]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/lnl: Enable GuC SLPC DCC task
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 15 Jan 2025 14:50:53 +0000 (09:50 -0500)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 15 Jan 2025 19:12:52 +0000 (14:12 -0500)
Enable DCC (Duty Cycle Control) in Lunar Lake.

DCC is the SLPC task that tries to keep
the GT from operating inefficiently when thermally constrained.

Although the recommendation is to enable it, LNL GuC is leaving
it disabled by default on LNL.

It would minimize the GT frequency oscillation on throttled
scenarios, which could potentially reduce latencies.

v2: Move set_policies call after wait for running state, so
    we ensure it is not overwritten. (Vinay)
v3: Fix English in the commit message (Jonathan)
v4: Also set disable to 0 so DCC can really get into effect.
v5: Avoid lnl_ prefix (Vinay)
v6: Finish renaming...

Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com> #v3
Link: https://patchwork.freedesktop.org/patch/msgid/20250115145053.1142023-2-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_guc_pc.c

index 43f9617baba2903be62c5fe320836dd30b6b274a..44b5211066efa77f7104af15ec514904133e95bc 100644 (file)
@@ -993,6 +993,27 @@ out:
        return ret;
 }
 
+static int slpc_enable_dcc(struct xe_guc_pc *pc)
+{
+       int ret;
+
+       ret = pc_action_set_param(pc, SLPC_PARAM_TASK_ENABLE_DCC, 1);
+       if (ret)
+               return ret;
+
+       return pc_action_set_param(pc, SLPC_PARAM_TASK_DISABLE_DCC, 0);
+}
+
+static int slpc_set_policies(struct xe_guc_pc *pc)
+{
+       struct xe_device *xe = pc_to_xe(pc);
+
+       if (xe->info.platform == XE_LUNARLAKE)
+               return slpc_enable_dcc(pc);
+
+       return 0;
+}
+
 /**
  * xe_guc_pc_start - Start GuC's Power Conservation component
  * @pc: Xe_GuC_PC instance
@@ -1037,6 +1058,10 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)
                goto out;
        }
 
+       ret = slpc_set_policies(pc);
+       if (ret)
+               goto out;
+
        ret = pc_init_freqs(pc);
        if (ret)
                goto out;