drm/xe: Fix application of LRC tunings
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 21 Feb 2023 23:33:44 +0000 (15:33 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:29:06 +0000 (18:29 -0500)
LRC tunings were added after the gt ones and didn't add the call
in xe_gt_record_default_lrcs() to process them like is done for
workarounds. Add such a function and call it from
xe_gt_record_default_lrcs().

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_gt.c
drivers/gpu/drm/xe/xe_tuning.c
drivers/gpu/drm/xe/xe_tuning.h

index 809e9b14c314d6edb58d79f0354257df47ae63a9..5a3c8fd5936a767853655474973af8124cc48b2d 100644 (file)
@@ -320,6 +320,7 @@ int xe_gt_record_default_lrcs(struct xe_gt *gt)
 
                xe_reg_sr_init(&hwe->reg_lrc, "LRC", xe);
                xe_wa_process_lrc(hwe);
+               xe_tuning_process_lrc(hwe);
 
                default_lrc = drmm_kzalloc(&xe->drm,
                                           xe_lrc_size(xe, hwe->class),
index 3cc32e3e7a90fd9673c28ac601830819dfe1dace..595eb2de90adf5285718e5407cc490c7c91ccc5e 100644 (file)
@@ -24,7 +24,7 @@ static const struct xe_rtp_entry gt_tunings[] = {
        {}
 };
 
-static const struct xe_rtp_entry context_tunings[] = {
+static const struct xe_rtp_entry lrc_tunings[] = {
        { XE_RTP_NAME("1604555607"),
          XE_RTP_RULES(GRAPHICS_VERSION(1200)),
          XE_RTP_ACTIONS(FIELD_SET_NO_READ_MASK(XEHP_FF_MODE2,
@@ -38,3 +38,16 @@ void xe_tuning_process_gt(struct xe_gt *gt)
 {
        xe_rtp_process(gt_tunings, &gt->reg_sr, gt, NULL);
 }
+
+/**
+ * xe_tuning_process_lrc - process lrc tunings
+ * @hwe: engine instance to process tunings for
+ *
+ * Process LRC table for this platform, saving in @hwe all the tunings that need
+ * to be applied on context restore. These are tunings touching registers that
+ * are part of the HW context image.
+ */
+void xe_tuning_process_lrc(struct xe_hw_engine *hwe)
+{
+       xe_rtp_process(lrc_tunings, &hwe->reg_lrc, hwe->gt, hwe);
+}
index 66dbc93192bdeaeae0a96305da31fd7480d77322..2b95b0c8effc46e4177a82b0a51764c9c4a05550 100644 (file)
@@ -7,7 +7,9 @@
 #define _XE_TUNING_
 
 struct xe_gt;
+struct xe_hw_engine;
 
 void xe_tuning_process_gt(struct xe_gt *gt);
+void xe_tuning_process_lrc(struct xe_hw_engine *hwe);
 
 #endif