On Wed, Jun 17, 2015 at 04:12:49PM +0300, Imre Deak wrote: > BXT introduces DSI ports, for which we need to skip the DDI port setup. > Also there is no real reason for having a BUG for unknown port types so > convert it to a WARN. > > Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx> I think we could do with a better port abstraction as a whole, right now that's all a bit messy. But anyway: Reviewed-by: Damien Lespiau <damien.lespiau@xxxxxxxxx> > --- > drivers/gpu/drm/i915/intel_ddi.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c > index 31b29e8..9ae297a 100644 > --- a/drivers/gpu/drm/i915/intel_ddi.c > +++ b/drivers/gpu/drm/i915/intel_ddi.c > @@ -210,7 +210,7 @@ static const struct bxt_ddi_buf_trans bxt_ddi_translations_hdmi[] = { > { 154, 0x9A, 1, 128, true }, /* 9: 1200 0 */ > }; > > -static void ddi_get_encoder_port(struct intel_encoder *intel_encoder, > +static bool ddi_get_encoder_port(struct intel_encoder *intel_encoder, > struct intel_digital_port **dig_port, > enum port *port) > { > @@ -228,9 +228,10 @@ static void ddi_get_encoder_port(struct intel_encoder *intel_encoder, > *dig_port = NULL; > *port = PORT_E; > } else { > - DRM_ERROR("Invalid DDI encoder type %d\n", type); > - BUG(); > + return false; > } > + > + return true; > } > > enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder) > @@ -238,7 +239,8 @@ enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder) > struct intel_digital_port *dig_port; > enum port port; > > - ddi_get_encoder_port(intel_encoder, &dig_port, &port); > + if (WARN_ON(!ddi_get_encoder_port(intel_encoder, &dig_port, &port))) > + return PORT_A; > > return port; > } > @@ -390,7 +392,8 @@ void intel_prepare_ddi(struct drm_device *dev) > enum port port; > bool supports_hdmi; > > - ddi_get_encoder_port(intel_encoder, &intel_dig_port, &port); > + if (!ddi_get_encoder_port(intel_encoder, &intel_dig_port, &port)) > + continue; > > if (visited[port]) > continue; > -- > 2.1.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@xxxxxxxxxxxxxxxxxxxxx > http://lists.freedesktop.org/mailman/listinfo/intel-gfx _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx