drm/ssd130x: Synchronize access to dma-buf imported GEM BOs
Subsystems (3)
Javier Martinez Canillas
maintainerPATCH 1/1 drm/ssd130x: Synchronize access to dma-buf imported GEM BOs
Synchronize CPU access to GEM BOs with other drivers when updating the screen buffer. Imported DMA buffers might otherwise contain stale data.
Suggested-by Thomas Zimmermann <[email protected]>
Signed-off-by Javier Martinez Canillas <[email protected]>
---
drivers/gpu/drm/solomon/ssd130x.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/solomon/ssd130x.c +7 -0
@@ -555,11 +555,18 @@ static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb, const struct iosys_mif (!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;
Signature · 1 line
2.37.3
Hi
Am 27.09.22 um 11:52 schrieb Javier Martinez Canillas:
Quoted 5 lines
Synchronize CPU access to GEM BOs with other drivers when updating the screen buffer. Imported DMA buffers might otherwise contain stale data.
Suggested-by Thomas Zimmermann <[email protected]>Signed-off-by Javier Martinez Canillas <[email protected]>
Reviewed-by Thomas Zimmermann <[email protected]>
Quoted 28 lines
---
drivers/gpu/drm/solomon/ssd130x.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/solomon/ssd130x.c +7
-0@@ -555,11 +555,18 @@ static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb, const struct iosys_mif (!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;
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
Quoted 11 lines · Thomas Zimmermann
Hi
Am 27.09.22 um 11:52 schrieb Javier Martinez Canillas:
Quoted 5 lines
Synchronize CPU access to GEM BOs with other drivers when updating the screen buffer. Imported DMA buffers might otherwise contain stale data.
Suggested-by Thomas Zimmermann <[email protected]>Signed-off-by Javier Martinez Canillas <[email protected]>Reviewed-by Thomas Zimmermann <[email protected]>
Pushed to drm-misc (drm-misc-next). Thanks!
Signature · 5 lines
Best regards, Javier Martinez Canillas Core Platforms Red Hat