Re: [PATCH 46/49] drm/i915: Iterate through the initialized DDIs to prepare their buffers

Imre Deak
2015-04-24T15:22:26Z

On Fri, 2015-04-24 at 15:47 +0300, Ander Conselvan De Oliveira wrote:
> On Tue, 2015-03-17 at 11:40 +0200, Imre Deak wrote:
> > From: Damien Lespiau <damien.lespiau@intel.com>
> >
> > Not every DDIs is necessarily connected can be strapped off and, in the
> > future, we'll have platforms with a different number of default DDI
> > ports. So, let's only call intel_prepare_ddi_buffers() on DDI ports that
> > are actually detected.
> >
> > We also use the opportunity to give a struct intel_digital_port to
> > intel_prepare_ddi_buffers() as we'll need it in a following patch to
> > query if the port supports HMDI or not.
> >
> > On my HSW machine this removes the initialization of a couple of
> > (unused) DDIs.
> >
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.h | 4 ++++
> > drivers/gpu/drm/i915/intel_ddi.c | 16 ++++++++++++----
> > 2 files changed, 16 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index e4dd4bba..e6402b0 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -251,6 +251,10 @@ enum hpd_pin {
> > &dev->mode_config.connector_list, \
> > base.head)
> >
> > +#define for_each_digital_port(dev, digital_port) \
> > + list_for_each_entry(digital_port, \
> > + &dev->mode_config.encoder_list, \
> > + base.base.head)
>
> This breaks HSW machines with CRTs. We can't just assume all the
> encoders are digital ports.

I posted a fix for this:
http://lists.freedesktop.org/archives/intel-gfx/2015-April/064993.html

--Imre