[Intel-gfx] [PATCH i-g-t] tests/kms_rotation_crc: Use get_first_connected_output macro

Vivek Kasireddy vivek.kasireddy at intel.com
Fri Nov 20 18:58:04 PST 2015


In some cases, the only connected connector might not occupy the
first slot and hence output[0] might be empty. Therefore, use
the get_first_connected_output macro to find the output object
associated with the connected connector.

Signed-off-by: Vivek Kasireddy <vivek.kasireddy at intel.com>
---
 tests/kms_rotation_crc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index c3241cf..94b4486 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -323,14 +323,15 @@ static void test_plane_rotation_ytiled_obj(data_t *data, enum igt_plane plane_ty
 	int bpp = igt_drm_format_to_bpp(format);
 	enum igt_commit_style commit = COMMIT_LEGACY;
 	int fd = data->gfx_fd;
-	igt_output_t *output = &display->outputs[0];
+	igt_output_t *output = NULL;
 	igt_plane_t *plane;
 	drmModeModeInfo *mode;
 	unsigned int stride, size, w, h;
 	uint32_t gem_handle;
 	int ret;
 
-	igt_require(output != NULL && output->valid == true);
+	get_first_connected_output(display, output);
+	igt_require(output != NULL);
 
 	plane = igt_output_get_plane(output, plane_type);
 	igt_require(igt_plane_supports_rotation(plane));
@@ -385,7 +386,7 @@ static void test_plane_rotation_exhaust_fences(data_t *data, enum igt_plane plan
 	int bpp = igt_drm_format_to_bpp(format);
 	enum igt_commit_style commit = COMMIT_LEGACY;
 	int fd = data->gfx_fd;
-	igt_output_t *output = &display->outputs[0];
+	igt_output_t *output = NULL;
 	igt_plane_t *plane;
 	drmModeModeInfo *mode;
 	data_t data2[MAX_FENCES+1] = {};
@@ -394,7 +395,8 @@ static void test_plane_rotation_exhaust_fences(data_t *data, enum igt_plane plan
 	uint64_t total_aperture_size, total_fbs_size;
 	int i, ret;
 
-	igt_require(output != NULL && output->valid == true);
+	get_first_connected_output(display, output);
+	igt_require(output != NULL);
 
 	plane = igt_output_get_plane(output, plane_type);
 	igt_require(igt_plane_supports_rotation(plane));
-- 
2.4.3



More information about the Intel-gfx mailing list