diff mbox

drm/i915/cnl: don't hardcode DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT

Message ID 20170825194004.26571-1-paulo.r.zanoni@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zanoni, Paulo R Aug. 25, 2017, 7:40 p.m. UTC
We have the macro, use it. Makes the code a little easier to
understand.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rodrigo Vivi Aug. 25, 2017, 7:51 p.m. UTC | #1
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

On Fri, Aug 25, 2017 at 12:40 PM, Paulo Zanoni <paulo.r.zanoni@intel.com> wrote:
> We have the macro, use it. Makes the code a little easier to
> understand.
>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 6bfd0de..868d65c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9022,7 +9022,7 @@ static void cannonlake_get_ddi_pll(struct drm_i915_private *dev_priv,
>         u32 temp;
>
>         temp = I915_READ(DPCLKA_CFGCR0) & DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port);
> -       id = temp >> (port * 2);
> +       id = temp >> DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port);
>
>         if (WARN_ON(id < SKL_DPLL0 || id > SKL_DPLL2))
>                 return;
> --
> 2.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Zanoni, Paulo R Aug. 26, 2017, 12:49 a.m. UTC | #2
Em Sex, 2017-08-25 às 12:51 -0700, Rodrigo Vivi escreveu:
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Merged. Thanks for the review!

> 
> On Fri, Aug 25, 2017 at 12:40 PM, Paulo Zanoni <paulo.r.zanoni@intel.
> com> wrote:
> > We have the macro, use it. Makes the code a little easier to
> > understand.
> > 
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > b/drivers/gpu/drm/i915/intel_display.c
> > index 6bfd0de..868d65c 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -9022,7 +9022,7 @@ static void cannonlake_get_ddi_pll(struct
> > drm_i915_private *dev_priv,
> >         u32 temp;
> > 
> >         temp = I915_READ(DPCLKA_CFGCR0) &
> > DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port);
> > -       id = temp >> (port * 2);
> > +       id = temp >> DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port);
> > 
> >         if (WARN_ON(id < SKL_DPLL0 || id > SKL_DPLL2))
> >                 return;
> > --
> > 2.9.5
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> 
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6bfd0de..868d65c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9022,7 +9022,7 @@  static void cannonlake_get_ddi_pll(struct drm_i915_private *dev_priv,
 	u32 temp;
 
 	temp = I915_READ(DPCLKA_CFGCR0) & DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port);
-	id = temp >> (port * 2);
+	id = temp >> DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port);
 
 	if (WARN_ON(id < SKL_DPLL0 || id > SKL_DPLL2))
 		return;