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 <tzimmerm...@suse.de>
Cc: Inki Dae <inki....@samsung.com>
Cc: Seung-Woo Kim <sw0312....@samsung.com>
Cc: Kyungmin Park <kyungmin.p...@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c 
b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 4787fee4696f..c549ba5cda5e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -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);
-- 
2.48.1

Reply via email to