All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Kasireddy <vivek.kasireddy@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Subject: [PATCH i-g-t] tests/kms_rotation_crc: Use get_first_connected_output macro
Date: Fri, 20 Nov 2015 18:58:04 -0800	[thread overview]
Message-ID: <1448074684-8719-1-git-send-email-vivek.kasireddy@intel.com> (raw)
In-Reply-To: <CANkqdn14z4VV5=k+qKEQXeOrCYF9wJVeAYaqujysH-P=cSaugQ@mail.gmail.com>

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@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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2015-11-21  3:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29  2:09 [PATCH] lib/igt_kms: Introduce get_first_connected_output to retrieve a valid output Vivek Kasireddy
2015-10-29 11:05 ` Thomas Wood
2015-11-05  1:34   ` [PATCH] igt/igt_kms: Introduce get_first_connected_output (v2) Vivek Kasireddy
2015-11-13 15:59     ` Thomas Wood
2015-11-14  3:08       ` Vivek Kasireddy
2015-11-16 13:30         ` Thomas Wood
2015-11-21  2:56           ` [PATCH i-g-t v2] lib/igt_kms: Introduce get_first_connected_output macro Vivek Kasireddy
2015-11-23 13:49             ` Ander Conselvan De Oliveira
2015-11-24 12:20               ` Daniel Vetter
2015-11-24 13:03             ` Ville Syrjälä
2015-11-21  2:58           ` Vivek Kasireddy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448074684-8719-1-git-send-email-vivek.kasireddy@intel.com \
    --to=vivek.kasireddy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.