drm/i915/hsw: add flag has_audio in crtc config
Subsystems (2)
PATCH v3 2/2 drm/i915/hsw: add flag has_audio in crtc config
From: Mengdong Lin <[email protected]>
This patch adds a flag "has_audio" for audio presence in intel_crtc->config. HMDI and DP encoders set this flag in their computer_config() if the external monitor supports audio. Later audio sequence will check this flag.
drivers/gpu/drm/i915/intel_ddi.c +2 -3
@@ -295,7 +295,6 @@ static void intel_ddi_mode_set(struct drm_encoder *encoder,DRM_DEBUG_KMS ("Preparing DDI mode on port %c, pipe %c\n" ,port_name (port),pipe_name (pipe)); - intel_crtc->eld_vld = false;if (type ==INTEL_OUTPUT_DISPLAYPORT || type ==INTEL_OUTPUT_EDP ) {struct intel_dp *intel_dp =enc_to_intel_dp (encoder); struct intel_digital_port *intel_dig_port =
@@ -1164,7 +1163,7 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder)ironlake_edp_backlight_on (intel_dp); } -if (intel_crtc->eld_vld && type !=INTEL_OUTPUT_EDP ) { +if (intel_crtc->config.has_audio) { tmp =I915_READ (HSW_AUD_PIN_ELD_CP_VLD ); tmp |= ((AUDIO_OUTPUT_ENABLE_A |AUDIO_ELD_VALID_A ) << (pipe *4 ));I915_WRITE (HSW_AUD_PIN_ELD_CP_VLD , tmp);
@@ -1178,7 +1177,7 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)struct intel_crtc *intel_crtc =to_intel_crtc (crtc);int type = intel_encoder->type; -if (intel_crtc->eld_vld && type !=INTEL_OUTPUT_EDP ) +if (intel_crtc->config.has_audio)intel_disable_audio (intel_encoder);if (type ==INTEL_OUTPUT_EDP ) {
drivers/gpu/drm/i915/intel_display.c +0 -4
@@ -3784,13 +3784,11 @@ static void intel_crtc_disable(struct drm_crtc *crtc)struct drm_device *dev = crtc->dev;struct drm_connector *connector;struct drm_i915_private *dev_priv = dev->dev_private; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc);/* crtc should still be enabled when we disable it. */ WARN_ON (!crtc->enabled); dev_priv->display.crtc_disable (crtc); - intel_crtc->eld_vld = false;intel_crtc_update_sarea (crtc, false); dev_priv->display.off (crtc);
@@ -6114,7 +6112,6 @@ static void haswell_write_eld(struct drm_connector *connector,struct drm_i915_private *dev_priv = connector->dev->dev_private;uint8_t *eld = connector->eld;struct drm_device *dev = crtc->dev; -struct intel_crtc *intel_crtc =to_intel_crtc (crtc);uint32_t eldv;uint32_t i;int len;
@@ -6156,7 +6153,6 @@ static void haswell_write_eld(struct drm_connector *connector,DRM_DEBUG_DRIVER ("ELD on pipe %c\n" ,pipe_name (pipe)); eldv =AUDIO_ELD_VALID_A << (pipe *4 ); - intel_crtc->eld_vld = true;if (intel_pipe_has_type (crtc,INTEL_OUTPUT_DISPLAYPORT )) {DRM_DEBUG_DRIVER ("ELD: DisplayPort detected\n" );
drivers/gpu/drm/i915/intel_dp.c +2 -0
@@ -764,6 +764,8 @@ found:intel_dp_set_clock (encoder, pipe_config, intel_dp->link_bw); + pipe_config->has_audio = intel_dp->has_audio; +return true; }
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -290,6 +290,7 @@ struct intel_crtc_config {struct intel_link_m_n fdi_m_n;bool ips_enabled; +bool has_audio; };struct intel_crtc {
@@ -303,7 +304,6 @@ struct intel_crtc {* some outputs connected to this crtc. */ bool active; -bool eld_vld;bool primary_disabled;/* is the crtc obscured by a plane? */ bool lowfreq_avail;struct intel_overlay *overlay;
drivers/gpu/drm/i915/intel_hdmi.c +2 -0
@@ -864,6 +864,8 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,return false; } + pipe_config->has_audio = intel_hdmi->has_audio; +return true; }
Signature · 1 line
1.8.1.2
Quoted 7 lines · On Tue, Sep 24, 2013 at 01:01:37AM -0400, [email protected] wrote:
From: Mengdong Lin <[email protected]>
This patch adds a flag "
has_audio" for audio presence inintel_crtc->config. HMDI and DP encoders set this flag in theircomputer_config()if the external monitor supports audio. Later audio sequence will check this flag.Signed-off-by Mengdong Lin <[email protected]>
[snip]
drivers/gpu/drm/i915/intel_dp.c found: · line 768
Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +2
-0@@ -764,6 +764,8 @@ found:intel_dp_set_clock (encoder, pipe_config, intel_dp->link_bw); + pipe_config->has_audio = intel_dp->has_audio; +
This should only be set when we actually have an audio-capable monitor and want to enable the audio output on the port. Furthermore you need to add hw state readout support for this boolean to haswell_get_pipe_config and also the relevant state check code to intel_pipe_config_compare (by adding PIPE_CONF_CHECK_I(has_audio)).
Same applies to the intel_hdmi.c part ofc.
Cheers, Daniel
Quoted 43 lines
drivers/gpu/drm/i915/intel_dp.c +0
-0return true; }drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -290,6 +290,7 @@ struct intel_crtc_config {struct intel_link_m_n fdi_m_n;bool ips_enabled; +bool has_audio; };struct intel_crtc {@@ -303,7 +304,6 @@ struct intel_crtc {* some outputs connected to this crtc. */ bool active; -bool eld_vld;bool primary_disabled;/* is the crtc obscured by a plane? */ bool lowfreq_avail;struct intel_overlay *overlay;drivers/gpu/drm/i915/intel_hdmi.c +2
-0@@ -864,6 +864,8 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,return false; } + pipe_config->has_audio = intel_hdmi->has_audio; +return true; }Signature · 6 lines
1.8.1.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Hi Daniel,
Thanks for your advice!
Would you help working on this patch? Or can I continue after a few days, I have some Android support task these days.
Regards
Mengdong
Quoted 91 lines
-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, September 24, 2013 8:48 PM
To: Lin, Mengdong
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH v3 2/2] drm/i915/hsw: add flaghas_audioin crtc configQuoted 7 lines · On Tue, Sep 24, 2013 at 01:01:37AM -0400, [email protected] wrote:
From: Mengdong Lin <[email protected]>
This patch adds a flag "
has_audio" for audio presence inintel_crtc->config. HMDI and DP encoders set this flag in theircomputer_config()if the external monitor supports audio. Later audio sequence will check this flag.Signed-off-by Mengdong Lin <[email protected]>[snip]
drivers/gpu/drm/i915/intel_dp.c found: · line 768
Quoted 10 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_dp.cindex 26e162b..4bc125e 100644drivers/gpu/drm/i915/intel_dp.c +2
-0@@ -764,6 +764,8 @@ found:intel_dp_set_clock (encoder, pipe_config, intel_dp->link_bw); + pipe_config->has_audio = intel_dp->has_audio; +This should only be set when we actually have an audio-capable monitor and want to enable the audio output on the port. Furthermore you need to add hw state readout support for this boolean to
haswell_get_pipe_configand also the relevant state check code tointel_pipe_config_compare(by addingPIPE_CONF_CHECK_I(has_audio)).Same applies to the
intel_hdmi.cpart ofc.Cheers, Daniel
drivers/gpu/drm/i915/intel_hdmi.c bool intel_hdmi_compute_config(struct
Quoted 30 lines
drivers/gpu/drm/i915/intel_dp.c +0
-0return true; }drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -290,6 +290,7 @@ struct intel_crtc_config {struct intel_link_m_n fdi_m_n;bool ips_enabled; +bool has_audio; };struct intel_crtc {@@ -303,7 +304,6 @@ struct intel_crtc {* some outputs connected to this crtc. */ bool active; -bool eld_vld;bool primary_disabled;/* is the crtc obscured by a plane? */ bool lowfreq_avail;struct intel_overlay *overlay;drivers/gpu/drm/i915/intel_hdmi.c +0
-0@@ -864,6 +864,8 @@ bool intel_hdmi_compute_config(struct
intel_encoder*encoder,Quoted 11 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-1return false; } + pipe_config->has_audio = intel_hdmi->has_audio; +return true; } --1.8.1.2
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch