Skip to contentSkip to conversation

drm/i915/dp: there is no audio on port A on non-DDI platforms

PATCH Applied Jani Nikula 4 participants 13 messages May 4, 2015 – May 6, 2015

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

PATCH 1/2 drm/i915/dp: there is no audio on port A on non-DDI platforms

The eDP port A register on PCH split platforms has a slightly different register layout from the other ports, with bit 6 being either alternate scrambler reset or reserved, depending on the generation. Our misinterpretation of the bit as audio has lead to warnings.

Fix this by not enabling audio on port A on non-DDI platforms. The check could be made more specific, but this corresponds to the audio codec enabling code which emits the warning for port A.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89958

---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +3 -2
index 937ba31d8dde..fa71fb4d6542 100644
@@ -1355,7 +1355,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 
 	pipe_config->has_dp_encoder = true;
 	pipe_config->has_drrs = false;
-	pipe_config->has_audio = intel_dp->has_audio;
+	if (HAS_DDI(dev) || port != PORT_A)
+		pipe_config->has_audio = intel_dp->has_audio;
 
 	if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
 		intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
@@ -2228,7 +2229,7 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
 	int dotclock;
 
 	tmp = I915_READ(intel_dp->output_reg);
-	if (tmp & DP_AUDIO_OUTPUT_ENABLE)
+	if (port != PORT_A && tmp & DP_AUDIO_OUTPUT_ENABLE)
 		pipe_config->has_audio = true;
 
 	if ((port == PORT_A) || !HAS_PCH_CPT(dev)) {
Signature · 6 lines
2.1.4

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

PATCH 2/2 drm/i915/audio: do not mess with audio registers if port is invalid

We should no longer enter the codec enable/disable functions in question with port A anyway, but to err on the safe side, keep the warnings. Just bail out early without messing with the registers.

---
 drivers/gpu/drm/i915/intel_audio.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +8 -12
index f72e93a45e11..c4312177b0ee 100644
@@ -269,6 +269,9 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder)
 	DRM_DEBUG_KMS("Disable audio codec on port %c, pipe %c\n",
 		      port_name(port), pipe_name(pipe));
 
+	if (WARN_ON(port == PORT_A))
+		return;
+
 	if (HAS_PCH_IBX(dev_priv->dev)) {
 		aud_config = IBX_AUD_CFG(pipe);
 		aud_cntrl_st2 = IBX_AUD_CNTL_ST2;
@@ -290,12 +293,7 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder)
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	I915_WRITE(aud_config, tmp);
 
-	if (WARN_ON(!port)) {
-		eldv = IBX_ELD_VALID(PORT_B) | IBX_ELD_VALID(PORT_C) |
-			IBX_ELD_VALID(PORT_D);
-	} else {
-		eldv = IBX_ELD_VALID(port);
-	}
+	eldv = IBX_ELD_VALID(port);
 
 	/* Invalidate ELD */
 	tmp = I915_READ(aud_cntrl_st2);
@@ -325,6 +323,9 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
 	DRM_DEBUG_KMS("Enable audio codec on port %c, pipe %c, %u bytes ELD\n",
 		      port_name(port), pipe_name(pipe), drm_eld_size(eld));
 
+	if (WARN_ON(port == PORT_A))
+		return;
+
 	/*
 	 * FIXME: We're supposed to wait for vblank here, but we have vblanks
 	 * disabled during the mode set. The proper fix would be to push the
@@ -349,12 +350,7 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
 		aud_cntrl_st2 = CPT_AUD_CNTRL_ST2;
 	}
 
-	if (WARN_ON(!port)) {
-		eldv = IBX_ELD_VALID(PORT_B) | IBX_ELD_VALID(PORT_C) |
-			IBX_ELD_VALID(PORT_D);
-	} else {
-		eldv = IBX_ELD_VALID(port);
-	}
+	eldv = IBX_ELD_VALID(port);
 
 	/* Invalidate ELD */
 	tmp = I915_READ(aud_cntrl_st2);
Signature · 6 lines
2.1.4

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

Re: [PATCH 2/2] drm/i915/audio: do not mess with audio registers if port is invalid

Task id: 6312 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                                  276/276              276/276
ILK                                  302/302              302/302
SNB                                  316/316              316/316
IVB                                  342/342              342/342
BYT                                  286/286              286/286
BDW                                  321/321              321/321

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] drm/i915/audio: do not mess with audio registers if port is invalid

In reply to Jani Nikula
Quoted 61 lines · Jani Nikula

We should no longer enter the codec enable/disable functions in question with port A anyway, but to err on the safe side, keep the warnings. Just bail out early without messing with the registers.

---
  drivers/gpu/drm/i915/intel_audio.c | 20 ++++++++------------
  1 file changed, 8 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +8 -12
index f72e93a45e11..c4312177b0ee 100644
@@ -269,6 +269,9 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder)
  	DRM_DEBUG_KMS("Disable audio codec on port %c, pipe %c\n",
  		      port_name(port), pipe_name(pipe));
 
+	if (WARN_ON(port == PORT_A))
+		return;
+
  	if (HAS_PCH_IBX(dev_priv->dev)) {
  		aud_config = IBX_AUD_CFG(pipe);
  		aud_cntrl_st2 = IBX_AUD_CNTL_ST2;
@@ -290,12 +293,7 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder)
  		tmp |= AUD_CONFIG_N_VALUE_INDEX;
  	I915_WRITE(aud_config, tmp);
 
-	if (WARN_ON(!port)) {
-		eldv = IBX_ELD_VALID(PORT_B) | IBX_ELD_VALID(PORT_C) |
-			IBX_ELD_VALID(PORT_D);
-	} else {
-		eldv = IBX_ELD_VALID(port);
-	}
+	eldv = IBX_ELD_VALID(port);
 
  	/* Invalidate ELD */
  	tmp = I915_READ(aud_cntrl_st2);
@@ -325,6 +323,9 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
  	DRM_DEBUG_KMS("Enable audio codec on port %c, pipe %c, %u bytes ELD\n",
  		      port_name(port), pipe_name(pipe), drm_eld_size(eld));
 
+	if (WARN_ON(port == PORT_A))
+		return;
+
  	/*
  	 * FIXME: We're supposed to wait for vblank here, but we have vblanks
  	 * disabled during the mode set. The proper fix would be to push the
@@ -349,12 +350,7 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
  		aud_cntrl_st2 = CPT_AUD_CNTRL_ST2;
  	}
 
-	if (WARN_ON(!port)) {
-		eldv = IBX_ELD_VALID(PORT_B) | IBX_ELD_VALID(PORT_C) |
-			IBX_ELD_VALID(PORT_D);
-	} else {
-		eldv = IBX_ELD_VALID(port);
-	}
+	eldv = IBX_ELD_VALID(port);
 
  	/* Invalidate ELD */
  	tmp = I915_READ(aud_cntrl_st2);
Signature · 7 lines
regards,
Sivakumar

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

Re: [PATCH 2/2] drm/i915/audio: do not mess with audio registers if port is invalid

Quoted 8 lines · Sivakumar Thulasimani
Quoted 5 lines · Jani Nikula

We should no longer enter the codec enable/disable functions in question with port A anyway, but to err on the safe side, keep the warnings. Just bail out early without messing with the registers.

Queued for -next, thanks for the patch.
-Daniel

Quoted 59 lines
Quoted 50 lines
---
 drivers/gpu/drm/i915/intel_audio.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +8 -12
index f72e93a45e11..c4312177b0ee 100644
@@ -269,6 +269,9 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder)
 	DRM_DEBUG_KMS("Disable audio codec on port %c, pipe %c\n",
 		      port_name(port), pipe_name(pipe));
+	if (WARN_ON(port == PORT_A))
+		return;
+
 	if (HAS_PCH_IBX(dev_priv->dev)) {
 		aud_config = IBX_AUD_CFG(pipe);
 		aud_cntrl_st2 = IBX_AUD_CNTL_ST2;
@@ -290,12 +293,7 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder)
 		tmp |= AUD_CONFIG_N_VALUE_INDEX;
 	I915_WRITE(aud_config, tmp);
-	if (WARN_ON(!port)) {
-		eldv = IBX_ELD_VALID(PORT_B) | IBX_ELD_VALID(PORT_C) |
-			IBX_ELD_VALID(PORT_D);
-	} else {
-		eldv = IBX_ELD_VALID(port);
-	}
+	eldv = IBX_ELD_VALID(port);
 	/* Invalidate ELD */
 	tmp = I915_READ(aud_cntrl_st2);
@@ -325,6 +323,9 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
 	DRM_DEBUG_KMS("Enable audio codec on port %c, pipe %c, %u bytes ELD\n",
 		      port_name(port), pipe_name(pipe), drm_eld_size(eld));
+	if (WARN_ON(port == PORT_A))
+		return;
+
 	/*
 	 * FIXME: We're supposed to wait for vblank here, but we have vblanks
 	 * disabled during the mode set. The proper fix would be to push the
@@ -349,12 +350,7 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
 		aud_cntrl_st2 = CPT_AUD_CNTRL_ST2;
 	}
-	if (WARN_ON(!port)) {
-		eldv = IBX_ELD_VALID(PORT_B) | IBX_ELD_VALID(PORT_C) |
-			IBX_ELD_VALID(PORT_D);
-	} else {
-		eldv = IBX_ELD_VALID(port);
-	}
+	eldv = IBX_ELD_VALID(port);
 	/* Invalidate ELD */
 	tmp = I915_READ(aud_cntrl_st2);
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
In reply to Jani Nikula
Quoted 8 lines · Jani Nikula

The eDP port A register on PCH split platforms has a slightly different register layout from the other ports, with bit 6 being either alternate scrambler reset or reserved, depending on the generation. Our misinterpretation of the bit as audio has lead to warnings.

Fix this by not enabling audio on port A on non-DDI platforms. The check could be made more specific, but this corresponds to the audio codec enabling code which emits the warning for port A.

shouldn't we disable audio for eDP on all platforms , including DDI ones ?

Quoted 13 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89958

---
  drivers/gpu/drm/i915/intel_dp.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -0
index 937ba31d8dde..fa71fb4d6542 100644

drivers/gpu/drm/i915/intel_dp.c intel_dp_compute_config(struct intel_encoder *encoder, · line 1360

Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c +2 -1
@@ -1355,7 +1355,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 
  	pipe_config->has_dp_encoder = true;
  	pipe_config->has_drrs = false;
-	pipe_config->has_audio = intel_dp->has_audio;
+	if (HAS_DDI(dev) || port != PORT_A)
+		pipe_config->has_audio = intel_dp->has_audio;
 

this still enables audio for PORT_A on for HSW/BDW/etc . the following is better IMO

+ if (!is_edp(encoder))
+ pipe_config->has_audio = intel_dp->has_audio;

Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
Quoted 33 lines · Sivakumar Thulasimani
Quoted 8 lines · Jani Nikula

The eDP port A register on PCH split platforms has a slightly different register layout from the other ports, with bit 6 being either alternate scrambler reset or reserved, depending on the generation. Our misinterpretation of the bit as audio has lead to warnings.

Fix this by not enabling audio on port A on non-DDI platforms. The check could be made more specific, but this corresponds to the audio codec enabling code which emits the warning for port A.

shouldn't we disable audio for eDP on all platforms , including DDI ones ?

Quoted 13 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89958

---
  drivers/gpu/drm/i915/intel_dp.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -0
index 937ba31d8dde..fa71fb4d6542 100644

drivers/gpu/drm/i915/intel_dp.c intel_dp_compute_config(struct intel_encoder *encoder, · line 1360

Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c +2 -1
@@ -1355,7 +1355,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 
  	pipe_config->has_dp_encoder = true;
  	pipe_config->has_drrs = false;
-	pipe_config->has_audio = intel_dp->has_audio;
+	if (HAS_DDI(dev) || port != PORT_A)
+		pipe_config->has_audio = intel_dp->has_audio;
 

this still enables audio for PORT_A on for HSW/BDW/etc . the following is better IMO

Review

Quoted 2 lines
(quoted diff) +2 -0
+	if (!is_edp(encoder))
+		pipe_config->has_audio = intel_dp->has_audio;

I wanted the check to match what's in intel_audio.c for these platforms. And those only need the pipe.

Perhaps it's a theoretical question, but is it impossible for edp to have audio?

Jani.

Quoted 7 lines
Signature · 3 lines
-- 
regards,
Sivakumar
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

two points
1) The eDP spec says Audio is optional so it is allowed to have audio, but i am yet to come across any eDP panel that supports Audio.
2) Also, there is no support for audio in DDI A port as well :)

So please change the check to

if (!is_edp(encoder))

Quoted 53 lines · Jani Nikula
Quoted 33 lines · Sivakumar Thulasimani
Quoted 8 lines · Jani Nikula

The eDP port A register on PCH split platforms has a slightly different register layout from the other ports, with bit 6 being either alternate scrambler reset or reserved, depending on the generation. Our misinterpretation of the bit as audio has lead to warnings.

Fix this by not enabling audio on port A on non-DDI platforms. The check could be made more specific, but this corresponds to the audio codec enabling code which emits the warning for port A.

shouldn't we disable audio for eDP on all platforms , including DDI ones ?

Quoted 13 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89958

---
   drivers/gpu/drm/i915/intel_dp.c | 5 +++--
   1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -0
index 937ba31d8dde..fa71fb4d6542 100644

drivers/gpu/drm/i915/intel_dp.c intel_dp_compute_config(struct intel_encoder *encoder, · line 1360

Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c +2 -1
@@ -1355,7 +1355,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 
   	pipe_config->has_dp_encoder = true;
   	pipe_config->has_drrs = false;
-	pipe_config->has_audio = intel_dp->has_audio;
+	if (HAS_DDI(dev) || port != PORT_A)
+		pipe_config->has_audio = intel_dp->has_audio;
 

this still enables audio for PORT_A on for HSW/BDW/etc . the following is better IMO

Review

Quoted 2 lines
(quoted diff) +2 -0
+	if (!is_edp(encoder))
+		pipe_config->has_audio = intel_dp->has_audio;

I wanted the check to match what's in intel_audio.c for these platforms. And those only need the pipe.

Perhaps it's a theoretical question, but is it impossible for edp to have audio?

Jani.

Quoted 6 lines
Signature · 3 lines
-- 
regards,
Sivakumar
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw
Quoted 8 lines · Sivakumar Thulasimani

two points
1) The eDP spec says Audio is optional so it is allowed to have audio, but i am yet to come across any eDP panel that supports Audio.
2) Also, there is no support for audio in DDI A port as well :)

So please change the check to

if (!is_edp(encoder))

Because the actual limitation we have is "no audio on port A" instead of "no audio on eDP", I insist we check for port A. Patch below.

BR,
Jani.

From ca5d2444065ac91db3ad6cfcdbf8a012a4d44556 Mon Sep 17 00:00:00 2001
From: Jani Nikula <[email protected]>
Date: Thu, 9 Apr 2015 12:41:53 +0300
Subject: [PATCH] drm/i915/dp: there is no audio on port A
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Cc: Jani Nikula <[email protected]>

The eDP port A register on PCH split platforms has a slightly different register layout from the other ports, with bit 6 being either alternate scrambler reset or reserved, depending on the generation. Our misinterpretation of the bit as audio has lead to warning.

Fix this by not enabling audio on port A, since none of our platforms support audio on port A anyway.

v2: DDI doesn't have audio on port A either (Sivakumar Thulasimani)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89958

---
 drivers/gpu/drm/i915/intel_dp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +3 -3
index caeb6ed99ad2..b61bf9b2f76f 100644
@@ -1361,7 +1361,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 
 	pipe_config->has_dp_encoder = true;
 	pipe_config->has_drrs = false;
-	pipe_config->has_audio = intel_dp->has_audio;
+	pipe_config->has_audio = intel_dp->has_audio && port != PORT_A;
 
 	if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
 		intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
@@ -2234,8 +2234,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
 	int dotclock;
 
 	tmp = I915_READ(intel_dp->output_reg);
-	if (tmp & DP_AUDIO_OUTPUT_ENABLE)
-		pipe_config->has_audio = true;
+
+	pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
 
 	if ((port == PORT_A) || !HAS_PCH_CPT(dev)) {
 		if (tmp & DP_SYNC_HS_HIGH)
Signature · 9 lines
2.1.4


-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

sure, you can check for port A alone then. DDI A will have edp in all SKUs so checking for eDP should ideally be the same as DDIA.

Quoted 65 lines · Jani Nikula
Quoted 8 lines · Sivakumar Thulasimani

two points
1) The eDP spec says Audio is optional so it is allowed to have audio, but i am yet to come across any eDP panel that supports Audio.
2) Also, there is no support for audio in DDI A port as well :)

So please change the check to

if (!is_edp(encoder))

Because the actual limitation we have is "no audio on port A" instead of "no audio on eDP", I insist we check for port A. Patch below.

BR,
Jani.

From ca5d2444065ac91db3ad6cfcdbf8a012a4d44556 Mon Sep 17 00:00:00 2001
From: Jani Nikula <[email protected]>
Date: Thu, 9 Apr 2015 12:41:53 +0300
Subject: [PATCH] drm/i915/dp: there is no audio on port A
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Cc: Jani Nikula <[email protected]>

The eDP port A register on PCH split platforms has a slightly different register layout from the other ports, with bit 6 being either alternate scrambler reset or reserved, depending on the generation. Our misinterpretation of the bit as audio has lead to warning.

Fix this by not enabling audio on port A, since none of our platforms support audio on port A anyway.

v2: DDI doesn't have audio on port A either (Sivakumar Thulasimani)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89958

---
  drivers/gpu/drm/i915/intel_dp.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +3 -3
index caeb6ed99ad2..b61bf9b2f76f 100644
@@ -1361,7 +1361,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 
  	pipe_config->has_dp_encoder = true;
  	pipe_config->has_drrs = false;
-	pipe_config->has_audio = intel_dp->has_audio;
+	pipe_config->has_audio = intel_dp->has_audio && port != PORT_A;
 
  	if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
  		intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
@@ -2234,8 +2234,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
  	int dotclock;
 
  	tmp = I915_READ(intel_dp->output_reg);
-	if (tmp & DP_AUDIO_OUTPUT_ENABLE)
-		pipe_config->has_audio = true;
+
+	pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
 
  	if ((port == PORT_A) || !HAS_PCH_CPT(dev)) {
  		if (tmp & DP_SYNC_HS_HIGH)
Signature · 7 lines
regards,
Sivakumar

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw
In reply to Jani Nikula

missed the changes attached. so adding rb tag

Quoted 65 lines · Jani Nikula
Quoted 8 lines · Sivakumar Thulasimani

two points
1) The eDP spec says Audio is optional so it is allowed to have audio, but i am yet to come across any eDP panel that supports Audio.
2) Also, there is no support for audio in DDI A port as well :)

So please change the check to

if (!is_edp(encoder))

Because the actual limitation we have is "no audio on port A" instead of "no audio on eDP", I insist we check for port A. Patch below.

BR,
Jani.

From ca5d2444065ac91db3ad6cfcdbf8a012a4d44556 Mon Sep 17 00:00:00 2001
From: Jani Nikula <[email protected]>
Date: Thu, 9 Apr 2015 12:41:53 +0300
Subject: [PATCH] drm/i915/dp: there is no audio on port A
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Cc: Jani Nikula <[email protected]>

The eDP port A register on PCH split platforms has a slightly different register layout from the other ports, with bit 6 being either alternate scrambler reset or reserved, depending on the generation. Our misinterpretation of the bit as audio has lead to warning.

Fix this by not enabling audio on port A, since none of our platforms support audio on port A anyway.

v2: DDI doesn't have audio on port A either (Sivakumar Thulasimani)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89958

---
  drivers/gpu/drm/i915/intel_dp.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +3 -3
index caeb6ed99ad2..b61bf9b2f76f 100644
@@ -1361,7 +1361,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 
  	pipe_config->has_dp_encoder = true;
  	pipe_config->has_drrs = false;
-	pipe_config->has_audio = intel_dp->has_audio;
+	pipe_config->has_audio = intel_dp->has_audio && port != PORT_A;
 
  	if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
  		intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
@@ -2234,8 +2234,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
  	int dotclock;
 
  	tmp = I915_READ(intel_dp->output_reg);
-	if (tmp & DP_AUDIO_OUTPUT_ENABLE)
-		pipe_config->has_audio = true;
+
+	pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
 
  	if ((port == PORT_A) || !HAS_PCH_CPT(dev)) {
  		if (tmp & DP_SYNC_HS_HIGH)
Signature · 2 lines
regards,
Sivakumar

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

#11 lore raw
Quoted 3 lines · Sivakumar Thulasimani

missed the changes attached. so adding rb tag

Pardon my stubbornness, and thanks for the review! Pushed to drm-intel-fixes.

BR,
Jani.

Quoted 73 lines · Jani Nikula
Quoted 65 lines · Sivakumar Thulasimani
Quoted 8 lines

two points
1) The eDP spec says Audio is optional so it is allowed to have audio, but i am yet to come across any eDP panel that supports Audio.
2) Also, there is no support for audio in DDI A port as well :)

So please change the check to

if (!is_edp(encoder))

Because the actual limitation we have is "no audio on port A" instead of "no audio on eDP", I insist we check for port A. Patch below.

BR,
Jani.

From ca5d2444065ac91db3ad6cfcdbf8a012a4d44556 Mon Sep 17 00:00:00 2001
From: Jani Nikula <[email protected]>
Date: Thu, 9 Apr 2015 12:41:53 +0300
Subject: [PATCH] drm/i915/dp: there is no audio on port A
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Cc: Jani Nikula <[email protected]>

The eDP port A register on PCH split platforms has a slightly different register layout from the other ports, with bit 6 being either alternate scrambler reset or reserved, depending on the generation. Our misinterpretation of the bit as audio has lead to warning.

Fix this by not enabling audio on port A, since none of our platforms support audio on port A anyway.

v2: DDI doesn't have audio on port A either (Sivakumar Thulasimani)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89958

---
  drivers/gpu/drm/i915/intel_dp.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +3 -3
index caeb6ed99ad2..b61bf9b2f76f 100644
@@ -1361,7 +1361,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 
  	pipe_config->has_dp_encoder = true;
  	pipe_config->has_drrs = false;
-	pipe_config->has_audio = intel_dp->has_audio;
+	pipe_config->has_audio = intel_dp->has_audio && port != PORT_A;
 
  	if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
  		intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
@@ -2234,8 +2234,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
  	int dotclock;
 
  	tmp = I915_READ(intel_dp->output_reg);
-	if (tmp & DP_AUDIO_OUTPUT_ENABLE)
-		pipe_config->has_audio = true;
+
+	pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
 
  	if ((port == PORT_A) || !HAS_PCH_CPT(dev)) {
  		if (tmp & DP_SYNC_HS_HIGH)
Signature · 2 lines
regards,
Sivakumar
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw
In reply to Jani Nikula
Quoted 6 lines · Jani Nikula
Quoted 5 lines · Sivakumar Thulasimani

two points
1) The eDP spec says Audio is optional so it is allowed to have audio, but i am yet to come across any eDP panel that supports Audio.
2) Also, there is no support for audio in DDI A port as well :)

Quoted 6 lines
Quoted 3 lines

So please change the check to

if (!is_edp(encoder))

Because the actual limitation we have is "no audio on port A" instead of "no audio on eDP", I insist we check for port A. Patch below.

Yes this is the correct check. On desktop all-in-ones edp is usually on port D, which does support audio.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx