[PATCH v2 01/10] drm/xe: Add command MI_LOAD_REGISTER_MEM
Matt Roper
matthew.d.roper at intel.com
Fri Dec 15 22:34:22 UTC 2023
On Thu, Dec 14, 2023 at 07:59:46PM +0100, Michal Wajdeczko wrote:
> We will need this shortly during context state preparation.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Matt Roper <matthew.d.roper at intel.com>
Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
> ---
> v2: update dump_mi_command (Matt)
> ---
> drivers/gpu/drm/xe/instructions/xe_mi_commands.h | 3 +++
> drivers/gpu/drm/xe/xe_lrc.c | 14 ++++++++++++++
> 2 files changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/instructions/xe_mi_commands.h b/drivers/gpu/drm/xe/instructions/xe_mi_commands.h
> index 1cfa96167fde..c74ceb550dce 100644
> --- a/drivers/gpu/drm/xe/instructions/xe_mi_commands.h
> +++ b/drivers/gpu/drm/xe/instructions/xe_mi_commands.h
> @@ -56,6 +56,9 @@
> #define MI_FLUSH_IMM_QW REG_FIELD_PREP(MI_FLUSH_DW_LEN_DW, 5 - 2)
> #define MI_FLUSH_DW_USE_GTT REG_BIT(2)
>
> +#define MI_LOAD_REGISTER_MEM (__MI_INSTR(0x29) | XE_INSTR_NUM_DW(4))
> +#define MI_LRM_USE_GGTT REG_BIT(22)
> +
> #define MI_BATCH_BUFFER_START __MI_INSTR(0x31)
>
> #endif
> diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
> index d6dfbd0bdc70..c8e242d8fb09 100644
> --- a/drivers/gpu/drm/xe/xe_lrc.c
> +++ b/drivers/gpu/drm/xe/xe_lrc.c
> @@ -966,6 +966,20 @@ static int dump_mi_command(struct drm_printer *p,
> drm_printf(p, " - %#6x = %#010x\n", dw[i], dw[i + 1]);
> return numdw;
>
> + case MI_LOAD_REGISTER_MEM & MI_OPCODE:
> + drm_printf(p, "[%#010x] MI_LOAD_REGISTER_MEM: %s%s\n",
> + inst_header,
> + dw[0] & MI_LRI_LRM_CS_MMIO ? "CS_MMIO " : "",
> + dw[0] & MI_LRM_USE_GGTT ? "USE_GGTT " : "");
> + if (numdw == 4)
> + drm_printf(p, " - %#6x = %#010llx\n",
> + dw[1], ((u64)(dw[3]) << 32 | (u64)(dw[2])));
> + else
> + drm_printf(p, " - %*ph (%s)\n",
> + (int)sizeof(u32) * (numdw - 1), dw + 1,
> + numdw < 4 ? "truncated" : "malformed");
> + return numdw;
> +
> case MI_FORCE_WAKEUP:
> drm_printf(p, "[%#010x] MI_FORCE_WAKEUP\n", inst_header);
> return numdw;
> --
> 2.25.1
>
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
More information about the Intel-xe
mailing list