PS_WIN_XSIZE(width) | PS_WIN_YSIZE(height));
}
+static int skl_pipe_scaler_get_hw_state(struct intel_crtc_state *crtc_state)
+{
+ struct intel_display *display = to_intel_display(crtc_state);
+ struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+
+ for (int scaler_id = 0; scaler_id < crtc->num_scalers; scaler_id++) {
+ u32 ctl;
+
+ 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))
+ return scaler_id;
+ }
+
+ return -1;
+}
+
void
skl_program_plane_scaler(struct intel_dsb *dsb,
struct intel_plane *plane,
u32 pos, size;
/* find scaler attached to this pipe */
- for (scaler_id = 0; scaler_id < crtc->num_scalers; scaler_id++) {
- u32 ctl;
-
- 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))
- break;
- }
-
- if (scaler_id == crtc->num_scalers)
+ scaler_id = skl_pipe_scaler_get_hw_state(crtc_state);
+ if (scaler_id < 0)
return;
if (scaler_has_casf(display, scaler_id))