public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [RFT i-g-t] tests/prime_vgem/basic-fence-flip: Probe display resolution
@ 2019-04-10 11:43 Tvrtko Ursulin
  2019-04-10 11:48 ` [igt-dev] " Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Tvrtko Ursulin @ 2019-04-10 11:43 UTC (permalink / raw)
  To: igt-dev; +Cc: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Some displays might not support hardcoded 1024x768.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109294
---
 tests/prime_vgem.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 60bb951c8cbe..458846add9ee 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -744,8 +744,22 @@ static void flip_to_vgem(int i915, int vgem,
 
 static void test_flip(int i915, int vgem, unsigned hang)
 {
-	struct vgem_bo bo[2];
+	drmModeModeInfo *mode = NULL;
 	uint32_t fb_id[2], handle[2], crtc_id;
+	igt_display_t display;
+	igt_output_t *output;
+	struct vgem_bo bo[2];
+	enum pipe pipe;
+
+	igt_display_require(&display, i915);
+	igt_display_require_output(&display);
+
+	for_each_pipe_with_valid_output(&display, pipe, output) {
+		mode = igt_output_get_mode(output);
+		break;
+	}
+
+	igt_assert(mode);
 
 	signal(SIGHUP, sighandler);
 
@@ -754,8 +768,8 @@ static void test_flip(int i915, int vgem, unsigned hang)
 		uint32_t offsets[4] = {};
 		int fd;
 
-		bo[i].width = 1024;
-		bo[i].height = 768;
+		bo[i].width = mode->hdisplay;
+		bo[i].height = mode->vdisplay;
 		bo[i].bpp = 32;
 		vgem_create(vgem, &bo[i]);
 
-- 
2.19.1

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-05-09 12:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-10 11:43 [Intel-gfx] [RFT i-g-t] tests/prime_vgem/basic-fence-flip: Probe display resolution Tvrtko Ursulin
2019-04-10 11:48 ` [igt-dev] " Chris Wilson
2019-04-10 12:11   ` Tvrtko Ursulin
2019-05-07  8:14     ` Tvrtko Ursulin
2019-05-09 10:51     ` Kahola, Mika
2019-05-09 12:14       ` Tvrtko Ursulin
2019-04-10 12:31 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-10 12:36   ` Tvrtko Ursulin
2019-04-10 17:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox