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/drm_mipi_dbi.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/drm_mipi_dbi.c')
-rw-r--r-- | drivers/gpu/drm/drm_mipi_dbi.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index b808de61c5bc..0ef5e81ba5e1 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -321,12 +321,10 @@ EXPORT_SYMBOL(mipi_dbi_pipe_mode_valid); void mipi_dbi_pipe_update(struct drm_simple_display_pipe *pipe, struct drm_plane_state *old_state) { - struct iosys_map map[DRM_FORMAT_MAX_PLANES] = { }; - struct iosys_map data[DRM_FORMAT_MAX_PLANES] = { }; 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_rect rect; - int ret; if (!pipe->crtc.state->active) return; @@ -334,14 +332,8 @@ void mipi_dbi_pipe_update(struct drm_simple_display_pipe *pipe, if (WARN_ON(!fb)) return; - ret = drm_gem_fb_vmap(fb, map, data); - if (ret) - return; - if (drm_atomic_helper_damage_merged(old_state, state, &rect)) - mipi_dbi_fb_dirty(&data[0], fb, &rect); - - drm_gem_fb_vunmap(fb, map); + mipi_dbi_fb_dirty(&shadow_plane_state->data[0], fb, &rect); } EXPORT_SYMBOL(mipi_dbi_pipe_update); @@ -362,6 +354,7 @@ void mipi_dbi_enable_flush(struct mipi_dbi_dev *dbidev, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { + struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); struct drm_framebuffer *fb = plane_state->fb; struct drm_rect rect = { .x1 = 0, @@ -369,22 +362,14 @@ void mipi_dbi_enable_flush(struct mipi_dbi_dev *dbidev, .y1 = 0, .y2 = fb->height, }; - struct iosys_map map[DRM_FORMAT_MAX_PLANES] = { }; - struct iosys_map data[DRM_FORMAT_MAX_PLANES] = { }; - int idx, ret; + int idx; if (!drm_dev_enter(&dbidev->drm, &idx)) return; - ret = drm_gem_fb_vmap(fb, map, data); - if (ret) - goto err_drm_dev_exit; - - mipi_dbi_fb_dirty(&data[0], fb, &rect); + mipi_dbi_fb_dirty(&shadow_plane_state->data[0], fb, &rect); backlight_enable(dbidev->backlight); - drm_gem_fb_vunmap(fb, map); -err_drm_dev_exit: drm_dev_exit(idx); } EXPORT_SYMBOL(mipi_dbi_enable_flush); |