From: Thomas Zimmermann Date: Wed, 26 Feb 2025 17:03:09 +0000 (+0100) Subject: drm/gem-framebuffer: Test for imported buffers with drm_gem_is_imported() X-Git-Tag: v6.15-rc1~120^2~13^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d672f483e5dc99053b9c94bd0e5f504c2e3f758;p=thirdparty%2Fkernel%2Flinux.git drm/gem-framebuffer: 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. Signed-off-by: Thomas Zimmermann Reviewed-by: Anusha Srivatsa Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20250226172457.217725-7-tzimmermann@suse.de --- diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index 185534f56bab9..2bf606ba24cd1 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -429,7 +429,7 @@ static void __drm_gem_fb_end_cpu_access(struct drm_framebuffer *fb, enum dma_dat if (!obj) continue; import_attach = obj->import_attach; - if (!import_attach) + if (!drm_gem_is_imported(obj)) continue; ret = dma_buf_end_cpu_access(import_attach->dmabuf, dir); if (ret) @@ -466,7 +466,7 @@ int drm_gem_fb_begin_cpu_access(struct drm_framebuffer *fb, enum dma_data_direct goto err___drm_gem_fb_end_cpu_access; } import_attach = obj->import_attach; - if (!import_attach) + if (!drm_gem_is_imported(obj)) continue; ret = dma_buf_begin_cpu_access(import_attach->dmabuf, dir); if (ret)