drm/xe/pf: Add thresholds to the VF KLV config
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 30 Aug 2024 13:20:59 +0000 (15:20 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 2 Sep 2024 18:51:02 +0000 (20:51 +0200)
We are pushing threshold KLV to the GuC immediately during the
threshold provisioning, but those configs will be lost during a
GT reset.  Include threshold KLVs while encoding full VF config
buffer to make sure the GuC receives all of the config KLVs.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240830132100.1704-2-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c

index 497af3949b199d44eb9cd1bfdf4d522859ad60ad..151eb69ab4aed54381afed1d47eb31623f6be4ce 100644 (file)
@@ -277,6 +277,14 @@ static u32 encode_config(u32 *cfg, const struct xe_gt_sriov_config *config)
        cfg[n++] = PREP_GUC_KLV_TAG(VF_CFG_PREEMPT_TIMEOUT);
        cfg[n++] = config->preempt_timeout;
 
+#define encode_threshold_config(TAG, ...) ({                                   \
+       cfg[n++] = PREP_GUC_KLV_TAG(VF_CFG_THRESHOLD_##TAG);                    \
+       cfg[n++] = config->thresholds[MAKE_XE_GUC_KLV_THRESHOLD_INDEX(TAG)];    \
+});
+
+       MAKE_XE_GUC_KLV_THRESHOLDS_SET(encode_threshold_config);
+#undef encode_threshold_config
+
        return n;
 }