summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tiny/st7586.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2020-06-12 19:00:55 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2020-06-24 10:17:34 +0300
commit7e06886bbfca73717e45a0f20cdb4053793c191b (patch)
tree4608d9633f9afd2b2d69e83a65060c89d7e667c0 /drivers/gpu/drm/tiny/st7586.c
parente8411b7ede3bd59f45a7ad997536d235e9c71c36 (diff)
downloadlinux-7e06886bbfca73717e45a0f20cdb4053793c191b.tar.xz
drm/mipi-dbi: Remove ->enabled
The atomic helpers try really hard to not lose track of things, duplicating enabled tracking in the driver is at best confusing. Double-enabling or disabling is a bug in atomic helpers. In the fb_dirty function we can just assume that the fb always exists, simple display pipe helpers guarantee that the crtc is only enabled together with the output, so we always have a primary plane around. Now in the update function we need to be a notch more careful, since that can also get called when the crtc is off. And we don't want to upload frames when that's the case, so filter that out too. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Acked-by: David Lechner <david@lechnology.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: David Lechner <david@lechnology.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200612160056.2082681-7-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/tiny/st7586.c')
-rw-r--r--drivers/gpu/drm/tiny/st7586.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpu/drm/tiny/st7586.c b/drivers/gpu/drm/tiny/st7586.c
index 1311e5df8721..d05de03891f8 100644
--- a/drivers/gpu/drm/tiny/st7586.c
+++ b/drivers/gpu/drm/tiny/st7586.c
@@ -118,9 +118,6 @@ static void st7586_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
struct mipi_dbi *dbi = &dbidev->dbi;
int start, end, idx, ret = 0;
- if (!dbidev->enabled)
- return;
-
if (!drm_dev_enter(fb->dev, &idx))
return;
@@ -161,6 +158,9 @@ static void st7586_pipe_update(struct drm_simple_display_pipe *pipe,
struct drm_plane_state *state = pipe->plane.state;
struct drm_rect rect;
+ if (!pipe->crtc.state->active)
+ return;
+
if (drm_atomic_helper_damage_merged(old_state, state, &rect))
st7586_fb_dirty(state->fb, &rect);
}
@@ -237,7 +237,6 @@ static void st7586_pipe_enable(struct drm_simple_display_pipe *pipe,
msleep(100);
- dbidev->enabled = true;
st7586_fb_dirty(fb, &rect);
mipi_dbi_command(dbi, MIPI_DCS_SET_DISPLAY_ON);
@@ -258,11 +257,7 @@ static void st7586_pipe_disable(struct drm_simple_display_pipe *pipe)
DRM_DEBUG_KMS("\n");
- if (!dbidev->enabled)
- return;
-
mipi_dbi_command(&dbidev->dbi, MIPI_DCS_SET_DISPLAY_OFF);
- dbidev->enabled = false;
}
static const u32 st7586_formats[] = {