[igt-dev] [PATCH i-g-t v2] tests/kms_ccs: Select highest resolution
Mika Kahola
mika.kahola at intel.com
Thu Feb 6 07:48:06 UTC 2020
In some cases we select resolution that is insufficient for testing
and we receive unnecessary skips on CI. Let's loop through all available
modes and select the higest one when running the tests.
v2: Pointer to drmModeModeInfo (Imre)
Set default to back to preferred mode (Imre)
Search mode only in cases with misaligned or small aux strides
test flags (Imre)
Fix requirement to from vertical to horizontal (Imre)
Signed-off-by: Mika Kahola <mika.kahola at intel.com>
---
tests/kms_ccs.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 2259a4f1..f1f6cc6b 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -276,6 +276,22 @@ static igt_plane_t *compatible_main_plane(data_t *data)
return igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
}
+static drmModeModeInfo *get_mode(drmModeModeInfo *preferred_mode,
+ igt_output_t *output)
+{
+ drmModeModeInfo *mode, *tmp;
+ int i;
+
+ mode = preferred_mode;
+ for (i = 0; i < output->config.connector->count_modes; i++) {
+ tmp = &output->config.connector->modes[i];
+ if (tmp->hdisplay > mode->hdisplay)
+ mode = tmp;
+ }
+
+ return mode;
+}
+
static bool try_config(data_t *data, enum test_fb_flags fb_flags,
igt_crc_t *crc)
{
@@ -298,6 +314,12 @@ static bool try_config(data_t *data, enum test_fb_flags fb_flags,
data->ccs_modifier))
return false;
+ if ((fb_flags & FB_MISALIGN_AUX_STRIDE) ||
+ (fb_flags & FB_SMALL_AUX_STRIDE)) {
+ drm_mode = get_mode(drm_mode, data->output);
+ igt_output_override_mode(data->output, drm_mode);
+ }
+
if (data->plane && fb_flags & FB_COMPRESSED) {
if (!igt_plane_has_format_mod(data->plane, data->format,
data->ccs_modifier))
--
2.17.1
More information about the igt-dev
mailing list