From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH 11/14] drm/i915: Be more careful when picking the initial power sequencer pipe Date: Tue, 02 Sep 2014 16:52:53 +0300 Message-ID: <1409665973.15662.14.camel@intelbox> References: <1408389369-22898-1-git-send-email-ville.syrjala@linux.intel.com> <1408389369-22898-12-git-send-email-ville.syrjala@linux.intel.com> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0667427369==" Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 643BF89105 for ; Tue, 2 Sep 2014 06:52:56 -0700 (PDT) In-Reply-To: <1408389369-22898-12-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0667427369== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-ZZyfC5I3BACAvDZpKwNM" --=-ZZyfC5I3BACAvDZpKwNM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2014-08-18 at 22:16 +0300, ville.syrjala@linux.intel.com wrote: > From: Ville Syrj=C3=A4l=C3=A4 >=20 > Try to make sure we find the power sequencer that the BIOS used > by first looking for one which has the panel power enabled, then > fall back to one with VDD force bit enabled, and finally look at > just the port select bits. This should make us pick the correct > power sequencer when the BIOS has already enabled the panel. >=20 > Signed-off-by: Ville Syrj=C3=A4l=C3=A4 Reviewed-by: Imre Deak > --- > drivers/gpu/drm/i915/intel_dp.c | 36 ++++++++++++++++++++++++++++++++++-= - > 1 file changed, 34 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel= _dp.c > index 4614e6e..4952783 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -341,9 +341,31 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp) > return intel_dp->pps_pipe; > } > =20 > +typedef bool (*vlv_pipe_check)(struct drm_i915_private *dev_priv, > + enum pipe pipe); > + > +static bool vlv_pipe_has_pp_on(struct drm_i915_private *dev_priv, > + enum pipe pipe) > +{ > + return I915_READ(VLV_PIPE_PP_STATUS(pipe)) & PP_ON; > +} > + > +static bool vlv_pipe_has_vdd_on(struct drm_i915_private *dev_priv, > + enum pipe pipe) > +{ > + return I915_READ(VLV_PIPE_PP_CONTROL(pipe)) & EDP_FORCE_VDD; > +} > + > +static bool vlv_pipe_any(struct drm_i915_private *dev_priv, > + enum pipe pipe) > +{ > + return true; > +} > + > static enum pipe > vlv_initial_power_sequencer_pipe(struct drm_i915_private *dev_priv, > - enum port port) > + enum port port, > + vlv_pipe_check pipe_check) > { > enum pipe pipe; > =20 > @@ -354,6 +376,9 @@ vlv_initial_power_sequencer_pipe(struct drm_i915_priv= ate *dev_priv, > if (port_sel !=3D PANEL_PORT_SELECT_VLV(port)) > continue; > =20 > + if (!pipe_check(dev_priv, pipe)) > + continue; > + > return pipe; > } > =20 > @@ -372,7 +397,14 @@ vlv_initial_power_sequencer_setup(struct intel_dp *i= ntel_dp) > lockdep_assert_held(&dev_priv->pps_mutex); > =20 > /* try to find a pipe with this port selected */ > - intel_dp->pps_pipe =3D vlv_initial_power_sequencer_pipe(dev_priv, port)= ; > + /* first pick one where the panel is on */ > + intel_dp->pps_pipe =3D vlv_initial_power_sequencer_pipe(dev_priv, port,= vlv_pipe_has_pp_on); > + /* didn't find one? pick one where vdd is on */ > + if (intel_dp->pps_pipe =3D=3D INVALID_PIPE) > + intel_dp->pps_pipe =3D vlv_initial_power_sequencer_pipe(dev_priv, port= , vlv_pipe_has_vdd_on); > + /* didn't find one? pick one with just the correct port */ > + if (intel_dp->pps_pipe =3D=3D INVALID_PIPE) > + intel_dp->pps_pipe =3D vlv_initial_power_sequencer_pipe(dev_priv, port= , vlv_pipe_any); > =20 > /* didn't find one? just let vlv_power_sequencer_pipe() pick one when n= eeded */ > if (intel_dp->pps_pipe =3D=3D INVALID_PIPE) { --=-ZZyfC5I3BACAvDZpKwNM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAABAgAGBQJUBcu1AAoJEORIIAnNuWDFsB8IAKtvaLwPdPzQfgStHwdDGXlg L4oJIk49L/kwA/0mf6xSxfKfQqVLM2Xuv+/2/0aMEGSBsY+XuzQS99yGNICo7KsD 6euNIXyuP8Rd4UKx7+5+LvhKSBzoUeLEnEl8MhPiT3wHvEkx9clYfkOVre0am0FK MK3m0mUdP2Nl46Cd4rOHOwI/Cs2p6aZP00CeueGNlO07dI/JMW/V4mR9EtQ2ygJW Ls5MMcYM8J7Av2hAfx+dpzLw/MBVUE0Uu1Fr8NuX4NfqUPNu/XY89qy+F/MxZb4e hajnUBvZvhnJGb8HDVdjD9HC6bw/TAiETTZAxcCCCtEO4UAAGyUgSGOxv6Z7390= =/Zdm -----END PGP SIGNATURE----- --=-ZZyfC5I3BACAvDZpKwNM-- --===============0667427369== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0667427369==--