Quoting Ville Syrjala (2020-04-17 14:47:20) > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > > Pass the encoder all the way down to > intel_ddi_transcoder_func_reg_val_get(). Allows us eliminate the > intel_ddi_get_crtc_encoder() eyesore. > > Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > --- > drivers/gpu/drm/i915/display/intel_crt.c | 2 +- > drivers/gpu/drm/i915/display/intel_ddi.c | 39 ++++++--------------- > drivers/gpu/drm/i915/display/intel_ddi.h | 3 +- > drivers/gpu/drm/i915/display/intel_dp_mst.c | 2 +- > 4 files changed, 14 insertions(+), 32 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c > index 0a75821a680b..2f5b9a4baafd 100644 > --- a/drivers/gpu/drm/i915/display/intel_crt.c > +++ b/drivers/gpu/drm/i915/display/intel_crt.c > @@ -308,7 +308,7 @@ static void hsw_enable_crt(struct intel_atomic_state *state, > > drm_WARN_ON(&dev_priv->drm, !crtc_state->has_pch_encoder); > > - intel_ddi_enable_transcoder_func(crtc_state); > + intel_ddi_enable_transcoder_func(encoder, crtc_state); > > intel_enable_pipe(crtc_state); > > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c > index 640cf34f6e24..88edb702b6ac 100644 > --- a/drivers/gpu/drm/i915/display/intel_ddi.c > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c > @@ -1351,27 +1351,6 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder) > intel_dp->DP |= DDI_PORT_WIDTH(intel_dp->lane_count); > } > > -static struct intel_encoder * > -intel_ddi_get_crtc_encoder(struct intel_crtc *crtc) > -{ > - struct drm_device *dev = crtc->base.dev; > - struct intel_encoder *encoder, *ret = NULL; > - int num_encoders = 0; > - > - for_each_encoder_on_crtc(dev, &crtc->base, encoder) { > - ret = encoder; > - num_encoders++; > - } > - > - if (num_encoders != 1) > - drm_WARN(dev, 1, "%d encoders on crtc for pipe %c\n", > - num_encoders, > - pipe_name(crtc->pipe)); > - > - BUG_ON(ret == NULL); > - return ret; > -} Worth it. Eyesore, more like booby trap. Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx