Re: [Intel-gfx] [PATCH 2/9] drm/i915: Convert most of atomic commit to take more intel state
On Thu, Jun 20, 2019 at 11:46:06PM +0200, Maarten Lankhorst wrote: > Instead of passing along drm_crtc_state and drm_atomic_state, pass > along more intel_atomic_state and intel_crtc_state. This will > make the code more readable by not casting between drm state > and intel state all the time. > > Signed-off-by: Maarten Lankhorst > --- > drivers/gpu/drm/i915/display/intel_display.c | 403 +-- > drivers/gpu/drm/i915/i915_drv.h | 6 +- > drivers/gpu/drm/i915/intel_pm.c | 11 +- > drivers/gpu/drm/i915/intel_pm.h | 4 +- > 4 files changed, 196 insertions(+), 228 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index 02565e97995a..855f90a81396 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -6036,19 +6036,19 @@ static void intel_crtc_disable_planes(struct > intel_atomic_state *state, > intel_frontbuffer_flip(dev_priv, fb_bits); > } > > -static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc, > +static void intel_encoders_pre_pll_enable(struct intel_crtc *crtc, > struct intel_crtc_state *crtc_state, > - struct drm_atomic_state *old_state) > + struct intel_atomic_state *old_state) Maybe s/old_state/state/ while at it? Reviewed-by: Ville Syrjälä > { > struct drm_connector_state *conn_state; > struct drm_connector *conn; > int i; > > - for_each_new_connector_in_state(old_state, conn, conn_state, i) { > + for_each_new_connector_in_state(_state->base, conn, conn_state, i) { > struct intel_encoder *encoder = > to_intel_encoder(conn_state->best_encoder); > > - if (conn_state->crtc != crtc) > + if (conn_state->crtc != >base) > continue; > > if (encoder->pre_pll_enable) > @@ -6056,19 +6056,19 @@ static void intel_encoders_pre_pll_enable(struct > drm_crtc *crtc, > } > } > > -static void intel_encoders_pre_enable(struct drm_crtc *crtc, > +static void intel_encoders_pre_enable(struct intel_crtc *crtc, > struct intel_crtc_state *crtc_state, > - struct drm_atomic_state *old_state) > + struct intel_atomic_state *old_state) > { > struct drm_connector_state *conn_state; > struct drm_connector *conn; > int i; > > - for_each_new_connector_in_state(old_state, conn, conn_state, i) { > + for_each_new_connector_in_state(_state->base, conn, conn_state, i) { > struct intel_encoder *encoder = > to_intel_encoder(conn_state->best_encoder); > > - if (conn_state->crtc != crtc) > + if (conn_state->crtc != >base) > continue; > > if (encoder->pre_enable) > @@ -6076,19 +6076,19 @@ static void intel_encoders_pre_enable(struct drm_crtc > *crtc, > } > } > > -static void intel_encoders_enable(struct drm_crtc *crtc, > +static void intel_encoders_enable(struct intel_crtc *crtc, > struct intel_crtc_state *crtc_state, > - struct drm_atomic_state *old_state) > + struct intel_atomic_state *old_state) > { > struct drm_connector_state *conn_state; > struct drm_connector *conn; > int i; > > - for_each_new_connector_in_state(old_state, conn, conn_state, i) { > + for_each_new_connector_in_state(_state->base, conn, conn_state, i) { > struct intel_encoder *encoder = > to_intel_encoder(conn_state->best_encoder); > > - if (conn_state->crtc != crtc) > + if (conn_state->crtc != >base) > continue; > > if (encoder->enable) > @@ -6097,19 +6097,19 @@ static void intel_encoders_enable(struct drm_crtc > *crtc, > } > } > > -static void intel_encoders_disable(struct drm_crtc *crtc, > +static void intel_encoders_disable(struct intel_crtc *crtc, > struct intel_crtc_state *old_crtc_state, > -struct drm_atomic_state *old_state) > +struct intel_atomic_state *old_state) > { > struct drm_connector_state *old_conn_state; > struct drm_connector *conn; > int i; > > - for_each_old_connector_in_state(old_state, conn, old_conn_state, i) { > + for_each_old_connector_in_state(_state->base, conn, old_conn_state, > i) { > struct intel_encoder *encoder = > to_intel_encoder(old_conn_state->best_encoder); > > - if (old_conn_state->crtc != crtc) > + if
[Intel-gfx] [PATCH 2/9] drm/i915: Convert most of atomic commit to take more intel state
Instead of passing along drm_crtc_state and drm_atomic_state, pass along more intel_atomic_state and intel_crtc_state. This will make the code more readable by not casting between drm state and intel state all the time. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/display/intel_display.c | 403 +-- drivers/gpu/drm/i915/i915_drv.h | 6 +- drivers/gpu/drm/i915/intel_pm.c | 11 +- drivers/gpu/drm/i915/intel_pm.h | 4 +- 4 files changed, 196 insertions(+), 228 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 02565e97995a..855f90a81396 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -6036,19 +6036,19 @@ static void intel_crtc_disable_planes(struct intel_atomic_state *state, intel_frontbuffer_flip(dev_priv, fb_bits); } -static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc, +static void intel_encoders_pre_pll_enable(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, - struct drm_atomic_state *old_state) + struct intel_atomic_state *old_state) { struct drm_connector_state *conn_state; struct drm_connector *conn; int i; - for_each_new_connector_in_state(old_state, conn, conn_state, i) { + for_each_new_connector_in_state(_state->base, conn, conn_state, i) { struct intel_encoder *encoder = to_intel_encoder(conn_state->best_encoder); - if (conn_state->crtc != crtc) + if (conn_state->crtc != >base) continue; if (encoder->pre_pll_enable) @@ -6056,19 +6056,19 @@ static void intel_encoders_pre_pll_enable(struct drm_crtc *crtc, } } -static void intel_encoders_pre_enable(struct drm_crtc *crtc, +static void intel_encoders_pre_enable(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, - struct drm_atomic_state *old_state) + struct intel_atomic_state *old_state) { struct drm_connector_state *conn_state; struct drm_connector *conn; int i; - for_each_new_connector_in_state(old_state, conn, conn_state, i) { + for_each_new_connector_in_state(_state->base, conn, conn_state, i) { struct intel_encoder *encoder = to_intel_encoder(conn_state->best_encoder); - if (conn_state->crtc != crtc) + if (conn_state->crtc != >base) continue; if (encoder->pre_enable) @@ -6076,19 +6076,19 @@ static void intel_encoders_pre_enable(struct drm_crtc *crtc, } } -static void intel_encoders_enable(struct drm_crtc *crtc, +static void intel_encoders_enable(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state, - struct drm_atomic_state *old_state) + struct intel_atomic_state *old_state) { struct drm_connector_state *conn_state; struct drm_connector *conn; int i; - for_each_new_connector_in_state(old_state, conn, conn_state, i) { + for_each_new_connector_in_state(_state->base, conn, conn_state, i) { struct intel_encoder *encoder = to_intel_encoder(conn_state->best_encoder); - if (conn_state->crtc != crtc) + if (conn_state->crtc != >base) continue; if (encoder->enable) @@ -6097,19 +6097,19 @@ static void intel_encoders_enable(struct drm_crtc *crtc, } } -static void intel_encoders_disable(struct drm_crtc *crtc, +static void intel_encoders_disable(struct intel_crtc *crtc, struct intel_crtc_state *old_crtc_state, - struct drm_atomic_state *old_state) + struct intel_atomic_state *old_state) { struct drm_connector_state *old_conn_state; struct drm_connector *conn; int i; - for_each_old_connector_in_state(old_state, conn, old_conn_state, i) { + for_each_old_connector_in_state(_state->base, conn, old_conn_state, i) { struct intel_encoder *encoder = to_intel_encoder(old_conn_state->best_encoder); - if (old_conn_state->crtc != crtc) + if (old_conn_state->crtc != >base) continue; intel_opregion_notify_encoder(encoder, false); @@ -6118,19 +6118,19 @@ static void intel_encoders_disable(struct drm_crtc *crtc, } } -static void