diff mbox

drm/i915: cleanup the CHICKEN_MISC_2 (re)definitions

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

Commit Message

Zanoni, Paulo R July 14, 2017, 5:52 p.m. UTC
* Don't define it twice.
* Define MSBs first, like the rest of i915_reg.h.
* Add CNL_ prefix to the bit that arrived in CNL.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h         | 8 +++-----
 drivers/gpu/drm/i915/intel_runtime_pm.c | 4 ++--
 2 files changed, 5 insertions(+), 7 deletions(-)

Comments

Rodrigo Vivi July 14, 2017, 6:17 p.m. UTC | #1
oh! I believe you had warned me about this beforehand but I forgot... sorry....

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

On Fri, Jul 14, 2017 at 10:52 AM, Paulo Zanoni <paulo.r.zanoni@intel.com> wrote:
> * Don't define it twice.
> * Define MSBs first, like the rest of i915_reg.h.
> * Add CNL_ prefix to the bit that arrived in CNL.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h         | 8 +++-----
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 4 ++--
>  2 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index c712d01..a16bf67 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -6703,12 +6703,10 @@ enum {
>  #define  KVM_CONFIG_CHANGE_NOTIFICATION_SELECT (1 << 14)
>
>  #define CHICKEN_MISC_2         _MMIO(0x42084)
> -#define  GLK_CL0_PWR_DOWN      (1 << 10)
> -#define  GLK_CL1_PWR_DOWN      (1 << 11)
> +#define  CNL_COMP_PWR_DOWN     (1 << 23)
>  #define  GLK_CL2_PWR_DOWN      (1 << 12)
> -
> -#define CHICKEN_MISC_2         _MMIO(0x42084)
> -#define  COMP_PWR_DOWN         (1 << 23)
> +#define  GLK_CL1_PWR_DOWN      (1 << 11)
> +#define  GLK_CL0_PWR_DOWN      (1 << 10)
>
>  #define _CHICKEN_PIPESL_1_A    0x420b0
>  #define _CHICKEN_PIPESL_1_B    0x420b4
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index f630d63..45bdcd0 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -2820,7 +2820,7 @@ static void cnl_display_core_init(struct drm_i915_private *dev_priv, bool resume
>
>         /* 2. Enable Comp */
>         val = I915_READ(CHICKEN_MISC_2);
> -       val &= ~COMP_PWR_DOWN;
> +       val &= ~CNL_COMP_PWR_DOWN;
>         I915_WRITE(CHICKEN_MISC_2, val);
>
>         val = I915_READ(CNL_PORT_COMP_DW3);
> @@ -2894,7 +2894,7 @@ static void cnl_display_core_uninit(struct drm_i915_private *dev_priv)
>
>         /* 5. Disable Comp */
>         val = I915_READ(CHICKEN_MISC_2);
> -       val |= COMP_PWR_DOWN;
> +       val |= CNL_COMP_PWR_DOWN;
>         I915_WRITE(CHICKEN_MISC_2, val);
>  }
>
> --
> 2.9.4
>
> _______________________________________________
> 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/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index c712d01..a16bf67 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -6703,12 +6703,10 @@  enum {
 #define  KVM_CONFIG_CHANGE_NOTIFICATION_SELECT	(1 << 14)
 
 #define CHICKEN_MISC_2		_MMIO(0x42084)
-#define  GLK_CL0_PWR_DOWN	(1 << 10)
-#define  GLK_CL1_PWR_DOWN	(1 << 11)
+#define  CNL_COMP_PWR_DOWN	(1 << 23)
 #define  GLK_CL2_PWR_DOWN	(1 << 12)
-
-#define CHICKEN_MISC_2		_MMIO(0x42084)
-#define  COMP_PWR_DOWN		(1 << 23)
+#define  GLK_CL1_PWR_DOWN	(1 << 11)
+#define  GLK_CL0_PWR_DOWN	(1 << 10)
 
 #define _CHICKEN_PIPESL_1_A	0x420b0
 #define _CHICKEN_PIPESL_1_B	0x420b4
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index f630d63..45bdcd0 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -2820,7 +2820,7 @@  static void cnl_display_core_init(struct drm_i915_private *dev_priv, bool resume
 
 	/* 2. Enable Comp */
 	val = I915_READ(CHICKEN_MISC_2);
-	val &= ~COMP_PWR_DOWN;
+	val &= ~CNL_COMP_PWR_DOWN;
 	I915_WRITE(CHICKEN_MISC_2, val);
 
 	val = I915_READ(CNL_PORT_COMP_DW3);
@@ -2894,7 +2894,7 @@  static void cnl_display_core_uninit(struct drm_i915_private *dev_priv)
 
 	/* 5. Disable Comp */
 	val = I915_READ(CHICKEN_MISC_2);
-	val |= COMP_PWR_DOWN;
+	val |= CNL_COMP_PWR_DOWN;
 	I915_WRITE(CHICKEN_MISC_2, val);
 }