[PATCH i-g-t 08/12] tiling: Convert framebuffer helpers to use fb modifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>

This converts the IGT API only, underneath legacy set_tiling is still used.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
---
 lib/igt_fb.c                | 20 ++++++++++----------
 lib/igt_fb.h                | 10 +++++-----
 lib/igt_kms.h               |  1 +
 tests/kms_3d.c              |  2 +-
 tests/kms_cursor_crc.c      |  8 +++++---
 tests/kms_fbc_crc.c         |  4 ++--
 tests/kms_fence_pin_leak.c  |  4 ++--
 tests/kms_flip.c            |  6 +++---
 tests/kms_flip_event_leak.c |  4 ++--
 tests/kms_flip_tiling.c     |  7 ++++---
 tests/kms_mmio_vs_cs_flip.c | 12 ++++++------
 tests/kms_pipe_crc_basic.c  |  2 +-
 tests/kms_plane.c           |  8 ++++----
 tests/kms_psr_sink_crc.c    |  8 +++++---
 tests/kms_pwrite_crc.c      |  4 ++--
 tests/kms_render.c          |  8 ++++----
 tests/kms_rotation_crc.c    |  4 ++--
 tests/kms_setmode.c         |  2 +-
 tests/kms_sink_crc_basic.c  |  6 ++++--
 tests/kms_universal_plane.c | 18 +++++++++---------
 tests/pm_lpsp.c             |  2 +-
 tests/pm_rpm.c              | 26 ++++++++++++++------------
 tests/testdisplay.c         |  4 ++--
 23 files changed, 90 insertions(+), 80 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 9b41301..853b2f9 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -75,7 +75,7 @@ static struct format_desc_struct {
 
 /* helpers to create nice-looking framebuffers */
 static int create_bo_for_fb(int fd, int width, int height, int bpp,
-			    unsigned int tiling, unsigned bo_size,
+			    uint64_t tiling, unsigned bo_size,
 			    uint32_t *gem_handle_ret,
 			    unsigned *size_ret,
 			    unsigned *stride_ret)
@@ -84,7 +84,7 @@ static int create_bo_for_fb(int fd, int width, int height, int bpp,
 	int size, ret = 0;
 	unsigned stride;
 
-	if (tiling) {
+	if (tiling != LOCAL_DRM_FORMAT_MOD_NONE) {
 		int v;
 
 		/* Round the tiling up to the next power-of-two and the
@@ -112,8 +112,8 @@ static int create_bo_for_fb(int fd, int width, int height, int bpp,
 		bo_size = size;
 	gem_handle = gem_create(fd, bo_size);
 
-	if (tiling)
-		ret = __gem_set_tiling(fd, gem_handle, tiling, stride);
+	if (tiling != LOCAL_DRM_FORMAT_MOD_NONE)
+		ret = __gem_set_tiling(fd, gem_handle, I915_TILING_X, stride);
 
 	*stride_ret = stride;
 	*size_ret = size;
@@ -385,7 +385,7 @@ void igt_paint_image(cairo_t *cr, const char *filename,
  * @width: width of the framebuffer in pixel
  * @height: height of the framebuffer in pixel
  * @format: drm fourcc pixel format code
- * @tiling: tiling layout of the framebuffer
+ * @tiling: tiling layout of the framebuffer (as framebuffer modifier)
  * @fb: pointer to an #igt_fb structure
  * @bo_size: size of the backing bo (0 for minimum needed size)
  *
@@ -401,7 +401,7 @@ void igt_paint_image(cairo_t *cr, const char *filename,
  */
 unsigned int
 igt_create_fb_with_bo_size(int fd, int width, int height,
-			   uint32_t format, unsigned int tiling,
+			   uint32_t format, uint64_t tiling,
 			   struct igt_fb *fb, unsigned bo_size)
 {
 	uint32_t handles[4];
@@ -417,7 +417,7 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
 
 	bpp = igt_drm_format_to_bpp(format);
 
-	igt_debug("%s(width=%d, height=%d, format=0x%x [bpp=%d], tiling=%d, size=%d\n",
+	igt_debug("%s(width=%d, height=%d, format=0x%x [bpp=%d], tiling=%llx, size=%d\n",
 		  __func__, width, height, format, bpp, tiling, bo_size);
 	do_or_die(create_bo_for_fb(fd, width, height, bpp, tiling, bo_size,
 				   &fb->gem_handle, &fb->size, &fb->stride));
@@ -460,7 +460,7 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
  * The kms id of the created framebuffer.
  */
 unsigned int igt_create_fb(int fd, int width, int height, uint32_t format,
-			   unsigned int tiling, struct igt_fb *fb)
+			   uint64_t tiling, struct igt_fb *fb)
 {
 	return igt_create_fb_with_bo_size(fd, width, height, format, tiling, fb, 0);
 }
@@ -489,7 +489,7 @@ unsigned int igt_create_fb(int fd, int width, int height, uint32_t format,
  * failure.
  */
 unsigned int igt_create_color_fb(int fd, int width, int height,
-				 uint32_t format, unsigned int tiling,
+				 uint32_t format, uint64_t tiling,
 				 double r, double g, double b,
 				 struct igt_fb *fb /* out */)
 {
@@ -583,7 +583,7 @@ static void stereo_fb_layout_from_mode(struct stereo_fb_layout *layout,
  * failure.
  */
 unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode,
-				  uint32_t format, unsigned int tiling)
+				  uint32_t format, uint64_t tiling)
 {
 	struct stereo_fb_layout layout;
 	cairo_t *cr;
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index d9fb6bb..bafafcd 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -51,7 +51,7 @@ struct igt_fb {
 	int width;
 	int height;
 	unsigned stride;
-	unsigned tiling;
+	uint64_t tiling;
 	unsigned size;
 	cairo_surface_t *cairo_surface;
 };
@@ -67,16 +67,16 @@ enum igt_text_align {
 
 unsigned int
 igt_create_fb_with_bo_size(int fd, int width, int height,
-			   uint32_t format, unsigned int tiling,
+			   uint32_t format, uint64_t tiling,
 			   struct igt_fb *fb, unsigned bo_size);
 unsigned int igt_create_fb(int fd, int width, int height, uint32_t format,
-			   unsigned int tiling, struct igt_fb *fb);
+			   uint64_t tiling, struct igt_fb *fb);
 unsigned int igt_create_color_fb(int fd, int width, int height,
-				 uint32_t format, unsigned int tiling,
+				 uint32_t format, uint64_t tiling,
 				 double r, double g, double b,
 				 struct igt_fb *fb /* out */);
 unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode,
-				  uint32_t format, unsigned int tiling);
+				  uint32_t format, uint64_t tiling);
 void igt_remove_fb(int fd, struct igt_fb *fb);
 
 /* cairo-based painting */
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index a1483a4..565df14 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -35,6 +35,7 @@
 #include <xf86drmMode.h>
 
 #include "igt_fb.h"
+#include "ioctl_wrappers.h"
 
 /* Low-level helpers with kmstest_ prefix */
 
diff --git a/tests/kms_3d.c b/tests/kms_3d.c
index 6588d9d..fdc05b1 100644
--- a/tests/kms_3d.c
+++ b/tests/kms_3d.c
@@ -103,7 +103,7 @@ igt_simple_main
 		/* create stereo framebuffer */
 		fb_id = igt_create_stereo_fb(drm_fd, &connector->modes[i],
 					     igt_bpp_depth_to_drm_format(32, 32),
-					     I915_TILING_NONE);
+					     LOCAL_DRM_FORMAT_MOD_NONE);
 
 		ret = drmModeSetCrtc(drm_fd, config.crtc->crtc_id, fb_id, 0, 0,
 				     &connector->connector_id, 1,
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 64fea12..98c2867 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -279,7 +279,7 @@ static bool prepare_crtc(data_t *data, igt_output_t *output,
 	mode = igt_output_get_mode(output);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_NONE,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    0.0, 0.0, 0.0,
 			    &data->primary_fb);
 
@@ -384,7 +384,8 @@ static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
 	 * with non-square cursors).
 	 */
 	fb_id = igt_create_color_fb(data->drm_fd, cur_w, cur_h + 1,
-				    DRM_FORMAT_ARGB8888, I915_TILING_NONE,
+				    DRM_FORMAT_ARGB8888,
+				    LOCAL_DRM_FORMAT_MOD_NONE,
 				    1.0, 1.0, 1.0,
 				    &data->fb);
 
@@ -419,7 +420,8 @@ static void test_cursor_size(data_t *data)
 	 * smaller ones to see that the size is applied correctly
 	 */
 	fb_id = igt_create_fb(data->drm_fd, cursor_max_size, cursor_max_size,
-			      DRM_FORMAT_ARGB8888, I915_TILING_NONE, &data->fb);
+			      DRM_FORMAT_ARGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
+			      &data->fb);
 	igt_assert(fb_id);
 
 	/* Use a solid white rectangle as the cursor */
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c
index 32c3d98..b6de218 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -324,12 +324,12 @@ static bool prepare_test(data_t *data, enum test_mode test_mode)
 
 	data->fb_id[0] = igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 					     DRM_FORMAT_XRGB8888,
-					     I915_TILING_X,
+					     LOCAL_I915_FORMAT_MOD_X_TILED,
 					     0.0, 0.0, 0.0, &data->fb[0]);
 	igt_assert(data->fb_id[0]);
 	data->fb_id[1] = igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 					     DRM_FORMAT_XRGB8888,
-					     I915_TILING_X,
+					     LOCAL_I915_FORMAT_MOD_X_TILED,
 					     0.1, 0.1, 0.1,
 					     &data->fb[1]);
 	igt_assert(data->fb_id[1]);
diff --git a/tests/kms_fence_pin_leak.c b/tests/kms_fence_pin_leak.c
index 7f530e6..4d3d37a 100644
--- a/tests/kms_fence_pin_leak.c
+++ b/tests/kms_fence_pin_leak.c
@@ -131,12 +131,12 @@ static bool run_single_test(data_t *data, enum pipe pipe, igt_output_t *output)
 
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_X, /* need a fence so must be tiled */
+			    LOCAL_I915_FORMAT_MOD_X_TILED , /* need a fence so must be tiled */
 			    0.0, 0.0, 0.0,
 			    &fb[0]);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_X, /* need a fence so must be tiled */
+			    LOCAL_I915_FORMAT_MOD_X_TILED, /* need a fence so must be tiled */
 			    0.0, 0.0, 0.0,
 			    &fb[1]);
 
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index b843478..c7c093e 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1325,7 +1325,7 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
 	char test_name[128];
 	unsigned elapsed;
 	unsigned bo_size = 0;
-	unsigned int tiling;
+	uint64_t tiling;
 	int i;
 
 	switch (crtc_count) {
@@ -1357,9 +1357,9 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
 	if (o->flags & TEST_PAN)
 		o->fb_width *= 2;
 
-	tiling = I915_TILING_NONE;
+	tiling = LOCAL_DRM_FORMAT_MOD_NONE;
 	if (o->flags & TEST_FENCE_STRESS)
-		tiling = I915_TILING_X;
+		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
 
 	/* 256 MB is usually the maximum mappable aperture,
 	 * (make it 4x times that to ensure failure) */
diff --git a/tests/kms_flip_event_leak.c b/tests/kms_flip_event_leak.c
index 8a5e6db..a18a6f9 100644
--- a/tests/kms_flip_event_leak.c
+++ b/tests/kms_flip_event_leak.c
@@ -67,7 +67,7 @@ static bool test(data_t *data, enum pipe pipe, igt_output_t *output)
 
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    true, /* tiled */
+			    LOCAL_I915_FORMAT_MOD_X_TILED,
 			    0.0, 0.0, 0.0, &fb[0]);
 
 	igt_plane_set_fb(primary, &fb[0]);
@@ -83,7 +83,7 @@ static bool test(data_t *data, enum pipe pipe, igt_output_t *output)
 
 	igt_create_color_fb(fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    true, /* tiled */
+			    LOCAL_I915_FORMAT_MOD_X_TILED,
 			    0.0, 0.0, 0.0, &fb[1]);
 	ret = drmModePageFlip(fd, output->config.crtc->crtc_id,
 			      fb[1].fb_id, DRM_MODE_PAGE_FLIP_EVENT,
diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
index 9bc085b..9adf143 100644
--- a/tests/kms_flip_tiling.c
+++ b/tests/kms_flip_tiling.c
@@ -84,7 +84,8 @@ test_flip_changes_tiling(data_t *data, igt_output_t *output)
 	while (width < mode->hdisplay)
 		width *= 2;
 	fb_id = igt_create_fb(data->drm_fd, width, mode->vdisplay,
-			      DRM_FORMAT_XRGB8888, I915_TILING_NONE, &linear);
+			      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
+			      &linear);
 
 	/* fill it with a pattern that will look wrong if tiling is wrong */
 	fill_linear_fb(&linear, data, mode);
@@ -96,8 +97,8 @@ test_flip_changes_tiling(data_t *data, igt_output_t *output)
 
 	/* allocate a tiled buffer and set the crtc with it */
 	igt_create_color_fb(data->drm_fd, width, mode->vdisplay,
-			    DRM_FORMAT_XRGB8888, I915_TILING_X, 0.0, 0.0, 0.0,
-			    &tiled);
+			    DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_X_TILED,
+			    0.0, 0.0, 0.0, &tiled);
 	igt_plane_set_fb(primary, &tiled);
 	igt_display_commit(&data->display);
 
diff --git a/tests/kms_mmio_vs_cs_flip.c b/tests/kms_mmio_vs_cs_flip.c
index 00557aa..1deddd2 100644
--- a/tests/kms_mmio_vs_cs_flip.c
+++ b/tests/kms_mmio_vs_cs_flip.c
@@ -218,17 +218,17 @@ test_plane(data_t *data, igt_output_t *output, enum pipe pipe, enum igt_plane pl
 	mode = igt_output_get_mode(output);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_NONE,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    1.0, 0.0, 0.0,
 			    &red_fb);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_NONE,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    0.0, 1.0, 0.0,
 			    &green_fb);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_NONE,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    0.0, 0.0, 1.0,
 			    &blue_fb);
 
@@ -368,17 +368,17 @@ test_crtc(data_t *data, igt_output_t *output, enum pipe pipe)
 	mode = igt_output_get_mode(output);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay+1,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_NONE,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    1.0, 0.0, 0.0,
 			    &red_fb);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay+1,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_NONE,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    0.0, 0.0, 1.0,
 			    &blue_fb);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay+1,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_NONE,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    0.0, 1.0, 0.0,
 			    &green_fb);
 
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index a658b39..bbedd58 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -138,7 +138,7 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output,
 		igt_create_color_fb(data->drm_fd,
 					mode->hdisplay, mode->vdisplay,
 					DRM_FORMAT_XRGB8888,
-					I915_TILING_NONE,
+					LOCAL_DRM_FORMAT_MOD_NONE,
 					colors[c].r,
 					colors[c].g,
 					colors[c].b,
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index c94eac0..961dbd1 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -79,7 +79,7 @@ test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe,
 	mode = igt_output_get_mode(output);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    I915_TILING_NONE,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    fb_color->red, fb_color->green, fb_color->blue,
 			    &fb);
 	igt_plane_set_fb(primary, &fb);
@@ -131,7 +131,7 @@ create_fb_for_mode__position(data_t *data, drmModeModeInfo *mode,
 	fb_id = igt_create_fb(data->drm_fd,
 				  mode->hdisplay, mode->vdisplay,
 				  DRM_FORMAT_XRGB8888,
-				  I915_TILING_NONE,
+				  LOCAL_DRM_FORMAT_MOD_NONE,
 				  fb);
 	igt_assert(fb_id);
 
@@ -180,7 +180,7 @@ test_plane_position_with_output(data_t *data,
 	igt_create_color_fb(data->drm_fd,
 				64, 64, /* width, height */
 				DRM_FORMAT_XRGB8888,
-				I915_TILING_NONE,
+				LOCAL_DRM_FORMAT_MOD_NONE,
 				0.0, 1.0, 0.0,
 				&sprite_fb);
 	igt_plane_set_fb(sprite, &sprite_fb);
@@ -249,7 +249,7 @@ create_fb_for_mode__panning(data_t *data, drmModeModeInfo *mode,
 	fb_id = igt_create_fb(data->drm_fd,
 			      mode->hdisplay * 2, mode->vdisplay * 2,
 			      DRM_FORMAT_XRGB8888,
-			      I915_TILING_NONE,
+			      LOCAL_DRM_FORMAT_MOD_NONE,
 			      fb);
 	igt_assert(fb_id);
 
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 98b60cf..569f310 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -91,7 +91,7 @@ static void create_cursor_fb(data_t *data)
 	uint32_t fb_id;
 
 	fb_id = igt_create_fb(data->drm_fd, 64, 64,
-			      DRM_FORMAT_ARGB8888, I915_TILING_NONE,
+			      DRM_FORMAT_ARGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
 			      &data->fb_white);
 	igt_assert(fb_id);
 
@@ -421,7 +421,8 @@ static void run_test(data_t *data)
 
 		igt_create_color_fb(data->drm_fd,
 				    mode->hdisplay, mode->vdisplay,
-				    DRM_FORMAT_XRGB8888, I915_TILING_X,
+				    DRM_FORMAT_XRGB8888,
+				    LOCAL_I915_FORMAT_MOD_X_TILED,
 				    0.0, 1.0, 0.0,
 				    &data->fb_green);
 
@@ -444,7 +445,8 @@ static void run_test(data_t *data)
 		case PRIMARY:
 			igt_create_color_fb(data->drm_fd,
 					    white_h, white_v,
-					    DRM_FORMAT_XRGB8888, I915_TILING_X,
+					    DRM_FORMAT_XRGB8888,
+					    LOCAL_I915_FORMAT_MOD_X_TILED,
 					    1.0, 1.0, 1.0,
 					    &data->fb_white);
 			break;
diff --git a/tests/kms_pwrite_crc.c b/tests/kms_pwrite_crc.c
index aa1d3a3..a8e40ef 100644
--- a/tests/kms_pwrite_crc.c
+++ b/tests/kms_pwrite_crc.c
@@ -65,7 +65,7 @@ static void test(data_t *data)
 
 	/* create a non-white fb where we can pwrite later */
 	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-		      DRM_FORMAT_XRGB8888, I915_TILING_NONE, fb);
+		      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, fb);
 
 	cr = igt_get_cairo_ctx(data->drm_fd, fb);
 	igt_paint_test_pattern(cr, fb->width, fb->height);
@@ -123,7 +123,7 @@ static bool prepare_crtc(data_t *data)
 
 	/* create a white reference fb and flip to it */
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-			    DRM_FORMAT_XRGB8888, I915_TILING_NONE,
+			    DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
 			    1.0, 1.0, 1.0, &data->fb[0]);
 
 	data->primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY);
diff --git a/tests/kms_render.c b/tests/kms_render.c
index a3487dd..0434c0f 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -125,12 +125,12 @@ static int test_format(const char *test_name,
 	width = mode->hdisplay;
 	height = mode->vdisplay;
 
-	if (!igt_create_fb(drm_fd, width, height, format, I915_TILING_NONE,
-			   &fb[0]))
+	if (!igt_create_fb(drm_fd, width, height, format,
+			   LOCAL_DRM_FORMAT_MOD_NONE, &fb[0]))
 		goto err1;
 
-	if (!igt_create_fb(drm_fd, width, height, format, I915_TILING_NONE,
-			   &fb[1]))
+	if (!igt_create_fb(drm_fd, width, height, format,
+			   LOCAL_DRM_FORMAT_MOD_NONE,	&fb[1]))
 		goto err2;
 
 	if (drmModeSetCrtc(drm_fd, cconf->crtc->crtc_id, fb[0].fb_id,
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 7f09df3..a57692e 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -97,14 +97,14 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 	fb_id = igt_create_fb(data->gfx_fd,
 			mode->hdisplay, mode->vdisplay,
 			DRM_FORMAT_XRGB8888,
-			false, /* tiled */
+			LOCAL_DRM_FORMAT_MOD_NONE,
 			&data->fb);
 	igt_assert(fb_id);
 
 	fb_cursor_id = igt_create_fb(data->gfx_fd,
 				     128, 128,
 				     DRM_FORMAT_ARGB8888,
-				     false, /* tiled */
+				     LOCAL_DRM_FORMAT_MOD_NONE,
 				     &data->fb_cursor);
 	igt_assert(fb_cursor_id);
 
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index f13871e..a1a45af 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -186,7 +186,7 @@ static void create_fb_for_crtc(struct crtc_config *crtc,
 	fb_id = igt_create_fb(drm_fd, crtc->mode.hdisplay,
 				  crtc->mode.vdisplay,
 				  igt_bpp_depth_to_drm_format(bpp, depth),
-				  I915_TILING_NONE, fb_info);
+				  LOCAL_DRM_FORMAT_MOD_NONE, fb_info);
 	igt_assert(fb_id > 0);
 }
 
diff --git a/tests/kms_sink_crc_basic.c b/tests/kms_sink_crc_basic.c
index 41accf4..d2cc7ed 100644
--- a/tests/kms_sink_crc_basic.c
+++ b/tests/kms_sink_crc_basic.c
@@ -144,13 +144,15 @@ static void run_test(data_t *data)
 
 		igt_create_color_fb(data->drm_fd,
 				    mode->hdisplay, mode->vdisplay,
-				    DRM_FORMAT_XRGB8888, I915_TILING_X,
+				    DRM_FORMAT_XRGB8888,
+				    LOCAL_I915_FORMAT_MOD_X_TILED,
 				    0.0, 1.0, 0.0,
 				    &data->fb_green);
 
 		igt_create_color_fb(data->drm_fd,
 				    mode->hdisplay, mode->vdisplay,
-				    DRM_FORMAT_XRGB8888, I915_TILING_X,
+				    DRM_FORMAT_XRGB8888,
+				    LOCAL_I915_FORMAT_MOD_X_TILED,
 				    1.0, 0.0, 0.0,
 				    &data->fb_red);
 
diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index 04ff840..f2075f5 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -68,22 +68,22 @@ functional_test_init(functional_test_t *test, igt_output_t *output, enum pipe pi
 	mode = igt_output_get_mode(output);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 				DRM_FORMAT_XRGB8888,
-				false, /* tiled */
+				LOCAL_DRM_FORMAT_MOD_NONE,
 				0.0, 0.0, 0.0,
 				&test->black_fb);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 				DRM_FORMAT_XRGB8888,
-				false, /* tiled */
+				LOCAL_DRM_FORMAT_MOD_NONE,
 				0.0, 0.0, 1.0,
 				&test->blue_fb);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 				DRM_FORMAT_XRGB8888,
-				false, /* tiled */
+				LOCAL_DRM_FORMAT_MOD_NONE,
 				1.0, 1.0, 0.0,
 				&test->yellow_fb);
 	igt_create_color_fb(data->drm_fd, 100, 100,
 				DRM_FORMAT_XRGB8888,
-				false, /* tiled */
+				LOCAL_DRM_FORMAT_MOD_NONE,
 				1.0, 0.0, 0.0,
 				&test->red_fb);
 
@@ -313,19 +313,19 @@ sanity_test_init(sanity_test_t *test, igt_output_t *output, enum pipe pipe)
 	mode = igt_output_get_mode(output);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    false, /* tiled */
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    0.0, 0.0, 1.0,
 			    &test->blue_fb);
 	igt_create_color_fb(data->drm_fd,
 			    mode->hdisplay + 100, mode->vdisplay + 100,
 			    DRM_FORMAT_XRGB8888,
-			    false, /* tiled */
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    0.0, 0.0, 1.0,
 			    &test->oversized_fb);
 	igt_create_color_fb(data->drm_fd,
 			    mode->hdisplay - 100, mode->vdisplay - 100,
 			    DRM_FORMAT_XRGB8888,
-			    false, /* tiled */
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    0.0, 0.0, 1.0,
 			    &test->undersized_fb);
 
@@ -442,12 +442,12 @@ pageflip_test_init(pageflip_test_t *test, igt_output_t *output, enum pipe pipe)
 	mode = igt_output_get_mode(output);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    false, /* tiled */
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    1.0, 0.0, 0.0,
 			    &test->red_fb);
 	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 			    DRM_FORMAT_XRGB8888,
-			    false, /* tiled */
+			    LOCAL_DRM_FORMAT_MOD_NONE,
 			    0.0, 0.0, 1.0,
 			    &test->blue_fb);
 }
diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c
index 4c6b3d6..242bf94 100644
--- a/tests/pm_lpsp.c
+++ b/tests/pm_lpsp.c
@@ -85,7 +85,7 @@ static uint32_t create_fb(int drm_fd, int width, int height)
 	uint32_t buffer_id;
 
 	buffer_id = igt_create_fb(drm_fd, width, height, DRM_FORMAT_XRGB8888,
-				  I915_TILING_NONE, &fb);
+				  LOCAL_DRM_FORMAT_MOD_NONE, &fb);
 	cr = igt_get_cairo_ctx(drm_fd, &fb);
 	igt_paint_test_pattern(cr, width, height);
 	cairo_destroy(cr);
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index 84254b7..b789fba 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -285,7 +285,8 @@ static bool init_modeset_params_for_type(struct mode_set_data *data,
 		return false;
 
 	igt_create_fb(drm_fd, mode->hdisplay, mode->vdisplay,
-		      DRM_FORMAT_XRGB8888, I915_TILING_NONE, &params->fb);
+		      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
+		      &params->fb);
 	cr = igt_get_cairo_ctx(drm_fd, &params->fb);
 	igt_paint_test_pattern(cr, mode->hdisplay, mode->vdisplay);
 	cairo_destroy(cr);
@@ -1485,12 +1486,12 @@ static void cursor_subtest(bool dpms)
 	igt_require(default_mode_params);
 	crtc_id = default_mode_params->crtc_id;
 
-	igt_create_fb(drm_fd, 64, 64, DRM_FORMAT_ARGB8888, I915_TILING_NONE,
-		      &cursor_fb1);
-	igt_create_fb(drm_fd, 64, 64, DRM_FORMAT_ARGB8888, I915_TILING_NONE,
-		      &cursor_fb2);
-	igt_create_fb(drm_fd, 64, 64, DRM_FORMAT_ARGB8888, I915_TILING_X,
-		      &cursor_fb3);
+	igt_create_fb(drm_fd, 64, 64, DRM_FORMAT_ARGB8888,
+		      LOCAL_DRM_FORMAT_MOD_NONE, &cursor_fb1);
+	igt_create_fb(drm_fd, 64, 64, DRM_FORMAT_ARGB8888,
+		      LOCAL_DRM_FORMAT_MOD_NONE, &cursor_fb2);
+	igt_create_fb(drm_fd, 64, 64, DRM_FORMAT_ARGB8888,
+		      LOCAL_I915_FORMAT_MOD_X_TILED, &cursor_fb3);
 
 	fill_igt_fb(&cursor_fb1, 0xFF00FFFF);
 	fill_igt_fb(&cursor_fb2, 0xFF00FF00);
@@ -1597,7 +1598,7 @@ static void test_one_plane(bool dpms, uint32_t plane_id,
 	uint32_t crtc_id;
 	struct igt_fb plane_fb1, plane_fb2;
 	int32_t crtc_x = 0, crtc_y = 0;
-	unsigned int tiling;
+	uint64_t tiling;
 
 	disable_all_screens_and_wait(&ms_data);
 
@@ -1609,19 +1610,19 @@ static void test_one_plane(bool dpms, uint32_t plane_id,
 		plane_format = DRM_FORMAT_XRGB8888;
 		plane_w = 64;
 		plane_h = 64;
-		tiling = I915_TILING_X;
+		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
 		break;
 	case PLANE_PRIMARY:
 		plane_format = DRM_FORMAT_XRGB8888;
 		plane_w = default_mode_params->mode->hdisplay;
 		plane_h = default_mode_params->mode->vdisplay;
-		tiling = I915_TILING_X;
+		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
 		break;
 	case PLANE_CURSOR:
 		plane_format = DRM_FORMAT_ARGB8888;
 		plane_w = 64;
 		plane_h = 64;
-		tiling = I915_TILING_NONE;
+		tiling = LOCAL_DRM_FORMAT_MOD_NONE;
 		break;
 	default:
 		igt_assert(0);
@@ -1740,7 +1741,8 @@ static void fences_subtest(bool dpms)
 	params.connector_id = default_mode_params->connector_id;
 	params.mode = default_mode_params->mode;
 	igt_create_fb(drm_fd, params.mode->hdisplay, params.mode->vdisplay,
-		      DRM_FORMAT_XRGB8888, I915_TILING_X, &params.fb);
+		      DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_X_TILED,
+		      &params.fb);
 
 	/* Even though we passed "true" as the tiling argument, double-check
 	 * that the fb is really tiled. */
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 68bb21f..64ce4d7 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -81,7 +81,7 @@ drmModeRes *resources;
 int drm_fd, modes;
 int test_all_modes = 0, test_preferred_mode = 0, force_mode = 0, test_plane,
     test_stereo_modes;
-unsigned int tiling = I915_TILING_NONE;
+uint64_t tiling = LOCAL_DRM_FORMAT_MOD_NONE;
 int sleep_between_modes = 5;
 int do_dpms = 0; /* This aliases to DPMS_ON */
 uint32_t depth = 24, stride, bpp;
@@ -695,7 +695,7 @@ int main(int argc, char **argv)
 			test_preferred_mode = 1;
 			break;
 		case 't':
-			tiling = I915_TILING_X;
+			tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
 			break;
 		case 'r':
 			qr_code = 1;
-- 
2.3.0

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





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux