public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_rotation_crc: Fix multiplane-rotation-cropping* tests
@ 2019-01-22 14:38 Juha-Pekka Heikkila
  2019-01-22 15:25 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Juha-Pekka Heikkila @ 2019-01-22 14:38 UTC (permalink / raw)
  To: igt-dev

Make certain viewports are divisible by four due to intel
hw workarounds for NV12.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109381
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 8f343e0..d66b489 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -467,6 +467,7 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 			igt_plane_set_size(planes[c].plane, h, w);
 
 		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
+
 		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
 	}
 
@@ -486,10 +487,25 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,
 			  int c)
 {
-	p[c].x1 = (int32_t)(data->planepos[c].x * mode->hdisplay)
-			+ ((data->planepos[c].origo & p_right) ? mode->hdisplay : 0);
-	p[c].y1 = (int32_t)(data->planepos[c].y * mode->vdisplay)
-			+ ((data->planepos[c].origo & p_bottom) ? mode->vdisplay : 0);
+	if (data->planepos[c].origo & p_right) {
+		p[c].x1 = (int32_t)(data->planepos[c].x * mode->hdisplay
+				+ mode->hdisplay);
+		p[c].x1 &= ~3;
+		p[c].x1 -= (p[c].x1+p[c].width-mode->hdisplay)&3;
+	} else {
+		p[c].x1 = (int32_t)(data->planepos[c].x * mode->hdisplay);
+		p[c].x1 &= ~3;
+	}
+
+	if (data->planepos[c].origo & p_bottom) {
+		p[c].y1 = (int32_t)(data->planepos[c].y * mode->vdisplay
+				+ mode->vdisplay);
+		p[c].y1 &= ~3;
+		p[c].y1 -= (p[c].y1+p[c].height-mode->vdisplay)&3;
+	} else {
+		p[c].y1 = (int32_t)(data->planepos[c].y * mode->vdisplay);
+		p[c].y1 &= ~3;
+	}
 }
 
 /*
-- 
2.7.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-01-25 21:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-22 14:38 [igt-dev] [PATCH i-g-t] tests/kms_rotation_crc: Fix multiplane-rotation-cropping* tests Juha-Pekka Heikkila
2019-01-22 15:25 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-01-22 18:00 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-23 21:07 ` [igt-dev] [PATCH i-g-t] " Ville Syrjälä
2019-01-24 12:29   ` Juha-Pekka Heikkila
2019-01-24 15:45 ` Juha-Pekka Heikkila
2019-01-25 21:29   ` Ville Syrjälä
2019-01-24 16:45 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_rotation_crc: Fix multiplane-rotation-cropping* tests (rev2) Patchwork
2019-01-24 20:13 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox