All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 03/13] tests/kms_addfb: Y tiled testcases
Date: Tue,  3 Mar 2015 14:10:56 +0000	[thread overview]
Message-ID: <1425391866-15377-4-git-send-email-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <1425391866-15377-1-git-send-email-tvrtko.ursulin@linux.intel.com>

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

v2: Moved all init into fixtures.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 lib/ioctl_wrappers.h |  2 ++
 tests/kms_addfb.c    | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 3c85e8b..99fc7fd 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -157,6 +157,8 @@ struct local_drm_mode_fb_cmd2 {
 
 #define LOCAL_DRM_FORMAT_MOD_NONE	(0)
 #define LOCAL_I915_FORMAT_MOD_X_TILED	local_fourcc_mod_code(INTEL, 1)
+#define LOCAL_I915_FORMAT_MOD_Y_TILED	local_fourcc_mod_code(INTEL, 2)
+#define LOCAL_I915_FORMAT_MOD_Yf_TILED	local_fourcc_mod_code(INTEL, 3)
 
 #define LOCAL_DRM_IOCTL_MODE_ADDFB2	DRM_IOWR(0xB8, \
 						 struct local_drm_mode_fb_cmd2)
diff --git a/tests/kms_addfb.c b/tests/kms_addfb.c
index 58a23ea..28afdf0 100644
--- a/tests/kms_addfb.c
+++ b/tests/kms_addfb.c
@@ -38,6 +38,7 @@
 #include "ioctl_wrappers.h"
 #include "drmtest.h"
 #include "drm_fourcc.h"
+#include "intel_chipset.h"
 
 uint32_t gem_bo;
 uint32_t gem_bo_small;
@@ -286,12 +287,77 @@ static void addfb25_tests(int fd)
 	}
 }
 
+static void addfb25_ytile(int fd, int gen)
+{
+	struct local_drm_mode_fb_cmd2 f = {};
+	int shouldret;
+
+	igt_fixture {
+		gem_bo = gem_create(fd, 1024*1024*4);
+		igt_assert(gem_bo);
+		gem_bo_small = gem_create(fd, 1024*1023*4);
+		igt_assert(gem_bo_small);
+
+		shouldret = gen >= 9 ? 0 : -1;
+
+		memset(&f, 0, sizeof(f));
+
+		f.width = 1024;
+		f.height = 1024;
+		f.pixel_format = DRM_FORMAT_XRGB8888;
+		f.pitches[0] = 1024*4;
+		f.flags = LOCAL_DRM_MODE_FB_MODIFIERS;
+		f.modifier[0] = LOCAL_DRM_FORMAT_MOD_NONE;
+
+		f.handles[0] = gem_bo;
+	}
+
+	igt_subtest("addfb25-Y-tiled") {
+		igt_require_fb_modifiers(fd);
+
+		f.modifier[0] = LOCAL_I915_FORMAT_MOD_Y_TILED;
+		igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == shouldret);
+		if (!shouldret)
+			igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0);
+		f.fb_id = 0;
+	}
+
+	igt_subtest("addfb25-Yf-tiled") {
+		igt_require_fb_modifiers(fd);
+
+		f.modifier[0] = LOCAL_I915_FORMAT_MOD_Yf_TILED;
+		igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == shouldret);
+		if (!shouldret)
+			igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0);
+		f.fb_id = 0;
+	}
+
+	igt_subtest("addfb25-Y-tiled-small") {
+		igt_require_fb_modifiers(fd);
+		igt_require(gen >= 9);
+
+		f.modifier[0] = LOCAL_I915_FORMAT_MOD_Y_TILED;
+		f.height = 1023;
+		f.handles[0] = gem_bo_small;
+		igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) < 0 && errno == EINVAL);
+		f.fb_id = 0;
+	}
+
+	igt_fixture {
+		gem_close(fd, gem_bo);
+		gem_close(fd, gem_bo_small);
+	}
+}
+
 int fd;
+int gen;
 
 igt_main
 {
-	igt_fixture
+	igt_fixture {
 		fd = drm_open_any_master();
+		gen = intel_gen(intel_get_drm_devid(fd));
+	}
 
 	pitch_tests(fd);
 
@@ -299,6 +365,8 @@ igt_main
 
 	addfb25_tests(fd);
 
+	addfb25_ytile(fd, gen);
+
 	igt_fixture
 		close(fd);
 }
-- 
2.3.0

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

  parent reply	other threads:[~2015-03-03 14:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 14:10 [PATCH i-g-t v3 00/13] Testing the Y tiled display Tvrtko Ursulin
2015-03-03 14:10 ` [PATCH i-g-t 01/13] tests/kms_addfb: Add support for fb modifiers Tvrtko Ursulin
2015-03-03 14:10 ` [PATCH i-g-t 02/13] lib: Extract igt_buf_write_to_png() from gem_render_copy Tvrtko Ursulin
2015-03-03 16:03   ` Tvrtko Ursulin
2015-03-03 16:12     ` Gore, Tim
2015-03-03 14:10 ` Tvrtko Ursulin [this message]
2015-03-03 14:10 ` [PATCH i-g-t 04/13] lib/skl: Add gen9 specific igt_blitter_fast_copy() Tvrtko Ursulin
2015-03-03 14:10 ` [PATCH i-g-t 05/13] lib: Don't give a struct igt_buf * to fast_copy_pitch() Tvrtko Ursulin
2015-03-03 14:10 ` [PATCH i-g-t 06/13] lib: Split two helpers to build fast copy's dword0 and dword1 Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 07/13] lib: Provide a raw version of the gen9 fast copy blits Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 08/13] tiling: Convert framebuffer helpers to use fb modifiers Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 09/13] lib: Add support for new extension to the ADDFB2 ioctl Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 10/13] lib/igt_fb: Use new ADDFB2 extension for new tiling modes Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 11/13] lib: Allow the creation of Ys/Yf tiled FBs Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 12/13] testdisplay/skl: Add command line options for Yb/Yf tiled fbs Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 13/13] tests/kms_flip_tiling: Exercise Y tiling modes on Gen9+ Tvrtko Ursulin
2015-03-12 14:36 ` [PATCH i-g-t v3 00/13] Testing the Y tiled display Damien Lespiau

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=1425391866-15377-4-git-send-email-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.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.