summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tiny/repaper.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/tiny/repaper.c')
-rw-r--r--drivers/gpu/drm/tiny/repaper.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
index 1c0e7169545b..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);
}
@@ -946,7 +939,7 @@ DEFINE_DRM_GEM_CMA_FOPS(repaper_fops);
static struct drm_driver repaper_driver = {
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
.fops = &repaper_fops,
- DRM_GEM_CMA_VMAP_DRIVER_OPS,
+ DRM_GEM_CMA_DRIVER_OPS_VMAP,
.name = "repaper",
.desc = "Pervasive Displays RePaper e-ink panels",
.date = "20170405",