*/
u8 pipe_sagv_reject;
- /* bitmask of active pipes */
- u8 active_pipes;
-
/*
* From MTL onwards, to lock a QGV point, punit expects the peak BW of
* the selected QGV point as the parameter in multiples of 100MB/s
return 0;
}
-static int intel_bw_modeset_checks(struct intel_atomic_state *state)
-{
- const struct intel_bw_state *old_bw_state;
- struct intel_bw_state *new_bw_state;
- int ret;
-
- if (!intel_any_crtc_active_changed(state))
- return 0;
-
- new_bw_state = intel_atomic_get_bw_state(state);
- if (IS_ERR(new_bw_state))
- return PTR_ERR(new_bw_state);
-
- old_bw_state = intel_atomic_get_old_bw_state(state);
-
- new_bw_state->active_pipes =
- intel_calc_active_pipes(state, old_bw_state->active_pipes);
-
- ret = intel_atomic_lock_global_state(&new_bw_state->base);
- if (ret)
- return ret;
-
- return 0;
-}
-
static int intel_bw_check_sagv_mask(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
if (DISPLAY_VER(display) < 9)
return 0;
- ret = intel_bw_modeset_checks(state);
- if (ret)
- return ret;
-
ret = intel_bw_check_sagv_mask(state);
if (ret)
return ret;
if (DISPLAY_VER(display) < 9)
return;
- bw_state->active_pipes = 0;
bw_state->pipe_sagv_reject = 0;
for_each_intel_crtc(display->drm, crtc) {
to_intel_crtc_state(crtc->base.state);
enum pipe pipe = crtc->pipe;
- if (crtc_state->hw.active)
- bw_state->active_pipes |= BIT(pipe);
-
if (DISPLAY_VER(display) >= 11)
intel_bw_crtc_update(bw_state, crtc_state);
bool intel_bw_can_enable_sagv(struct intel_display *display,
const struct intel_bw_state *bw_state)
{
- if (DISPLAY_VER(display) < 11 &&
- bw_state->active_pipes && !is_power_of_2(bw_state->active_pipes))
- return false;
-
return bw_state->pipe_sagv_reject == 0;
}