Skip to content

Commit

Permalink
drm/i915/gvt: set guest display buffer as readonly
Browse files Browse the repository at this point in the history
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: e546e28 ("drm/i915/gvt: Dmabuf support for GVT-g")
Cc: Tina Zhang <[email protected]>
Acked-by: Tina Zhang <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
zhenyw committed Dec 13, 2019
1 parent 6d44694 commit 4fc0a3c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/gvt/dmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4fc0a3c

Please sign in to comment.