]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/vc4: Test for imported buffers with drm_gem_is_imported()
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 27 Feb 2026 13:31:11 +0000 (14:31 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 3 Mar 2026 08:58:07 +0000 (09:58 +0100)
Instead of testing import_attach for imported GEM buffers, invoke
drm_gem_is_imported() to do the test. The test itself does not change.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: "Maíra Canal" <mcanal@igalia.com>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Link: https://patch.msgid.link/20260227133113.235940-12-tzimmermann@suse.de
drivers/gpu/drm/vc4/vc4_bo.c
drivers/gpu/drm/vc4/vc4_gem.c

index 1f93bc5a3d02ebfd3800c3892444a0b22bc08dd8..f45ba47b4ba8645f371215c083d3ead3ddd5ffe8 100644 (file)
@@ -556,7 +556,7 @@ static void vc4_free_object(struct drm_gem_object *gem_bo)
        mutex_lock(&vc4->bo_lock);
        /* If the object references someone else's memory, we can't cache it.
         */
-       if (gem_bo->import_attach) {
+       if (drm_gem_is_imported(gem_bo)) {
                vc4_bo_destroy(bo);
                goto out;
        }
index ad8cbd727b801cfe61e97b92177f0286377ae358..2d3df5e621c1a2192656efd6fc8940ebb1ce991f 100644 (file)
@@ -1250,7 +1250,7 @@ int vc4_gem_madvise_ioctl(struct drm_device *dev, void *data,
        /* Not sure it's safe to purge imported BOs. Let's just assume it's
         * not until proven otherwise.
         */
-       if (gem_obj->import_attach) {
+       if (drm_gem_is_imported(gem_obj)) {
                DRM_DEBUG("madvise not supported on imported BOs\n");
                ret = -EINVAL;
                goto out_put_gem;