[Intel-gfx] [RFC PATCH 1/2] drm/i915: Add a function to mmap framebuffer obj
Andi Shyti
andi.shyti at linux.intel.com
Mon Mar 13 18:37:44 UTC 2023
Hi Nirmoy,
[...]
> +int i915_gem_fb_mmap(struct drm_i915_gem_object *obj, struct vm_area_struct *vma)
> +{
> + struct drm_i915_private *i915 = to_i915(obj->base.dev);
> + struct drm_device *dev = &i915->drm;
> + struct i915_mmap_offset *mmo = NULL;
> + enum i915_mmap_type mmap_type;
> + struct i915_ggtt *ggtt = to_gt(i915)->ggtt;
> +
> + if (drm_dev_is_unplugged(dev))
> + return -ENODEV;
> +
> + mmap_type = i915_ggtt_has_aperture(ggtt) ? I915_MMAP_TYPE_GTT : I915_MMAP_TYPE_WC;
> + mmo = mmap_offset_attach(obj, mmap_type, NULL);
> + if (!mmo)
> + return -ENODEV;
> +
> + obj = i915_gem_object_get(mmo->obj);
Where do we decrease the refcount?
Andi
> + return i915_gem_object_mmap(obj, mmo, vma);
> +}
> +
More information about the Intel-gfx
mailing list