[PATCH 01/15] drm/armada: Test for imported buffers with drm_gem_is_imported()
Thomas Zimmermann
tzimmermann at suse.de
Mon Mar 17 13:06:39 UTC 2025
Instead of testing import_attach for imported GEM buffers, invoke
drm_gem_is_imported() to do the test. The helper tests the dma_buf
itself while import_attach is just an artifact of the import. Prepares
to make import_attach optional.
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
Cc: Russell King <linux at armlinux.org.uk>
---
drivers/gpu/drm/armada/armada_fb.c | 2 +-
drivers/gpu/drm/armada/armada_gem.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_fb.c b/drivers/gpu/drm/armada/armada_fb.c
index cf2e88218dc0..67af4bd8797f 100644
--- a/drivers/gpu/drm/armada/armada_fb.c
+++ b/drivers/gpu/drm/armada/armada_fb.c
@@ -110,7 +110,7 @@ struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
goto err;
}
- if (obj->obj.import_attach && !obj->sgt) {
+ if (drm_gem_is_imported(&obj->obj) && !obj->sgt) {
ret = armada_gem_map_import(obj);
if (ret)
goto err_unref;
diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
index 1a1680d71486..bd4209b6a893 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -63,7 +63,7 @@ void armada_gem_free_object(struct drm_gem_object *obj)
iounmap(dobj->addr);
}
- if (dobj->obj.import_attach) {
+ if (drm_gem_is_imported(&dobj->obj)) {
/* We only ever display imported data */
if (dobj->sgt)
dma_buf_unmap_attachment_unlocked(dobj->obj.import_attach,
--
2.48.1
More information about the dri-devel
mailing list