From: Thomas Zimmermann Date: Mon, 17 Mar 2025 13:06:46 +0000 (+0100) Subject: drm/panfrost: Test for imported buffers with drm_gem_is_imported() X-Git-Tag: v6.16-rc1~144^2~16^2~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64e21b80ded95e919060a2043c52f58ecb281aac;p=thirdparty%2Flinux.git drm/panfrost: 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. Signed-off-by: Thomas Zimmermann Cc: Boris Brezillon Cc: Rob Herring Cc: Steven Price Reviewed-by: Steven Price Link: https://lore.kernel.org/r/20250317131923.238374-9-tzimmermann@suse.de --- diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index 8e0ff3efede7e..963f04ba2de65 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -200,7 +200,7 @@ static enum drm_gem_object_status panfrost_gem_status(struct drm_gem_object *obj struct panfrost_gem_object *bo = to_panfrost_bo(obj); enum drm_gem_object_status res = 0; - if (bo->base.base.import_attach || bo->base.pages) + if (drm_gem_is_imported(&bo->base.base) || bo->base.pages) res |= DRM_GEM_OBJECT_RESIDENT; if (bo->base.madv == PANFROST_MADV_DONTNEED)