diff mbox

[20/33] drm/i915: VLV_ADPA must be used in VLV code

Message ID 1359034198-19678-21-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjala Jan. 24, 2013, 1:29 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

ADPA doesn't include the required offset, so don't use it in VLV
specific code. VLV_ADPA must be used instead.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_crt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Daniel Vetter Jan. 24, 2013, 10:12 p.m. UTC | #1
On Thu, Jan 24, 2013 at 03:29:45PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> ADPA doesn't include the required offset, so don't use it in VLV
> specific code. VLV_ADPA must be used instead.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_crt.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index 71a5eba..9fe3d67 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -305,12 +305,12 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
>  	bool ret;
>  	u32 save_adpa;
>  
> -	save_adpa = adpa = I915_READ(ADPA);
> +	save_adpa = adpa = I915_READ(VLV_ADPA);
>  	DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa);
>  
>  	adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER;
>  
> -	I915_WRITE(ADPA, adpa);
> +	I915_WRITE(VLV_ADPA, adpa);
>  
>  	if (wait_for((I915_READ(ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
>  		     1000)) {

A few are missing here ... I wonder whether we shouldn't just use
crt->adpa_reg instead? intel_ironlake_crt_detect_hotplug right above
suffers from the same by using PCH_ADPA.
-Daniel

> @@ -319,7 +319,7 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
>  	}
>  
>  	/* Check the status to see if both blue and green are on now */
> -	adpa = I915_READ(ADPA);
> +	adpa = I915_READ(VLV_ADPA);
>  	if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0)
>  		ret = true;
>  	else
> -- 
> 1.7.12.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjala Jan. 25, 2013, 11:59 a.m. UTC | #2
On Thu, Jan 24, 2013 at 11:12:10PM +0100, Daniel Vetter wrote:
> On Thu, Jan 24, 2013 at 03:29:45PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > ADPA doesn't include the required offset, so don't use it in VLV
> > specific code. VLV_ADPA must be used instead.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_crt.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> > index 71a5eba..9fe3d67 100644
> > --- a/drivers/gpu/drm/i915/intel_crt.c
> > +++ b/drivers/gpu/drm/i915/intel_crt.c
> > @@ -305,12 +305,12 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
> >  	bool ret;
> >  	u32 save_adpa;
> >  
> > -	save_adpa = adpa = I915_READ(ADPA);
> > +	save_adpa = adpa = I915_READ(VLV_ADPA);
> >  	DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa);
> >  
> >  	adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER;
> >  
> > -	I915_WRITE(ADPA, adpa);
> > +	I915_WRITE(VLV_ADPA, adpa);
> >  
> >  	if (wait_for((I915_READ(ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
> >  		     1000)) {
> 
> A few are missing here ... I wonder whether we shouldn't just use
> crt->adpa_reg instead? intel_ironlake_crt_detect_hotplug right above
> suffers from the same by using PCH_ADPA.

Dang. I'll make a patch to use apda_reg always.

> -Daniel
> 
> > @@ -319,7 +319,7 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
> >  	}
> >  
> >  	/* Check the status to see if both blue and green are on now */
> > -	adpa = I915_READ(ADPA);
> > +	adpa = I915_READ(VLV_ADPA);
> >  	if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0)
> >  		ret = true;
> >  	else
> > -- 
> > 1.7.12.4
> > 
> > _______________________________________________
> > 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
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 71a5eba..9fe3d67 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -305,12 +305,12 @@  static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
 	bool ret;
 	u32 save_adpa;
 
-	save_adpa = adpa = I915_READ(ADPA);
+	save_adpa = adpa = I915_READ(VLV_ADPA);
 	DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa);
 
 	adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER;
 
-	I915_WRITE(ADPA, adpa);
+	I915_WRITE(VLV_ADPA, adpa);
 
 	if (wait_for((I915_READ(ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
 		     1000)) {
@@ -319,7 +319,7 @@  static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
 	}
 
 	/* Check the status to see if both blue and green are on now */
-	adpa = I915_READ(ADPA);
+	adpa = I915_READ(VLV_ADPA);
 	if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0)
 		ret = true;
 	else