[igt-dev] [PATCH i-g-t v3 7/9] lib/intel_cmds_info: Add flags field to describe command properties
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Fri Feb 10 09:25:14 UTC 2023
On Thu, Feb 09, 2023 at 03:12:10PM +0100, Karolina Stolarek wrote:
> Blitter commands may have different properties depending on the
> platform. Add a new field to blt_cmd_info struct to describe
> their properties. Update block-copy definitions for DG2 and MTL
> to use that field.
>
> Signed-off-by: Karolina Stolarek <karolina.stolarek at intel.com>
> ---
> lib/i915/intel_cmds_info.c | 28 ++++++++++++++++++++++------
> lib/i915/intel_cmds_info.h | 4 ++++
> 2 files changed, 26 insertions(+), 6 deletions(-)
>
> diff --git a/lib/i915/intel_cmds_info.c b/lib/i915/intel_cmds_info.c
> index 9fce0351..59ee0403 100644
> --- a/lib/i915/intel_cmds_info.c
> +++ b/lib/i915/intel_cmds_info.c
> @@ -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_cmd_info src_copy = BLT_INFO(SRC_COPY, BIT(T_LINEAR));
> static const struct blt_cmd_info
> pre_gen8_xy_src_copy = BLT_INFO(XY_SRC_COPY,
> @@ -45,11 +51,21 @@ static const struct blt_cmd_info
> BIT(T_LINEAR) |
> BIT(T_YMAJOR));
> static const struct blt_cmd_info
> - dg2_xy_block_copy = BLT_INFO(XY_BLOCK_COPY,
> - BIT(T_LINEAR) |
> - BIT(T_XMAJOR) |
> - BIT(T_TILE4) |
> - BIT(T_TILE64));
> + dg2_xy_block_copy = BLT_INFO_EXT(XY_BLOCK_COPY,
> + BIT(T_LINEAR) |
> + BIT(T_XMAJOR) |
> + BIT(T_TILE4) |
> + BIT(T_TILE64),
> + BLT_CMD_EXTENDED |
> + BLT_CMD_SUPPORTS_COMPRESSION);
> +
> +static const struct blt_cmd_info
> + mtl_xy_block_copy = BLT_INFO_EXT(XY_BLOCK_COPY,
> + BIT(T_LINEAR) |
> + BIT(T_XMAJOR) |
> + BIT(T_TILE4) |
> + BIT(T_TILE64),
> + BLT_CMD_EXTENDED);
>
> const struct intel_cmds_info pre_gen8_cmds_info = {
> .blt_cmds = {
> @@ -90,6 +106,6 @@ const struct intel_cmds_info gen12_dg2_cmds_info = {
> const struct intel_cmds_info gen12_mtl_cmds_info = {
> .blt_cmds = {
> [XY_FAST_COPY] = &dg2_xy_fast_copy,
> - [XY_BLOCK_COPY] = &dg2_xy_block_copy
> + [XY_BLOCK_COPY] = &mtl_xy_block_copy,
> }
> };
> diff --git a/lib/i915/intel_cmds_info.h b/lib/i915/intel_cmds_info.h
> index 4fdce343..541727ec 100644
> --- a/lib/i915/intel_cmds_info.h
> +++ b/lib/i915/intel_cmds_info.h
> @@ -29,6 +29,10 @@ enum blt_cmd_type {
> struct blt_cmd_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)
> };
Great! Finally we can extract this information from blitter library
instead of checking manually platform version.
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
--
Zbigniew
>
> struct intel_cmds_info {
> --
> 2.25.1
>
More information about the igt-dev
mailing list