mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
drm/prime: Use dma_buf from GEM object instance
Avoid dereferencing struct drm_gem_object.import_attach for the imported dma-buf. The dma_buf field in the GEM object instance refers to the same buffer. Prepares to make import_attach optional. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Anusha Srivatsa <asrivats@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250226172457.217725-11-tzimmermann@suse.de
This commit is contained in:
parent
0695d8fc11
commit
f83a9b8c7f
1 changed files with 1 additions and 7 deletions
|
@ -453,13 +453,7 @@ struct dma_buf *drm_gem_prime_handle_to_dmabuf(struct drm_device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&dev->object_name_lock);
|
mutex_lock(&dev->object_name_lock);
|
||||||
/* re-export the original imported object */
|
/* re-export the original imported/exported object */
|
||||||
if (obj->import_attach) {
|
|
||||||
dmabuf = obj->import_attach->dmabuf;
|
|
||||||
get_dma_buf(dmabuf);
|
|
||||||
goto out_have_obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj->dma_buf) {
|
if (obj->dma_buf) {
|
||||||
get_dma_buf(obj->dma_buf);
|
get_dma_buf(obj->dma_buf);
|
||||||
dmabuf = obj->dma_buf;
|
dmabuf = obj->dma_buf;
|
||||||
|
|
Loading…
Add table
Reference in a new issue