Skip to content

Commit 5d66788

Browse files
committed
drm/xe: Assert pat.ops function pointers
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> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240409105106.1067-1-michal.wajdeczko@intel.com
1 parent 7cd05ef commit 5d66788

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/xe/xe_pat.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ void xe_pat_init_early(struct xe_device *xe)
435435
/* VFs can't program nor dump PAT settings */
436436
if (IS_SRIOV_VF(xe))
437437
xe->pat.ops = NULL;
438+
439+
xe_assert(xe, !xe->pat.ops || xe->pat.ops->dump);
440+
xe_assert(xe, !xe->pat.ops || xe->pat.ops->program_graphics);
441+
xe_assert(xe, !xe->pat.ops || MEDIA_VER(xe) < 13 || xe->pat.ops->program_media);
438442
}
439443

440444
void xe_pat_init(struct xe_gt *gt)

0 commit comments

Comments
 (0)