drm/i915/dmc_wl: Allow enable_dmc_wl=3 to mean "always locked"

When debugging issues that might be related to the DMC wakelock code, it
might be useful to compare runs with the lock acquired while DC states
are enabled vs the regular case. If issues disappear with the former, it
might be a symptom of something wrong in our code. Support having this
"always locked" behavior with enable_dmc_wl=3.

Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241219221429.109668-5-gustavo.sousa@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
This commit is contained in:
Gustavo Sousa
2024-12-19 19:14:16 -03:00
committed by Matt Roper
parent a56d1e380d
commit 34e47bdbad
2 changed files with 7 additions and 2 deletions

View File

@@ -130,7 +130,7 @@ intel_display_param_named_unsafe(enable_psr2_sel_fetch, bool, 0400,
intel_display_param_named_unsafe(enable_dmc_wl, int, 0400,
"Enable DMC wakelock "
"(-1=use per-chip default, 0=disabled, 1=enabled, 2=match any register) "
"(-1=use per-chip default, 0=disabled, 1=enabled, 2=match any register, 3=always locked) "
"Default: -1");
__maybe_unused

View File

@@ -57,6 +57,7 @@ enum {
ENABLE_DMC_WL_DISABLED,
ENABLE_DMC_WL_ENABLED,
ENABLE_DMC_WL_ANY_REGISTER,
ENABLE_DMC_WL_ALWAYS_LOCKED,
ENABLE_DMC_WL_MAX,
};
@@ -312,6 +313,9 @@ static void intel_dmc_wl_sanitize_param(struct intel_display *display)
case ENABLE_DMC_WL_ANY_REGISTER:
desc = "match any register";
break;
case ENABLE_DMC_WL_ALWAYS_LOCKED:
desc = "always locked";
break;
default:
desc = "unknown";
break;
@@ -332,7 +336,8 @@ void intel_dmc_wl_init(struct intel_display *display)
INIT_DELAYED_WORK(&wl->work, intel_dmc_wl_work);
spin_lock_init(&wl->lock);
refcount_set(&wl->refcount, 0);
refcount_set(&wl->refcount,
display->params.enable_dmc_wl == ENABLE_DMC_WL_ALWAYS_LOCKED ? 1 : 0);
}
/* Must only be called as part of enabling dynamic DC states. */