diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2022-12-02 15:56:43 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2022-12-05 16:21:18 +0300 |
commit | 69c63e88ea9dc44382d508a7608495dec5eb69f9 (patch) | |
tree | 317a21e1f52fccdbcf1b1686d27f0dcfb844f323 /drivers/gpu/drm/tiny/st7586.c | |
parent | e7caf04d49533fb38d22379be0278a34aad8826f (diff) | |
download | linux-69c63e88ea9dc44382d508a7608495dec5eb69f9.tar.xz |
drm/mipi-dbi: Use shadow-plane mappings
Use the buffer mappings provided by shadow-plane helpers. As the
mappings are established while the commit can still fail, errors
are now reported correctly to callers.
v2:
* use shadow-plane state directly (Noralf)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Tested-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Noralf Trønnes <noralf@tronnes.org> # drm/tiny/mi0283qt
Link: https://patchwork.freedesktop.org/patch/msgid/20221202125644.7917-8-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/tiny/st7586.c')
-rw-r--r-- | drivers/gpu/drm/tiny/st7586.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpu/drm/tiny/st7586.c b/drivers/gpu/drm/tiny/st7586.c index 76b13cefc904..53dca9272d4d 100644 --- a/drivers/gpu/drm/tiny/st7586.c +++ b/drivers/gpu/drm/tiny/st7586.c @@ -153,19 +153,15 @@ static void st7586_pipe_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *old_state) { struct drm_plane_state *state = pipe->plane.state; + struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state); struct drm_framebuffer *fb = state->fb; - struct drm_gem_dma_object *dma_obj; - struct iosys_map src; struct drm_rect rect; if (!pipe->crtc.state->active) return; - dma_obj = drm_fb_dma_get_gem_obj(fb, 0); - iosys_map_set_vaddr(&src, dma_obj->vaddr); - if (drm_atomic_helper_damage_merged(old_state, state, &rect)) - st7586_fb_dirty(&src, fb, &rect); + st7586_fb_dirty(&shadow_plane_state->data[0], fb, &rect); } static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, @@ -173,6 +169,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_plane_state *plane_state) { struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); + struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); struct drm_framebuffer *fb = plane_state->fb; struct mipi_dbi *dbi = &dbidev->dbi; struct drm_rect rect = { @@ -181,8 +178,6 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, .y1 = 0, .y2 = fb->height, }; - struct drm_gem_dma_object *dma_obj; - struct iosys_map src; int idx, ret; u8 addr_mode; @@ -242,10 +237,7 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe, msleep(100); - dma_obj = drm_fb_dma_get_gem_obj(fb, 0); - iosys_map_set_vaddr(&src, dma_obj->vaddr); - - st7586_fb_dirty(&src, fb, &rect); + st7586_fb_dirty(&shadow_plane_state->data[0], fb, &rect); mipi_dbi_command(dbi, MIPI_DCS_SET_DISPLAY_ON); out_exit: |