diff mbox

[v2,4/8] drm/i915: use IS_HASWELL/BROADWELL instead of HAS_POWER_WELL

Message ID 1384434643-3118-1-git-send-email-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Imre Deak Nov. 14, 2013, 1:10 p.m. UTC
In intel_display_capture_error_state we use HAS_POWER_WELL to check if
we are running on Haswell/Broadwell when accessing HSW_PWR_WELL_DRIVER
which is specific to these platforms. Future platforms with power wells
don't have this register, so HAS_POWER_WELL won't work there any more.
Use IS_HASWELL/IS_BROADWELL instead.

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

Comments

Paulo Zanoni Nov. 22, 2013, 3:41 p.m. UTC | #1
2013/11/14 Imre Deak <imre.deak@intel.com>:
> In intel_display_capture_error_state we use HAS_POWER_WELL to check if
> we are running on Haswell/Broadwell when accessing HSW_PWR_WELL_DRIVER
> which is specific to these platforms. Future platforms with power wells
> don't have this register, so HAS_POWER_WELL won't work there any more.
> Use IS_HASWELL/IS_BROADWELL instead.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2df2366..bb5e4e9 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11370,7 +11370,7 @@ intel_display_capture_error_state(struct drm_device *dev)
>         if (error == NULL)
>                 return NULL;
>
> -       if (HAS_POWER_WELL(dev))
> +       if (IS_HASWELL(dev) || IS_BROADWELL(dev))
>                 error->power_well_driver = I915_READ(HSW_PWR_WELL_DRIVER);
>
>         for_each_pipe(i) {
> @@ -11441,7 +11441,7 @@ intel_display_print_error_state(struct drm_i915_error_state_buf *m,
>                 return;
>
>         err_printf(m, "Num Pipes: %d\n", INTEL_INFO(dev)->num_pipes);
> -       if (HAS_POWER_WELL(dev))
> +       if (IS_HASWELL(dev) | IS_BROADWELL(dev))

Please use the logical OR, instead of the bit operation.

Thanks,
Paulo

>                 err_printf(m, "PWR_WELL_CTL2: %08x\n",
>                            error->power_well_driver);
>         for_each_pipe(i) {
> --
> 1.8.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Imre Deak Nov. 22, 2013, 6:42 p.m. UTC | #2
On Fri, 2013-11-22 at 13:41 -0200, Paulo Zanoni wrote:
> 2013/11/14 Imre Deak <imre.deak@intel.com>:
> > In intel_display_capture_error_state we use HAS_POWER_WELL to check if
> > we are running on Haswell/Broadwell when accessing HSW_PWR_WELL_DRIVER
> > which is specific to these platforms. Future platforms with power wells
> > don't have this register, so HAS_POWER_WELL won't work there any more.
> > Use IS_HASWELL/IS_BROADWELL instead.
> >
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 2df2366..bb5e4e9 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -11370,7 +11370,7 @@ intel_display_capture_error_state(struct drm_device *dev)
> >         if (error == NULL)
> >                 return NULL;
> >
> > -       if (HAS_POWER_WELL(dev))
> > +       if (IS_HASWELL(dev) || IS_BROADWELL(dev))
> >                 error->power_well_driver = I915_READ(HSW_PWR_WELL_DRIVER);
> >
> >         for_each_pipe(i) {
> > @@ -11441,7 +11441,7 @@ intel_display_print_error_state(struct drm_i915_error_state_buf *m,
> >                 return;
> >
> >         err_printf(m, "Num Pipes: %d\n", INTEL_INFO(dev)->num_pipes);
> > -       if (HAS_POWER_WELL(dev))
> > +       if (IS_HASWELL(dev) | IS_BROADWELL(dev))
> 
> Please use the logical OR, instead of the bit operation.

Good catch, it was a typo.

--Imre
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2df2366..bb5e4e9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11370,7 +11370,7 @@  intel_display_capture_error_state(struct drm_device *dev)
 	if (error == NULL)
 		return NULL;
 
-	if (HAS_POWER_WELL(dev))
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev))
 		error->power_well_driver = I915_READ(HSW_PWR_WELL_DRIVER);
 
 	for_each_pipe(i) {
@@ -11441,7 +11441,7 @@  intel_display_print_error_state(struct drm_i915_error_state_buf *m,
 		return;
 
 	err_printf(m, "Num Pipes: %d\n", INTEL_INFO(dev)->num_pipes);
-	if (HAS_POWER_WELL(dev))
+	if (IS_HASWELL(dev) | IS_BROADWELL(dev))
 		err_printf(m, "PWR_WELL_CTL2: %08x\n",
 			   error->power_well_driver);
 	for_each_pipe(i) {