Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/xe: Assert pat.ops function pointers
@ 2024-04-09 10:51 Michal Wajdeczko
  2024-04-09 10:51 ` [PATCH 2/2] drm/xe: Check pat.ops before dumping PAT settings Michal Wajdeczko
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Michal Wajdeczko @ 2024-04-09 10:51 UTC (permalink / raw)
  To: intel-xe; +Cc: Michal Wajdeczko, Piotr Piórkowski, Matt Roper

Make sure that pat.ops (if selected) has all required function
pointers setup. Only .program_media may be omitted if we have
older media version.

This should help avoid late runtime checks against individual
function pointers.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/xe/xe_pat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
index 66d8e3dd8237..026e4a9fe124 100644
--- a/drivers/gpu/drm/xe/xe_pat.c
+++ b/drivers/gpu/drm/xe/xe_pat.c
@@ -428,6 +428,10 @@ void xe_pat_init_early(struct xe_device *xe)
 	/* VFs can't program nor dump PAT settings */
 	if (IS_SRIOV_VF(xe))
 		xe->pat.ops = NULL;
+
+	xe_assert(xe, !xe->pat.ops || xe->pat.ops->dump);
+	xe_assert(xe, !xe->pat.ops || xe->pat.ops->program_graphics);
+	xe_assert(xe, !xe->pat.ops || MEDIA_VER(xe) < 13 || xe->pat.ops->program_media);
 }
 
 void xe_pat_init(struct xe_gt *gt)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-04-09 16:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-09 10:51 [PATCH 1/2] drm/xe: Assert pat.ops function pointers Michal Wajdeczko
2024-04-09 10:51 ` [PATCH 2/2] drm/xe: Check pat.ops before dumping PAT settings Michal Wajdeczko
2024-04-09 13:09   ` Piotr Piórkowski
2024-04-09 10:56 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe: Assert pat.ops function pointers Patchwork
2024-04-09 10:57 ` ✓ CI.checkpatch: " Patchwork
2024-04-09 10:58 ` ✓ CI.KUnit: " Patchwork
2024-04-09 11:10 ` ✓ CI.Build: " Patchwork
2024-04-09 11:12 ` ✓ CI.Hooks: " Patchwork
2024-04-09 11:14 ` ✓ CI.checksparse: " Patchwork
2024-04-09 11:37 ` ✓ CI.BAT: " Patchwork
2024-04-09 12:48 ` ✗ CI.FULL: failure " Patchwork
2024-04-09 16:30   ` Michal Wajdeczko
2024-04-09 13:09 ` [PATCH 1/2] " Piotr Piórkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox