Skip to contentSkip to conversation

drm/i915: Get audio power domain during initial hw readout

PATCH In review Bob Paauwe 4 participants 10 messages Apr 12, 2016 – Apr 23, 2016

Subsystems (2)
lore
Share & tools
lore

Bob Paauwe

author
#0 lore raw

PATCH 1/1 drm/i915: Get audio power domain during initial hw readout

if the crtc has audio is enabled. Otherwise, when the first atomic modeset happens it will warn when trying to drop the audio power domain.

---
 drivers/gpu/drm/i915/intel_display.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_display.c +5 -0
index 5155efb6..caeb3e1 100644
@@ -10561,6 +10561,7 @@ found:
 	}
 
 	ret = intel_modeset_setup_plane_state(state, crtc, mode, fb, 0, 0);
+
 	if (ret)
 		goto fail;
 
@@ -15998,6 +15999,10 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 
 		memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
 		if (crtc->base.state->active) {
+			if (crtc->config->has_audio)
+				intel_display_power_get(dev_priv,
+							POWER_DOMAIN_AUDIO);
+
 			intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);
 			intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);
 			WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 22 lines · Bob Paauwe

if the crtc has audio is enabled. Otherwise, when the first atomic modeset happens it will warn when trying to drop the audio power domain.

---
 drivers/gpu/drm/i915/intel_display.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 5155efb6..caeb3e1 100644
@@ -10561,6 +10561,7 @@ found:
 	}
 
 	ret = intel_modeset_setup_plane_state(state, crtc, mode, fb, 0, 0);
+
 	if (ret)
 		goto fail;
 

drivers/gpu/drm/i915/intel_display.c static void intel_modeset_readout_hw_state(struct drm_device *dev) · line 16005

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -15998,6 +15999,10 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 
 		memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
 		if (crtc->base.state->active) {
+			if (crtc->config->has_audio)
+				intel_display_power_get(dev_priv,
+							POWER_DOMAIN_AUDIO);
+

Hmm. Ideally we would do this alongside the other power doamin stuff in intel_modeset_setup_hw_state(), but that's too late for intel_sanitize_{crtc,encoder}(). So I guess we'll have to do it before those, or we have to pull the audio power domain stuff out from the encoder hooks. Or perhaps even throw it out entirely, since I'm not sure it's doing anything for us.

If we do leave the power domain handling in the encoder hooks, then this is not quite the right place to grab the reference. We could have an encoder enabled w/o an active pipe, in which case intel_sanitize_encoder() would shut off the encoder, so we'd still end up with a bad refcount.

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 			intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);
 			intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);
 			WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#2 lore raw
Quoted 38 lines · On Wed, 13 Apr 2016 11:59:43 +0300 Ville Syrjälä…
Quoted 22 lines · Bob Paauwe

if the crtc has audio is enabled. Otherwise, when the first atomic modeset happens it will warn when trying to drop the audio power domain.

---
 drivers/gpu/drm/i915/intel_display.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 5155efb6..caeb3e1 100644
@@ -10561,6 +10561,7 @@ found:
 	}
 
 	ret = intel_modeset_setup_plane_state(state, crtc, mode, fb, 0, 0);
+
 	if (ret)
 		goto fail;
 

drivers/gpu/drm/i915/intel_display.c static void intel_modeset_readout_hw_state(struct drm_device *dev) · line 16005

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -15998,6 +15999,10 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 
 		memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
 		if (crtc->base.state->active) {
+			if (crtc->config->has_audio)
+				intel_display_power_get(dev_priv,
+							POWER_DOMAIN_AUDIO);
+  

Hmm. Ideally we would do this alongside the other power doamin stuff in intel_modeset_setup_hw_state(), but that's too late for intel_sanitize_{crtc,encoder}(). So I guess we'll have to do it before those, or we have to pull the audio power domain stuff out from the encoder hooks. Or perhaps even throw it out entirely, since I'm not sure it's doing anything for us.

Quoted 6 lines

If we do leave the power domain handling in the encoder hooks, then this is not quite the right place to grab the reference. We could have an encoder enabled w/o an active pipe, in which case intel_sanitize_encoder() would shut off the encoder, so we'd still end up with a bad refcount.

Thanks Ville for the details. I'm not at all familiar with how this is supposed to work so this helps some. But I'm still not sure I follow.

If I move this to get_crtc_power_domains() by sticking

if (crtc_state->has_audio)

	mask |= BIT(POWER_DOMAIN_AUDIO);

at the end, which is where I think you're suggesting initially, it seems to work. So I'm not sure why that's too late. Also, I'm not seeing where shutting off the encoder will effect the power domain refcounts.

Bob

Quoted 11 lines
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 			intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);
 			intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);
 			WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx  
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 53 lines · Bob Paauwe
Quoted 38 lines · On Wed, 13 Apr 2016 11:59:43 +0300 Ville Syrjälä…
Quoted 22 lines · Bob Paauwe

if the crtc has audio is enabled. Otherwise, when the first atomic modeset happens it will warn when trying to drop the audio power domain.

---
 drivers/gpu/drm/i915/intel_display.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 5155efb6..caeb3e1 100644
@@ -10561,6 +10561,7 @@ found:
 	}
 
 	ret = intel_modeset_setup_plane_state(state, crtc, mode, fb, 0, 0);
+
 	if (ret)
 		goto fail;
 

drivers/gpu/drm/i915/intel_display.c static void intel_modeset_readout_hw_state(struct drm_device *dev) · line 16005

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -15998,6 +15999,10 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 
 		memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
 		if (crtc->base.state->active) {
+			if (crtc->config->has_audio)
+				intel_display_power_get(dev_priv,
+							POWER_DOMAIN_AUDIO);
+  

Hmm. Ideally we would do this alongside the other power doamin stuff in intel_modeset_setup_hw_state(), but that's too late for intel_sanitize_{crtc,encoder}(). So I guess we'll have to do it before those, or we have to pull the audio power domain stuff out from the encoder hooks. Or perhaps even throw it out entirely, since I'm not sure it's doing anything for us.

Quoted 6 lines

If we do leave the power domain handling in the encoder hooks, then this is not quite the right place to grab the reference. We could have an encoder enabled w/o an active pipe, in which case intel_sanitize_encoder() would shut off the encoder, so we'd still end up with a bad refcount.

Thanks Ville for the details. I'm not at all familiar with how this is supposed to work so this helps some. But I'm still not sure I follow.

If I move this to get_crtc_power_domains() by sticking

Quoted 7 lines
   if (crtc_state->has_audio)
	mask |= BIT(POWER_DOMAIN_AUDIO);

at the end, which is where I think you're suggesting initially, it seems to work. So I'm not sure why that's too late. Also, I'm not seeing where shutting off the encoder will effect the power domain refcounts.

Some of the encoder hooks will do the POWER_DOMAIN_AUDIO put/get, so if sanitize_{crtc,encoder}() call just the disable hooks, we'll drop one to many power references.

That said, I'm still not sure why we do the audio power domain frobbing in the encoder code. That is, how can we end up enabling/disabling a port with has_audio==true without the relevant power wells being on already.

Looks like some of this stuff was added in
commit d45a0bf549cd ("drm/i915: grab the audio power domain when enabling audio on HSW+") so maybe Paulo knows?

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#4 lore raw
Quoted 66 lines · On Wed, 13 Apr 2016 21:27:17 +0300 Ville Syrjälä…
Quoted 53 lines · Bob Paauwe
Quoted 38 lines · On Wed, 13 Apr 2016 11:59:43 +0300 Ville Syrjälä…
Quoted 22 lines · Bob Paauwe

if the crtc has audio is enabled. Otherwise, when the first atomic modeset happens it will warn when trying to drop the audio power domain.

---
 drivers/gpu/drm/i915/intel_display.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 5155efb6..caeb3e1 100644
@@ -10561,6 +10561,7 @@ found:
 	}
 
 	ret = intel_modeset_setup_plane_state(state, crtc, mode, fb, 0, 0);
+
 	if (ret)
 		goto fail;
 

drivers/gpu/drm/i915/intel_display.c static void intel_modeset_readout_hw_state(struct drm_device *dev) · line 16005

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -15998,6 +15999,10 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 
 		memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
 		if (crtc->base.state->active) {
+			if (crtc->config->has_audio)
+				intel_display_power_get(dev_priv,
+							POWER_DOMAIN_AUDIO);
+    

Hmm. Ideally we would do this alongside the other power doamin stuff in intel_modeset_setup_hw_state(), but that's too late for intel_sanitize_{crtc,encoder}(). So I guess we'll have to do it before those, or we have to pull the audio power domain stuff out from the encoder hooks. Or perhaps even throw it out entirely, since I'm not sure it's doing anything for us.

Quoted 6 lines

If we do leave the power domain handling in the encoder hooks, then this is not quite the right place to grab the reference. We could have an encoder enabled w/o an active pipe, in which case intel_sanitize_encoder() would shut off the encoder, so we'd still end up with a bad refcount.

Thanks Ville for the details. I'm not at all familiar with how this is supposed to work so this helps some. But I'm still not sure I follow.

If I move this to get_crtc_power_domains() by sticking

Quoted 7 lines
   if (crtc_state->has_audio)
	mask |= BIT(POWER_DOMAIN_AUDIO);

at the end, which is where I think you're suggesting initially, it seems to work. So I'm not sure why that's too late. Also, I'm not seeing where shutting off the encoder will effect the power domain refcounts.

Some of the encoder hooks will do the POWER_DOMAIN_AUDIO put/get, so if sanitize_{crtc,encoder}() call just the disable hooks, we'll drop one to many power references.

Quoted 7 lines

That said, I'm still not sure why we do the audio power domain frobbing in the encoder code. That is, how can we end up enabling/disabling a port with has_audio==true without the relevant power wells being on already.

Looks like some of this stuff was added in
commit d45a0bf549cd ("drm/i915: grab the audio power domain when enabling audio on HSW+") so maybe Paulo knows?

I tried removing audio power domain frobbing from the encoder code (for DP) and it didn't cause any problems on BXT. But I haven't been able to run the pm_rpm tests on my BXT yet to verify that it doesn't cause any regressions that way.

In any case, I sent a v2 that should have it setting the mask in the correct place to at least resolve the warning messages I'm seeing.

Bob

Quoted 1 line
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

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

✗ Fi.CI.BAT: failure for drm/i915: Get audio power domain during initial hw readout

In reply to Bob Paauwe
== Series Details ==

== Series Details ==

Series: drm/i915: Get audio power domain during initial hw readout
URL : https://patchwork.freedesktop.org/series/5622/
State : failure

== Summary ==

Series 5622v1 drm/i915: Get audio power domain during initial hw readout
http://patchwork.freedesktop.org/api/1.0/series/5622/revisions/1/mbox/

Test gem_exec_suspend:

        Subgroup basic-s3:
                incomplete -> PASS       (hsw-gt2)
Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                pass       -> FAIL       (snb-x220t)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                pass       -> INCOMPLETE (skl-nuci5)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> FAIL       (snb-dellxps)
        Subgroup basic-rte:
                pass       -> FAIL       (snb-dellxps)
bdw-nuci7        total:203  pass:191  dwarn:0   dfail:0   fail:0   skip:12 
bdw-ultra        total:203  pass:180  dwarn:0   dfail:0   fail:0   skip:23 
bsw-nuc-2        total:202  pass:163  dwarn:0   dfail:0   fail:0   skip:39 
byt-nuc          total:202  pass:164  dwarn:0   dfail:0   fail:0   skip:38 
hsw-brixbox      total:203  pass:179  dwarn:0   dfail:0   fail:0   skip:24 
hsw-gt2          total:203  pass:184  dwarn:0   dfail:0   fail:0   skip:19 
ilk-hp8440p      total:203  pass:135  dwarn:0   dfail:0   fail:0   skip:68 
ivb-t430s        total:203  pass:175  dwarn:0   dfail:0   fail:0   skip:28 
skl-i7k-2        total:203  pass:178  dwarn:0   dfail:0   fail:0   skip:25 
skl-nuci5        total:178  pass:168  dwarn:0   dfail:0   fail:0   skip:9  
snb-dellxps      total:203  pass:163  dwarn:0   dfail:0   fail:2   skip:38 
snb-x220t        total:203  pass:164  dwarn:0   dfail:0   fail:2   skip:37 

Results at /archive/results/CI_IGT_test/Patchwork_1882/

631ffd2f45bb43964f729e8661532fb115f5eeec drm-intel-nightly: 2016y-04m-13d-13h-00m-18s UTC integration manifest 3940b8c drm/i915: Get audio power domain during initial hw readout

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

author
#6 lore raw

PATCH 1/1 drm/i915: Get audio power domain during initial hw readout (v2)

In reply to Bob Paauwe

if the crtc has audio is enabled. Otherwise, when the first atomic modeset happens it will warn when trying to drop the audio power domain.

v2: move this to get_crtc_power_domains to be consistent with other
power domain setup (Ville)

Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
index f29f2f6..96f7a87 100644
@@ -5264,6 +5264,9 @@ static unsigned long get_crtc_power_domains(struct drm_crtc *crtc,
 	if (crtc_state->shared_dpll)
 		mask |= BIT(POWER_DOMAIN_PLLS);
 
+	if (crtc_state->has_audio)
+		mask |= BIT(POWER_DOMAIN_AUDIO);
+
 	return mask;
 }
 
Signature · 6 lines
2.5.5

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

Re: [isg-gms] [PATCH] drm/i915: Get audio power domain during initial hw readout (v2)

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Paauwe, Bob J
Sent: Wednesday, April 20, 2016 1:38 PM
To: isg-gms <[email protected]>; intel-gfx <[email protected]>
Cc: Paauwe, Bob J <[email protected]>; Ville Syrjälä <[email protected]>
Subject: [isg-gms] [PATCH] drm/i915: Get audio power domain during initial hw readout (v2)

if the crtc has audio is enabled. Otherwise, when the first atomic modeset happens it will warn when trying to drop the audio power domain.

v2: move this to get_crtc_power_domains to be consistent with other
power domain setup (Ville)

---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
index f29f2f6..96f7a87 100644
@@ -5264,6 +5264,9 @@ static unsigned long get_crtc_power_domains(struct drm_crtc *crtc,
 	if (crtc_state->shared_dpll)
 		mask |= BIT(POWER_DOMAIN_PLLS);
 
+	if (crtc_state->has_audio)
+		mask |= BIT(POWER_DOMAIN_AUDIO);
+
 	return mask;
 }
 

--
2.5.5

-------------------------------------
[email protected]
https://eclists.intel.com/sympa/info/isg-gms
Unsubscribe by sending email to [email protected] with subject "Unsubscribe isg-gms"
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Get audio power domain during initial hw readout (rev2)

In reply to Bob Paauwe
== Series Details ==

== Series Details ==

Series: drm/i915: Get audio power domain during initial hw readout (rev2)
URL : https://patchwork.freedesktop.org/series/5622/
State : failure

== Summary ==

Series 5622v2 drm/i915: Get audio power domain during initial hw readout
http://patchwork.freedesktop.org/api/1.0/series/5622/revisions/2/mbox/

Test gem_close_race:

        Subgroup basic-threads:
                fail       -> PASS       (bdw-ultra)
Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                pass       -> FAIL       (byt-nuc)
        Subgroup basic-plain-flip:
                pass       -> DMESG-WARN (bsw-nuc-2)
Test kms_force_connector_basic:
        Subgroup force-connector-state:
                pass       -> SKIP       (ivb-t430s)
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-c:
                incomplete -> PASS       (bdw-nuci7)
bdw-nuci7        total:194  pass:182  dwarn:0   dfail:0   fail:0   skip:12 
bdw-ultra        total:194  pass:171  dwarn:0   dfail:0   fail:0   skip:23 
bsw-nuc-2        total:193  pass:152  dwarn:1   dfail:0   fail:0   skip:40 
byt-nuc          total:193  pass:154  dwarn:0   dfail:0   fail:1   skip:38 
hsw-brixbox      total:194  pass:170  dwarn:0   dfail:0   fail:0   skip:24 
hsw-gt2          total:194  pass:175  dwarn:0   dfail:0   fail:0   skip:19 
ilk-hp8440p      total:194  pass:137  dwarn:0   dfail:0   fail:0   skip:57 
ivb-t430s        total:194  pass:165  dwarn:0   dfail:0   fail:0   skip:29 
skl-i7k-2        total:194  pass:168  dwarn:0   dfail:0   fail:1   skip:25 
skl-nuci5        total:194  pass:183  dwarn:0   dfail:0   fail:0   skip:11 
snb-dellxps      total:193  pass:155  dwarn:0   dfail:0   fail:0   skip:38 
snb-x220t        total:193  pass:155  dwarn:0   dfail:0   fail:1   skip:37 

Results at /archive/results/CI_IGT_test/Patchwork_1971/

9dabb0053b63bc32ab6ad5d13209d1e43395313f drm-intel-nightly: 2016y-04m-21d-09h-27m-12s UTC integration manifest 51da346 drm/i915: Get audio power domain during initial hw readout (v2)

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

#9 lore raw

✓ Fi.CI.BAT: success for drm/i915: Get audio power domain during initial hw readout (rev2)

In reply to Bob Paauwe
== Series Details ==

== Series Details ==

Series: drm/i915: Get audio power domain during initial hw readout (rev2)
URL : https://patchwork.freedesktop.org/series/5622/
State : success

== Summary ==

Series 5622v2 drm/i915: Get audio power domain during initial hw readout
http://patchwork.freedesktop.org/api/1.0/series/5622/revisions/2/mbox/

bdw-nuci7        total:193  pass:181  dwarn:0   dfail:0   fail:0   skip:12 
bdw-ultra        total:193  pass:170  dwarn:0   dfail:0   fail:0   skip:23 
bsw-nuc-2        total:192  pass:153  dwarn:0   dfail:0   fail:0   skip:39 
byt-nuc          total:192  pass:154  dwarn:0   dfail:0   fail:0   skip:38 
ilk-hp8440p      total:193  pass:136  dwarn:0   dfail:0   fail:0   skip:57 
ivb-t430s        total:193  pass:165  dwarn:0   dfail:0   fail:0   skip:28 
skl-i7k-2        total:193  pass:168  dwarn:0   dfail:0   fail:0   skip:25 
skl-nuci5        total:193  pass:182  dwarn:0   dfail:0   fail:0   skip:11 
snb-dellxps      total:193  pass:155  dwarn:0   dfail:0   fail:0   skip:38 
snb-x220t        total:193  pass:155  dwarn:0   dfail:0   fail:1   skip:37 

Results at /archive/results/CI_IGT_test/Patchwork_2014/

340c485ad98d0ec0369a3b18d4a09938f3f5537d drm-intel-nightly: 2016y-04m-22d-17h-32m-25s UTC integration manifest 0303bb8 drm/i915: Get audio power domain during initial hw readout (v2)

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