diff mbox

[v2,5/7] drm/i915: stop using is_pch_edp() in is_cpu_edp()

Message ID 1368008048-19164-6-git-send-email-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Imre Deak May 8, 2013, 10:14 a.m. UTC
is_pch_edp() will be removed by the next patch, so replace it by a check
for the port and device type.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

Comments

Daniel Vetter May 10, 2013, 8:49 a.m. UTC | #1
On Wed, May 08, 2013 at 01:14:06PM +0300, Imre Deak wrote:
> is_pch_edp() will be removed by the next patch, so replace it by a check
> for the port and device type.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c |   17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 42c11dd..38b9cd2 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -65,6 +65,13 @@ static bool is_pch_edp(struct intel_dp *intel_dp)
>  	return intel_dp->is_pch_edp;
>  }
>  
> +static struct drm_device *intel_dp_to_dev(struct intel_dp *intel_dp)
> +{
> +	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> +
> +	return intel_dig_port->base.base.dev;
> +}
> +
>  /**
>   * is_cpu_edp - is the port on the CPU and attached to an eDP panel?
>   * @intel_dp: DP struct
> @@ -73,14 +80,12 @@ static bool is_pch_edp(struct intel_dp *intel_dp)
>   */
>  static bool is_cpu_edp(struct intel_dp *intel_dp)
>  {
> -	return is_edp(intel_dp) && !is_pch_edp(intel_dp);
> -}
> -
> -static struct drm_device *intel_dp_to_dev(struct intel_dp *intel_dp)
> -{
> +	struct drm_device *dev = intel_dp_to_dev(intel_dp);
>  	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> +	enum port port = intel_dig_port->port;
>  
> -	return intel_dig_port->base.base.dev;
> +	return is_edp(intel_dp) &&
> +		(port == PORT_A || (port == PORT_C && IS_VALLEYVIEW(dev)));

Valleyview is a giant mess here, I guess we should split the vlv case
from the pch_split cpu edp case. Maybe just check for port A in relevant
cases and factor out vlv cases completely.

My bet is that this massive confusion is the reason that vlv dp (i.e.
non-edp) is totally broken atm.
-Daniel
Imre Deak May 10, 2013, 8:52 a.m. UTC | #2
On Fri, 2013-05-10 at 10:49 +0200, Daniel Vetter wrote:
> On Wed, May 08, 2013 at 01:14:06PM +0300, Imre Deak wrote:
> > is_pch_edp() will be removed by the next patch, so replace it by a check
> > for the port and device type.
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dp.c |   17 +++++++++++------
> >  1 file changed, 11 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > index 42c11dd..38b9cd2 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -65,6 +65,13 @@ static bool is_pch_edp(struct intel_dp *intel_dp)
> >  	return intel_dp->is_pch_edp;
> >  }
> >  
> > +static struct drm_device *intel_dp_to_dev(struct intel_dp *intel_dp)
> > +{
> > +	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> > +
> > +	return intel_dig_port->base.base.dev;
> > +}
> > +
> >  /**
> >   * is_cpu_edp - is the port on the CPU and attached to an eDP panel?
> >   * @intel_dp: DP struct
> > @@ -73,14 +80,12 @@ static bool is_pch_edp(struct intel_dp *intel_dp)
> >   */
> >  static bool is_cpu_edp(struct intel_dp *intel_dp)
> >  {
> > -	return is_edp(intel_dp) && !is_pch_edp(intel_dp);
> > -}
> > -
> > -static struct drm_device *intel_dp_to_dev(struct intel_dp *intel_dp)
> > -{
> > +	struct drm_device *dev = intel_dp_to_dev(intel_dp);
> >  	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> > +	enum port port = intel_dig_port->port;
> >  
> > -	return intel_dig_port->base.base.dev;
> > +	return is_edp(intel_dp) &&
> > +		(port == PORT_A || (port == PORT_C && IS_VALLEYVIEW(dev)));
> 
> Valleyview is a giant mess here, I guess we should split the vlv case
> from the pch_split cpu edp case. Maybe just check for port A in relevant
> cases and factor out vlv cases completely.
> 
> My bet is that this massive confusion is the reason that vlv dp (i.e.
> non-edp) is totally broken atm.

Could we do that as a follow-up to this? That work would have also the
benefit of removing is_cpu_edp() as you hoped earlier, so it could stand
on its own..

--Imre
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 42c11dd..38b9cd2 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -65,6 +65,13 @@  static bool is_pch_edp(struct intel_dp *intel_dp)
 	return intel_dp->is_pch_edp;
 }
 
+static struct drm_device *intel_dp_to_dev(struct intel_dp *intel_dp)
+{
+	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+
+	return intel_dig_port->base.base.dev;
+}
+
 /**
  * is_cpu_edp - is the port on the CPU and attached to an eDP panel?
  * @intel_dp: DP struct
@@ -73,14 +80,12 @@  static bool is_pch_edp(struct intel_dp *intel_dp)
  */
 static bool is_cpu_edp(struct intel_dp *intel_dp)
 {
-	return is_edp(intel_dp) && !is_pch_edp(intel_dp);
-}
-
-static struct drm_device *intel_dp_to_dev(struct intel_dp *intel_dp)
-{
+	struct drm_device *dev = intel_dp_to_dev(intel_dp);
 	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+	enum port port = intel_dig_port->port;
 
-	return intel_dig_port->base.base.dev;
+	return is_edp(intel_dp) &&
+		(port == PORT_A || (port == PORT_C && IS_VALLEYVIEW(dev)));
 }
 
 static struct intel_dp *intel_attached_dp(struct drm_connector *connector)