Skip to contentSkip to conversation

tests/kms_plane_lowres: Search for modes of the connector being tested

PATCH In review José Roberto de Souza 3 participants 9 messages Mar 30, 2019 – Apr 1, 2019 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 tests/kms_plane_lowres: Search for modes of the connector being tested

get_lowres_mode() was looking for the desired mode over all connectors what could cause commit to fail due incompatibility.

---
 tests/kms_plane_lowres.c | 48 +++++++++-------------------------------
 1 file changed, 11 insertions(+), 37 deletions(-)
tests/kms_plane_lowres.c +11 -37
index b27e5e61..f7739b11 100644
@@ -43,9 +43,8 @@ typedef struct {
 } data_t;
 
 static drmModeModeInfo
-get_lowres_mode(int drmfd, drmModeModeInfo *mode_default)
+get_lowres_mode(int drmfd, igt_output_t *output, drmModeModeInfo *mode_default)
 {
-	drmModeRes *mode_resources = drmModeGetResources(drmfd);
 	drmModeModeInfo mode;
 	drmModeModeInfo std_1024_mode = {
 		.clock = 65000,
@@ -64,43 +63,18 @@ get_lowres_mode(int drmfd, drmModeModeInfo *mode_default)
 		.type = 0x40,
 		.name = "Custom 1024x768",
 	};
-	bool found;
-	int limit = mode_default->vdisplay-SIZE;
-	int i, j;
-
-	if (!mode_resources) {
-		igt_warn("drmModeGetResources failed: %s\n", strerror(errno));
-		return std_1024_mode;
-	}
-
-	found = false;
-	for (i = 0; i < mode_resources->count_connectors; i++) {
-		drmModeConnector *connector;
-
-		connector = drmModeGetConnectorCurrent(drmfd,
-						       mode_resources->connectors[i]);
-		if (!connector) {
-			igt_warn("could not get connector %i: %s\n",
-				 mode_resources->connectors[i], strerror(errno));
-			continue;
+	bool found = false;
+	int limit = mode_default->vdisplay - SIZE;
+	int j;
+
+	for (j = 0; j < output->config.connector->count_modes; j++) {
+		mode = output->config.connector->modes[j];
+		if (mode.vdisplay < limit) {
+			found = true;
+			break;
 		}
-
-		if (!connector->count_modes)
-			continue;
-
-		for (j = 0; j < connector->count_modes; j++) {
-			mode = connector->modes[j];
-			if (mode.vdisplay < limit) {
-				found = true;
-				break;
-			}
-		}
-
-		drmModeFreeConnector(connector);
 	}
 
-	drmModeFreeResources(mode_resources);
-
 	if (!found)
 		return std_1024_mode;
 
@@ -217,7 +191,7 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 
 	mode1 = test_setup(data, pipe, modifier, output);
 
-	mode_lowres = get_lowres_mode(data->drm_fd, mode1);
+	mode_lowres = get_lowres_mode(data->drm_fd, output, mode1);
 
 	ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
 	igt_skip_on(ret != 0);
Signature · 6 lines
2.21.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH 2/3 lib: Share the 1024x768 mode among tests

Three test were duplicating this 1024x768 mode so lets move it to lib and share it.

---
 lib/igt_kms.c                    | 25 ++++++++++++++++++++++++-
 lib/igt_kms.h                    |  3 ++-
 tests/kms_concurrent.c           | 28 +++++-----------------------
 tests/kms_frontbuffer_tracking.c | 32 +++++++-------------------------
 tests/kms_plane_lowres.c         | 19 +------------------
 5 files changed, 39 insertions(+), 68 deletions(-)
lib/igt_kms.c +24 -1
index 43f45997..ce9fe152 100644
@@ -2155,6 +2155,29 @@ igt_output_t *igt_output_from_connector(igt_display_t *display,
 	return found;
 }
 
+const drmModeModeInfo *igt_std_1024_mode_get(void)
+{
+	static const drmModeModeInfo std_1024_mode = {
+		.clock = 65000,
+		.hdisplay = 1024,
+		.hsync_start = 1048,
+		.hsync_end = 1184,
+		.htotal = 1344,
+		.hskew = 0,
+		.vdisplay = 768,
+		.vsync_start = 771,
+		.vsync_end = 777,
+		.vtotal = 806,
+		.vscan = 0,
+		.vrefresh = 60,
+		.flags = 0xA,
+		.type = 0x40,
+		.name = "Custom 1024x768",
+	};
+
+	return &std_1024_mode;
+}
+
 static void igt_pipe_fini(igt_pipe_t *pipe)
 {
 	free(pipe->planes);
@@ -3627,7 +3650,7 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output)
  * mode obtained with get connectors. Note that the mode is used without
  * checking if the output supports it, so this might lead to unexpected results.
  */
-void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode)
+void igt_output_override_mode(igt_output_t *output, const drmModeModeInfo *mode)
 {
 	igt_pipe_t *pipe = igt_output_get_driving_pipe(output);
 
lib/igt_kms.h +2 -1
index 407f3d64..e392e0ef 100644
@@ -403,7 +403,7 @@ void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe);
 
 const char *igt_output_name(igt_output_t *output);
 drmModeModeInfo *igt_output_get_mode(igt_output_t *output);
-void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode);
+void igt_output_override_mode(igt_output_t *output, const drmModeModeInfo *mode);
 void igt_output_set_pipe(igt_output_t *output, enum pipe pipe);
 igt_plane_t *igt_output_get_plane(igt_output_t *output, int plane_idx);
 igt_plane_t *igt_output_get_plane_type(igt_output_t *output, int plane_type);
@@ -412,6 +412,7 @@ igt_plane_t *igt_output_get_plane_type_index(igt_output_t *output,
 					     int plane_type, int index);
 igt_output_t *igt_output_from_connector(igt_display_t *display,
     drmModeConnector *connector);
+const drmModeModeInfo *igt_std_1024_mode_get(void);
 
 igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, int plane_type);
 int igt_pipe_count_plane_type(igt_pipe_t *pipe, int plane_type);
tests/kms_concurrent.c +5 -23
index af8ca70c..117016dc 100644
@@ -236,29 +236,11 @@ test_plane_position_with_output(data_t *data, enum pipe pipe, igt_output_t *outp
 	}
 }
 
-static drmModeModeInfo std_1024_mode = {
-	.clock = 65000,
-	.hdisplay = 1024,
-	.hsync_start = 1048,
-	.hsync_end = 1184,
-	.htotal = 1344,
-	.hskew = 0,
-	.vdisplay = 768,
-	.vsync_start = 771,
-	.vsync_end = 777,
-	.vtotal = 806,
-	.vscan = 0,
-	.vrefresh = 60,
-	.flags = 0xA,
-	.type = 0x40,
-	.name = "Custom 1024x768",
-};
-
-static drmModeModeInfo *
-get_lowres_mode(data_t *data, drmModeModeInfo *mode_default,
+static const drmModeModeInfo *
+get_lowres_mode(data_t *data, const drmModeModeInfo *mode_default,
 		igt_output_t *output)
 {
-	drmModeModeInfo *mode = &std_1024_mode;
+	const drmModeModeInfo *mode = igt_std_1024_mode_get();
 	drmModeConnector *connector = output->config.connector;
 	int limit = mode_default->vdisplay - SIZE_PLANE;
 	bool found;
@@ -277,7 +259,7 @@ get_lowres_mode(data_t *data, drmModeModeInfo *mode_default,
 	}
 
 	if (!found)
-		mode = &std_1024_mode;
+		mode = igt_std_1024_mode_get();
 
 	return mode;
 }
@@ -285,7 +267,7 @@ get_lowres_mode(data_t *data, drmModeModeInfo *mode_default,
 static void
 test_resolution_with_output(data_t *data, enum pipe pipe, igt_output_t *output)
 {
-	drmModeModeInfo *mode_hi, *mode_lo;
+	const drmModeModeInfo *mode_hi, *mode_lo;
 	int iterations = opt.iterations < 1 ? 1 : opt.iterations;
 	bool loop_forever = opt.iterations == LOOP_FOREVER ? true : false;
 	int i;
tests/kms_frontbuffer_tracking.c +7 -25
index 4d15ce1c..89586326 100644
@@ -295,28 +295,10 @@ struct {
 	.stop = true,
 };
 
-drmModeModeInfo std_1024_mode = {
-	.clock = 65000,
-	.hdisplay = 1024,
-	.hsync_start = 1048,
-	.hsync_end = 1184,
-	.htotal = 1344,
-	.hskew = 0,
-	.vdisplay = 768,
-	.vsync_start = 771,
-	.vsync_end = 777,
-	.vtotal = 806,
-	.vscan = 0,
-	.vrefresh = 60,
-	.flags = 0xA,
-	.type = 0x40,
-	.name = "Custom 1024x768",
-};
-
-static drmModeModeInfo *get_connector_smallest_mode(igt_output_t *output)
+static const drmModeModeInfo *get_connector_smallest_mode(igt_output_t *output)
 {
 	drmModeConnector *c = output->config.connector;
-	drmModeModeInfo *smallest = NULL;
+	const drmModeModeInfo *smallest = NULL;
 	int i;
 
 	for (i = 0; i < c->count_modes; i++) {
@@ -331,14 +313,14 @@ static drmModeModeInfo *get_connector_smallest_mode(igt_output_t *output)
 	}
 
 	if (c->connector_type == DRM_MODE_CONNECTOR_eDP)
-		smallest = &std_1024_mode;
+		smallest = igt_std_1024_mode_get();
 
 	return smallest;
 }
 
-static drmModeModeInfo *connector_get_mode(igt_output_t *output)
+static const drmModeModeInfo *connector_get_mode(igt_output_t *output)
 {
-	drmModeModeInfo *mode = NULL;
+	const drmModeModeInfo *mode = NULL;
 
 	if (opt.small_modes)
 		mode = get_connector_smallest_mode(output);
@@ -349,7 +331,7 @@ static drmModeModeInfo *connector_get_mode(igt_output_t *output)
 	  * bugged. */
 	if (IS_HASWELL(intel_get_drm_devid(drm.fd)) &&
 	    output->config.connector->connector_type == DRM_MODE_CONNECTOR_eDP)
-		mode = &std_1024_mode;
+		mode = igt_std_1024_mode_get();
 
 	return mode;
 }
@@ -357,7 +339,7 @@ static drmModeModeInfo *connector_get_mode(igt_output_t *output)
 static void init_mode_params(struct modeset_params *params,
 			     igt_output_t *output, enum pipe pipe)
 {
-	drmModeModeInfo *mode;
+	const drmModeModeInfo *mode;
 
 	igt_output_override_mode(output, NULL);
 	mode = connector_get_mode(output);
tests/kms_plane_lowres.c +1 -18
index f7739b11..51bb7cd8 100644
@@ -46,23 +46,6 @@ static drmModeModeInfo
 get_lowres_mode(int drmfd, igt_output_t *output, drmModeModeInfo *mode_default)
 {
 	drmModeModeInfo mode;
-	drmModeModeInfo std_1024_mode = {
-		.clock = 65000,
-		.hdisplay = 1024,
-		.hsync_start = 1048,
-		.hsync_end = 1184,
-		.htotal = 1344,
-		.hskew = 0,
-		.vdisplay = 768,
-		.vsync_start = 771,
-		.vsync_end = 777,
-		.vtotal = 806,
-		.vscan = 0,
-		.vrefresh = 60,
-		.flags = 0xA,
-		.type = 0x40,
-		.name = "Custom 1024x768",
-	};
 	bool found = false;
 	int limit = mode_default->vdisplay - SIZE;
 	int j;
@@ -76,7 +59,7 @@ get_lowres_mode(int drmfd, igt_output_t *output, drmModeModeInfo *mode_default)
 	}
 
 	if (!found)
-		return std_1024_mode;
+		return *igt_std_1024_mode_get();
 
 	return mode;
 }
Signature · 6 lines
2.21.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Reviewed-by on v1 2/3
#2 lore raw

Re: [igt-dev] [PATCH i-g-t 2/3] lib: Share the 1024x768 mode among tests

Quoted 4 lines · José Roberto de Souza

Three test were duplicating this 1024x768 mode so lets move it to lib and share it.

Quoted 265 lines
---
 lib/igt_kms.c                    | 25 ++++++++++++++++++++++++-
 lib/igt_kms.h                    |  3 ++-
 tests/kms_concurrent.c           | 28 +++++-----------------------
 tests/kms_frontbuffer_tracking.c | 32 +++++++-----------------------
--
 tests/kms_plane_lowres.c         | 19 +------------------
 5 files changed, 39 insertions(+), 68 deletions(-)
lib/igt_kms.c +23 -0
index 43f45997..ce9fe152 100644
@@ -2155,6 +2155,29 @@ igt_output_t
 *igt_output_from_connector(igt_display_t *display,
 	return found;
 }
 
+const drmModeModeInfo *igt_std_1024_mode_get(void)
+{
+	static const drmModeModeInfo std_1024_mode = {
+		.clock = 65000,
+		.hdisplay = 1024,
+		.hsync_start = 1048,
+		.hsync_end = 1184,
+		.htotal = 1344,
+		.hskew = 0,
+		.vdisplay = 768,
+		.vsync_start = 771,
+		.vsync_end = 777,
+		.vtotal = 806,
+		.vscan = 0,
+		.vrefresh = 60,
+		.flags = 0xA,
+		.type = 0x40,
+		.name = "Custom 1024x768",
+	};
+
+	return &std_1024_mode;
+}
+
 static void igt_pipe_fini(igt_pipe_t *pipe)
 {
lib/igt_kms.c +0 -0
 	free(pipe->planes);
@@ -3627,7 +3650,7 @@ drmModeModeInfo
 *igt_output_get_mode(igt_output_t *output)
  * mode obtained with get connectors. Note that the mode is used

without
* checking if the output supports it, so this might lead to
unexpected results.
*/
-void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode)
+void igt_output_override_mode(igt_output_t *output, const drmModeModeInfo *mode)
{

lib/igt_kms.c +0 -0
 	igt_pipe_t *pipe = igt_output_get_driving_pipe(output);
lib/igt_kms.h +0 -0
index 407f3d64..e392e0ef 100644
@@ -403,7 +403,7 @@ void

igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe);

const char *igt_output_name(igt_output_t *output); drmModeModeInfo *igt_output_get_mode(igt_output_t *output);
-void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode);
+void igt_output_override_mode(igt_output_t *output, const drmModeModeInfo *mode);
void igt_output_set_pipe(igt_output_t *output, enum pipe pipe); igt_plane_t *igt_output_get_plane(igt_output_t *output, int
plane_idx);
igt_plane_t *igt_output_get_plane_type(igt_output_t *output, int
plane_type);

lib/igt_kms.h +1 -0
@@ -412,6 +412,7 @@ igt_plane_t
 *igt_output_get_plane_type_index(igt_output_t *output,
 					     int plane_type, int
 index);
 igt_output_t *igt_output_from_connector(igt_display_t *display,
     drmModeConnector *connector);
+const drmModeModeInfo *igt_std_1024_mode_get(void);
 

igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, int
plane_type);
int igt_pipe_count_plane_type(igt_pipe_t *pipe, int plane_type);

tests/kms_concurrent.c +0 -0
index af8ca70c..117016dc 100644
@@ -236,29 +236,11 @@ test_plane_position_with_output(data_t *data,

enum pipe pipe, igt_output_t *outp

tests/kms_concurrent.c +4 -22
 	}
 }
 
-static drmModeModeInfo std_1024_mode = {
-	.clock = 65000,
-	.hdisplay = 1024,
-	.hsync_start = 1048,
-	.hsync_end = 1184,
-	.htotal = 1344,
-	.hskew = 0,
-	.vdisplay = 768,
-	.vsync_start = 771,
-	.vsync_end = 777,
-	.vtotal = 806,
-	.vscan = 0,
-	.vrefresh = 60,
-	.flags = 0xA,
-	.type = 0x40,
-	.name = "Custom 1024x768",
-};
-
-static drmModeModeInfo *
-get_lowres_mode(data_t *data, drmModeModeInfo *mode_default,
+static const drmModeModeInfo *
+get_lowres_mode(data_t *data, const drmModeModeInfo *mode_default,
 		igt_output_t *output)
 {
-	drmModeModeInfo *mode = &std_1024_mode;
+	const drmModeModeInfo *mode = igt_std_1024_mode_get();
 	drmModeConnector *connector = output->config.connector;
 	int limit = mode_default->vdisplay - SIZE_PLANE;
 	bool found;
@@ -277,7 +259,7 @@ get_lowres_mode(data_t *data, drmModeModeInfo
 *mode_default,
 	}
 
 	if (!found)
-		mode = &std_1024_mode;
+		mode = igt_std_1024_mode_get();
 
 	return mode;

}

tests/kms_concurrent.c +1 -1
@@ -285,7 +267,7 @@ get_lowres_mode(data_t *data, drmModeModeInfo
 *mode_default,
 static void
 test_resolution_with_output(data_t *data, enum pipe pipe,
 igt_output_t *output)
 {
-	drmModeModeInfo *mode_hi, *mode_lo;
+	const drmModeModeInfo *mode_hi, *mode_lo;
 	int iterations = opt.iterations < 1 ? 1 : opt.iterations;

bool loop_forever = opt.iterations == LOOP_FOREVER ? true :
false;

tests/kms_concurrent.c +0 -0
 	int i;
tests/kms_frontbuffer_tracking.c +2 -20
index 4d15ce1c..89586326 100644
@@ -295,28 +295,10 @@ struct {
 	.stop = true,
 };
 
-drmModeModeInfo std_1024_mode = {
-	.clock = 65000,
-	.hdisplay = 1024,
-	.hsync_start = 1048,
-	.hsync_end = 1184,
-	.htotal = 1344,
-	.hskew = 0,
-	.vdisplay = 768,
-	.vsync_start = 771,
-	.vsync_end = 777,
-	.vtotal = 806,
-	.vscan = 0,
-	.vrefresh = 60,
-	.flags = 0xA,
-	.type = 0x40,
-	.name = "Custom 1024x768",
-};
-
-static drmModeModeInfo *get_connector_smallest_mode(igt_output_t
 *output)
+static const drmModeModeInfo
 *get_connector_smallest_mode(igt_output_t *output)
 {
 	drmModeConnector *c = output->config.connector;
-	drmModeModeInfo *smallest = NULL;
+	const drmModeModeInfo *smallest = NULL;
 	int i;
tests/kms_frontbuffer_tracking.c +3 -3
 	for (i = 0; i < c->count_modes; i++) {
@@ -331,14 +313,14 @@ static drmModeModeInfo
 *get_connector_smallest_mode(igt_output_t *output)
 	}
 
 	if (c->connector_type == DRM_MODE_CONNECTOR_eDP)
-		smallest = &std_1024_mode;
+		smallest = igt_std_1024_mode_get();
 
 	return smallest;
 }
 
-static drmModeModeInfo *connector_get_mode(igt_output_t *output)
+static const drmModeModeInfo *connector_get_mode(igt_output_t
 *output)
 {
-	drmModeModeInfo *mode = NULL;
+	const drmModeModeInfo *mode = NULL;
 
tests/kms_frontbuffer_tracking.c +1 -1
 	if (opt.small_modes)
 		mode = get_connector_smallest_mode(output);
@@ -349,7 +331,7 @@ static drmModeModeInfo
 *connector_get_mode(igt_output_t *output)
 	  * bugged. */
 	if (IS_HASWELL(intel_get_drm_devid(drm.fd)) &&
 	    output->config.connector->connector_type ==
 DRM_MODE_CONNECTOR_eDP)
-		mode = &std_1024_mode;
+		mode = igt_std_1024_mode_get();
 
tests/kms_frontbuffer_tracking.c +1 -1
 	return mode;
 }
@@ -357,7 +339,7 @@ static drmModeModeInfo
 *connector_get_mode(igt_output_t *output)
 static void init_mode_params(struct modeset_params *params,
 			     igt_output_t *output, enum pipe pipe)
 {
-	drmModeModeInfo *mode;
+	const drmModeModeInfo *mode;
 
 	igt_output_override_mode(output, NULL);
tests/kms_frontbuffer_tracking.c +0 -0
 	mode = connector_get_mode(output);
tests/kms_plane_lowres.c +0 -17
index f7739b11..51bb7cd8 100644
@@ -46,23 +46,6 @@ static drmModeModeInfo
 get_lowres_mode(int drmfd, igt_output_t *output, drmModeModeInfo
 *mode_default)
 {
 	drmModeModeInfo mode;
-	drmModeModeInfo std_1024_mode = {
-		.clock = 65000,
-		.hdisplay = 1024,
-		.hsync_start = 1048,
-		.hsync_end = 1184,
-		.htotal = 1344,
-		.hskew = 0,
-		.vdisplay = 768,
-		.vsync_start = 771,
-		.vsync_end = 777,
-		.vtotal = 806,
-		.vscan = 0,
-		.vrefresh = 60,
-		.flags = 0xA,
-		.type = 0x40,
-		.name = "Custom 1024x768",
-	};
 	bool found = false;
 	int limit = mode_default->vdisplay - SIZE;
tests/kms_plane_lowres.c +1 -1
 	int j;
@@ -76,7 +59,7 @@ get_lowres_mode(int drmfd, igt_output_t *output,
 drmModeModeInfo *mode_default)
 	}
 
 	if (!found)
-		return std_1024_mode;
+		return *igt_std_1024_mode_get();
 
 	return mode;
Quoted 1 line

}

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw

PATCH 3/3 tests/plane_lowres: Test each plane individually

In reply to José Roberto de Souza

ICL has some many planes per pipe that it is causing this test to skip due bandwidth limitation when combined with 4K displays.

The objective of this test is test the visibility of the planes when switching between high and low resolution, more information in the patch that added this test 12e34d8c909a ("tests/kms_plane_lowres:
Plane visibility after atomic modesets").
So it was setting all the planes the tested pipe in the bottom left of the display using the height of high resolution, checking the visibility and then switching to the low resolution mode and checking again the visibility and now it is expected that all planes would be invisible.

So to overcome ICL bandwidth issues, here it is testing each plane individually.

Cc Maarten Lankhorst <[email protected]>
Cc Mika Kahola <[email protected]>
---
 lib/igt_kms.c            |  21 +--
 lib/igt_kms.h            |   2 +-
 tests/kms_plane_lowres.c | 274 ++++++++++++++++++---------------------
 3 files changed, 135 insertions(+), 162 deletions(-)
lib/igt_kms.c +6 -15
index ce9fe152..1e2415bf 100644
@@ -1634,27 +1634,18 @@ static void kmstest_get_crtc(int device, enum pipe pipe, struct kmstest_crtc *cr
  *
  * Asserts only if the plane's visibility state matches the status being passed by @visibility
  */
-void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility)
+void igt_assert_plane_visible(int fd, enum pipe pipe, int plane_index, bool visibility)
 {
 	struct kmstest_crtc crtc;
-	int i;
-	bool visible;
+	bool visible = true;
 
 	kmstest_get_crtc(fd, pipe, &crtc);
 
-	visible = true;
-	for (i = 0; i < crtc.n_planes; i++) {
-		if (crtc.planes[i].type == DRM_PLANE_TYPE_PRIMARY)
-			continue;
+	igt_assert(plane_index < crtc.n_planes);
 
-		if (crtc.planes[i].pos_x > crtc.width) {
-			visible = false;
-			break;
-		} else if (crtc.planes[i].pos_y > crtc.height) {
-			visible = false;
-			break;
-		}
-	}
+	if (crtc.planes[plane_index].pos_x > crtc.width ||
+	    crtc.planes[plane_index].pos_y > crtc.height)
+		visible = false;
 
 	free(crtc.planes);
 	igt_assert_eq(visible, visibility);
lib/igt_kms.h +1 -1
index e392e0ef..38bdc08f 100644
@@ -228,7 +228,7 @@ void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size,
 void kmstest_dumb_destroy(int fd, uint32_t handle);
 void kmstest_wait_for_pageflip(int fd);
 unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int flags);
-void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility);
+void igt_assert_plane_visible(int fd, enum pipe pipe, int plane_index, bool visibility);
 
 /*
  * A small modeset API
tests/kms_plane_lowres.c +128 -146

343 lines not on this page · raw message

Signature · 6 lines
2.21.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Reviewed-by on v1 3/3
#4 lore raw

Re: [igt-dev] [PATCH i-g-t 3/3] tests/plane_lowres: Test each plane individually

I think in this test it would be sufficient to test only with one plane as this test is intended to test resolution change. We do have kms_plane_multiple test that tests all planes at once and thereofre exercises full bandwith. Therefore, I see this as valid change to the test.

Quoted 13 lines · José Roberto de Souza

ICL has some many planes per pipe that it is causing this test to skip due bandwidth limitation when combined with 4K displays.

The objective of this test is test the visibility of the planes when switching between high and low resolution, more information in the patch that added this test 12e34d8c909a ("tests/kms_plane_lowres:
Plane visibility after atomic modesets").
So it was setting all the planes the tested pipe in the bottom left of the display using the height of high resolution, checking the visibility and then switching to the low resolution mode and checking again the visibility and now it is expected that all planes would be invisible.

Quoted 6 lines

So to overcome ICL bandwidth issues, here it is testing each plane individually.

Cc Maarten Lankhorst <[email protected]>
Cc Mika Kahola <[email protected]>
Quoted 449 lines
---
 lib/igt_kms.c            |  21 +--
 lib/igt_kms.h            |   2 +-
 tests/kms_plane_lowres.c | 274 ++++++++++++++++++-------------------
--
 3 files changed, 135 insertions(+), 162 deletions(-)
lib/igt_kms.c +0 -0
index ce9fe152..1e2415bf 100644
@@ -1634,27 +1634,18 @@ static void kmstest_get_crtc(int device, enum

pipe pipe, struct kmstest_crtc *cr
*
* Asserts only if the plane's visibility state matches the status
being passed by @visibility
*/
-void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility)
+void igt_assert_plane_visible(int fd, enum pipe pipe, int plane_index, bool visibility)
{

lib/igt_kms.c +5 -14
 	struct kmstest_crtc crtc;
-	int i;
-	bool visible;
+	bool visible = true;
 
 	kmstest_get_crtc(fd, pipe, &crtc);
 
-	visible = true;
-	for (i = 0; i < crtc.n_planes; i++) {
-		if (crtc.planes[i].type == DRM_PLANE_TYPE_PRIMARY)
-			continue;
+	igt_assert(plane_index < crtc.n_planes);
 
-		if (crtc.planes[i].pos_x > crtc.width) {
-			visible = false;
-			break;
-		} else if (crtc.planes[i].pos_y > crtc.height) {
-			visible = false;
-			break;
-		}
-	}
+	if (crtc.planes[plane_index].pos_x > crtc.width ||
+	    crtc.planes[plane_index].pos_y > crtc.height)
+		visible = false;
 
 	free(crtc.planes);
 	igt_assert_eq(visible, visibility);
lib/igt_kms.h +1 -1
index e392e0ef..38bdc08f 100644
@@ -228,7 +228,7 @@ void *kmstest_dumb_map_buffer(int fd, uint32_t
 handle, uint64_t size,
 void kmstest_dumb_destroy(int fd, uint32_t handle);
 void kmstest_wait_for_pageflip(int fd);
 unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int
 flags);
-void igt_assert_plane_visible(int fd, enum pipe pipe, bool
 visibility);
+void igt_assert_plane_visible(int fd, enum pipe pipe, int

plane_index, bool visibility);

/*
* A small modeset API

tests/kms_plane_lowres.c +0 -0
index 51bb7cd8..0b78573f 100644
@@ -39,7 +39,8 @@ IGT_TEST_DESCRIPTION("Test atomic mode setting with

a plane by switching between
typedef struct {

tests/kms_plane_lowres.c +2 -19
 	int drm_fd;
 	igt_display_t display;
-	struct igt_fb *fb;
+	struct igt_fb fb_primary;
+	struct igt_fb fb_plane;
 } data_t;
 
 static drmModeModeInfo
@@ -64,24 +65,6 @@ get_lowres_mode(int drmfd, igt_output_t *output,
 drmModeModeInfo *mode_default)
 	return mode;
 }
 
-static void
-test_fini(data_t *data, igt_output_t *output, enum pipe pipe)
-{
-	igt_plane_t *plane;
-
-	/* restore original mode */
-	igt_output_override_mode(output, NULL);
-
-	for_each_plane_on_pipe(&data->display, pipe, plane)
-		igt_plane_set_fb(plane, NULL);
-
-	/* reset the constraint on the pipe */
-	igt_output_set_pipe(output, PIPE_ANY);
-
-	free(data->fb);
-	data->fb = NULL;
-}
-
 static void
 check_mode(drmModeModeInfo *mode1, drmModeModeInfo *mode2)

{

tests/kms_plane_lowres.c +98 -113
@@ -90,175 +73,160 @@ check_mode(drmModeModeInfo *mode1,
 drmModeModeInfo *mode2)
 	igt_assert_eq(mode1->vrefresh, mode2->vrefresh);
 }
 
-static drmModeModeInfo *
-test_setup(data_t *data, enum pipe pipe, uint64_t modifier,
-	   igt_output_t *output)
+/*
+ * Return false if test on this plane should be skipped
+ */
+static bool
+setup_plane(data_t *data, igt_plane_t *plane, drmModeModeInfo *mode,
+	    uint64_t modifier)
 {
-	drmModeModeInfo *mode;
-	int size;
-	int i = 1, x, y;
-	igt_plane_t *plane;
-
-	igt_skip_on(!igt_display_has_format_mod(&data->display,
-						DRM_FORMAT_XRGB8888,
-						modifier));
-
-	igt_output_set_pipe(output, pipe);
-
-	mode = igt_output_get_mode(output);
-
-	data->fb = calloc(data->display.pipes[pipe].n_planes,
 sizeof(struct igt_fb));
-	igt_assert_f(data->fb, "Failed to allocate memory for %d
 FBs\n",
-	             data->display.pipes[pipe].n_planes);
-
-	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode-
 >vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    modifier,
-			    0.0, 0.0, 1.0,
-			    &data->fb[0]);
-
-	/* yellow sprite plane in lower left corner */
-	for_each_plane_on_pipe(&data->display, pipe, plane) {
-		uint64_t plane_modifier;
-		uint32_t plane_format;
-
-		if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
-			igt_plane_set_fb(plane, &data->fb[0]);
-			continue;
-		}
-
-		if (plane->type == DRM_PLANE_TYPE_CURSOR)
-			size = 64;
-		else
-			size = SIZE;
-
-		x = 0;
-		y = mode->vdisplay - size;
-
-		plane_format = plane->type == DRM_PLANE_TYPE_CURSOR ?
-			DRM_FORMAT_ARGB8888 : DRM_FORMAT_XRGB8888;
-
-		plane_modifier = plane->type == DRM_PLANE_TYPE_CURSOR ?
-			LOCAL_DRM_FORMAT_MOD_NONE : modifier;
+	uint64_t plane_modifier;
+	uint32_t plane_format;
+	int size, x, y;
+
+	if (plane->type == DRM_PLANE_TYPE_PRIMARY)
+		return false;
+
+	if (plane->type == DRM_PLANE_TYPE_CURSOR)
+		size = 64;
+	else
+		size = SIZE;
+
+	x = 0;
+	y = mode->vdisplay - size;
+
+	if (plane->type == DRM_PLANE_TYPE_CURSOR) {
+		plane_format = DRM_FORMAT_ARGB8888;
+		plane_modifier = LOCAL_DRM_FORMAT_MOD_NONE;
+	} else {
+		plane_format = DRM_FORMAT_XRGB8888;
+		plane_modifier = modifier;
+	}
 
-		igt_skip_on(!igt_plane_has_format_mod(plane,
 plane_format,
-						      plane_modifier));
+	if (!igt_plane_has_format_mod(plane, plane_format,
 plane_modifier))
+		return false;
 
-		igt_create_color_fb(data->drm_fd,
-				    size, size,
-				    plane_format,
-				    plane_modifier,
-				    1.0, 1.0, 0.0,
-				    &data->fb[i]);
+	igt_create_color_fb(data->drm_fd, size, size, plane_format,
+			    plane_modifier, 1.0, 1.0, 0.0, &data-
 >fb_plane);
+	igt_plane_set_position(plane, x, y);
+	igt_plane_set_fb(plane, &data->fb_plane);
 
-		igt_plane_set_position(plane, x, y);
-		igt_plane_set_fb(plane, &data->fb[i++]);
-	}
+	return true;
+}
 
-	return mode;
+static igt_plane_t *
+primary_plane_get(igt_display_t *display, enum pipe pipe)
+{
+	unsigned plane_primary_id = display->pipes[pipe].plane_primary;
+	return &display->pipes[pipe].planes[plane_primary_id];
 }
 
-static void
-test_plane_position_with_output(data_t *data, enum pipe pipe,
+static unsigned
+test_planes_on_pipe_with_output(data_t *data, enum pipe pipe,
 				igt_output_t *output, uint64_t
 modifier)
 {
-	igt_crc_t crc_hires1, crc_hires2;
-	igt_crc_t crc_lowres;
-	drmModeModeInfo mode_lowres;
-	drmModeModeInfo *mode1, *mode2, *mode3;
-	int ret;
+	drmModeModeInfo *mode, mode_lowres;
 	igt_pipe_crc_t *pipe_crc;
+	unsigned tested = 0;
+	igt_plane_t *plane;
 
 	igt_info("Testing connector %s using pipe %s\n",
 		 igt_output_name(output), kmstest_pipe_name(pipe));
 
-	mode1 = test_setup(data, pipe, modifier, output);
+	igt_output_set_pipe(output, pipe);
+	mode = igt_output_get_mode(output);
+	mode_lowres = get_lowres_mode(data->drm_fd, output, mode);
 
-	mode_lowres = get_lowres_mode(data->drm_fd, output, mode1);
+	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode-
 >vdisplay,
+			    DRM_FORMAT_XRGB8888, modifier, 0.0, 0.0,
 1.0,
+			    &data->fb_primary);
+	igt_plane_set_fb(primary_plane_get(&data->display, pipe),
+			 &data->fb_primary);
 
-	ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
-	igt_skip_on(ret != 0);
+	pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+				    INTEL_PIPE_CRC_SOURCE_AUTO);
 
-	pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
 INTEL_PIPE_CRC_SOURCE_AUTO);
-	igt_pipe_crc_start(pipe_crc);
-	igt_pipe_crc_get_single(pipe_crc, &crc_hires1);
+	/* yellow sprite plane in lower left corner */
+	for_each_plane_on_pipe(&data->display, pipe, plane) {
+		igt_crc_t crc_hires1, crc_hires2;
+		int r;
 
-	igt_assert_plane_visible(data->drm_fd, pipe, true);
+		if (!setup_plane(data, plane, mode, modifier))
+			continue;
 
-	/* switch to lower resolution */
-	igt_output_override_mode(output, &mode_lowres);
-	igt_output_set_pipe(output, pipe);
+		r = igt_display_try_commit2(&data->display,
 COMMIT_ATOMIC);
+		if (r) {
+			igt_debug("Commit failed %i", r);
+			continue;
+		}
 
-	mode2 = igt_output_get_mode(output);
+		igt_pipe_crc_start(pipe_crc);
+		igt_pipe_crc_get_single(pipe_crc, &crc_hires1);
 
-	check_mode(&mode_lowres, mode2);
+		igt_assert_plane_visible(data->drm_fd, pipe, plane-
 >index,
+					 true);
 
-	igt_display_commit2(&data->display, COMMIT_ATOMIC);
-	igt_pipe_crc_get_current(data->display.drm_fd, pipe_crc,
 &crc_lowres);
+		/* switch to lower resolution */
+		igt_output_override_mode(output, &mode_lowres);
+		igt_output_set_pipe(output, pipe);
+		check_mode(&mode_lowres, igt_output_get_mode(output));
 
-	igt_assert_plane_visible(data->drm_fd, pipe, false);
+		igt_display_commit2(&data->display, COMMIT_ATOMIC);
 
-	/* switch back to higher resolution */
-	igt_output_override_mode(output, NULL);
-	igt_output_set_pipe(output, pipe);
+		igt_assert_plane_visible(data->drm_fd, pipe, plane-
 >index,
+					 false);
 
-	mode3 = igt_output_get_mode(output);
+		/* switch back to higher resolution */
+		igt_output_override_mode(output, NULL);
+		igt_output_set_pipe(output, pipe);
+		check_mode(mode, igt_output_get_mode(output));
 
-	check_mode(mode1, mode3);
+		igt_display_commit2(&data->display, COMMIT_ATOMIC);
 
-	igt_display_commit2(&data->display, COMMIT_ATOMIC);
+		igt_pipe_crc_get_current(data->drm_fd, pipe_crc,
 &crc_hires2);
 
-	igt_pipe_crc_get_current(data->display.drm_fd, pipe_crc,
 &crc_hires2);
+		igt_assert_plane_visible(data->drm_fd, pipe, plane-
 >index,
+					 true);
 
-	igt_assert_plane_visible(data->drm_fd, pipe, true);
+		igt_assert_crc_equal(&crc_hires1, &crc_hires2);
 
-	igt_assert_crc_equal(&crc_hires1, &crc_hires2);
+		igt_pipe_crc_stop(pipe_crc);
 
-	igt_pipe_crc_stop(pipe_crc);
-	igt_pipe_crc_free(pipe_crc);
+		igt_plane_set_fb(plane, NULL);
+		igt_remove_fb(data->drm_fd, &data->fb_plane);
+		tested++;
+	}
 
-	test_fini(data, output, pipe);
-}
+	igt_pipe_crc_free(pipe_crc);
 
-static void
-test_plane_position(data_t *data, enum pipe pipe, uint64_t modifier)
-{
-	igt_output_t *output;
+	igt_plane_set_fb(primary_plane_get(&data->display, pipe),
 NULL);
+	igt_remove_fb(data->drm_fd, &data->fb_primary);
+	igt_output_set_pipe(output, PIPE_NONE);
 
-	for_each_valid_output_on_pipe(&data->display, pipe, output)
-		test_plane_position_with_output(data, pipe, output,
 modifier);
+	return tested;
 }
 
 static void
-run_tests_for_pipe(data_t *data, enum pipe pipe)
+test_planes_on_pipe(data_t *data, enum pipe pipe, uint64_t modifier)
 {
-	igt_fixture {
-		igt_skip_on(pipe >= data->display.n_pipes);
-
-		igt_display_require_output_on_pipe(&data->display,
 pipe);
-	}
-
-	igt_subtest_f("pipe-%s-tiling-none",
-		      kmstest_pipe_name(pipe))
-		test_plane_position(data, pipe,

LOCAL_DRM_FORMAT_MOD_NONE);

tests/kms_plane_lowres.c +2 -3
+	igt_output_t *output;
+	unsigned tested = 0;
 
-	igt_subtest_f("pipe-%s-tiling-x",
-		      kmstest_pipe_name(pipe))
-		test_plane_position(data, pipe,

LOCAL_I915_FORMAT_MOD_X_TILED);

tests/kms_plane_lowres.c +4 -0
+	igt_skip_on(pipe >= data->display.n_pipes);
+	igt_display_require_output_on_pipe(&data->display, pipe);
+	igt_skip_on(!igt_display_has_format_mod(&data->display,
+						DRM_FORMAT_XRGB8888,

modifier));

tests/kms_plane_lowres.c +0 -3
-	igt_subtest_f("pipe-%s-tiling-y",
-		      kmstest_pipe_name(pipe))
-		test_plane_position(data, pipe,

LOCAL_I915_FORMAT_MOD_Y_TILED);

tests/kms_plane_lowres.c +2 -0
+	for_each_valid_output_on_pipe(&data->display, pipe, output)
+		tested += test_planes_on_pipe_with_output(data, pipe,

output,

tests/kms_plane_lowres.c +1 -3
+							  modifier);
 
-	igt_subtest_f("pipe-%s-tiling-yf",
-		      kmstest_pipe_name(pipe))
-		test_plane_position(data, pipe,

LOCAL_I915_FORMAT_MOD_Yf_TILED);

tests/kms_plane_lowres.c +12 -5
+	igt_assert(tested > 0);
 }
 
-static data_t data;
-
 igt_main
 {
+	data_t data = {};
 	enum pipe pipe;
 
 	igt_skip_on_simulation();
@@ -273,9 +241,23 @@ igt_main
 		igt_require(data.display.is_atomic);
 	}
 
-	for_each_pipe_static(pipe)
-		igt_subtest_group
-			run_tests_for_pipe(&data, pipe);
+	for_each_pipe_static(pipe) {
+		igt_subtest_f("pipe-%s-tiling-none",
 kmstest_pipe_name(pipe))
+			test_planes_on_pipe(&data, pipe,
+					    LOCAL_DRM_FORMAT_MOD_NONE);
+
+		igt_subtest_f("pipe-%s-tiling-x",
 kmstest_pipe_name(pipe))
+			test_planes_on_pipe(&data, pipe,
+					    LOCAL_I915_FORMAT_MOD_X_TIL
 ED);
+
+		igt_subtest_f("pipe-%s-tiling-y",

kmstest_pipe_name(pipe))

tests/kms_plane_lowres.c +2 -0
+			test_planes_on_pipe(&data, pipe,
+					    LOCAL_I915_FORMAT_MOD_Y_TIL

ED);

tests/kms_plane_lowres.c +2 -0
+
+		igt_subtest_f("pipe-%s-tiling-yf",

kmstest_pipe_name(pipe))

tests/kms_plane_lowres.c +2 -0
+			test_planes_on_pipe(&data, pipe,
+					    LOCAL_I915_FORMAT_MOD_Yf_TI

LED);

tests/kms_plane_lowres.c igt_main · line 263

Quoted 4 lines
tests/kms_plane_lowres.c +1 -0
+	}
 
 	igt_fixture {
 		igt_display_fini(&data.display);

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#5 lore raw

Re: [igt-dev] [PATCH i-g-t 3/3] tests/plane_lowres: Test each plane individually

Quoted 6 lines · Mika

I think in this test it would be sufficient to test only with one plane
as this test is intended to test resolution change. We do have kms_plane_multiple test that tests all planes at once and thereofre exercises full bandwith. Therefore, I see this as valid change to the test.

Now it is pretty easy to change to just one plane if we want to.

Quoted 18 lines · José Roberto de Souza
Quoted 16 lines

ICL has some many planes per pipe that it is causing this test to skip due bandwidth limitation when combined with 4K displays.

The objective of this test is test the visibility of the planes when
switching between high and low resolution, more information in the patch that added this test 12e34d8c909a ("tests/kms_plane_lowres:
Plane visibility after atomic modesets").
So it was setting all the planes the tested pipe in the bottom left of the display using the height of high resolution, checking the visibility and then switching to the low resolution mode and checking
again the visibility and now it is expected that all planes would be
invisible.

Quoted 7 lines
Quoted 6 lines

So to overcome ICL bandwidth issues, here it is testing each plane individually.

Cc Maarten Lankhorst <[email protected]>
Cc Mika Kahola <[email protected]>

Thanks for the reviews, merged.

Quoted 458 lines
Quoted 458 lines
---
 lib/igt_kms.c            |  21 +--
 lib/igt_kms.h            |   2 +-
 tests/kms_plane_lowres.c | 274 ++++++++++++++++++-----------------
--
--
 3 files changed, 135 insertions(+), 162 deletions(-)
lib/igt_kms.c +0 -0
index ce9fe152..1e2415bf 100644
@@ -1634,27 +1634,18 @@ static void kmstest_get_crtc(int device,

enum
pipe pipe, struct kmstest_crtc *cr
*
* Asserts only if the plane's visibility state matches the status
being passed by @visibility
*/
-void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility)
+void igt_assert_plane_visible(int fd, enum pipe pipe, int plane_index, bool visibility)
{

lib/igt_kms.c +5 -14
 	struct kmstest_crtc crtc;
-	int i;
-	bool visible;
+	bool visible = true;
 
 	kmstest_get_crtc(fd, pipe, &crtc);
 
-	visible = true;
-	for (i = 0; i < crtc.n_planes; i++) {
-		if (crtc.planes[i].type == DRM_PLANE_TYPE_PRIMARY)
-			continue;
+	igt_assert(plane_index < crtc.n_planes);
 
-		if (crtc.planes[i].pos_x > crtc.width) {
-			visible = false;
-			break;
-		} else if (crtc.planes[i].pos_y > crtc.height) {
-			visible = false;
-			break;
-		}
-	}
+	if (crtc.planes[plane_index].pos_x > crtc.width ||
+	    crtc.planes[plane_index].pos_y > crtc.height)
+		visible = false;
 
 	free(crtc.planes);
 	igt_assert_eq(visible, visibility);
lib/igt_kms.h +1 -1
index e392e0ef..38bdc08f 100644
@@ -228,7 +228,7 @@ void *kmstest_dumb_map_buffer(int fd, uint32_t
 handle, uint64_t size,
 void kmstest_dumb_destroy(int fd, uint32_t handle);
 void kmstest_wait_for_pageflip(int fd);
 unsigned int kmstest_get_vblank(int fd, int pipe, unsigned int
 flags);
-void igt_assert_plane_visible(int fd, enum pipe pipe, bool
 visibility);
+void igt_assert_plane_visible(int fd, enum pipe pipe, int

plane_index, bool visibility);

/*
* A small modeset API

tests/kms_plane_lowres.c +0 -0
index 51bb7cd8..0b78573f 100644
@@ -39,7 +39,8 @@ IGT_TEST_DESCRIPTION("Test atomic mode setting

with
a plane by switching between
typedef struct {

tests/kms_plane_lowres.c +2 -19
 	int drm_fd;
 	igt_display_t display;
-	struct igt_fb *fb;
+	struct igt_fb fb_primary;
+	struct igt_fb fb_plane;
 } data_t;
 
 static drmModeModeInfo
@@ -64,24 +65,6 @@ get_lowres_mode(int drmfd, igt_output_t *output,
 drmModeModeInfo *mode_default)
 	return mode;
 }
 
-static void
-test_fini(data_t *data, igt_output_t *output, enum pipe pipe)
-{
-	igt_plane_t *plane;
-
-	/* restore original mode */
-	igt_output_override_mode(output, NULL);
-
-	for_each_plane_on_pipe(&data->display, pipe, plane)
-		igt_plane_set_fb(plane, NULL);
-
-	/* reset the constraint on the pipe */
-	igt_output_set_pipe(output, PIPE_ANY);
-
-	free(data->fb);
-	data->fb = NULL;
-}
-
 static void
 check_mode(drmModeModeInfo *mode1, drmModeModeInfo *mode2)

{

tests/kms_plane_lowres.c +98 -104
@@ -90,175 +73,160 @@ check_mode(drmModeModeInfo *mode1,
 drmModeModeInfo *mode2)
 	igt_assert_eq(mode1->vrefresh, mode2->vrefresh);
 }
 
-static drmModeModeInfo *
-test_setup(data_t *data, enum pipe pipe, uint64_t modifier,
-	   igt_output_t *output)
+/*
+ * Return false if test on this plane should be skipped
+ */
+static bool
+setup_plane(data_t *data, igt_plane_t *plane, drmModeModeInfo
 *mode,
+	    uint64_t modifier)
 {
-	drmModeModeInfo *mode;
-	int size;
-	int i = 1, x, y;
-	igt_plane_t *plane;
-
-	igt_skip_on(!igt_display_has_format_mod(&data->display,
-						DRM_FORMAT_XRGB8888,
-						modifier));
-
-	igt_output_set_pipe(output, pipe);
-
-	mode = igt_output_get_mode(output);
-
-	data->fb = calloc(data->display.pipes[pipe].n_planes,
 sizeof(struct igt_fb));
-	igt_assert_f(data->fb, "Failed to allocate memory for %d
 FBs\n",
-	             data->display.pipes[pipe].n_planes);
-
-	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode-
 > vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    modifier,
-			    0.0, 0.0, 1.0,
-			    &data->fb[0]);
-
-	/* yellow sprite plane in lower left corner */
-	for_each_plane_on_pipe(&data->display, pipe, plane) {
-		uint64_t plane_modifier;
-		uint32_t plane_format;
-
-		if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
-			igt_plane_set_fb(plane, &data->fb[0]);
-			continue;
-		}
-
-		if (plane->type == DRM_PLANE_TYPE_CURSOR)
-			size = 64;
-		else
-			size = SIZE;
-
-		x = 0;
-		y = mode->vdisplay - size;
-
-		plane_format = plane->type == DRM_PLANE_TYPE_CURSOR ?
-			DRM_FORMAT_ARGB8888 : DRM_FORMAT_XRGB8888;
-
-		plane_modifier = plane->type == DRM_PLANE_TYPE_CURSOR ?
-			LOCAL_DRM_FORMAT_MOD_NONE : modifier;
+	uint64_t plane_modifier;
+	uint32_t plane_format;
+	int size, x, y;
+
+	if (plane->type == DRM_PLANE_TYPE_PRIMARY)
+		return false;
+
+	if (plane->type == DRM_PLANE_TYPE_CURSOR)
+		size = 64;
+	else
+		size = SIZE;
+
+	x = 0;
+	y = mode->vdisplay - size;
+
+	if (plane->type == DRM_PLANE_TYPE_CURSOR) {
+		plane_format = DRM_FORMAT_ARGB8888;
+		plane_modifier = LOCAL_DRM_FORMAT_MOD_NONE;
+	} else {
+		plane_format = DRM_FORMAT_XRGB8888;
+		plane_modifier = modifier;
+	}
 
-		igt_skip_on(!igt_plane_has_format_mod(plane,
 plane_format,
-						      plane_modifier));
+	if (!igt_plane_has_format_mod(plane, plane_format,
 plane_modifier))
+		return false;
 
-		igt_create_color_fb(data->drm_fd,
-				    size, size,
-				    plane_format,
-				    plane_modifier,
-				    1.0, 1.0, 0.0,
-				    &data->fb[i]);
+	igt_create_color_fb(data->drm_fd, size, size, plane_format,
+			    plane_modifier, 1.0, 1.0, 0.0, &data-
 > fb_plane);
+	igt_plane_set_position(plane, x, y);
+	igt_plane_set_fb(plane, &data->fb_plane);
 
-		igt_plane_set_position(plane, x, y);
-		igt_plane_set_fb(plane, &data->fb[i++]);
-	}
+	return true;
+}
 
-	return mode;
+static igt_plane_t *
+primary_plane_get(igt_display_t *display, enum pipe pipe)
+{
+	unsigned plane_primary_id = display->pipes[pipe].plane_primary;
+	return &display->pipes[pipe].planes[plane_primary_id];
 }
 
-static void
-test_plane_position_with_output(data_t *data, enum pipe pipe,
+static unsigned
+test_planes_on_pipe_with_output(data_t *data, enum pipe pipe,
 				igt_output_t *output, uint64_t
 modifier)
 {
-	igt_crc_t crc_hires1, crc_hires2;
-	igt_crc_t crc_lowres;
-	drmModeModeInfo mode_lowres;
-	drmModeModeInfo *mode1, *mode2, *mode3;
-	int ret;
+	drmModeModeInfo *mode, mode_lowres;
 	igt_pipe_crc_t *pipe_crc;
+	unsigned tested = 0;
+	igt_plane_t *plane;
 
 	igt_info("Testing connector %s using pipe %s\n",
 		 igt_output_name(output), kmstest_pipe_name(pipe));
 
-	mode1 = test_setup(data, pipe, modifier, output);
+	igt_output_set_pipe(output, pipe);
+	mode = igt_output_get_mode(output);
+	mode_lowres = get_lowres_mode(data->drm_fd, output, mode);
 
-	mode_lowres = get_lowres_mode(data->drm_fd, output, mode1);
+	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode-
 > vdisplay,
+			    DRM_FORMAT_XRGB8888, modifier, 0.0, 0.0,
 1.0,
+			    &data->fb_primary);
+	igt_plane_set_fb(primary_plane_get(&data->display, pipe),
+			 &data->fb_primary);
 
-	ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
-	igt_skip_on(ret != 0);
+	pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+				    INTEL_PIPE_CRC_SOURCE_AUTO);
 
-	pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
 INTEL_PIPE_CRC_SOURCE_AUTO);
-	igt_pipe_crc_start(pipe_crc);
-	igt_pipe_crc_get_single(pipe_crc, &crc_hires1);
+	/* yellow sprite plane in lower left corner */
+	for_each_plane_on_pipe(&data->display, pipe, plane) {
+		igt_crc_t crc_hires1, crc_hires2;
+		int r;
 
-	igt_assert_plane_visible(data->drm_fd, pipe, true);
+		if (!setup_plane(data, plane, mode, modifier))
+			continue;
 
-	/* switch to lower resolution */
-	igt_output_override_mode(output, &mode_lowres);
-	igt_output_set_pipe(output, pipe);
+		r = igt_display_try_commit2(&data->display,
 COMMIT_ATOMIC);
+		if (r) {
+			igt_debug("Commit failed %i", r);
+			continue;
+		}
 
-	mode2 = igt_output_get_mode(output);
+		igt_pipe_crc_start(pipe_crc);
+		igt_pipe_crc_get_single(pipe_crc, &crc_hires1);
 
-	check_mode(&mode_lowres, mode2);
+		igt_assert_plane_visible(data->drm_fd, pipe, plane-
 > index,
+					 true);
 
-	igt_display_commit2(&data->display, COMMIT_ATOMIC);
-	igt_pipe_crc_get_current(data->display.drm_fd, pipe_crc,
 &crc_lowres);
+		/* switch to lower resolution */
+		igt_output_override_mode(output, &mode_lowres);
+		igt_output_set_pipe(output, pipe);
+		check_mode(&mode_lowres, igt_output_get_mode(output));
 
-	igt_assert_plane_visible(data->drm_fd, pipe, false);
+		igt_display_commit2(&data->display, COMMIT_ATOMIC);
 
-	/* switch back to higher resolution */
-	igt_output_override_mode(output, NULL);
-	igt_output_set_pipe(output, pipe);
+		igt_assert_plane_visible(data->drm_fd, pipe, plane-
 > index,
+					 false);
 
-	mode3 = igt_output_get_mode(output);
+		/* switch back to higher resolution */
+		igt_output_override_mode(output, NULL);
+		igt_output_set_pipe(output, pipe);
+		check_mode(mode, igt_output_get_mode(output));
 
-	check_mode(mode1, mode3);
+		igt_display_commit2(&data->display, COMMIT_ATOMIC);
 
-	igt_display_commit2(&data->display, COMMIT_ATOMIC);
+		igt_pipe_crc_get_current(data->drm_fd, pipe_crc,
 &crc_hires2);
 
-	igt_pipe_crc_get_current(data->display.drm_fd, pipe_crc,
 &crc_hires2);
+		igt_assert_plane_visible(data->drm_fd, pipe, plane-
 > index,
+					 true);
 
-	igt_assert_plane_visible(data->drm_fd, pipe, true);
+		igt_assert_crc_equal(&crc_hires1, &crc_hires2);
 
-	igt_assert_crc_equal(&crc_hires1, &crc_hires2);
+		igt_pipe_crc_stop(pipe_crc);
 
-	igt_pipe_crc_stop(pipe_crc);
-	igt_pipe_crc_free(pipe_crc);
+		igt_plane_set_fb(plane, NULL);
+		igt_remove_fb(data->drm_fd, &data->fb_plane);
+		tested++;
+	}
 
-	test_fini(data, output, pipe);
-}
+	igt_pipe_crc_free(pipe_crc);
 
-static void
-test_plane_position(data_t *data, enum pipe pipe, uint64_t
 modifier)
-{
-	igt_output_t *output;
+	igt_plane_set_fb(primary_plane_get(&data->display, pipe),
 NULL);
+	igt_remove_fb(data->drm_fd, &data->fb_primary);
+	igt_output_set_pipe(output, PIPE_NONE);
 
-	for_each_valid_output_on_pipe(&data->display, pipe, output)
-		test_plane_position_with_output(data, pipe, output,
 modifier);
+	return tested;
 }
 
 static void
-run_tests_for_pipe(data_t *data, enum pipe pipe)
+test_planes_on_pipe(data_t *data, enum pipe pipe, uint64_t

modifier)
{

tests/kms_plane_lowres.c +0 -4
-	igt_fixture {
-		igt_skip_on(pipe >= data->display.n_pipes);
-
-		igt_display_require_output_on_pipe(&data->display,

pipe);

tests/kms_plane_lowres.c +0 -5
-	}
-
-	igt_subtest_f("pipe-%s-tiling-none",
-		      kmstest_pipe_name(pipe))
-		test_plane_position(data, pipe,

LOCAL_DRM_FORMAT_MOD_NONE);

tests/kms_plane_lowres.c +2 -3
+	igt_output_t *output;
+	unsigned tested = 0;
 
-	igt_subtest_f("pipe-%s-tiling-x",
-		      kmstest_pipe_name(pipe))
-		test_plane_position(data, pipe,

LOCAL_I915_FORMAT_MOD_X_TILED);

tests/kms_plane_lowres.c +4 -0
+	igt_skip_on(pipe >= data->display.n_pipes);
+	igt_display_require_output_on_pipe(&data->display, pipe);
+	igt_skip_on(!igt_display_has_format_mod(&data->display,
+						DRM_FORMAT_XRGB8888,

modifier));

tests/kms_plane_lowres.c +0 -3
-	igt_subtest_f("pipe-%s-tiling-y",
-		      kmstest_pipe_name(pipe))
-		test_plane_position(data, pipe,

LOCAL_I915_FORMAT_MOD_Y_TILED);

tests/kms_plane_lowres.c +2 -0
+	for_each_valid_output_on_pipe(&data->display, pipe, output)
+		tested += test_planes_on_pipe_with_output(data, pipe,

output,

tests/kms_plane_lowres.c +1 -3
+							  modifier);
 
-	igt_subtest_f("pipe-%s-tiling-yf",
-		      kmstest_pipe_name(pipe))
-		test_plane_position(data, pipe,

LOCAL_I915_FORMAT_MOD_Yf_TILED);

tests/kms_plane_lowres.c +12 -5
+	igt_assert(tested > 0);
 }
 
-static data_t data;
-
 igt_main
 {
+	data_t data = {};
 	enum pipe pipe;
 
 	igt_skip_on_simulation();
@@ -273,9 +241,23 @@ igt_main
 		igt_require(data.display.is_atomic);
 	}
 
-	for_each_pipe_static(pipe)
-		igt_subtest_group
-			run_tests_for_pipe(&data, pipe);
+	for_each_pipe_static(pipe) {
+		igt_subtest_f("pipe-%s-tiling-none",
 kmstest_pipe_name(pipe))
+			test_planes_on_pipe(&data, pipe,
+					    LOCAL_DRM_FORMAT_MOD_NONE);
+
+		igt_subtest_f("pipe-%s-tiling-x",
 kmstest_pipe_name(pipe))
+			test_planes_on_pipe(&data, pipe,
+					    LOCAL_I915_FORMAT_MOD_X_TIL
 ED);
+
+		igt_subtest_f("pipe-%s-tiling-y",

kmstest_pipe_name(pipe))

tests/kms_plane_lowres.c +2 -0
+			test_planes_on_pipe(&data, pipe,
+					    LOCAL_I915_FORMAT_MOD_Y_TIL

ED);

tests/kms_plane_lowres.c +2 -0
+
+		igt_subtest_f("pipe-%s-tiling-yf",

kmstest_pipe_name(pipe))

tests/kms_plane_lowres.c +2 -0
+			test_planes_on_pipe(&data, pipe,
+					    LOCAL_I915_FORMAT_MOD_Yf_TI

LED);

tests/kms_plane_lowres.c +1 -0
+	}
Quoted 2 lines

tests/kms_plane_lowres.c igt_main · line 263

Quoted 2 lines
tests/kms_plane_lowres.c +0 -0
 	igt_fixture {
 		igt_display_fini(&data.display);

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#6 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] tests/kms_plane_lowres: Search for modes of the connector being tested

In reply to José Roberto de Souza
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/3] tests/kms_plane_lowres: Search for modes of the connector being tested
URL : https://patchwork.freedesktop.org/series/58765/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5840 -> IGTPW_2741
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/58765/revisions/1/mbox/

Known issues
------------

Here are the changes found in IGTPW_2741 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live_contexts:
- fi-skl-gvtdvm: PASS -> DMESG-FAIL [fdo#110235 ]

* igt@kms_busy@basic-flip-b:
- fi-gdg-551: PASS -> FAIL [fdo#103182]

* igt@kms_busy@basic-flip-c:
- fi-blb-e6850: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u3: PASS -> FAIL [fdo#103167]

* igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
- fi-blb-e6850: NOTRUN -> SKIP [fdo#109271] +48

* igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
- fi-byt-clapper: PASS -> FAIL [fdo#103191] / [fdo#107362]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s4-devices:
- fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS

* igt@i915_selftest@live_evict:
- fi-bsw-kefka: DMESG-WARN [fdo#107709] -> PASS

* igt@i915_selftest@live_execlists:
- fi-apl-guc: INCOMPLETE [fdo#103927] / [fdo#109720] -> PASS

* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u2: FAIL [fdo#103167] -> PASS

* igt@prime_vgem@basic-fence-flip:
- fi-icl-u3: FAIL [fdo#104008] -> PASS

#### Warnings ####

* igt@i915_selftest@live_contexts:
- fi-icl-u3: DMESG-FAIL [fdo#108569] -> INCOMPLETE [fdo#108569]

[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104008]: https://bugs.freedesktop.org/show_bug.cgi?id=104008
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107709]: https://bugs.freedesktop.org/show_bug.cgi?id=107709
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720
[fdo#110235 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110235

Participating hosts (50 -> 42)
------------------------------

Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-bwr-2160 fi-ctg-p8600 fi-bdw-samus

Build changes
-------------

* IGT: IGT_4913 -> IGTPW_2741

CI_DRM_5840: db336fee1090f4207856469e57d04bcf56fe9e3a @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2741: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2741/
IGT_4913: e408d569973b610ba4aafdba016c48b25e563468 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2741/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#7 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/3] tests/kms_plane_lowres: Search for modes of the connector being tested

In reply to José Roberto de Souza
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/3] tests/kms_plane_lowres: Search for modes of the connector being tested
URL : https://patchwork.freedesktop.org/series/58765/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5840_full -> IGTPW_2741_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/58765/revisions/1/mbox/

Known issues
------------

Here are the changes found in IGTPW_2741_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_schedule@preempt-other-chain-blt:
- shard-snb: NOTRUN -> SKIP [fdo#109271] +150

* igt@gem_tiled_swapping@non-threaded:
- shard-hsw: PASS -> INCOMPLETE [fdo#103540]
- shard-snb: PASS -> INCOMPLETE [fdo#105411]

* igt@kms_busy@extended-modeset-hang-newfb-render-c:
- shard-hsw: PASS -> DMESG-WARN [fdo#110222] +1

* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
- shard-snb: PASS -> DMESG-WARN [fdo#110222]
- shard-kbl: PASS -> DMESG-WARN [fdo#110222]

* igt@kms_chv_cursor_fail@pipe-c-256x256-bottom-edge:
- shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +16

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
- shard-hsw: PASS -> FAIL [fdo#105767]

* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
- shard-glk: PASS -> FAIL [fdo#104873]

* igt@kms_flip@2x-dpms-vs-vblank-race-interruptible:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] +58

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-apl: PASS -> FAIL [fdo#102887] / [fdo#105363]

* igt@kms_flip@flip-vs-suspend:
- shard-apl: PASS -> DMESG-WARN [fdo#108566]

* igt@kms_frontbuffer_tracking@fbcpsr-rgb565-draw-mmap-cpu:
- shard-glk: NOTRUN -> SKIP [fdo#109271] +5

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-f:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +6

* igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb:
- shard-kbl: NOTRUN -> FAIL [fdo#108145] +2

* igt@kms_setmode@basic:

    - shard-apl:          PASS -> FAIL [fdo#99912]
    - shard-kbl:          NOTRUN -> FAIL [fdo#99912]
    - shard-snb:          NOTRUN -> FAIL [fdo#99912]

#### Possible fixes ####

* igt@gem_eio@in-flight-suspend:
- shard-snb: FAIL [fdo#103375] -> PASS

* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:

    - shard-kbl:          DMESG-WARN [fdo#110222] -> PASS
    - shard-snb:          DMESG-WARN [fdo#110222] -> PASS +1
    - shard-hsw:          DMESG-WARN [fdo#110222] -> PASS

* igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions:
- shard-hsw: FAIL [fdo#103355] -> PASS

* igt@kms_draw_crc@draw-method-xrgb8888-mmap-cpu-ytiled:
- shard-glk: FAIL [fdo#107791] -> PASS

* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-shrfb-msflip-blt:
- shard-glk: FAIL [fdo#103167] -> PASS

* igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format:
- shard-glk: SKIP [fdo#109271] / [fdo#109278] -> PASS

* igt@kms_rotation_crc@multiplane-rotation:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS

* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: FAIL [fdo#109016] -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#104873]: https://bugs.freedesktop.org/show_bug.cgi?id=104873
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#107791]: https://bugs.freedesktop.org/show_bug.cgi?id=107791
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

Participating hosts (10 -> 5)
------------------------------

Missing (5): shard-skl pig-hsw-4770r pig-glk-j5005 shard-iclb pig-skl-6260u

Build changes
-------------

* IGT: IGT_4913 -> IGTPW_2741
* Piglit: piglit_4509 -> None

CI_DRM_5840: db336fee1090f4207856469e57d04bcf56fe9e3a @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2741: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2741/
IGT_4913: e408d569973b610ba4aafdba016c48b25e563468 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2741/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

Reviewed-by on v1 1/3
#8 lore raw
In reply to José Roberto de Souza

I'm in favor to add this check to the test.

Quoted 5 lines · José Roberto de Souza

get_lowres_mode() was looking for the desired mode over all connectors what could cause commit to fail due incompatibility.

Quoted 87 lines
---
 tests/kms_plane_lowres.c | 48 +++++++++-----------------------------
--
 1 file changed, 11 insertions(+), 37 deletions(-)
tests/kms_plane_lowres.c +1 -2
index b27e5e61..f7739b11 100644
@@ -43,9 +43,8 @@ typedef struct {
 } data_t;
 
 static drmModeModeInfo
-get_lowres_mode(int drmfd, drmModeModeInfo *mode_default)
+get_lowres_mode(int drmfd, igt_output_t *output, drmModeModeInfo
 *mode_default)
 {
-	drmModeRes *mode_resources = drmModeGetResources(drmfd);
 	drmModeModeInfo mode;
 	drmModeModeInfo std_1024_mode = {
tests/kms_plane_lowres.c +10 -35
 		.clock = 65000,
@@ -64,43 +63,18 @@ get_lowres_mode(int drmfd, drmModeModeInfo
 *mode_default)
 		.type = 0x40,
 		.name = "Custom 1024x768",
 	};
-	bool found;
-	int limit = mode_default->vdisplay-SIZE;
-	int i, j;
-
-	if (!mode_resources) {
-		igt_warn("drmModeGetResources failed: %s\n",
 strerror(errno));
-		return std_1024_mode;
-	}
-
-	found = false;
-	for (i = 0; i < mode_resources->count_connectors; i++) {
-		drmModeConnector *connector;
-
-		connector = drmModeGetConnectorCurrent(drmfd,
-						       mode_resources-
 >connectors[i]);
-		if (!connector) {
-			igt_warn("could not get connector %i: %s\n",
-				 mode_resources->connectors[i],
 strerror(errno));
-			continue;
+	bool found = false;
+	int limit = mode_default->vdisplay - SIZE;
+	int j;
+
+	for (j = 0; j < output->config.connector->count_modes; j++) {
+		mode = output->config.connector->modes[j];
+		if (mode.vdisplay < limit) {
+			found = true;
+			break;
 		}
-
-		if (!connector->count_modes)
-			continue;
-
-		for (j = 0; j < connector->count_modes; j++) {
-			mode = connector->modes[j];
-			if (mode.vdisplay < limit) {
-				found = true;
-				break;
-			}
-		}
-
-		drmModeFreeConnector(connector);
 	}
 
-	drmModeFreeResources(mode_resources);
-
 	if (!found)
 		return std_1024_mode;
@@ -217,7 +191,7 @@ test_plane_position_with_output(data_t *data,
 enum pipe pipe,
 
 	mode1 = test_setup(data, pipe, modifier, output);
 
-	mode_lowres = get_lowres_mode(data->drm_fd, mode1);
+	mode_lowres = get_lowres_mode(data->drm_fd, output, mode1);
 
 	ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC);
Quoted 1 line

igt_skip_on(ret != 0);

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev