All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: Intel GFX discussion <intel-gfx@lists.freedesktop.org>
Cc: Daniel Stone <daniels@collabora.com>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Micah Fedke <micah.fedke@collabora.com>,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
	Emil Velikov <emil.velikov@collabora.com>
Subject: [i-g-t PATCH v1 2/7] tests/kms_render: Move dependency on i915 into subtest
Date: Mon, 18 Apr 2016 13:42:50 +0200	[thread overview]
Message-ID: <1460979775-21702-3-git-send-email-tomeu.vizoso@collabora.com> (raw)
In-Reply-To: <1460979775-21702-1-git-send-email-tomeu.vizoso@collabora.com>

Batchbuffers are only needed in the subtest that does the blit on the
GPU, so move that dependency into it so the other subtest can be ran on
!i915.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

 tests/kms_render.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/tests/kms_render.c b/tests/kms_render.c
index e0a2b58f6b82..72da87f19af3 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -35,9 +35,6 @@
 
 drmModeRes *resources;
 int drm_fd;
-static drm_intel_bufmgr *bufmgr;
-struct intel_batchbuffer *batch;
-uint32_t devid;
 
 enum test_flags {
 	TEST_DIRECT_RENDER	= 0x01,
@@ -70,6 +67,15 @@ static void gpu_blit(struct igt_fb *dst_fb, struct igt_fb *src_fb)
 	drm_intel_bo *dst_bo;
 	drm_intel_bo *src_bo;
 	int bpp;
+	static drm_intel_bufmgr *bufmgr;
+	struct intel_batchbuffer *batch;
+	uint32_t devid;
+
+	igt_require_intel(drm_fd);
+
+	bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
+	devid = intel_get_drm_devid(drm_fd);
+	batch = intel_batchbuffer_alloc(bufmgr, devid);
 
 	igt_assert(dst_fb->drm_format == src_fb->drm_format);
 	igt_assert(src_fb->drm_format == DRM_FORMAT_RGB565 ||
@@ -175,7 +181,8 @@ static void test_connector(const char *test_name,
 
 	igt_get_all_cairo_formats(&formats, &format_count);
 	for (i = 0; i < format_count; i++) {
-		if (intel_gen(intel_get_drm_devid(drm_fd)) < 4
+		if (is_i915_device(drm_fd)
+		    && intel_gen(intel_get_drm_devid(drm_fd)) < 4
 		    && formats[i] == DRM_FORMAT_XRGB2101010) {
 			igt_info("gen2/3 don't support 10bpc, skipping\n");
 			continue;
@@ -232,11 +239,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
-		drm_fd = drm_open_driver_master(DRIVER_INTEL);
-
-		bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
-		devid = intel_get_drm_devid(drm_fd);
-		batch = intel_batchbuffer_alloc(bufmgr, devid);
+		drm_fd = drm_open_driver_master(DRIVER_ANY);
 
 		kmstest_set_vt_graphics_mode();
 	}
-- 
2.5.5

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

  parent reply	other threads:[~2016-04-18 11:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 11:42 [i-g-t PATCH v1 0/7] Make more tests generic Tomeu Vizoso
2016-04-18 11:42 ` [i-g-t PATCH v1 1/7] tests/drm_read: Drop DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID Tomeu Vizoso
2016-04-20 13:07   ` Daniel Vetter
2016-04-18 11:42 ` Tomeu Vizoso [this message]
2016-04-18 11:42 ` [i-g-t PATCH v1 3/7] tests/kms_flip: Create tiled BOs only when needed Tomeu Vizoso
2016-04-18 11:42 ` [i-g-t PATCH v1 4/7] tests/kms_flip: Move bufmgr requirement into subtests Tomeu Vizoso
2016-04-18 11:42 ` [i-g-t PATCH v1 5/7] tests/kms_flip: Open DRM device with DRIVER_ANY Tomeu Vizoso
2016-04-18 11:42 ` [i-g-t PATCH v1 6/7] tests/kms_flip_event_leak: Use non-tiled formats Tomeu Vizoso
2016-04-18 11:42 ` [i-g-t PATCH v1 7/7] tests/kms_flip_event_leak: Open DRM device with DRIVER_ANY Tomeu Vizoso
2016-04-20 13:10 ` [i-g-t PATCH v1 0/7] Make more tests generic Daniel Vetter
2016-04-20 13:57   ` Tomeu Vizoso
2016-04-20 14:12     ` Daniel Vetter
2016-04-25 13:13       ` Tomeu Vizoso
2016-04-25 13:17         ` Tomeu Vizoso

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=1460979775-21702-3-git-send-email-tomeu.vizoso@collabora.com \
    --to=tomeu.vizoso@collabora.com \
    --cc=daniel.vetter@intel.com \
    --cc=daniels@collabora.com \
    --cc=emil.velikov@collabora.com \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=micah.fedke@collabora.com \
    /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.