diff mbox series

[08/10] drm/fb-dma-helper: Test for imported buffers with drm_gem_is_imported()

Message ID 20250226172457.217725-9-tzimmermann@suse.de (mailing list archive)
State New
Headers show
Series drm: Hide import_attach from GEM code and helpers | expand

Commit Message

Thomas Zimmermann Feb. 26, 2025, 5:03 p.m. UTC
Instead of testing import_attach for imported GEM buffers, invoke
drm_gem_is_imported() to do the test.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/drm_fb_dma_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anusha Srivatsa Feb. 28, 2025, 4:18 p.m. UTC | #1
On Wed, Feb 26, 2025 at 12:28 PM Thomas Zimmermann <tzimmermann@suse.de>
wrote:

> Instead of testing import_attach for imported GEM buffers, invoke
> drm_gem_is_imported() to do the test.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>  drivers/gpu/drm/drm_fb_dma_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_fb_dma_helper.c
> b/drivers/gpu/drm/drm_fb_dma_helper.c
> index e1d61a65210b..2c4dc7ebc0c3 100644
> --- a/drivers/gpu/drm/drm_fb_dma_helper.c
> +++ b/drivers/gpu/drm/drm_fb_dma_helper.c
> @@ -178,7 +178,7 @@ int drm_fb_dma_get_scanout_buffer(struct drm_plane
> *plane,
>         dma_obj = drm_fb_dma_get_gem_obj(fb, 0);
>
>         /* Buffer should be accessible from the CPU */
> -       if (dma_obj->base.import_attach)
> +       if (drm_gem_is_imported(&dma_obj->base))
>                 return -ENODEV;
>
>
Reviewed-by: Anusha Srivatsa <asrivats@redhat.com>

        /* Buffer should be already mapped to CPU */
> --
> 2.48.1
>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_fb_dma_helper.c b/drivers/gpu/drm/drm_fb_dma_helper.c
index e1d61a65210b..2c4dc7ebc0c3 100644
--- a/drivers/gpu/drm/drm_fb_dma_helper.c
+++ b/drivers/gpu/drm/drm_fb_dma_helper.c
@@ -178,7 +178,7 @@  int drm_fb_dma_get_scanout_buffer(struct drm_plane *plane,
 	dma_obj = drm_fb_dma_get_gem_obj(fb, 0);
 
 	/* Buffer should be accessible from the CPU */
-	if (dma_obj->base.import_attach)
+	if (drm_gem_is_imported(&dma_obj->base))
 		return -ENODEV;
 
 	/* Buffer should be already mapped to CPU */