[PATCH v1 05/10] drm/i915/casf: s/i/scaler_id where appropriate

Michał Grzelak
2026-03-28T14:33:25Z

Switch from generic iterator naming into more specific scaler_id where
it is possible.

Cc: Nemesa Garg <nemesa.garg@intel.com>
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
drivers/gpu/drm/i915/display/skl_scaler.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index 7c5cb188ebf0..729ef51beeb4 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -970,17 +970,17 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state)
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state;
int id = -1;
- int i;
+ int scaler_id;

/* find scaler attached to this pipe */
- for (i = 0; i < crtc->num_scalers; i++) {
+ for (scaler_id = 0; scaler_id < crtc->num_scalers; scaler_id++) {
u32 ctl, pos, size;

- ctl = intel_de_read(display, SKL_PS_CTRL(crtc->pipe, i));
+ ctl = intel_de_read(display, SKL_PS_CTRL(crtc->pipe, scaler_id));
if ((ctl & (PS_SCALER_EN | PS_BINDING_MASK)) != (PS_SCALER_EN | PS_BINDING_PIPE))
continue;

- id = i;
+ id = scaler_id;

/* Read CASF regs for second scaler */
if (HAS_CASF(display) && id == 1)
@@ -989,8 +989,8 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state)
if (!crtc_state->hw.casf_params.casf_enable)
crtc_state->pch_pfit.enabled = true;

- pos = intel_de_read(display, SKL_PS_WIN_POS(crtc->pipe, i));
- size = intel_de_read(display, SKL_PS_WIN_SZ(crtc->pipe, i));
+ pos = intel_de_read(display, SKL_PS_WIN_POS(crtc->pipe, scaler_id));
+ size = intel_de_read(display, SKL_PS_WIN_SZ(crtc->pipe, scaler_id));

if (!crtc_state->hw.casf_params.casf_enable)
drm_rect_init(&crtc_state->pch_pfit.dst,
@@ -999,7 +999,7 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state)
REG_FIELD_GET(PS_WIN_XSIZE_MASK, size),
REG_FIELD_GET(PS_WIN_YSIZE_MASK, size));

- scaler_state->scalers[i].in_use = true;
+ scaler_state->scalers[scaler_id].in_use = true;
break;
}

--
2.45.2