Skip to contentSkip to conversation

drm-uapi: Add AMD DRM Modifier update to IGT

PATCH In review Sung Joon Kim 4 participants 13 messages Feb 3, 2021 – Feb 22, 2021 Library code

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/3 drm-uapi: Add AMD DRM Modifier update to IGT

Aligns IGT drm_fourcc.h to the AMD's latest commit to this file in drm-next:
8ba16d5993749c3f31fd2b49e16f0dc1e1770b9c: drm/fourcc: Add AMD DRM modifiers.

---
 include/drm-uapi/drm_fourcc.h | 135 ++++++++++++++++++++++++++++++++++
 1 file changed, 135 insertions(+)
include/drm-uapi/drm_fourcc.h +135 -0
index 82f32780..a7bc058c 100644
@@ -1056,8 +1056,143 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
  */
 #define AMLOGIC_FBC_OPTION_MEM_SAVING		(1ULL << 0)
 
+/*
+ * AMD modifiers
+ *
+ * Memory layout:
+ *
+ * without DCC:
+ *   - main surface
+ *
+ * with DCC & without DCC_RETILE:
+ *   - main surface in plane 0
+ *   - DCC surface in plane 1 (RB-aligned, pipe-aligned if DCC_PIPE_ALIGN is set)
+ *
+ * with DCC & DCC_RETILE:
+ *   - main surface in plane 0
+ *   - displayable DCC surface in plane 1 (not RB-aligned & not pipe-aligned)
+ *   - pipe-aligned DCC surface in plane 2 (RB-aligned & pipe-aligned)
+ *
+ * For multi-plane formats the above surfaces get merged into one plane for
+ * each format plane, based on the required alignment only.
+ *
+ * Bits  Parameter                Notes
+ * ----- ------------------------ ---------------------------------------------
+ *
+ *   7:0 TILE_VERSION             Values are AMD_FMT_MOD_TILE_VER_*
+ *  12:8 TILE                     Values are AMD_FMT_MOD_TILE_<version>_*
+ *    13 DCC
+ *    14 DCC_RETILE
+ *    15 DCC_PIPE_ALIGN
+ *    16 DCC_INDEPENDENT_64B
+ *    17 DCC_INDEPENDENT_128B
+ * 19:18 DCC_MAX_COMPRESSED_BLOCK Values are AMD_FMT_MOD_DCC_BLOCK_*
+ *    20 DCC_CONSTANT_ENCODE
+ * 23:21 PIPE_XOR_BITS            Only for some chips
+ * 26:24 BANK_XOR_BITS            Only for some chips
+ * 29:27 PACKERS                  Only for some chips
+ * 32:30 RB                       Only for some chips
+ * 35:33 PIPE                     Only for some chips
+ * 55:36 -                        Reserved for future use, must be zero
+ */
+#define AMD_FMT_MOD fourcc_mod_code(AMD, 0)
+
+#define IS_AMD_FMT_MOD(val) (((val) >> 56) == DRM_FORMAT_MOD_VENDOR_AMD)
+
+/* Reserve 0 for GFX8 and older */
+#define AMD_FMT_MOD_TILE_VER_GFX9 1
+#define AMD_FMT_MOD_TILE_VER_GFX10 2
+#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3
+
+/*
+ * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical
+ * version.
+ */
+#define AMD_FMT_MOD_TILE_GFX9_64K_S 9
+
+/*
+ * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has
+ * GFX9 as canonical version.
+ */
+#define AMD_FMT_MOD_TILE_GFX9_64K_D 10
+#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25
+#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26
+#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27
+
+#define AMD_FMT_MOD_DCC_BLOCK_64B 0
+#define AMD_FMT_MOD_DCC_BLOCK_128B 1
+#define AMD_FMT_MOD_DCC_BLOCK_256B 2
+
+#define AMD_FMT_MOD_TILE_VERSION_SHIFT 0
+#define AMD_FMT_MOD_TILE_VERSION_MASK 0xFF
+#define AMD_FMT_MOD_TILE_SHIFT 8
+#define AMD_FMT_MOD_TILE_MASK 0x1F
+
+/* Whether DCC compression is enabled. */
+#define AMD_FMT_MOD_DCC_SHIFT 13
+#define AMD_FMT_MOD_DCC_MASK 0x1
+
+/*
+ * Whether to include two DCC surfaces, one which is rb & pipe aligned, and
+ * one which is not-aligned.
+ */
+#define AMD_FMT_MOD_DCC_RETILE_SHIFT 14
+#define AMD_FMT_MOD_DCC_RETILE_MASK 0x1
+
+/* Only set if DCC_RETILE = false */
+#define AMD_FMT_MOD_DCC_PIPE_ALIGN_SHIFT 15
+#define AMD_FMT_MOD_DCC_PIPE_ALIGN_MASK 0x1
+
+#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_SHIFT 16
+#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_MASK 0x1
+#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_SHIFT 17
+#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_MASK 0x1
+#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18
+#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3
+
+/*
+ * DCC supports embedding some clear colors directly in the DCC surface.
+ * However, on older GPUs the rendering HW ignores the embedded clear color
+ * and prefers the driver provided color. This necessitates doing a fastclear
+ * eliminate operation before a process transfers control.
+ *
+ * If this bit is set that means the fastclear eliminate is not needed for these
+ * embeddable colors.
+ */
+#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_SHIFT 20
+#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_MASK 0x1
+
+/*
+ * The below fields are for accounting for per GPU differences. These are only
+ * relevant for GFX9 and later and if the tile field is *_X/_T.
+ *
+ * PIPE_XOR_BITS = always needed
+ * BANK_XOR_BITS = only for TILE_VER_GFX9
+ * PACKERS = only for TILE_VER_GFX10_RBPLUS
+ * RB = only for TILE_VER_GFX9 & DCC
+ * PIPE = only for TILE_VER_GFX9 & DCC & (DCC_RETILE | DCC_PIPE_ALIGN)
+ */
+#define AMD_FMT_MOD_PIPE_XOR_BITS_SHIFT 21
+#define AMD_FMT_MOD_PIPE_XOR_BITS_MASK 0x7
+#define AMD_FMT_MOD_BANK_XOR_BITS_SHIFT 24
+#define AMD_FMT_MOD_BANK_XOR_BITS_MASK 0x7
+#define AMD_FMT_MOD_PACKERS_SHIFT 27
+#define AMD_FMT_MOD_PACKERS_MASK 0x7
+#define AMD_FMT_MOD_RB_SHIFT 30
+#define AMD_FMT_MOD_RB_MASK 0x7
+#define AMD_FMT_MOD_PIPE_SHIFT 33
+#define AMD_FMT_MOD_PIPE_MASK 0x7
+
+#define AMD_FMT_MOD_SET(field, value) \
+	((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT)
+#define AMD_FMT_MOD_GET(field, value) \
+	(((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK)
+#define AMD_FMT_MOD_CLEAR(field) \
+	(~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
+
 #if defined(__cplusplus)
 }
 #endif
 
 #endif /* DRM_FOURCC_H */
+
Signature · 6 lines
2.25.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH v3 2/3 tests/kms_rotation_crc: Add HW Rotation test case for amdgpu with tiling

Allow amdgpu to run HW rotation IGT test case
Added conditions to bypass all the requirements needed for intel when testing amdgpu. Additionally, freed unused frame buffers.
Added swizzle 64kb tiling method for amdgpu-specific.
Updated drm header for amdgpu tiling modifiers.

v2: drm_fourcc.h copied from kernel header commit:8ba16d5993749c3f31fd2b49e16f0dc1e1770b9c from drm-next. removed igt_pipe_crc_collect_crc for intel gpu. Only on AMDGPU.

v3: moved drm_fourcc.h to another patch.
Removed creating redundant fb in prepare_crtc for amdgpu. Guarded display commit for amdgpu.
Blocked cursor plane rotation for amdgpu.
Added back tiling when creating reference fb.

---
 lib/igt_amd.c            | 192 +++++++++++++++++++++++++++++++++++++++
 lib/igt_amd.h            |  14 ++-
 lib/igt_fb.c             |  36 +++++++-
 tests/kms_rotation_crc.c |  76 ++++++++++++----
 4 files changed, 299 insertions(+), 19 deletions(-)
lib/igt_amd.c +192 -0
index abd3ad96..a4e1cb59 100644
@@ -24,6 +24,29 @@
 #include "igt.h"
 #include <amdgpu_drm.h>
 
+#define X0 1
+#define X1 2
+#define X2 4
+#define X3 8
+#define X4 16
+#define X5 32
+#define X6 64
+#define X7 128
+#define Y0 1
+#define Y1 2
+#define Y2 4
+#define Y3 8
+#define Y4 16
+#define Y5 32
+#define Y6 64
+#define Y7 128
+
+struct dim2d
+{
+    int w;
+    int h;
+};
+
 uint32_t igt_amd_create_bo(int fd, uint64_t size)
 {
 	union drm_amdgpu_gem_create create;
@@ -54,3 +77,172 @@ void *igt_amd_mmap_bo(int fd, uint32_t handle, uint64_t size, int prot)
 	ptr = mmap(0, size, prot, MAP_SHARED, fd, map.out.addr_ptr);
 	return ptr == MAP_FAILED ? NULL : ptr;
 }
+
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+				       unsigned int x, unsigned int y)
+{
+    unsigned int offset = 0, index = 0;
+    unsigned int blk_size_table_index = 0, interleave = 0;
+    unsigned int channel[16] =
+				{0, 0, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1};
+    unsigned int i, v;
+
+    for (i = 0; i < 16; i++)
+    {
+        v = 0;
+        if (channel[i] == 1)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+				blk_size_table_index++;
+				interleave = (interleave + 1) >> 1;
+			}
+
+            index = blk_size_table_index + 2;
+            v ^= (x >> index) & 1;
+        }
+        else if (channel[i] == 2)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+				blk_size_table_index++;
+				interleave = (interleave + 1) >> 1;
+			}
+
+            index = blk_size_table_index;
+            v ^= (y >> index) & 1;
+        }
+
+        offset |= (v << i);
+    }
+
+	return offset;
+}
+
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp)
+{
+	unsigned int element_bytes;
+	unsigned int blk_size_table_index = 0;
+
+	element_bytes = bpp >> 3;
+
+	while (element_bytes > 1) {
+		blk_size_table_index++;
+		element_bytes = (element_bytes + 1) >> 1;
+	}
+
+	return blk_size_table_index;
+}
+
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+				       unsigned int *width, unsigned int *height)
+{
+	unsigned int blk_size_table_index;
+	unsigned int blk_size_log2, blk_size_log2_256B;
+	unsigned int width_amp, height_amp;
+
+	// swizzle 64kb tile block
+	unsigned int block256_2d[][2] = {{16, 16}, {16, 8}, {8, 8}, {8, 4}, {4, 4}};
+	blk_size_log2 = 16;
+
+	blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp);
+
+	blk_size_log2_256B = blk_size_log2 - 8;
+
+	width_amp = blk_size_log2_256B / 2;
+	height_amp = blk_size_log2_256B - width_amp;
+
+	*width  = (block256_2d[blk_size_table_index][0] << width_amp);
+	*height = (block256_2d[blk_size_table_index][1] << height_amp);
+}
+
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int x_input,
+				       unsigned int y_input, unsigned int width_input)
+{
+	unsigned int width, height, pitch;
+	unsigned int pb, yb, xb, blk_idx, blk_offset, addr;
+	unsigned int blk_size_table_index, blk_size_log2;
+	unsigned int* swizzle_pattern;
+
+	// swizzle 64kb tile block
+	unsigned int sw_64k_s[][16]=
+	{
+	    {X0, X1, X2, X3, Y0, Y1, Y2, Y3, Y4, X4, Y5, X5, Y6, X6, Y7, X7},
+	    {0,  X0, X1, X2, Y0, Y1, Y2, X3, Y3, X4, Y4, X5, Y5, X6, Y6, X7},
+	    {0,  0,  X0, X1, Y0, Y1, Y2, X2, Y3, X3, Y4, X4, Y5, X5, Y6, X6},
+	    {0,  0,  0,  X0, Y0, Y1, X1, X2, Y2, X3, Y3, X4, Y4, X5, Y5, X6},
+	    {0,  0,  0,  0,  Y0, Y1, X0, X1, Y2, X2, Y3, X3, Y4, X4, Y5, X5},
+	};
+	igt_amd_fb_calculate_tile_dimension(bpp, &width, &height);
+	blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp);
+	blk_size_log2 = 16;
+
+	pitch = (width_input + (width - 1)) & (~(width - 1));
+
+	swizzle_pattern = sw_64k_s[blk_size_table_index];
+
+	pb = pitch / width;
+	yb = y_input / height;
+	xb = x_input / width;
+	blk_idx = yb * pb + xb;
+	blk_offset = igt_amd_compute_offset(swizzle_pattern,
+					x_input << blk_size_table_index, y_input);
+	addr = (blk_idx << blk_size_log2) + blk_offset;
+
+    return (uint32_t)addr;
+}
+
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct igt_fb *src,
+				       void *src_buf, unsigned int plane)
+{
+	uint32_t src_offset, dst_offset;
+	unsigned int bpp = src->plane_bpp[plane];
+	unsigned int width = dst->plane_width[plane];
+	unsigned int height = dst->plane_height[plane];
+	unsigned int x, y;
+
+	for (y = 0; y < height; y++) {
+		for (x = 0; x < width; x++) {
+			src_offset = src->offsets[plane];
+			dst_offset = dst->offsets[plane];
+
+			src_offset += src->strides[plane] * y + x * bpp / 8;
+			dst_offset += igt_amd_fb_tiled_offset(bpp, x, y, width);
+
+			switch (bpp) {
+			case 16:
+				*(uint16_t *)(dst_buf + dst_offset) =
+					*(uint16_t *)(src_buf + src_offset);
+				break;
+			case 32:
+				*(uint32_t *)(dst_buf + dst_offset) =
+					*(uint32_t *)(src_buf + src_offset);
+				break;
+			}
+		}
+	}
+}
+
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void *dst_buf,
+				       struct igt_fb *src, void *src_buf)
+{
+	unsigned int plane;
+
+	for (plane = 0; plane < src->num_planes; plane++) {
+		igt_require(AMD_FMT_MOD_GET(TILE, dst->modifier) ==
+					AMD_FMT_MOD_TILE_GFX9_64K_S);
+		igt_amd_fb_to_tiled(dst, dst_buf, src, src_buf, plane);
+	}
+}
+
+bool igt_amd_is_tiled(uint64_t modifier)
+{
+	if (IS_AMD_FMT_MOD(modifier) && AMD_FMT_MOD_GET(TILE, modifier))
+		return true;
+	else
+		return false;
+}
lib/igt_amd.h +13 -1
index f63d26f4..6656d901 100644
@@ -24,8 +24,20 @@
 #define IGT_AMD_H
 
 #include <stdint.h>
+#include "igt_fb.h"
 
 uint32_t igt_amd_create_bo(int fd, uint64_t size);
 void *igt_amd_mmap_bo(int fd, uint32_t handle, uint64_t size, int prot);
-
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+				       unsigned int x, unsigned int y);
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp);
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+				       unsigned int *width, unsigned int *height);
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int x_input,
+				       unsigned int y_input, unsigned int width_input);
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct igt_fb *src,
+				       void *src_buf, unsigned int plane);
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void *dst_buf,
+				       struct igt_fb *src, void *src_buf);
+bool igt_amd_is_tiled(uint64_t modifier);
 #endif /* IGT_AMD_H */
lib/igt_fb.c +35 -1
index 4b9be47e..f0fcd1a7 100644
@@ -671,6 +671,17 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane)
 		 * so the easiest way is to align the luma stride to 256.
 		 */
 		return ALIGN(min_stride, 256);
+	} else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && is_amdgpu_device(fb->fd)) {
+		/*
+		 * For amdgpu device with tiling mode
+		 */
+		unsigned int tile_width, tile_height;
+
+		igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+				     &tile_width, &tile_height);
+		tile_width *= (fb->plane_bpp[plane] / 8);
+
+		return ALIGN(min_stride, tile_width);
 	} else if (is_gen12_ccs_cc_plane(fb, plane)) {
 		/* clear color always fixed to 64 bytes */
 		return 64;
@@ -711,6 +722,18 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)
 		size = roundup_power_of_two(size);
 
 		return size;
+	} else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && is_amdgpu_device(fb->fd)) {
+		/*
+		 * For amdgpu device with tiling mode
+		 */
+		unsigned int tile_width, tile_height;
+
+		igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+				     &tile_width, &tile_height);
+		tile_height *= (fb->plane_bpp[plane] / 8);
+
+		return (uint64_t) fb->strides[plane] *
+			ALIGN(fb->plane_height[plane], tile_height);
 	} else if (is_gen12_ccs_plane(fb, plane)) {
 		/* The AUX CCS surface must be page aligned */
 		return (uint64_t)fb->strides[plane] *
@@ -2352,6 +2375,12 @@ static void free_linear_mapping(struct fb_blit_upload *blit)
 
 		vc4_fb_convert_plane_to_tiled(fb, map, &linear->fb, &linear->map);
 
+		munmap(map, fb->size);
+	} else if (igt_amd_is_tiled(fb->modifier)) {
+		void *map = igt_amd_mmap_bo(fd, fb->gem_handle, fb->size, PROT_WRITE);
+
+		igt_amd_fb_convert_plane_to_tiled(fb, map, &linear->fb, linear->map);
+
 		munmap(map, fb->size);
 	} else {
 		gem_munmap(linear->map, linear->fb.size);
@@ -2419,6 +2448,10 @@ static void setup_linear_mapping(struct fb_blit_upload *blit)
 		vc4_fb_convert_plane_from_tiled(&linear->fb, &linear->map, fb, map);
 
 		munmap(map, fb->size);
+	} else if (igt_amd_is_tiled(fb->modifier)) {
+		linear->map = igt_amd_mmap_bo(fd, linear->fb.gem_handle,
+					      linear->fb.size,
+					      PROT_READ | PROT_WRITE);
 	} else {
 		/* Copy fb content to linear BO */
 		gem_set_domain(fd, linear->fb.gem_handle,
@@ -3625,7 +3658,8 @@ cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb)
 		if (use_convert(fb))
 			create_cairo_surface__convert(fd, fb);
 		else if (use_blitter(fb) || use_enginecopy(fb) ||
-			 igt_vc4_is_tiled(fb->modifier))
+			 igt_vc4_is_tiled(fb->modifier) ||
+			 igt_amd_is_tiled(fb->modifier))
 			create_cairo_surface__gpu(fd, fb);
 		else
 			create_cairo_surface__gtt(fd, fb);
tests/kms_rotation_crc.c +59 -17

144 lines not on this page · raw message

Signature · 6 lines
2.25.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Reviewed-by on v3 2/3
#2 lore raw

Re: [igt-dev] [PATCH v3 2/3] tests/kms_rotation_crc: Add HW Rotation test case for amdgpu with tiling

Quoted 9 lines · Sung Joon Kim

Allow amdgpu to run HW rotation IGT test case
Added conditions to bypass all the requirements needed for intel when testing amdgpu. Additionally, freed unused frame buffers.
Added swizzle 64kb tiling method for amdgpu-specific.
Updated drm header for amdgpu tiling modifiers.

v2: drm_fourcc.h copied from kernel header commit:8ba16d5993749c3f31fd2b49e16f0dc1e1770b9c from drm-next. removed igt_pipe_crc_collect_crc for intel gpu. Only on AMDGPU.

Quoted 7 lines

v3: moved drm_fourcc.h to another patch.
Removed creating redundant fb in prepare_crtc for amdgpu. Guarded display commit for amdgpu.
Blocked cursor plane rotation for amdgpu.
Added back tiling when creating reference fb.

This looks okay to me now. Thanks for addressing all my feedback.

I ran a smoke test of a rebase of this patch on the latest tree and the tests pass. CI results are good too, so I think this looks OK to merge.

I'll put this in on Monday or Tuesday provided there are no further concerns from Juha-Pekka or Petri Latvala.

Regards,
Nicholas Kazlauskas

Quoted 465 lines
---
  lib/igt_amd.c            | 192 +++++++++++++++++++++++++++++++++++++++
  lib/igt_amd.h            |  14 ++-
  lib/igt_fb.c             |  36 +++++++-
  tests/kms_rotation_crc.c |  76 ++++++++++++----
  4 files changed, 299 insertions(+), 19 deletions(-)
lib/igt_amd.c +192 -0
index abd3ad96..a4e1cb59 100644
@@ -24,6 +24,29 @@
  #include "igt.h"
  #include <amdgpu_drm.h>
 
+#define X0 1
+#define X1 2
+#define X2 4
+#define X3 8
+#define X4 16
+#define X5 32
+#define X6 64
+#define X7 128
+#define Y0 1
+#define Y1 2
+#define Y2 4
+#define Y3 8
+#define Y4 16
+#define Y5 32
+#define Y6 64
+#define Y7 128
+
+struct dim2d
+{
+    int w;
+    int h;
+};
+
  uint32_t igt_amd_create_bo(int fd, uint64_t size)
  {
  	union drm_amdgpu_gem_create create;
@@ -54,3 +77,172 @@ void *igt_amd_mmap_bo(int fd, uint32_t handle, uint64_t size, int prot)
  	ptr = mmap(0, size, prot, MAP_SHARED, fd, map.out.addr_ptr);
  	return ptr == MAP_FAILED ? NULL : ptr;
  }
+
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+				       unsigned int x, unsigned int y)
+{
+    unsigned int offset = 0, index = 0;
+    unsigned int blk_size_table_index = 0, interleave = 0;
+    unsigned int channel[16] =
+				{0, 0, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1};
+    unsigned int i, v;
+
+    for (i = 0; i < 16; i++)
+    {
+        v = 0;
+        if (channel[i] == 1)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+				blk_size_table_index++;
+				interleave = (interleave + 1) >> 1;
+			}
+
+            index = blk_size_table_index + 2;
+            v ^= (x >> index) & 1;
+        }
+        else if (channel[i] == 2)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+				blk_size_table_index++;
+				interleave = (interleave + 1) >> 1;
+			}
+
+            index = blk_size_table_index;
+            v ^= (y >> index) & 1;
+        }
+
+        offset |= (v << i);
+    }
+
+	return offset;
+}
+
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp)
+{
+	unsigned int element_bytes;
+	unsigned int blk_size_table_index = 0;
+
+	element_bytes = bpp >> 3;
+
+	while (element_bytes > 1) {
+		blk_size_table_index++;
+		element_bytes = (element_bytes + 1) >> 1;
+	}
+
+	return blk_size_table_index;
+}
+
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+				       unsigned int *width, unsigned int *height)
+{
+	unsigned int blk_size_table_index;
+	unsigned int blk_size_log2, blk_size_log2_256B;
+	unsigned int width_amp, height_amp;
+
+	// swizzle 64kb tile block
+	unsigned int block256_2d[][2] = {{16, 16}, {16, 8}, {8, 8}, {8, 4}, {4, 4}};
+	blk_size_log2 = 16;
+
+	blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp);
+
+	blk_size_log2_256B = blk_size_log2 - 8;
+
+	width_amp = blk_size_log2_256B / 2;
+	height_amp = blk_size_log2_256B - width_amp;
+
+	*width  = (block256_2d[blk_size_table_index][0] << width_amp);
+	*height = (block256_2d[blk_size_table_index][1] << height_amp);
+}
+
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int x_input,
+				       unsigned int y_input, unsigned int width_input)
+{
+	unsigned int width, height, pitch;
+	unsigned int pb, yb, xb, blk_idx, blk_offset, addr;
+	unsigned int blk_size_table_index, blk_size_log2;
+	unsigned int* swizzle_pattern;
+
+	// swizzle 64kb tile block
+	unsigned int sw_64k_s[][16]=
+	{
+	    {X0, X1, X2, X3, Y0, Y1, Y2, Y3, Y4, X4, Y5, X5, Y6, X6, Y7, X7},
+	    {0,  X0, X1, X2, Y0, Y1, Y2, X3, Y3, X4, Y4, X5, Y5, X6, Y6, X7},
+	    {0,  0,  X0, X1, Y0, Y1, Y2, X2, Y3, X3, Y4, X4, Y5, X5, Y6, X6},
+	    {0,  0,  0,  X0, Y0, Y1, X1, X2, Y2, X3, Y3, X4, Y4, X5, Y5, X6},
+	    {0,  0,  0,  0,  Y0, Y1, X0, X1, Y2, X2, Y3, X3, Y4, X4, Y5, X5},
+	};
+	igt_amd_fb_calculate_tile_dimension(bpp, &width, &height);
+	blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp);
+	blk_size_log2 = 16;
+
+	pitch = (width_input + (width - 1)) & (~(width - 1));
+
+	swizzle_pattern = sw_64k_s[blk_size_table_index];
+
+	pb = pitch / width;
+	yb = y_input / height;
+	xb = x_input / width;
+	blk_idx = yb * pb + xb;
+	blk_offset = igt_amd_compute_offset(swizzle_pattern,
+					x_input << blk_size_table_index, y_input);
+	addr = (blk_idx << blk_size_log2) + blk_offset;
+
+    return (uint32_t)addr;
+}
+
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct igt_fb *src,
+				       void *src_buf, unsigned int plane)
+{
+	uint32_t src_offset, dst_offset;
+	unsigned int bpp = src->plane_bpp[plane];
+	unsigned int width = dst->plane_width[plane];
+	unsigned int height = dst->plane_height[plane];
+	unsigned int x, y;
+
+	for (y = 0; y < height; y++) {
+		for (x = 0; x < width; x++) {
+			src_offset = src->offsets[plane];
+			dst_offset = dst->offsets[plane];
+
+			src_offset += src->strides[plane] * y + x * bpp / 8;
+			dst_offset += igt_amd_fb_tiled_offset(bpp, x, y, width);
+
+			switch (bpp) {
+			case 16:
+				*(uint16_t *)(dst_buf + dst_offset) =
+					*(uint16_t *)(src_buf + src_offset);
+				break;
+			case 32:
+				*(uint32_t *)(dst_buf + dst_offset) =
+					*(uint32_t *)(src_buf + src_offset);
+				break;
+			}
+		}
+	}
+}
+
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void *dst_buf,
+				       struct igt_fb *src, void *src_buf)
+{
+	unsigned int plane;
+
+	for (plane = 0; plane < src->num_planes; plane++) {
+		igt_require(AMD_FMT_MOD_GET(TILE, dst->modifier) ==
+					AMD_FMT_MOD_TILE_GFX9_64K_S);
+		igt_amd_fb_to_tiled(dst, dst_buf, src, src_buf, plane);
+	}
+}
+
+bool igt_amd_is_tiled(uint64_t modifier)
+{
+	if (IS_AMD_FMT_MOD(modifier) && AMD_FMT_MOD_GET(TILE, modifier))
+		return true;
+	else
+		return false;
+}
lib/igt_amd.h +13 -1
index f63d26f4..6656d901 100644
@@ -24,8 +24,20 @@
  #define IGT_AMD_H
 
  #include <stdint.h>
+#include "igt_fb.h"
 
  uint32_t igt_amd_create_bo(int fd, uint64_t size);
  void *igt_amd_mmap_bo(int fd, uint32_t handle, uint64_t size, int prot);
-
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+				       unsigned int x, unsigned int y);
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp);
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+				       unsigned int *width, unsigned int *height);
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int x_input,
+				       unsigned int y_input, unsigned int width_input);
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct igt_fb *src,
+				       void *src_buf, unsigned int plane);
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void *dst_buf,
+				       struct igt_fb *src, void *src_buf);
+bool igt_amd_is_tiled(uint64_t modifier);
  #endif /* IGT_AMD_H */
lib/igt_fb.c +35 -1
index 4b9be47e..f0fcd1a7 100644
@@ -671,6 +671,17 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane)
  		 * so the easiest way is to align the luma stride to 256.
  		 */
  		return ALIGN(min_stride, 256);
+	} else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && is_amdgpu_device(fb->fd)) {
+		/*
+		 * For amdgpu device with tiling mode
+		 */
+		unsigned int tile_width, tile_height;
+
+		igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+				     &tile_width, &tile_height);
+		tile_width *= (fb->plane_bpp[plane] / 8);
+
+		return ALIGN(min_stride, tile_width);
  	} else if (is_gen12_ccs_cc_plane(fb, plane)) {
  		/* clear color always fixed to 64 bytes */
  		return 64;
@@ -711,6 +722,18 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)
  		size = roundup_power_of_two(size);
 
  		return size;
+	} else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && is_amdgpu_device(fb->fd)) {
+		/*
+		 * For amdgpu device with tiling mode
+		 */
+		unsigned int tile_width, tile_height;
+
+		igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+				     &tile_width, &tile_height);
+		tile_height *= (fb->plane_bpp[plane] / 8);
+
+		return (uint64_t) fb->strides[plane] *
+			ALIGN(fb->plane_height[plane], tile_height);
  	} else if (is_gen12_ccs_plane(fb, plane)) {
  		/* The AUX CCS surface must be page aligned */
  		return (uint64_t)fb->strides[plane] *
@@ -2352,6 +2375,12 @@ static void free_linear_mapping(struct fb_blit_upload *blit)
 
  		vc4_fb_convert_plane_to_tiled(fb, map, &linear->fb, &linear->map);
 
+		munmap(map, fb->size);
+	} else if (igt_amd_is_tiled(fb->modifier)) {
+		void *map = igt_amd_mmap_bo(fd, fb->gem_handle, fb->size, PROT_WRITE);
+
+		igt_amd_fb_convert_plane_to_tiled(fb, map, &linear->fb, linear->map);
+
  		munmap(map, fb->size);
  	} else {
  		gem_munmap(linear->map, linear->fb.size);
@@ -2419,6 +2448,10 @@ static void setup_linear_mapping(struct fb_blit_upload *blit)
  		vc4_fb_convert_plane_from_tiled(&linear->fb, &linear->map, fb, map);
 
  		munmap(map, fb->size);
+	} else if (igt_amd_is_tiled(fb->modifier)) {
+		linear->map = igt_amd_mmap_bo(fd, linear->fb.gem_handle,
+					      linear->fb.size,
+					      PROT_READ | PROT_WRITE);
  	} else {
  		/* Copy fb content to linear BO */
  		gem_set_domain(fd, linear->fb.gem_handle,
@@ -3625,7 +3658,8 @@ cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb)
  		if (use_convert(fb))
  			create_cairo_surface__convert(fd, fb);
  		else if (use_blitter(fb) || use_enginecopy(fb) ||
-			 igt_vc4_is_tiled(fb->modifier))
+			 igt_vc4_is_tiled(fb->modifier) ||
+			 igt_amd_is_tiled(fb->modifier))
  			create_cairo_surface__gpu(fd, fb);
  		else
  			create_cairo_surface__gtt(fd, fb);
tests/kms_rotation_crc.c +52 -17
index e7072e20..6b0ea67c 100644
@@ -197,10 +197,14 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
  	/* create the pipe_crc object for this pipe */
  	igt_pipe_crc_free(data->pipe_crc);
 
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	/* defer crtc cleanup + crtc active for later on amd - not valid
+	 * to enable CRTC without a plane active
+	 */
+	if (!is_amdgpu_device(data->gfx_fd))
+		igt_display_commit2(display, COMMIT_ATOMIC);
  	data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
 
-	if (start_crc)
+	if (!is_amdgpu_device(data->gfx_fd) && start_crc)
  		igt_pipe_crc_start(data->pipe_crc);
  }
 
@@ -285,8 +289,14 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
  			igt_plane_set_position(plane, data->pos_x, data->pos_y);
  		igt_display_commit2(display, COMMIT_ATOMIC);
 
-		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->crc_rect[rect].flip_crc);
-		igt_remove_fb(data->gfx_fd, &data->fb_flip);
+		if (is_i915_device(data->gfx_fd)) {
+			igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+					&data->crc_rect[rect].flip_crc);
+			igt_remove_fb(data->gfx_fd, &data->fb_flip);
+		} else if (is_amdgpu_device(data->gfx_fd)) {
+			igt_pipe_crc_collect_crc(data->pipe_crc,
+					&data->crc_rect[rect].flip_crc);
+		}
 
  		/*
  		* Create a reference CRC for a software-rotated fb.
@@ -300,7 +310,14 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
  			igt_plane_set_position(plane, data->pos_x, data->pos_y);
  		igt_display_commit2(display, COMMIT_ATOMIC);
 
-		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->crc_rect[rect].ref_crc);
+		if (is_i915_device(data->gfx_fd)) {
+			igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+					&data->crc_rect[rect].ref_crc);
+		} else if (is_amdgpu_device(data->gfx_fd)) {
+			igt_pipe_crc_collect_crc(data->pipe_crc,
+					&data->crc_rect[rect].ref_crc);
+			igt_remove_fb(data->gfx_fd, &data->fb_flip);
+		}
  		data->crc_rect[rect].valid = true;
  	}
 
@@ -350,7 +367,10 @@ static void test_single_case(data_t *data, enum pipe pipe,
  	igt_assert_eq(ret, 0);
 
  	/* Check CRC */
-	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
+	if (is_i915_device(data->gfx_fd))
+		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
+	else if (is_amdgpu_device(data->gfx_fd))
+		igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
  	igt_assert_crc_equal(&data->crc_rect[rect].ref_crc, &crc_output);
 
  	/*
@@ -373,7 +393,10 @@ static void test_single_case(data_t *data, enum pipe pipe,
  			igt_assert_eq(ret, 0);
  		}
  		kmstest_wait_for_pageflip(data->gfx_fd);
-		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
+		if (is_i915_device(data->gfx_fd))
+			igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
+		else if (is_amdgpu_device(data->gfx_fd))
+			igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
  		igt_assert_crc_equal(&data->crc_rect[rect].flip_crc, &crc_output);
  	}
  }
@@ -407,6 +430,10 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
  	enum pipe pipe;
  	int pipe_count = 0;
 
+	if (is_amdgpu_device(data->gfx_fd))
+		igt_require(plane_type != DRM_PLANE_TYPE_OVERLAY &&
+					plane_type != DRM_PLANE_TYPE_CURSOR);
+
  	if (plane_type == DRM_PLANE_TYPE_CURSOR)
  		igt_require(display->has_cursor_plane);
 
@@ -419,7 +446,7 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
  		for (c = 0; c < num_rectangle_types; c++)
  			data->crc_rect[c].valid = false;
 
-		if (IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
+		if (is_i915_device(data->gfx_fd) && IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
  			continue;
 
  		/* restricting the execution to 2 pipes to reduce execution time*/
@@ -441,8 +468,9 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
  				continue;
 
  			/* Only support partial covering primary plane on gen9+ */
-			if (plane_type == DRM_PLANE_TYPE_PRIMARY &&
-			    intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9) {
+			if (is_amdgpu_device(data->gfx_fd) ||
+				(plane_type == DRM_PLANE_TYPE_PRIMARY &&
+			    intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9)) {
  				if (i != rectangle)
  					continue;
  				else
@@ -472,7 +500,9 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
  						 data->override_fmt, test_bad_format);
  			}
  		}
-		igt_pipe_crc_stop(data->pipe_crc);
+		if (is_i915_device(data->gfx_fd)) {
+			igt_pipe_crc_stop(data->pipe_crc);
+		}
  	}
  }
 
@@ -850,9 +880,11 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
  	int gen = 0;
 
  	igt_fixture {
-		data.gfx_fd = drm_open_driver_master(DRIVER_INTEL);
-		data.devid = intel_get_drm_devid(data.gfx_fd);
-		gen = intel_gen(data.devid);
+		data.gfx_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_AMDGPU);
+		if (is_i915_device(data.gfx_fd)) {
+			data.devid = intel_get_drm_devid(data.gfx_fd);
+			gen = intel_gen(data.devid);
+		}
 
  		kmstest_set_vt_graphics_mode();
 
@@ -866,9 +898,19 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
  		igt_subtest_f("%s-rotation-%s",
  			      plane_test_str(subtest->plane),
  			      rot_test_str(subtest->rot)) {
-			igt_require(!(subtest->rot &
-				    (IGT_ROTATION_90 | IGT_ROTATION_270)) ||
-				    gen >= 9);
+			if (is_i915_device(data.gfx_fd)) {
+				igt_require(!(subtest->rot &
+					    (IGT_ROTATION_90 | IGT_ROTATION_270)) ||
+					    gen >= 9);
+			} else if (is_amdgpu_device(data.gfx_fd)) {
+				data.override_fmt = DRM_FORMAT_XRGB8888;

tests/kms_rotation_crc.c igt_main_args("", long_opts, help_str, opt_handler, &data) · line 916

Quoted 10 lines
tests/kms_rotation_crc.c +7 -0
+				if (subtest->rot & (IGT_ROTATION_90 | IGT_ROTATION_270))
+					data.override_tiling = AMD_FMT_MOD |
+						AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX9_64K_S) |
+						AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX9);
+				else
+					data.override_tiling = LOCAL_DRM_FORMAT_MOD_NONE;
+			}
  			data.rotation = subtest->rot;
  			test_plane_rotation(&data, subtest->plane, false);
  		}

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw

Re: [igt-dev] [PATCH v3 2/3] tests/kms_rotation_crc: Add HW Rotation test case for amdgpu with tiling

Quoted 18 lines · Nicholas
Quoted 9 lines · Sung Joon Kim

Allow amdgpu to run HW rotation IGT test case
Added conditions to bypass all the requirements needed for intel when testing amdgpu. Additionally, freed unused frame buffers.
Added swizzle 64kb tiling method for amdgpu-specific.
Updated drm header for amdgpu tiling modifiers.

v2: drm_fourcc.h copied from kernel header commit:8ba16d5993749c3f31fd2b49e16f0dc1e1770b9c from drm-next. removed igt_pipe_crc_collect_crc for intel gpu. Only on AMDGPU.

Quoted 7 lines

v3: moved drm_fourcc.h to another patch.
Removed creating redundant fb in prepare_crtc for amdgpu. Guarded display commit for amdgpu.
Blocked cursor plane rotation for amdgpu.
Added back tiling when creating reference fb.

Quoted 7 lines

This looks okay to me now. Thanks for addressing all my feedback.

I ran a smoke test of a rebase of this patch on the latest tree and the tests pass. CI results are good too, so I think this looks OK to merge.

I'll put this in on Monday or Tuesday provided there are no further concerns from Juha-Pekka or Petri Latvala.

Hei

Sorry I had missed original patch set hence slow to comment, now my mail client picked up my name here. Generally things look all ok to me with just one exception, I wish things going to lib/ will be separated into their own patch from things going into actual test in tests/ so later when will see changes in test there will not come changes in view not in test itself.

For those amd related changes I cannot say anything because I don't have amd hw to try with. I'll put some comments below that just come to my mind.

Quoted 358 lines

Regards,
Nicholas Kazlauskas

Quoted 354 lines

---
  lib/igt_amd.c            | 192 +++++++++++++++++++++++++++++++++++++++ lib/igt_amd.h            |  14 ++-
  lib/igt_fb.c             |  36 +++++++- tests/kms_rotation_crc.c |  76 ++++++++++++----

  4 files changed, 299 insertions(+), 19 deletions(-)
lib/igt_amd.c +23 -0
index abd3ad96..a4e1cb59 100644
@@ -24,6 +24,29 @@
   #include "igt.h"
   #include <amdgpu_drm.h>
+#define X0 1
+#define X1 2
+#define X2 4
+#define X3 8
+#define X4 16
+#define X5 32
+#define X6 64
+#define X7 128
+#define Y0 1
+#define Y1 2
+#define Y2 4
+#define Y3 8
+#define Y4 16
+#define Y5 32
+#define Y6 64
+#define Y7 128
+
+struct dim2d
+{
+    int w;
+    int h;
+};
+
   uint32_t igt_amd_create_bo(int fd, uint64_t size)
   {
       union drm_amdgpu_gem_create create;
@@ -54,3 +77,172 @@ void *igt_amd_mmap_bo(int fd, uint32_t handle, 
 uint64_t size, int prot)
       ptr = mmap(0, size, prot, MAP_SHARED, fd, map.out.addr_ptr);
       return ptr == MAP_FAILED ? NULL : ptr;

  }

lib/igt_amd.c +70 -0
+
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+                       unsigned int x, unsigned int y)
+{
+    unsigned int offset = 0, index = 0;
+    unsigned int blk_size_table_index = 0, interleave = 0;
+    unsigned int channel[16] =
+                {0, 0, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1};
+    unsigned int i, v;
+
+    for (i = 0; i < 16; i++)
+    {
+        v = 0;
+        if (channel[i] == 1)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+                blk_size_table_index++;
+                interleave = (interleave + 1) >> 1;
+            }
+
+            index = blk_size_table_index + 2;
+            v ^= (x >> index) & 1;
+        }
+        else if (channel[i] == 2)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+                blk_size_table_index++;
+                interleave = (interleave + 1) >> 1;
+            }
+
+            index = blk_size_table_index;
+            v ^= (y >> index) & 1;
+        }
+
+        offset |= (v << i);
+    }
+
+    return offset;
+}
+
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp)
+{
+    unsigned int element_bytes;
+    unsigned int blk_size_table_index = 0;
+
+    element_bytes = bpp >> 3;
+
+    while (element_bytes > 1) {
+        blk_size_table_index++;
+        element_bytes = (element_bytes + 1) >> 1;
+    }
+
+    return blk_size_table_index;
+}
+
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+                       unsigned int *width, unsigned int *height)
+{
+    unsigned int blk_size_table_index;
+    unsigned int blk_size_log2, blk_size_log2_256B;
+    unsigned int width_amp, height_amp;
+
+    // swizzle 64kb tile block
+    unsigned int block256_2d[][2] = {{16, 16}, {16, 8}, {8, 8}, {8, 

4}, {4, 4}};
+    blk_size_log2 = 16;

lib/igt_amd.c +24 -0
+
+    blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp);
+
+    blk_size_log2_256B = blk_size_log2 - 8;
+
+    width_amp = blk_size_log2_256B / 2;
+    height_amp = blk_size_log2_256B - width_amp;
+
+    *width  = (block256_2d[blk_size_table_index][0] << width_amp);
+    *height = (block256_2d[blk_size_table_index][1] << height_amp);
+}
+
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int x_input,
+                       unsigned int y_input, unsigned int width_input)
+{
+    unsigned int width, height, pitch;
+    unsigned int pb, yb, xb, blk_idx, blk_offset, addr;
+    unsigned int blk_size_table_index, blk_size_log2;
+    unsigned int* swizzle_pattern;
+
+    // swizzle 64kb tile block
+    unsigned int sw_64k_s[][16]=
+    {
+        {X0, X1, X2, X3, Y0, Y1, Y2, Y3, Y4, X4, Y5, X5, Y6, X6, Y7, 

X7},
+        {0,  X0, X1, X2, Y0, Y1, Y2, X3, Y3, X4, Y4, X5, Y5, X6, Y6, X7},
+        {0,  0,  X0, X1, Y0, Y1, Y2, X2, Y3, X3, Y4, X4, Y5, X5, Y6, X6},
+        {0,  0,  0,  X0, Y0, Y1, X1, X2, Y2, X3, Y3, X4, Y4, X5, Y5, X6},
+        {0,  0,  0,  0,  Y0, Y1, X0, X1, Y2, X2, Y3, X3, Y4, X4, Y5, X5},
+    };
+    igt_amd_fb_calculate_tile_dimension(bpp, &width, &height); +    blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp); +    blk_size_log2 = 16;

lib/igt_amd.c +17 -0
+
+    pitch = (width_input + (width - 1)) & (~(width - 1));
+
+    swizzle_pattern = sw_64k_s[blk_size_table_index];
+
+    pb = pitch / width;
+    yb = y_input / height;
+    xb = x_input / width;
+    blk_idx = yb * pb + xb;
+    blk_offset = igt_amd_compute_offset(swizzle_pattern,
+                    x_input << blk_size_table_index, y_input);
+    addr = (blk_idx << blk_size_log2) + blk_offset;
+
+    return (uint32_t)addr;
+}
+
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct 

igt_fb *src,
+                       void *src_buf, unsigned int plane)

lib/igt_amd.c +30 -0
+{
+    uint32_t src_offset, dst_offset;
+    unsigned int bpp = src->plane_bpp[plane];
+    unsigned int width = dst->plane_width[plane];
+    unsigned int height = dst->plane_height[plane];
+    unsigned int x, y;
+
+    for (y = 0; y < height; y++) {
+        for (x = 0; x < width; x++) {
+            src_offset = src->offsets[plane];
+            dst_offset = dst->offsets[plane];
+
+            src_offset += src->strides[plane] * y + x * bpp / 8;
+            dst_offset += igt_amd_fb_tiled_offset(bpp, x, y, width);
+
+            switch (bpp) {
+            case 16:
+                *(uint16_t *)(dst_buf + dst_offset) =
+                    *(uint16_t *)(src_buf + src_offset);
+                break;
+            case 32:
+                *(uint32_t *)(dst_buf + dst_offset) =
+                    *(uint32_t *)(src_buf + src_offset);
+                break;
+            }
+        }
+    }
+}
+
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void 

*dst_buf,
+                       struct igt_fb *src, void *src_buf)

lib/igt_amd.c +17 -0
+{
+    unsigned int plane;
+
+    for (plane = 0; plane < src->num_planes; plane++) {
+        igt_require(AMD_FMT_MOD_GET(TILE, dst->modifier) ==
+                    AMD_FMT_MOD_TILE_GFX9_64K_S);
+        igt_amd_fb_to_tiled(dst, dst_buf, src, src_buf, plane);
+    }
+}
+
+bool igt_amd_is_tiled(uint64_t modifier)
+{
+    if (IS_AMD_FMT_MOD(modifier) && AMD_FMT_MOD_GET(TILE, modifier))
+        return true;
+    else
+        return false;
+}
lib/igt_amd.h +13 -1
index f63d26f4..6656d901 100644
@@ -24,8 +24,20 @@
   #define IGT_AMD_H
   #include <stdint.h>
+#include "igt_fb.h"
   uint32_t igt_amd_create_bo(int fd, uint64_t size);
   void *igt_amd_mmap_bo(int fd, uint32_t handle, uint64_t size, int prot);
-
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+                       unsigned int x, unsigned int y);
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp);
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+                       unsigned int *width, unsigned int *height);
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int x_input,
+                       unsigned int y_input, unsigned int width_input);
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct 
 igt_fb *src,
+                       void *src_buf, unsigned int plane);
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void 
 *dst_buf,
+                       struct igt_fb *src, void *src_buf);
+bool igt_amd_is_tiled(uint64_t modifier);
   #endif /* IGT_AMD_H */
lib/igt_fb.c +11 -0
index 4b9be47e..f0fcd1a7 100644
@@ -671,6 +671,17 @@ static uint32_t calc_plane_stride(struct igt_fb 
 *fb, int plane)
            * so the easiest way is to align the luma stride to 256.
            */
           return ALIGN(min_stride, 256);
+    } else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && 
 is_amdgpu_device(fb->fd)) {
+        /*
+         * For amdgpu device with tiling mode
+         */
+        unsigned int tile_width, tile_height;
+
+        igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+                     &tile_width, &tile_height);
+        tile_width *= (fb->plane_bpp[plane] / 8);
+
+        return ALIGN(min_stride, tile_width);
       } else if (is_gen12_ccs_cc_plane(fb, plane)) {

          /* clear color always fixed to 64 bytes */ return 64;

lib/igt_fb.c +12 -0
@@ -711,6 +722,18 @@ static uint64_t calc_plane_size(struct igt_fb 
 *fb, int plane)
           size = roundup_power_of_two(size);
           return size;
+    } else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && 
 is_amdgpu_device(fb->fd)) {
+        /*
+         * For amdgpu device with tiling mode
+         */
+        unsigned int tile_width, tile_height;
+
+        igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+                     &tile_width, &tile_height);
+        tile_height *= (fb->plane_bpp[plane] / 8);
+
+        return (uint64_t) fb->strides[plane] *
+            ALIGN(fb->plane_height[plane], tile_height);
       } else if (is_gen12_ccs_plane(fb, plane)) {
           /* The AUX CCS surface must be page aligned */

          return (uint64_t)fb->strides[plane] *

lib/igt_fb.c +6 -0
@@ -2352,6 +2375,12 @@ static void free_linear_mapping(struct 
 fb_blit_upload *blit)
           vc4_fb_convert_plane_to_tiled(fb, map, &linear->fb, &linear->map);
+        munmap(map, fb->size);
+    } else if (igt_amd_is_tiled(fb->modifier)) {
+        void *map = igt_amd_mmap_bo(fd, fb->gem_handle, fb->size, 
 PROT_WRITE);
+
+        igt_amd_fb_convert_plane_to_tiled(fb, map, &linear->fb, 
 linear->map);
+
           munmap(map, fb->size);
       } else {

          gem_munmap(linear->map, linear->fb.size);

lib/igt_fb.c +4 -0
@@ -2419,6 +2448,10 @@ static void setup_linear_mapping(struct 
 fb_blit_upload *blit)
           vc4_fb_convert_plane_from_tiled(&linear->fb, &linear->map, fb, map);
           munmap(map, fb->size);
+    } else if (igt_amd_is_tiled(fb->modifier)) {
+        linear->map = igt_amd_mmap_bo(fd, linear->fb.gem_handle,
+                          linear->fb.size,
+                          PROT_READ | PROT_WRITE);
       } else {
           /* Copy fb content to linear BO */
           gem_set_domain(fd, linear->fb.gem_handle,
@@ -3625,7 +3658,8 @@ cairo_surface_t *igt_get_cairo_surface(int fd, 
 struct igt_fb *fb)
           if (use_convert(fb))
               create_cairo_surface__convert(fd, fb);

          else if (use_blitter(fb) || use_enginecopy(fb) || -             igt_vc4_is_tiled(fb->modifier))
+             igt_vc4_is_tiled(fb->modifier) ||
+             igt_amd_is_tiled(fb->modifier)) create_cairo_surface__gpu(fd, fb); else
              create_cairo_surface__gtt(fd, fb);

tests/kms_rotation_crc.c +6 -4
index e7072e20..6b0ea67c 100644
@@ -197,10 +197,14 @@ static void prepare_crtc(data_t *data, 
 igt_output_t *output, enum pipe pipe,
       /* create the pipe_crc object for this pipe */
       igt_pipe_crc_free(data->pipe_crc);
-    igt_display_commit2(display, COMMIT_ATOMIC);
+    /* defer crtc cleanup + crtc active for later on amd - not valid
+     * to enable CRTC without a plane active
+     */
+    if (!is_amdgpu_device(data->gfx_fd))
+        igt_display_commit2(display, COMMIT_ATOMIC);
       data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
-    if (start_crc)
+    if (!is_amdgpu_device(data->gfx_fd) && start_crc)
           igt_pipe_crc_start(data->pipe_crc);
   }
@@ -285,8 +289,14 @@ static void prepare_fbs(data_t *data, 
 igt_output_t *output,
               igt_plane_set_position(plane, data->pos_x, data->pos_y);
           igt_display_commit2(display, COMMIT_ATOMIC);
-        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &data->crc_rect[rect].flip_crc);
-        igt_remove_fb(data->gfx_fd, &data->fb_flip);
Quoted 8 lines

tests/kms_rotation_crc.c static void prepare_fbs(data_t *data, igt_output_t *output, · line 299

Quoted 8 lines
tests/kms_rotation_crc.c +8 -0
+        if (is_i915_device(data->gfx_fd)) {
+            igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+                    &data->crc_rect[rect].flip_crc);
+            igt_remove_fb(data->gfx_fd, &data->fb_flip);
+        } else if (is_amdgpu_device(data->gfx_fd)) {
+            igt_pipe_crc_collect_crc(data->pipe_crc,
+                    &data->crc_rect[rect].flip_crc);
+        }

I'm ok with this change but I was wondering why is this so for amd? Driver on amd has crc counted all the time or crc buffer is very short? On intel hw restarting crc counting will waste several vblanks which can overall double execution time of this test.

If crc buffer is very short on amd there is also possibility to use igt_pipe_crc_drain(..) placed 'correctly'

Quoted 108 lines
Quoted 108 lines
tests/kms_rotation_crc.c +12 -2
           /*
           * Create a reference CRC for a software-rotated fb.
@@ -300,7 +310,14 @@ static void prepare_fbs(data_t *data, 
 igt_output_t *output,
               igt_plane_set_position(plane, data->pos_x, data->pos_y);
           igt_display_commit2(display, COMMIT_ATOMIC);
-        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &data->crc_rect[rect].ref_crc);
+        if (is_i915_device(data->gfx_fd)) {
+            igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+                    &data->crc_rect[rect].ref_crc);
+        } else if (is_amdgpu_device(data->gfx_fd)) {
+            igt_pipe_crc_collect_crc(data->pipe_crc,
+                    &data->crc_rect[rect].ref_crc);
+            igt_remove_fb(data->gfx_fd, &data->fb_flip);
+        }
           data->crc_rect[rect].valid = true;
       }
@@ -350,7 +367,10 @@ static void test_single_case(data_t *data, enum 
 pipe pipe,
       igt_assert_eq(ret, 0);
       /* Check CRC */
-    igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &crc_output);
+    if (is_i915_device(data->gfx_fd))
+        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &crc_output);
+    else if (is_amdgpu_device(data->gfx_fd))
+        igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
       igt_assert_crc_equal(&data->crc_rect[rect].ref_crc, &crc_output);

      /*

tests/kms_rotation_crc.c +4 -1
@@ -373,7 +393,10 @@ static void test_single_case(data_t *data, enum 
 pipe pipe,
               igt_assert_eq(ret, 0);
           }
           kmstest_wait_for_pageflip(data->gfx_fd);
-        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &crc_output);
+        if (is_i915_device(data->gfx_fd))
+            igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &crc_output);
+        else if (is_amdgpu_device(data->gfx_fd))
+            igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);

          igt_assert_crc_equal(&data->crc_rect[rect].flip_crc, &crc_output); }
  }

tests/kms_rotation_crc.c +0 -0
@@ -407,6 +430,10 @@ static void test_plane_rotation(data_t *data, int 

plane_type, bool test_bad_form
      enum pipe pipe;
      int pipe_count = 0;
+    if (is_amdgpu_device(data->gfx_fd))
+        igt_require(plane_type != DRM_PLANE_TYPE_OVERLAY && +                    plane_type != DRM_PLANE_TYPE_CURSOR); +
      if (plane_type == DRM_PLANE_TYPE_CURSOR) igt_require(display->has_cursor_plane);

tests/kms_rotation_crc.c +0 -0
@@ -419,7 +446,7 @@ static void test_plane_rotation(data_t *data, int 

plane_type, bool test_bad_form
          for (c = 0; c < num_rectangle_types; c++) data->crc_rect[c].valid = false;
-        if (IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
+        if (is_i915_device(data->gfx_fd) && IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
              continue;
          /* restricting the execution to 2 pipes to reduce execution time*/

tests/kms_rotation_crc.c +0 -0
@@ -441,8 +468,9 @@ static void test_plane_rotation(data_t *data, int 

plane_type, bool test_bad_form
                  continue;
              /* Only support partial covering primary plane on gen9+ */ -            if (plane_type == DRM_PLANE_TYPE_PRIMARY &&
-                intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9) { +            if (is_amdgpu_device(data->gfx_fd) ||
+                (plane_type == DRM_PLANE_TYPE_PRIMARY &&
+                intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9)) { if (i != rectangle)
                      continue;
                  else

tests/kms_rotation_crc.c +0 -0
@@ -472,7 +500,9 @@ static void test_plane_rotation(data_t *data, int 

plane_type, bool test_bad_form
                           data->override_fmt, test_bad_format); }
          }
-        igt_pipe_crc_stop(data->pipe_crc);
+        if (is_i915_device(data->gfx_fd)) {
+            igt_pipe_crc_stop(data->pipe_crc);
+        }
      }
  }

tests/kms_rotation_crc.c +5 -4
@@ -850,9 +880,11 @@ igt_main_args("", long_opts, help_str, 
 opt_handler, &data)
       int gen = 0;
       igt_fixture {
-        data.gfx_fd = drm_open_driver_master(DRIVER_INTEL);
-        data.devid = intel_get_drm_devid(data.gfx_fd);
-        gen = intel_gen(data.devid);
+        data.gfx_fd = drm_open_driver_master(DRIVER_INTEL | 
 DRIVER_AMDGPU);
+        if (is_i915_device(data.gfx_fd)) {
+            data.devid = intel_get_drm_devid(data.gfx_fd);
+            gen = intel_gen(data.devid);
+        }
           kmstest_set_vt_graphics_mode();
@@ -866,9 +898,19 @@ igt_main_args("", long_opts, help_str, 
 opt_handler, &data)
           igt_subtest_f("%s-rotation-%s",
                     plane_test_str(subtest->plane),
                     rot_test_str(subtest->rot)) {
-            igt_require(!(subtest->rot &
Quoted 8 lines

tests/kms_rotation_crc.c igt_main_args("", long_opts, help_str, opt_handler, &data) · line 906

Quoted 8 lines
tests/kms_rotation_crc.c +6 -2
-                    (IGT_ROTATION_90 | IGT_ROTATION_270)) ||
-                    gen >= 9);
+            if (is_i915_device(data.gfx_fd)) {
+                igt_require(!(subtest->rot &
+                        (IGT_ROTATION_90 | IGT_ROTATION_270)) ||
+                        gen >= 9);
+            } else if (is_amdgpu_device(data.gfx_fd)) {
+                data.override_fmt = DRM_FORMAT_XRGB8888;

I think this will cause you will get only DRM_FORMAT_XRGB8888 tested on amd and also if there's cursor plane tested it will go with DRM_FORMAT_XRGB8888.

Quoted 5 lines
Quoted 5 lines
tests/kms_rotation_crc.c +3 -0
+                if (subtest->rot & (IGT_ROTATION_90 | IGT_ROTATION_270))
+                    data.override_tiling = AMD_FMT_MOD |
+                        AMD_FMT_MOD_SET(TILE, 

AMD_FMT_MOD_TILE_GFX9_64K_S) |
+                        AMD_FMT_MOD_SET(TILE_VERSION,

Quoted 10 lines
Quoted 8 lines

AMD_FMT_MOD_TILE_VER_GFX9);
+                else
+                    data.override_tiling = LOCAL_DRM_FORMAT_MOD_NONE; +            }
              data.rotation = subtest->rot; test_plane_rotation(&data, subtest->plane, false); }

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw

Re: [igt-dev] [PATCH v3 2/3] tests/kms_rotation_crc: Add HW Rotation test case for amdgpu with tiling

Quoted 404 lines · Juha-Pekka Heikkila
Quoted 18 lines · Nicholas
Quoted 9 lines · Sung Joon Kim

Allow amdgpu to run HW rotation IGT test case
Added conditions to bypass all the requirements needed for intel when testing amdgpu. Additionally, freed unused frame buffers.
Added swizzle 64kb tiling method for amdgpu-specific.
Updated drm header for amdgpu tiling modifiers.

v2: drm_fourcc.h copied from kernel header commit:8ba16d5993749c3f31fd2b49e16f0dc1e1770b9c from drm-next. removed igt_pipe_crc_collect_crc for intel gpu. Only on AMDGPU.

Quoted 7 lines

v3: moved drm_fourcc.h to another patch.
Removed creating redundant fb in prepare_crtc for amdgpu. Guarded display commit for amdgpu.
Blocked cursor plane rotation for amdgpu.
Added back tiling when creating reference fb.

Quoted 7 lines

This looks okay to me now. Thanks for addressing all my feedback.

I ran a smoke test of a rebase of this patch on the latest tree and the tests pass. CI results are good too, so I think this looks OK to merge.

I'll put this in on Monday or Tuesday provided there are no further concerns from Juha-Pekka or Petri Latvala.

Hei

Sorry I had missed original patch set hence slow to comment, now my mail client picked up my name here. Generally things look all ok to me with just one exception, I wish things going to lib/ will be separated into their own patch from things going into actual test in tests/ so later when will see changes in test there will not come changes in view not in test itself.

For those amd related changes I cannot say anything because I don't have amd hw to try with. I'll put some comments below that just come to my mind.

Quoted 360 lines

Regards,
Nicholas Kazlauskas

Quoted 356 lines

---
  lib/igt_amd.c            | 192 +++++++++++++++++++++++++++++++++++++++ lib/igt_amd.h            |  14 ++-
  lib/igt_fb.c             |  36 +++++++- tests/kms_rotation_crc.c |  76 ++++++++++++----

  4 files changed, 299 insertions(+), 19 deletions(-)
lib/igt_amd.c +23 -0
index abd3ad96..a4e1cb59 100644
@@ -24,6 +24,29 @@
   #include "igt.h"
   #include <amdgpu_drm.h>
+#define X0 1
+#define X1 2
+#define X2 4
+#define X3 8
+#define X4 16
+#define X5 32
+#define X6 64
+#define X7 128
+#define Y0 1
+#define Y1 2
+#define Y2 4
+#define Y3 8
+#define Y4 16
+#define Y5 32
+#define Y6 64
+#define Y7 128
+
+struct dim2d
+{
+    int w;
+    int h;
+};
+
   uint32_t igt_amd_create_bo(int fd, uint64_t size)
   {
       union drm_amdgpu_gem_create create;
@@ -54,3 +77,172 @@ void *igt_amd_mmap_bo(int fd, uint32_t handle, 
 uint64_t size, int prot)
       ptr = mmap(0, size, prot, MAP_SHARED, fd, map.out.addr_ptr);
       return ptr == MAP_FAILED ? NULL : ptr;

  }

lib/igt_amd.c +70 -0
+
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+                       unsigned int x, unsigned int y)
+{
+    unsigned int offset = 0, index = 0;
+    unsigned int blk_size_table_index = 0, interleave = 0;
+    unsigned int channel[16] =
+                {0, 0, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1};
+    unsigned int i, v;
+
+    for (i = 0; i < 16; i++)
+    {
+        v = 0;
+        if (channel[i] == 1)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+                blk_size_table_index++;
+                interleave = (interleave + 1) >> 1;
+            }
+
+            index = blk_size_table_index + 2;
+            v ^= (x >> index) & 1;
+        }
+        else if (channel[i] == 2)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+                blk_size_table_index++;
+                interleave = (interleave + 1) >> 1;
+            }
+
+            index = blk_size_table_index;
+            v ^= (y >> index) & 1;
+        }
+
+        offset |= (v << i);
+    }
+
+    return offset;
+}
+
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp)
+{
+    unsigned int element_bytes;
+    unsigned int blk_size_table_index = 0;
+
+    element_bytes = bpp >> 3;
+
+    while (element_bytes > 1) {
+        blk_size_table_index++;
+        element_bytes = (element_bytes + 1) >> 1;
+    }
+
+    return blk_size_table_index;
+}
+
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+                       unsigned int *width, unsigned int *height)
+{
+    unsigned int blk_size_table_index;
+    unsigned int blk_size_log2, blk_size_log2_256B;
+    unsigned int width_amp, height_amp;
+
+    // swizzle 64kb tile block
+    unsigned int block256_2d[][2] = {{16, 16}, {16, 8}, {8, 8}, {8, 

4}, {4, 4}};
+    blk_size_log2 = 16;

lib/igt_amd.c +13 -0
+
+    blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp);
+
+    blk_size_log2_256B = blk_size_log2 - 8;
+
+    width_amp = blk_size_log2_256B / 2;
+    height_amp = blk_size_log2_256B - width_amp;
+
+    *width  = (block256_2d[blk_size_table_index][0] << width_amp);
+    *height = (block256_2d[blk_size_table_index][1] << height_amp);
+}
+
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int 

x_input,
+                       unsigned int y_input, unsigned int width_input)

lib/igt_amd.c +10 -0
+{
+    unsigned int width, height, pitch;
+    unsigned int pb, yb, xb, blk_idx, blk_offset, addr;
+    unsigned int blk_size_table_index, blk_size_log2;
+    unsigned int* swizzle_pattern;
+
+    // swizzle 64kb tile block
+    unsigned int sw_64k_s[][16]=
+    {
+        {X0, X1, X2, X3, Y0, Y1, Y2, Y3, Y4, X4, Y5, X5, Y6, X6, Y7, 

X7},
+        {0,  X0, X1, X2, Y0, Y1, Y2, X3, Y3, X4, Y4, X5, Y5, X6, Y6, X7},
+        {0,  0,  X0, X1, Y0, Y1, Y2, X2, Y3, X3, Y4, X4, Y5, X5, Y6, X6},
+        {0,  0,  0,  X0, Y0, Y1, X1, X2, Y2, X3, Y3, X4, Y4, X5, Y5, X6},
+        {0,  0,  0,  0,  Y0, Y1, X0, X1, Y2, X2, Y3, X3, Y4, X4, Y5, X5},
+    };
+    igt_amd_fb_calculate_tile_dimension(bpp, &width, &height); +    blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp); +    blk_size_log2 = 16;

lib/igt_amd.c +17 -0
+
+    pitch = (width_input + (width - 1)) & (~(width - 1));
+
+    swizzle_pattern = sw_64k_s[blk_size_table_index];
+
+    pb = pitch / width;
+    yb = y_input / height;
+    xb = x_input / width;
+    blk_idx = yb * pb + xb;
+    blk_offset = igt_amd_compute_offset(swizzle_pattern,
+                    x_input << blk_size_table_index, y_input);
+    addr = (blk_idx << blk_size_log2) + blk_offset;
+
+    return (uint32_t)addr;
+}
+
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct 

igt_fb *src,
+                       void *src_buf, unsigned int plane)

lib/igt_amd.c +30 -0
+{
+    uint32_t src_offset, dst_offset;
+    unsigned int bpp = src->plane_bpp[plane];
+    unsigned int width = dst->plane_width[plane];
+    unsigned int height = dst->plane_height[plane];
+    unsigned int x, y;
+
+    for (y = 0; y < height; y++) {
+        for (x = 0; x < width; x++) {
+            src_offset = src->offsets[plane];
+            dst_offset = dst->offsets[plane];
+
+            src_offset += src->strides[plane] * y + x * bpp / 8;
+            dst_offset += igt_amd_fb_tiled_offset(bpp, x, y, width);
+
+            switch (bpp) {
+            case 16:
+                *(uint16_t *)(dst_buf + dst_offset) =
+                    *(uint16_t *)(src_buf + src_offset);
+                break;
+            case 32:
+                *(uint32_t *)(dst_buf + dst_offset) =
+                    *(uint32_t *)(src_buf + src_offset);
+                break;
+            }
+        }
+    }
+}
+
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void 

*dst_buf,
+                       struct igt_fb *src, void *src_buf)

lib/igt_amd.c +17 -0
+{
+    unsigned int plane;
+
+    for (plane = 0; plane < src->num_planes; plane++) {
+        igt_require(AMD_FMT_MOD_GET(TILE, dst->modifier) ==
+                    AMD_FMT_MOD_TILE_GFX9_64K_S);
+        igt_amd_fb_to_tiled(dst, dst_buf, src, src_buf, plane);
+    }
+}
+
+bool igt_amd_is_tiled(uint64_t modifier)
+{
+    if (IS_AMD_FMT_MOD(modifier) && AMD_FMT_MOD_GET(TILE, modifier))
+        return true;
+    else
+        return false;
+}
lib/igt_amd.h +13 -1
index f63d26f4..6656d901 100644
@@ -24,8 +24,20 @@
   #define IGT_AMD_H
   #include <stdint.h>
+#include "igt_fb.h"
   uint32_t igt_amd_create_bo(int fd, uint64_t size);
   void *igt_amd_mmap_bo(int fd, uint32_t handle, uint64_t size, int prot);
-
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+                       unsigned int x, unsigned int y);
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp);
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+                       unsigned int *width, unsigned int *height);
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int 
 x_input,
+                       unsigned int y_input, unsigned int width_input);
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct 
 igt_fb *src,
+                       void *src_buf, unsigned int plane);
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void 
 *dst_buf,
+                       struct igt_fb *src, void *src_buf);
+bool igt_amd_is_tiled(uint64_t modifier);

  #endif /* IGT_AMD_H */

lib/igt_fb.c +11 -0
index 4b9be47e..f0fcd1a7 100644
@@ -671,6 +671,17 @@ static uint32_t calc_plane_stride(struct igt_fb 
 *fb, int plane)
            * so the easiest way is to align the luma stride to 256.
            */
           return ALIGN(min_stride, 256);
+    } else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && 
 is_amdgpu_device(fb->fd)) {
+        /*
+         * For amdgpu device with tiling mode
+         */
+        unsigned int tile_width, tile_height;
+
+        igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+                     &tile_width, &tile_height);
+        tile_width *= (fb->plane_bpp[plane] / 8);
+
+        return ALIGN(min_stride, tile_width);
       } else if (is_gen12_ccs_cc_plane(fb, plane)) {

          /* clear color always fixed to 64 bytes */ return 64;

lib/igt_fb.c +12 -0
@@ -711,6 +722,18 @@ static uint64_t calc_plane_size(struct igt_fb 
 *fb, int plane)
           size = roundup_power_of_two(size);
           return size;
+    } else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && 
 is_amdgpu_device(fb->fd)) {
+        /*
+         * For amdgpu device with tiling mode
+         */
+        unsigned int tile_width, tile_height;
+
+        igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+                     &tile_width, &tile_height);
+        tile_height *= (fb->plane_bpp[plane] / 8);
+
+        return (uint64_t) fb->strides[plane] *
+            ALIGN(fb->plane_height[plane], tile_height);
       } else if (is_gen12_ccs_plane(fb, plane)) {
           /* The AUX CCS surface must be page aligned */

          return (uint64_t)fb->strides[plane] *

lib/igt_fb.c +6 -0
@@ -2352,6 +2375,12 @@ static void free_linear_mapping(struct 
 fb_blit_upload *blit)
           vc4_fb_convert_plane_to_tiled(fb, map, &linear->fb, &linear->map);
+        munmap(map, fb->size);
+    } else if (igt_amd_is_tiled(fb->modifier)) {
+        void *map = igt_amd_mmap_bo(fd, fb->gem_handle, fb->size, 
 PROT_WRITE);
+
+        igt_amd_fb_convert_plane_to_tiled(fb, map, &linear->fb, 
 linear->map);
+
           munmap(map, fb->size);
       } else {

          gem_munmap(linear->map, linear->fb.size);

lib/igt_fb.c +4 -0
@@ -2419,6 +2448,10 @@ static void setup_linear_mapping(struct 
 fb_blit_upload *blit)
           vc4_fb_convert_plane_from_tiled(&linear->fb, &linear->map, fb, map);
           munmap(map, fb->size);
+    } else if (igt_amd_is_tiled(fb->modifier)) {
+        linear->map = igt_amd_mmap_bo(fd, linear->fb.gem_handle,
+                          linear->fb.size,
+                          PROT_READ | PROT_WRITE);
       } else {
           /* Copy fb content to linear BO */
           gem_set_domain(fd, linear->fb.gem_handle,
@@ -3625,7 +3658,8 @@ cairo_surface_t *igt_get_cairo_surface(int fd, 
 struct igt_fb *fb)
           if (use_convert(fb))
               create_cairo_surface__convert(fd, fb);

          else if (use_blitter(fb) || use_enginecopy(fb) || -             igt_vc4_is_tiled(fb->modifier))
+             igt_vc4_is_tiled(fb->modifier) ||
+             igt_amd_is_tiled(fb->modifier)) create_cairo_surface__gpu(fd, fb); else
              create_cairo_surface__gtt(fd, fb);

tests/kms_rotation_crc.c +6 -4
index e7072e20..6b0ea67c 100644
@@ -197,10 +197,14 @@ static void prepare_crtc(data_t *data, 
 igt_output_t *output, enum pipe pipe,
       /* create the pipe_crc object for this pipe */
       igt_pipe_crc_free(data->pipe_crc);
-    igt_display_commit2(display, COMMIT_ATOMIC);
+    /* defer crtc cleanup + crtc active for later on amd - not valid
+     * to enable CRTC without a plane active
+     */
+    if (!is_amdgpu_device(data->gfx_fd))
+        igt_display_commit2(display, COMMIT_ATOMIC);
       data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
-    if (start_crc)
+    if (!is_amdgpu_device(data->gfx_fd) && start_crc)
           igt_pipe_crc_start(data->pipe_crc);
   }
@@ -285,8 +289,14 @@ static void prepare_fbs(data_t *data, 
 igt_output_t *output,
               igt_plane_set_position(plane, data->pos_x, data->pos_y);
           igt_display_commit2(display, COMMIT_ATOMIC);
-        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &data->crc_rect[rect].flip_crc);
-        igt_remove_fb(data->gfx_fd, &data->fb_flip);
Quoted 8 lines

tests/kms_rotation_crc.c static void prepare_fbs(data_t *data, igt_output_t *output, · line 299

Quoted 8 lines
tests/kms_rotation_crc.c +8 -0
+        if (is_i915_device(data->gfx_fd)) {
+            igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+                    &data->crc_rect[rect].flip_crc);
+            igt_remove_fb(data->gfx_fd, &data->fb_flip);
+        } else if (is_amdgpu_device(data->gfx_fd)) {
+            igt_pipe_crc_collect_crc(data->pipe_crc,
+                    &data->crc_rect[rect].flip_crc);
+        }

I'm ok with this change but I was wondering why is this so for amd? Driver on amd has crc counted all the time or crc buffer is very short? On intel hw restarting crc counting will waste several vblanks which can overall double execution time of this test.

Quoted 1 line

If crc buffer is very short on amd there is also possibility to use igt_pipe_crc_drain(..) placed 'correctly'

CRC generation is tied to vblank handler on AMDGPU, so the OTG needs to be running.

I think that's the case for i915 as well, but a lot of IGT tests are written in a way that the CRTC is enabled before commiting any planes at all.

Unfortunately we can't do the same thing on AMDGPU or we break legacy userspace and their HW cursor checks.

See:
https://www.spinics.net/lists/amd-gfx/msg52208.html

I don't really know the best way to solve this in IGT/kernel driver at the moment, but it's kind of a mess and we run into this problem on nearly every test.

So while collect_crc adds a two vblank overhead on every CRC capture and makes the tests run slower it at least enables the tests to run on amdgpu.

Quoted 111 lines
Quoted 111 lines
Quoted 111 lines
tests/kms_rotation_crc.c +12 -2
           /*
           * Create a reference CRC for a software-rotated fb.
@@ -300,7 +310,14 @@ static void prepare_fbs(data_t *data, 
 igt_output_t *output,
               igt_plane_set_position(plane, data->pos_x, data->pos_y);
           igt_display_commit2(display, COMMIT_ATOMIC);
-        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &data->crc_rect[rect].ref_crc);
+        if (is_i915_device(data->gfx_fd)) {
+            igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+                    &data->crc_rect[rect].ref_crc);
+        } else if (is_amdgpu_device(data->gfx_fd)) {
+            igt_pipe_crc_collect_crc(data->pipe_crc,
+                    &data->crc_rect[rect].ref_crc);
+            igt_remove_fb(data->gfx_fd, &data->fb_flip);
+        }
           data->crc_rect[rect].valid = true;
       }
@@ -350,7 +367,10 @@ static void test_single_case(data_t *data, enum 
 pipe pipe,
       igt_assert_eq(ret, 0);
       /* Check CRC */
-    igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &crc_output);
+    if (is_i915_device(data->gfx_fd))
+        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &crc_output);
+    else if (is_amdgpu_device(data->gfx_fd))
+        igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
       igt_assert_crc_equal(&data->crc_rect[rect].ref_crc, &crc_output);

      /*

tests/kms_rotation_crc.c +4 -1
@@ -373,7 +393,10 @@ static void test_single_case(data_t *data, enum 
 pipe pipe,
               igt_assert_eq(ret, 0);
           }
           kmstest_wait_for_pageflip(data->gfx_fd);
-        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &crc_output);
+        if (is_i915_device(data->gfx_fd))
+            igt_pipe_crc_get_current(display->drm_fd, 
 data->pipe_crc, &crc_output);
+        else if (is_amdgpu_device(data->gfx_fd))
+            igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);

          igt_assert_crc_equal(&data->crc_rect[rect].flip_crc, &crc_output); }
  }

tests/kms_rotation_crc.c +0 -0
@@ -407,6 +430,10 @@ static void test_plane_rotation(data_t *data, 

int plane_type, bool test_bad_form
      enum pipe pipe;
      int pipe_count = 0;
+    if (is_amdgpu_device(data->gfx_fd))
+        igt_require(plane_type != DRM_PLANE_TYPE_OVERLAY && +                    plane_type != DRM_PLANE_TYPE_CURSOR); +
      if (plane_type == DRM_PLANE_TYPE_CURSOR) igt_require(display->has_cursor_plane);

tests/kms_rotation_crc.c +0 -0
@@ -419,7 +446,7 @@ static void test_plane_rotation(data_t *data, int 

plane_type, bool test_bad_form
          for (c = 0; c < num_rectangle_types; c++) data->crc_rect[c].valid = false;
-        if (IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
+        if (is_i915_device(data->gfx_fd) && IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
              continue;
          /* restricting the execution to 2 pipes to reduce execution time*/

tests/kms_rotation_crc.c +0 -0
@@ -441,8 +468,9 @@ static void test_plane_rotation(data_t *data, int 

plane_type, bool test_bad_form
                  continue;
              /* Only support partial covering primary plane on gen9+ */ -            if (plane_type == DRM_PLANE_TYPE_PRIMARY &&
-                intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9) { +            if (is_amdgpu_device(data->gfx_fd) ||
+                (plane_type == DRM_PLANE_TYPE_PRIMARY &&
+                intel_gen(intel_get_drm_devid(data->gfx_fd)) < 9)) { if (i != rectangle)
                      continue;
                  else

tests/kms_rotation_crc.c +0 -0
@@ -472,7 +500,9 @@ static void test_plane_rotation(data_t *data, int 

plane_type, bool test_bad_form
                           data->override_fmt, test_bad_format); }
          }
-        igt_pipe_crc_stop(data->pipe_crc);
+        if (is_i915_device(data->gfx_fd)) {
+            igt_pipe_crc_stop(data->pipe_crc);
+        }
      }
  }

tests/kms_rotation_crc.c +5 -6
@@ -850,9 +880,11 @@ igt_main_args("", long_opts, help_str, 
 opt_handler, &data)
       int gen = 0;
       igt_fixture {
-        data.gfx_fd = drm_open_driver_master(DRIVER_INTEL);
-        data.devid = intel_get_drm_devid(data.gfx_fd);
-        gen = intel_gen(data.devid);
+        data.gfx_fd = drm_open_driver_master(DRIVER_INTEL | 
 DRIVER_AMDGPU);
+        if (is_i915_device(data.gfx_fd)) {
+            data.devid = intel_get_drm_devid(data.gfx_fd);
+            gen = intel_gen(data.devid);
+        }
           kmstest_set_vt_graphics_mode();
@@ -866,9 +898,19 @@ igt_main_args("", long_opts, help_str, 
 opt_handler, &data)
           igt_subtest_f("%s-rotation-%s",
                     plane_test_str(subtest->plane),
                     rot_test_str(subtest->rot)) {
-            igt_require(!(subtest->rot &
-                    (IGT_ROTATION_90 | IGT_ROTATION_270)) ||
-                    gen >= 9);
Quoted 8 lines
Quoted 6 lines

tests/kms_rotation_crc.c igt_main_args("", long_opts, help_str, opt_handler, &data) · line 906

Quoted 6 lines
tests/kms_rotation_crc.c +6 -0
+            if (is_i915_device(data.gfx_fd)) {
+                igt_require(!(subtest->rot &
+                        (IGT_ROTATION_90 | IGT_ROTATION_270)) ||
+                        gen >= 9);
+            } else if (is_amdgpu_device(data.gfx_fd)) {
+                data.override_fmt = DRM_FORMAT_XRGB8888;

I think this will cause you will get only DRM_FORMAT_XRGB8888 tested on amd and also if there's cursor plane tested it will go with DRM_FORMAT_XRGB8888.

We don't support cursor plane in any other format than XRGB/ARGB8888/FP16 IIRC.

Regards,
Nicholas Kazlauskas

Quoted 18 lines
Quoted 17 lines
Quoted 6 lines
tests/kms_rotation_crc.c +3 -0
+                if (subtest->rot & (IGT_ROTATION_90 | 
 IGT_ROTATION_270))
+                    data.override_tiling = AMD_FMT_MOD |
+                        AMD_FMT_MOD_SET(TILE, 

AMD_FMT_MOD_TILE_GFX9_64K_S) |

Quoted 9 lines

+                        AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX9);
+                else
+                    data.override_tiling = LOCAL_DRM_FORMAT_MOD_NONE; +            }
              data.rotation = subtest->rot; test_plane_rotation(&data, subtest->plane, false); }

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#5 lore raw

Re: [igt-dev] [PATCH v3 2/3] tests/kms_rotation_crc: Add HW Rotation test case for amdgpu with tiling

Quoted 409 lines · Nicholas
Quoted 406 lines · Juha-Pekka Heikkila
Quoted 18 lines · Nicholas
Quoted 9 lines · Sung Joon Kim

Allow amdgpu to run HW rotation IGT test case
Added conditions to bypass all the requirements needed for intel when testing amdgpu. Additionally, freed unused frame buffers.
Added swizzle 64kb tiling method for amdgpu-specific.
Updated drm header for amdgpu tiling modifiers.

v2: drm_fourcc.h copied from kernel header commit:8ba16d5993749c3f31fd2b49e16f0dc1e1770b9c from drm-next. removed igt_pipe_crc_collect_crc for intel gpu. Only on AMDGPU.

Quoted 7 lines

v3: moved drm_fourcc.h to another patch.
Removed creating redundant fb in prepare_crtc for amdgpu. Guarded display commit for amdgpu.
Blocked cursor plane rotation for amdgpu.
Added back tiling when creating reference fb.

Quoted 7 lines

This looks okay to me now. Thanks for addressing all my feedback.

I ran a smoke test of a rebase of this patch on the latest tree and the tests pass. CI results are good too, so I think this looks OK to merge.

I'll put this in on Monday or Tuesday provided there are no further concerns from Juha-Pekka or Petri Latvala.

Hei

Sorry I had missed original patch set hence slow to comment, now my mail client picked up my name here. Generally things look all ok to me with just one exception, I wish things going to lib/ will be separated into their own patch from things going into actual test in tests/ so later when will see changes in test there will not come changes in view not in test itself.

For those amd related changes I cannot say anything because I don't have amd hw to try with. I'll put some comments below that just come to my mind.

Quoted 362 lines

Regards,
Nicholas Kazlauskas

Quoted 358 lines

---
  lib/igt_amd.c            | 192
+++++++++++++++++++++++++++++++++++++++
  lib/igt_amd.h            |  14 ++-
  lib/igt_fb.c             |  36 +++++++-
  tests/kms_rotation_crc.c |  76 ++++++++++++----

  4 files changed, 299 insertions(+), 19 deletions(-)
lib/igt_amd.c +23 -0
index abd3ad96..a4e1cb59 100644
@@ -24,6 +24,29 @@
   #include "igt.h"
   #include <amdgpu_drm.h>
+#define X0 1
+#define X1 2
+#define X2 4
+#define X3 8
+#define X4 16
+#define X5 32
+#define X6 64
+#define X7 128
+#define Y0 1
+#define Y1 2
+#define Y2 4
+#define Y3 8
+#define Y4 16
+#define Y5 32
+#define Y6 64
+#define Y7 128
+
+struct dim2d
+{
+    int w;
+    int h;
+};
+
   uint32_t igt_amd_create_bo(int fd, uint64_t size)
   {
       union drm_amdgpu_gem_create create;
@@ -54,3 +77,172 @@ void *igt_amd_mmap_bo(int fd, uint32_t handle, 
 uint64_t size, int prot)
       ptr = mmap(0, size, prot, MAP_SHARED, fd, map.out.addr_ptr);
       return ptr == MAP_FAILED ? NULL : ptr;

  }

lib/igt_amd.c +70 -0
+
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+                       unsigned int x, unsigned int y)
+{
+    unsigned int offset = 0, index = 0;
+    unsigned int blk_size_table_index = 0, interleave = 0;
+    unsigned int channel[16] =
+                {0, 0, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1};
+    unsigned int i, v;
+
+    for (i = 0; i < 16; i++)
+    {
+        v = 0;
+        if (channel[i] == 1)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+                blk_size_table_index++;
+                interleave = (interleave + 1) >> 1;
+            }
+
+            index = blk_size_table_index + 2;
+            v ^= (x >> index) & 1;
+        }
+        else if (channel[i] == 2)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+                blk_size_table_index++;
+                interleave = (interleave + 1) >> 1;
+            }
+
+            index = blk_size_table_index;
+            v ^= (y >> index) & 1;
+        }
+
+        offset |= (v << i);
+    }
+
+    return offset;
+}
+
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp)
+{
+    unsigned int element_bytes;
+    unsigned int blk_size_table_index = 0;
+
+    element_bytes = bpp >> 3;
+
+    while (element_bytes > 1) {
+        blk_size_table_index++;
+        element_bytes = (element_bytes + 1) >> 1;
+    }
+
+    return blk_size_table_index;
+}
+
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+                       unsigned int *width, unsigned int *height)
+{
+    unsigned int blk_size_table_index;
+    unsigned int blk_size_log2, blk_size_log2_256B;
+    unsigned int width_amp, height_amp;
+
+    // swizzle 64kb tile block
+    unsigned int block256_2d[][2] = {{16, 16}, {16, 8}, {8, 8}, {8, 

4}, {4, 4}};
+    blk_size_log2 = 16;

lib/igt_amd.c +13 -0
+
+    blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp);
+
+    blk_size_log2_256B = blk_size_log2 - 8;
+
+    width_amp = blk_size_log2_256B / 2;
+    height_amp = blk_size_log2_256B - width_amp;
+
+    *width  = (block256_2d[blk_size_table_index][0] << width_amp);
+    *height = (block256_2d[blk_size_table_index][1] << height_amp);
+}
+
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int 

x_input,
+                       unsigned int y_input, unsigned int width_input)

lib/igt_amd.c +10 -0
+{
+    unsigned int width, height, pitch;
+    unsigned int pb, yb, xb, blk_idx, blk_offset, addr;
+    unsigned int blk_size_table_index, blk_size_log2;
+    unsigned int* swizzle_pattern;
+
+    // swizzle 64kb tile block
+    unsigned int sw_64k_s[][16]=
+    {
+        {X0, X1, X2, X3, Y0, Y1, Y2, Y3, Y4, X4, Y5, X5, Y6, X6, 

Y7, X7},
+        {0,  X0, X1, X2, Y0, Y1, Y2, X3, Y3, X4, Y4, X5, Y5, X6, Y6, X7},
+        {0,  0,  X0, X1, Y0, Y1, Y2, X2, Y3, X3, Y4, X4, Y5, X5, Y6, X6},
+        {0,  0,  0,  X0, Y0, Y1, X1, X2, Y2, X3, Y3, X4, Y4, X5, Y5, X6},
+        {0,  0,  0,  0,  Y0, Y1, X0, X1, Y2, X2, Y3, X3, Y4, X4, Y5, X5},
+    };
+    igt_amd_fb_calculate_tile_dimension(bpp, &width, &height); +    blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp); +    blk_size_log2 = 16;

lib/igt_amd.c +17 -0
+
+    pitch = (width_input + (width - 1)) & (~(width - 1));
+
+    swizzle_pattern = sw_64k_s[blk_size_table_index];
+
+    pb = pitch / width;
+    yb = y_input / height;
+    xb = x_input / width;
+    blk_idx = yb * pb + xb;
+    blk_offset = igt_amd_compute_offset(swizzle_pattern,
+                    x_input << blk_size_table_index, y_input);
+    addr = (blk_idx << blk_size_log2) + blk_offset;
+
+    return (uint32_t)addr;
+}
+
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct 

igt_fb *src,
+                       void *src_buf, unsigned int plane)

lib/igt_amd.c +30 -0
+{
+    uint32_t src_offset, dst_offset;
+    unsigned int bpp = src->plane_bpp[plane];
+    unsigned int width = dst->plane_width[plane];
+    unsigned int height = dst->plane_height[plane];
+    unsigned int x, y;
+
+    for (y = 0; y < height; y++) {
+        for (x = 0; x < width; x++) {
+            src_offset = src->offsets[plane];
+            dst_offset = dst->offsets[plane];
+
+            src_offset += src->strides[plane] * y + x * bpp / 8;
+            dst_offset += igt_amd_fb_tiled_offset(bpp, x, y, width);
+
+            switch (bpp) {
+            case 16:
+                *(uint16_t *)(dst_buf + dst_offset) =
+                    *(uint16_t *)(src_buf + src_offset);
+                break;
+            case 32:
+                *(uint32_t *)(dst_buf + dst_offset) =
+                    *(uint32_t *)(src_buf + src_offset);
+                break;
+            }
+        }
+    }
+}
+
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void 

*dst_buf,
+                       struct igt_fb *src, void *src_buf)

lib/igt_amd.c +17 -0
+{
+    unsigned int plane;
+
+    for (plane = 0; plane < src->num_planes; plane++) {
+        igt_require(AMD_FMT_MOD_GET(TILE, dst->modifier) ==
+                    AMD_FMT_MOD_TILE_GFX9_64K_S);
+        igt_amd_fb_to_tiled(dst, dst_buf, src, src_buf, plane);
+    }
+}
+
+bool igt_amd_is_tiled(uint64_t modifier)
+{
+    if (IS_AMD_FMT_MOD(modifier) && AMD_FMT_MOD_GET(TILE, modifier))
+        return true;
+    else
+        return false;
+}
lib/igt_amd.h +11 -1
index f63d26f4..6656d901 100644
@@ -24,8 +24,20 @@
   #define IGT_AMD_H
   #include <stdint.h>
+#include "igt_fb.h"
   uint32_t igt_amd_create_bo(int fd, uint64_t size);
   void *igt_amd_mmap_bo(int fd, uint32_t handle, uint64_t size, int prot);
-
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+                       unsigned int x, unsigned int y);
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp);
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+                       unsigned int *width, unsigned int *height);
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int 
 x_input,
+                       unsigned int y_input, unsigned int 
 width_input);
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct 
 igt_fb *src,
+                       void *src_buf, unsigned int plane);
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void 

*dst_buf,
+                       struct igt_fb *src, void *src_buf); +bool igt_amd_is_tiled(uint64_t modifier);
  #endif /* IGT_AMD_H */

lib/igt_fb.c +11 -0
index 4b9be47e..f0fcd1a7 100644
@@ -671,6 +671,17 @@ static uint32_t calc_plane_stride(struct igt_fb 
 *fb, int plane)
            * so the easiest way is to align the luma stride to 256.
            */
           return ALIGN(min_stride, 256);
+    } else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && 
 is_amdgpu_device(fb->fd)) {
+        /*
+         * For amdgpu device with tiling mode
+         */
+        unsigned int tile_width, tile_height;
+
+        igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+                     &tile_width, &tile_height);
+        tile_width *= (fb->plane_bpp[plane] / 8);
+
+        return ALIGN(min_stride, tile_width);
       } else if (is_gen12_ccs_cc_plane(fb, plane)) {

          /* clear color always fixed to 64 bytes */ return 64;

lib/igt_fb.c +12 -0
@@ -711,6 +722,18 @@ static uint64_t calc_plane_size(struct igt_fb 
 *fb, int plane)
           size = roundup_power_of_two(size);
           return size;
+    } else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && 
 is_amdgpu_device(fb->fd)) {
+        /*
+         * For amdgpu device with tiling mode
+         */
+        unsigned int tile_width, tile_height;
+
+        igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+                     &tile_width, &tile_height);
+        tile_height *= (fb->plane_bpp[plane] / 8);
+
+        return (uint64_t) fb->strides[plane] *
+            ALIGN(fb->plane_height[plane], tile_height);
       } else if (is_gen12_ccs_plane(fb, plane)) {
           /* The AUX CCS surface must be page aligned */

          return (uint64_t)fb->strides[plane] *

lib/igt_fb.c +6 -0
@@ -2352,6 +2375,12 @@ static void free_linear_mapping(struct 
 fb_blit_upload *blit)
           vc4_fb_convert_plane_to_tiled(fb, map, &linear->fb, &linear->map);
+        munmap(map, fb->size);
+    } else if (igt_amd_is_tiled(fb->modifier)) {
+        void *map = igt_amd_mmap_bo(fd, fb->gem_handle, fb->size, 
 PROT_WRITE);
+
+        igt_amd_fb_convert_plane_to_tiled(fb, map, &linear->fb, 
 linear->map);
+
           munmap(map, fb->size);
       } else {

          gem_munmap(linear->map, linear->fb.size);

lib/igt_fb.c +4 -0
@@ -2419,6 +2448,10 @@ static void setup_linear_mapping(struct 
 fb_blit_upload *blit)
           vc4_fb_convert_plane_from_tiled(&linear->fb, &linear->map, fb, map);
           munmap(map, fb->size);
+    } else if (igt_amd_is_tiled(fb->modifier)) {
+        linear->map = igt_amd_mmap_bo(fd, linear->fb.gem_handle,
+                          linear->fb.size,
+                          PROT_READ | PROT_WRITE);
       } else {
           /* Copy fb content to linear BO */
           gem_set_domain(fd, linear->fb.gem_handle,
@@ -3625,7 +3658,8 @@ cairo_surface_t *igt_get_cairo_surface(int fd, 
 struct igt_fb *fb)
           if (use_convert(fb))
               create_cairo_surface__convert(fd, fb);

          else if (use_blitter(fb) || use_enginecopy(fb) || -             igt_vc4_is_tiled(fb->modifier))
+             igt_vc4_is_tiled(fb->modifier) ||
+             igt_amd_is_tiled(fb->modifier)) create_cairo_surface__gpu(fd, fb); else
              create_cairo_surface__gtt(fd, fb);

tests/kms_rotation_crc.c +6 -4
index e7072e20..6b0ea67c 100644
@@ -197,10 +197,14 @@ static void prepare_crtc(data_t *data, 
 igt_output_t *output, enum pipe pipe,
       /* create the pipe_crc object for this pipe */
       igt_pipe_crc_free(data->pipe_crc);
-    igt_display_commit2(display, COMMIT_ATOMIC);
+    /* defer crtc cleanup + crtc active for later on amd - not valid
+     * to enable CRTC without a plane active
+     */
+    if (!is_amdgpu_device(data->gfx_fd))
+        igt_display_commit2(display, COMMIT_ATOMIC);
       data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
-    if (start_crc)
+    if (!is_amdgpu_device(data->gfx_fd) && start_crc)
           igt_pipe_crc_start(data->pipe_crc);
   }
@@ -285,8 +289,14 @@ static void prepare_fbs(data_t *data, 
 igt_output_t *output,
               igt_plane_set_position(plane, data->pos_x, data->pos_y);
           igt_display_commit2(display, COMMIT_ATOMIC);
-        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &data->crc_rect[rect].flip_crc);
-        igt_remove_fb(data->gfx_fd, &data->fb_flip);
Quoted 8 lines

tests/kms_rotation_crc.c static void prepare_fbs(data_t *data, · line 300

Quoted 8 lines
tests/kms_rotation_crc.c +8 -0
+        if (is_i915_device(data->gfx_fd)) {
+            igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+                    &data->crc_rect[rect].flip_crc);
+            igt_remove_fb(data->gfx_fd, &data->fb_flip);
+        } else if (is_amdgpu_device(data->gfx_fd)) {
+            igt_pipe_crc_collect_crc(data->pipe_crc,
+                    &data->crc_rect[rect].flip_crc);
+        }

I'm ok with this change but I was wondering why is this so for amd? Driver on amd has crc counted all the time or crc buffer is very short? On intel hw restarting crc counting will waste several vblanks which can overall double execution time of this test.

Quoted 1 line

If crc buffer is very short on amd there is also possibility to use igt_pipe_crc_drain(..) placed 'correctly'

Quoted 8 lines

CRC generation is tied to vblank handler on AMDGPU, so the OTG needs to be running.

I think that's the case for i915 as well, but a lot of IGT tests are written in a way that the CRTC is enabled before commiting any planes at all.

Unfortunately we can't do the same thing on AMDGPU or we break legacy userspace and their HW cursor checks.

See:
https://www.spinics.net/lists/amd-gfx/msg52208.html

This is good to know. While working with these tests I can try to take this issue into account.

Quoted 5 lines

I don't really know the best way to solve this in IGT/kernel driver at the moment, but it's kind of a mess and we run into this problem on nearly every test.

So while collect_crc adds a two vblank overhead on every CRC capture and makes the tests run slower it at least enables the tests to run on amdgpu.

For now this is bit theoretical as rotation test on amd hw will be run on DRM_FORMAT_XRGB8888 but if you enable other formats for rotation tests would something like below work better for this crc issue? I have no way of testing it so I don't know if it's correct for amd hw, on intel hw it doesn't seem to make a difference.. (I just tested it on my icelake) What below does is just delay starting of crc counting until there's first plane on screen.

/Juha-Pekka

---

tests/kms_rotation_crc.c +0 -3
index a90293442..c0ca7f3e7 100644
@@ -180,16 +180,13 @@ static void cleanup_crtc(data_t *data)
 {
 	igt_display_t *display = &data->display;
 
-	igt_pipe_crc_free(data->pipe_crc);
-	data->pipe_crc = NULL;
-
 	remove_fbs(data);
 
 	igt_display_reset(display);
 }
 
 static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe 

pipe,
- igt_plane_t *plane, bool start_crc)
+ igt_plane_t *plane)
{
igt_display_t *display = &data->display;

@@ -198,14 +195,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
igt_output_set_pipe(output, pipe);
igt_plane_set_rotation(plane, IGT_ROTATION_0);

- /* create the pipe_crc object for this pipe */
- igt_pipe_crc_free(data->pipe_crc);
-
igt_display_commit2(display, COMMIT_ATOMIC);
- data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
-
- if (start_crc)
- igt_pipe_crc_start(data->pipe_crc);
}

static void prepare_fbs(data_t *data, igt_output_t *output,
@@ -289,11 +279,16 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
igt_plane_set_position(plane, data->pos_x, data->pos_y);
igt_display_commit2(display, COMMIT_ATOMIC);

- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
- &data->crc_rect[data->output_crc_in_use][rect].flip_crc);
+ if (data->pipe_crc == NULL) {
+ data->pipe_crc = igt_pipe_crc_new(data->gfx_fd,
+ output->config.pipe,
+ INTEL_PIPE_CRC_SOURCE_AUTO);

- igt_remove_fb(data->gfx_fd, &data->fb_flip);
+ igt_pipe_crc_start(data->pipe_crc);
+ }

+ igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+ &data->crc_rect[data->output_crc_in_use][rect].flip_crc);
/*
* Create a reference CRC for a software-rotated fb.
*/
@@ -310,6 +305,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
&data->crc_rect[data->output_crc_in_use][rect].ref_crc);

data->crc_rect[data->output_crc_in_use][rect].valid = true;
+ igt_remove_fb(data->gfx_fd, &data->fb_flip);
}

data->last_on_screen = data->fb_flip;
@@ -479,7 +475,7 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
plane = igt_output_get_plane_type(output, plane_type); igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));

- prepare_crtc(data, output, pipe, plane, true);
+ prepare_crtc(data, output, pipe, plane);

for (i = 0; i < num_rectangle_types; i++) {
/* Unsupported on i915 */
@@ -520,6 +516,8 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
}
}
igt_pipe_crc_stop(data->pipe_crc);
+ igt_pipe_crc_free(data->pipe_crc);
+ data->pipe_crc = NULL;
}
}

@@ -762,7 +760,7 @@ static void test_plane_rotation_exhaust_fences(data_t *data,

igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));

- prepare_crtc(data, output, pipe, plane, false);
+ prepare_crtc(data, output, pipe, plane);

mode = igt_output_get_mode(output);
w = mode->hdisplay;
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#6 lore raw

Re: [igt-dev] [PATCH v3 2/3] tests/kms_rotation_crc: Add HW Rotation test case for amdgpu with tiling

Quoted 424 lines · Juha-Pekka Heikkila
Quoted 410 lines · Nicholas
Quoted 407 lines · Juha-Pekka Heikkila
Quoted 18 lines · Nicholas
Quoted 9 lines · Sung Joon Kim

Allow amdgpu to run HW rotation IGT test case
Added conditions to bypass all the requirements needed for intel when testing amdgpu. Additionally, freed unused frame buffers.
Added swizzle 64kb tiling method for amdgpu-specific.
Updated drm header for amdgpu tiling modifiers.

v2: drm_fourcc.h copied from kernel header commit:8ba16d5993749c3f31fd2b49e16f0dc1e1770b9c from drm-next. removed igt_pipe_crc_collect_crc for intel gpu. Only on AMDGPU.

Quoted 7 lines

v3: moved drm_fourcc.h to another patch.
Removed creating redundant fb in prepare_crtc for amdgpu. Guarded display commit for amdgpu.
Blocked cursor plane rotation for amdgpu.
Added back tiling when creating reference fb.

Quoted 7 lines

This looks okay to me now. Thanks for addressing all my feedback.

I ran a smoke test of a rebase of this patch on the latest tree and the tests pass. CI results are good too, so I think this looks OK to merge.

I'll put this in on Monday or Tuesday provided there are no further concerns from Juha-Pekka or Petri Latvala.

Hei

Sorry I had missed original patch set hence slow to comment, now my mail client picked up my name here. Generally things look all ok to me with just one exception, I wish things going to lib/ will be separated into their own patch from things going into actual test in tests/ so later when will see changes in test there will not come changes in view not in test itself.

For those amd related changes I cannot say anything because I don't have amd hw to try with. I'll put some comments below that just come to my mind.

Quoted 363 lines

Regards,
Nicholas Kazlauskas

Quoted 359 lines

---
  lib/igt_amd.c            | 192
+++++++++++++++++++++++++++++++++++++++
  lib/igt_amd.h            |  14 ++-
  lib/igt_fb.c             |  36 +++++++-
  tests/kms_rotation_crc.c |  76 ++++++++++++----

  4 files changed, 299 insertions(+), 19 deletions(-)
lib/igt_amd.c +23 -0
index abd3ad96..a4e1cb59 100644
@@ -24,6 +24,29 @@
   #include "igt.h"
   #include <amdgpu_drm.h>
+#define X0 1
+#define X1 2
+#define X2 4
+#define X3 8
+#define X4 16
+#define X5 32
+#define X6 64
+#define X7 128
+#define Y0 1
+#define Y1 2
+#define Y2 4
+#define Y3 8
+#define Y4 16
+#define Y5 32
+#define Y6 64
+#define Y7 128
+
+struct dim2d
+{
+    int w;
+    int h;
+};
+
   uint32_t igt_amd_create_bo(int fd, uint64_t size)
   {
       union drm_amdgpu_gem_create create;
@@ -54,3 +77,172 @@ void *igt_amd_mmap_bo(int fd, uint32_t handle, 
 uint64_t size, int prot)
       ptr = mmap(0, size, prot, MAP_SHARED, fd, map.out.addr_ptr);
       return ptr == MAP_FAILED ? NULL : ptr;

  }

lib/igt_amd.c +70 -0
+
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+                       unsigned int x, unsigned int y)
+{
+    unsigned int offset = 0, index = 0;
+    unsigned int blk_size_table_index = 0, interleave = 0;
+    unsigned int channel[16] =
+                {0, 0, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1};
+    unsigned int i, v;
+
+    for (i = 0; i < 16; i++)
+    {
+        v = 0;
+        if (channel[i] == 1)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+                blk_size_table_index++;
+                interleave = (interleave + 1) >> 1;
+            }
+
+            index = blk_size_table_index + 2;
+            v ^= (x >> index) & 1;
+        }
+        else if (channel[i] == 2)
+        {
+            blk_size_table_index = 0;
+            interleave = swizzle_pattern[i];
+
+            while (interleave > 1) {
+                blk_size_table_index++;
+                interleave = (interleave + 1) >> 1;
+            }
+
+            index = blk_size_table_index;
+            v ^= (y >> index) & 1;
+        }
+
+        offset |= (v << i);
+    }
+
+    return offset;
+}
+
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp)
+{
+    unsigned int element_bytes;
+    unsigned int blk_size_table_index = 0;
+
+    element_bytes = bpp >> 3;
+
+    while (element_bytes > 1) {
+        blk_size_table_index++;
+        element_bytes = (element_bytes + 1) >> 1;
+    }
+
+    return blk_size_table_index;
+}
+
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+                       unsigned int *width, unsigned int *height)
+{
+    unsigned int blk_size_table_index;
+    unsigned int blk_size_log2, blk_size_log2_256B;
+    unsigned int width_amp, height_amp;
+
+    // swizzle 64kb tile block
+    unsigned int block256_2d[][2] = {{16, 16}, {16, 8}, {8, 8}, 

{8, 4}, {4, 4}};
+    blk_size_log2 = 16;

lib/igt_amd.c +13 -0
+
+    blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp);
+
+    blk_size_log2_256B = blk_size_log2 - 8;
+
+    width_amp = blk_size_log2_256B / 2;
+    height_amp = blk_size_log2_256B - width_amp;
+
+    *width  = (block256_2d[blk_size_table_index][0] << width_amp);
+    *height = (block256_2d[blk_size_table_index][1] << height_amp);
+}
+
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int 

x_input,
+                       unsigned int y_input, unsigned int width_input)

lib/igt_amd.c +10 -0
+{
+    unsigned int width, height, pitch;
+    unsigned int pb, yb, xb, blk_idx, blk_offset, addr;
+    unsigned int blk_size_table_index, blk_size_log2;
+    unsigned int* swizzle_pattern;
+
+    // swizzle 64kb tile block
+    unsigned int sw_64k_s[][16]=
+    {
+        {X0, X1, X2, X3, Y0, Y1, Y2, Y3, Y4, X4, Y5, X5, Y6, X6, 

Y7, X7},
+        {0,  X0, X1, X2, Y0, Y1, Y2, X3, Y3, X4, Y4, X5, Y5, X6, Y6, X7},
+        {0,  0,  X0, X1, Y0, Y1, Y2, X2, Y3, X3, Y4, X4, Y5, X5, Y6, X6},
+        {0,  0,  0,  X0, Y0, Y1, X1, X2, Y2, X3, Y3, X4, Y4, X5, Y5, X6},
+        {0,  0,  0,  0,  Y0, Y1, X0, X1, Y2, X2, Y3, X3, Y4, X4, Y5, X5},
+    };
+    igt_amd_fb_calculate_tile_dimension(bpp, &width, &height); +    blk_size_table_index = igt_amd_fb_get_blk_size_table_idx(bpp); +    blk_size_log2 = 16;

lib/igt_amd.c +17 -0
+
+    pitch = (width_input + (width - 1)) & (~(width - 1));
+
+    swizzle_pattern = sw_64k_s[blk_size_table_index];
+
+    pb = pitch / width;
+    yb = y_input / height;
+    xb = x_input / width;
+    blk_idx = yb * pb + xb;
+    blk_offset = igt_amd_compute_offset(swizzle_pattern,
+                    x_input << blk_size_table_index, y_input);
+    addr = (blk_idx << blk_size_log2) + blk_offset;
+
+    return (uint32_t)addr;
+}
+
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct 

igt_fb *src,
+                       void *src_buf, unsigned int plane)

lib/igt_amd.c +30 -0
+{
+    uint32_t src_offset, dst_offset;
+    unsigned int bpp = src->plane_bpp[plane];
+    unsigned int width = dst->plane_width[plane];
+    unsigned int height = dst->plane_height[plane];
+    unsigned int x, y;
+
+    for (y = 0; y < height; y++) {
+        for (x = 0; x < width; x++) {
+            src_offset = src->offsets[plane];
+            dst_offset = dst->offsets[plane];
+
+            src_offset += src->strides[plane] * y + x * bpp / 8;
+            dst_offset += igt_amd_fb_tiled_offset(bpp, x, y, width);
+
+            switch (bpp) {
+            case 16:
+                *(uint16_t *)(dst_buf + dst_offset) =
+                    *(uint16_t *)(src_buf + src_offset);
+                break;
+            case 32:
+                *(uint32_t *)(dst_buf + dst_offset) =
+                    *(uint32_t *)(src_buf + src_offset);
+                break;
+            }
+        }
+    }
+}
+
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void 

*dst_buf,
+                       struct igt_fb *src, void *src_buf)

lib/igt_amd.c +17 -0
+{
+    unsigned int plane;
+
+    for (plane = 0; plane < src->num_planes; plane++) {
+        igt_require(AMD_FMT_MOD_GET(TILE, dst->modifier) ==
+                    AMD_FMT_MOD_TILE_GFX9_64K_S);
+        igt_amd_fb_to_tiled(dst, dst_buf, src, src_buf, plane);
+    }
+}
+
+bool igt_amd_is_tiled(uint64_t modifier)
+{
+    if (IS_AMD_FMT_MOD(modifier) && AMD_FMT_MOD_GET(TILE, modifier))
+        return true;
+    else
+        return false;
+}
lib/igt_amd.h +11 -1
index f63d26f4..6656d901 100644
@@ -24,8 +24,20 @@
   #define IGT_AMD_H
   #include <stdint.h>
+#include "igt_fb.h"
   uint32_t igt_amd_create_bo(int fd, uint64_t size);
   void *igt_amd_mmap_bo(int fd, uint32_t handle, uint64_t size, int prot);
-
+unsigned int igt_amd_compute_offset(unsigned int* swizzle_pattern,
+                       unsigned int x, unsigned int y);
+unsigned int igt_amd_fb_get_blk_size_table_idx(unsigned int bpp);
+void igt_amd_fb_calculate_tile_dimension(unsigned int bpp,
+                       unsigned int *width, unsigned int *height);
+uint32_t igt_amd_fb_tiled_offset(unsigned int bpp, unsigned int 
 x_input,
+                       unsigned int y_input, unsigned int 
 width_input);
+void igt_amd_fb_to_tiled(struct igt_fb *dst, void *dst_buf, struct 
 igt_fb *src,
+                       void *src_buf, unsigned int plane);
+void igt_amd_fb_convert_plane_to_tiled(struct igt_fb *dst, void 

*dst_buf,
+                       struct igt_fb *src, void *src_buf); +bool igt_amd_is_tiled(uint64_t modifier);
  #endif /* IGT_AMD_H */

lib/igt_fb.c +11 -0
index 4b9be47e..f0fcd1a7 100644
@@ -671,6 +671,17 @@ static uint32_t calc_plane_stride(struct 
 igt_fb *fb, int plane)
            * so the easiest way is to align the luma stride to 256.
            */
           return ALIGN(min_stride, 256);
+    } else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && 
 is_amdgpu_device(fb->fd)) {
+        /*
+         * For amdgpu device with tiling mode
+         */
+        unsigned int tile_width, tile_height;
+
+        igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+                     &tile_width, &tile_height);
+        tile_width *= (fb->plane_bpp[plane] / 8);
+
+        return ALIGN(min_stride, tile_width);
       } else if (is_gen12_ccs_cc_plane(fb, plane)) {

          /* clear color always fixed to 64 bytes */ return 64;

lib/igt_fb.c +12 -0
@@ -711,6 +722,18 @@ static uint64_t calc_plane_size(struct igt_fb 
 *fb, int plane)
           size = roundup_power_of_two(size);
           return size;
+    } else if (fb->modifier != LOCAL_DRM_FORMAT_MOD_NONE && 
 is_amdgpu_device(fb->fd)) {
+        /*
+         * For amdgpu device with tiling mode
+         */
+        unsigned int tile_width, tile_height;
+
+        igt_amd_fb_calculate_tile_dimension(fb->plane_bpp[plane],
+                     &tile_width, &tile_height);
+        tile_height *= (fb->plane_bpp[plane] / 8);
+
+        return (uint64_t) fb->strides[plane] *
+            ALIGN(fb->plane_height[plane], tile_height);
       } else if (is_gen12_ccs_plane(fb, plane)) {
           /* The AUX CCS surface must be page aligned */

          return (uint64_t)fb->strides[plane] *

lib/igt_fb.c +6 -0
@@ -2352,6 +2375,12 @@ static void free_linear_mapping(struct 
 fb_blit_upload *blit)
           vc4_fb_convert_plane_to_tiled(fb, map, &linear->fb, &linear->map);
+        munmap(map, fb->size);
+    } else if (igt_amd_is_tiled(fb->modifier)) {
+        void *map = igt_amd_mmap_bo(fd, fb->gem_handle, fb->size, 
 PROT_WRITE);
+
+        igt_amd_fb_convert_plane_to_tiled(fb, map, &linear->fb, 
 linear->map);
+
           munmap(map, fb->size);
       } else {

          gem_munmap(linear->map, linear->fb.size);

lib/igt_fb.c +4 -0
@@ -2419,6 +2448,10 @@ static void setup_linear_mapping(struct 
 fb_blit_upload *blit)
           vc4_fb_convert_plane_from_tiled(&linear->fb, &linear->map, fb, map);
           munmap(map, fb->size);
+    } else if (igt_amd_is_tiled(fb->modifier)) {
+        linear->map = igt_amd_mmap_bo(fd, linear->fb.gem_handle,
+                          linear->fb.size,
+                          PROT_READ | PROT_WRITE);
       } else {
           /* Copy fb content to linear BO */
           gem_set_domain(fd, linear->fb.gem_handle,
@@ -3625,7 +3658,8 @@ cairo_surface_t *igt_get_cairo_surface(int 
 fd, struct igt_fb *fb)
           if (use_convert(fb))
               create_cairo_surface__convert(fd, fb);

          else if (use_blitter(fb) || use_enginecopy(fb) || -             igt_vc4_is_tiled(fb->modifier))
+             igt_vc4_is_tiled(fb->modifier) ||
+             igt_amd_is_tiled(fb->modifier)) create_cairo_surface__gpu(fd, fb); else
              create_cairo_surface__gtt(fd, fb);

tests/kms_rotation_crc.c +6 -4
index e7072e20..6b0ea67c 100644
@@ -197,10 +197,14 @@ static void prepare_crtc(data_t *data, 
 igt_output_t *output, enum pipe pipe,
       /* create the pipe_crc object for this pipe */
       igt_pipe_crc_free(data->pipe_crc);
-    igt_display_commit2(display, COMMIT_ATOMIC);
+    /* defer crtc cleanup + crtc active for later on amd - not valid
+     * to enable CRTC without a plane active
+     */
+    if (!is_amdgpu_device(data->gfx_fd))
+        igt_display_commit2(display, COMMIT_ATOMIC);
       data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
-    if (start_crc)
+    if (!is_amdgpu_device(data->gfx_fd) && start_crc)
           igt_pipe_crc_start(data->pipe_crc);
   }
@@ -285,8 +289,14 @@ static void prepare_fbs(data_t *data, 
 igt_output_t *output,
               igt_plane_set_position(plane, data->pos_x, data->pos_y);
           igt_display_commit2(display, COMMIT_ATOMIC);
-        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, 
 &data->crc_rect[rect].flip_crc);
-        igt_remove_fb(data->gfx_fd, &data->fb_flip);
Quoted 8 lines

tests/kms_rotation_crc.c static void prepare_fbs(data_t *data, · line 300

Quoted 8 lines
tests/kms_rotation_crc.c +8 -0
+        if (is_i915_device(data->gfx_fd)) {
+            igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+                    &data->crc_rect[rect].flip_crc);
+            igt_remove_fb(data->gfx_fd, &data->fb_flip);
+        } else if (is_amdgpu_device(data->gfx_fd)) {
+            igt_pipe_crc_collect_crc(data->pipe_crc,
+                    &data->crc_rect[rect].flip_crc);
+        }

I'm ok with this change but I was wondering why is this so for amd? Driver on amd has crc counted all the time or crc buffer is very short? On intel hw restarting crc counting will waste several vblanks which can overall double execution time of this test.

Quoted 1 line

If crc buffer is very short on amd there is also possibility to use igt_pipe_crc_drain(..) placed 'correctly'

Quoted 9 lines

CRC generation is tied to vblank handler on AMDGPU, so the OTG needs to be running.

I think that's the case for i915 as well, but a lot of IGT tests are written in a way that the CRTC is enabled before commiting any planes at all.

Unfortunately we can't do the same thing on AMDGPU or we break legacy userspace and their HW cursor checks.

See:
https://www.spinics.net/lists/amd-gfx/msg52208.html

This is good to know. While working with these tests I can try to take this issue into account.

Quoted 1 line
Quoted 8 lines
Quoted 4 lines

I don't really know the best way to solve this in IGT/kernel driver at the moment, but it's kind of a mess and we run into this problem on nearly every test.

So while collect_crc adds a two vblank overhead on every CRC capture and makes the tests run slower it at least enables the tests to run on amdgpu.

For now this is bit theoretical as rotation test on amd hw will be run on DRM_FORMAT_XRGB8888 but if you enable other formats for rotation tests would something like below work better for this crc issue? I have no way of testing it so I don't know if it's correct for amd hw, on intel hw it doesn't seem to make a difference.. (I just tested it on my icelake) What below does is just delay starting of crc counting until there's first plane on screen.

/Juha-Pekka

Thanks for taking a look at this.

This looks theoertically OK to me, though I'm not sure what happens when the framebuffer gets removed if the test can continue as-is.

It'd be good if Joon can double check this on his setup as it'd help cleanup all the if/else surrounding the CRC checks.

Regards,
Nicholas Kazlauskas

Quoted 104 lines

---

tests/kms_rotation_crc.c +1 -11
index a90293442..c0ca7f3e7 100644
@@ -180,16 +180,13 @@ static void cleanup_crtc(data_t *data)
  {
      igt_display_t *display = &data->display;
 
-    igt_pipe_crc_free(data->pipe_crc);
-    data->pipe_crc = NULL;
-
      remove_fbs(data);
 
      igt_display_reset(display);
  }
 
  static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe 
 pipe,
-             igt_plane_t *plane, bool start_crc)
+             igt_plane_t *plane)
  {
      igt_display_t *display = &data->display;
@@ -198,14 +195,7 @@ static void prepare_crtc(data_t *data, igt_output_t 
 *output, enum pipe pipe,
      igt_output_set_pipe(output, pipe);
      igt_plane_set_rotation(plane, IGT_ROTATION_0);
 
-    /* create the pipe_crc object for this pipe */
-    igt_pipe_crc_free(data->pipe_crc);
-
      igt_display_commit2(display, COMMIT_ATOMIC);
-    data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, 
 INTEL_PIPE_CRC_SOURCE_AUTO);
-
-    if (start_crc)
-        igt_pipe_crc_start(data->pipe_crc);
  }

 static void prepare_fbs(data_t *data, igt_output_t *output,

tests/kms_rotation_crc.c +8 -3
@@ -289,11 +279,16 @@ static void prepare_fbs(data_t *data, igt_output_t 
 *output,
              igt_plane_set_position(plane, data->pos_x, data->pos_y);
          igt_display_commit2(display, COMMIT_ATOMIC);
 
-        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
-                     
 &data->crc_rect[data->output_crc_in_use][rect].flip_crc);
+        if (data->pipe_crc == NULL) {
+            data->pipe_crc = igt_pipe_crc_new(data->gfx_fd,
+                              output->config.pipe,
+                              INTEL_PIPE_CRC_SOURCE_AUTO);
 
-        igt_remove_fb(data->gfx_fd, &data->fb_flip);
+            igt_pipe_crc_start(data->pipe_crc);
+        }
 
+        igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+                     
 &data->crc_rect[data->output_crc_in_use][rect].flip_crc);

         /*
         * Create a reference CRC for a software-rotated fb. */

tests/kms_rotation_crc.c +1 -0
@@ -310,6 +305,7 @@ static void prepare_fbs(data_t *data, igt_output_t 
 *output,
 
 &data->crc_rect[data->output_crc_in_use][rect].ref_crc);
 
          data->crc_rect[data->output_crc_in_use][rect].valid = true;
+        igt_remove_fb(data->gfx_fd, &data->fb_flip);
      }

     data->last_on_screen = data->fb_flip;

tests/kms_rotation_crc.c +0 -0
@@ -479,7 +475,7 @@ static void test_plane_rotation(data_t *data, int 

plane_type, bool test_bad_form
         plane = igt_output_get_plane_type(output, plane_type); igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));

-        prepare_crtc(data, output, pipe, plane, true); +        prepare_crtc(data, output, pipe, plane);

         for (i = 0; i < num_rectangle_types; i++) { /* Unsupported on i915 */

tests/kms_rotation_crc.c +0 -0
@@ -520,6 +516,8 @@ static void test_plane_rotation(data_t *data, int 

plane_type, bool test_bad_form
             }
         }
         igt_pipe_crc_stop(data->pipe_crc);
+        igt_pipe_crc_free(data->pipe_crc);
+        data->pipe_crc = NULL;
     }
 }

tests/kms_rotation_crc.c +1 -1
@@ -762,7 +760,7 @@ static void 
 test_plane_rotation_exhaust_fences(data_t *data,
 
      igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));
 
-    prepare_crtc(data, output, pipe, plane, false);
+    prepare_crtc(data, output, pipe, plane);
 
      mode = igt_output_get_mode(output);
Quoted 1 line

     w = mode->hdisplay;

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#7 lore raw

PATCH v3 3/3 HAX remove rotation tests from blacklist

In reply to Sung Joon Kim
---
 tests/intel-ci/blacklist-pre-merge.txt | 1 -
 1 file changed, 1 deletion(-)
tests/intel-ci/blacklist-pre-merge.txt +0 -1
index cddb77c1..ba4478f5 100644
@@ -17,7 +17,6 @@
 #
 # Data acquired on 2020-02-19 by Martin Peres
 ###############################################################################
-igt@kms_rotation_crc@.*
 
 
 ###############################################################################
Signature · 6 lines
2.25.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#8 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for series starting with [v3,1/3] drm-uapi: Add AMD DRM Modifier update to IGT

In reply to Sung Joon Kim
== Series Details ==

== Series Details ==

Series: series starting with [v3,1/3] drm-uapi: Add AMD DRM Modifier update to IGT
URL : https://patchwork.freedesktop.org/series/86664/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_9726 -> IGTPW_5474
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_5474 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_5474, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/index.html

Possible new issues
-------------------

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

### IGT changes ###

#### Possible regressions ####

* igt@gem_exec_parallel@engines@fds:
- fi-tgl-y: NOTRUN -> [FAIL][1] +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/fi-tgl-y/igt@gem_exec_parallel@[email protected]

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@prime_vgem@basic-userptr:
- {fi-ehl-1}: [PASS][2] -> [DMESG-WARN][3]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/fi-ehl-1/igt@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/fi-ehl-1/igt@[email protected]

Known issues
------------

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

### IGT changes ###

#### Issues hit ####

* igt@i915_pm_rpm@module-reload:
- fi-kbl-soraka: [PASS][4] -> [DMESG-WARN][5] ([i915#1982])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/fi-kbl-soraka/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/fi-kbl-soraka/igt@[email protected]

* igt@i915_selftest@live@gt_lrc:
- fi-tgl-y: NOTRUN -> [DMESG-FAIL][6] ([i915#2373])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/fi-tgl-y/igt@i915_selftest@live@gt_lrc.html

* igt@i915_selftest@live@gt_pm:
- fi-tgl-y: NOTRUN -> [DMESG-FAIL][7] ([i915#1759])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/fi-tgl-y/igt@i915_selftest@live@gt_pm.html

* igt@kms_chamelium@vga-edid-read:
- fi-tgl-y: NOTRUN -> [SKIP][8] ([fdo#111827]) +8 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/fi-tgl-y/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- fi-tgl-y: NOTRUN -> [SKIP][9] ([fdo#109285])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/fi-tgl-y/igt@[email protected]

* igt@prime_self_import@basic-with_one_bo_two_files:
- fi-tgl-y: NOTRUN -> [DMESG-WARN][10] ([i915#402]) +1 similar issue
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/fi-tgl-y/igt@prime_self_import@basic-with_one_bo_two_files.html

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s0:
- fi-tgl-u2: [FAIL][11] ([i915#1888]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/fi-tgl-u2/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/fi-tgl-u2/igt@[email protected]

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

[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1759]: https://gitlab.freedesktop.org/drm/intel/issues/1759
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2373]: https://gitlab.freedesktop.org/drm/intel/issues/2373
[i915#2505]: https://gitlab.freedesktop.org/drm/intel/issues/2505
[i915#2724]: https://gitlab.freedesktop.org/drm/intel/issues/2724
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402

Participating hosts (44 -> 38)
------------------------------

Additional (1): fi-tgl-y
Missing (7): fi-jsl-1 fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-dg1-1 fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_5989 -> IGTPW_5474

CI-20190529: 20190529
CI_DRM_9726: b862e8ace7548bf422530a242d142bebf3c5d2ec @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5474: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/index.html
IGT_5989: 57a96840fd5aa7ec48c2f84b30e0420f84ec7386 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5474/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#9 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for series starting with [v3,1/3] drm-uapi: Add AMD DRM Modifier update to IGT (rev2)

In reply to Sung Joon Kim
== Series Details ==

== Series Details ==

Series: series starting with [v3,1/3] drm-uapi: Add AMD DRM Modifier update to IGT (rev2)
URL : https://patchwork.freedesktop.org/series/86664/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9726 -> IGTPW_5475
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/index.html

Known issues
------------

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s3:
- fi-tgl-u2: [PASS][1] -> [FAIL][2] ([i915#1888])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/fi-tgl-u2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-tgl-u2/igt@[email protected]

* igt@i915_selftest@live@gt_lrc:
- fi-tgl-y: NOTRUN -> [DMESG-FAIL][3] ([i915#2373])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-tgl-y/igt@i915_selftest@live@gt_lrc.html

* igt@i915_selftest@live@gt_pm:
- fi-tgl-y: NOTRUN -> [DMESG-FAIL][4] ([i915#1759])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-tgl-y/igt@i915_selftest@live@gt_pm.html

* igt@i915_selftest@live@hangcheck:
- fi-icl-y: [PASS][5] -> [INCOMPLETE][6] ([i915#2782] / [i915#926])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/fi-icl-y/igt@i915_selftest@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-icl-y/igt@i915_selftest@[email protected]

* igt@kms_chamelium@dp-crc-fast:
- fi-kbl-7500u: [PASS][7] -> [FAIL][8] ([i915#1372])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/fi-kbl-7500u/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-kbl-7500u/igt@[email protected]

* igt@kms_chamelium@vga-edid-read:
- fi-tgl-y: NOTRUN -> [SKIP][9] ([fdo#111827]) +8 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-tgl-y/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- fi-tgl-y: NOTRUN -> [SKIP][10] ([fdo#109285])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-tgl-y/igt@[email protected]

* igt@prime_self_import@basic-with_one_bo_two_files:
- fi-tgl-y: NOTRUN -> [DMESG-WARN][11] ([i915#402]) +1 similar issue
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-tgl-y/igt@prime_self_import@basic-with_one_bo_two_files.html

* igt@runner@aborted:
- fi-icl-y: NOTRUN -> [FAIL][12] ([i915#2295] / [i915#2724])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-icl-y/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s0:
- fi-tgl-u2: [FAIL][13] ([i915#1888]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/fi-tgl-u2/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/fi-tgl-u2/igt@[email protected]

[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1372]: https://gitlab.freedesktop.org/drm/intel/issues/1372
[i915#1759]: https://gitlab.freedesktop.org/drm/intel/issues/1759
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#2295]: https://gitlab.freedesktop.org/drm/intel/issues/2295
[i915#2373]: https://gitlab.freedesktop.org/drm/intel/issues/2373
[i915#2724]: https://gitlab.freedesktop.org/drm/intel/issues/2724
[i915#2782]: https://gitlab.freedesktop.org/drm/intel/issues/2782
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#926]: https://gitlab.freedesktop.org/drm/intel/issues/926

Participating hosts (44 -> 38)
------------------------------

Additional (1): fi-tgl-y
Missing (7): fi-jsl-1 fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-dg1-1 fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_5989 -> IGTPW_5475

CI-20190529: 20190529
CI_DRM_9726: b862e8ace7548bf422530a242d142bebf3c5d2ec @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5475: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/index.html
IGT_5989: 57a96840fd5aa7ec48c2f84b30e0420f84ec7386 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#10 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for series starting with [v3,1/3] drm-uapi: Add AMD DRM Modifier update to IGT (rev2)

In reply to Sung Joon Kim
== Series Details ==

== Series Details ==

Series: series starting with [v3,1/3] drm-uapi: Add AMD DRM Modifier update to IGT (rev2)
URL : https://patchwork.freedesktop.org/series/86664/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9726_full -> IGTPW_5475_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/index.html

Possible new issues
-------------------

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

### IGT changes ###

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* {igt@sysfs_clients@recycle-many}:
- shard-apl: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl7/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl3/igt@[email protected]
- shard-hsw: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-hsw7/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-hsw8/igt@[email protected]

Known issues
------------

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

### IGT changes ###

#### Issues hit ####

* igt@api_intel_bb@render-ccs:
- shard-iclb: [PASS][5] -> [INCOMPLETE][6] ([i915#2405])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-iclb7/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb3/igt@[email protected]

* igt@gem_ctx_persistence@clone:
- shard-snb: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#1099])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-snb6/igt@[email protected]
- shard-hsw: NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#1099])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-hsw6/igt@[email protected]

* igt@gem_exec_balancer@hang:
- shard-iclb: [PASS][9] -> [INCOMPLETE][10] ([i915#1895] / [i915#2295])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-iclb6/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb4/igt@[email protected]

* igt@gem_exec_fair@basic-deadline:
- shard-kbl: NOTRUN -> [FAIL][11] ([i915#2846])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl6/igt@[email protected]

* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-apl: [PASS][12] -> [SKIP][13] ([fdo#109271])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl4/igt@gem_exec_fair@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl2/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-none-vip@rcs0:
- shard-kbl: [PASS][14] -> [FAIL][15] ([i915#2842]) +3 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl7/igt@gem_exec_fair@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl6/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vcs0:
- shard-kbl: [PASS][16] -> [SKIP][17] ([fdo#109271])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl7/igt@gem_exec_fair@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl4/igt@gem_exec_fair@[email protected]
- shard-tglb: [PASS][18] -> [FAIL][19] ([i915#2842])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-tglb5/igt@gem_exec_fair@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb2/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vcs1:
- shard-iclb: NOTRUN -> [FAIL][20] ([i915#2842])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb4/igt@gem_exec_fair@[email protected]

* igt@gem_exec_whisper@basic-normal-all:
- shard-glk: [PASS][21] -> [DMESG-WARN][22] ([i915#118] / [i915#95]) +1 similar issue
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-glk3/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-glk4/igt@[email protected]

* igt@gem_render_copy@yf-tiled-mc-ccs-to-vebox-yf-tiled:
- shard-iclb: NOTRUN -> [SKIP][23] ([i915#768])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb7/igt@[email protected]

* igt@gem_userptr_blits@process-exit-mmap-busy@uc:
- shard-kbl: NOTRUN -> [SKIP][24] ([fdo#109271] / [i915#1699]) +3 similar issues
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl6/igt@gem_userptr_blits@[email protected]

* igt@gem_userptr_blits@vma-merge:
- shard-apl: NOTRUN -> [INCOMPLETE][25] ([i915#2502] / [i915#2667])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl1/igt@[email protected]

* igt@gen7_exec_parse@oacontrol-tracking:
- shard-tglb: NOTRUN -> [SKIP][26] ([fdo#109289])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb1/igt@[email protected]

* igt@gen9_exec_parse@allowed-all:
- shard-iclb: NOTRUN -> [SKIP][27] ([fdo#112306])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb4/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][28] ([fdo#112306])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb2/igt@[email protected]

* igt@gen9_exec_parse@shadow-peek:
- shard-tglb: NOTRUN -> [SKIP][29] ([i915#2856])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb2/igt@[email protected]

* igt@i915_pm_dc@dc6-psr:
- shard-iclb: [PASS][30] -> [FAIL][31] ([i915#454])
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-iclb8/igt@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb8/igt@[email protected]

* igt@i915_pm_rpm@modeset-non-lpsp-stress:
- shard-tglb: NOTRUN -> [SKIP][32] ([fdo#111644] / [i915#1397] / [i915#2411])
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb1/igt@[email protected]

* igt@i915_query@query-topology-unsupported:
- shard-tglb: NOTRUN -> [SKIP][33] ([fdo#109302])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb5/igt@[email protected]

* igt@i915_suspend@debugfs-reader:
- shard-kbl: [PASS][34] -> [INCOMPLETE][35] ([i915#155])
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl4/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl1/igt@[email protected]

* igt@i915_suspend@sysfs-reader:
- shard-apl: [PASS][36] -> [DMESG-WARN][37] ([i915#180]) +1 similar issue
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl1/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl8/igt@[email protected]

* igt@kms_atomic@plane-primary-overlay-mutable-zpos:
- shard-tglb: NOTRUN -> [SKIP][38] ([i915#404])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb8/igt@[email protected]

* igt@kms_big_fb@yf-tiled-addfb:
- shard-tglb: NOTRUN -> [SKIP][39] ([fdo#111615]) +1 similar issue
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb3/igt@[email protected]

* igt@kms_chamelium@vga-hpd-for-each-pipe:
- shard-kbl: NOTRUN -> [SKIP][40] ([fdo#109271] / [fdo#111827]) +8 similar issues
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl4/igt@[email protected]
- shard-apl: NOTRUN -> [SKIP][41] ([fdo#109271] / [fdo#111827]) +6 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl2/igt@[email protected]

* igt@kms_color_chamelium@pipe-d-ctm-0-5:
- shard-snb: NOTRUN -> [SKIP][42] ([fdo#109271] / [fdo#111827])
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-snb2/igt@[email protected]
- shard-hsw: NOTRUN -> [SKIP][43] ([fdo#109271] / [fdo#111827])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-hsw1/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][44] ([fdo#109284] / [fdo#111827]) +1 similar issue
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb2/igt@[email protected]
- shard-glk: NOTRUN -> [SKIP][45] ([fdo#109271] / [fdo#111827])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-glk9/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][46] ([fdo#109278] / [fdo#109284] / [fdo#111827])
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb4/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-512x170-onscreen:
- shard-tglb: NOTRUN -> [SKIP][47] ([fdo#109279])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb7/igt@[email protected]

* igt@kms_cursor_edge_walk@pipe-d-256x256-right-edge:
- shard-iclb: NOTRUN -> [SKIP][48] ([fdo#109278]) +4 similar issues
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb7/igt@[email protected]

* igt@kms_cursor_legacy@2x-cursor-vs-flip-atomic:
- shard-snb: NOTRUN -> [SKIP][49] ([fdo#109271]) +47 similar issues
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-snb4/igt@[email protected]

* igt@kms_cursor_legacy@cursorb-vs-flipa-toggle:
- shard-iclb: NOTRUN -> [SKIP][50] ([fdo#109274] / [fdo#109278]) +2 similar issues
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb6/igt@[email protected]

* igt@kms_flip@2x-flip-vs-absolute-wf_vblank:
- shard-iclb: NOTRUN -> [SKIP][51] ([fdo#109274])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb3/igt@kms_flip@2x-flip-vs-absolute-wf_vblank.html

* igt@kms_flip@2x-plain-flip-ts-check-interruptible@bc-hdmi-a1-hdmi-a2:
- shard-glk: [PASS][52] -> [FAIL][53] ([i915#2122])
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-glk4/igt@kms_flip@[email protected]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-glk3/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1:
- shard-tglb: [PASS][54] -> [FAIL][55] ([i915#2598])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-tglb3/igt@kms_flip@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb2/igt@kms_flip@[email protected]

* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-64bpp-ytile:
- shard-apl: NOTRUN -> [SKIP][56] ([fdo#109271] / [i915#2642])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl3/igt@[email protected]
- shard-glk: NOTRUN -> [SKIP][57] ([fdo#109271] / [i915#2642])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-glk3/igt@[email protected]
- shard-kbl: NOTRUN -> [SKIP][58] ([fdo#109271] / [i915#2642])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl2/igt@[email protected]

* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytile:
- shard-kbl: NOTRUN -> [FAIL][59] ([i915#2641])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl6/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-indfb-pgflip-blt:
- shard-glk: NOTRUN -> [SKIP][60] ([fdo#109271]) +20 similar issues
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-glk2/igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-indfb-pgflip-blt.html
- shard-iclb: NOTRUN -> [SKIP][61] ([fdo#109280]) +5 similar issues
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-indfb-pgflip-blt.html

* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-cur-indfb-draw-pwrite:
- shard-apl: NOTRUN -> [SKIP][62] ([fdo#109271]) +75 similar issues
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl7/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-cur-indfb-draw-pwrite.html

* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-blt:
- shard-hsw: NOTRUN -> [SKIP][63] ([fdo#109271]) +32 similar issues
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-hsw1/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-pwrite:
- shard-tglb: NOTRUN -> [SKIP][64] ([fdo#111825]) +17 similar issues
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb5/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-pwrite.html

* igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-wc:
- shard-kbl: NOTRUN -> [SKIP][65] ([fdo#109271]) +83 similar issues
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl6/igt@[email protected]

* igt@kms_multipipe_modeset@basic-max-pipe-crc-check:
- shard-tglb: NOTRUN -> [SKIP][66] ([i915#1839])
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb7/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][67] ([i915#1839])
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb1/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-d:
- shard-kbl: NOTRUN -> [SKIP][68] ([fdo#109271] / [i915#533])
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl7/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-alpha-7efc:
- shard-kbl: NOTRUN -> [FAIL][69] ([fdo#108145] / [i915#265]) +1 similar issue
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl6/igt@[email protected]
- shard-apl: NOTRUN -> [FAIL][70] ([fdo#108145] / [i915#265])
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl7/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-alpha-transparent-fb:
- shard-kbl: NOTRUN -> [FAIL][71] ([i915#265])
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl6/igt@[email protected]

* igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2:
- shard-kbl: NOTRUN -> [SKIP][72] ([fdo#109271] / [i915#658]) +2 similar issues
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl1/igt@[email protected]

* igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-3:
- shard-tglb: NOTRUN -> [SKIP][73] ([i915#2920]) +1 similar issue
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb5/igt@[email protected]

* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-1:
- shard-apl: NOTRUN -> [SKIP][74] ([fdo#109271] / [i915#658]) +1 similar issue
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl1/igt@[email protected]

* igt@kms_psr2_sf@plane-move-sf-dmg-area-1:
- shard-glk: NOTRUN -> [SKIP][75] ([fdo#109271] / [i915#658])
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-glk9/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][76] ([i915#2920])
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb2/igt@[email protected]

* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][77] -> [SKIP][78] ([fdo#109441]) +2 similar issues
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb5/igt@kms_psr@psr2_cursor_render.html

* igt@kms_psr@psr2_dpms:
- shard-iclb: NOTRUN -> [SKIP][79] ([fdo#109441])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb1/igt@kms_psr@psr2_dpms.html
- shard-hsw: NOTRUN -> [SKIP][80] ([fdo#109271] / [i915#1072])
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-hsw2/igt@kms_psr@psr2_dpms.html

* igt@kms_sysfs_edid_timing:
- shard-kbl: NOTRUN -> [FAIL][81] ([IGT#2])
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl1/igt@kms_sysfs_edid_timing.html

* igt@kms_vblank@pipe-d-wait-forked-busy:
- shard-hsw: NOTRUN -> [SKIP][82] ([fdo#109271] / [i915#533]) +2 similar issues
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-hsw2/igt@[email protected]

* igt@kms_writeback@writeback-check-output:
- shard-kbl: NOTRUN -> [SKIP][83] ([fdo#109271] / [i915#2437])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl7/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][84] ([i915#2437])
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb5/igt@[email protected]

* igt@nouveau_crc@pipe-c-source-outp-inactive:
- shard-tglb: NOTRUN -> [SKIP][85] ([i915#2530])
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb6/igt@[email protected]

* igt@perf_pmu@event-wait@rcs0:
- shard-tglb: NOTRUN -> [SKIP][86] ([fdo#112283])
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb2/igt@perf_pmu@[email protected]

* igt@prime_nv_test@i915_import_pread_pwrite:
- shard-tglb: NOTRUN -> [SKIP][87] ([fdo#109291]) +1 similar issue
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb7/igt@prime_nv_test@i915_import_pread_pwrite.html
- shard-iclb: NOTRUN -> [SKIP][88] ([fdo#109291])
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb8/igt@prime_nv_test@i915_import_pread_pwrite.html

#### Possible fixes ####

* igt@gem_ctx_isolation@preservation-s3@rcs0:
- shard-apl: [INCOMPLETE][89] ([i915#1630]) -> [PASS][90]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl2/igt@gem_ctx_isolation@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl7/igt@gem_ctx_isolation@[email protected]

* igt@gem_eio@in-flight-suspend:
- shard-kbl: [DMESG-WARN][91] ([i915#1037] / [i915#180]) -> [PASS][92]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl7/igt@[email protected]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl7/igt@[email protected]

* igt@gem_exec_fair@basic-flow@rcs0:
- shard-apl: [SKIP][93] ([fdo#109271]) -> [PASS][94]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl1/igt@gem_exec_fair@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl7/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-tglb: [FAIL][95] ([i915#2842]) -> [PASS][96]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-tglb7/igt@gem_exec_fair@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb5/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-none@vecs0:
- shard-kbl: [FAIL][97] ([i915#2842]) -> [PASS][98]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl6/igt@gem_exec_fair@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl1/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@rcs0:
- shard-glk: [FAIL][99] ([i915#2842]) -> [PASS][100]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-glk4/igt@gem_exec_fair@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-glk9/igt@gem_exec_fair@[email protected]

* igt@gem_exec_reloc@basic-many-active@rcs0:
- shard-glk: [FAIL][101] ([i915#2389]) -> [PASS][102]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-glk2/igt@gem_exec_reloc@[email protected]
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-glk2/igt@gem_exec_reloc@[email protected]

* igt@i915_pm_rpm@system-suspend-modeset:
- shard-kbl: [INCOMPLETE][103] ([i915#151] / [i915#155]) -> [PASS][104]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl4/igt@[email protected]
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl1/igt@[email protected]

* igt@kms_color@pipe-b-legacy-gamma-reset:
- shard-apl: [FAIL][105] ([i915#2964]) -> [PASS][106]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl2/igt@[email protected]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl3/igt@[email protected]
- shard-kbl: [FAIL][107] ([i915#2964]) -> [PASS][108]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl2/igt@[email protected]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl1/igt@[email protected]

* igt@kms_cursor_crc@pipe-b-cursor-suspend:
- shard-apl: [DMESG-WARN][109] ([i915#180]) -> [PASS][110]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl1/igt@[email protected]
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl7/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-varying-size:
- shard-tglb: [FAIL][111] ([i915#2346]) -> [PASS][112]
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-tglb2/igt@[email protected]
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb8/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- shard-kbl: [DMESG-WARN][113] ([i915#180]) -> [PASS][114] +1 similar issue
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl7/igt@[email protected]
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl1/igt@[email protected]

* igt@kms_psr@psr2_basic:
- shard-iclb: [SKIP][115] ([fdo#109441]) -> [PASS][116] +1 similar issue
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-iclb1/igt@kms_psr@psr2_basic.html
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb2/igt@kms_psr@psr2_basic.html

* {igt@sysfs_clients@recycle}:
- shard-hsw: [FAIL][117] ([i915#3028]) -> [PASS][118]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-hsw8/igt@[email protected]
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-hsw4/igt@[email protected]
- shard-iclb: [FAIL][119] ([i915#3028]) -> [PASS][120]
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-iclb3/igt@[email protected]
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb6/igt@[email protected]

* {igt@sysfs_clients@recycle-many}:
- shard-glk: [FAIL][121] -> [PASS][122]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-glk9/igt@[email protected]
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-glk1/igt@[email protected]

#### Warnings ####

* igt@kms_async_flips@test-time-stamp:
- shard-tglb: [FAIL][123] ([i915#2597]) -> [FAIL][124] ([i915#2574])
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-tglb3/igt@[email protected]
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-tglb5/igt@[email protected]

* igt@kms_psr2_sf@cursor-plane-update-sf:
- shard-iclb: [SKIP][125] ([i915#2920]) -> [SKIP][126] ([i915#658]) +1 similar issue
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-iclb2/igt@[email protected]
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb1/igt@[email protected]

* igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-3:
- shard-iclb: [SKIP][127] ([i915#658]) -> [SKIP][128] ([i915#2920])
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-iclb6/igt@[email protected]
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-iclb2/igt@[email protected]

* igt@runner@aborted:
- shard-kbl: ([FAIL][129], [FAIL][130], [FAIL][131], [FAIL][132], [FAIL][133], [FAIL][134]) ([i915#1436] / [i915#1814] / [i915#2295] / [i915#2505] / [i915#3002]) -> ([FAIL][135], [FAIL][136], [FAIL][137]) ([i915#2295] / [i915#3002])
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl7/igt@[email protected]
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl6/igt@[email protected]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl7/igt@[email protected]
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl6/igt@[email protected]
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl2/igt@[email protected]
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-kbl2/igt@[email protected]
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl4/igt@[email protected]
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl2/igt@[email protected]
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-kbl7/igt@[email protected]
- shard-apl: ([FAIL][138], [FAIL][139], [FAIL][140], [FAIL][141]) ([i915#1610] / [i915#1814] / [i915#2295] / [i915#2426] / [i915#3002]) -> ([FAIL][142], [FAIL][143], [FAIL][144], [FAIL][145], [FAIL][146], [FAIL][147]) ([i915#1610] / [i915#2295] / [i915#2426] / [i915#3002])
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl8/igt@[email protected]
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl1/igt@[email protected]
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl4/igt@[email protected]
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9726/shard-apl3/igt@[email protected]
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl8/igt@[email protected]
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl1/igt@[email protected]
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl4/igt@[email protected]
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl4/igt@[email protected]
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl1/igt@[email protected]
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/shard-apl4/igt@[email protected]

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

[IGT#2]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/2
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
[fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
[fdo#112306]: https://bugs.freedesktop.org/show_bug.cgi?id=112306
[i915#1037]: https://gitlab.freedesktop.org/

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5475/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

Reviewed-by on v3 1/3
#11 lore raw
In reply to Sung Joon Kim
Quoted 4 lines · Sung Joon Kim

Aligns IGT drm_fourcc.h to the AMD's latest commit to this file in drm-next:
8ba16d5993749c3f31fd2b49e16f0dc1e1770b9c: drm/fourcc: Add AMD DRM modifiers.

Thanks for updating this with the commit hash and pulling it from drm-next.

Regards,
Nicholas Kazlauskas

Quoted 143 lines
---
  include/drm-uapi/drm_fourcc.h | 135 ++++++++++++++++++++++++++++++++++
  1 file changed, 135 insertions(+)
include/drm-uapi/drm_fourcc.h +130 -0
index 82f32780..a7bc058c 100644
@@ -1056,8 +1056,143 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
   */
  #define AMLOGIC_FBC_OPTION_MEM_SAVING		(1ULL << 0)
 
+/*
+ * AMD modifiers
+ *
+ * Memory layout:
+ *
+ * without DCC:
+ *   - main surface
+ *
+ * with DCC & without DCC_RETILE:
+ *   - main surface in plane 0
+ *   - DCC surface in plane 1 (RB-aligned, pipe-aligned if DCC_PIPE_ALIGN is set)
+ *
+ * with DCC & DCC_RETILE:
+ *   - main surface in plane 0
+ *   - displayable DCC surface in plane 1 (not RB-aligned & not pipe-aligned)
+ *   - pipe-aligned DCC surface in plane 2 (RB-aligned & pipe-aligned)
+ *
+ * For multi-plane formats the above surfaces get merged into one plane for
+ * each format plane, based on the required alignment only.
+ *
+ * Bits  Parameter                Notes
+ * ----- ------------------------ ---------------------------------------------
+ *
+ *   7:0 TILE_VERSION             Values are AMD_FMT_MOD_TILE_VER_*
+ *  12:8 TILE                     Values are AMD_FMT_MOD_TILE_<version>_*
+ *    13 DCC
+ *    14 DCC_RETILE
+ *    15 DCC_PIPE_ALIGN
+ *    16 DCC_INDEPENDENT_64B
+ *    17 DCC_INDEPENDENT_128B
+ * 19:18 DCC_MAX_COMPRESSED_BLOCK Values are AMD_FMT_MOD_DCC_BLOCK_*
+ *    20 DCC_CONSTANT_ENCODE
+ * 23:21 PIPE_XOR_BITS            Only for some chips
+ * 26:24 BANK_XOR_BITS            Only for some chips
+ * 29:27 PACKERS                  Only for some chips
+ * 32:30 RB                       Only for some chips
+ * 35:33 PIPE                     Only for some chips
+ * 55:36 -                        Reserved for future use, must be zero
+ */
+#define AMD_FMT_MOD fourcc_mod_code(AMD, 0)
+
+#define IS_AMD_FMT_MOD(val) (((val) >> 56) == DRM_FORMAT_MOD_VENDOR_AMD)
+
+/* Reserve 0 for GFX8 and older */
+#define AMD_FMT_MOD_TILE_VER_GFX9 1
+#define AMD_FMT_MOD_TILE_VER_GFX10 2
+#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3
+
+/*
+ * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical
+ * version.
+ */
+#define AMD_FMT_MOD_TILE_GFX9_64K_S 9
+
+/*
+ * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has
+ * GFX9 as canonical version.
+ */
+#define AMD_FMT_MOD_TILE_GFX9_64K_D 10
+#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25
+#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26
+#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27
+
+#define AMD_FMT_MOD_DCC_BLOCK_64B 0
+#define AMD_FMT_MOD_DCC_BLOCK_128B 1
+#define AMD_FMT_MOD_DCC_BLOCK_256B 2
+
+#define AMD_FMT_MOD_TILE_VERSION_SHIFT 0
+#define AMD_FMT_MOD_TILE_VERSION_MASK 0xFF
+#define AMD_FMT_MOD_TILE_SHIFT 8
+#define AMD_FMT_MOD_TILE_MASK 0x1F
+
+/* Whether DCC compression is enabled. */
+#define AMD_FMT_MOD_DCC_SHIFT 13
+#define AMD_FMT_MOD_DCC_MASK 0x1
+
+/*
+ * Whether to include two DCC surfaces, one which is rb & pipe aligned, and
+ * one which is not-aligned.
+ */
+#define AMD_FMT_MOD_DCC_RETILE_SHIFT 14
+#define AMD_FMT_MOD_DCC_RETILE_MASK 0x1
+
+/* Only set if DCC_RETILE = false */
+#define AMD_FMT_MOD_DCC_PIPE_ALIGN_SHIFT 15
+#define AMD_FMT_MOD_DCC_PIPE_ALIGN_MASK 0x1
+
+#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_SHIFT 16
+#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_MASK 0x1
+#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_SHIFT 17
+#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_MASK 0x1
+#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18
+#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3
+
+/*
+ * DCC supports embedding some clear colors directly in the DCC surface.
+ * However, on older GPUs the rendering HW ignores the embedded clear color
+ * and prefers the driver provided color. This necessitates doing a fastclear
+ * eliminate operation before a process transfers control.
+ *
+ * If this bit is set that means the fastclear eliminate is not needed for these
+ * embeddable colors.
+ */
+#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_SHIFT 20
+#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_MASK 0x1
+
+/*
+ * The below fields are for accounting for per GPU differences. These are only
+ * relevant for GFX9 and later and if the tile field is *_X/_T.
+ *
+ * PIPE_XOR_BITS = always needed
+ * BANK_XOR_BITS = only for TILE_VER_GFX9
+ * PACKERS = only for TILE_VER_GFX10_RBPLUS
+ * RB = only for TILE_VER_GFX9 & DCC
+ * PIPE = only for TILE_VER_GFX9 & DCC & (DCC_RETILE | DCC_PIPE_ALIGN)
+ */
+#define AMD_FMT_MOD_PIPE_XOR_BITS_SHIFT 21
+#define AMD_FMT_MOD_PIPE_XOR_BITS_MASK 0x7
+#define AMD_FMT_MOD_BANK_XOR_BITS_SHIFT 24
+#define AMD_FMT_MOD_BANK_XOR_BITS_MASK 0x7
+#define AMD_FMT_MOD_PACKERS_SHIFT 27
+#define AMD_FMT_MOD_PACKERS_MASK 0x7
+#define AMD_FMT_MOD_RB_SHIFT 30
+#define AMD_FMT_MOD_RB_MASK 0x7
+#define AMD_FMT_MOD_PIPE_SHIFT 33
+#define AMD_FMT_MOD_PIPE_MASK 0x7
+
+#define AMD_FMT_MOD_SET(field, value) \
+	((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT)
+#define AMD_FMT_MOD_GET(field, value) \

include/drm-uapi/drm_fourcc.h drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) · line 1198

Quoted 10 lines
include/drm-uapi/drm_fourcc.h +5 -0
+	(((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK)
+#define AMD_FMT_MOD_CLEAR(field) \
+	(~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
+
  #if defined(__cplusplus)
  }
  #endif
 
  #endif /* DRM_FOURCC_H */
+

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#12 lore raw

[igt-dev] ✗ Fi.CI.BUILD: failure for series starting with [v3,1/3] drm-uapi: Add AMD DRM Modifier update to IGT (rev3)

In reply to Sung Joon Kim
== Series Details ==

== Series Details ==

Series: series starting with [v3,1/3] drm-uapi: Add AMD DRM Modifier update to IGT (rev3)
URL : https://patchwork.freedesktop.org/series/86664/
State : failure

== Summary ==

Applying: drm-uapi: Add AMD DRM Modifier update to IGT
Applying: tests/kms_rotation_crc: Add HW Rotation test case for amdgpu with tiling Patch failed at 0002 tests/kms_rotation_crc: Add HW Rotation test case for amdgpu with tiling When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev