From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: Matthew Auld <matthew.auld@intel.com> Subject: [PATCH 1/4] drm/xe/pat: annotate pat index table with compression info Date: Tue, 30 Jan 2024 21:36:49 +0200 [thread overview] Message-ID: <20240130193652.374270-2-juhapekka.heikkila@gmail.com> (raw) In-Reply-To: <20240130193652.374270-1-juhapekka.heikkila@gmail.com> From: Matthew Auld <matthew.auld@intel.com> In a future patch we need to be able to determine if a given pat_index enables compression on xe2. Simplest is to annotate the PAT index table with this information. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> --- drivers/gpu/drm/xe/xe_pat.c | 9 ++++++++- drivers/gpu/drm/xe/xe_pat.h | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c index 1ff6bc79e7d4..c3cc6e90b068 100644 --- a/drivers/gpu/drm/xe/xe_pat.c +++ b/drivers/gpu/drm/xe/xe_pat.c @@ -104,7 +104,8 @@ static const struct xe_pat_table_entry xelpg_pat_table[] = { REG_FIELD_PREP(XE2_L3_POLICY, l3_policy) | \ REG_FIELD_PREP(XE2_L4_POLICY, l4_policy) | \ REG_FIELD_PREP(XE2_COH_MODE, __coh_mode), \ - .coh_mode = __coh_mode ? XE_COH_AT_LEAST_1WAY : XE_COH_NONE \ + .coh_mode = __coh_mode ? XE_COH_AT_LEAST_1WAY : XE_COH_NONE, \ + .compressed = comp_en \ } static const struct xe_pat_table_entry xe2_pat_table[] = { @@ -148,6 +149,12 @@ u16 xe_pat_index_get_coh_mode(struct xe_device *xe, u16 pat_index) return xe->pat.table[pat_index].coh_mode; } +bool xe_pat_index_has_compression(struct xe_device *xe, u16 pat_index) +{ + WARN_ON(pat_index >= xe->pat.n_entries); + return xe->pat.table[pat_index].compressed; +} + static void program_pat(struct xe_gt *gt, const struct xe_pat_table_entry table[], int n_entries) { diff --git a/drivers/gpu/drm/xe/xe_pat.h b/drivers/gpu/drm/xe/xe_pat.h index fa0dfbe525cd..8c0fc68e844f 100644 --- a/drivers/gpu/drm/xe/xe_pat.h +++ b/drivers/gpu/drm/xe/xe_pat.h @@ -29,6 +29,10 @@ struct xe_pat_table_entry { #define XE_COH_NONE 1 #define XE_COH_AT_LEAST_1WAY 2 u16 coh_mode; + /** + * @compressed: Whether compression is enabled or not with @value. + */ + bool compressed; }; /** @@ -58,4 +62,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_has_compression - Check if the given pat_index enables + * compression. + * @xe: xe device + * @pat_index: The pat_index to query + * + * Note: Only applicable to xe2+, where compression is part of the PAT index. + */ +bool xe_pat_index_has_compression(struct xe_device *xe, u16 pat_index); + #endif -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Subject: [PATCH 1/4] drm/xe/pat: annotate pat index table with compression info Date: Tue, 30 Jan 2024 21:36:49 +0200 [thread overview] Message-ID: <20240130193652.374270-2-juhapekka.heikkila@gmail.com> (raw) In-Reply-To: <20240130193652.374270-1-juhapekka.heikkila@gmail.com> From: Matthew Auld <matthew.auld@intel.com> In a future patch we need to be able to determine if a given pat_index enables compression on xe2. Simplest is to annotate the PAT index table with this information. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> --- drivers/gpu/drm/xe/xe_pat.c | 9 ++++++++- drivers/gpu/drm/xe/xe_pat.h | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c index 1ff6bc79e7d4..c3cc6e90b068 100644 --- a/drivers/gpu/drm/xe/xe_pat.c +++ b/drivers/gpu/drm/xe/xe_pat.c @@ -104,7 +104,8 @@ static const struct xe_pat_table_entry xelpg_pat_table[] = { REG_FIELD_PREP(XE2_L3_POLICY, l3_policy) | \ REG_FIELD_PREP(XE2_L4_POLICY, l4_policy) | \ REG_FIELD_PREP(XE2_COH_MODE, __coh_mode), \ - .coh_mode = __coh_mode ? XE_COH_AT_LEAST_1WAY : XE_COH_NONE \ + .coh_mode = __coh_mode ? XE_COH_AT_LEAST_1WAY : XE_COH_NONE, \ + .compressed = comp_en \ } static const struct xe_pat_table_entry xe2_pat_table[] = { @@ -148,6 +149,12 @@ u16 xe_pat_index_get_coh_mode(struct xe_device *xe, u16 pat_index) return xe->pat.table[pat_index].coh_mode; } +bool xe_pat_index_has_compression(struct xe_device *xe, u16 pat_index) +{ + WARN_ON(pat_index >= xe->pat.n_entries); + return xe->pat.table[pat_index].compressed; +} + static void program_pat(struct xe_gt *gt, const struct xe_pat_table_entry table[], int n_entries) { diff --git a/drivers/gpu/drm/xe/xe_pat.h b/drivers/gpu/drm/xe/xe_pat.h index fa0dfbe525cd..8c0fc68e844f 100644 --- a/drivers/gpu/drm/xe/xe_pat.h +++ b/drivers/gpu/drm/xe/xe_pat.h @@ -29,6 +29,10 @@ struct xe_pat_table_entry { #define XE_COH_NONE 1 #define XE_COH_AT_LEAST_1WAY 2 u16 coh_mode; + /** + * @compressed: Whether compression is enabled or not with @value. + */ + bool compressed; }; /** @@ -58,4 +62,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_has_compression - Check if the given pat_index enables + * compression. + * @xe: xe device + * @pat_index: The pat_index to query + * + * Note: Only applicable to xe2+, where compression is part of the PAT index. + */ +bool xe_pat_index_has_compression(struct xe_device *xe, u16 pat_index); + #endif -- 2.25.1
next prev parent reply other threads:[~2024-01-30 19:38 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-01-30 19:36 [PATCH 0/4] Enable ccs compressed framebuffers on Xe2 Juha-Pekka Heikkila 2024-01-30 19:36 ` Juha-Pekka Heikkila 2024-01-30 19:36 ` Juha-Pekka Heikkila [this message] 2024-01-30 19:36 ` [PATCH 1/4] drm/xe/pat: annotate pat index table with compression info Juha-Pekka Heikkila 2024-01-31 5:32 ` Ghimiray, Himal Prasad 2024-01-30 19:36 ` [PATCH 2/4] drm/xe: add bind time pat index to xe_bo structure Juha-Pekka Heikkila 2024-01-30 19:36 ` Juha-Pekka Heikkila 2024-01-31 6:02 ` Ghimiray, Himal Prasad 2024-01-31 18:56 ` Matt Roper 2024-02-01 14:17 ` Juha-Pekka Heikkila 2024-02-01 15:02 ` Juha-Pekka Heikkila 2024-01-30 19:36 ` [PATCH 3/4] drm/xe/xe2: Limit ccs framebuffers to tile4 only Juha-Pekka Heikkila 2024-01-30 19:36 ` Juha-Pekka Heikkila 2024-01-31 11:40 ` Ville Syrjälä 2024-01-31 12:09 ` Ville Syrjälä 2024-01-30 19:36 ` [PATCH 4/4] drm/i915/display: On Xe2 always enable decompression with tile4 Juha-Pekka Heikkila 2024-01-30 19:36 ` Juha-Pekka Heikkila 2024-01-31 2:06 ` ✓ CI.Patch_applied: success for Enable ccs compressed framebuffers on Xe2 (rev5) Patchwork 2024-01-31 2:07 ` ✓ CI.checkpatch: " Patchwork 2024-01-31 2:07 ` ✓ CI.KUnit: " Patchwork 2024-01-31 2:15 ` ✓ CI.Build: " Patchwork 2024-01-31 2:15 ` ✓ CI.Hooks: " Patchwork 2024-01-31 2:16 ` ✗ CI.checksparse: warning " Patchwork 2024-01-31 3:01 ` ✓ CI.BAT: success " Patchwork 2024-02-02 5:26 ` ✓ Fi.CI.BAT: success for Enable ccs compressed framebuffers on Xe2 (rev6) Patchwork 2024-02-02 7:09 ` ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240130193652.374270-2-juhapekka.heikkila@gmail.com \ --to=juhapekka.heikkila@gmail.com \ --cc=intel-gfx@lists.freedesktop.org \ --cc=intel-xe@lists.freedesktop.org \ --cc=matthew.auld@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.