Skip to contentSkip to conversation

drm/exynos: Test for imported buffers with drm_gem_is_imported()

PATCH In review Thomas Zimmermann 1 participant 1 message Apr 14, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/11 drm/exynos: Test for imported buffers with drm_gem_is_imported()

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.

Cc Inki Dae <[email protected]>
Cc Seung-Woo Kim <[email protected]>
Cc Kyungmin Park <[email protected]>
---
 drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_gem.c +2 -2
index 4787fee4696f..c549ba5cda5e 100644
@@ -121,7 +121,7 @@ void exynos_drm_gem_destroy(struct exynos_drm_gem *exynos_gem)
 	 * the region will be released by exporter
 	 * once dmabuf's refcount becomes 0.
 	 */
-	if (obj->import_attach)
+	if (drm_gem_is_imported(obj))
 		drm_prime_gem_destroy(obj, exynos_gem->sgt);
 	else
 		exynos_drm_free_buf(exynos_gem);
@@ -365,7 +365,7 @@ static int exynos_drm_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct
 	struct exynos_drm_gem *exynos_gem = to_exynos_gem(obj);
 	int ret;
 
-	if (obj->import_attach)
+	if (drm_gem_is_imported(obj))
 		return dma_buf_mmap(obj->dma_buf, vma, 0);
 
 	vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
Signature · 1 line
2.49.0