[8/8] drm/tiny/repaper: Drop edp->enabled
diff mbox series

Message ID 20200612160056.2082681-8-daniel.vetter@ffwll.ch
State New
Headers show
Series
  • [1/8] drm/atomic-helper: reset vblank on crtc reset
Related show

Commit Message

Daniel Vetter June 12, 2020, 4 p.m. UTC
Same patch as the mipi-dbi one, atomic tracks this for us already, we
just have to check the right thing.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
---
 drivers/gpu/drm/tiny/repaper.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Comments

Noralf Trønnes June 13, 2020, 1:43 p.m. UTC | #1
Den 12.06.2020 18.00, skrev Daniel Vetter:
> Same patch as the mipi-dbi one, atomic tracks this for us already, we
> just have to check the right thing.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: "Noralf Trønnes" <noralf@tronnes.org>
> ---

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Daniel Vetter June 24, 2020, 7:15 a.m. UTC | #2
On Sat, Jun 13, 2020 at 03:43:23PM +0200, Noralf Trønnes wrote:
> 
> 
> Den 12.06.2020 18.00, skrev Daniel Vetter:
> > Same patch as the mipi-dbi one, atomic tracks this for us already, we
> > just have to check the right thing.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: "Noralf Trønnes" <noralf@tronnes.org>
> > ---
> 
> Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

Thanks for your review, patch applied.
-Daniel

Patch
diff mbox series

diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
index 08164e2a2d13..2e01cf0a9876 100644
--- a/drivers/gpu/drm/tiny/repaper.c
+++ b/drivers/gpu/drm/tiny/repaper.c
@@ -88,7 +88,6 @@  struct repaper_epd {
 	u8 *line_buffer;
 	void *current_frame;
 
-	bool enabled;
 	bool cleared;
 	bool partial;
 };
@@ -538,9 +537,6 @@  static int repaper_fb_dirty(struct drm_framebuffer *fb)
 	int idx, ret = 0;
 	u8 *buf = NULL;
 
-	if (!epd->enabled)
-		return 0;
-
 	if (!drm_dev_enter(fb->dev, &idx))
 		return -ENODEV;
 
@@ -786,7 +782,6 @@  static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe,
 	 */
 	repaper_write_val(spi, 0x02, 0x04);
 
-	epd->enabled = true;
 	epd->partial = false;
 out_exit:
 	drm_dev_exit(idx);
@@ -805,13 +800,8 @@  static void repaper_pipe_disable(struct drm_simple_display_pipe *pipe)
 	 * unplug.
 	 */
 
-	if (!epd->enabled)
-		return;
-
 	DRM_DEBUG_DRIVER("\n");
 
-	epd->enabled = false;
-
 	/* Nothing frame */
 	for (line = 0; line < epd->height; line++)
 		repaper_one_line(epd, 0x7fffu, NULL, 0x00, NULL,
@@ -859,6 +849,9 @@  static void repaper_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))
 		repaper_fb_dirty(state->fb);
 }