diff options
author | Zhenyu Wang <zhenyuw@linux.intel.com> | 2019-12-12 16:46:14 +0800 |
---|---|---|
committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2019-12-13 11:15:25 +0800 |
commit | 4fc0a3ca721da2bfbab0fdf248bd76d7e6bc232f (patch) | |
tree | cb456f25d1d2e2d890b9e31d3df167a1fc4065a7 /drivers/gpu/drm/i915/gvt | |
parent | 6d44694dc7c72e82e0f45d114a9c9e3f3e2aeab7 (diff) | |
download | linux-4fc0a3ca721da2bfbab0fdf248bd76d7e6bc232f.tar.gz linux-4fc0a3ca721da2bfbab0fdf248bd76d7e6bc232f.tar.bz2 linux-4fc0a3ca721da2bfbab0fdf248bd76d7e6bc232f.zip |
drm/i915/gvt: set guest display buffer as readonly
We shouldn't allow write for exposed 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@intel.com>
Acked-by: Tina Zhang <tina.zhang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20191212084614.1100-1-zhenyuw@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/gvt')
-rw-r--r-- | drivers/gpu/drm/i915/gvt/dmabuf.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); obj->read_domains = I915_GEM_DOMAIN_GTT; obj->write_domain = 0; |