[Intel-gfx] [PATCH 3/7] drm/i915: Don't register HDMI connectors for eDP ports on VLV/CHV

Daniel Vetter daniel at ffwll.ch
Mon Jan 12 15:48:38 PST 2015


On Fri, Jan 09, 2015 at 05:02:40PM +0200, Jani Nikula wrote:
> On Fri, 09 Jan 2015, ville.syrjala at linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > If we determine that a specific port is eDP, don't register the HDMI
> > connector/encoder for it. The reason being that we want to disable
> > HPD interrupts for eDP ports when the display is off, but the presence
> > of the extra HDMI connector would demand the HPD interrupt to remain
> > enabled all the time.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index d1a4de8..2b1f220 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -12390,14 +12390,16 @@ static void intel_setup_outputs(struct drm_device *dev)
> >   * eDP ports. Consult the VBT as well as DP_DETECTED to
> >   * detect eDP ports.
> >   */
> > - if (I915_READ(VLV_DISPLAY_BASE + GEN4_HDMIB) & SDVO_DETECTED)
> > + if (I915_READ(VLV_DISPLAY_BASE + GEN4_HDMIB) & SDVO_DETECTED &&
> > +    !intel_dp_is_edp(dev, PORT_B))
> >   intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIB,
> >   PORT_B);
> >   if (I915_READ(VLV_DISPLAY_BASE + DP_B) & DP_DETECTED ||
> >      intel_dp_is_edp(dev, PORT_B))
> >   intel_dp_init(dev, VLV_DISPLAY_BASE + DP_B, PORT_B);
>
> I wonder if these would read better with
>
> if (intel_dp_is_edp(dev, PORT_B)) {
>         ...
>         } else {
> if (I915_READ(VLV_DISPLAY_BASE + GEN4_HDMIB) & SDVO_DETECTED)
> ...
> if (I915_READ(VLV_DISPLAY_BASE + DP_B) & DP_DETECTED)
> ...
> }
>
> Dunno. Either way,

Imo if we want to polish the turd here I think it might be beter to push
checks down into the various intel_<encoder>_init functions, and just have
the logic for deciding which ports a platform has at most here (and at
which reg offsets). Atm we have a crazy mix of checks both here and there.

> Reviewed-by: Jani Nikula <jani.nikula at intel.com>

Anyway, merged, thanks for patch and review.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the Intel-gfx mailing list