All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_available_modes_crc: Fix test to work correctly on GLK.
@ 2018-05-24  8:40 Maarten Lankhorst
  2018-05-24  9:50 ` Juha-Pekka Heikkilä
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Maarten Lankhorst @ 2018-05-24  8:40 UTC (permalink / raw)
  To: igt-dev; +Cc: Juha-Pekka Heikkilä

As the test notes, DRM_FORMAT_ARGB8888 is broken for CRC comparison,
and should not be used on gen9-gen10.

DRM_FORMAT_C8 failed on my glk, because it was running into the pitch
pixel limit when 4 * width is used. Track bpp correctly, and use it with
igt_get_fb_tile_size to get a more accurate size without reinventing
the wheel.

Cc: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_available_modes_crc.c | 181 +++++++++++++++-----------------
 1 file changed, 86 insertions(+), 95 deletions(-)

diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index da58ee563d4d..b70ef5d7d4c0 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -81,7 +81,7 @@ static void generate_comparison_crc_list(data_t *data, igt_output_t *output)
 	fbid = igt_create_color_fb(data->gfx_fd,
 				   mode->hdisplay,
 				   mode->vdisplay,
-				   intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9 ? DRM_FORMAT_XRGB8888 : DRM_FORMAT_ARGB8888,
+				   DRM_FORMAT_XRGB8888,
 				   LOCAL_DRM_FORMAT_MOD_NONE,
 				   0, 0, 0,
 				   &data->primary_fb);
@@ -120,67 +120,65 @@ static void generate_comparison_crc_list(data_t *data, igt_output_t *output)
 	igt_remove_fb(data->gfx_fd, &data->primary_fb);
 }
 
-/*
- * fill_in_fb tell in return value if selected mode should be
- * proceed to crc check
- */
-static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
-		       uint32_t format)
-{
-	signed i, c, writesize;
-	unsigned short* ptemp_16_buf;
-	unsigned int* ptemp_32_buf;
+static const struct {
+	uint32_t	fourcc;
+	char		zeropadding;
+	enum		{ BYTES_PP_1=1,
+				BYTES_PP_2=2,
+				BYTES_PP_4=4,
+				NV12,
+				P010,
+				SKIP4 } bpp;
+	uint32_t	value;
+} fillers[] = {
+	{ DRM_FORMAT_C8, 0, BYTES_PP_1, 0xff},
+	{ DRM_FORMAT_RGB565, 0, BYTES_PP_2, 0xffff},
+	{ DRM_FORMAT_XRGB8888, 0, BYTES_PP_4, 0xffffffff},
+	{ DRM_FORMAT_XBGR8888, 0, BYTES_PP_4, 0xffffffff},
 
-	const struct {
-		uint32_t	fourcc;
-		char		zeropadding;
-		enum		{ BYTES_PP_1=1,
-				  BYTES_PP_2=2,
-				  BYTES_PP_4=4,
-				  NV12,
-#if defined(DRM_FORMAT_P010) || defined(DRM_FORMAT_P012) || defined(DRM_FORMAT_P016)
-				  P010,
-#endif
-				  SKIP } bpp;
-		uint32_t	value;
-	} fillers[] = {
-		{ DRM_FORMAT_C8, 0, BYTES_PP_1, 0xff},
-		{ DRM_FORMAT_RGB565, 0, BYTES_PP_2, 0xffff},
-		{ DRM_FORMAT_XRGB8888, 0, BYTES_PP_4, 0xffffffff},
-		{ DRM_FORMAT_XBGR8888, 0, BYTES_PP_4, 0xffffffff},
-
-		/*
-		 * following two are skipped because blending seems to work
-		 * incorrectly with exception of AR24 on cursor plane.
-		 * Test still creates the planes, just filling plane
-		 * and getting crc is skipped.
-		 */
-		{ DRM_FORMAT_ARGB8888, 0, SKIP, 0xffffffff},
-		{ DRM_FORMAT_ABGR8888, 0, SKIP, 0x00ffffff},
+	/*
+	 * following two are skipped because blending seems to work
+	 * incorrectly with exception of AR24 on cursor plane.
+	 * Test still creates the planes, just filling plane
+	 * and getting crc is skipped.
+	 */
+	{ DRM_FORMAT_ARGB8888, 0, SKIP4, 0xffffffff},
+	{ DRM_FORMAT_ABGR8888, 0, SKIP4, 0x00ffffff},
 
-		{ DRM_FORMAT_XRGB2101010, 0, BYTES_PP_4, 0xffffffff},
-		{ DRM_FORMAT_XBGR2101010, 0, BYTES_PP_4, 0xffffffff},
+	{ DRM_FORMAT_XRGB2101010, 0, BYTES_PP_4, 0xffffffff},
+	{ DRM_FORMAT_XBGR2101010, 0, BYTES_PP_4, 0xffffffff},
 
-		{ DRM_FORMAT_YUYV, 0, BYTES_PP_4, 0x80eb80eb},
-		{ DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
-		{ DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
-		{ DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
+	{ DRM_FORMAT_YUYV, 0, BYTES_PP_4, 0x80eb80eb},
+	{ DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
+	{ DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
+	{ DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
 
-		/*
-		 * (semi-)planar formats
-		 */
-		{ DRM_FORMAT_NV12, 0, NV12, 0x80eb},
+	/*
+	 * (semi-)planar formats
+	 */
+	{ DRM_FORMAT_NV12, 0, NV12, 0x80eb},
 #ifdef DRM_FORMAT_P010
-		{ DRM_FORMAT_P010, 0, P010, 0x8000eb00},
+	{ DRM_FORMAT_P010, 0, P010, 0x8000eb00},
 #endif
 #ifdef DRM_FORMAT_P012
-		{ DRM_FORMAT_P012, 0, P010, 0x8000eb00},
+	{ DRM_FORMAT_P012, 0, P010, 0x8000eb00},
 #endif
 #ifdef DRM_FORMAT_P016
-		{ DRM_FORMAT_P016, 0, P010, 0x8000eb00},
+	{ DRM_FORMAT_P016, 0, P010, 0x8000eb00},
 #endif
-		{ 0, 0, 0, 0 }
-	};
+	{ 0, 0, 0, 0 }
+};
+
+/*
+ * fill_in_fb tell in return value if selected mode should be
+ * proceed to crc check
+ */
+static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
+		       uint32_t format)
+{
+	signed i, c, writesize;
+	unsigned short* ptemp_16_buf;
+	unsigned int* ptemp_32_buf;
 
 	for( i = 0; fillers[i].fourcc != 0; i++ ) {
 		if( fillers[i].fourcc == format )
@@ -213,7 +211,6 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 
 		writesize = data->size+data->size/2;
 		break;
-#if defined(DRM_FORMAT_P010) || defined(DRM_FORMAT_P012) || defined(DRM_FORMAT_P016)
 	case P010:
 		ptemp_16_buf = (unsigned short*)data->buf;
 		for (c = 0; c < data->size/2; c++)
@@ -225,8 +222,7 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 
 		writesize = data->size+data->size/2;
 		break;
-#endif
-	case SKIP:
+	case SKIP4:
 		if (fillers[i].fourcc == DRM_FORMAT_ARGB8888 &&
 		    plane->type == DRM_PLANE_TYPE_CURSOR) {
 		/*
@@ -261,67 +257,62 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 	signed ret, gemsize = 0;
 	unsigned tile_width, tile_height, stride;
 	uint32_t offsets[4] = {};
-	uint32_t* offsetpointer = NULL;
+	uint64_t tiling;
+	int bpp = 0;
+	int i;
 
 	mode = igt_output_get_mode(output);
 	if (plane->type != DRM_PLANE_TYPE_CURSOR) {
-		w = mode->hdisplay ;
+		w = mode->hdisplay;
 		h = mode->vdisplay;
+		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
 	} else {
 		drmGetCap(data->gfx_fd, DRM_CAP_CURSOR_WIDTH, &w);
 		drmGetCap(data->gfx_fd, DRM_CAP_CURSOR_HEIGHT, &h);
+		tiling = LOCAL_DRM_FORMAT_MOD_NONE;
 	}
 
-	switch(format) {
-#ifdef DRM_FORMAT_P010
-	case DRM_FORMAT_P010:
-#endif
-#ifdef DRM_FORMAT_P012
-	case DRM_FORMAT_P012:
-#endif
-#ifdef DRM_FORMAT_P016
-	case DRM_FORMAT_P016:
-#endif
-#if defined(DRM_FORMAT_P010) || defined(DRM_FORMAT_P012) || defined(DRM_FORMAT_P016)
-		tile_width = 512;
-		tile_height = 16;
-		stride = ALIGN(w*2, tile_width);
-		data->size = offsets[1] = stride*ALIGN(h, tile_height);
-		gemsize = data->size*2;
-		offsetpointer = (uint32_t*)&offsets;
+	for (i = 0; fillers[i].fourcc != 0; i++) {
+		if (fillers[i].fourcc == format)
+			break;
+	}
+
+	switch (fillers[i].bpp) {
+	case NV12:
+	case BYTES_PP_1:
+		bpp = 8;
 		break;
-#endif
-	case DRM_FORMAT_NV12:
-		tile_width = 512;
-		tile_height = 16;
-		stride = ALIGN(w, tile_width);
-		data->size = offsets[1] = stride*ALIGN(h, tile_height);
-		gemsize = data->size*2;
-		offsetpointer = (uint32_t*)&offsets;
+
+	case P010:
+	case BYTES_PP_2:
+		bpp = 16;
 		break;
-	default:
-		tile_width = 512;
-		tile_height = 16;
 
-		/*
-		 * w*4 so there's enough space
-		 */
-		stride = ALIGN(w*4, tile_width);
-		data->size = stride*ALIGN(h, tile_height);
-		offsetpointer = NULL;
-		gemsize = data->size;
+	case SKIP4:
+	case BYTES_PP_4:
+		bpp = 32;
 		break;
 	}
 
+	igt_get_fb_tile_size(data->gfx_fd, tiling, bpp,
+			     &tile_width, &tile_height);
+	stride = ALIGN(w * bpp / 8, tile_width);
+	gemsize = data->size = stride * ALIGN(h, tile_height);
+
+	if (fillers[i].bpp == P010 || fillers[i].bpp == NV12) {
+		offsets[1] = data->size;
+		gemsize = data->size * 2;
+	}
+
 	data->gem_handle = gem_create(data->gfx_fd, gemsize);
 	ret = __gem_set_tiling(data->gfx_fd, data->gem_handle,
-			       I915_TILING_NONE, stride);
+			       igt_fb_mod_to_tiling(tiling), stride);
 
 	igt_assert_eq(ret, 0);
 
 	ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
-			  stride, format, LOCAL_DRM_FORMAT_MOD_NONE,
-			  offsetpointer, LOCAL_DRM_MODE_FB_MODIFIERS,
+			  stride, format, tiling,
+			  offsets, LOCAL_DRM_MODE_FB_MODIFIERS,
 			  &data->fb.fb_id);
 
 	if(ret < 0) {
-- 
2.17.0

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

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_available_modes_crc: Fix test to work correctly on GLK.
  2018-05-24  8:40 [igt-dev] [PATCH i-g-t] tests/kms_available_modes_crc: Fix test to work correctly on GLK Maarten Lankhorst
@ 2018-05-24  9:50 ` Juha-Pekka Heikkilä
  2018-05-24 14:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Juha-Pekka Heikkilä @ 2018-05-24  9:50 UTC (permalink / raw)
  To: Maarten Lankhorst, igt-dev

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

On 24.05.2018 11:40, Maarten Lankhorst wrote:
> As the test notes, DRM_FORMAT_ARGB8888 is broken for CRC comparison,
> and should not be used on gen9-gen10.
> 
> DRM_FORMAT_C8 failed on my glk, because it was running into the pitch
> pixel limit when 4 * width is used. Track bpp correctly, and use it with
> igt_get_fb_tile_size to get a more accurate size without reinventing
> the wheel.
> 
> Cc: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>   tests/kms_available_modes_crc.c | 181 +++++++++++++++-----------------
>   1 file changed, 86 insertions(+), 95 deletions(-)
> 
> diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
> index da58ee563d4d..b70ef5d7d4c0 100644
> --- a/tests/kms_available_modes_crc.c
> +++ b/tests/kms_available_modes_crc.c
> @@ -81,7 +81,7 @@ static void generate_comparison_crc_list(data_t *data, igt_output_t *output)
>   	fbid = igt_create_color_fb(data->gfx_fd,
>   				   mode->hdisplay,
>   				   mode->vdisplay,
> -				   intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9 ? DRM_FORMAT_XRGB8888 : DRM_FORMAT_ARGB8888,
> +				   DRM_FORMAT_XRGB8888,
>   				   LOCAL_DRM_FORMAT_MOD_NONE,
>   				   0, 0, 0,
>   				   &data->primary_fb);
> @@ -120,67 +120,65 @@ static void generate_comparison_crc_list(data_t *data, igt_output_t *output)
>   	igt_remove_fb(data->gfx_fd, &data->primary_fb);
>   }
>   
> -/*
> - * fill_in_fb tell in return value if selected mode should be
> - * proceed to crc check
> - */
> -static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
> -		       uint32_t format)
> -{
> -	signed i, c, writesize;
> -	unsigned short* ptemp_16_buf;
> -	unsigned int* ptemp_32_buf;
> +static const struct {
> +	uint32_t	fourcc;
> +	char		zeropadding;
> +	enum		{ BYTES_PP_1=1,
> +				BYTES_PP_2=2,
> +				BYTES_PP_4=4,
> +				NV12,
> +				P010,
> +				SKIP4 } bpp;
> +	uint32_t	value;
> +} fillers[] = {
> +	{ DRM_FORMAT_C8, 0, BYTES_PP_1, 0xff},
> +	{ DRM_FORMAT_RGB565, 0, BYTES_PP_2, 0xffff},
> +	{ DRM_FORMAT_XRGB8888, 0, BYTES_PP_4, 0xffffffff},
> +	{ DRM_FORMAT_XBGR8888, 0, BYTES_PP_4, 0xffffffff},
>   
> -	const struct {
> -		uint32_t	fourcc;
> -		char		zeropadding;
> -		enum		{ BYTES_PP_1=1,
> -				  BYTES_PP_2=2,
> -				  BYTES_PP_4=4,
> -				  NV12,
> -#if defined(DRM_FORMAT_P010) || defined(DRM_FORMAT_P012) || defined(DRM_FORMAT_P016)
> -				  P010,
> -#endif
> -				  SKIP } bpp;
> -		uint32_t	value;
> -	} fillers[] = {
> -		{ DRM_FORMAT_C8, 0, BYTES_PP_1, 0xff},
> -		{ DRM_FORMAT_RGB565, 0, BYTES_PP_2, 0xffff},
> -		{ DRM_FORMAT_XRGB8888, 0, BYTES_PP_4, 0xffffffff},
> -		{ DRM_FORMAT_XBGR8888, 0, BYTES_PP_4, 0xffffffff},
> -
> -		/*
> -		 * following two are skipped because blending seems to work
> -		 * incorrectly with exception of AR24 on cursor plane.
> -		 * Test still creates the planes, just filling plane
> -		 * and getting crc is skipped.
> -		 */
> -		{ DRM_FORMAT_ARGB8888, 0, SKIP, 0xffffffff},
> -		{ DRM_FORMAT_ABGR8888, 0, SKIP, 0x00ffffff},
> +	/*
> +	 * following two are skipped because blending seems to work
> +	 * incorrectly with exception of AR24 on cursor plane.
> +	 * Test still creates the planes, just filling plane
> +	 * and getting crc is skipped.
> +	 */
> +	{ DRM_FORMAT_ARGB8888, 0, SKIP4, 0xffffffff},
> +	{ DRM_FORMAT_ABGR8888, 0, SKIP4, 0x00ffffff},
>   
> -		{ DRM_FORMAT_XRGB2101010, 0, BYTES_PP_4, 0xffffffff},
> -		{ DRM_FORMAT_XBGR2101010, 0, BYTES_PP_4, 0xffffffff},
> +	{ DRM_FORMAT_XRGB2101010, 0, BYTES_PP_4, 0xffffffff},
> +	{ DRM_FORMAT_XBGR2101010, 0, BYTES_PP_4, 0xffffffff},
>   
> -		{ DRM_FORMAT_YUYV, 0, BYTES_PP_4, 0x80eb80eb},
> -		{ DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
> -		{ DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
> -		{ DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
> +	{ DRM_FORMAT_YUYV, 0, BYTES_PP_4, 0x80eb80eb},
> +	{ DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
> +	{ DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
> +	{ DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
>   
> -		/*
> -		 * (semi-)planar formats
> -		 */
> -		{ DRM_FORMAT_NV12, 0, NV12, 0x80eb},
> +	/*
> +	 * (semi-)planar formats
> +	 */
> +	{ DRM_FORMAT_NV12, 0, NV12, 0x80eb},
>   #ifdef DRM_FORMAT_P010
> -		{ DRM_FORMAT_P010, 0, P010, 0x8000eb00},
> +	{ DRM_FORMAT_P010, 0, P010, 0x8000eb00},
>   #endif
>   #ifdef DRM_FORMAT_P012
> -		{ DRM_FORMAT_P012, 0, P010, 0x8000eb00},
> +	{ DRM_FORMAT_P012, 0, P010, 0x8000eb00},
>   #endif
>   #ifdef DRM_FORMAT_P016
> -		{ DRM_FORMAT_P016, 0, P010, 0x8000eb00},
> +	{ DRM_FORMAT_P016, 0, P010, 0x8000eb00},
>   #endif
> -		{ 0, 0, 0, 0 }
> -	};
> +	{ 0, 0, 0, 0 }
> +};
> +
> +/*
> + * fill_in_fb tell in return value if selected mode should be
> + * proceed to crc check
> + */
> +static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
> +		       uint32_t format)
> +{
> +	signed i, c, writesize;
> +	unsigned short* ptemp_16_buf;
> +	unsigned int* ptemp_32_buf;
>   
>   	for( i = 0; fillers[i].fourcc != 0; i++ ) {
>   		if( fillers[i].fourcc == format )
> @@ -213,7 +211,6 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
>   
>   		writesize = data->size+data->size/2;
>   		break;
> -#if defined(DRM_FORMAT_P010) || defined(DRM_FORMAT_P012) || defined(DRM_FORMAT_P016)
>   	case P010:
>   		ptemp_16_buf = (unsigned short*)data->buf;
>   		for (c = 0; c < data->size/2; c++)
> @@ -225,8 +222,7 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
>   
>   		writesize = data->size+data->size/2;
>   		break;
> -#endif
> -	case SKIP:
> +	case SKIP4:
>   		if (fillers[i].fourcc == DRM_FORMAT_ARGB8888 &&
>   		    plane->type == DRM_PLANE_TYPE_CURSOR) {
>   		/*
> @@ -261,67 +257,62 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
>   	signed ret, gemsize = 0;
>   	unsigned tile_width, tile_height, stride;
>   	uint32_t offsets[4] = {};
> -	uint32_t* offsetpointer = NULL;
> +	uint64_t tiling;
> +	int bpp = 0;
> +	int i;
>   
>   	mode = igt_output_get_mode(output);
>   	if (plane->type != DRM_PLANE_TYPE_CURSOR) {
> -		w = mode->hdisplay ;
> +		w = mode->hdisplay;
>   		h = mode->vdisplay;
> +		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
>   	} else {
>   		drmGetCap(data->gfx_fd, DRM_CAP_CURSOR_WIDTH, &w);
>   		drmGetCap(data->gfx_fd, DRM_CAP_CURSOR_HEIGHT, &h);
> +		tiling = LOCAL_DRM_FORMAT_MOD_NONE;
>   	}
>   
> -	switch(format) {
> -#ifdef DRM_FORMAT_P010
> -	case DRM_FORMAT_P010:
> -#endif
> -#ifdef DRM_FORMAT_P012
> -	case DRM_FORMAT_P012:
> -#endif
> -#ifdef DRM_FORMAT_P016
> -	case DRM_FORMAT_P016:
> -#endif
> -#if defined(DRM_FORMAT_P010) || defined(DRM_FORMAT_P012) || defined(DRM_FORMAT_P016)
> -		tile_width = 512;
> -		tile_height = 16;
> -		stride = ALIGN(w*2, tile_width);
> -		data->size = offsets[1] = stride*ALIGN(h, tile_height);
> -		gemsize = data->size*2;
> -		offsetpointer = (uint32_t*)&offsets;
> +	for (i = 0; fillers[i].fourcc != 0; i++) {
> +		if (fillers[i].fourcc == format)
> +			break;
> +	}
> +
> +	switch (fillers[i].bpp) {
> +	case NV12:
> +	case BYTES_PP_1:
> +		bpp = 8;
>   		break;
> -#endif
> -	case DRM_FORMAT_NV12:
> -		tile_width = 512;
> -		tile_height = 16;
> -		stride = ALIGN(w, tile_width);
> -		data->size = offsets[1] = stride*ALIGN(h, tile_height);
> -		gemsize = data->size*2;
> -		offsetpointer = (uint32_t*)&offsets;
> +
> +	case P010:
> +	case BYTES_PP_2:
> +		bpp = 16;
>   		break;
> -	default:
> -		tile_width = 512;
> -		tile_height = 16;
>   
> -		/*
> -		 * w*4 so there's enough space
> -		 */
> -		stride = ALIGN(w*4, tile_width);
> -		data->size = stride*ALIGN(h, tile_height);
> -		offsetpointer = NULL;
> -		gemsize = data->size;
> +	case SKIP4:
> +	case BYTES_PP_4:
> +		bpp = 32;
>   		break;
>   	}
>   
> +	igt_get_fb_tile_size(data->gfx_fd, tiling, bpp,
> +			     &tile_width, &tile_height);
> +	stride = ALIGN(w * bpp / 8, tile_width);
> +	gemsize = data->size = stride * ALIGN(h, tile_height);
> +
> +	if (fillers[i].bpp == P010 || fillers[i].bpp == NV12) {
> +		offsets[1] = data->size;
> +		gemsize = data->size * 2;
> +	}
> +
>   	data->gem_handle = gem_create(data->gfx_fd, gemsize);
>   	ret = __gem_set_tiling(data->gfx_fd, data->gem_handle,
> -			       I915_TILING_NONE, stride);
> +			       igt_fb_mod_to_tiling(tiling), stride);
>   
>   	igt_assert_eq(ret, 0);
>   
>   	ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
> -			  stride, format, LOCAL_DRM_FORMAT_MOD_NONE,
> -			  offsetpointer, LOCAL_DRM_MODE_FB_MODIFIERS,
> +			  stride, format, tiling,
> +			  offsets, LOCAL_DRM_MODE_FB_MODIFIERS,
>   			  &data->fb.fb_id);
>   
>   	if(ret < 0) {
> 
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_available_modes_crc: Fix test to work correctly on GLK.
  2018-05-24  8:40 [igt-dev] [PATCH i-g-t] tests/kms_available_modes_crc: Fix test to work correctly on GLK Maarten Lankhorst
  2018-05-24  9:50 ` Juha-Pekka Heikkilä
@ 2018-05-24 14:54 ` Patchwork
  2018-05-24 17:57 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2018-05-25  7:47 ` [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila
  3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-05-24 14:54 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

Series: tests/kms_available_modes_crc: Fix test to work correctly on GLK.
URL   : https://patchwork.freedesktop.org/series/43677/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4227 -> IGTPW_1392 =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1392 need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1392, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/43677/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1392:

  === IGT changes ===

    ==== Warnings ====

    igt@gem_exec_gttfill@basic:
      fi-pnv-d510:        SKIP -> PASS

    
== Known issues ==

  Here are the changes found in IGTPW_1392 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-cfl-s3:          PASS -> FAIL (fdo#103928, fdo#100368)

    
    ==== Possible fixes ====

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-hsw-4770:        FAIL (fdo#100368) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928


== Participating hosts (44 -> 39) ==

  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-skl-6700hq 


== Build changes ==

    * IGT: IGT_4495 -> IGTPW_1392
    * Piglit: piglit_4495 -> None

  CI_DRM_4227: a8727d3fe03770e4d523468dfbc487dfe01597d3 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1392: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1392/
  IGT_4495: 71c7a5740913d2618f44bca252669efe8a84f4c9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4495: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1392/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for tests/kms_available_modes_crc: Fix test to work correctly on GLK.
  2018-05-24  8:40 [igt-dev] [PATCH i-g-t] tests/kms_available_modes_crc: Fix test to work correctly on GLK Maarten Lankhorst
  2018-05-24  9:50 ` Juha-Pekka Heikkilä
  2018-05-24 14:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-05-24 17:57 ` Patchwork
  2018-05-25  7:47 ` [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila
  3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-05-24 17:57 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: igt-dev

== Series Details ==

Series: tests/kms_available_modes_crc: Fix test to work correctly on GLK.
URL   : https://patchwork.freedesktop.org/series/43677/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4495_full -> IGTPW_1392_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1392_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1392_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/43677/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1392_full:

  === IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-blt:
      shard-kbl:          PASS -> SKIP +2

    igt@gem_exec_schedule@deep-bsd1:
      shard-kbl:          SKIP -> PASS +1

    
== Known issues ==

  Here are the changes found in IGTPW_1392_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_hangcheck:
      shard-kbl:          NOTRUN -> DMESG-FAIL (fdo#106560)

    igt@kms_flip@plain-flip-fb-recreate:
      shard-hsw:          PASS -> FAIL (fdo#100368)

    igt@kms_flip@plain-flip-ts-check-interruptible:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_flip_tiling@flip-x-tiled:
      shard-glk:          PASS -> FAIL (fdo#104724)

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-shrfb-pgflip-blt:
      shard-glk:          PASS -> FAIL (fdo#103167, fdo#104724)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
      shard-snb:          PASS -> FAIL (fdo#104724, fdo#103166)

    igt@testdisplay:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_gtt:
      shard-kbl:          INCOMPLETE (fdo#103665) -> PASS

    igt@drv_selftest@live_hangcheck:
      shard-apl:          DMESG-FAIL (fdo#106560) -> PASS

    igt@gem_ppgtt@blt-vs-render-ctxn:
      shard-kbl:          INCOMPLETE (fdo#103665, fdo#106023) -> PASS

    igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
      shard-glk:          FAIL (fdo#105703) -> PASS +1

    {igt@kms_available_modes_crc@available_mode_test_crc}:
      shard-apl:          FAIL (fdo#106641) -> PASS
      shard-snb:          FAIL (fdo#106641) -> PASS

    igt@kms_flip@2x-flip-vs-expired-vblank:
      shard-glk:          FAIL (fdo#102887) -> PASS +1

    igt@kms_flip@plain-flip-ts-check:
      shard-hsw:          FAIL (fdo#100368) -> PASS

    igt@kms_setmode@basic:
      shard-kbl:          FAIL (fdo#99912) -> PASS

    
    ==== Warnings ====

    igt@drv_selftest@live_gtt:
      shard-glk:          FAIL -> INCOMPLETE (k.org#198133, fdo#103359)

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
  fdo#105703 https://bugs.freedesktop.org/show_bug.cgi?id=105703
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4495 -> IGTPW_1392
    * Linux: CI_DRM_4225 -> CI_DRM_4227
    * Piglit: piglit_4495 -> None

  CI_DRM_4225: 88ca72d89921db7a46dfb1492e2059e04a7b6c5e @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4227: a8727d3fe03770e4d523468dfbc487dfe01597d3 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1392: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1392/
  IGT_4495: 71c7a5740913d2618f44bca252669efe8a84f4c9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4495: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1392/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_available_modes_crc: Fix test to work correctly on GLK.
  2018-05-24  8:40 [igt-dev] [PATCH i-g-t] tests/kms_available_modes_crc: Fix test to work correctly on GLK Maarten Lankhorst
                   ` (2 preceding siblings ...)
  2018-05-24 17:57 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2018-05-25  7:47 ` Juha-Pekka Heikkila
  3 siblings, 0 replies; 5+ messages in thread
From: Juha-Pekka Heikkila @ 2018-05-25  7:47 UTC (permalink / raw)
  To: Maarten Lankhorst, igt-dev; +Cc: Juha-Pekka Heikkilä

Seems my earlier mail for this thread didn't arrive here so here's 
second time:

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>



On 24.05.2018 11:40, Maarten Lankhorst wrote:
> As the test notes, DRM_FORMAT_ARGB8888 is broken for CRC comparison,
> and should not be used on gen9-gen10.
> 
> DRM_FORMAT_C8 failed on my glk, because it was running into the pitch
> pixel limit when 4 * width is used. Track bpp correctly, and use it with
> igt_get_fb_tile_size to get a more accurate size without reinventing
> the wheel.
> 
> Cc: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>   tests/kms_available_modes_crc.c | 181 +++++++++++++++-----------------
>   1 file changed, 86 insertions(+), 95 deletions(-)
> 
> diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
> index da58ee563d4d..b70ef5d7d4c0 100644
> --- a/tests/kms_available_modes_crc.c
> +++ b/tests/kms_available_modes_crc.c
> @@ -81,7 +81,7 @@ static void generate_comparison_crc_list(data_t *data, igt_output_t *output)
>   	fbid = igt_create_color_fb(data->gfx_fd,
>   				   mode->hdisplay,
>   				   mode->vdisplay,
> -				   intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9 ? DRM_FORMAT_XRGB8888 : DRM_FORMAT_ARGB8888,
> +				   DRM_FORMAT_XRGB8888,
>   				   LOCAL_DRM_FORMAT_MOD_NONE,
>   				   0, 0, 0,
>   				   &data->primary_fb);
> @@ -120,67 +120,65 @@ static void generate_comparison_crc_list(data_t *data, igt_output_t *output)
>   	igt_remove_fb(data->gfx_fd, &data->primary_fb);
>   }
>   
> -/*
> - * fill_in_fb tell in return value if selected mode should be
> - * proceed to crc check
> - */
> -static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
> -		       uint32_t format)
> -{
> -	signed i, c, writesize;
> -	unsigned short* ptemp_16_buf;
> -	unsigned int* ptemp_32_buf;
> +static const struct {
> +	uint32_t	fourcc;
> +	char		zeropadding;
> +	enum		{ BYTES_PP_1=1,
> +				BYTES_PP_2=2,
> +				BYTES_PP_4=4,
> +				NV12,
> +				P010,
> +				SKIP4 } bpp;
> +	uint32_t	value;
> +} fillers[] = {
> +	{ DRM_FORMAT_C8, 0, BYTES_PP_1, 0xff},
> +	{ DRM_FORMAT_RGB565, 0, BYTES_PP_2, 0xffff},
> +	{ DRM_FORMAT_XRGB8888, 0, BYTES_PP_4, 0xffffffff},
> +	{ DRM_FORMAT_XBGR8888, 0, BYTES_PP_4, 0xffffffff},
>   
> -	const struct {
> -		uint32_t	fourcc;
> -		char		zeropadding;
> -		enum		{ BYTES_PP_1=1,
> -				  BYTES_PP_2=2,
> -				  BYTES_PP_4=4,
> -				  NV12,
> -#if defined(DRM_FORMAT_P010) || defined(DRM_FORMAT_P012) || defined(DRM_FORMAT_P016)
> -				  P010,
> -#endif
> -				  SKIP } bpp;
> -		uint32_t	value;
> -	} fillers[] = {
> -		{ DRM_FORMAT_C8, 0, BYTES_PP_1, 0xff},
> -		{ DRM_FORMAT_RGB565, 0, BYTES_PP_2, 0xffff},
> -		{ DRM_FORMAT_XRGB8888, 0, BYTES_PP_4, 0xffffffff},
> -		{ DRM_FORMAT_XBGR8888, 0, BYTES_PP_4, 0xffffffff},
> -
> -		/*
> -		 * following two are skipped because blending seems to work
> -		 * incorrectly with exception of AR24 on cursor plane.
> -		 * Test still creates the planes, just filling plane
> -		 * and getting crc is skipped.
> -		 */
> -		{ DRM_FORMAT_ARGB8888, 0, SKIP, 0xffffffff},
> -		{ DRM_FORMAT_ABGR8888, 0, SKIP, 0x00ffffff},
> +	/*
> +	 * following two are skipped because blending seems to work
> +	 * incorrectly with exception of AR24 on cursor plane.
> +	 * Test still creates the planes, just filling plane
> +	 * and getting crc is skipped.
> +	 */
> +	{ DRM_FORMAT_ARGB8888, 0, SKIP4, 0xffffffff},
> +	{ DRM_FORMAT_ABGR8888, 0, SKIP4, 0x00ffffff},
>   
> -		{ DRM_FORMAT_XRGB2101010, 0, BYTES_PP_4, 0xffffffff},
> -		{ DRM_FORMAT_XBGR2101010, 0, BYTES_PP_4, 0xffffffff},
> +	{ DRM_FORMAT_XRGB2101010, 0, BYTES_PP_4, 0xffffffff},
> +	{ DRM_FORMAT_XBGR2101010, 0, BYTES_PP_4, 0xffffffff},
>   
> -		{ DRM_FORMAT_YUYV, 0, BYTES_PP_4, 0x80eb80eb},
> -		{ DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
> -		{ DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
> -		{ DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
> +	{ DRM_FORMAT_YUYV, 0, BYTES_PP_4, 0x80eb80eb},
> +	{ DRM_FORMAT_YVYU, 0, BYTES_PP_4, 0x80eb80eb},
> +	{ DRM_FORMAT_VYUY, 0, BYTES_PP_4, 0xeb80eb80},
> +	{ DRM_FORMAT_UYVY, 0, BYTES_PP_4, 0xeb80eb80},
>   
> -		/*
> -		 * (semi-)planar formats
> -		 */
> -		{ DRM_FORMAT_NV12, 0, NV12, 0x80eb},
> +	/*
> +	 * (semi-)planar formats
> +	 */
> +	{ DRM_FORMAT_NV12, 0, NV12, 0x80eb},
>   #ifdef DRM_FORMAT_P010
> -		{ DRM_FORMAT_P010, 0, P010, 0x8000eb00},
> +	{ DRM_FORMAT_P010, 0, P010, 0x8000eb00},
>   #endif
>   #ifdef DRM_FORMAT_P012
> -		{ DRM_FORMAT_P012, 0, P010, 0x8000eb00},
> +	{ DRM_FORMAT_P012, 0, P010, 0x8000eb00},
>   #endif
>   #ifdef DRM_FORMAT_P016
> -		{ DRM_FORMAT_P016, 0, P010, 0x8000eb00},
> +	{ DRM_FORMAT_P016, 0, P010, 0x8000eb00},
>   #endif
> -		{ 0, 0, 0, 0 }
> -	};
> +	{ 0, 0, 0, 0 }
> +};
> +
> +/*
> + * fill_in_fb tell in return value if selected mode should be
> + * proceed to crc check
> + */
> +static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
> +		       uint32_t format)
> +{
> +	signed i, c, writesize;
> +	unsigned short* ptemp_16_buf;
> +	unsigned int* ptemp_32_buf;
>   
>   	for( i = 0; fillers[i].fourcc != 0; i++ ) {
>   		if( fillers[i].fourcc == format )
> @@ -213,7 +211,6 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
>   
>   		writesize = data->size+data->size/2;
>   		break;
> -#if defined(DRM_FORMAT_P010) || defined(DRM_FORMAT_P012) || defined(DRM_FORMAT_P016)
>   	case P010:
>   		ptemp_16_buf = (unsigned short*)data->buf;
>   		for (c = 0; c < data->size/2; c++)
> @@ -225,8 +222,7 @@ static bool fill_in_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
>   
>   		writesize = data->size+data->size/2;
>   		break;
> -#endif
> -	case SKIP:
> +	case SKIP4:
>   		if (fillers[i].fourcc == DRM_FORMAT_ARGB8888 &&
>   		    plane->type == DRM_PLANE_TYPE_CURSOR) {
>   		/*
> @@ -261,67 +257,62 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
>   	signed ret, gemsize = 0;
>   	unsigned tile_width, tile_height, stride;
>   	uint32_t offsets[4] = {};
> -	uint32_t* offsetpointer = NULL;
> +	uint64_t tiling;
> +	int bpp = 0;
> +	int i;
>   
>   	mode = igt_output_get_mode(output);
>   	if (plane->type != DRM_PLANE_TYPE_CURSOR) {
> -		w = mode->hdisplay ;
> +		w = mode->hdisplay;
>   		h = mode->vdisplay;
> +		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
>   	} else {
>   		drmGetCap(data->gfx_fd, DRM_CAP_CURSOR_WIDTH, &w);
>   		drmGetCap(data->gfx_fd, DRM_CAP_CURSOR_HEIGHT, &h);
> +		tiling = LOCAL_DRM_FORMAT_MOD_NONE;
>   	}
>   
> -	switch(format) {
> -#ifdef DRM_FORMAT_P010
> -	case DRM_FORMAT_P010:
> -#endif
> -#ifdef DRM_FORMAT_P012
> -	case DRM_FORMAT_P012:
> -#endif
> -#ifdef DRM_FORMAT_P016
> -	case DRM_FORMAT_P016:
> -#endif
> -#if defined(DRM_FORMAT_P010) || defined(DRM_FORMAT_P012) || defined(DRM_FORMAT_P016)
> -		tile_width = 512;
> -		tile_height = 16;
> -		stride = ALIGN(w*2, tile_width);
> -		data->size = offsets[1] = stride*ALIGN(h, tile_height);
> -		gemsize = data->size*2;
> -		offsetpointer = (uint32_t*)&offsets;
> +	for (i = 0; fillers[i].fourcc != 0; i++) {
> +		if (fillers[i].fourcc == format)
> +			break;
> +	}
> +
> +	switch (fillers[i].bpp) {
> +	case NV12:
> +	case BYTES_PP_1:
> +		bpp = 8;
>   		break;
> -#endif
> -	case DRM_FORMAT_NV12:
> -		tile_width = 512;
> -		tile_height = 16;
> -		stride = ALIGN(w, tile_width);
> -		data->size = offsets[1] = stride*ALIGN(h, tile_height);
> -		gemsize = data->size*2;
> -		offsetpointer = (uint32_t*)&offsets;
> +
> +	case P010:
> +	case BYTES_PP_2:
> +		bpp = 16;
>   		break;
> -	default:
> -		tile_width = 512;
> -		tile_height = 16;
>   
> -		/*
> -		 * w*4 so there's enough space
> -		 */
> -		stride = ALIGN(w*4, tile_width);
> -		data->size = stride*ALIGN(h, tile_height);
> -		offsetpointer = NULL;
> -		gemsize = data->size;
> +	case SKIP4:
> +	case BYTES_PP_4:
> +		bpp = 32;
>   		break;
>   	}
>   
> +	igt_get_fb_tile_size(data->gfx_fd, tiling, bpp,
> +			     &tile_width, &tile_height);
> +	stride = ALIGN(w * bpp / 8, tile_width);
> +	gemsize = data->size = stride * ALIGN(h, tile_height);
> +
> +	if (fillers[i].bpp == P010 || fillers[i].bpp == NV12) {
> +		offsets[1] = data->size;
> +		gemsize = data->size * 2;
> +	}
> +
>   	data->gem_handle = gem_create(data->gfx_fd, gemsize);
>   	ret = __gem_set_tiling(data->gfx_fd, data->gem_handle,
> -			       I915_TILING_NONE, stride);
> +			       igt_fb_mod_to_tiling(tiling), stride);
>   
>   	igt_assert_eq(ret, 0);
>   
>   	ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
> -			  stride, format, LOCAL_DRM_FORMAT_MOD_NONE,
> -			  offsetpointer, LOCAL_DRM_MODE_FB_MODIFIERS,
> +			  stride, format, tiling,
> +			  offsets, LOCAL_DRM_MODE_FB_MODIFIERS,
>   			  &data->fb.fb_id);
>   
>   	if(ret < 0) {
> 

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

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

end of thread, other threads:[~2018-05-25  7:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-24  8:40 [igt-dev] [PATCH i-g-t] tests/kms_available_modes_crc: Fix test to work correctly on GLK Maarten Lankhorst
2018-05-24  9:50 ` Juha-Pekka Heikkilä
2018-05-24 14:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-05-24 17:57 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-05-25  7:47 ` [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila

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.