Skip to content

Commit e91eb3a

Browse files
committed
drm/etnaviv: 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> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Russell King <linux+etnaviv@armlinux.org.uk> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: etnaviv@lists.freedesktop.org Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Link: https://lore.kernel.org/r/20250317131923.238374-4-tzimmermann@suse.de
1 parent 970003d commit e91eb3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)
6565
struct iosys_map map = IOSYS_MAP_INIT_VADDR(etnaviv_obj->vaddr);
6666

6767
if (etnaviv_obj->vaddr)
68-
dma_buf_vunmap_unlocked(etnaviv_obj->base.import_attach->dmabuf, &map);
68+
dma_buf_vunmap_unlocked(etnaviv_obj->base.dma_buf, &map);
6969

7070
/* Don't drop the pages for imported dmabuf, as they are not
7171
* ours, just free the array we allocated:
@@ -82,7 +82,7 @@ static void *etnaviv_gem_prime_vmap_impl(struct etnaviv_gem_object *etnaviv_obj)
8282

8383
lockdep_assert_held(&etnaviv_obj->lock);
8484

85-
ret = dma_buf_vmap(etnaviv_obj->base.import_attach->dmabuf, &map);
85+
ret = dma_buf_vmap(etnaviv_obj->base.dma_buf, &map);
8686
if (ret)
8787
return NULL;
8888
return map.vaddr;

0 commit comments

Comments
 (0)