···9090 } props;91919292 unsigned int dpad0_source;9393+ unsigned int vspd1_sink;9494+9395 struct rcar_du_lvdsenc *lvds[RCAR_DU_MAX_LVDS];94969597 struct {
+14-10
drivers/gpu/drm/rcar-du/rcar_du_group.c
···4949 u32 defr8 = DEFR8_CODE | DEFR8_DEFE8;50505151 /* The DEFR8 register for the first group also controls RGB output5252- * routing to DPAD0 for DU instances that support it.5252+ * routing to DPAD0 and VSPD1 routing to DU0/1/2 for DU instances that5353+ * support it.5354 */5454- if (rgrp->dev->info->routes[RCAR_DU_OUTPUT_DPAD0].possible_crtcs > 1 &&5555- rgrp->index == 0)5656- defr8 |= DEFR8_DRGBS_DU(rgrp->dev->dpad0_source);5555+ if (rgrp->index == 0) {5656+ if (rgrp->dev->info->routes[RCAR_DU_OUTPUT_DPAD0].possible_crtcs > 1)5757+ defr8 |= DEFR8_DRGBS_DU(rgrp->dev->dpad0_source);5858+ if (rgrp->dev->vspd1_sink == 2)5959+ defr8 |= DEFR8_VSCS;6060+ }57615862 rcar_du_group_write(rgrp, DEFR8, defr8);5963}···166162 __rcar_du_group_start_stop(rgrp, true);167163}168164169169-static int rcar_du_set_dpad0_routing(struct rcar_du_device *rcdu)165165+int rcar_du_set_dpad0_vsp1_routing(struct rcar_du_device *rcdu)170166{171167 int ret;172168173169 if (!rcar_du_has(rcdu, RCAR_DU_FEATURE_EXT_CTRL_REGS))174170 return 0;175171176176- /* RGB output routing to DPAD0 is configured in the DEFR8 register of177177- * the first group. As this function can be called with the DU0 and DU1178178- * CRTCs disabled, we need to enable the first group clock before179179- * accessing the register.172172+ /* RGB output routing to DPAD0 and VSP1D routing to DU0/1/2 are173173+ * configured in the DEFR8 register of the first group. As this function174174+ * can be called with the DU0 and DU1 CRTCs disabled, we need to enable175175+ * the first group clock before accessing the register.180176 */181177 ret = clk_prepare_enable(rcdu->crtcs[0].clock);182178 if (ret < 0)···207203208204 rcar_du_group_write(rgrp, DORCR, dorcr);209205210210- return rcar_du_set_dpad0_routing(rgrp->dev);206206+ return rcar_du_set_dpad0_vsp1_routing(rgrp->dev);211207}
···217217 */218218219219static bool rcar_du_plane_needs_realloc(struct rcar_du_plane *plane,220220- struct rcar_du_plane_state *state)220220+ struct rcar_du_plane_state *new_state)221221{222222- const struct rcar_du_format_info *cur_format;222222+ struct rcar_du_plane_state *cur_state;223223224224- cur_format = to_rcar_plane_state(plane->plane.state)->format;224224+ cur_state = to_rcar_plane_state(plane->plane.state);225225226226 /* Lowering the number of planes doesn't strictly require reallocation227227 * as the extra hardware plane will be freed when committing, but doing228228 * so could lead to more fragmentation.229229 */230230- return !cur_format || cur_format->planes != state->format->planes;230230+ if (!cur_state->format ||231231+ cur_state->format->planes != new_state->format->planes)232232+ return true;233233+234234+ /* Reallocate hardware planes if the source has changed. */235235+ if (cur_state->source != new_state->source)236236+ return true;237237+238238+ return false;231239}232240233241static unsigned int rcar_du_plane_hwmask(struct rcar_du_plane_state *state)