Periodic AS SDP (skip frames) drives a Panel Replay panel down toward its
minimum refresh rate. It is a new, panel- and platform-sensitive behaviour,
so keep it opt-in rather than enabling it unconditionally.

Expose it as a per-device debugfs knob, enable_periodic_assdp, rather than a
module parameter. The behaviour is panel-specific, so the correct granularity
is per-device, not per-module. The knob is added through the 
intel_display_params
infrastructure (shared by i915 and xe) with a debugfs entry only. It defaults to
false (feature disabled); write 1 to the debugfs file to enable periodic AS SDP
at runtime.

Gate the feature at its single choke point, intel_pr_as_sdp_skip_frames():
returning a zero skip count when the knob is off makes both the PR_ALPM_CTL
programming (intel_alpm_configure_pr_as_sdp()) and the DC3co force-disable
predicate (intel_alpm_pr_as_sdp_skip_frames_enabled()) a no-op, so AS SDP
continues to be sent on every frame as before.

v2: Switch to debugfs entry and drop module param

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Uma Shankar <[email protected]>
Reviewed-by: Dibin Moolakadan Subrahmanian 
<[email protected]>
Tested-by: Naladala Ramanaidu <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_alpm.c           | 5 +++++
 drivers/gpu/drm/i915/display/intel_display_params.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c 
b/drivers/gpu/drm/i915/display/intel_alpm.c
index c784e77f610b..10943539bc7c 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -392,11 +392,16 @@ static u32 get_pr_alpm_as_sdp_transmission_time(const 
struct intel_crtc_state *c
  */
 static u32 intel_pr_as_sdp_skip_frames(struct intel_dp *intel_dp)
 {
+       struct intel_display *display = to_intel_display(intel_dp);
        const struct drm_display_info *info =
                &intel_dp->attached_connector->base.display_info;
        int max_vrefresh = info->monitor_range.max_vfreq;
        int min_vrefresh = info->monitor_range.min_vfreq;
 
+       /* Off by default; gated by the enable_periodic_assdp debugfs knob. */
+       if (!display->params.enable_periodic_assdp)
+               return 0;
+
        if (min_vrefresh <= 0 || max_vrefresh <= min_vrefresh)
                return 0;
 
diff --git a/drivers/gpu/drm/i915/display/intel_display_params.h 
b/drivers/gpu/drm/i915/display/intel_display_params.h
index b95ecf728daa..ba01aeaf8944 100644
--- a/drivers/gpu/drm/i915/display/intel_display_params.h
+++ b/drivers/gpu/drm/i915/display/intel_display_params.h
@@ -50,6 +50,11 @@ struct drm_printer;
        param(bool, psr_safest_params, false, 0400) \
        param(bool, enable_psr2_sel_fetch, true, 0400) \
        param(int, enable_dmc_wl, -1, 0400) \
+       /*
+        * Debugfs-only knob (per-device): no matching module_param is 
registered
+        * in intel_display_params.c on purpose. Runtime-toggle via debugfs.
+        */ \
+       param(bool, enable_periodic_assdp, false, 0600) \
 
 #define MEMBER(T, member, ...) T member;
 struct intel_display_params {
-- 
2.50.1

Reply via email to