[PATCH 10/12] drm/xe/pf: Define stub for pf_send_vf_control_cmd()
Michal Wajdeczko
michal.wajdeczko at intel.com
Fri Aug 9 16:51:57 UTC 2024
For some advanced KUnit test cases we may want to use replacement
function instead of the real pf_send_vf_control_cmd().
Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
---
drivers/gpu/drm/xe/xe_gt_sriov_pf_control.c | 1 +
drivers/gpu/drm/xe/xe_gt_sriov_pf_control_types.h | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_control.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_control.c
index 1ed7d49bef8c..e91c71d768ff 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_control.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_control.c
@@ -58,6 +58,7 @@ static int pf_send_vf_control_cmd(struct xe_gt *gt, unsigned int vfid, u32 cmd)
xe_gt_assert(gt, vfid != PFID);
xe_gt_sriov_dbg_verbose(gt, "sending VF%u control command %s\n",
vfid, control_cmd_to_string(cmd));
+ XE_TEST_REDIRECT(gt->sriov.pf.control.send_vf_control_cmd, gt, vfid, cmd);
err = guc_action_vf_control_cmd(>->uc.guc, vfid, cmd);
if (unlikely(err))
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_control_types.h b/drivers/gpu/drm/xe/xe_gt_sriov_pf_control_types.h
index 11830aafea45..6d7a3c8cc38a 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_control_types.h
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_control_types.h
@@ -10,6 +10,10 @@
#include <linux/spinlock.h>
#include <linux/workqueue_types.h>
+#include "tests/xe_test.h"
+
+struct xe_gt;
+
/**
* enum xe_gt_sriov_control_bits - Various bits used by the PF to represent a VF state
*
@@ -102,6 +106,9 @@ struct xe_gt_sriov_pf_control {
/** @lock: protects VF pending list */
spinlock_t lock;
+
+ /* private: */
+ XE_TEST_DECLARE(int (*send_vf_control_cmd)(struct xe_gt *gt, unsigned int vfid, u32 cmd));
};
#endif
--
2.43.0
More information about the Intel-xe
mailing list