From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] drm/i915: fix short vs. long hpd detection Date: Wed, 15 Oct 2014 11:08:03 +0300 Message-ID: <20141015080803.GH4284@intel.com> References: <1412237792-15878-1-git-send-email-jani.nikula@intel.com> <20141002082658.GV12343@phenom.ffwll.local> <20141015074354.GG4284@intel.com> <878ukhu5wl.fsf@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A6226E157 for ; Wed, 15 Oct 2014 01:08:10 -0700 (PDT) Content-Disposition: inline In-Reply-To: <878ukhu5wl.fsf@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Jani Nikula Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Oct 15, 2014 at 10:51:54AM +0300, Jani Nikula wrote: > On Wed, 15 Oct 2014, Ville Syrj=E4l=E4 wr= ote: > > On Thu, Oct 02, 2014 at 10:26:58AM +0200, Daniel Vetter wrote: > >> On Thu, Oct 02, 2014 at 11:16:32AM +0300, Jani Nikula wrote: > >> > Fix short vs. long hpd detection for non-g4x and non-pch split > >> > platforms. > >> > = > >> > Broken since introduction in > >> > commit 13cf550448b58abf8f44f5d6a560f2d20871c965 > >> > Author: Dave Airlie > >> > Date: Wed Jun 18 11:29:35 2014 +1000 > >> > = > >> > drm/i915: rework digital port IRQ handling (v2) > >> > = > >> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3D83175 > >> > Signed-off-by: Jani Nikula > >> > --- > >> > drivers/gpu/drm/i915/i915_irq.c | 14 +++++++------- > >> > 1 file changed, 7 insertions(+), 7 deletions(-) > >> > = > >> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/= i915_irq.c > >> > index 72cb9397ecc5..3ff6f1bb594a 100644 > >> > --- a/drivers/gpu/drm/i915/i915_irq.c > >> > +++ b/drivers/gpu/drm/i915/i915_irq.c > >> > @@ -1708,7 +1708,7 @@ static irqreturn_t gen8_gt_irq_handler(struct = drm_device *dev, > >> > #define HPD_STORM_DETECT_PERIOD 1000 > >> > #define HPD_STORM_THRESHOLD 5 > >> > = > >> > -static int ilk_port_to_hotplug_shift(enum port port) > >> > +static int pch_port_to_hotplug_shift(enum port port) > >> > { > >> > switch (port) { > >> > case PORT_A: > >> > @@ -1724,7 +1724,7 @@ static int ilk_port_to_hotplug_shift(enum port= port) > >> > } > >> > } > >> > = > >> > -static int g4x_port_to_hotplug_shift(enum port port) > >> > +static int i915_port_to_hotplug_shift(enum port port) > >> > { > >> > switch (port) { > >> > case PORT_A: > >> > @@ -1782,12 +1782,12 @@ static inline void intel_hpd_irq_handler(str= uct drm_device *dev, > >> > if (port && dev_priv->hpd_irq_port[port]) { > >> > bool long_hpd; > >> > = > >> > - if (IS_G4X(dev)) { > >> > - dig_shift =3D g4x_port_to_hotplug_shift(port); > >> > - long_hpd =3D (hotplug_trigger >> dig_shift) & PORTB_HOTPLUG_LON= G_DETECT; > >> > - } else { > >> > - dig_shift =3D ilk_port_to_hotplug_shift(port); > >> > + if (HAS_PCH_SPLIT(dev)) { > >> > + dig_shift =3D pch_port_to_hotplug_shift(port); > >> > long_hpd =3D (dig_hotplug_reg >> dig_shift) & PORTB_HOTPLUG_LON= G_DETECT; > >> = > >> Using the new HAS_GMCH_DISPLAY will probably survive longer (i.e. skl). > > > > Did we have a concenses on this? I want hpd on my BSW. > = > Sorry, we agreed on IRC that the ifs were okay as-is, but we're still > missing review. Reviewed-by: Ville Syrj=E4l=E4 Although after checking the spec it does look like HAS_GMCH_DISPLAY might be a bit more future proof. > = > BR, > Jani. > = > = > = > = > > > >> -Daniel > >> = > >> > + } else { > >> > + dig_shift =3D i915_port_to_hotplug_shift(port); > >> > + long_hpd =3D (hotplug_trigger >> dig_shift) & PORTB_HOTPLUG_LON= G_DETECT; > >> > } > >> > = > >> > DRM_DEBUG_DRIVER("digital hpd port %c - %s\n", > >> > -- = > >> > 1.9.1 > >> > = > >> > _______________________________________________ > >> > Intel-gfx mailing list > >> > Intel-gfx@lists.freedesktop.org > >> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx > >> = > >> -- = > >> Daniel Vetter > >> Software Engineer, Intel Corporation > >> +41 (0) 79 365 57 48 - http://blog.ffwll.ch > >> _______________________________________________ > >> Intel-gfx mailing list > >> Intel-gfx@lists.freedesktop.org > >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > > > -- = > > Ville Syrj=E4l=E4 > > Intel OTC > = > -- = > Jani Nikula, Intel Open Source Technology Center -- = Ville Syrj=E4l=E4 Intel OTC