[PATCH] drm/i915/gvt: set guest display buffer as readonly
Zhenyu Wang
zhenyuw at linux.intel.com
Fri Dec 13 03:11:21 UTC 2019
On 2019.12.12 08:51:09 +0000, Zhang, Tina wrote:
>
>
> > -----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.
>
I'll take this as acked-by. Thanks
> BR,
> Tina
> >
> > obj->read_domains = I915_GEM_DOMAIN_GTT;
> > obj->write_domain = 0;
> > --
> > 2.24.0
>
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20191213/fa35e833/attachment.sig>
More information about the intel-gvt-dev
mailing list