[PATCH 3/5] drm/gem: Handle drm_gem_{begin,end}_cpu_access() in shadow-plane helpers
Javier Martinez Canillas
javierm at redhat.com
Mon Oct 17 12:44:52 UTC 2022
Hello Thomas,
On 10/17/22 13:15, Thomas Zimmermann wrote:
> Handle drm_gem_{begin,end}_cpu_access() in shadow-plane helpers during
> a commit. The functions synchronizes imported dma-buf objects with the
> exporter's state. If this fail (as signalled by an error code), atomic-
> commit helpers can now still abort the commit.
>
> Several drivers already reserved CPU access in their atomic update
> handlers. Remove the respective calls, as they are no longer required.
> All other drivers with shadow planes that never bothered with these
> functions now correctly reserve CPU access to the framebuffer memory.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---
[...]
> diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
> index f2795f90ea693..51e06eb76c613 100644
> --- a/drivers/gpu/drm/solomon/ssd130x.c
> +++ b/drivers/gpu/drm/solomon/ssd130x.c
> @@ -544,7 +544,6 @@ static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb, const struct iosys_m
> struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->dev);
> struct iosys_map dst;
> unsigned int dst_pitch;
> - int ret = 0;
> u8 *buf = NULL;
>
> /* Align y to display page boundaries */
> @@ -556,21 +555,14 @@ static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb, const struct iosys_m
> if (!buf)
> return -ENOMEM;
>
> - ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE);
> - if (ret)
> - goto out_free;
> -
> iosys_map_set_vaddr(&dst, buf);
> drm_fb_xrgb8888_to_mono(&dst, &dst_pitch, vmap, fb, rect);
>
> - drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
> -
> ssd130x_update_rect(ssd130x, buf, rect);
>
> -out_free:
> kfree(buf);
>
> - return ret;
> + return 0;
> }
>
For ssd130x,
Acked-by: Javier Martinez Canillas <javierm at redhat.com>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
More information about the dri-devel
mailing list