aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rcar-du/rcar_du_kms.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2018-11-24 20:19:52 +0200
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2019-01-14 03:51:25 +0200
commitb8a43032a7b8d7e8e7c65dfa987d8374a0de7a6e (patch)
tree481decdae9f748da417118bb8bbb00d85e1515b0 /drivers/gpu/drm/rcar-du/rcar_du_kms.c
parentdrm: rcar-du: Replace EXT_CTRL_REGS feature flag with generation check (diff)
downloadlinux-dev-b8a43032a7b8d7e8e7c65dfa987d8374a0de7a6e.tar.xz
linux-dev-b8a43032a7b8d7e8e7c65dfa987d8374a0de7a6e.zip
drm: rcar-du: Move CRTC outputs bitmask to private CRTC state
The rcar_du_crtc outputs field stores a bitmask of the outputs driven by the CRTC. This changes based on the configuration requested by userspace, and is used for the sole purpose of configuring the hardware. The field thus belongs to the CRTC state. Move it to the rcar_du_crtc_state structure. As a result the rcar_du_crtc_route_output() function loses most of its purpose. In order to remove it, move dpad0_source calculation to rcar_du_atomic_commit_tail(), until the field gets moved to a state structure. In order to simplify the rcar_du_group_set_routing() implementation, we also store the DPAD1 source in a new dpad1_source field which will move to a state structure with dpad0_source. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du/rcar_du_kms.c')
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_kms.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
index 9c7007d45408..d8ef3a86b0b2 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
@@ -278,6 +278,28 @@ static int rcar_du_atomic_check(struct drm_device *dev,
static void rcar_du_atomic_commit_tail(struct drm_atomic_state *old_state)
{
struct drm_device *dev = old_state->dev;
+ struct rcar_du_device *rcdu = dev->dev_private;
+ struct drm_crtc_state *crtc_state;
+ struct drm_crtc *crtc;
+ unsigned int i;
+
+ /*
+ * Store RGB routing to DPAD0 and DPAD1, the hardware will be configured
+ * when starting the CRTCs.
+ */
+ rcdu->dpad1_source = -1;
+
+ for_each_new_crtc_in_state(old_state, crtc, crtc_state, i) {
+ struct rcar_du_crtc_state *rcrtc_state =
+ to_rcar_crtc_state(crtc_state);
+ struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
+
+ if (rcrtc_state->outputs & BIT(RCAR_DU_OUTPUT_DPAD0))
+ rcdu->dpad0_source = rcrtc->index;
+
+ if (rcrtc_state->outputs & BIT(RCAR_DU_OUTPUT_DPAD1))
+ rcdu->dpad1_source = rcrtc->index;
+ }
/* Apply the atomic update. */
drm_atomic_helper_commit_modeset_disables(dev, old_state);