Commit c045bc42 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Decouple intel_crtc_vblank_evade_scanlines() from atomic commits

We'll be needing to do vblank evasion around legacy cursor updates,
which don't have the intel_atomic_state around. So let's remove
this dependency on a full commit and pass the crtc state in by hand.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231213102519.13500-2-ville.syrjala@linux.intel.comReviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
parent 92b47c3b
...@@ -471,14 +471,11 @@ static int intel_mode_vblank_start(const struct drm_display_mode *mode) ...@@ -471,14 +471,11 @@ static int intel_mode_vblank_start(const struct drm_display_mode *mode)
return vblank_start; return vblank_start;
} }
static void intel_crtc_vblank_evade_scanlines(struct intel_atomic_state *state, static void intel_crtc_vblank_evade_scanlines(const struct intel_crtc_state *old_crtc_state,
struct intel_crtc *crtc, const struct intel_crtc_state *new_crtc_state,
int *min, int *max, int *vblank_start) int *min, int *max, int *vblank_start)
{ {
const struct intel_crtc_state *old_crtc_state = struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
intel_atomic_get_old_crtc_state(state, crtc);
const struct intel_crtc_state *new_crtc_state =
intel_atomic_get_new_crtc_state(state, crtc);
const struct intel_crtc_state *crtc_state; const struct intel_crtc_state *crtc_state;
const struct drm_display_mode *adjusted_mode; const struct drm_display_mode *adjusted_mode;
...@@ -497,7 +494,7 @@ static void intel_crtc_vblank_evade_scanlines(struct intel_atomic_state *state, ...@@ -497,7 +494,7 @@ static void intel_crtc_vblank_evade_scanlines(struct intel_atomic_state *state,
if (crtc->mode_flags & I915_MODE_FLAG_VRR) { if (crtc->mode_flags & I915_MODE_FLAG_VRR) {
/* timing changes should happen with VRR disabled */ /* timing changes should happen with VRR disabled */
drm_WARN_ON(state->base.dev, intel_crtc_needs_modeset(new_crtc_state) || drm_WARN_ON(crtc->base.dev, intel_crtc_needs_modeset(new_crtc_state) ||
new_crtc_state->update_m_n || new_crtc_state->update_lrr); new_crtc_state->update_m_n || new_crtc_state->update_lrr);
if (intel_vrr_is_push_sent(crtc_state)) if (intel_vrr_is_push_sent(crtc_state))
...@@ -542,6 +539,8 @@ void intel_pipe_update_start(struct intel_atomic_state *state, ...@@ -542,6 +539,8 @@ void intel_pipe_update_start(struct intel_atomic_state *state,
struct intel_crtc *crtc) struct intel_crtc *crtc)
{ {
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
const struct intel_crtc_state *old_crtc_state =
intel_atomic_get_old_crtc_state(state, crtc);
struct intel_crtc_state *new_crtc_state = struct intel_crtc_state *new_crtc_state =
intel_atomic_get_new_crtc_state(state, crtc); intel_atomic_get_new_crtc_state(state, crtc);
long timeout = msecs_to_jiffies_timeout(1); long timeout = msecs_to_jiffies_timeout(1);
...@@ -566,7 +565,8 @@ void intel_pipe_update_start(struct intel_atomic_state *state, ...@@ -566,7 +565,8 @@ void intel_pipe_update_start(struct intel_atomic_state *state,
if (intel_crtc_needs_vblank_work(new_crtc_state)) if (intel_crtc_needs_vblank_work(new_crtc_state))
intel_crtc_vblank_work_init(new_crtc_state); intel_crtc_vblank_work_init(new_crtc_state);
intel_crtc_vblank_evade_scanlines(state, crtc, &min, &max, &vblank_start); intel_crtc_vblank_evade_scanlines(old_crtc_state, new_crtc_state,
&min, &max, &vblank_start);
if (min <= 0 || max <= 0) if (min <= 0 || max <= 0)
goto irq_disable; goto irq_disable;
......
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