[Intel-gfx] [PATCH] drm/i915/bxt: fix intel_prepare_ddi for DSI ports
Daniel Vetter
daniel at ffwll.ch
Mon Jun 22 07:45:59 PDT 2015
On Mon, Jun 22, 2015 at 02:34:14PM +0100, Damien Lespiau wrote:
> 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 at intel.com>
>
> I think we could do with a better port abstraction as a whole, right now
> that's all a bit messy. But anyway:
I did ask for that for the bxt dsi enabling stuff. Punting on this one
until we have the complete picture there.
-Daniel
>
> Reviewed-by: Damien Lespiau <damien.lespiau at intel.com>
>
> > ---
> > 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 at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list