Commit 882ecff7 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Use intel_crtc_needs_modeset() more

Prefer our own intel_crtc_needs_modeset() wrapper to
drm_atomic_crtc_needs_modeset() whenever we are dealing
with the intel_ types instead of drm_ types. Makes things
a bit neater in general.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221031214037.1636-1-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 9034f9c4
...@@ -2755,7 +2755,7 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state) ...@@ -2755,7 +2755,7 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
if (IS_ERR(crtc_state)) if (IS_ERR(crtc_state))
return PTR_ERR(crtc_state); return PTR_ERR(crtc_state);
if (drm_atomic_crtc_needs_modeset(&crtc_state->uapi)) if (intel_crtc_needs_modeset(crtc_state))
pipe = INVALID_PIPE; pipe = INVALID_PIPE;
} }
......
...@@ -1239,7 +1239,7 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state) ...@@ -1239,7 +1239,7 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
struct intel_plane *plane; struct intel_plane *plane;
if (!new_crtc_state->hw.active || if (!new_crtc_state->hw.active ||
drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) intel_crtc_needs_modeset(new_crtc_state))
return 0; return 0;
if (new_crtc_state->gamma_enable == old_crtc_state->gamma_enable && if (new_crtc_state->gamma_enable == old_crtc_state->gamma_enable &&
......
...@@ -5931,7 +5931,7 @@ int intel_modeset_all_pipes(struct intel_atomic_state *state, ...@@ -5931,7 +5931,7 @@ int intel_modeset_all_pipes(struct intel_atomic_state *state,
return PTR_ERR(crtc_state); return PTR_ERR(crtc_state);
if (!crtc_state->hw.active || if (!crtc_state->hw.active ||
drm_atomic_crtc_needs_modeset(&crtc_state->uapi)) intel_crtc_needs_modeset(crtc_state))
continue; continue;
drm_dbg_kms(&dev_priv->drm, "[CRTC:%d:%s] Full modeset due to %s\n", drm_dbg_kms(&dev_priv->drm, "[CRTC:%d:%s] Full modeset due to %s\n",
......
...@@ -1183,7 +1183,7 @@ static bool intel_fbc_can_flip_nuke(struct intel_atomic_state *state, ...@@ -1183,7 +1183,7 @@ static bool intel_fbc_can_flip_nuke(struct intel_atomic_state *state,
const struct drm_framebuffer *old_fb = old_plane_state->hw.fb; const struct drm_framebuffer *old_fb = old_plane_state->hw.fb;
const struct drm_framebuffer *new_fb = new_plane_state->hw.fb; const struct drm_framebuffer *new_fb = new_plane_state->hw.fb;
if (drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) if (intel_crtc_needs_modeset(new_crtc_state))
return false; return false;
if (!intel_fbc_is_ok(old_plane_state) || if (!intel_fbc_is_ok(old_plane_state) ||
......
...@@ -2744,7 +2744,7 @@ static int skl_wm_add_affected_planes(struct intel_atomic_state *state, ...@@ -2744,7 +2744,7 @@ static int skl_wm_add_affected_planes(struct intel_atomic_state *state,
* power well the hardware state will go out of sync * power well the hardware state will go out of sync
* with the software state. * with the software state.
*/ */
if (!drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi) && if (!intel_crtc_needs_modeset(new_crtc_state) &&
skl_plane_selected_wm_equals(plane, skl_plane_selected_wm_equals(plane,
&old_crtc_state->wm.skl.optimal, &old_crtc_state->wm.skl.optimal,
&new_crtc_state->wm.skl.optimal)) &new_crtc_state->wm.skl.optimal))
......
...@@ -1434,7 +1434,7 @@ static int g4x_compute_intermediate_wm(struct intel_atomic_state *state, ...@@ -1434,7 +1434,7 @@ static int g4x_compute_intermediate_wm(struct intel_atomic_state *state,
enum plane_id plane_id; enum plane_id plane_id;
if (!new_crtc_state->hw.active || if (!new_crtc_state->hw.active ||
drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) { intel_crtc_needs_modeset(new_crtc_state)) {
*intermediate = *optimal; *intermediate = *optimal;
intermediate->cxsr = false; intermediate->cxsr = false;
...@@ -1922,7 +1922,6 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state, ...@@ -1922,7 +1922,6 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state,
{ {
struct intel_crtc_state *crtc_state = struct intel_crtc_state *crtc_state =
intel_atomic_get_new_crtc_state(state, crtc); intel_atomic_get_new_crtc_state(state, crtc);
bool needs_modeset = drm_atomic_crtc_needs_modeset(&crtc_state->uapi);
const struct intel_plane_state *old_plane_state; const struct intel_plane_state *old_plane_state;
const struct intel_plane_state *new_plane_state; const struct intel_plane_state *new_plane_state;
struct intel_plane *plane; struct intel_plane *plane;
...@@ -1949,7 +1948,7 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state, ...@@ -1949,7 +1948,7 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state,
* FIFO setting we took over from the BIOS even if there * FIFO setting we took over from the BIOS even if there
* are no active planes on the crtc. * are no active planes on the crtc.
*/ */
if (needs_modeset) if (intel_crtc_needs_modeset(crtc_state))
dirty = ~0; dirty = ~0;
if (!dirty) if (!dirty)
...@@ -1969,7 +1968,7 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state, ...@@ -1969,7 +1968,7 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state,
if (ret) if (ret)
return ret; return ret;
if (needs_modeset || if (intel_crtc_needs_modeset(crtc_state) ||
memcmp(old_fifo_state, new_fifo_state, memcmp(old_fifo_state, new_fifo_state,
sizeof(*new_fifo_state)) != 0) sizeof(*new_fifo_state)) != 0)
crtc_state->fifo_changed = true; crtc_state->fifo_changed = true;
...@@ -2092,7 +2091,7 @@ static int vlv_compute_intermediate_wm(struct intel_atomic_state *state, ...@@ -2092,7 +2091,7 @@ static int vlv_compute_intermediate_wm(struct intel_atomic_state *state,
int level; int level;
if (!new_crtc_state->hw.active || if (!new_crtc_state->hw.active ||
drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) { intel_crtc_needs_modeset(new_crtc_state)) {
*intermediate = *optimal; *intermediate = *optimal;
intermediate->cxsr = false; intermediate->cxsr = false;
...@@ -3150,7 +3149,7 @@ static int ilk_compute_intermediate_wm(struct intel_atomic_state *state, ...@@ -3150,7 +3149,7 @@ static int ilk_compute_intermediate_wm(struct intel_atomic_state *state,
*/ */
*a = new_crtc_state->wm.ilk.optimal; *a = new_crtc_state->wm.ilk.optimal;
if (!new_crtc_state->hw.active || if (!new_crtc_state->hw.active ||
drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi) || intel_crtc_needs_modeset(new_crtc_state) ||
state->skip_intermediate_wm) state->skip_intermediate_wm)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment