aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/vc4/vc4_plane.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index cfb50fedfa2b..a3275fa66b7b 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -297,6 +297,9 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
297 vc4_state->y_scaling[0] = vc4_get_scaling_mode(vc4_state->src_h[0], 297 vc4_state->y_scaling[0] = vc4_get_scaling_mode(vc4_state->src_h[0],
298 vc4_state->crtc_h); 298 vc4_state->crtc_h);
299 299
300 vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE &&
301 vc4_state->y_scaling[0] == VC4_SCALING_NONE);
302
300 if (num_planes > 1) { 303 if (num_planes > 1) {
301 vc4_state->is_yuv = true; 304 vc4_state->is_yuv = true;
302 305
@@ -312,24 +315,17 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
312 vc4_get_scaling_mode(vc4_state->src_h[1], 315 vc4_get_scaling_mode(vc4_state->src_h[1],
313 vc4_state->crtc_h); 316 vc4_state->crtc_h);
314 317
315 /* YUV conversion requires that scaling be enabled, 318 /* YUV conversion requires that horizontal scaling be enabled,
316 * even on a plane that's otherwise 1:1. Choose TPZ 319 * even on a plane that's otherwise 1:1. Looks like only PPF
317 * for simplicity. 320 * works in that case, so let's pick that one.
318 */ 321 */
319 if (vc4_state->x_scaling[0] == VC4_SCALING_NONE) 322 if (vc4_state->is_unity)
320 vc4_state->x_scaling[0] = VC4_SCALING_TPZ; 323 vc4_state->x_scaling[0] = VC4_SCALING_PPF;
321 if (vc4_state->y_scaling[0] == VC4_SCALING_NONE)
322 vc4_state->y_scaling[0] = VC4_SCALING_TPZ;
323 } else { 324 } else {
324 vc4_state->x_scaling[1] = VC4_SCALING_NONE; 325 vc4_state->x_scaling[1] = VC4_SCALING_NONE;
325 vc4_state->y_scaling[1] = VC4_SCALING_NONE; 326 vc4_state->y_scaling[1] = VC4_SCALING_NONE;
326 } 327 }
327 328
328 vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE &&
329 vc4_state->y_scaling[0] == VC4_SCALING_NONE &&
330 vc4_state->x_scaling[1] == VC4_SCALING_NONE &&
331 vc4_state->y_scaling[1] == VC4_SCALING_NONE);
332
333 /* No configuring scaling on the cursor plane, since it gets 329 /* No configuring scaling on the cursor plane, since it gets
334 non-vblank-synced updates, and scaling requires requires 330 non-vblank-synced updates, and scaling requires requires
335 LBM changes which have to be vblank-synced. 331 LBM changes which have to be vblank-synced.
@@ -672,7 +668,10 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
672 vc4_dlist_write(vc4_state, SCALER_CSC2_ITR_R_601_5); 668 vc4_dlist_write(vc4_state, SCALER_CSC2_ITR_R_601_5);
673 } 669 }
674 670
675 if (!vc4_state->is_unity) { 671 if (vc4_state->x_scaling[0] != VC4_SCALING_NONE ||
672 vc4_state->x_scaling[1] != VC4_SCALING_NONE ||
673 vc4_state->y_scaling[0] != VC4_SCALING_NONE ||
674 vc4_state->y_scaling[1] != VC4_SCALING_NONE) {
676 /* LBM Base Address. */ 675 /* LBM Base Address. */
677 if (vc4_state->y_scaling[0] != VC4_SCALING_NONE || 676 if (vc4_state->y_scaling[0] != VC4_SCALING_NONE ||
678 vc4_state->y_scaling[1] != VC4_SCALING_NONE) { 677 vc4_state->y_scaling[1] != VC4_SCALING_NONE) {