diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2023-06-23 10:46:35 +0200 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2023-06-26 08:08:06 +0200 |
commit | feb4fdbcce1e53cb1d483aad3d5ec4ff41092359 (patch) | |
tree | 78f30f2c88996c17ecdaa44e913b93f62cce373a /lib/intel_cmds_info.c | |
parent | 621c2d3115d40a1ba0b53668413ea21edf03a5ff (diff) |
lib/intel_blt: Prepare blt library to support xe
Migrate i915/i915_blt -> intel_blt as a preparation step before
extending to support xe. It is a simple move of files and rename
of i915 -> fd field.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Karolina Stolarek <karolina.stolarek@intel.com>
Diffstat (limited to 'lib/intel_cmds_info.c')
-rw-r--r-- | lib/intel_cmds_info.c | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/lib/intel_cmds_info.c b/lib/intel_cmds_info.c new file mode 100644 index 000000000..151cb5f72 --- /dev/null +++ b/lib/intel_cmds_info.c @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: MIT +/* + * Copyright © 2023 Intel Corporation + */ + +#include <stdint.h> +#include <stddef.h> + +#include "intel_chipset.h" +#include "intel_cmds_info.h" + +#define BLT_INFO(_cmd, _tiling) { \ + .blt_cmd_type = _cmd, \ + .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_gen6_xy_src_copy = BLT_INFO(XY_SRC_COPY, + BIT(T_LINEAR) | + BIT(T_XMAJOR)); +static const struct blt_cmd_info + gen6_xy_src_copy = BLT_INFO(XY_SRC_COPY, + BIT(T_LINEAR) | + BIT(T_XMAJOR) | + BIT(T_YMAJOR)); +static const struct blt_cmd_info + gen11_xy_fast_copy = BLT_INFO(XY_FAST_COPY, + BIT(T_LINEAR) | + BIT(T_YMAJOR) | + BIT(T_YFMAJOR) | + BIT(T_TILE64)); +static const struct blt_cmd_info + gen12_xy_fast_copy = BLT_INFO(XY_FAST_COPY, + BIT(T_LINEAR) | + BIT(T_YMAJOR) | + BIT(T_TILE4) | + BIT(T_TILE64)); +static const struct blt_cmd_info + dg2_xy_fast_copy = BLT_INFO(XY_FAST_COPY, + BIT(T_LINEAR) | + BIT(T_XMAJOR) | + BIT(T_TILE4) | + BIT(T_TILE64)); +static const struct blt_cmd_info + pvc_xy_fast_copy = BLT_INFO(XY_FAST_COPY, + BIT(T_LINEAR) | + BIT(T_TILE4) | + BIT(T_TILE64)); + +static const struct blt_cmd_info + gen12_xy_block_copy = BLT_INFO(XY_BLOCK_COPY, + BIT(T_LINEAR) | + BIT(T_YMAJOR)); +static const struct blt_cmd_info + 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); + +static const struct blt_cmd_info + pvc_xy_block_copy = BLT_INFO_EXT(XY_BLOCK_COPY, + BIT(T_LINEAR) | + BIT(T_TILE4) | + BIT(T_TILE64), + BLT_CMD_EXTENDED); + +const struct intel_cmds_info pre_gen6_cmds_info = { + .blt_cmds = { + [SRC_COPY] = &src_copy, + [XY_SRC_COPY] = &pre_gen6_xy_src_copy + } +}; + +const struct intel_cmds_info gen6_cmds_info = { + .blt_cmds = { + [SRC_COPY] = &src_copy, + [XY_SRC_COPY] = &gen6_xy_src_copy + } + +}; + +const struct intel_cmds_info gen8_cmds_info = { + .blt_cmds = { + [XY_SRC_COPY] = &gen6_xy_src_copy, + } +}; + +const struct intel_cmds_info gen11_cmds_info = { + .blt_cmds = { + [XY_SRC_COPY] = &gen6_xy_src_copy, + [XY_FAST_COPY] = &gen11_xy_fast_copy, + } +}; + +const struct intel_cmds_info gen12_cmds_info = { + .blt_cmds = { + [XY_SRC_COPY] = &gen6_xy_src_copy, + [XY_FAST_COPY] = &gen12_xy_fast_copy, + [XY_BLOCK_COPY] = &gen12_xy_block_copy, + } +}; + +const struct intel_cmds_info gen12_dg2_cmds_info = { + .blt_cmds = { + [XY_SRC_COPY] = &gen6_xy_src_copy, + [XY_FAST_COPY] = &dg2_xy_fast_copy, + [XY_BLOCK_COPY] = &dg2_xy_block_copy, + } +}; + +const struct intel_cmds_info gen12_mtl_cmds_info = { + .blt_cmds = { + [XY_FAST_COPY] = &dg2_xy_fast_copy, + [XY_BLOCK_COPY] = &mtl_xy_block_copy, + } +}; + +const struct intel_cmds_info gen12_pvc_cmds_info = { + .blt_cmds = { + [XY_FAST_COPY] = &pvc_xy_fast_copy, + [XY_BLOCK_COPY] = &pvc_xy_block_copy, + } +}; + +const struct blt_cmd_info *blt_get_cmd_info(const struct intel_cmds_info *cmds_info, + enum blt_cmd_type cmd) +{ + if (!cmds_info) + return NULL; + + return cmds_info->blt_cmds[cmd]; +} |