drm/i915/gvt: Keep obj->dma_buf link NULL during exporting
"Linux Kernel Mailing List" <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.head |
|---|---|
| Message-ID | <[email protected]> |
Web: https://git.kernel.org/torvalds/c/412718a10926f77052d8107cb3c5d9dbc96cf8c9 Commit: 412718a10926f77052d8107cb3c5d9dbc96cf8c9 Parent: cc4f8fc72eb949889caa1d574d3db65fa9d71a12 Refname: refs/heads/master Author: Tina Zhang <[email protected]> AuthorDate: Mon Jan 15 14:41:42 2018 +0800 Committer: Rodrigo Vivi <[email protected]> CommitDate: Thu Feb 1 07:31:58 2018 -0800 drm/i915/gvt: Keep obj->dma_buf link NULL during exporting According to commit (319c933c71f3dbdb2b3274d1634d3494c70efa06) Author: Daniel Vetter <[email protected]> Date: Thu Aug 15 00:02:46 2013 +0200 drm/prime: proper locking+refcounting for obj->dma_buf link obj->dma_buf link should be reinstated at import time. Gvt-g dma-buf buffer exposeing might be simpler, as there won't be much racing during Gvt-g dma-buf exposing. In other words, Gvt-g dma-buf exposing can guarantee exposing happens before gem close ioctl, and Gvt-g is the only exporter of the guest framebuffer. But following the drm prime scheme can give Gvt-g a chance to increase a dma-buf reference count during importing. Otherwise, we have to increase the reference during exposing, which will break the case that the only reference userspace has held was through the dma-buf fd and the reference count is one. Signed-off-by: Tina Zhang <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Zhenyu Wang <[email protected]> Cc: Zhi Wang <[email protected]> Cc: Hang Yuan <[email protected]> Cc: Gerd Hoffmann <[email protected]> Signed-off-by: Zhenyu Wang <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> --- drivers/gpu/drm/i915/gvt/dmabuf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c index 2ab584f97dfb..2fb7b34ef561 100644 --- a/drivers/gpu/drm/i915/gvt/dmabuf.c +++ b/drivers/gpu/drm/i915/gvt/dmabuf.c @@ -472,7 +472,6 @@ int intel_vgpu_get_dmabuf(struct intel_vgpu *vgpu, unsigned int dmabuf_id) ret = PTR_ERR(dmabuf); goto out_free_gem; } - obj->base.dma_buf = dmabuf; i915_gem_object_put(obj); -- To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html