mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-23 12:38:20 -04:00
drm/i915: Extract sanitize_wm_latency()
Pull the "zero out invalid WM latencies" stuff into a helper. Mainly to avoid mixing higher level and lower level stuff in the same adjust_wm_latency() function. Reviewed-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250919193000.17665-10-ville.syrjala@linux.intel.com
This commit is contained in:
@@ -3217,14 +3217,10 @@ static int wm_read_latency(struct intel_display *display)
|
||||
return 2;
|
||||
}
|
||||
|
||||
static void
|
||||
adjust_wm_latency(struct intel_display *display)
|
||||
static void sanitize_wm_latency(struct intel_display *display)
|
||||
{
|
||||
u16 *wm = display->wm.skl_latency;
|
||||
int i, level, num_levels = display->wm.num_levels;
|
||||
|
||||
if (display->platform.dg2)
|
||||
multiply_wm_latency(display, 2);
|
||||
int level, num_levels = display->wm.num_levels;
|
||||
|
||||
/*
|
||||
* If a level n (n > 1) has a 0us latency, all levels m (m >= n)
|
||||
@@ -3233,11 +3229,24 @@ adjust_wm_latency(struct intel_display *display)
|
||||
*/
|
||||
for (level = 1; level < num_levels; level++) {
|
||||
if (wm[level] == 0) {
|
||||
int i;
|
||||
|
||||
for (i = level + 1; i < num_levels; i++)
|
||||
wm[i] = 0;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
adjust_wm_latency(struct intel_display *display)
|
||||
{
|
||||
u16 *wm = display->wm.skl_latency;
|
||||
|
||||
if (display->platform.dg2)
|
||||
multiply_wm_latency(display, 2);
|
||||
|
||||
sanitize_wm_latency(display);
|
||||
|
||||
/*
|
||||
* WaWmMemoryReadLatency
|
||||
|
||||
Reference in New Issue
Block a user