Skip to content

Commit f83a9b8

Browse files
author
Thomas Zimmermann
committed
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
1 parent 0695d8f commit f83a9b8

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

drivers/gpu/drm/drm_prime.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,7 @@ struct dma_buf *drm_gem_prime_handle_to_dmabuf(struct drm_device *dev,
453453
}
454454

455455
mutex_lock(&dev->object_name_lock);
456-
/* re-export the original imported object */
457-
if (obj->import_attach) {
458-
dmabuf = obj->import_attach->dmabuf;
459-
get_dma_buf(dmabuf);
460-
goto out_have_obj;
461-
}
462-
456+
/* re-export the original imported/exported object */
463457
if (obj->dma_buf) {
464458
get_dma_buf(obj->dma_buf);
465459
dmabuf = obj->dma_buf;

0 commit comments

Comments
 (0)