Skip to contentSkip to conversation

drm/i915: Disable DC5 before going to DC9

PATCH In review Rodrigo Vivi 4 participants 5 messages Apr 20, 2022

Subsystems (3)
lore
Share & tools
lore

Rodrigo Vivi

author maintainer
#0 lore raw

PATCH 1/1 drm/i915: Disable DC5 before going to DC9

According to BSPec:
Sequence to Allow DC9:
1. Follow Sequence to Disallow DC5.

which is:
Sequence to Disallow DC5 and DC6
Set DC_STATE_EN Dynamic DC State Enable = "Disable".

I understand that we haven't had any issue so far. But since DC9 is a software thing, it is better to disable DC5 before to avoid any conflict. And respect the spec to avoid potential future issues.

Cc Imre Deak <[email protected]>
Cc Anshuman Gupta <[email protected]>
Cc Anusha Srivatsa <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display_power.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/display/intel_display_power.c +3 -0
index 6a5695008f7c..b3cf5182044f 100644
@@ -883,6 +883,9 @@ static void bxt_enable_dc9(struct drm_i915_private *dev_priv)
 {
 	assert_can_enable_dc9(dev_priv);
 
+	/* Disable DC5 before enabling DC9 */
+	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
+
 	drm_dbg_kms(&dev_priv->drm, "Enabling DC9\n");
 	/*
 	 * Power sequencer reset is not needed on
Signature · 1 line
2.34.1
#1 lore raw
Quoted 37 lines

-----Original Message-----
From: Vivi, Rodrigo <[email protected]>
Sent: Wednesday, April 20, 2022 12:09 PM
To: [email protected]
Cc: Vivi, Rodrigo <[email protected]>; Deak, Imre <[email protected]>; Gupta, Anshuman <[email protected]>; Srivatsa, Anusha <[email protected]>
Subject: [PATCH] drm/i915: Disable DC5 before going to DC9

According to BSPec:
Sequence to Allow DC9:
1. Follow Sequence to Disallow DC5.

which is:
Sequence to Disallow DC5 and DC6
Set DC_STATE_EN Dynamic DC State Enable = "Disable".

I understand that we haven't had any issue so far. But since
DC9 is a software thing, it is better to disable DC5 before to avoid any conflict. And respect the spec to avoid potential future issues.

Cc Imre Deak <[email protected]>
Cc Anshuman Gupta <[email protected]>
Cc Anusha Srivatsa <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display_power.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
index 6a5695008f7c..b3cf5182044f 100644

drivers/gpu/drm/i915/display/intel_display_power.c static void bxt_enable_dc9(struct drm_i915_private · line 884

Quoted 2 lines
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
@@ -883,6 +883,9 @@ static void bxt_enable_dc9(struct drm_i915_private
 *dev_priv)  {
 	assert_can_enable_dc9(dev_priv);

^ We are already checking if DC5 is enabled. If enabled then don't enable DC9. SO the change should be- if driver cannot enableDC9 because DC5 is enabled then go ahead and disable DC5.

Anusha

Quoted 8 lines
drivers/gpu/drm/i915/display/intel_display_power.c +3 -1
+	/* Disable DC5 before enabling DC9 */
+	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
+
 	drm_dbg_kms(&dev_priv->drm, "Enabling DC9\n");
 	/*
 	 * Power sequencer reset is not needed on
--

2.34.1

#2 lore raw
In reply to Rodrigo Vivi
Quoted 26 lines · Rodrigo Vivi

According to BSPec:
Sequence to Allow DC9:
1. Follow Sequence to Disallow DC5.

which is:
Sequence to Disallow DC5 and DC6
Set DC_STATE_EN Dynamic DC State Enable = "Disable".

I understand that we haven't had any issue so far. But since DC9 is a software thing, it is better to disable DC5 before to avoid any conflict. And respect the spec to avoid potential future issues.

Cc Imre Deak <[email protected]>
Cc Anshuman Gupta <[email protected]>
Cc Anusha Srivatsa <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display_power.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
index 6a5695008f7c..b3cf5182044f 100644

drivers/gpu/drm/i915/display/intel_display_power.c static void bxt_enable_dc9(struct drm_i915_private *dev_priv) · line 887

Quoted 5 lines
drivers/gpu/drm/i915/display/intel_display_power.c +2 -0
@@ -883,6 +883,9 @@ static void bxt_enable_dc9(struct drm_i915_private *dev_priv)
 {
 	assert_can_enable_dc9(dev_priv);
 
+	/* Disable DC5 before enabling DC9 */
+	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);

For DC9 DMC should be disabled already, along with DC states and other dependencies like power well 1, etc. That happens in bxt/icl_display_core_uninit().

Quoted 7 lines
drivers/gpu/drm/i915/display/intel_display_power.c +1 -0
+
 	drm_dbg_kms(&dev_priv->drm, "Enabling DC9\n");
 	/*
 	 * Power sequencer reset is not needed on
Signature · 1 line
2.34.1
author maintainer
#3 lore raw
Quoted 30 lines · Imre Deak
Quoted 29 lines · Rodrigo Vivi

According to BSPec:
Sequence to Allow DC9:
1. Follow Sequence to Disallow DC5.

which is:
Sequence to Disallow DC5 and DC6
Set DC_STATE_EN Dynamic DC State Enable = "Disable".

I understand that we haven't had any issue so far. But since DC9 is a software thing, it is better to disable DC5 before to avoid any conflict. And respect the spec to avoid potential future issues.

Cc Imre Deak <[email protected]>
Cc Anshuman Gupta <[email protected]>
Cc Anusha Srivatsa <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display_power.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/display/intel_display_power.c +0 -0
index 6a5695008f7c..b3cf5182044f 100644
@@ -883,6 +883,9 @@ static void bxt_enable_dc9(struct drm_i915_private *dev_priv)
 {
 	assert_can_enable_dc9(dev_priv);
 
Quoted 6 lines

drivers/gpu/drm/i915/display/intel_display_power.c static void bxt_enable_dc9(struct drm_i915_private *dev_priv) · line 887

Quoted 2 lines
drivers/gpu/drm/i915/display/intel_display_power.c +2 -0
+	/* Disable DC5 before enabling DC9 */
+	gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);

For DC9 DMC should be disabled already, along with DC states and other dependencies like power well 1, etc. That happens in bxt/icl_display_core_uninit().

but that wasn't on the suspend_late path... but Anusha is right and probably the check in the assert is already enough for now... if we notice that assert is coming we do something else...

I was willing to avoid indirection and the risk of changing something and this dc5 disable getting forgotten, but with the assert we are probably good...

let's just ignore this patch...

Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_display_power.c +1 -0
+
 	drm_dbg_kms(&dev_priv->drm, "Enabling DC9\n");
 	/*
 	 * Power sequencer reset is not needed on
Signature · 1 line
2.34.1
#4 lore raw

[Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Disable DC5 before going to DC9

In reply to Rodrigo Vivi
== Series Details ==

== Series Details ==

Series: drm/i915: Disable DC5 before going to DC9
URL : https://patchwork.freedesktop.org/series/102881/
State : failure

== Summary ==

Error: patch https://patchwork.freedesktop.org/api/1.0/series/102881/revisions/1/mbox/ not applied
Applying: drm/i915: Disable DC5 before going to DC9
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/display/intel_display_power.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/display/intel_display_power.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/display/intel_display_power.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 drm/i915: Disable DC5 before going to DC9
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".