drm/i915: HDMI/DP - ELD info refresh support for Haswell
Subsystems (2)
PATCH 1/1 drm/i915: HDMI/DP - ELD info refresh support for Haswell
ELD info should be updated dynamically according to hot plug event. For haswell chip, clear/set the eld valid bit and output enable bit from callback intel_disable/eanble_ddi().
--- drivers/gpu/drm/i915/intel_ddi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/gpu/drm/i915/intel_ddi.c +20 -0
@@ -1274,10 +1274,15 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)static void intel_enable_ddi (struct intel_encoder *intel_encoder) {struct drm_encoder *encoder = &intel_encoder->base; +struct drm_crtc *crtc = encoder->crtc; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe;struct drm_device *dev = encoder->dev;struct drm_i915_private *dev_priv = dev->dev_private;enum port port =intel_ddi_get_encoder_port (intel_encoder);int type = intel_encoder->type; +int aud_cntrl_st2 =HSW_AUD_PIN_ELD_CP_VLD ; +int tmp;if (type ==INTEL_OUTPUT_HDMI ) {/* In HDMI/DVI mode, the port width, and swing/emphasis values
@@ -1290,18 +1295,33 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder)ironlake_edp_backlight_on (intel_dp); } + + tmp =I915_READ (aud_cntrl_st2); + tmp |= ((AUDIO_OUTPUT_ENABLE_A |AUDIO_ELD_VALID_A ) << (pipe *4 )); +I915_WRITE (aud_cntrl_st2, tmp); }static void intel_disable_ddi (struct intel_encoder *intel_encoder) {struct drm_encoder *encoder = &intel_encoder->base; +struct drm_crtc *crtc = encoder->crtc; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe;int type = intel_encoder->type; +int aud_cntrl_st2 =HSW_AUD_PIN_ELD_CP_VLD ; +struct drm_device *dev = encoder->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +int tmp;if (type ==INTEL_OUTPUT_EDP ) {struct intel_dp *intel_dp =enc_to_intel_dp (encoder);ironlake_edp_backlight_off (intel_dp); } + + tmp =I915_READ (aud_cntrl_st2); + tmp &= ~((AUDIO_OUTPUT_ENABLE_A |AUDIO_ELD_VALID_A ) << (pipe *4 )); +I915_WRITE (aud_cntrl_st2, tmp); }int intel_ddi_get_cdclk_freq (struct drm_i915_private *dev_priv)
Signature · 1 line
1.7.9.5
Hi Wang,
I would prefer to use defined HSW_AUD_PIN_ELD_CP_VLD directly at read/write macros instead of creating an variable aud_cntrl_st2. But this is minor, the other question I have here, why are you doing this only for pipe A instead of pipe in use?
Quoted 70 lines · Wang Xingchao
ELD info should be updated dynamically according to hot plug event. For haswell chip, clear/set the eld valid bit and output enable bit from callback intel_disable/eanble_ddi().
Signed-off-by Wang Xingchao <[email protected]>--- drivers/gpu/drm/i915/intel_ddi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)drivers/gpu/drm/i915/intel_ddi.c +20
-1@@ -1274,10 +1274,15 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)static void intel_enable_ddi (struct intel_encoder *intel_encoder) {struct drm_encoder *encoder = &intel_encoder->base; +struct drm_crtc *crtc = encoder->crtc; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe;struct drm_device *dev = encoder->dev;struct drm_i915_private *dev_priv = dev->dev_private;enum port port =intel_ddi_get_encoder_port (intel_encoder);int type = intel_encoder->type; +int aud_cntrl_st2 =HSW_AUD_PIN_ELD_CP_VLD ; +int tmp;if (type ==INTEL_OUTPUT_HDMI ) {/* In HDMI/DVI mode, the port width, and swing/emphasis values @@ -1290,18 +1295,33 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder)ironlake_edp_backlight_on (intel_dp); } + + tmp =I915_READ (aud_cntrl_st2); + tmp |= ((AUDIO_OUTPUT_ENABLE_A |AUDIO_ELD_VALID_A ) << (pipe *4 )); +I915_WRITE (aud_cntrl_st2, tmp); }static void intel_disable_ddi (struct intel_encoder *intel_encoder) {struct drm_encoder *encoder = &intel_encoder->base; +struct drm_crtc *crtc = encoder->crtc; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe;int type = intel_encoder->type; +int aud_cntrl_st2 =HSW_AUD_PIN_ELD_CP_VLD ; +struct drm_device *dev = encoder->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +int tmp;if (type ==INTEL_OUTPUT_EDP ) {struct intel_dp *intel_dp =enc_to_intel_dp (encoder);ironlake_edp_backlight_off (intel_dp); } + + tmp =I915_READ (aud_cntrl_st2); + tmp &= ~((AUDIO_OUTPUT_ENABLE_A |AUDIO_ELD_VALID_A ) << (pipe *4 )); +I915_WRITE (aud_cntrl_st2, tmp); }int intel_ddi_get_cdclk_freq (struct drm_i915_private *dev_priv) --1.7.9.5
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Rodrigo Vivi Blog: http://blog.vivi.eng.br
Hi Vivi,
Quoted 8 lines
-----Original Message-----
From: Rodrigo Vivi [mailto:[email protected]]
Sent: Tuesday, January 15, 2013 1:00 AM
To: Wang, Xingchao
Cc: Daniel Vetter; intel-gfx; Zanoni, Paulo R
Subject: Re: [Intel-gfx] [PATCH] drm/i915: HDMI/DP - ELD info refresh support for Haswell
Quoted 4 lines
Hi Wang,
I would prefer to use defined
HSW_AUD_PIN_ELD_CP_VLDdirectly at read/write macros instead of creating an variableaud_cntrl_st2.
Okay, will modify that in second version patch.
Quoted 3 lines
But this is minor, the other question I have here, why are you doing this only for pipe A instead of pipe in use?
No, the patch is making fix for the current using pipe, not only for pipe A. please note below line:
tmp |= ((AUDIO_OUTPUT_ENABLE_A | AUDIO_ELD_VALID_A) << (pipe * 4));
Thanks
--xingchao
Quoted 81 lines
Quoted 35 lines · Wang Xingchao
ELD info should be updated dynamically according to hot plug event. For haswell chip, clear/set the eld valid bit and output enable bit from callback intel_disable/eanble_ddi().
Signed-off-by Wang Xingchao <[email protected]>--- drivers/gpu/drm/i915/intel_ddi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)drivers/gpu/drm/i915/intel_ddi.c +0
-0@@ -1274,10 +1274,15 @@ static void intel_ddi_post_disable(struct
intel_encoder*intel_encoder) static void intel_enable_ddi(structintel_encoder *intel_encoder) { struct drm_encoder *encoder = &intel_encoder->base;drivers/gpu/drm/i915/intel_ddi.c +5
-0+struct drm_crtc *crtc = encoder->crtc; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe;struct drm_device *dev = encoder->dev;struct drm_i915_private *dev_priv = dev->dev_private;enum port port =intel_ddi_get_encoder_port (intel_encoder);int type = intel_encoder->type; +int aud_cntrl_st2 =HSW_AUD_PIN_ELD_CP_VLD ; +int tmp;if (type ==INTEL_OUTPUT_HDMI ) {/* In HDMI/DVI mode, the port width, and swing/emphasis values @@ -1290,18 +1295,33 @@ static void
intel_enable_ddi(struct intel_encoder *intel_encoder)ironlake_edp_backlight_on(intel_dp); }drivers/gpu/drm/i915/intel_ddi.c static void intel_enable_ddi(struct intel_encoder *intel_encoder)
Quoted 3 lines
drivers/gpu/drm/i915/intel_ddi.c +3
-0+ + tmp =I915_READ (aud_cntrl_st2); + tmp |= ((AUDIO_OUTPUT_ENABLE_A | AUDIO_ELD_VALID_A) <<(pipe * 4));
Quoted 12 lines
drivers/gpu/drm/i915/intel_ddi.c +7
-0+I915_WRITE (aud_cntrl_st2, tmp); }static void intel_disable_ddi (struct intel_encoder *intel_encoder) {struct drm_encoder *encoder = &intel_encoder->base; +struct drm_crtc *crtc = encoder->crtc; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +int pipe = intel_crtc->pipe;int type = intel_encoder->type; +int aud_cntrl_st2 =HSW_AUD_PIN_ELD_CP_VLD ; +struct drm_device *dev = encoder->dev; +struct drm_i915_private *dev_priv = dev->dev_private;drivers/gpu/drm/i915/intel_ddi.c static void intel_enable_ddi(struct intel_encoder *intel_encoder)
Quoted 10 lines
drivers/gpu/drm/i915/intel_ddi.c +4
-0+int tmp;if (type ==INTEL_OUTPUT_EDP ) {struct intel_dp *intel_dp =enc_to_intel_dp (encoder);ironlake_edp_backlight_off (intel_dp); } + + tmp =I915_READ (aud_cntrl_st2); + tmp &= ~((AUDIO_OUTPUT_ENABLE_A | AUDIO_ELD_VALID_A) <<(pipe * 4));
Quoted 11 lines
+
I915_WRITE(aud_cntrl_st2, tmp);
}int
intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv)
--
1.7.9.5_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Rodrigo Vivi
Blog: http://blog.vivi.eng.br