Skip to contentSkip to conversation

Revert "drm/i915/chv: Set min freq to efficient frequency on chv"

PATCH Superseded [email protected] 6 participants 17 messages Aug 12, 2016 – Feb 14, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "drm/i915/chv: Set min freq to efficient frequency on chv"

From: Deepak S <[email protected]>

With latest Punit FW, vgg input voltag drop falling to minimum is fixed. So reverting the WA patch & moving to turbo freq opreation range to [RPn -> RP0]

This reverts commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44.

commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44

Author: Deepak S <[email protected]>
Date:   Sat May 9 18:15:46 2015 +0530

drm/i915/chv: Set min freq to efficient frequency on chv

---
 drivers/gpu/drm/i915/intel_pm.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +19 -2
index 81ab119..e59799a 100644
@@ -5579,6 +5579,24 @@ static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
 	return rp1;
 }
 
+static int cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
+{
+	struct drm_device *dev = &dev_priv->drm;
+	u32 val, rpn;
+
+	if (dev->pdev->revision >= 0x20) {
+		val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
+		rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
+		       FB_GFX_FREQ_FUSE_MASK);
+	} else { /* For pre-production hardware */
+		val = vlv_punit_read(dev_priv, PUNIT_GPU_STATUS_REG);
+		rpn = ((val >> PUNIT_GPU_STATIS_GFX_MIN_FREQ_SHIFT) &
+		       PUNIT_GPU_STATUS_GFX_MIN_FREQ_MASK);
+	}
+
+	return rpn;
+}
+
 static int valleyview_rps_guar_freq(struct drm_i915_private *dev_priv)
 {
 	u32 val, rp1;
@@ -5818,8 +5836,7 @@ static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv)
 			 intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq),
 			 dev_priv->rps.rp1_freq);
 
-	/* PUnit validated range is only [RPe, RP0] */
-	dev_priv->rps.min_freq = dev_priv->rps.efficient_freq;
+	dev_priv->rps.min_freq = cherryview_rps_min_freq(dev_priv);
 	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
 			 intel_gpu_freq(dev_priv, dev_priv->rps.min_freq),
 			 dev_priv->rps.min_freq);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Acked-by on v1 1/1
#1 lore raw
Quoted 23 lines · On Fri, Aug 12, 2016 at 02:20:34PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

With latest Punit FW, vgg input voltag drop falling to minimum is fixed. So reverting the WA patch & moving to turbo freq opreation range to [RPn -> RP0]

This reverts commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44.

commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44

Author: Deepak S <[email protected]>
Date:   Sat May 9 18:15:46 2015 +0530

drm/i915/chv: Set min freq to efficient frequency on chv

---
 drivers/gpu/drm/i915/intel_pm.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 81ab119..e59799a 100644

drivers/gpu/drm/i915/intel_pm.c static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv) · line 5582

Quoted 4 lines
drivers/gpu/drm/i915/intel_pm.c +1 -0
@@ -5579,6 +5579,24 @@ static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
 	return rp1;
 }
 
+static int cherryview_rps_min_freq(struct drm_i915_private *dev_priv)

Return int, but compute a u32? Just inconsistent.

drivers/gpu/drm/i915/intel_pm.c static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv) · line 5584

Quoted 2 lines
drivers/gpu/drm/i915/intel_pm.c +2 -0
+{
+	struct drm_device *dev = &dev_priv->drm;

struct pci_device *pdev = dev_priv->drm.pdev;

drivers/gpu/drm/i915/intel_pm.c static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv) · line 5591

Quoted 7 lines
drivers/gpu/drm/i915/intel_pm.c +7 -0
+	u32 val, rpn;
+
+	if (dev->pdev->revision >= 0x20) {
+		val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
+		rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
+		       FB_GFX_FREQ_FUSE_MASK);
+	} else { /* For pre-production hardware */
	} else { /* For pre-production hardware use RPe instead */

drivers/gpu/drm/i915/intel_pm.c static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv) · line 5595

Quoted 4 lines
drivers/gpu/drm/i915/intel_pm.c +4 -0
+		val = vlv_punit_read(dev_priv, PUNIT_GPU_STATUS_REG);
+		rpn = ((val >> PUNIT_GPU_STATIS_GFX_MIN_FREQ_SHIFT) &
+		       PUNIT_GPU_STATUS_GFX_MIN_FREQ_MASK);
+	}

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v2 1/1 Revert "drm/i915/chv: Set min freq to efficient frequency on chv"

From: Deepak S <[email protected]>

With latest Punit FW, vgg input voltag drop falling to minimum is fixed. So reverting the WA patch & moving to turbo freq opreation range to [RPn -> RP0]

This reverts commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44.

commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44

Author: Deepak S <[email protected]>
Date:   Sat May 9 18:15:46 2015 +0530

drm/i915/chv: Set min freq to efficient frequency on chv

v2: Fix inconsistent return type. (Chris)

---
 drivers/gpu/drm/i915/intel_pm.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +19 -2
index 81ab119..7844bf5 100644
@@ -5579,6 +5579,24 @@ static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
 	return rp1;
 }
 
+static u32 cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
+{
+	struct pci_device *pdev = dev_priv->drm.pdev;
+	u32 val, rpn;
+
+	if (pdev->revision >= 0x20) {
+		val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
+		rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
+		       FB_GFX_FREQ_FUSE_MASK);
+	} else { /* For pre-production hardware */
+		val = vlv_punit_read(dev_priv, PUNIT_GPU_STATUS_REG);
+		rpn = ((val >> PUNIT_GPU_STATIS_GFX_MIN_FREQ_SHIFT) &
+		       PUNIT_GPU_STATUS_GFX_MIN_FREQ_MASK);
+	}
+
+	return rpn;
+}
+
 static int valleyview_rps_guar_freq(struct drm_i915_private *dev_priv)
 {
 	u32 val, rp1;
@@ -5818,8 +5836,7 @@ static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv)
 			 intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq),
 			 dev_priv->rps.rp1_freq);
 
-	/* PUnit validated range is only [RPe, RP0] */
-	dev_priv->rps.min_freq = dev_priv->rps.efficient_freq;
+	dev_priv->rps.min_freq = cherryview_rps_min_freq(dev_priv);
 	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
 			 intel_gpu_freq(dev_priv, dev_priv->rps.min_freq),
 			 dev_priv->rps.min_freq);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
reproduce:

Hi Deepak,

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v4.8-rc1 next-20160811]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/deepak-s-linux-intel-com/Revert-drm-i915-chv-Set-min-freq-to-efficient-frequency-on-chv/20160812-135320
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-x012-201632 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

drivers/gpu/drm/i915/intel_pm.c: In function 'cherryview_rps_min_freq':

>> drivers/gpu/drm/i915/intel_pm.c:5610:28: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     struct pci_device *pdev = dev_priv->drm.pdev;
                               ^~~~~~~~
>> drivers/gpu/drm/i915/intel_pm.c:5613:10: error: dereferencing pointer to incomplete type 'struct pci_device'
     if (pdev->revision >= 0x20) {
             ^~

cc1: some warnings being treated as errors

vim +5610 drivers/gpu/drm/i915/intel_pm.c

5604
5605 return rp1;
5606 }
5607
5608 static u32 cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
5609 {

> 5610		struct pci_device *pdev = dev_priv->drm.pdev;
  5611		u32 val, rpn;
  5612	
> 5613		if (pdev->revision >= 0x20) {

5614 val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
5615 rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
5616 FB_GFX_FREQ_FUSE_MASK);

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 14 lines · kbuild test robot

Hi Deepak,

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v4.8-rc1 next-20160811]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/deepak-s-linux-intel-com/Revert-drm-i915-chv-Set-min-freq-to-efficient-frequency-on-chv/20160812-135320
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-x012-201632 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 
Quoted 5 lines

All errors (new ones prefixed by >>):

drivers/gpu/drm/i915/intel_pm.c: In function 'cherryview_rps_min_freq':

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_pm.c:5610:28: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]

     struct pci_device *pdev = dev_priv->drm.pdev;

My bad, it's struct pci_dev.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#5 lore raw
Quoted 15 lines · Chris Wilson
Quoted 14 lines · kbuild test robot

Hi Deepak,

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v4.8-rc1 next-20160811]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/deepak-s-linux-intel-com/Revert-drm-i915-chv-Set-min-freq-to-efficient-frequency-on-chv/20160812-135320
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-x012-201632 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
         # save the attached .config to linux build tree
         make ARCH=x86_64
Quoted 7 lines
Quoted 5 lines

All errors (new ones prefixed by >>):

drivers/gpu/drm/i915/intel_pm.c: In function 'cherryview_rps_min_freq':

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_pm.c:5610:28: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]

      struct pci_device *pdev = dev_priv->drm.pdev;

My bad, it's struct pci_dev.
-Chris

Oops sorry. I made the changes and tested the code. But forgot to amend and send it :( Let me re-send the code.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw
In reply to [email protected]
reproduce:

Hi Deepak,

[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on v4.8-rc1 next-20160811]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/deepak-s-linux-intel-com/Revert-drm-i915-chv-Set-min-freq-to-efficient-frequency-on-chv/20160812-135320
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-x019-201632 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

drivers/gpu/drm/i915/intel_pm.c: In function 'cherryview_rps_min_freq':
drivers/gpu/drm/i915/intel_pm.c:5610:28: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]

     struct pci_device *pdev = dev_priv->drm.pdev;
                               ^~~~~~~~
   In file included from include/linux/err.h:4:0,
                    from include/linux/clk.h:15,
                    from include/linux/cpufreq.h:14,
                    from drivers/gpu/drm/i915/intel_pm.c:28:
   drivers/gpu/drm/i915/intel_pm.c:5613:10: error: dereferencing pointer to incomplete type 'struct pci_device'
     if (pdev->revision >= 0x20) {
             ^
   include/linux/compiler.h:151:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
>> drivers/gpu/drm/i915/intel_pm.c:5613:2: note: in expansion of macro 'if'
     if (pdev->revision >= 0x20) {
     ^~

cc1: some warnings being treated as errors

vim +/if +5613 drivers/gpu/drm/i915/intel_pm.c

5597
5598 static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
5599 {
5600 u32 val, rp1;
5601
5602 val = vlv_punit_read(dev_priv, FB_GFX_FMAX_AT_VMAX_FUSE);
5603 rp1 = (val & FB_GFX_FREQ_FUSE_MASK);
5604
5605 return rp1;
5606 }
5607
5608 static u32 cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
5609 {
5610 struct pci_device *pdev = dev_priv->drm.pdev;
5611 u32 val, rpn;
5612

> 5613		if (pdev->revision >= 0x20) {

5614 val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
5615 rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
5616 FB_GFX_FREQ_FUSE_MASK);
5617 } else { /* For pre-production hardware */
5618 val = vlv_punit_read(dev_priv, PUNIT_GPU_STATUS_REG);
5619 rpn = ((val >> PUNIT_GPU_STATIS_GFX_MIN_FREQ_SHIFT) &
5620 PUNIT_GPU_STATUS_GFX_MIN_FREQ_MASK);
5621 }

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw
In reply to [email protected]
Quoted 32 lines · On Fri, Aug 12, 2016 at 04:52:15PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

With latest Punit FW, vgg input voltag drop falling to minimum is fixed. So reverting the WA patch & moving to turbo freq opreation range to [RPn -> RP0]

This reverts commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44.

commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44

Author: Deepak S <[email protected]>
Date:   Sat May 9 18:15:46 2015 +0530

drm/i915/chv: Set min freq to efficient frequency on chv

v2: Fix inconsistent return type. (Chris)

---
 drivers/gpu/drm/i915/intel_pm.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +3 -0
index 81ab119..7844bf5 100644
@@ -5579,6 +5579,24 @@ static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
 	return rp1;
 }
 
+static u32 cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
+{
+	struct pci_device *pdev = dev_priv->drm.pdev;

drivers/gpu/drm/i915/intel_pm.c static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv) · line 5594

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +10 -0
+	u32 val, rpn;
+
+	if (pdev->revision >= 0x20) {
+		val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
+		rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
+		       FB_GFX_FREQ_FUSE_MASK);
+	} else { /* For pre-production hardware */
+		val = vlv_punit_read(dev_priv, PUNIT_GPU_STATUS_REG);
+		rpn = ((val >> PUNIT_GPU_STATIS_GFX_MIN_FREQ_SHIFT) &
+		       PUNIT_GPU_STATUS_GFX_MIN_FREQ_MASK);

Please drop the pre-production hw case. We got rid of all pre-production junk long ago.

Quoted 20 lines
drivers/gpu/drm/i915/intel_pm.c +6 -2
+	}
+
+	return rpn;
+}
+
 static int valleyview_rps_guar_freq(struct drm_i915_private *dev_priv)
 {
 	u32 val, rp1;
@@ -5818,8 +5836,7 @@ static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv)
 			 intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq),
 			 dev_priv->rps.rp1_freq);
 
-	/* PUnit validated range is only [RPe, RP0] */
-	dev_priv->rps.min_freq = dev_priv->rps.efficient_freq;
+	dev_priv->rps.min_freq = cherryview_rps_min_freq(dev_priv);
 	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
 			 intel_gpu_freq(dev_priv, dev_priv->rps.min_freq),
 			 dev_priv->rps.min_freq);
Signature · 1 line
1.9.1
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw
Quoted 30 lines · Ville Syrjälä
Quoted 29 lines · On Fri, Aug 12, 2016 at 04:52:15PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

With latest Punit FW, vgg input voltag drop falling to minimum is fixed. So reverting the WA patch & moving to turbo freq opreation range to [RPn -> RP0]

This reverts commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44.

commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44

Author: Deepak S <[email protected]>
Date:   Sat May 9 18:15:46 2015 +0530

drm/i915/chv: Set min freq to efficient frequency on chv

v2: Fix inconsistent return type. (Chris)

---
 drivers/gpu/drm/i915/intel_pm.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 81ab119..7844bf5 100644
@@ -5579,6 +5579,24 @@ static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
 	return rp1;
 }
 
Quoted 16 lines

drivers/gpu/drm/i915/intel_pm.c static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv) · line 5594

Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +13 -0
+static u32 cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
+{
+	struct pci_device *pdev = dev_priv->drm.pdev;
+	u32 val, rpn;
+
+	if (pdev->revision >= 0x20) {
+		val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
+		rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
+		       FB_GFX_FREQ_FUSE_MASK);
+	} else { /* For pre-production hardware */
+		val = vlv_punit_read(dev_priv, PUNIT_GPU_STATUS_REG);
+		rpn = ((val >> PUNIT_GPU_STATIS_GFX_MIN_FREQ_SHIFT) &
+		       PUNIT_GPU_STATUS_GFX_MIN_FREQ_MASK);

Please drop the pre-production hw case. We got rid of all pre-production junk long ago.

Oh and maybe add a note to the commit message explaining why it's not a 1:1 revert. You can refer to commit 5b5929cbe3f7 ("drm/i915/chv: remove pre-production hardware workarounds") as the reason for the discrepancy.

Quoted 25 lines
Quoted 21 lines
drivers/gpu/drm/i915/intel_pm.c +6 -2
+	}
+
+	return rpn;
+}
+
 static int valleyview_rps_guar_freq(struct drm_i915_private *dev_priv)
 {
 	u32 val, rp1;
@@ -5818,8 +5836,7 @@ static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv)
 			 intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq),
 			 dev_priv->rps.rp1_freq);
 
-	/* PUnit validated range is only [RPe, RP0] */
-	dev_priv->rps.min_freq = dev_priv->rps.efficient_freq;
+	dev_priv->rps.min_freq = cherryview_rps_min_freq(dev_priv);
 	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
 			 intel_gpu_freq(dev_priv, dev_priv->rps.min_freq),
 			 dev_priv->rps.min_freq);
Signature · 1 line
1.9.1
Signature · 2 lines
Ville Syrjälä
Intel OTC
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

PATCH v3 1/1 drm/i915/chv: Set min freq to RPn on CHV.

From: Deepak S <[email protected]>

With latest Punit FW, vgg input voltag drop falling to minimum is fixed. So reverting the WA patch & moving to turbo freq opreation range to [RPn -> RP0]

This is not a 1:1 revert of the commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44. You can refer to commit 5b5929cbe3f7 ("drm/i915/chv: remove pre-production hardware workarounds") as the reason for the discrepancy

commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44

Author: Deepak S <[email protected]>
Date:   Sat May 9 18:15:46 2015 +0530

drm/i915/chv: Set min freq to efficient frequency on chv

v2: Fix inconsistent return type. (Chris)
v3: drop pre-production hw case (Ville)

---
 drivers/gpu/drm/i915/intel_pm.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +12 -2
index 81ab119..fa80881 100644
@@ -5579,6 +5579,17 @@ static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
 	return rp1;
 }
 
+static u32 cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
+{
+	u32 val, rpn;
+
+	val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
+	rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
+		       FB_GFX_FREQ_FUSE_MASK);
+
+	return rpn;
+}
+
 static int valleyview_rps_guar_freq(struct drm_i915_private *dev_priv)
 {
 	u32 val, rp1;
@@ -5818,8 +5829,7 @@ static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv)
 			 intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq),
 			 dev_priv->rps.rp1_freq);
 
-	/* PUnit validated range is only [RPe, RP0] */
-	dev_priv->rps.min_freq = dev_priv->rps.efficient_freq;
+	dev_priv->rps.min_freq = cherryview_rps_min_freq(dev_priv);
 	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
 			 intel_gpu_freq(dev_priv, dev_priv->rps.min_freq),
 			 dev_priv->rps.min_freq);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v3 1/1
#10 lore raw

Re: [PATCH v3] drm/i915/chv: Set min freq to RPn on CHV.

Quoted 13 lines · On Fri, Aug 12, 2016 at 06:46:41PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

With latest Punit FW, vgg input voltag drop falling to minimum is fixed. So reverting the WA patch & moving to turbo freq opreation range to [RPn -> RP0]

This is not a 1:1 revert of the commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44. You can refer to commit 5b5929cbe3f7 ("drm/i915/chv: remove pre-production hardware workarounds") as the reason for the discrepancy

commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44

Author: Deepak S <[email protected]>
Date:   Sat May 9 18:15:46 2015 +0530
Quoted 7 lines

drm/i915/chv: Set min freq to efficient frequency on chv

v2: Fix inconsistent return type. (Chris)
v3: drop pre-production hw case (Ville)

I was never able to reproduce the supposed Punit problems with <RPe frequencies. In fact what I always observed was that the voltage did end up lower at RPn than at RPe. IIRC it might have been lower even while we were in RC6. I can't actually double check that right now since they made SVID inaccessible via sideband on CHV and I'm too lazy to set up the extra equipment for it now.

What I can say is that RAPL is reporting ~10 mW lower power consumption with vsynced glxgears running when we're running at 200 MHz rather than at 400 MHz. So I'm going to decalare this patch good.

and pushed to dinq. Thanks for the patch.

Quoted 38 lines
---
 drivers/gpu/drm/i915/intel_pm.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +12 -2
index 81ab119..fa80881 100644
@@ -5579,6 +5579,17 @@ static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
 	return rp1;
 }
 
+static u32 cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
+{
+	u32 val, rpn;
+
+	val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
+	rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
+		       FB_GFX_FREQ_FUSE_MASK);
+
+	return rpn;
+}
+
 static int valleyview_rps_guar_freq(struct drm_i915_private *dev_priv)
 {
 	u32 val, rp1;
@@ -5818,8 +5829,7 @@ static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv)
 			 intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq),
 			 dev_priv->rps.rp1_freq);
 
-	/* PUnit validated range is only [RPe, RP0] */
-	dev_priv->rps.min_freq = dev_priv->rps.efficient_freq;
+	dev_priv->rps.min_freq = cherryview_rps_min_freq(dev_priv);
 	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
 			 intel_gpu_freq(dev_priv, dev_priv->rps.min_freq),
 			 dev_priv->rps.min_freq);
Signature · 1 line
1.9.1
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw
In reply to [email protected]
reproduce:

Hi Deepak,

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v4.8-rc1 next-20160811]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/deepak-s-linux-intel-com/Revert-drm-i915-chv-Set-min-freq-to-efficient-frequency-on-chv/20160812-135320
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-i0-201632 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.3-14) 4.9.3
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

drivers/gpu/drm/i915/intel_pm.c: In function 'cherryview_rps_min_freq':

>> drivers/gpu/drm/i915/intel_pm.c:5610:28: warning: initialization from incompatible pointer type
     struct pci_device *pdev = dev_priv->drm.pdev;
                               ^
>> drivers/gpu/drm/i915/intel_pm.c:5613:10: error: dereferencing pointer to incomplete type
     if (pdev->revision >= 0x20) {
             ^

vim +5613 drivers/gpu/drm/i915/intel_pm.c

5604
5605 return rp1;
5606 }
5607
5608 static u32 cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
5609 {

> 5610		struct pci_device *pdev = dev_priv->drm.pdev;
  5611		u32 val, rpn;
  5612	
> 5613		if (pdev->revision >= 0x20) {

5614 val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
5615 rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
5616 FB_GFX_FREQ_FUSE_MASK);

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#12 lore raw

✗ Fi.CI.BAT: failure for Revert "drm/i915/chv: Set min freq to efficient frequency on chv" (rev2)

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: Revert "drm/i915/chv: Set min freq to efficient frequency on chv" (rev2)
URL : https://patchwork.freedesktop.org/series/10998/
State : failure

== Summary ==

  CC      drivers/pci/pcie/aer/aerdrv_acpi.o
  CC [M]  drivers/net/ethernet/intel/igb/e1000_mac.o
  CC      drivers/pci/pcie/aer/ecrc.o
  LD      drivers/pci/pcie/pcieportdrv.o
  CC [M]  drivers/net/ethernet/intel/igb/e1000_nvm.o
  CC [M]  drivers/net/ethernet/realtek/8139too.o
  CC [M]  drivers/net/ethernet/intel/igb/e1000_phy.o
  CC [M]  drivers/net/ethernet/realtek/r8169.o
  CC [M]  drivers/net/ethernet/intel/igb/e1000_mbx.o
  CC [M]  drivers/net/ethernet/intel/igb/e1000_i210.o
  LD      drivers/mmc/built-in.o
  LD      drivers/net/ethernet/intel/igbvf/built-in.o
  CC [M]  drivers/net/ethernet/intel/igbvf/vf.o
  CC [M]  drivers/net/ethernet/intel/igb/igb_ptp.o
  CC [M]  drivers/net/ethernet/intel/igbvf/mbx.o
  CC [M]  drivers/net/ethernet/intel/igb/igb_hwmon.o
  CC [M]  drivers/net/ethernet/intel/igbvf/ethtool.o
  LD      drivers/pci/pcie/aer/aerdriver.o
  LD      drivers/pci/pcie/aer/built-in.o
  CC [M]  drivers/net/ethernet/intel/igbvf/netdev.o
  LD      drivers/pci/pcie/built-in.o
  LD      drivers/pci/built-in.o
  LD [M]  drivers/net/ethernet/intel/e1000/e1000.o
  LD [M]  drivers/net/ethernet/intel/igb/igb.o
  LD [M]  drivers/net/ethernet/intel/igbvf/igbvf.o
  LD [M]  drivers/net/ethernet/intel/e1000e/e1000e.o
  LD      drivers/net/ethernet/built-in.o
  LD      drivers/net/built-in.o

Makefile:975: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Full logs at /archive/deploy/logs/CI_Patchwork_build_2301

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#13 lore raw

✗ Ro.CI.BAT: failure for Revert "drm/i915/chv: Set min freq to efficient frequency on chv" (rev2)

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: Revert "drm/i915/chv: Set min freq to efficient frequency on chv" (rev2)
URL : https://patchwork.freedesktop.org/series/10998/
State : failure

== Summary ==

SHIPPED drivers/tty/vt/defkeymap.c

  CC [M]  drivers/ssb/driver_chipcommon.o
  CC      drivers/tty/serial/8250/8250_pnp.o
  CC      drivers/tty/vt/consolemap_deftbl.o
  CC      drivers/acpi/acpica/utxface.o
  CC [M]  drivers/ssb/driver_chipcommon_pmu.o
  CC [M]  drivers/ssb/driver_pcicore.o
  CC      drivers/tty/vt/defkeymap.o
  CC      drivers/tty/serial/8250/8250_port.o
  CC      drivers/acpi/acpica/utxfinit.o
  CC      drivers/acpi/acpica/utxferror.o
  CC      drivers/tty/serial/8250/8250_pci.o
  LD      drivers/scsi/scsi_mod.o
  CC      drivers/tty/serial/8250/8250_early.o
  CC      drivers/acpi/acpica/utxfmutex.o
  CC      drivers/tty/serial/8250/8250_mid.o
  LD      drivers/scsi/sd_mod.o
  LD      drivers/scsi/built-in.o
  LD      drivers/tty/vt/built-in.o
  LD      drivers/tty/serial/8250/8250.o
  LD      drivers/acpi/acpica/acpi.o
  LD [M]  drivers/ssb/ssb.o
  LD      drivers/tty/serial/8250/8250_base.o
  LD      drivers/tty/serial/8250/built-in.o
  LD      drivers/tty/serial/built-in.o
  LD      drivers/tty/built-in.o
  LD      drivers/acpi/acpica/built-in.o
  LD      drivers/acpi/built-in.o

Makefile:975: recipe for target 'drivers' failed
make: *** [drivers] Error 2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#14 lore raw
In reply to [email protected]
Quoted 4 lines · On Fri, 12 Aug 2016, [email protected] wrote:

From: Deepak S <[email protected]>

With latest Punit FW, vgg input voltag drop falling to minimum is fixed. So reverting the WA patch & moving to turbo freq opreation range to [RPn -> RP0]

IOW, this patch will regress for anyone who does *not* have the latest Punit firmware. Can we check for the firmware version, and act accordingly? How does one go about updating the firmware, if at all?

Definitely NAK until the above is cleared.

BR,
Jani.

Quoted 53 lines

This reverts commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44.

commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44

Author: Deepak S <[email protected]>
Date:   Sat May 9 18:15:46 2015 +0530

drm/i915/chv: Set min freq to efficient frequency on chv

---
 drivers/gpu/drm/i915/intel_pm.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +19 -2
index 81ab119..e59799a 100644
@@ -5579,6 +5579,24 @@ static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
 	return rp1;
 }
 
+static int cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
+{
+	struct drm_device *dev = &dev_priv->drm;
+	u32 val, rpn;
+
+	if (dev->pdev->revision >= 0x20) {
+		val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
+		rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
+		       FB_GFX_FREQ_FUSE_MASK);
+	} else { /* For pre-production hardware */
+		val = vlv_punit_read(dev_priv, PUNIT_GPU_STATUS_REG);
+		rpn = ((val >> PUNIT_GPU_STATIS_GFX_MIN_FREQ_SHIFT) &
+		       PUNIT_GPU_STATUS_GFX_MIN_FREQ_MASK);
+	}
+
+	return rpn;
+}
+
 static int valleyview_rps_guar_freq(struct drm_i915_private *dev_priv)
 {
 	u32 val, rp1;
@@ -5818,8 +5836,7 @@ static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv)
 			 intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq),
 			 dev_priv->rps.rp1_freq);
 
-	/* PUnit validated range is only [RPe, RP0] */
-	dev_priv->rps.min_freq = dev_priv->rps.efficient_freq;
+	dev_priv->rps.min_freq = cherryview_rps_min_freq(dev_priv);
 	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
 			 intel_gpu_freq(dev_priv, dev_priv->rps.min_freq),
 			 dev_priv->rps.min_freq);
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#15 lore raw
Quoted 5 lines · Jani Nikula
Quoted 4 lines · On Fri, 12 Aug 2016, [email protected] wrote:

From: Deepak S <[email protected]>

With latest Punit FW, vgg input voltag drop falling to minimum is fixed. So reverting the WA patch & moving to turbo freq opreation range to [RPn -> RP0]

Quoted 8 lines

IOW, this patch will regress for anyone who does *not* have the latest Punit firmware. Can we check for the firmware version, and act accordingly? How does one go about updating the firmware, if at all?

Definitely NAK until the above is cleared.

BR,
Jani.

I will check with the firmware team when this was released. I think the fix was added long back, I will confirm.

Quoted 47 lines
Quoted 47 lines

This reverts commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44.

commit 5b7c91b78b1ce6663e0f1f037f6cb4d7c9537d44

Author: Deepak S <[email protected]>
Date:   Sat May 9 18:15:46 2015 +0530

drm/i915/chv: Set min freq to efficient frequency on chv

---
  drivers/gpu/drm/i915/intel_pm.c | 21 +++++++++++++++++++--
  1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +18 -0
index 81ab119..e59799a 100644
@@ -5579,6 +5579,24 @@ static int cherryview_rps_guar_freq(struct drm_i915_private *dev_priv)
  	return rp1;
  }
 
+static int cherryview_rps_min_freq(struct drm_i915_private *dev_priv)
+{
+	struct drm_device *dev = &dev_priv->drm;
+	u32 val, rpn;
+
+	if (dev->pdev->revision >= 0x20) {
+		val = vlv_punit_read(dev_priv, FB_GFX_FMIN_AT_VMIN_FUSE);
+		rpn = ((val >> FB_GFX_FMIN_AT_VMIN_FUSE_SHIFT) &
+		       FB_GFX_FREQ_FUSE_MASK);
+	} else { /* For pre-production hardware */
+		val = vlv_punit_read(dev_priv, PUNIT_GPU_STATUS_REG);
+		rpn = ((val >> PUNIT_GPU_STATIS_GFX_MIN_FREQ_SHIFT) &
+		       PUNIT_GPU_STATUS_GFX_MIN_FREQ_MASK);
+	}
+
+	return rpn;
+}
+
  static int valleyview_rps_guar_freq(struct drm_i915_private *dev_priv)
  {
  	u32 val, rp1;
@@ -5818,8 +5836,7 @@ static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv)
  			 intel_gpu_freq(dev_priv, dev_priv->rps.rp1_freq),
  			 dev_priv->rps.rp1_freq);
 
Quoted 6 lines

drivers/gpu/drm/i915/intel_pm.c static void cherryview_init_gt_powersave(struct drm_i915_private *dev_priv) · line 5842

Quoted 6 lines
drivers/gpu/drm/i915/intel_pm.c +1 -2
-	/* PUnit validated range is only [RPe, RP0] */
-	dev_priv->rps.min_freq = dev_priv->rps.efficient_freq;
+	dev_priv->rps.min_freq = cherryview_rps_min_freq(dev_priv);
  	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
  			 intel_gpu_freq(dev_priv, dev_priv->rps.min_freq),
  			 dev_priv->rps.min_freq);

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#16 lore raw

✗ Ro.CI.BAT: failure for Revert "drm/i915/chv: Set min freq to efficient frequency on chv" (rev3)

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: Revert "drm/i915/chv: Set min freq to efficient frequency on chv" (rev3)
URL : https://patchwork.freedesktop.org/series/10998/
State : failure

== Summary ==

Series 10998v3 Revert "drm/i915/chv: Set min freq to efficient frequency on chv"
http://patchwork.freedesktop.org/api/1.0/series/10998/revisions/3/mbox

Test drv_module_reload_basic:

                pass       -> SKIP       (ro-ivb-i7-3770)
Test gem_exec_suspend:
        Subgroup basic-s3:
                dmesg-warn -> PASS       (ro-bdw-i7-5600u)
Test kms_cursor_legacy:
        Subgroup basic-cursor-vs-flip-varying-size:
                pass       -> FAIL       (ro-ilk1-i5-650)
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-b-frame-sequence:
                fail       -> PASS       (ro-ivb2-i7-3770)
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> INCOMPLETE (fi-skl-i7-6700k)
                skip       -> DMESG-WARN (ro-bdw-i5-5250u)
                pass       -> INCOMPLETE (fi-snb-i7-2600)
        Subgroup suspend-read-crc-pipe-c:
                skip       -> DMESG-WARN (ro-bdw-i5-5250u)
fi-hsw-i7-4770k  total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-qkkr      total:244  pass:185  dwarn:28  dfail:1   fail:3   skip:27 
fi-skl-i7-6700k  total:207  pass:176  dwarn:2   dfail:2   fail:0   skip:26 
fi-snb-i7-2600   total:207  pass:172  dwarn:0   dfail:0   fail:0   skip:34 
ro-bdw-i5-5250u  total:240  pass:218  dwarn:4   dfail:0   fail:2   skip:16 
ro-bdw-i7-5600u  total:240  pass:207  dwarn:0   dfail:0   fail:1   skip:32 
ro-bsw-n3050     total:240  pass:194  dwarn:0   dfail:0   fail:4   skip:42 
ro-byt-n2820     total:240  pass:197  dwarn:0   dfail:0   fail:3   skip:40 
ro-hsw-i3-4010u  total:240  pass:214  dwarn:0   dfail:0   fail:0   skip:26 
ro-hsw-i7-4770r  total:240  pass:185  dwarn:0   dfail:0   fail:0   skip:55 
ro-ilk1-i5-650   total:235  pass:173  dwarn:0   dfail:0   fail:2   skip:60 
ro-ivb-i7-3770   total:240  pass:204  dwarn:0   dfail:0   fail:0   skip:36 
ro-ivb2-i7-3770  total:240  pass:209  dwarn:0   dfail:0   fail:0   skip:31 
ro-skl3-i5-6260u total:240  pass:222  dwarn:0   dfail:0   fail:4   skip:14 

Results at /archive/results/CI_IGT_test/RO_Patchwork_1850/

4a26251 drm-intel-nightly: 2016y-08m-11d-16h-12m-42s UTC integration manifest 2fd0810 drm/i915/chv: Set min freq to RPn on CHV.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx