Commit 6ea22ab4 authored by Laurent Pinchart's avatar Laurent Pinchart

drm: rcar-du: Remove local CRTC enabled state

The atomic framework guarantees that the CRTC enable and disable
functions will only be called when needed, there's no need to duplicate
the CRTC state check. By replacing the local CRTC enabled state check at
resume time with the CRTC active state we can remove the local CRTC
enabled state altogether.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
parent c1d4b38c
...@@ -418,7 +418,7 @@ void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc) ...@@ -418,7 +418,7 @@ void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc)
{ {
unsigned int i; unsigned int i;
if (!rcrtc->enabled) if (!rcrtc->crtc.state->active)
return; return;
rcar_du_crtc_get(rcrtc); rcar_du_crtc_get(rcrtc);
...@@ -445,26 +445,17 @@ static void rcar_du_crtc_enable(struct drm_crtc *crtc) ...@@ -445,26 +445,17 @@ static void rcar_du_crtc_enable(struct drm_crtc *crtc)
{ {
struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc); struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
if (rcrtc->enabled)
return;
rcar_du_crtc_get(rcrtc); rcar_du_crtc_get(rcrtc);
rcar_du_crtc_start(rcrtc); rcar_du_crtc_start(rcrtc);
rcrtc->enabled = true;
} }
static void rcar_du_crtc_disable(struct drm_crtc *crtc) static void rcar_du_crtc_disable(struct drm_crtc *crtc)
{ {
struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc); struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
if (!rcrtc->enabled)
return;
rcar_du_crtc_stop(rcrtc); rcar_du_crtc_stop(rcrtc);
rcar_du_crtc_put(rcrtc); rcar_du_crtc_put(rcrtc);
rcrtc->enabled = false;
rcrtc->outputs = 0; rcrtc->outputs = 0;
} }
...@@ -589,7 +580,6 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index) ...@@ -589,7 +580,6 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index)
rcrtc->group = rgrp; rcrtc->group = rgrp;
rcrtc->mmio_offset = mmio_offsets[index]; rcrtc->mmio_offset = mmio_offsets[index];
rcrtc->index = index; rcrtc->index = index;
rcrtc->enabled = false;
ret = drm_crtc_init_with_planes(rcdu->ddev, crtc, ret = drm_crtc_init_with_planes(rcdu->ddev, crtc,
&rgrp->planes[index % 2].plane, &rgrp->planes[index % 2].plane,
......
...@@ -33,7 +33,6 @@ struct rcar_du_group; ...@@ -33,7 +33,6 @@ struct rcar_du_group;
* @event: event to post when the pending page flip completes * @event: event to post when the pending page flip completes
* @flip_wait: wait queue used to signal page flip completion * @flip_wait: wait queue used to signal page flip completion
* @outputs: bitmask of the outputs (enum rcar_du_output) driven by this CRTC * @outputs: bitmask of the outputs (enum rcar_du_output) driven by this CRTC
* @enabled: whether the CRTC is enabled, used to control system resume
* @group: CRTC group this CRTC belongs to * @group: CRTC group this CRTC belongs to
*/ */
struct rcar_du_crtc { struct rcar_du_crtc {
...@@ -49,7 +48,6 @@ struct rcar_du_crtc { ...@@ -49,7 +48,6 @@ struct rcar_du_crtc {
wait_queue_head_t flip_wait; wait_queue_head_t flip_wait;
unsigned int outputs; unsigned int outputs;
bool enabled;
struct rcar_du_group *group; struct rcar_du_group *group;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment