]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe: Add infrastructure for per engine tuning
authorMatt Atwood <matthew.s.atwood@intel.com>
Fri, 6 Oct 2023 16:11:47 +0000 (09:11 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:42:10 +0000 (11:42 -0500)
Add the infrastructure for per engine tuning in preparation for disable
indirect state.

v3: Rebase
v4: Fix rebasing issues

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Atwood <matthew.s.atwood@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_hw_engine.c
drivers/gpu/drm/xe/xe_tuning.c
drivers/gpu/drm/xe/xe_tuning.h

index f63c821baeb77f2c3ed770db04020faabcf9e1a2..b5b0845908887eb435d8b756431651ea813fcf36 100644 (file)
@@ -25,6 +25,7 @@
 #include "xe_reg_sr.h"
 #include "xe_rtp.h"
 #include "xe_sched_job.h"
+#include "xe_tuning.h"
 #include "xe_wa.h"
 
 #define MAX_MMIO_BASES 3
@@ -405,6 +406,7 @@ static void hw_engine_init_early(struct xe_gt *gt, struct xe_hw_engine *hwe,
        }
 
        xe_reg_sr_init(&hwe->reg_sr, hwe->name, gt_to_xe(gt));
+       xe_tuning_process_engine(hwe);
        xe_wa_process_engine(hwe);
        hw_engine_setup_default_state(hwe);
 
index 08174dda9bc734adbb6b315d6aadc95e806fb3dc..3ad11c259300326b28eeed78b114ba39234a98ef 100644 (file)
@@ -27,6 +27,10 @@ static const struct xe_rtp_entry_sr gt_tunings[] = {
        {}
 };
 
+static const struct xe_rtp_entry_sr engine_tunings[] = {
+       {}
+};
+
 static const struct xe_rtp_entry_sr lrc_tunings[] = {
        { XE_RTP_NAME("Tuning: ganged timer, also known as 16011163337"),
          XE_RTP_RULES(GRAPHICS_VERSION_RANGE(1200, 1210), ENGINE_CLASS(RENDER)),
@@ -65,6 +69,14 @@ void xe_tuning_process_gt(struct xe_gt *gt)
 }
 EXPORT_SYMBOL_IF_KUNIT(xe_tuning_process_gt);
 
+void xe_tuning_process_engine(struct xe_hw_engine *hwe)
+{
+       struct xe_rtp_process_ctx ctx = XE_RTP_PROCESS_CTX_INITIALIZER(hwe);
+
+       xe_rtp_process_to_sr(&ctx, engine_tunings, &hwe->reg_sr);
+}
+EXPORT_SYMBOL_IF_KUNIT(xe_tuning_process_engine);
+
 /**
  * xe_tuning_process_lrc - process lrc tunings
  * @hwe: engine instance to process tunings for
index 2b95b0c8effc46e4177a82b0a51764c9c4a05550..4f9c3ac3b5162eed82ec8800e1fbad0a48b9610a 100644 (file)
@@ -10,6 +10,7 @@ struct xe_gt;
 struct xe_hw_engine;
 
 void xe_tuning_process_gt(struct xe_gt *gt);
+void xe_tuning_process_engine(struct xe_hw_engine *hwe);
 void xe_tuning_process_lrc(struct xe_hw_engine *hwe);
 
 #endif