All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks.
@ 2016-01-07  1:15 Rodrigo Vivi
  2016-01-07  1:15 ` [PATCH 2/3] drm/i915: Don't warn if the workaround list is empty part 2 Rodrigo Vivi
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Rodrigo Vivi @ 2016-01-07  1:15 UTC (permalink / raw)
  To: intel-gfx; +Cc: Sarah Sharp, Rodrigo Vivi

When adding IS_KABYLAKE definition I didn't included the
DC states related because I was planing to include them
with the patch that fixes DMC firmware loading, but I
forgot them.

Meanwhile this runtime pm code changed a lot for
Skylake.

Well, I didn't expect that this would crash the machine
and I just noticed now that Sarah warned me our driver
wasn't working. Thanks Sarah.

Cc: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_csr.c        |  5 +++--
 drivers/gpu/drm/i915/intel_runtime_pm.c | 19 ++++++++++++-------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index 9bb63a8..3f69829 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -278,7 +278,8 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
 
 	csr->version = css_header->version;
 
-	if (IS_SKYLAKE(dev) && csr->version < SKL_CSR_VERSION_REQUIRED) {
+	if ((IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) &&
+	     csr->version < SKL_CSR_VERSION_REQUIRED) {
 		DRM_INFO("Refusing to load old Skylake DMC firmware v%u.%u,"
 			 " please upgrade to v%u.%u or later"
 			 " [https://01.org/linuxgraphics/intel-linux-graphics-firmwares].\n",
@@ -421,7 +422,7 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
 	if (!HAS_CSR(dev_priv))
 		return;
 
-	if (IS_SKYLAKE(dev_priv))
+	if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
 		csr->fw_path = I915_CSR_SKL;
 	else if (IS_BROXTON(dev_priv))
 		csr->fw_path = I915_CSR_BXT;
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index ddbdbff..f5bf54c 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -532,7 +532,8 @@ static void assert_can_enable_dc5(struct drm_i915_private *dev_priv)
 	bool pg2_enabled = intel_display_power_well_is_enabled(dev_priv,
 					SKL_DISP_PW_2);
 
-	WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC5.\n");
+	WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
+		  "Platform doesn't support DC5.\n");
 	WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
 	WARN_ONCE(pg2_enabled, "PG2 not disabled to enable DC5.\n");
 
@@ -568,7 +569,8 @@ static void assert_can_enable_dc6(struct drm_i915_private *dev_priv)
 {
 	struct drm_device *dev = dev_priv->dev;
 
-	WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC6.\n");
+	WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
+		  "Platform doesn't support DC6.\n");
 	WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
 	WARN_ONCE(I915_READ(UTIL_PIN_CTL) & UTIL_PIN_ENABLE,
 		  "Backlight is not disabled.\n");
@@ -595,7 +597,8 @@ static void gen9_disable_dc5_dc6(struct drm_i915_private *dev_priv)
 {
 	assert_can_disable_dc5(dev_priv);
 
-	if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
+	if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
+	    i915.enable_dc != 0 && i915.enable_dc != 1)
 		assert_can_disable_dc6(dev_priv);
 
 	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
@@ -783,7 +786,8 @@ static void gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv,
 static void gen9_dc_off_power_well_disable(struct drm_i915_private *dev_priv,
 					   struct i915_power_well *power_well)
 {
-	if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
+	if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
+	    i915.enable_dc != 0 && i915.enable_dc != 1)
 		skl_enable_dc6(dev_priv);
 	else
 		gen9_enable_dc5(dev_priv);
@@ -795,7 +799,8 @@ static void gen9_dc_off_power_well_sync_hw(struct drm_i915_private *dev_priv,
 	if (power_well->count > 0) {
 		gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
 	} else {
-		if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 &&
+		if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
+		    i915.enable_dc != 0 &&
 		    i915.enable_dc != 1)
 			gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
 		else
@@ -1851,7 +1856,7 @@ void skl_pw1_misc_io_init(struct drm_i915_private *dev_priv)
 {
 	struct i915_power_well *well;
 
-	if (!IS_SKYLAKE(dev_priv))
+	if (!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv))
 		return;
 
 	well = lookup_power_well(dev_priv, SKL_DISP_PW_1);
@@ -1865,7 +1870,7 @@ void skl_pw1_misc_io_fini(struct drm_i915_private *dev_priv)
 {
 	struct i915_power_well *well;
 
-	if (!IS_SKYLAKE(dev_priv))
+	if (!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv))
 		return;
 
 	well = lookup_power_well(dev_priv, SKL_DISP_PW_1);
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/3] drm/i915: Don't warn if the workaround list is empty part 2.
  2016-01-07  1:15 [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks Rodrigo Vivi
@ 2016-01-07  1:15 ` Rodrigo Vivi
  2016-01-08  0:49   ` Rodrigo Vivi
  2016-01-07  1:15 ` [PATCH 3/3] drm/i915/kbl: Remove preliminary_hw_support protection from Kabylake Rodrigo Vivi
  2016-01-07 16:14 ` [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks Michel Thierry
  2 siblings, 1 reply; 13+ messages in thread
From: Rodrigo Vivi @ 2016-01-07  1:15 UTC (permalink / raw)
  To: intel-gfx; +Cc: Rodrigo Vivi

From: "Boyer, Wayne" <wayne.boyer@intel.com>

Extend the same reasoning as in the patch listed below.  It's not an
error for the workaround list to be empty if no workarounds are needed.

    commit 02235808b61cd9382d224b0df263193006dd9913
    Author: Francisco Jerez <currojerez@riseup.net>
    Date:   Wed Oct 7 14:44:01 2015 +0300
        drm/i915: Don't warn if the workaround list is empty.

Signed-off-by: Wayne Boyer <wayne.boyer@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 8096c6a..641d21c 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1100,7 +1100,7 @@ static int intel_logical_ring_workarounds_emit(struct drm_i915_gem_request *req)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct i915_workarounds *w = &dev_priv->workarounds;
 
-	if (WARN_ON_ONCE(w->count == 0))
+	if (w->count == 0)
 		return 0;
 
 	ring->gpu_caches_dirty = true;
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/3] drm/i915/kbl: Remove preliminary_hw_support protection from Kabylake.
  2016-01-07  1:15 [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks Rodrigo Vivi
  2016-01-07  1:15 ` [PATCH 2/3] drm/i915: Don't warn if the workaround list is empty part 2 Rodrigo Vivi
@ 2016-01-07  1:15 ` Rodrigo Vivi
  2016-01-07  9:30   ` Daniel Vetter
  2016-01-07 16:14 ` [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks Michel Thierry
  2 siblings, 1 reply; 13+ messages in thread
From: Rodrigo Vivi @ 2016-01-07  1:15 UTC (permalink / raw)
  To: intel-gfx; +Cc: Rodrigo Vivi

The only missing gap compared to Skylake is the GuC
because we don't have yet a GuC firmware image to publish.

However with all other parts in place this is very similar to
Skylake which is out of this procection.

So I'm now confident that Kabylake is in a good stage and won't
cause troubles like blank displays, hard hangs, etc.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 3ac616d..c8ddf3e 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -346,14 +346,12 @@ static const struct intel_device_info intel_broxton_info = {
 
 static const struct intel_device_info intel_kabylake_info = {
 	HSW_FEATURES,
-	.is_preliminary = 1,
 	.is_kabylake = 1,
 	.gen = 9,
 };
 
 static const struct intel_device_info intel_kabylake_gt3_info = {
 	HSW_FEATURES,
-	.is_preliminary = 1,
 	.is_kabylake = 1,
 	.gen = 9,
 	.ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/3] drm/i915/kbl: Remove preliminary_hw_support protection from Kabylake.
  2016-01-07  1:15 ` [PATCH 3/3] drm/i915/kbl: Remove preliminary_hw_support protection from Kabylake Rodrigo Vivi
@ 2016-01-07  9:30   ` Daniel Vetter
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Vetter @ 2016-01-07  9:30 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: intel-gfx

On Wed, Jan 06, 2016 at 05:15:30PM -0800, Rodrigo Vivi wrote:
> The only missing gap compared to Skylake is the GuC
> because we don't have yet a GuC firmware image to publish.
> 
> However with all other parts in place this is very similar to
> Skylake which is out of this procection.
> 
> So I'm now confident that Kabylake is in a good stage and won't
> cause troubles like blank displays, hard hangs, etc.
> 
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Imo we should have at least 1 kbl in CI before doing this. Do we have
that?
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 3ac616d..c8ddf3e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -346,14 +346,12 @@ static const struct intel_device_info intel_broxton_info = {
>  
>  static const struct intel_device_info intel_kabylake_info = {
>  	HSW_FEATURES,
> -	.is_preliminary = 1,
>  	.is_kabylake = 1,
>  	.gen = 9,
>  };
>  
>  static const struct intel_device_info intel_kabylake_gt3_info = {
>  	HSW_FEATURES,
> -	.is_preliminary = 1,
>  	.is_kabylake = 1,
>  	.gen = 9,
>  	.ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
> -- 
> 2.4.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks.
  2016-01-07  1:15 [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks Rodrigo Vivi
  2016-01-07  1:15 ` [PATCH 2/3] drm/i915: Don't warn if the workaround list is empty part 2 Rodrigo Vivi
  2016-01-07  1:15 ` [PATCH 3/3] drm/i915/kbl: Remove preliminary_hw_support protection from Kabylake Rodrigo Vivi
@ 2016-01-07 16:14 ` Michel Thierry
  2016-01-08  0:32   ` Vivi, Rodrigo
  2016-01-08  0:49   ` [PATCH] " Rodrigo Vivi
  2 siblings, 2 replies; 13+ messages in thread
From: Michel Thierry @ 2016-01-07 16:14 UTC (permalink / raw)
  To: Rodrigo Vivi, intel-gfx; +Cc: Sharp, Sarah A

On 1/7/2016 1:15 AM, Rodrigo Vivi wrote:
> When adding IS_KABYLAKE definition I didn't included the
> DC states related because I was planing to include them
> with the patch that fixes DMC firmware loading, but I
> forgot them.
>
> Meanwhile this runtime pm code changed a lot for
> Skylake.
>
> Well, I didn't expect that this would crash the machine
> and I just noticed now that Sarah warned me our driver
> wasn't working. Thanks Sarah.
>
> Cc: Sarah Sharp <sarah.a.sharp@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_csr.c        |  5 +++--
>   drivers/gpu/drm/i915/intel_runtime_pm.c | 19 ++++++++++++-------
>   2 files changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> index 9bb63a8..3f69829 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c
> @@ -278,7 +278,8 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
>
>   	csr->version = css_header->version;
>
> -	if (IS_SKYLAKE(dev) && csr->version < SKL_CSR_VERSION_REQUIRED) {
> +	if ((IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) &&
> +	     csr->version < SKL_CSR_VERSION_REQUIRED) {
>   		DRM_INFO("Refusing to load old Skylake DMC firmware v%u.%u,"
>   			 " please upgrade to v%u.%u or later"
>   			 " [https://01.org/linuxgraphics/intel-linux-graphics-firmwares].\n",
> @@ -421,7 +422,7 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
>   	if (!HAS_CSR(dev_priv))
>   		return;
>
> -	if (IS_SKYLAKE(dev_priv))
> +	if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
>   		csr->fw_path = I915_CSR_SKL;
>   	else if (IS_BROXTON(dev_priv))
>   		csr->fw_path = I915_CSR_BXT;
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index ddbdbff..f5bf54c 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -532,7 +532,8 @@ static void assert_can_enable_dc5(struct drm_i915_private *dev_priv)
>   	bool pg2_enabled = intel_display_power_well_is_enabled(dev_priv,
>   					SKL_DISP_PW_2);
>
> -	WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC5.\n");
> +	WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
> +		  "Platform doesn't support DC5.\n");
>   	WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
>   	WARN_ONCE(pg2_enabled, "PG2 not disabled to enable DC5.\n");
>
> @@ -568,7 +569,8 @@ static void assert_can_enable_dc6(struct drm_i915_private *dev_priv)
>   {
>   	struct drm_device *dev = dev_priv->dev;
>
> -	WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC6.\n");
> +	WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
> +		  "Platform doesn't support DC6.\n");
>   	WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
>   	WARN_ONCE(I915_READ(UTIL_PIN_CTL) & UTIL_PIN_ENABLE,
>   		  "Backlight is not disabled.\n");
> @@ -595,7 +597,8 @@ static void gen9_disable_dc5_dc6(struct drm_i915_private *dev_priv)
>   {
>   	assert_can_disable_dc5(dev_priv);
>
> -	if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
> +	if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
> +	    i915.enable_dc != 0 && i915.enable_dc != 1)
>   		assert_can_disable_dc6(dev_priv);
>
>   	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
> @@ -783,7 +786,8 @@ static void gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv,
>   static void gen9_dc_off_power_well_disable(struct drm_i915_private *dev_priv,
>   					   struct i915_power_well *power_well)
>   {
> -	if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
> +	if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
> +	    i915.enable_dc != 0 && i915.enable_dc != 1)
>   		skl_enable_dc6(dev_priv);
>   	else
>   		gen9_enable_dc5(dev_priv);
> @@ -795,7 +799,8 @@ static void gen9_dc_off_power_well_sync_hw(struct drm_i915_private *dev_priv,
>   	if (power_well->count > 0) {
>   		gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
>   	} else {
> -		if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 &&
> +		if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
> +		    i915.enable_dc != 0 &&
>   		    i915.enable_dc != 1)
>   			gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
>   		else
> @@ -1851,7 +1856,7 @@ void skl_pw1_misc_io_init(struct drm_i915_private *dev_priv)
>   {
>   	struct i915_power_well *well;
>
> -	if (!IS_SKYLAKE(dev_priv))
> +	if (!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv))
>   		return;
>
>   	well = lookup_power_well(dev_priv, SKL_DISP_PW_1);
> @@ -1865,7 +1870,7 @@ void skl_pw1_misc_io_fini(struct drm_i915_private *dev_priv)
>   {
>   	struct i915_power_well *well;
>
> -	if (!IS_SKYLAKE(dev_priv))
> +	if (!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv))
>   		return;
>
>   	well = lookup_power_well(dev_priv, SKL_DISP_PW_1);
>

Hi Rodrigo,

I had the same issue with the power wells and sent the same fix 
yesterday 
(http://cgit.freedesktop.org/drm-intel/commit/?id=16fbc291cb87c7defcd13ad715d3e4af0d523e43).

I didn't try to use DMC, so I didn't catch the other problem.

Without the now redundant changes in skl_pw1_misc_io_init/fini,

Reviewed-by: Michel Thierry <michel.thierry@intel.com>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks.
  2016-01-07 16:14 ` [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks Michel Thierry
@ 2016-01-08  0:32   ` Vivi, Rodrigo
  2016-01-08  0:49   ` [PATCH] " Rodrigo Vivi
  1 sibling, 0 replies; 13+ messages in thread
From: Vivi, Rodrigo @ 2016-01-08  0:32 UTC (permalink / raw)
  To: Thierry, Michel, intel-gfx; +Cc: Sharp, Sarah A

Hi Michel,

On Thu, 2016-01-07 at 16:14 +0000, Michel Thierry wrote:
> On 1/7/2016 1:15 AM, Rodrigo Vivi wrote:
> > When adding IS_KABYLAKE definition I didn't included the
> > DC states related because I was planing to include them
> > with the patch that fixes DMC firmware loading, but I
> > forgot them.
> > 
> > Meanwhile this runtime pm code changed a lot for
> > Skylake.
> > 
> > Well, I didn't expect that this would crash the machine
> > and I just noticed now that Sarah warned me our driver
> > wasn't working. Thanks Sarah.
> > 
> > Cc: Sarah Sharp <sarah.a.sharp@intel.com>
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > ---
> >   drivers/gpu/drm/i915/intel_csr.c        |  5 +++--
> >   drivers/gpu/drm/i915/intel_runtime_pm.c | 19 ++++++++++++-------
> >   2 files changed, 15 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_csr.c 
> > b/drivers/gpu/drm/i915/intel_csr.c
> > index 9bb63a8..3f69829 100644
> > --- a/drivers/gpu/drm/i915/intel_csr.c
> > +++ b/drivers/gpu/drm/i915/intel_csr.c
> > @@ -278,7 +278,8 @@ static uint32_t *parse_csr_fw(struct 
> > drm_i915_private *dev_priv,
> > 
> >   	csr->version = css_header->version;
> > 
> > -	if (IS_SKYLAKE(dev) && csr->version < 
> > SKL_CSR_VERSION_REQUIRED) {
> > +	if ((IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) &&
> > +	     csr->version < SKL_CSR_VERSION_REQUIRED) {
> >   		DRM_INFO("Refusing to load old Skylake DMC 
> > firmware v%u.%u,"
> >   			 " please upgrade to v%u.%u or later"
> >   			 " [
> > https://01.org/linuxgraphics/intel-linux-graphics-firmwares].\n",
> > @@ -421,7 +422,7 @@ void intel_csr_ucode_init(struct 
> > drm_i915_private *dev_priv)
> >   	if (!HAS_CSR(dev_priv))
> >   		return;
> > 
> > -	if (IS_SKYLAKE(dev_priv))
> > +	if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
> >   		csr->fw_path = I915_CSR_SKL;
> >   	else if (IS_BROXTON(dev_priv))
> >   		csr->fw_path = I915_CSR_BXT;
> > diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c 
> > b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > index ddbdbff..f5bf54c 100644
> > --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > @@ -532,7 +532,8 @@ static void assert_can_enable_dc5(struct 
> > drm_i915_private *dev_priv)
> >   	bool pg2_enabled = 
> > intel_display_power_well_is_enabled(dev_priv,
> >   					SKL_DISP_PW_2);
> > 
> > -	WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support 
> > DC5.\n");
> > +	WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
> > +		  "Platform doesn't support DC5.\n");
> >   	WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not 
> > enabled.\n");
> >   	WARN_ONCE(pg2_enabled, "PG2 not disabled to enable 
> > DC5.\n");
> > 
> > @@ -568,7 +569,8 @@ static void assert_can_enable_dc6(struct 
> > drm_i915_private *dev_priv)
> >   {
> >   	struct drm_device *dev = dev_priv->dev;
> > 
> > -	WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support 
> > DC6.\n");
> > +	WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
> > +		  "Platform doesn't support DC6.\n");
> >   	WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not 
> > enabled.\n");
> >   	WARN_ONCE(I915_READ(UTIL_PIN_CTL) & UTIL_PIN_ENABLE,
> >   		  "Backlight is not disabled.\n");
> > @@ -595,7 +597,8 @@ static void gen9_disable_dc5_dc6(struct 
> > drm_i915_private *dev_priv)
> >   {
> >   	assert_can_disable_dc5(dev_priv);
> > 
> > -	if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && 
> > i915.enable_dc != 1)
> > +	if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
> > +	    i915.enable_dc != 0 && i915.enable_dc != 1)
> >   		assert_can_disable_dc6(dev_priv);
> > 
> >   	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
> > @@ -783,7 +786,8 @@ static void 
> > gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv,
> >   static void gen9_dc_off_power_well_disable(struct 
> > drm_i915_private *dev_priv,
> >   					   struct i915_power_well 
> > *power_well)
> >   {
> > -	if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && 
> > i915.enable_dc != 1)
> > +	if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
> > +	    i915.enable_dc != 0 && i915.enable_dc != 1)
> >   		skl_enable_dc6(dev_priv);
> >   	else
> >   		gen9_enable_dc5(dev_priv);
> > @@ -795,7 +799,8 @@ static void 
> > gen9_dc_off_power_well_sync_hw(struct drm_i915_private *dev_priv,
> >   	if (power_well->count > 0) {
> >   		gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
> >   	} else {
> > -		if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 &&
> > +		if ((IS_SKYLAKE(dev_priv) || 
> > IS_KABYLAKE(dev_priv)) &&
> > +		    i915.enable_dc != 0 &&
> >   		    i915.enable_dc != 1)
> >   			gen9_set_dc_state(dev_priv, 
> > DC_STATE_EN_UPTO_DC6);
> >   		else
> > @@ -1851,7 +1856,7 @@ void skl_pw1_misc_io_init(struct 
> > drm_i915_private *dev_priv)
> >   {
> >   	struct i915_power_well *well;
> > 
> > -	if (!IS_SKYLAKE(dev_priv))
> > +	if (!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv))
> >   		return;
> > 
> >   	well = lookup_power_well(dev_priv, SKL_DISP_PW_1);
> > @@ -1865,7 +1870,7 @@ void skl_pw1_misc_io_fini(struct 
> > drm_i915_private *dev_priv)
> >   {
> >   	struct i915_power_well *well;
> > 
> > -	if (!IS_SKYLAKE(dev_priv))
> > +	if (!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv))
> >   		return;
> > 
> >   	well = lookup_power_well(dev_priv, SKL_DISP_PW_1);
> > 
> 
> Hi Rodrigo,
> 
> I had the same issue with the power wells and sent the same fix 
> yesterday 
> (http://cgit.freedesktop.org/drm-intel/commit/?id=16fbc291cb87c7defcd
> 13ad715d3e4af0d523e43).

I hadn't seen it. I'm sorry.

> 
> I didn't try to use DMC, so I didn't catch the other problem.

I will merge a v2 of my patch rebased on top of yours.


> 
> Without the now redundant changes in skl_pw1_misc_io_init/fini,
> 
> Reviewed-by: Michel Thierry <michel.thierry@intel.com>

Thanks for the review.

> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] drm/i915/kbl: Adding missing IS_KABYLAKE checks.
  2016-01-07 16:14 ` [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks Michel Thierry
  2016-01-08  0:32   ` Vivi, Rodrigo
@ 2016-01-08  0:49   ` Rodrigo Vivi
  2016-02-26  0:23     ` Rodrigo Vivi
  1 sibling, 1 reply; 13+ messages in thread
From: Rodrigo Vivi @ 2016-01-08  0:49 UTC (permalink / raw)
  To: intel-gfx; +Cc: Sarah Sharp, Rodrigo Vivi

When adding IS_KABYLAKE definition I didn't included the
DC states related because I was planing to include them
with the patch that fixes DMC firmware loading, but I
forgot them.

Meanwhile this runtime pm code changed a lot for
Skylake.

Well, I didn't expect that this would crash the machine
and I just noticed now that Sarah warned me our driver
wasn't working. Thanks Sarah.

Michel had found the main error first and his
fix had better details on the history and got
merged already:

commit 16fbc291cb87c7defcd13ad715d3e4af0d523e43
Author: Michel Thierry <michel.thierry@intel.com>
Date:   Wed Jan 6 12:08:36 2016 +0000

    drm/i915/kbl: Enable PW1 and Misc I/O power wells

This one is a follow-up adding the other remaining
missing pieces.

v2: Rebased on top of Michel's patch as explained above.

Cc: Sarah Sharp <sarah.a.sharp@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_csr.c        |  5 +++--
 drivers/gpu/drm/i915/intel_runtime_pm.c | 15 ++++++++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index 9bb63a8..3f69829 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -278,7 +278,8 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
 
 	csr->version = css_header->version;
 
-	if (IS_SKYLAKE(dev) && csr->version < SKL_CSR_VERSION_REQUIRED) {
+	if ((IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) &&
+	     csr->version < SKL_CSR_VERSION_REQUIRED) {
 		DRM_INFO("Refusing to load old Skylake DMC firmware v%u.%u,"
 			 " please upgrade to v%u.%u or later"
 			 " [https://01.org/linuxgraphics/intel-linux-graphics-firmwares].\n",
@@ -421,7 +422,7 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
 	if (!HAS_CSR(dev_priv))
 		return;
 
-	if (IS_SKYLAKE(dev_priv))
+	if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
 		csr->fw_path = I915_CSR_SKL;
 	else if (IS_BROXTON(dev_priv))
 		csr->fw_path = I915_CSR_BXT;
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 4b44e68..89a7dd8 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -532,7 +532,8 @@ static void assert_can_enable_dc5(struct drm_i915_private *dev_priv)
 	bool pg2_enabled = intel_display_power_well_is_enabled(dev_priv,
 					SKL_DISP_PW_2);
 
-	WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC5.\n");
+	WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
+		  "Platform doesn't support DC5.\n");
 	WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
 	WARN_ONCE(pg2_enabled, "PG2 not disabled to enable DC5.\n");
 
@@ -568,7 +569,8 @@ static void assert_can_enable_dc6(struct drm_i915_private *dev_priv)
 {
 	struct drm_device *dev = dev_priv->dev;
 
-	WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC6.\n");
+	WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
+		  "Platform doesn't support DC6.\n");
 	WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
 	WARN_ONCE(I915_READ(UTIL_PIN_CTL) & UTIL_PIN_ENABLE,
 		  "Backlight is not disabled.\n");
@@ -595,7 +597,8 @@ static void gen9_disable_dc5_dc6(struct drm_i915_private *dev_priv)
 {
 	assert_can_disable_dc5(dev_priv);
 
-	if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
+	if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
+	    i915.enable_dc != 0 && i915.enable_dc != 1)
 		assert_can_disable_dc6(dev_priv);
 
 	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
@@ -783,7 +786,8 @@ static void gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv,
 static void gen9_dc_off_power_well_disable(struct drm_i915_private *dev_priv,
 					   struct i915_power_well *power_well)
 {
-	if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
+	if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
+	    i915.enable_dc != 0 && i915.enable_dc != 1)
 		skl_enable_dc6(dev_priv);
 	else
 		gen9_enable_dc5(dev_priv);
@@ -795,7 +799,8 @@ static void gen9_dc_off_power_well_sync_hw(struct drm_i915_private *dev_priv,
 	if (power_well->count > 0) {
 		gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
 	} else {
-		if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 &&
+		if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
+		    i915.enable_dc != 0 &&
 		    i915.enable_dc != 1)
 			gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
 		else
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] drm/i915: Don't warn if the workaround list is empty part 2.
  2016-01-07  1:15 ` [PATCH 2/3] drm/i915: Don't warn if the workaround list is empty part 2 Rodrigo Vivi
@ 2016-01-08  0:49   ` Rodrigo Vivi
  0 siblings, 0 replies; 13+ messages in thread
From: Rodrigo Vivi @ 2016-01-08  0:49 UTC (permalink / raw)
  To: Rodrigo Vivi, intel-gfx, Daniel Vetter


[-- Attachment #1.1: Type: text/plain, Size: 1637 bytes --]

Daniel, Ack?

So I can merge this and the missing IS_KABYLAKE ones...

The preliminary one I agree with you and will put a request for KBL on CI.

Thanks in advance,
Rodrigo.

On Wed, Jan 6, 2016 at 5:15 PM Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:

> From: "Boyer, Wayne" <wayne.boyer@intel.com>
>
> Extend the same reasoning as in the patch listed below.  It's not an
> error for the workaround list to be empty if no workarounds are needed.
>
>     commit 02235808b61cd9382d224b0df263193006dd9913
>     Author: Francisco Jerez <currojerez@riseup.net>
>     Date:   Wed Oct 7 14:44:01 2015 +0300
>         drm/i915: Don't warn if the workaround list is empty.
>
> Signed-off-by: Wayne Boyer <wayne.boyer@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_lrc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c
> b/drivers/gpu/drm/i915/intel_lrc.c
> index 8096c6a..641d21c 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1100,7 +1100,7 @@ static int
> intel_logical_ring_workarounds_emit(struct drm_i915_gem_request *req)
>         struct drm_i915_private *dev_priv = dev->dev_private;
>         struct i915_workarounds *w = &dev_priv->workarounds;
>
> -       if (WARN_ON_ONCE(w->count == 0))
> +       if (w->count == 0)
>                 return 0;
>
>         ring->gpu_caches_dirty = true;
> --
> 2.4.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>

[-- Attachment #1.2: Type: text/html, Size: 2591 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/i915/kbl: Adding missing IS_KABYLAKE checks.
  2016-01-08  0:49   ` [PATCH] " Rodrigo Vivi
@ 2016-02-26  0:23     ` Rodrigo Vivi
  2016-02-29 14:35       ` Jani Nikula
  0 siblings, 1 reply; 13+ messages in thread
From: Rodrigo Vivi @ 2016-02-26  0:23 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: Daniel Vetter, intel-gfx

Hi Jani and Daniel,

I believe I forgot to cc:stable on this one and this is missing on
most branches out there including Linus 4.5-r5.
Is there any chance to get this patch in for 4.5? without this i915 is
not working on KBL.
Good thing is that this platform is still protected by preliminary_hw_support.

Thanks,
Rodrigo.

On Thu, Jan 7, 2016 at 4:49 PM, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> When adding IS_KABYLAKE definition I didn't included the
> DC states related because I was planing to include them
> with the patch that fixes DMC firmware loading, but I
> forgot them.
>
> Meanwhile this runtime pm code changed a lot for
> Skylake.
>
> Well, I didn't expect that this would crash the machine
> and I just noticed now that Sarah warned me our driver
> wasn't working. Thanks Sarah.
>
> Michel had found the main error first and his
> fix had better details on the history and got
> merged already:
>
> commit 16fbc291cb87c7defcd13ad715d3e4af0d523e43
> Author: Michel Thierry <michel.thierry@intel.com>
> Date:   Wed Jan 6 12:08:36 2016 +0000
>
>     drm/i915/kbl: Enable PW1 and Misc I/O power wells
>
> This one is a follow-up adding the other remaining
> missing pieces.
>
> v2: Rebased on top of Michel's patch as explained above.
>
> Cc: Sarah Sharp <sarah.a.sharp@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Reviewed-by: Michel Thierry <michel.thierry@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_csr.c        |  5 +++--
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 15 ++++++++++-----
>  2 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> index 9bb63a8..3f69829 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c
> @@ -278,7 +278,8 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
>
>         csr->version = css_header->version;
>
> -       if (IS_SKYLAKE(dev) && csr->version < SKL_CSR_VERSION_REQUIRED) {
> +       if ((IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) &&
> +            csr->version < SKL_CSR_VERSION_REQUIRED) {
>                 DRM_INFO("Refusing to load old Skylake DMC firmware v%u.%u,"
>                          " please upgrade to v%u.%u or later"
>                          " [https://01.org/linuxgraphics/intel-linux-graphics-firmwares].\n",
> @@ -421,7 +422,7 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
>         if (!HAS_CSR(dev_priv))
>                 return;
>
> -       if (IS_SKYLAKE(dev_priv))
> +       if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
>                 csr->fw_path = I915_CSR_SKL;
>         else if (IS_BROXTON(dev_priv))
>                 csr->fw_path = I915_CSR_BXT;
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 4b44e68..89a7dd8 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -532,7 +532,8 @@ static void assert_can_enable_dc5(struct drm_i915_private *dev_priv)
>         bool pg2_enabled = intel_display_power_well_is_enabled(dev_priv,
>                                         SKL_DISP_PW_2);
>
> -       WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC5.\n");
> +       WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
> +                 "Platform doesn't support DC5.\n");
>         WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
>         WARN_ONCE(pg2_enabled, "PG2 not disabled to enable DC5.\n");
>
> @@ -568,7 +569,8 @@ static void assert_can_enable_dc6(struct drm_i915_private *dev_priv)
>  {
>         struct drm_device *dev = dev_priv->dev;
>
> -       WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC6.\n");
> +       WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
> +                 "Platform doesn't support DC6.\n");
>         WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
>         WARN_ONCE(I915_READ(UTIL_PIN_CTL) & UTIL_PIN_ENABLE,
>                   "Backlight is not disabled.\n");
> @@ -595,7 +597,8 @@ static void gen9_disable_dc5_dc6(struct drm_i915_private *dev_priv)
>  {
>         assert_can_disable_dc5(dev_priv);
>
> -       if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
> +       if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
> +           i915.enable_dc != 0 && i915.enable_dc != 1)
>                 assert_can_disable_dc6(dev_priv);
>
>         gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
> @@ -783,7 +786,8 @@ static void gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv,
>  static void gen9_dc_off_power_well_disable(struct drm_i915_private *dev_priv,
>                                            struct i915_power_well *power_well)
>  {
> -       if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
> +       if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
> +           i915.enable_dc != 0 && i915.enable_dc != 1)
>                 skl_enable_dc6(dev_priv);
>         else
>                 gen9_enable_dc5(dev_priv);
> @@ -795,7 +799,8 @@ static void gen9_dc_off_power_well_sync_hw(struct drm_i915_private *dev_priv,
>         if (power_well->count > 0) {
>                 gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
>         } else {
> -               if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 &&
> +               if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
> +                   i915.enable_dc != 0 &&
>                     i915.enable_dc != 1)
>                         gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
>                 else
> --
> 2.4.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/i915/kbl: Adding missing IS_KABYLAKE checks.
  2016-02-26  0:23     ` Rodrigo Vivi
@ 2016-02-29 14:35       ` Jani Nikula
  2016-03-16 14:31         ` Michel Thierry
  0 siblings, 1 reply; 13+ messages in thread
From: Jani Nikula @ 2016-02-29 14:35 UTC (permalink / raw)
  To: Rodrigo Vivi, Rodrigo Vivi; +Cc: Daniel Vetter, intel-gfx

On Fri, 26 Feb 2016, Rodrigo Vivi <rodrigo.vivi@gmail.com> wrote:
> Hi Jani and Daniel,
>
> I believe I forgot to cc:stable on this one and this is missing on
> most branches out there including Linus 4.5-r5.
> Is there any chance to get this patch in for 4.5? without this i915 is
> not working on KBL.

Is the referenced commit by Michel also required?

    Michel had found the main error first and his
    fix had better details on the history and got
    merged already:
    
    commit 16fbc291cb87c7defcd13ad715d3e4af0d523e43
    Author: Michel Thierry <michel.thierry@intel.com>
    Date:   Wed Jan 6 12:08:36 2016 +0000
    
        drm/i915/kbl: Enable PW1 and Misc I/O power wells

If that's needed, what else is needed? Where does the rabbit hole end?

> Good thing is that this platform is still protected by preliminary_hw_support.

We do not backport cc: stable fixes for platforms that only have
preliminary hw support.

v4.5 is not released yet, and although towards the later -rc's the rules
are pretty much the same as for stable kernels, I might consider
cherry-picking kbl fixes that make platform enabling or early adoption
easier.

BR,
Jani.


>
> Thanks,
> Rodrigo.
>
> On Thu, Jan 7, 2016 at 4:49 PM, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
>> When adding IS_KABYLAKE definition I didn't included the
>> DC states related because I was planing to include them
>> with the patch that fixes DMC firmware loading, but I
>> forgot them.
>>
>> Meanwhile this runtime pm code changed a lot for
>> Skylake.
>>
>> Well, I didn't expect that this would crash the machine
>> and I just noticed now that Sarah warned me our driver
>> wasn't working. Thanks Sarah.
>>
>> Michel had found the main error first and his
>> fix had better details on the history and got
>> merged already:
>>
>> commit 16fbc291cb87c7defcd13ad715d3e4af0d523e43
>> Author: Michel Thierry <michel.thierry@intel.com>
>> Date:   Wed Jan 6 12:08:36 2016 +0000
>>
>>     drm/i915/kbl: Enable PW1 and Misc I/O power wells
>>
>> This one is a follow-up adding the other remaining
>> missing pieces.
>>
>> v2: Rebased on top of Michel's patch as explained above.
>>
>> Cc: Sarah Sharp <sarah.a.sharp@intel.com>
>> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Reviewed-by: Michel Thierry <michel.thierry@intel.com>
>> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_csr.c        |  5 +++--
>>  drivers/gpu/drm/i915/intel_runtime_pm.c | 15 ++++++++++-----
>>  2 files changed, 13 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
>> index 9bb63a8..3f69829 100644
>> --- a/drivers/gpu/drm/i915/intel_csr.c
>> +++ b/drivers/gpu/drm/i915/intel_csr.c
>> @@ -278,7 +278,8 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
>>
>>         csr->version = css_header->version;
>>
>> -       if (IS_SKYLAKE(dev) && csr->version < SKL_CSR_VERSION_REQUIRED) {
>> +       if ((IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) &&
>> +            csr->version < SKL_CSR_VERSION_REQUIRED) {
>>                 DRM_INFO("Refusing to load old Skylake DMC firmware v%u.%u,"
>>                          " please upgrade to v%u.%u or later"
>>                          " [https://01.org/linuxgraphics/intel-linux-graphics-firmwares].\n",
>> @@ -421,7 +422,7 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
>>         if (!HAS_CSR(dev_priv))
>>                 return;
>>
>> -       if (IS_SKYLAKE(dev_priv))
>> +       if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
>>                 csr->fw_path = I915_CSR_SKL;
>>         else if (IS_BROXTON(dev_priv))
>>                 csr->fw_path = I915_CSR_BXT;
>> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> index 4b44e68..89a7dd8 100644
>> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> @@ -532,7 +532,8 @@ static void assert_can_enable_dc5(struct drm_i915_private *dev_priv)
>>         bool pg2_enabled = intel_display_power_well_is_enabled(dev_priv,
>>                                         SKL_DISP_PW_2);
>>
>> -       WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC5.\n");
>> +       WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
>> +                 "Platform doesn't support DC5.\n");
>>         WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
>>         WARN_ONCE(pg2_enabled, "PG2 not disabled to enable DC5.\n");
>>
>> @@ -568,7 +569,8 @@ static void assert_can_enable_dc6(struct drm_i915_private *dev_priv)
>>  {
>>         struct drm_device *dev = dev_priv->dev;
>>
>> -       WARN_ONCE(!IS_SKYLAKE(dev), "Platform doesn't support DC6.\n");
>> +       WARN_ONCE(!IS_SKYLAKE(dev) && !IS_KABYLAKE(dev),
>> +                 "Platform doesn't support DC6.\n");
>>         WARN_ONCE(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
>>         WARN_ONCE(I915_READ(UTIL_PIN_CTL) & UTIL_PIN_ENABLE,
>>                   "Backlight is not disabled.\n");
>> @@ -595,7 +597,8 @@ static void gen9_disable_dc5_dc6(struct drm_i915_private *dev_priv)
>>  {
>>         assert_can_disable_dc5(dev_priv);
>>
>> -       if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
>> +       if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
>> +           i915.enable_dc != 0 && i915.enable_dc != 1)
>>                 assert_can_disable_dc6(dev_priv);
>>
>>         gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
>> @@ -783,7 +786,8 @@ static void gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv,
>>  static void gen9_dc_off_power_well_disable(struct drm_i915_private *dev_priv,
>>                                            struct i915_power_well *power_well)
>>  {
>> -       if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
>> +       if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
>> +           i915.enable_dc != 0 && i915.enable_dc != 1)
>>                 skl_enable_dc6(dev_priv);
>>         else
>>                 gen9_enable_dc5(dev_priv);
>> @@ -795,7 +799,8 @@ static void gen9_dc_off_power_well_sync_hw(struct drm_i915_private *dev_priv,
>>         if (power_well->count > 0) {
>>                 gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
>>         } else {
>> -               if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 &&
>> +               if ((IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) &&
>> +                   i915.enable_dc != 0 &&
>>                     i915.enable_dc != 1)
>>                         gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
>>                 else
>> --
>> 2.4.3
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/i915/kbl: Adding missing IS_KABYLAKE checks.
  2016-02-29 14:35       ` Jani Nikula
@ 2016-03-16 14:31         ` Michel Thierry
  2016-03-16 15:15           ` Jani Nikula
  0 siblings, 1 reply; 13+ messages in thread
From: Michel Thierry @ 2016-03-16 14:31 UTC (permalink / raw)
  To: Jani Nikula, Rodrigo Vivi, Vivi, Rodrigo; +Cc: Daniel Vetter, intel-gfx

On 2/29/2016 2:35 PM, Jani Nikula wrote:
> On Fri, 26 Feb 2016, Rodrigo Vivi <rodrigo.vivi@gmail.com> wrote:
>> Hi Jani and Daniel,
>>
>> I believe I forgot to cc:stable on this one and this is missing on
>> most branches out there including Linus 4.5-r5.
>> Is there any chance to get this patch in for 4.5? without this i915 is
>> not working on KBL.
>
> Is the referenced commit by Michel also required?
>
>      Michel had found the main error first and his
>      fix had better details on the history and got
>      merged already:
>
>      commit 16fbc291cb87c7defcd13ad715d3e4af0d523e43
>      Author: Michel Thierry <michel.thierry@intel.com>
>      Date:   Wed Jan 6 12:08:36 2016 +0000
>
>          drm/i915/kbl: Enable PW1 and Misc I/O power wells
>
> If that's needed, what else is needed? Where does the rabbit hole end?
>
>> Good thing is that this platform is still protected by preliminary_hw_support.
>
> We do not backport cc: stable fixes for platforms that only have
> preliminary hw support.
>
> v4.5 is not released yet, and although towards the later -rc's the rules
> are pretty much the same as for stable kernels, I might consider
> cherry-picking kbl fixes that make platform enabling or early adoption
> easier.
>

Hi Jani,

Now that v4.5 has been released, would you consider _backporting_ these 
two patches to allow kbl to boot?

AFAIK, these are the only patches needed,
drm/i915/kbl: Enable PW1 and Misc I/O power wells
[https://cgit.freedesktop.org/drm-intel/commit/?id=16fbc291cb87c7defcd13ad715d3e4af0d523e43]
and
drm/i915/kbl: Adding missing IS_KABYLAKE checks
[https://cgit.freedesktop.org/drm-intel/commit/?id=8d7a1c4a579c4ecfe360044c24dc1fbf97096752]

Thanks,

-Michel

> BR,
> Jani.
>
>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/i915/kbl: Adding missing IS_KABYLAKE checks.
  2016-03-16 14:31         ` Michel Thierry
@ 2016-03-16 15:15           ` Jani Nikula
  2016-03-16 15:32             ` Daniel Vetter
  0 siblings, 1 reply; 13+ messages in thread
From: Jani Nikula @ 2016-03-16 15:15 UTC (permalink / raw)
  To: Michel Thierry, Rodrigo Vivi, Vivi, Rodrigo; +Cc: Daniel Vetter, intel-gfx

On Wed, 16 Mar 2016, Michel Thierry <michel.thierry@intel.com> wrote:
> [ text/plain ]
> On 2/29/2016 2:35 PM, Jani Nikula wrote:
>> On Fri, 26 Feb 2016, Rodrigo Vivi <rodrigo.vivi@gmail.com> wrote:
>>> Hi Jani and Daniel,
>>>
>>> I believe I forgot to cc:stable on this one and this is missing on
>>> most branches out there including Linus 4.5-r5.
>>> Is there any chance to get this patch in for 4.5? without this i915 is
>>> not working on KBL.
>>
>> Is the referenced commit by Michel also required?
>>
>>      Michel had found the main error first and his
>>      fix had better details on the history and got
>>      merged already:
>>
>>      commit 16fbc291cb87c7defcd13ad715d3e4af0d523e43
>>      Author: Michel Thierry <michel.thierry@intel.com>
>>      Date:   Wed Jan 6 12:08:36 2016 +0000
>>
>>          drm/i915/kbl: Enable PW1 and Misc I/O power wells
>>
>> If that's needed, what else is needed? Where does the rabbit hole end?
>>
>>> Good thing is that this platform is still protected by preliminary_hw_support.
>>
>> We do not backport cc: stable fixes for platforms that only have
>> preliminary hw support.
>>
>> v4.5 is not released yet, and although towards the later -rc's the rules
>> are pretty much the same as for stable kernels, I might consider
>> cherry-picking kbl fixes that make platform enabling or early adoption
>> easier.
>>
>
> Hi Jani,
>
> Now that v4.5 has been released, would you consider _backporting_ these 
> two patches to allow kbl to boot?

As I said we do not backport cc: stable fixes for platforms that only
have preliminary hw support. We can discuss the rules we make for
ourselves, but that discussion shouldn't be linked to specific patches.

So I might have cherry-picked them through fixes *before* v4.5 was
released, but there was no response to my mail... communication fail
from my part I guess, but I kind of expected opinions. "I might
consider" does not mean "I am going to".

(Technically, *I* don't do stable backports. Also, the commits have to
be in Linus' tree before they can be backported to stable. See
Documentation/stable_kernel_rules.txt.)

BR,
Jani.

>
> AFAIK, these are the only patches needed,
> drm/i915/kbl: Enable PW1 and Misc I/O power wells
> [https://cgit.freedesktop.org/drm-intel/commit/?id=16fbc291cb87c7defcd13ad715d3e4af0d523e43]
> and
> drm/i915/kbl: Adding missing IS_KABYLAKE checks
> [https://cgit.freedesktop.org/drm-intel/commit/?id=8d7a1c4a579c4ecfe360044c24dc1fbf97096752]
>
> Thanks,
>
> -Michel
>
>> BR,
>> Jani.
>>
>>
>

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/i915/kbl: Adding missing IS_KABYLAKE checks.
  2016-03-16 15:15           ` Jani Nikula
@ 2016-03-16 15:32             ` Daniel Vetter
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Vetter @ 2016-03-16 15:32 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Daniel Vetter, intel-gfx, Vivi, Rodrigo

On Wed, Mar 16, 2016 at 05:15:37PM +0200, Jani Nikula wrote:
> On Wed, 16 Mar 2016, Michel Thierry <michel.thierry@intel.com> wrote:
> > [ text/plain ]
> > On 2/29/2016 2:35 PM, Jani Nikula wrote:
> >> On Fri, 26 Feb 2016, Rodrigo Vivi <rodrigo.vivi@gmail.com> wrote:
> >>> Hi Jani and Daniel,
> >>>
> >>> I believe I forgot to cc:stable on this one and this is missing on
> >>> most branches out there including Linus 4.5-r5.
> >>> Is there any chance to get this patch in for 4.5? without this i915 is
> >>> not working on KBL.
> >>
> >> Is the referenced commit by Michel also required?
> >>
> >>      Michel had found the main error first and his
> >>      fix had better details on the history and got
> >>      merged already:
> >>
> >>      commit 16fbc291cb87c7defcd13ad715d3e4af0d523e43
> >>      Author: Michel Thierry <michel.thierry@intel.com>
> >>      Date:   Wed Jan 6 12:08:36 2016 +0000
> >>
> >>          drm/i915/kbl: Enable PW1 and Misc I/O power wells
> >>
> >> If that's needed, what else is needed? Where does the rabbit hole end?
> >>
> >>> Good thing is that this platform is still protected by preliminary_hw_support.
> >>
> >> We do not backport cc: stable fixes for platforms that only have
> >> preliminary hw support.
> >>
> >> v4.5 is not released yet, and although towards the later -rc's the rules
> >> are pretty much the same as for stable kernels, I might consider
> >> cherry-picking kbl fixes that make platform enabling or early adoption
> >> easier.
> >>
> >
> > Hi Jani,
> >
> > Now that v4.5 has been released, would you consider _backporting_ these 
> > two patches to allow kbl to boot?
> 
> As I said we do not backport cc: stable fixes for platforms that only
> have preliminary hw support. We can discuss the rules we make for
> ourselves, but that discussion shouldn't be linked to specific patches.
> 
> So I might have cherry-picked them through fixes *before* v4.5 was
> released, but there was no response to my mail... communication fail
> from my part I guess, but I kind of expected opinions. "I might
> consider" does not mean "I am going to".
> 
> (Technically, *I* don't do stable backports. Also, the commits have to
> be in Linus' tree before they can be backported to stable. See
> Documentation/stable_kernel_rules.txt.)

Yup, backproting platform support when upstream isn't yet out of
prelim_hw_support or to kernels where that is still set doesn't make
sense. If you need platform support earlier, you need to make it clear
that we need to clear that milestone earlier. prelim_hw_support taints
your kernel for a reason.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-03-16 15:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-07  1:15 [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks Rodrigo Vivi
2016-01-07  1:15 ` [PATCH 2/3] drm/i915: Don't warn if the workaround list is empty part 2 Rodrigo Vivi
2016-01-08  0:49   ` Rodrigo Vivi
2016-01-07  1:15 ` [PATCH 3/3] drm/i915/kbl: Remove preliminary_hw_support protection from Kabylake Rodrigo Vivi
2016-01-07  9:30   ` Daniel Vetter
2016-01-07 16:14 ` [PATCH 1/3] drm/i915/kbl: Adding missing IS_KABYLAKE checks Michel Thierry
2016-01-08  0:32   ` Vivi, Rodrigo
2016-01-08  0:49   ` [PATCH] " Rodrigo Vivi
2016-02-26  0:23     ` Rodrigo Vivi
2016-02-29 14:35       ` Jani Nikula
2016-03-16 14:31         ` Michel Thierry
2016-03-16 15:15           ` Jani Nikula
2016-03-16 15:32             ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.