Skip to contentSkip to conversation

lib/intel_tiling_info: Add flags field to describe command properties

PATCH In review Karolina Stolarek 3 participants 5 messages Feb 2, 2023 – Feb 3, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/intel_tiling_info: Add flags field to describe command properties

Blitter commands may have different properties depending on the platform. Add a new field to blt_tiling_info struct to describe properties of the commands. Update definitions of block-copy on DG2 and beyond to show the differences. Add helpers that check if a platform uses an extended version of the block-copy command or supports compression. Update gem_ccs test to use these functions.

---
 lib/i915/i915_blt.c          | 89 +++++++++++++++++++++++++++++-------
 lib/i915/i915_blt.h          | 10 +++-
 lib/i915/intel_tiling_info.c | 28 +++++++++---
 lib/i915/intel_tiling_info.h |  4 ++
 tests/i915/gem_ccs.c         |  7 ++-
 5 files changed, 111 insertions(+), 27 deletions(-)
lib/i915/i915_blt.c +73 -16
index bbfb6ffc..bda9ea5f 100644
@@ -191,23 +191,22 @@ struct gen12_block_copy_data_ext {
 	} dw21;
 };
 
-/**
- * blt_supports_compression:
- * @i915: drm fd
- *
- * Function checks if HW supports flatccs compression in blitter commands
- * on @i915 device.
- *
- * Returns:
- * true if it does, false otherwise.
- */
-bool blt_supports_compression(int i915)
+static bool device_supports_compression(int i915)
 {
 	uint32_t devid = intel_get_drm_devid(i915);
 
 	return HAS_FLATCCS(devid);
 }
 
+static const struct blt_tiling_info *blt_get_tiling_info(const struct blt_cmd_info *info,
+							 enum blt_cmd_type cmd)
+{
+	if (!info)
+		return NULL;
+
+	return info->supported_cmds[cmd];
+}
+
 /**
  * blt_supports_command:
  * @info: Blitter command info struct
@@ -222,7 +221,7 @@ bool blt_supports_command(const struct blt_cmd_info *info,
 {
 	igt_require_f(info, "No config found for the platform\n");
 
-	return info->supported_cmds[cmd];
+	return blt_get_tiling_info(info, cmd);
 }
 
 /**
@@ -242,10 +241,7 @@ bool blt_cmd_supports_tiling(const struct blt_cmd_info *info,
 {
 	struct blt_tiling_info const *tile_config;
 
-	if (!info)
-		return false;
-
-	tile_config = info->supported_cmds[cmd];
+	tile_config = blt_get_tiling_info(info, cmd);
 
 	/* no config means no support for that tiling */
 	if (!tile_config)
@@ -254,6 +250,32 @@ bool blt_cmd_supports_tiling(const struct blt_cmd_info *info,
 	return tile_config->supported_tiling & BIT(tiling);
 }
 
+/**
+ * blt_cmd_has_property:
+ * @info: Blitter command info struct
+ * @cmd: Blitter command enum
+ * @flag: property flag
+ *
+ * Checks if a @cmd entry of @info has @flag property. The properties can be
+ * freely combined, but the function will return true for platforms for which
+ * all properties defined in the bit flag are present. The function returns
+ * false if no information about the command is stored.
+ *
+ * Returns: true if it does, false otherwise
+ */
+bool blt_cmd_has_property(const struct blt_cmd_info *info,
+			  enum blt_cmd_type cmd, uint32_t flag)
+{
+	struct blt_tiling_info const *tile_config;
+
+	tile_config = blt_get_tiling_info(info, cmd);
+
+	if (!tile_config)
+		return false;
+
+	return tile_config->flags & flag;
+}
+
 /**
  * blt_has_block_copy
  * @i915: drm fd
@@ -320,6 +342,41 @@ bool blt_block_copy_supports_tiling(int i915, enum blt_tiling_type tiling)
 	return blt_cmd_supports_tiling(blt_info, XY_BLOCK_COPY, tiling);
 }
 
+/**
+ * blt_block_copy_supports_compression
+ * @i915: drm fd
+ *
+ * Check if block copy provided by @i915 device supports compression.
+ *
+ * Returns:
+ * true if it does, false otherwise.
+ */
+bool blt_block_copy_supports_compression(int i915)
+{
+	const struct blt_cmd_info *blt_info = GET_BLT_INFO(i915);
+
+	return device_supports_compression(i915) &&
+	       blt_cmd_has_property(blt_info, XY_BLOCK_COPY,
+				    BLT_CMD_SUPPORTS_COMPRESSION);
+}
+
+/**
+ * blt_uses_extended_block_copy
+ * @i915: drm fd
+ *
+ * Check if block copy provided by @i915 device uses an extended version
+ * of the command.
+ *
+ * Returns:
+ * true if it does, false otherwise.
+ */
+bool blt_uses_extended_block_copy(int i915)
+{
+	const struct blt_cmd_info *blt_info = GET_BLT_INFO(i915);
+
+	return blt_cmd_has_property(blt_info, XY_BLOCK_COPY, BLT_CMD_EXTENDED);
+}
+
 /**
  * blt_tiling_name:
  * @tiling: tiling id
lib/i915/i915_blt.h +9 -1
index 299dff8e..14885db3 100644
@@ -157,16 +157,24 @@ struct blt_ctrl_surf_copy_data {
 	bool print_bb;
 };
 
-bool blt_supports_compression(int i915);
 bool blt_supports_command(const struct blt_cmd_info *info,
 			  enum blt_cmd_type cmd);
 bool blt_cmd_supports_tiling(const struct blt_cmd_info *info,
 			     enum blt_cmd_type cmd,
 			     enum blt_tiling_type tiling);
+bool blt_cmd_has_property(const struct blt_cmd_info *info,
+			  enum blt_cmd_type cmd,
+			  uint32_t flag);
+
 bool blt_has_block_copy(int i915);
 bool blt_has_fast_copy(int i915);
+
 bool blt_fast_copy_supports_tiling(int i915, enum blt_tiling_type tiling);
 bool blt_block_copy_supports_tiling(int i915, enum blt_tiling_type tiling);
+
+bool blt_block_copy_supports_compression(int i915);
+bool blt_uses_extended_block_copy(int i915);
+
 const char *blt_tiling_name(enum blt_tiling_type tiling);
 
 uint64_t emit_blt_block_copy(int i915,
lib/i915/intel_tiling_info.c +22 -6
index fc388919..1dcf17c2 100644
@@ -12,6 +12,12 @@
 		.supported_tiling = _tiling \
 	}
 
+#define BLT_INFO_EXT(_cmd, _tiling, _flags) { \
+		.blt_cmd_type = _cmd, \
+		.supported_tiling = _tiling, \
+		.flags = _flags \
+	}
+
 static const struct blt_tiling_info src_copy = BLT_INFO(SRC_COPY, BIT(T_LINEAR));
 static const struct blt_tiling_info
 		pre_gen8_xy_src_copy = BLT_INFO(XY_SRC_COPY,
@@ -44,12 +50,22 @@ static const struct blt_tiling_info
 		gen12_xy_block_copy = BLT_INFO(XY_BLOCK_COPY,
 					       BIT(T_LINEAR) |
 					       BIT(T_YMAJOR));
+
+#define DG2_SUPPORTED_TILING \
+	(BIT(T_LINEAR) | \
+	 BIT(T_XMAJOR) | \
+	 BIT(T_TILE4)  | \
+	 BIT(T_TILE64))
+
+#define DG2_BLOCK_COPY_INFO(_flags) \
+	BLT_INFO_EXT(XY_BLOCK_COPY, DG2_SUPPORTED_TILING, (_flags))
+
+static const struct blt_tiling_info
+		dg2_xy_block_copy = DG2_BLOCK_COPY_INFO(BLT_CMD_EXTENDED |
+							BLT_CMD_SUPPORTS_COMPRESSION);
+
 static const struct blt_tiling_info
-		dg2_xy_block_copy = BLT_INFO(XY_BLOCK_COPY,
-					     BIT(T_LINEAR) |
-					     BIT(T_XMAJOR) |
-					     BIT(T_TILE4)  |
-					     BIT(T_TILE64));
+		mtl_xy_block_copy = DG2_BLOCK_COPY_INFO(BLT_CMD_EXTENDED);
 
 const struct blt_cmd_info pre_gen8_blt_info = {
 	.supported_cmds = {
@@ -90,6 +106,6 @@ const struct blt_cmd_info gen12_dg2_blt_info = {
 const struct blt_cmd_info gen12_mtl_blt_info = {
 	.supported_cmds = {
 		[XY_FAST_COPY] = &dg2_xy_fast_copy,
-		[XY_BLOCK_COPY] = &dg2_xy_block_copy
+		[XY_BLOCK_COPY] = &mtl_xy_block_copy
 	}
 };
lib/i915/intel_tiling_info.h +4 -0
index bb655103..a6288f49 100644
@@ -29,6 +29,10 @@ enum blt_cmd_type {
 struct blt_tiling_info {
 	enum blt_cmd_type blt_cmd_type;
 	uint32_t supported_tiling;
+
+	uint32_t flags;
+#define BLT_CMD_EXTENDED		(1 << 0)
+#define BLT_CMD_SUPPORTS_COMPRESSION	(1 << 1)
 };
 
 struct blt_cmd_info {
tests/i915/gem_ccs.c +3 -4
index a24c8e1f..b7e8bda7 100644
@@ -346,7 +346,6 @@ static void block_copy(int i915,
 	uint32_t run_id = mid_tiling;
 	uint32_t mid_region = region2, bb;
 	uint32_t width = param.width, height = param.height;
-	uint32_t devid = intel_get_drm_devid(i915);
 	enum blt_compression mid_compression = config->compression;
 	int mid_compression_format = param.compression_format;
 	enum blt_compression_type comp_type = COMPRESSION_TYPE_3D;
@@ -355,7 +354,7 @@ static void block_copy(int i915,
 
 	igt_assert(__gem_create_in_memory_regions(i915, &bb, &bb_size, region1) == 0);
 
-	if (!blt_supports_compression(i915) && !IS_METEORLAKE(devid))
+	if (!blt_uses_extended_block_copy(i915))
 		pext = NULL;
 
 	src = blt_create_object(i915, region1, width, height, bpp, uc_mocs,
@@ -470,7 +469,7 @@ static void block_multicopy(int i915,
 
 	igt_assert(__gem_create_in_memory_regions(i915, &bb, &bb_size, region1) == 0);
 
-	if (!blt_supports_compression(i915))
+	if (!blt_uses_extended_block_copy(i915))
 		pext3 = NULL;
 
 	src = blt_create_object(i915, region1, width, height, bpp, uc_mocs,
@@ -557,7 +556,7 @@ static void block_copy_test(int i915,
 	const struct intel_execution_engine2 *e;
 	int tiling;
 
-	if (config->compression && !blt_supports_compression(i915))
+	if (config->compression && !blt_block_copy_supports_compression(i915))
 		return;
 
 	if (config->inplace && !config->compression)
Signature · 1 line
2.25.1
#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for lib/intel_tiling_info: Add flags field to describe command properties

== Series Details ==

== Series Details ==

Series: lib/intel_tiling_info: Add flags field to describe command properties
URL : https://patchwork.freedesktop.org/series/113595/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12682 -> IGTPW_8435
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Participating hosts (27 -> 26)
------------------------------

Missing (1): fi-snb-2520m

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@execlists:
- fi-kbl-soraka: NOTRUN -> [INCOMPLETE][1] ([i915#7156])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/fi-kbl-soraka/igt@i915_selftest@[email protected]

#### Possible fixes ####

* igt@i915_pm_rpm@module-reload:
- bat-dg1-6: [SKIP][2] ([i915#7855]) -> [PASS][3]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/bat-dg1-6/igt@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/bat-dg1-6/igt@[email protected]

* igt@i915_selftest@live@hangcheck:
- fi-kbl-soraka: [INCOMPLETE][4] ([i915#7913]) -> [PASS][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/fi-kbl-soraka/igt@i915_selftest@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/fi-kbl-soraka/igt@i915_selftest@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc@pipe-d-hdmi-a-3:
- {bat-dg2-11}: [INCOMPLETE][6] ([i915#7908]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/bat-dg2-11/igt@kms_pipe_crc_basic@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/bat-dg2-11/igt@kms_pipe_crc_basic@[email protected]

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

[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7156]: https://gitlab.freedesktop.org/drm/intel/issues/7156
[i915#7855]: https://gitlab.freedesktop.org/drm/intel/issues/7855
[i915#7908]: https://gitlab.freedesktop.org/drm/intel/issues/7908
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7996]: https://gitlab.freedesktop.org/drm/intel/issues/7996

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

* CI: CI-20190529 -> None
* IGT: IGT_7144 -> IGTPW_8435

CI-20190529: 20190529
CI_DRM_12682: b0ddd08fba5c065cdc402a3be6cc6eb3340a7996 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8435: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/index.html
IGT_7144: cda71bf809b981a646270963d6b1ccee4fd4643b @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

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

#2 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for lib/intel_tiling_info: Add flags field to describe command properties

In reply to Karolina Stolarek
== Series Details ==

== Series Details ==

Series: lib/intel_tiling_info: Add flags field to describe command properties
URL : https://patchwork.freedesktop.org/series/113595/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12682_full -> IGTPW_8435_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Participating hosts (11 -> 10)
------------------------------

Missing (1): shard-rkl0

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

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

### IGT changes ###

#### Suppressed ####

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

* igt@gem_exec_capture@pi@bcs0:
- {shard-rkl}: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-2/igt@gem_exec_capture@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-2/igt@gem_exec_capture@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@kms_cursor_legacy@torture-bo@all-pipes:
- shard-glk: [PASS][3] -> [DMESG-WARN][4] ([i915#118])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-glk6/igt@kms_cursor_legacy@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-glk6/igt@kms_cursor_legacy@[email protected]

#### Possible fixes ####

* igt@fbdev@unaligned-read:
- {shard-rkl}: [SKIP][5] ([i915#2582]) -> [PASS][6] +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-4/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-1/igt@[email protected]

* igt@gem_eio@in-flight-suspend:
- {shard-rkl}: [FAIL][7] ([fdo#103375]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-3/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@[email protected]

* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-glk: [FAIL][9] ([i915#2842]) -> [PASS][10] +1 similar issue
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-glk7/igt@gem_exec_fair@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-glk3/igt@gem_exec_fair@[email protected]

* igt@gem_exec_reloc@basic-wc-read-noreloc:
- {shard-rkl}: [SKIP][11] ([i915#3281]) -> [PASS][12] +7 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-2/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-5/igt@[email protected]

* igt@gem_partial_pwrite_pread@writes-after-reads-snoop:
- {shard-rkl}: [SKIP][13] ([i915#3282]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-1/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-5/igt@[email protected]

* igt@gen9_exec_parse@batch-invalid-length:
- {shard-rkl}: [SKIP][15] ([i915#2527]) -> [PASS][16] +3 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-3/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-5/igt@[email protected]

* igt@i915_pipe_stress@stress-xrgb8888-ytiled:
- {shard-rkl}: [SKIP][17] ([i915#4098]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-4/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@[email protected]

* igt@i915_pm_rpm@dpms-lpsp:
- {shard-rkl}: [SKIP][19] ([i915#1397]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-1/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@[email protected]

* igt@i915_pm_rpm@i2c:
- {shard-tglu}: [SKIP][21] ([i915#3547]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-tglu-6/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-tglu-2/igt@[email protected]

* {igt@i915_power@sanity}:
- {shard-rkl}: [SKIP][23] ([i915#7984]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-1/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-5/igt@[email protected]

* igt@kms_async_flips@alternate-sync-async-flip@pipe-a-hdmi-a-1:
- shard-glk: [FAIL][25] ([i915#2521]) -> [PASS][26] +1 similar issue
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-glk3/igt@kms_async_flips@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-glk6/igt@kms_async_flips@[email protected]

* igt@kms_big_fb@y-tiled-addfb-size-overflow:
- {shard-rkl}: [SKIP][27] ([i915#1845] / [i915#4098]) -> [PASS][28] +13 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-3/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions:
- shard-glk: [FAIL][29] ([i915#2346]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-glk2/igt@kms_cursor_legacy@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-glk9/igt@kms_cursor_legacy@[email protected]

* igt@kms_dp_aux_dev:
- {shard-rkl}: [SKIP][31] ([i915#1257]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-4/igt@kms_dp_aux_dev.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@kms_dp_aux_dev.html

* igt@kms_fbcon_fbt@psr:
- {shard-rkl}: [SKIP][33] ([i915#3955]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-4/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-modesetfrombusy:
- {shard-rkl}: [SKIP][35] ([i915#1849] / [i915#4098]) -> [PASS][36] +10 similar issues
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-3/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@[email protected]

* igt@kms_plane@plane-position-covered@pipe-a-planes:
- {shard-tglu}: [SKIP][37] ([i915#1849] / [i915#3558]) -> [PASS][38] +1 similar issue
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-tglu-6/igt@kms_plane@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-tglu-8/igt@kms_plane@[email protected]

* igt@kms_plane@plane-position-hole-dpms@pipe-b-planes:
- {shard-rkl}: [SKIP][39] ([i915#1849]) -> [PASS][40] +1 similar issue
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-3/igt@kms_plane@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@kms_plane@[email protected]

* igt@kms_psr@primary_page_flip:
- {shard-rkl}: [SKIP][41] ([i915#1072]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-4/igt@kms_psr@primary_page_flip.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@kms_psr@primary_page_flip.html

* igt@kms_psr_stress_test@invalidate-primary-flip-overlay:
- {shard-rkl}: [SKIP][43] ([i915#5461]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-3/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@[email protected]

* igt@kms_rotation_crc@bad-tiling:
- {shard-tglu}: [SKIP][45] ([i915#7651]) -> [PASS][46] +1 similar issue
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-tglu-6/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-tglu-1/igt@[email protected]

* igt@kms_universal_plane@universal-plane-pipe-b-functional:
- {shard-rkl}: [SKIP][47] ([i915#1845] / [i915#4070] / [i915#4098]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-rkl-2/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-rkl-6/igt@[email protected]

* igt@sysfs_heartbeat_interval@precise@vcs0:
- {shard-dg1}: [FAIL][49] ([i915#1755]) -> [PASS][50] +1 similar issue
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12682/shard-dg1-12/igt@sysfs_heartbeat_interval@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/shard-dg1-13/igt@sysfs_heartbeat_interval@[email protected]

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

[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
[fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
[fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
[fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112054]: https://bugs.freedesktop.org/show_bug.cgi?id=112054
[fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1257]: https://gitlab.freedesktop.org/drm/intel/issues/1257
[i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1755]: https://gitlab.freedesktop.org/drm/intel/issues/1755
[i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
[i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2433]: https://gitlab.freedesktop.org/drm/intel/issues/2433
[i915#2434]: https://gitlab.freedesktop.org/drm/intel/issues/2434
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
[i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#3116]: https://gitlab.freedesktop.org/drm/intel/issues/3116
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
[i915#3536]: https://gitlab.freedesktop.org/drm/intel/issues/3536
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3547]: https://gitlab.freedesktop.org/drm/intel/issues/3547
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
[i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
[i915#3825]: https://gitlab.freedesktop.org/drm/intel/issues/3825
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3952]: https://gitlab.freedesktop.org/drm/intel/issues/3952
[i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281
[i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
[i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[i915#4565]: https://gitlab.freedesktop.org/drm/intel/issues/4565
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4767]: https://gitlab.freedesktop.org/drm/intel/issues/4767
[i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
[i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
[i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
[i915#4859]: https://gitlab.freedesktop.org/drm/intel/issues/4859
[i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
[i915#4877]: https://gitlab.freedesktop.org/drm/intel/issues/4877
[i915#4880]: https://gitlab.freedesktop.org/drm/intel/issues/4880
[i915#4881]: https://gitlab.freedesktop.org/drm/intel/issues/4881
[i915#4958]: https://gitlab.freedesktop.org/drm/intel/issues/4958
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
[i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
[i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6245]: https://gitlab.freedesktop.org/drm/intel/issues/6245
[i915#6247]: https://gitlab.freedesktop.org/drm/intel/issues/6247
[i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
[i915#6335]: https://gitlab.freedesktop.org/drm/intel/issues/6335
[i915#6344]: https://gitlab.freedesktop.org/drm/intel/issues/6344
[i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
[i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
[i915#6944]: https://gitlab.freedesktop.org/drm/intel/issues/6944
[i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
[i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
[i915#7128]: https://gitlab.freedesktop.org/drm/intel/issues/7128
[i915#7276]: https://gitlab.freedesktop.org/drm/intel/issues/7276
[i915#7294]: https://gitlab.freedesktop.org/drm/intel/issues/7294
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7582]: https://gitlab.freedesktop.org/drm/intel/issues/7582
[i915#7651]: https://gitlab.freedesktop.org/drm/intel/issues/7651
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7707]: https://gitlab.freedesktop.org/drm/intel/issues/7707
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7949]: https://gitlab.freedesktop.org/drm/intel/issues/7949
[i915#7984]: https://gitlab.freedesktop.org/drm/intel/issues/7984

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

* CI: CI-20190529 -> None
* IGT: IGT_7144 -> IGTPW_8435

CI-20190529: 20190529
CI_DRM_12682: b0ddd08fba5c065cdc402a3be6cc6eb3340a7996 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8435: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8435/index.html
IGT_7144: cda71bf809b981a646270963d6b1ccee4fd4643b @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

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

#3 lore raw
In reply to Karolina Stolarek
Quoted 32 lines · Karolina Stolarek

Blitter commands may have different properties depending on the platform. Add a new field to blt_tiling_info struct to describe properties of the commands. Update definitions of block-copy on DG2 and beyond to show the differences. Add helpers that check if a platform uses an extended version of the block-copy command or supports compression. Update gem_ccs test to use these functions.

---
 lib/i915/i915_blt.c          | 89 +++++++++++++++++++++++++++++-------
 lib/i915/i915_blt.h          | 10 +++-
 lib/i915/intel_tiling_info.c | 28 +++++++++---
 lib/i915/intel_tiling_info.h |  4 ++
 tests/i915/gem_ccs.c         |  7 ++-
 5 files changed, 111 insertions(+), 27 deletions(-)
lib/i915/i915_blt.c +0 -7
index bbfb6ffc..bda9ea5f 100644
@@ -191,23 +191,22 @@ struct gen12_block_copy_data_ext {
 	} dw21;
 };
 
-/**
- * blt_supports_compression:
- * @i915: drm fd
- *
- * Function checks if HW supports flatccs compression in blitter commands
- * on @i915 device.
- *

lib/i915/i915_blt.c struct gen12_block_copy_data_ext { · line 199

Quoted 10 lines
lib/i915/i915_blt.c +1 -4
- * Returns:
- * true if it does, false otherwise.
- */
-bool blt_supports_compression(int i915)
+static bool device_supports_compression(int i915)
 {
 	uint32_t devid = intel_get_drm_devid(i915);
 
 	return HAS_FLATCCS(devid);
 }

If you're introduce compression flag this function is superfluous.

lib/i915/i915_blt.c struct gen12_block_copy_data_ext { · line 207

Quoted 8 lines
lib/i915/i915_blt.c +7 -0
+static const struct blt_tiling_info *blt_get_tiling_info(const struct blt_cmd_info *info,
+							 enum blt_cmd_type cmd)
+{
+	if (!info)
+		return NULL;
+
+	return info->supported_cmds[cmd];

Prototype of the function and what it returns is very confusing.

I'm not sure is blt_tiling_info name picked luckily. Looking at above we should rename it and pick some other name, like blt_cmd_desc or sth.

lib/i915/i915_blt.c bool blt_supports_command(const struct blt_cmd_info *info, · line 224

Quoted 11 lines
lib/i915/i915_blt.c +3 -1
+}
+
 /**
  * blt_supports_command:
  * @info: Blitter command info struct
@@ -222,7 +221,7 @@ bool blt_supports_command(const struct blt_cmd_info *info,
 {
 	igt_require_f(info, "No config found for the platform\n");
 
-	return info->supported_cmds[cmd];
+	return blt_get_tiling_info(info, cmd);

Same here.

Quoted 28 lines
lib/i915/i915_blt.c +10 -4
 }
 
 /**
@@ -242,10 +241,7 @@ bool blt_cmd_supports_tiling(const struct blt_cmd_info *info,
 {
 	struct blt_tiling_info const *tile_config;
 
-	if (!info)
-		return false;
-
-	tile_config = info->supported_cmds[cmd];
+	tile_config = blt_get_tiling_info(info, cmd);
 
 	/* no config means no support for that tiling */
 	if (!tile_config)
@@ -254,6 +250,32 @@ bool blt_cmd_supports_tiling(const struct blt_cmd_info *info,
 	return tile_config->supported_tiling & BIT(tiling);
 }
 
+/**
+ * blt_cmd_has_property:
+ * @info: Blitter command info struct
+ * @cmd: Blitter command enum
+ * @flag: property flag
+ *
+ * Checks if a @cmd entry of @info has @flag property. The properties can be
+ * freely combined, but the function will return true for platforms for which
+ * all properties defined in the bit flag are present. The function returns

lib/i915/i915_blt.c bool blt_cmd_supports_tiling(const struct blt_cmd_info *info, · line 271

Quoted 10 lines
lib/i915/i915_blt.c +10 -0
+ * false if no information about the command is stored.
+ *
+ * Returns: true if it does, false otherwise
+ */
+bool blt_cmd_has_property(const struct blt_cmd_info *info,
+			  enum blt_cmd_type cmd, uint32_t flag)
+{
+	struct blt_tiling_info const *tile_config;
+
+	tile_config = blt_get_tiling_info(info, cmd);
	cmd_desc = blt_get_cmd_desc(info, cmd);

	?
Quoted 20 lines
lib/i915/i915_blt.c +13 -0
+
+	if (!tile_config)
+		return false;
+
+	return tile_config->flags & flag;
+}
+
 /**
  * blt_has_block_copy
  * @i915: drm fd
@@ -320,6 +342,41 @@ bool blt_block_copy_supports_tiling(int i915, enum blt_tiling_type tiling)
 	return blt_cmd_supports_tiling(blt_info, XY_BLOCK_COPY, tiling);
 }
 
+/**
+ * blt_block_copy_supports_compression
+ * @i915: drm fd
+ *
+ * Check if block copy provided by @i915 device supports compression.
+ *

lib/i915/i915_blt.c bool blt_block_copy_supports_tiling(int i915, enum blt_tiling_type tiling) · line 360

Quoted 10 lines
lib/i915/i915_blt.c +10 -0
+ * Returns:
+ * true if it does, false otherwise.
+ */
+bool blt_block_copy_supports_compression(int i915)
+{
+	const struct blt_cmd_info *blt_info = GET_BLT_INFO(i915);
+
+	return device_supports_compression(i915) &&
+	       blt_cmd_has_property(blt_info, XY_BLOCK_COPY,
+				    BLT_CMD_SUPPORTS_COMPRESSION);

Imo checking flag is enough.

Quoted 72 lines
lib/i915/i915_blt.c +19 -0
+}
+
+/**
+ * blt_uses_extended_block_copy
+ * @i915: drm fd
+ *
+ * Check if block copy provided by @i915 device uses an extended version
+ * of the command.
+ *
+ * Returns:
+ * true if it does, false otherwise.
+ */
+bool blt_uses_extended_block_copy(int i915)
+{
+	const struct blt_cmd_info *blt_info = GET_BLT_INFO(i915);
+
+	return blt_cmd_has_property(blt_info, XY_BLOCK_COPY, BLT_CMD_EXTENDED);
+}
+
 /**
  * blt_tiling_name:
  * @tiling: tiling id
lib/i915/i915_blt.h +9 -1
index 299dff8e..14885db3 100644
@@ -157,16 +157,24 @@ struct blt_ctrl_surf_copy_data {
 	bool print_bb;
 };
 
-bool blt_supports_compression(int i915);
 bool blt_supports_command(const struct blt_cmd_info *info,
 			  enum blt_cmd_type cmd);
 bool blt_cmd_supports_tiling(const struct blt_cmd_info *info,
 			     enum blt_cmd_type cmd,
 			     enum blt_tiling_type tiling);
+bool blt_cmd_has_property(const struct blt_cmd_info *info,
+			  enum blt_cmd_type cmd,
+			  uint32_t flag);
+
 bool blt_has_block_copy(int i915);
 bool blt_has_fast_copy(int i915);
+
 bool blt_fast_copy_supports_tiling(int i915, enum blt_tiling_type tiling);
 bool blt_block_copy_supports_tiling(int i915, enum blt_tiling_type tiling);
+
+bool blt_block_copy_supports_compression(int i915);
+bool blt_uses_extended_block_copy(int i915);
+
 const char *blt_tiling_name(enum blt_tiling_type tiling);
 
 uint64_t emit_blt_block_copy(int i915,
lib/i915/intel_tiling_info.c +6 -0
index fc388919..1dcf17c2 100644
@@ -12,6 +12,12 @@
 		.supported_tiling = _tiling \
 	}
 
+#define BLT_INFO_EXT(_cmd, _tiling, _flags) { \
+		.blt_cmd_type = _cmd, \
+		.supported_tiling = _tiling, \
+		.flags = _flags \
+	}
+
 static const struct blt_tiling_info src_copy = BLT_INFO(SRC_COPY, BIT(T_LINEAR));
 static const struct blt_tiling_info
 		pre_gen8_xy_src_copy = BLT_INFO(XY_SRC_COPY,
@@ -44,12 +50,22 @@ static const struct blt_tiling_info
 		gen12_xy_block_copy = BLT_INFO(XY_BLOCK_COPY,
 					       BIT(T_LINEAR) |

lib/i915/intel_tiling_info.c static const struct blt_tiling_info · line 61

Quoted 10 lines
lib/i915/intel_tiling_info.c +9 -0
 					       BIT(T_YMAJOR));
+
+#define DG2_SUPPORTED_TILING \
+	(BIT(T_LINEAR) | \
+	 BIT(T_XMAJOR) | \
+	 BIT(T_TILE4)  | \
+	 BIT(T_TILE64))
+
+#define DG2_BLOCK_COPY_INFO(_flags) \
+	BLT_INFO_EXT(XY_BLOCK_COPY, DG2_SUPPORTED_TILING, (_flags))

Don't introduce above two macros, just use this directly below. It will be more consistent.

lib/i915/intel_tiling_info.c static const struct blt_tiling_info · line 66

Quoted 5 lines
lib/i915/intel_tiling_info.c +5 -0
+
+static const struct blt_tiling_info
+		dg2_xy_block_copy = DG2_BLOCK_COPY_INFO(BLT_CMD_EXTENDED |
+							BLT_CMD_SUPPORTS_COMPRESSION);
+

... dg2_xy_block_copy = BLT_CMD_DESC_EXT(XY_BLOCK_COPY,

					 BIT(T_LINEAR) | ...,
					 BLT_CMD_EXTENDED |
					 BLT_CMD_SUPPORT_COMPRESSION);

lib/i915/intel_tiling_info.c static const struct blt_tiling_info · line 52

Quoted 6 lines
lib/i915/intel_tiling_info.c +0 -5
 static const struct blt_tiling_info
-		dg2_xy_block_copy = BLT_INFO(XY_BLOCK_COPY,
-					     BIT(T_LINEAR) |
-					     BIT(T_XMAJOR) |
-					     BIT(T_TILE4)  |
-					     BIT(T_TILE64));

This looks better imo.,

Quoted 17 lines
lib/i915/intel_tiling_info.c +2 -1
+		mtl_xy_block_copy = DG2_BLOCK_COPY_INFO(BLT_CMD_EXTENDED);
 
 const struct blt_cmd_info pre_gen8_blt_info = {
 	.supported_cmds = {
@@ -90,6 +106,6 @@ const struct blt_cmd_info gen12_dg2_blt_info = {
 const struct blt_cmd_info gen12_mtl_blt_info = {
 	.supported_cmds = {
 		[XY_FAST_COPY] = &dg2_xy_fast_copy,
-		[XY_BLOCK_COPY] = &dg2_xy_block_copy
+		[XY_BLOCK_COPY] = &mtl_xy_block_copy
 	}
 };
lib/i915/intel_tiling_info.h +0 -0
index bb655103..a6288f49 100644

lib/i915/intel_tiling_info.h enum blt_cmd_type { · line 35

Quoted 7 lines
lib/i915/intel_tiling_info.h +4 -0
@@ -29,6 +29,10 @@ enum blt_cmd_type {
 struct blt_tiling_info {
 	enum blt_cmd_type blt_cmd_type;
 	uint32_t supported_tiling;
+
+	uint32_t flags;
+#define BLT_CMD_EXTENDED		(1 << 0)
+#define BLT_CMD_SUPPORTS_COMPRESSION	(1 << 1)

Consider rename to blt_cmd_desc, keeping tiling and flags here started to be confusing with blt_tiling_info.

Quoted 16 lines
lib/i915/intel_tiling_info.h +0 -0
 };
 
 struct blt_cmd_info {
tests/i915/gem_ccs.c +0 -1
index a24c8e1f..b7e8bda7 100644
@@ -346,7 +346,6 @@ static void block_copy(int i915,
 	uint32_t run_id = mid_tiling;
 	uint32_t mid_region = region2, bb;
 	uint32_t width = param.width, height = param.height;
-	uint32_t devid = intel_get_drm_devid(i915);
 	enum blt_compression mid_compression = config->compression;
 	int mid_compression_format = param.compression_format;
 	enum blt_compression_type comp_type = COMPRESSION_TYPE_3D;

tests/i915/gem_ccs.c static void block_copy(int i915, · line 358

Quoted 6 lines
tests/i915/gem_ccs.c +1 -1
@@ -355,7 +354,7 @@ static void block_copy(int i915,
 
 	igt_assert(__gem_create_in_memory_regions(i915, &bb, &bb_size, region1) == 0);
 
-	if (!blt_supports_compression(i915) && !IS_METEORLAKE(devid))
+	if (!blt_uses_extended_block_copy(i915))
 		pext = NULL;

Direction is ok, but we need to clean up the names imo with this series. And split this because one patch contains few logically separated changes.

--
Zbigniew

Quoted 23 lines
tests/i915/gem_ccs.c +2 -2
 	src = blt_create_object(i915, region1, width, height, bpp, uc_mocs,
@@ -470,7 +469,7 @@ static void block_multicopy(int i915,
 
 	igt_assert(__gem_create_in_memory_regions(i915, &bb, &bb_size, region1) == 0);
 
-	if (!blt_supports_compression(i915))
+	if (!blt_uses_extended_block_copy(i915))
 		pext3 = NULL;
 
 	src = blt_create_object(i915, region1, width, height, bpp, uc_mocs,
@@ -557,7 +556,7 @@ static void block_copy_test(int i915,
 	const struct intel_execution_engine2 *e;
 	int tiling;
 
-	if (config->compression && !blt_supports_compression(i915))
+	if (config->compression && !blt_block_copy_supports_compression(i915))
 		return;
 
 	if (config->inplace && !config->compression)
Signature · 1 line
2.25.1
#4 lore raw
Quoted 41 lines · Zbigniew Kempczyński
Quoted 40 lines · Karolina Stolarek

Blitter commands may have different properties depending on the platform. Add a new field to blt_tiling_info struct to describe properties of the commands. Update definitions of block-copy on DG2 and beyond to show the differences. Add helpers that check if a platform uses an extended version of the block-copy command or supports compression. Update gem_ccs test to use these functions.

---
  lib/i915/i915_blt.c          | 89 +++++++++++++++++++++++++++++-------
  lib/i915/i915_blt.h          | 10 +++-
  lib/i915/intel_tiling_info.c | 28 +++++++++---
  lib/i915/intel_tiling_info.h |  4 ++
  tests/i915/gem_ccs.c         |  7 ++-
  5 files changed, 111 insertions(+), 27 deletions(-)
lib/i915/i915_blt.c +1 -11
index bbfb6ffc..bda9ea5f 100644
@@ -191,23 +191,22 @@ struct gen12_block_copy_data_ext {
  	} dw21;
  };
 
-/**
- * blt_supports_compression:
- * @i915: drm fd
- *
- * Function checks if HW supports flatccs compression in blitter commands
- * on @i915 device.
- *
- * Returns:
- * true if it does, false otherwise.
- */
-bool blt_supports_compression(int i915)
+static bool device_supports_compression(int i915)
  {
  	uint32_t devid = intel_get_drm_devid(i915);
 
Quoted 4 lines

lib/i915/i915_blt.c struct gen12_block_copy_data_ext { · line 199

Quoted 2 lines
lib/i915/i915_blt.c +0 -0
  	return HAS_FLATCCS(devid);
  }

If you're introduce compression flag this function is superfluous.

We might be missing some information in the tiling library, and doing this check will help us in seeing the gaps.

Quoted 11 lines

lib/i915/i915_blt.c struct gen12_block_copy_data_ext { · line 207

Quoted 9 lines
lib/i915/i915_blt.c +7 -0
+static const struct blt_tiling_info *blt_get_tiling_info(const struct blt_cmd_info *info,
+							 enum blt_cmd_type cmd)
+{
+	if (!info)
+		return NULL;
+
+	return info->supported_cmds[cmd];

Prototype of the function and what it returns is very confusing.

I believe you meant the struct name. I just extracted a "getter" that I used in blt_supports_command and blt_cmd_supports tiling functions.

Quoted 3 lines

I'm not sure is blt_tiling_info name picked luckily. Looking at above we should rename it and pick some other name, like blt_cmd_desc or sth.

It stick during the review and I thought you accepted it as it is. blt_cmd_desc is not informative enough, but I'll have a think about the name.

Quoted 184 lines

lib/i915/i915_blt.c bool blt_supports_command(const struct blt_cmd_info *info, · line 224

Quoted 12 lines
lib/i915/i915_blt.c +3 -1
+}
+
  /**
   * blt_supports_command:
   * @info: Blitter command info struct
@@ -222,7 +221,7 @@ bool blt_supports_command(const struct blt_cmd_info *info,
  {
  	igt_require_f(info, "No config found for the platform\n");
 
-	return info->supported_cmds[cmd];
+	return blt_get_tiling_info(info, cmd);

Same here.

Quoted 28 lines
lib/i915/i915_blt.c +10 -4
  }
 
  /**
@@ -242,10 +241,7 @@ bool blt_cmd_supports_tiling(const struct blt_cmd_info *info,
  {
  	struct blt_tiling_info const *tile_config;
 
-	if (!info)
-		return false;
-
-	tile_config = info->supported_cmds[cmd];
+	tile_config = blt_get_tiling_info(info, cmd);
 
  	/* no config means no support for that tiling */
  	if (!tile_config)
@@ -254,6 +250,32 @@ bool blt_cmd_supports_tiling(const struct blt_cmd_info *info,
  	return tile_config->supported_tiling & BIT(tiling);
  }
 
+/**
+ * blt_cmd_has_property:
+ * @info: Blitter command info struct
+ * @cmd: Blitter command enum
+ * @flag: property flag
+ *
+ * Checks if a @cmd entry of @info has @flag property. The properties can be
+ * freely combined, but the function will return true for platforms for which
+ * all properties defined in the bit flag are present. The function returns

lib/i915/i915_blt.c bool blt_cmd_supports_tiling(const struct blt_cmd_info *info, · line 271

Quoted 10 lines
lib/i915/i915_blt.c +10 -0
+ * false if no information about the command is stored.
+ *
+ * Returns: true if it does, false otherwise
+ */
+bool blt_cmd_has_property(const struct blt_cmd_info *info,
+			  enum blt_cmd_type cmd, uint32_t flag)
+{
+	struct blt_tiling_info const *tile_config;
+
+	tile_config = blt_get_tiling_info(info, cmd);
	cmd_desc = blt_get_cmd_desc(info, cmd);

	?
Quoted 20 lines
lib/i915/i915_blt.c +13 -0
+
+	if (!tile_config)
+		return false;
+
+	return tile_config->flags & flag;
+}
+
  /**
   * blt_has_block_copy
   * @i915: drm fd
@@ -320,6 +342,41 @@ bool blt_block_copy_supports_tiling(int i915, enum blt_tiling_type tiling)
  	return blt_cmd_supports_tiling(blt_info, XY_BLOCK_COPY, tiling);
  }
 
+/**
+ * blt_block_copy_supports_compression
+ * @i915: drm fd
+ *
+ * Check if block copy provided by @i915 device supports compression.
+ *

lib/i915/i915_blt.c bool blt_block_copy_supports_tiling(int i915, enum blt_tiling_type tiling) · line 360

Quoted 10 lines
lib/i915/i915_blt.c +10 -0
+ * Returns:
+ * true if it does, false otherwise.
+ */
+bool blt_block_copy_supports_compression(int i915)
+{
+	const struct blt_cmd_info *blt_info = GET_BLT_INFO(i915);
+
+	return device_supports_compression(i915) &&
+	       blt_cmd_has_property(blt_info, XY_BLOCK_COPY,
+				    BLT_CMD_SUPPORTS_COMPRESSION);

Imo checking flag is enough.

Quoted 72 lines
lib/i915/i915_blt.c +19 -0
+}
+
+/**
+ * blt_uses_extended_block_copy
+ * @i915: drm fd
+ *
+ * Check if block copy provided by @i915 device uses an extended version
+ * of the command.
+ *
+ * Returns:
+ * true if it does, false otherwise.
+ */
+bool blt_uses_extended_block_copy(int i915)
+{
+	const struct blt_cmd_info *blt_info = GET_BLT_INFO(i915);
+
+	return blt_cmd_has_property(blt_info, XY_BLOCK_COPY, BLT_CMD_EXTENDED);
+}
+
  /**
   * blt_tiling_name:
   * @tiling: tiling id
lib/i915/i915_blt.h +9 -1
index 299dff8e..14885db3 100644
@@ -157,16 +157,24 @@ struct blt_ctrl_surf_copy_data {
  	bool print_bb;
  };
 
-bool blt_supports_compression(int i915);
  bool blt_supports_command(const struct blt_cmd_info *info,
  			  enum blt_cmd_type cmd);
  bool blt_cmd_supports_tiling(const struct blt_cmd_info *info,
  			     enum blt_cmd_type cmd,
  			     enum blt_tiling_type tiling);
+bool blt_cmd_has_property(const struct blt_cmd_info *info,
+			  enum blt_cmd_type cmd,
+			  uint32_t flag);
+
  bool blt_has_block_copy(int i915);
  bool blt_has_fast_copy(int i915);
+
  bool blt_fast_copy_supports_tiling(int i915, enum blt_tiling_type tiling);
  bool blt_block_copy_supports_tiling(int i915, enum blt_tiling_type tiling);
+
+bool blt_block_copy_supports_compression(int i915);
+bool blt_uses_extended_block_copy(int i915);
+
  const char *blt_tiling_name(enum blt_tiling_type tiling);
 
  uint64_t emit_blt_block_copy(int i915,
lib/i915/intel_tiling_info.c +6 -0
index fc388919..1dcf17c2 100644
@@ -12,6 +12,12 @@
  		.supported_tiling = _tiling \
  	}
 
+#define BLT_INFO_EXT(_cmd, _tiling, _flags) { \
+		.blt_cmd_type = _cmd, \
+		.supported_tiling = _tiling, \
+		.flags = _flags \
+	}
+
  static const struct blt_tiling_info src_copy = BLT_INFO(SRC_COPY, BIT(T_LINEAR));
  static const struct blt_tiling_info
  		pre_gen8_xy_src_copy = BLT_INFO(XY_SRC_COPY,
@@ -44,12 +50,22 @@ static const struct blt_tiling_info
  		gen12_xy_block_copy = BLT_INFO(XY_BLOCK_COPY,
  					       BIT(T_LINEAR) |

lib/i915/intel_tiling_info.c static const struct blt_tiling_info · line 61

Quoted 10 lines
lib/i915/intel_tiling_info.c +9 -0
  					       BIT(T_YMAJOR));
+
+#define DG2_SUPPORTED_TILING \
+	(BIT(T_LINEAR) | \
+	 BIT(T_XMAJOR) | \
+	 BIT(T_TILE4)  | \
+	 BIT(T_TILE64))
+
+#define DG2_BLOCK_COPY_INFO(_flags) \
+	BLT_INFO_EXT(XY_BLOCK_COPY, DG2_SUPPORTED_TILING, (_flags))

Don't introduce above two macros, just use this directly below. It will be more consistent.

lib/i915/intel_tiling_info.c static const struct blt_tiling_info · line 66

Quoted 5 lines
lib/i915/intel_tiling_info.c +5 -0
+
+static const struct blt_tiling_info
+		dg2_xy_block_copy = DG2_BLOCK_COPY_INFO(BLT_CMD_EXTENDED |
+							BLT_CMD_SUPPORTS_COMPRESSION);
+

... dg2_xy_block_copy = BLT_CMD_DESC_EXT(XY_BLOCK_COPY,

Quoted 3 lines
					 BIT(T_LINEAR) | ...,
					 BLT_CMD_EXTENDED |
					 BLT_CMD_SUPPORT_COMPRESSION);

I'd at least macro the tilings to avoid repetition.

Quoted 29 lines

lib/i915/intel_tiling_info.c static const struct blt_tiling_info · line 52

Quoted 7 lines
lib/i915/intel_tiling_info.c +0 -5
  static const struct blt_tiling_info
-		dg2_xy_block_copy = BLT_INFO(XY_BLOCK_COPY,
-					     BIT(T_LINEAR) |
-					     BIT(T_XMAJOR) |
-					     BIT(T_TILE4)  |
-					     BIT(T_TILE64));

This looks better imo.,

Quoted 19 lines
lib/i915/intel_tiling_info.c +2 -1
+		mtl_xy_block_copy = DG2_BLOCK_COPY_INFO(BLT_CMD_EXTENDED);
 
  const struct blt_cmd_info pre_gen8_blt_info = {
  	.supported_cmds = {
@@ -90,6 +106,6 @@ const struct blt_cmd_info gen12_dg2_blt_info = {
  const struct blt_cmd_info gen12_mtl_blt_info = {
  	.supported_cmds = {
  		[XY_FAST_COPY] = &dg2_xy_fast_copy,
-		[XY_BLOCK_COPY] = &dg2_xy_block_copy
+		[XY_BLOCK_COPY] = &mtl_xy_block_copy
  	}
  };
lib/i915/intel_tiling_info.h +0 -0
index bb655103..a6288f49 100644
@@ -29,6 +29,10 @@ enum blt_cmd_type {
  struct blt_tiling_info {
  	enum blt_cmd_type blt_cmd_type;
Quoted 8 lines

lib/i915/intel_tiling_info.h enum blt_cmd_type { · line 35

Quoted 5 lines
lib/i915/intel_tiling_info.h +4 -0
  	uint32_t supported_tiling;
+
+	uint32_t flags;
+#define BLT_CMD_EXTENDED		(1 << 0)
+#define BLT_CMD_SUPPORTS_COMPRESSION	(1 << 1)

Consider rename to blt_cmd_desc, keeping tiling and flags here started to be confusing with blt_tiling_info.

Then what would be the name for the main struct?

Quoted 20 lines
Quoted 20 lines
lib/i915/intel_tiling_info.h +0 -0
  };
 
  struct blt_cmd_info {
tests/i915/gem_ccs.c +0 -1
index a24c8e1f..b7e8bda7 100644
@@ -346,7 +346,6 @@ static void block_copy(int i915,
  	uint32_t run_id = mid_tiling;
  	uint32_t mid_region = region2, bb;
  	uint32_t width = param.width, height = param.height;
-	uint32_t devid = intel_get_drm_devid(i915);
  	enum blt_compression mid_compression = config->compression;
  	int mid_compression_format = param.compression_format;
  	enum blt_compression_type comp_type = COMPRESSION_TYPE_3D;
@@ -355,7 +354,7 @@ static void block_copy(int i915,
 
  	igt_assert(__gem_create_in_memory_regions(i915, &bb, &bb_size, region1) == 0);
 
Quoted 7 lines

tests/i915/gem_ccs.c static void block_copy(int i915, · line 358

Quoted 3 lines
tests/i915/gem_ccs.c +1 -1
-	if (!blt_supports_compression(i915) && !IS_METEORLAKE(devid))
+	if (!blt_uses_extended_block_copy(i915))
  		pext = NULL;

Direction is ok, but we need to clean up the names imo with this series. And split this because one patch contains few logically separated changes.

That would require keeping blt_supports_compression() function for a bit to split this up. Are you ok with that approach?

Thanks,
Karolina

Quoted 28 lines

--
Zbigniew

Quoted 23 lines
tests/i915/gem_ccs.c +2 -2
  	src = blt_create_object(i915, region1, width, height, bpp, uc_mocs,
@@ -470,7 +469,7 @@ static void block_multicopy(int i915,
 
  	igt_assert(__gem_create_in_memory_regions(i915, &bb, &bb_size, region1) == 0);
 
-	if (!blt_supports_compression(i915))
+	if (!blt_uses_extended_block_copy(i915))
  		pext3 = NULL;
 
  	src = blt_create_object(i915, region1, width, height, bpp, uc_mocs,
@@ -557,7 +556,7 @@ static void block_copy_test(int i915,
  	const struct intel_execution_engine2 *e;
  	int tiling;
 
-	if (config->compression && !blt_supports_compression(i915))
+	if (config->compression && !blt_block_copy_supports_compression(i915))
  		return;
 
  	if (config->inplace && !config->compression)
Signature · 1 line
2.25.1