Skip to content

Commit d4e8379

Browse files
committed
drm/i915/wm: Refactor dpkgc value prepration
Refactor the value getting prepped to be written into the PKG_C_LATENCY register by ORing the REG_FIELD_PREP values instead of having val getting operated on twice. We dont need the clear and val variables to be initialized. Signed-off-by: Suraj Kandpal <[email protected]> Reviewed-by: Mitul Golani <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5105c80 commit d4e8379

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/i915/display/skl_watermark.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,7 +2858,7 @@ static void
28582858
skl_program_dpkgc_latency(struct drm_i915_private *i915, bool enable_dpkgc)
28592859
{
28602860
u32 max_latency = LNL_PKG_C_LATENCY_MASK;
2861-
u32 clear = 0, val = 0;
2861+
u32 clear, val;
28622862
u32 added_wake_time = 0;
28632863

28642864
if (DISPLAY_VER(i915) < 20)
@@ -2872,9 +2872,9 @@ skl_program_dpkgc_latency(struct drm_i915_private *i915, bool enable_dpkgc)
28722872
i915->display.sagv.block_time_us;
28732873
}
28742874

2875-
clear |= LNL_ADDED_WAKE_TIME_MASK | LNL_PKG_C_LATENCY_MASK;
2876-
val |= REG_FIELD_PREP(LNL_PKG_C_LATENCY_MASK, max_latency);
2877-
val |= REG_FIELD_PREP(LNL_ADDED_WAKE_TIME_MASK, added_wake_time);
2875+
clear = LNL_ADDED_WAKE_TIME_MASK | LNL_PKG_C_LATENCY_MASK;
2876+
val = REG_FIELD_PREP(LNL_PKG_C_LATENCY_MASK, max_latency) |
2877+
REG_FIELD_PREP(LNL_ADDED_WAKE_TIME_MASK, added_wake_time);
28782878

28792879
intel_uncore_rmw(&i915->uncore, LNL_PKG_C_LATENCY, clear, val);
28802880
}

0 commit comments

Comments
 (0)