summaryrefslogtreecommitdiff
path: root/tests/kms_rotation_crc.c
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2019-01-22 16:04:56 +0200
committerJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2019-01-28 13:05:10 +0200
commite061af7bc37bfc77893dae8dab93d712d39d18df (patch)
treee446803fa4b09a9aaca6fb0443994fa7614b8dd2 /tests/kms_rotation_crc.c
parentcf1222ced94328b6c7be9256e6101505b5d3d143 (diff)
tests/kms_rotation_crc: Fix multiplane-rotation-cropping* tests
Make certain viewports are divisible by four due to intel hw workarounds for NV12. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_rotation_crc.c')
-rw-r--r--tests/kms_rotation_crc.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 8f343e016..fc995d07f 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -486,10 +486,31 @@ 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;
+ /*
+ * At this point is handled surface on right side. If display
+ * mode is not divisible by 4 but with 2 point location is
+ * fixed to match requirements. Because of YUV planes here is
+ * intentionally ignored bit 1.
+ */
+ p[c].x1 -= mode->hdisplay & 2;
+ } 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 -= mode->vdisplay & 2;
+ } else {
+ p[c].y1 = (int32_t)(data->planepos[c].y * mode->vdisplay);
+ p[c].y1 &= ~3;
+ }
}
/*