[PATCH] drm/i915/gvt: set guest display buffer as readonly
Zhang, Tina
tina.zhang at intel.com
Thu Dec 12 08:51:09 UTC 2019
> -----Original Message-----
> From: Zhenyu Wang <zhenyuw at linux.intel.com>
> Sent: Thursday, December 12, 2019 4:15 PM
> To: intel-gvt-dev at lists.freedesktop.org
> Cc: Zhang, Tina <tina.zhang at intel.com>
> Subject: [PATCH] drm/i915/gvt: set guest display buffer as readonly
>
> We shouldn't allow write for exporsed guest display buffer which doesn't
> make sense. So explicitly set read only flag for display dmabuf allocated
> object.
>
> Fixes: e546e281d33d ("drm/i915/gvt: Dmabuf support for GVT-g")
> Cc: Tina Zhang <tina.zhang at intel.com>
> Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> ---
> drivers/gpu/drm/i915/gvt/dmabuf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c
> b/drivers/gpu/drm/i915/gvt/dmabuf.c
> index e451298d11c3..ee0f3094e6d0 100644
> --- a/drivers/gpu/drm/i915/gvt/dmabuf.c
> +++ b/drivers/gpu/drm/i915/gvt/dmabuf.c
> @@ -163,6 +163,7 @@ static struct drm_i915_gem_object
> *vgpu_create_gem(struct drm_device *dev,
> drm_gem_private_object_init(dev, &obj->base,
> roundup(info->size, PAGE_SIZE));
> i915_gem_object_init(obj, &intel_vgpu_gem_ops, &lock_class);
> + i915_gem_object_set_readonly(obj);
Looks good to me. Thanks.
BR,
Tina
>
> obj->read_domains = I915_GEM_DOMAIN_GTT;
> obj->write_domain = 0;
> --
> 2.24.0
More information about the intel-gvt-dev
mailing list