public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/gem_tiled_wc: Reuse common gem_get_tiling
@ 2019-01-11 13:57 Chris Wilson
  2019-01-11 14:01 ` [Intel-gfx] " Tvrtko Ursulin
  2019-01-11 14:30 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2019-01-11 13:57 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Tvrtko Ursulin

get_tiling == gem_get_tiling + igt_require; so do that instead of
opencoding the ioctl.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/i915/gem_tiled_wc.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/tests/i915/gem_tiled_wc.c b/tests/i915/gem_tiled_wc.c
index 65ac38510..21390729d 100644
--- a/tests/i915/gem_tiled_wc.c
+++ b/tests/i915/gem_tiled_wc.c
@@ -104,27 +104,6 @@ calculate_expected(int offset)
 	return (base_y + tile_y) * WIDTH + base_x + tile_x;
 }
 
-static void
-get_tiling(int fd, uint32_t handle, uint32_t *tiling, uint32_t *swizzle)
-{
-	struct drm_i915_gem_get_tiling2 {
-		uint32_t handle;
-		uint32_t tiling_mode;
-		uint32_t swizzle_mode;
-		uint32_t phys_swizzle_mode;
-	} arg;
-#define DRM_IOCTL_I915_GEM_GET_TILING2	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling2)
-
-	memset(&arg, 0, sizeof(arg));
-	arg.handle = handle;
-
-	do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING2, &arg);
-	igt_require(arg.phys_swizzle_mode == arg.swizzle_mode);
-
-	*tiling = arg.tiling_mode;
-	*swizzle = arg.swizzle_mode;
-}
-
 igt_simple_main
 {
 	int fd;
@@ -136,7 +115,7 @@ igt_simple_main
 	gem_require_mmap_wc(fd);
 
 	handle = create_bo(fd);
-	get_tiling(fd, handle, &tiling, &swizzle);
+	igt_require(gem_get_tiling(fd, handle, &tiling, &swizzle));
 
 	if (IS_GEN2(intel_get_drm_devid(fd))) {
 		tile_height = 16;
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-01-11 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-11 13:57 [igt-dev] [PATCH i-g-t] i915/gem_tiled_wc: Reuse common gem_get_tiling Chris Wilson
2019-01-11 14:01 ` [Intel-gfx] " Tvrtko Ursulin
2019-01-11 14:30 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

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