Skip to content

Commit d07e142

Browse files
Jesse Agatealexdeucher
authored andcommitted
drm/amd/display: Incorrect Mirror Cositing
[WHY] hinit/vinit are incorrect in the case of mirroring. [HOW] Cositing sign must be flipped when image is mirrored in the vertical or horizontal direction. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Samson Tam <samson.tam@amd.com> Signed-off-by: Jesse Agate <jesse.agate@amd.com> Signed-off-by: Brendan Leder <breleder@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 5949e7c commit d07e142

File tree

1 file changed

+5
-5
lines changed
  • drivers/gpu/drm/amd/display/dc/sspl

1 file changed

+5
-5
lines changed

drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -641,16 +641,16 @@ static void spl_calculate_inits_and_viewports(struct spl_in *spl_in,
641641
/* this gives the direction of the cositing (negative will move
642642
* left, right otherwise)
643643
*/
644-
int sign = 1;
644+
int h_sign = flip_horz_scan_dir ? -1 : 1;
645+
int v_sign = flip_vert_scan_dir ? -1 : 1;
645646

646647
switch (spl_in->basic_in.cositing) {
647-
648648
case CHROMA_COSITING_TOPLEFT:
649-
init_adj_h = spl_fixpt_from_fraction(sign, 4);
650-
init_adj_v = spl_fixpt_from_fraction(sign, 4);
649+
init_adj_h = spl_fixpt_from_fraction(h_sign, 4);
650+
init_adj_v = spl_fixpt_from_fraction(v_sign, 4);
651651
break;
652652
case CHROMA_COSITING_LEFT:
653-
init_adj_h = spl_fixpt_from_fraction(sign, 4);
653+
init_adj_h = spl_fixpt_from_fraction(h_sign, 4);
654654
init_adj_v = spl_fixpt_zero;
655655
break;
656656
case CHROMA_COSITING_NONE:

0 commit comments

Comments
 (0)