[PATCH v6 16/26] drm/xe/pat: Add helper for compression mode of pat index
Matthew Brost
matthew.brost at intel.com
Fri Aug 8 05:47:28 UTC 2025
On Thu, Aug 07, 2025 at 10:13:28PM +0530, Himal Prasad Ghimiray wrote:
> From: Matthew Brost <matthew.brost at intel.com>
>
> Add `xe_pat_index_get_comp_mode()` to extract compression mode from a
> PAT index.
>
I'ed say just leave this one out, the initial patch [1] to disable this at
the bind IOCTL is still under review and we haven't landed on COH mode
issues or if we just nack the IOCTL for invalidate pat_index quite yet.
We have ~5 weeks until the 6.17 PR and close a on solution, so I'd say
let's get this series in with the same functional as bind IOCTLs for
now.
Matt
[1] https://patchwork.freedesktop.org/series/152547/
> Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
> ---
> drivers/gpu/drm/xe/xe_pat.c | 10 ++++++++++
> drivers/gpu/drm/xe/xe_pat.h | 10 ++++++++++
> 2 files changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
> index 2e7cb99ae87a..ac1767c812aa 100644
> --- a/drivers/gpu/drm/xe/xe_pat.c
> +++ b/drivers/gpu/drm/xe/xe_pat.c
> @@ -154,6 +154,16 @@ static const struct xe_pat_table_entry xe2_pat_table[] = {
> static const struct xe_pat_table_entry xe2_pat_ats = XE2_PAT( 0, 0, 0, 0, 3, 3 );
> static const struct xe_pat_table_entry xe2_pat_pta = XE2_PAT( 0, 0, 0, 0, 3, 0 );
>
> +bool xe_pat_index_get_comp_mode(struct xe_device *xe, u16 pat_index)
> +{
> + WARN_ON(pat_index >= xe->pat.n_entries);
> +
> + if (xe->pat.table != xe2_pat_table)
> + return false;
> +
> + return xe->pat.table[pat_index].value & XE2_COMP_EN;
> +}
> +
> u16 xe_pat_index_get_coh_mode(struct xe_device *xe, u16 pat_index)
> {
> WARN_ON(pat_index >= xe->pat.n_entries);
> diff --git a/drivers/gpu/drm/xe/xe_pat.h b/drivers/gpu/drm/xe/xe_pat.h
> index fa0dfbe525cd..8be2856a73af 100644
> --- a/drivers/gpu/drm/xe/xe_pat.h
> +++ b/drivers/gpu/drm/xe/xe_pat.h
> @@ -58,4 +58,14 @@ void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p);
> */
> u16 xe_pat_index_get_coh_mode(struct xe_device *xe, u16 pat_index);
>
> +/**
> + * xe_pat_index_get_comp_mode() = Extract the compression mode for the given
> + * pat_index.
> + * @xe: xe device
> + * @pat_index: The pat_index to query
> + *
> + * Return: True if pat_index is compressed, False otherwise
> + */
> +bool xe_pat_index_get_comp_mode(struct xe_device *xe, u16 pat_index);
> +
> #endif
> --
> 2.34.1
>
More information about the Intel-xe
mailing list