tests/kms_plane_lowres: Skip if no suitable mode is possible

Submitted by Matt Roper on Aug. 19, 2019, 11:31 p.m.

Details

Message ID 20190819233150.8331-1-matthew.d.roper@intel.com
State New
Headers show
Series "tests/kms_plane_lowres: Skip if no suitable mode is possible" ( rev: 1 ) in IGT - Trybot

Not browsing as part of any series.

Commit Message

Matt Roper Aug. 19, 2019, 11:31 p.m.
When choosing a low resolution mode to switch to, we search the
connector's mode list for a mode that's small enough that a plane
positioned in the bottom left corner of the screen in the original mode
will be fully offscreen in the new, smaller mode.  However if no
suitable modes are found in the modelist, we blindly fall back to a 10x7
mode without actually checking that the canary plane will now be
offscreen.  If, for example, the original mode was 13x7, then switching
to 10x7 will leave the plane visible onscreen, causing the test to fail.

Before falling back to a 10x7 mode, check whether that's actually small
enough.  If it isn't just skip this subtest.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105581
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 tests/kms_plane_lowres.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c
index 68b85025..3f20ed32 100644
--- a/tests/kms_plane_lowres.c
+++ b/tests/kms_plane_lowres.c
@@ -59,8 +59,10 @@  get_lowres_mode(int drmfd, igt_output_t *output, drmModeModeInfo *mode_default)
 		}
 	}
 
-	if (!found)
+	if (!found) {
+		igt_skip_on(limit <= 768);
 		return *igt_std_1024_mode_get();
+	}
 
 	return mode;
 }