drm/i915: HDMI 12bpc fixes
Subsystems (2)
cover drm/i915: HDMI 12bpc fixes
From: Ville Syrjälä <[email protected]>
Our HDMI 12bpc support has always been broken. This series aims to fix that.
The problems addressed include:
- missing GCP infoframes entirely
- IBX w/a code was mostly nonsense
- missing w/a for CPT/PPT
- 12bpc vs. DBLCLK was busted
Part of this was already posted [1] quite a while ago, but it's grown some new stuff since. The entire series is available in git [2].
I have additional stuff to fix the IBX transcoder B workarounds and some other random thigns on PCH platforms. I'll post that as a followup.
[1] http://lists.freedesktop.org/archives/intel-gfx/2014-October/053340.html
[2] hit://github.com/vsyrjala/linux.git hdmi_12bpc_fixes_9
Ville Syrjälä (9):
drm/i915: Implement WaEnableHDMI8bpcBefore12bpc:snb,ivb drm/i915: Send GCP infoframes for deep color HDMI sinks drm/i915: Enable default_phase in GCP when possible drm/i915: Fix HDMI 12bpc TRANSCONF bpc value
drm/i915: Fix 12bpc HDMI enable for IBX
drm/i915: Disable all infoframes when turning off the HDMI port drm/i915: Check infoframe state more diligently. drm/i915: Fix hdmi clock readout with pixel repeat drm/i915: Double the port clock when using double clocked modes with
12bpc
drivers/gpu/drm/i915/i915_reg.h | 4 + drivers/gpu/drm/i915/intel_display.c | 10 +- drivers/gpu/drm/i915/intel_hdmi.c | 359 ++++++++++++++++++++++++++++------- 3 files changed, 306 insertions(+), 67 deletions(-)
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/9 drm/i915: Implement WaEnableHDMI8bpcBefore12bpc:snb, ivb
From: Ville Syrjälä <[email protected]>
CPT/PPT require a specific procedure for enabling 12bpc HDMI. Implement it, and to keep things neat pull the code into a function.
v2: Rebased due to crtc->config changes
s/HDMI_GC/HDMIUNIT_GC/ to match spec better
Factor out intel_enable_hdmi_audio()
--- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++---- 2 files changed, 69 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -6149,6 +6149,7 @@ enum skl_disp_power_wells {#define _TRANSA_CHICKEN1 0xf0060#define _TRANSB_CHICKEN1 0xf1060#define TRANS_CHICKEN1 (pipe) _PIPE(pipe, _TRANSA_CHICKEN1, _TRANSB_CHICKEN1) +#define TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE (1<<10)#define TRANS_CHICKEN1_DP0UNIT_GC_DISABLE (1<<4)#define _TRANSA_CHICKEN2 0xf0064#define _TRANSB_CHICKEN2 0xf1064
drivers/gpu/drm/i915/intel_hdmi.c +68 -6
93 lines not on this page · raw message
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [PATCH v2 1/9] drm/i915: Implement WaEnableHDMI8bpcBefore12bpc:snb, ivb
Quoted 32 lines · On Tue, 05 May 2015, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
CPT/PPT require a specific procedure for enabling 12bpc HDMI. Implement it, and to keep things neat pull the code into a function.
v2: Rebased due to
crtc->configchanges
s/HDMI_GC/HDMIUNIT_GC/ to match spec better
Factor outintel_enable_hdmi_audio()Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++---- 2 files changed, 69 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/i915_reg.h +1
-0@@ -6149,6 +6149,7 @@ enum skl_disp_power_wells {#define _TRANSA_CHICKEN1 0xf0060#define _TRANSB_CHICKEN1 0xf1060#define TRANS_CHICKEN1 (pipe) _PIPE(pipe, _TRANSA_CHICKEN1, _TRANSB_CHICKEN1) +#define TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE (1<<10)#define TRANS_CHICKEN1_DP0UNIT_GC_DISABLE (1<<4)#define _TRANSA_CHICKEN2 0xf0064#define _TRANSB_CHICKEN2 0xf1064drivers/gpu/drm/i915/intel_hdmi.c +0
-0
drivers/gpu/drm/i915/intel_hdmi.c static void intel_hdmi_get_config(struct intel_encoder *encoder, · line 823
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +7
-0@@ -814,6 +814,16 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, pipe_config->base.adjusted_mode.crtc_clock = dotclock; } +static void intel_enable_hdmi_audio (struct intel_encoder *encoder) +{ +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); + +WARN_ON (!crtc->config->has_hdmi_sink); +DRM_DEBUG_DRIVER ("Enabling HDMI audio on pipe %c\n" , +pipe_name (crtc->pipe));
The debug message is redundant and should've been removed with the audio rework, as there's plenty of debug in intel_audio.c. Please just drop it here.
With that gone, I'm not so sure if it makes sense to have a separate function for audio enable. But up to you.
BR,
Jani.
Quoted 92 lines
drivers/gpu/drm/i915/intel_hdmi.c +61
-6+intel_audio_codec_enable (encoder); +} +static void intel_enable_hdmi (struct intel_encoder *encoder) {struct drm_device *dev = encoder->base.dev;@@ -854,12 +864,61 @@ static void intel_enable_hdmi(struct intel_encoder *encoder)POSTING_READ (intel_hdmi->hdmi_reg); } -if (intel_crtc->config->has_audio) { -WARN_ON (!intel_crtc->config->has_hdmi_sink); -DRM_DEBUG_DRIVER ("Enabling HDMI audio on pipe %c\n" , -pipe_name (intel_crtc->pipe)); -intel_audio_codec_enable (encoder); +if (intel_crtc->config->has_audio) +intel_enable_hdmi_audio (encoder); +} + +static void cpt_enable_hdmi (struct intel_encoder *encoder) +{ +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); +struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); +enum pipe pipe = crtc->pipe; +u32 temp; + + temp =I915_READ (intel_hdmi->hdmi_reg); + + temp |=SDVO_ENABLE ; +if (crtc->config->has_audio) + temp |=SDVO_AUDIO_ENABLE ; + +/* +* WaEnableHDMI8bpcBefore12bpc:snb,ivb +* +* The procedure for 12bpc is as follows: +* 1. disable HDMI clock gating +* 2. enable HDMI with 8bpc +* 3. enable HDMI with 12bpc +* 4. enable HDMI clock gating +*/ + +if (crtc->config->pipe_bpp >24 ) { +I915_WRITE (TRANS_CHICKEN1 (pipe), +I915_READ (TRANS_CHICKEN1 (pipe)) | +TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE ); + + temp &= ~SDVO_COLOR_FORMAT_MASK ; + temp |= SDVO_COLOR_FORMAT_8bpc; } + +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg); + +if (crtc->config->pipe_bpp >24 ) { + temp &= ~SDVO_COLOR_FORMAT_MASK ; + temp |= HDMI_COLOR_FORMAT_12bpc; + +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg); + +I915_WRITE (TRANS_CHICKEN1 (pipe), +I915_READ (TRANS_CHICKEN1 (pipe)) & + ~TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE ); + } + +if (crtc->config->has_audio) +intel_enable_hdmi_audio (encoder); }static void vlv_enable_hdmi (struct intel_encoder *encoder)@@ -1829,7 +1888,10 @@ void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port) intel_encoder->post_disable = vlv_hdmi_post_disable; }else { intel_encoder->pre_enable = intel_hdmi_pre_enable; - intel_encoder->enable = intel_enable_hdmi; +if (HAS_PCH_CPT (dev)) + intel_encoder->enable = cpt_enable_hdmi; +else + intel_encoder->enable = intel_enable_hdmi; } intel_encoder->type =INTEL_OUTPUT_HDMI ;Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 1/9] drm/i915: Implement WaEnableHDMI8bpcBefore12bpc:snb, ivb
In reply to [email protected]Quoted 117 lines · On Tue, 2015-05-05 at 17:06 +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
CPT/PPT require a specific procedure for enabling 12bpc HDMI. Implement it, and to keep things neat pull the code into a function.
v2: Rebased due to
crtc->configchanges
s/HDMI_GC/HDMIUNIT_GC/ to match spec better
Factor outintel_enable_hdmi_audio()Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++---- 2 files changed, 69 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/i915_reg.h +1
-0@@ -6149,6 +6149,7 @@ enum skl_disp_power_wells {#define _TRANSA_CHICKEN1 0xf0060#define _TRANSB_CHICKEN1 0xf1060#define TRANS_CHICKEN1 (pipe) _PIPE(pipe, _TRANSA_CHICKEN1, _TRANSB_CHICKEN1) +#define TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE (1<<10)#define TRANS_CHICKEN1_DP0UNIT_GC_DISABLE (1<<4)#define _TRANSA_CHICKEN2 0xf0064#define _TRANSB_CHICKEN2 0xf1064drivers/gpu/drm/i915/intel_hdmi.c +64
-5@@ -814,6 +814,16 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, pipe_config->base.adjusted_mode.crtc_clock = dotclock; } +static void intel_enable_hdmi_audio (struct intel_encoder *encoder) +{ +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); + +WARN_ON (!crtc->config->has_hdmi_sink); +DRM_DEBUG_DRIVER ("Enabling HDMI audio on pipe %c\n" , +pipe_name (crtc->pipe)); +intel_audio_codec_enable (encoder); +} +static void intel_enable_hdmi (struct intel_encoder *encoder) {struct drm_device *dev = encoder->base.dev;@@ -854,12 +864,61 @@ static void intel_enable_hdmi(struct intel_encoder *encoder)POSTING_READ (intel_hdmi->hdmi_reg); } -if (intel_crtc->config->has_audio) { -WARN_ON (!intel_crtc->config->has_hdmi_sink); -DRM_DEBUG_DRIVER ("Enabling HDMI audio on pipe %c\n" , -pipe_name (intel_crtc->pipe)); -intel_audio_codec_enable (encoder); +if (intel_crtc->config->has_audio) +intel_enable_hdmi_audio (encoder); +} + +static void cpt_enable_hdmi (struct intel_encoder *encoder) +{ +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); +struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); +enum pipe pipe = crtc->pipe; +u32 temp; + + temp =I915_READ (intel_hdmi->hdmi_reg); + + temp |=SDVO_ENABLE ; +if (crtc->config->has_audio) + temp |=SDVO_AUDIO_ENABLE ; + +/* +* WaEnableHDMI8bpcBefore12bpc:snb,ivb +* +* The procedure for 12bpc is as follows: +* 1. disable HDMI clock gating +* 2. enable HDMI with 8bpc +* 3. enable HDMI with 12bpc +* 4. enable HDMI clock gating +*/ + +if (crtc->config->pipe_bpp >24 ) { +I915_WRITE (TRANS_CHICKEN1 (pipe), +I915_READ (TRANS_CHICKEN1 (pipe)) | +TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE ); + + temp &= ~SDVO_COLOR_FORMAT_MASK ; + temp |= SDVO_COLOR_FORMAT_8bpc; } + +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg); + +if (crtc->config->pipe_bpp >24 ) { + temp &= ~SDVO_COLOR_FORMAT_MASK ; + temp |= HDMI_COLOR_FORMAT_12bpc; + +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg); + +I915_WRITE (TRANS_CHICKEN1 (pipe), +I915_READ (TRANS_CHICKEN1 (pipe)) & + ~TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE ); + } + +if (crtc->config->has_audio) +intel_enable_hdmi_audio (encoder); }static void vlv_enable_hdmi (struct intel_encoder *encoder)@@ -1829,7 +1888,10 @@ void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port) intel_encoder->post_disable = vlv_hdmi_post_disable;
drivers/gpu/drm/i915/intel_hdmi.c void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port) · line 1897
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +4
-1}else { intel_encoder->pre_enable = intel_hdmi_pre_enable; - intel_encoder->enable = intel_enable_hdmi; +if (HAS_PCH_CPT (dev)) + intel_encoder->enable = cpt_enable_hdmi; +else + intel_encoder->enable = intel_enable_hdmi; } intel_encoder->type =INTEL_OUTPUT_HDMI ;
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 1/9] drm/i915: Implement WaEnableHDMI8bpcBefore12bpc:snb, ivb
In reply to [email protected]Quoted 12 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 1/9] drm/i915: Implement WaEnableHDMI8bpcBefore12bpc:snb, ivbFrom: Ville Syrjälä <[email protected]>
Quoted 8 lines
CPT/PPT require a specific procedure for enabling 12bpc HDMI. Implement it, and to keep things neat pull the code into a function.
v2: Rebased due to
crtc->configchanges
s/HDMI_GC/HDMIUNIT_GC/ to match spec better
Factor outintel_enable_hdmi_audio()Signed-off-by Ville Syrjälä <[email protected]>
Please call out any existing or new i-g-tests (or other tests) testing this feature. One that is done,
Quoted 121 lines
--- drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++---- 2 files changed, 69 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/i915_reg.h +1
-0@@ -6149,6 +6149,7 @@ enum skl_disp_power_wells {#define _TRANSA_CHICKEN1 0xf0060#define _TRANSB_CHICKEN1 0xf1060#define TRANS_CHICKEN1 (pipe) _PIPE(pipe, _TRANSA_CHICKEN1, _TRANSB_CHICKEN1) +#define TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE (1<<10)#define TRANS_CHICKEN1_DP0UNIT_GC_DISABLE (1<<4)#define _TRANSA_CHICKEN2 0xf0064#define
_TRANSB_CHICKEN20xf1064drivers/gpu/drm/i915/intel_hdmi.c +63
-5@@ -814,6 +814,16 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, pipe_config->base.adjusted_mode.crtc_clock = dotclock; } +static void intel_enable_hdmi_audio (struct intel_encoder *encoder) { +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); + +WARN_ON (!crtc->config->has_hdmi_sink); +DRM_DEBUG_DRIVER ("Enabling HDMI audio on pipe %c\n" , +pipe_name (crtc->pipe)); +intel_audio_codec_enable (encoder); +} +static void intel_enable_hdmi (struct intel_encoder *encoder) { struct drm_device *dev = encoder->base.dev; @@ -854,12 +864,61 @@ static void intel_enable_hdmi(struct intel_encoder *encoder) POSTING_READ(intel_hdmi->hdmi_reg); } -if (intel_crtc->config->has_audio) { -WARN_ON (!intel_crtc->config->has_hdmi_sink); -DRM_DEBUG_DRIVER ("Enabling HDMI audio on pipe %c\n" , -pipe_name (intel_crtc->pipe)); -intel_audio_codec_enable (encoder); +if (intel_crtc->config->has_audio) +intel_enable_hdmi_audio (encoder); +} + +static void cpt_enable_hdmi (struct intel_encoder *encoder) { +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); +struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); +enum pipe pipe = crtc->pipe; +u32 temp; + + temp =I915_READ (intel_hdmi->hdmi_reg); + + temp |=SDVO_ENABLE ; +if (crtc->config->has_audio) + temp |=SDVO_AUDIO_ENABLE ; + +/* +* WaEnableHDMI8bpcBefore12bpc:snb,ivb +* +* The procedure for 12bpc is as follows: +* 1. disable HDMI clock gating +* 2. enable HDMI with 8bpc +* 3. enable HDMI with 12bpc +* 4. enable HDMI clock gating +*/ + +if (crtc->config->pipe_bpp >24 ) { +I915_WRITE (TRANS_CHICKEN1 (pipe), +I915_READ (TRANS_CHICKEN1 (pipe)) | +TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE ); + + temp &= ~SDVO_COLOR_FORMAT_MASK ; + temp |= SDVO_COLOR_FORMAT_8bpc; } + +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg); + +if (crtc->config->pipe_bpp >24 ) { + temp &= ~SDVO_COLOR_FORMAT_MASK ; + temp |= HDMI_COLOR_FORMAT_12bpc; + +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg); + +I915_WRITE (TRANS_CHICKEN1 (pipe), +I915_READ (TRANS_CHICKEN1 (pipe)) & + ~TRANS_CHICKEN1_HDMIUNIT_GC_DISABLE ); + } + +if (crtc->config->has_audio) +intel_enable_hdmi_audio (encoder); } static void vlv_enable_hdmi(struct intel_encoder *encoder) @@ -1829,7 +1888,10 @@ void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enumport port)
drivers/gpu/drm/i915/intel_hdmi.c +4
-2intel_encoder->post_disable = vlv_hdmi_post_disable; }else { intel_encoder->pre_enable = intel_hdmi_pre_enable; - intel_encoder->enable = intel_enable_hdmi; +if (HAS_PCH_CPT (dev)) + intel_encoder->enable = cpt_enable_hdmi; +else + intel_encoder->enable = intel_enable_hdmi; } intel_encoder->type =INTEL_OUTPUT_HDMI ; --2.0.5
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/9 drm/i915: Send GCP infoframes for deep color HDMI sinks
In reply to [email protected]From: Ville Syrjälä <[email protected]>
GCP infoframes are required to inform the HDMI sink about the color depth.
Send the GCP infoframe whenever the sink supports any deep color modes since such sinks must anyway be capable of receiving them. For sinks that don't support deep color let's skip the GCP in case it might confuse the sink, although HDMI 1.4 spec does say all sinks must be capable of reciving them. In theory we could skip the GCP infoframe for deep color sinks in 8bpc mode as well since sinks must fall back to 8bpc whenever GCP isn't received for some time.
BSpec says we should disable GCP after disabling the port, so do that as well.
v2: s/intel_set_gcp_infoframe/intel_hdmi_set_gcp_infoframe/
Rebased due to crtc->config changes
--- drivers/gpu/drm/i915/i915_reg.h | 3 ++ drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -6010,6 +6010,9 @@ enum skl_disp_power_wells {#define _VIDEO_DIP_CTL_A 0xe0200#define _VIDEO_DIP_DATA_A 0xe0208#define _VIDEO_DIP_GCP_A 0xe0210 +#define GCP_COLOR_INDICATION (1 << 2) +#define GCP_DEFAULT_PHASE_ENABLE (1 << 1) +#define GCP_AV_MUTE (1 << 0)#define _VIDEO_DIP_CTL_B 0xe1200#define _VIDEO_DIP_DATA_B 0xe1208
drivers/gpu/drm/i915/intel_hdmi.c +74 -0
110 lines not on this page · raw message
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 2/9] drm/i915: Send GCP infoframes for deep color HDMI sinks
Quoted 151 lines · On Tue, 2015-05-05 at 17:06 +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
GCP infoframes are required to inform the HDMI sink about the color depth.
Send the GCP infoframe whenever the sink supports any deep color modes since such sinks must anyway be capable of receiving them. For sinks that don't support deep color let's skip the GCP in case it might confuse the sink, although HDMI 1.4 spec does say all sinks must be capable of reciving them. In theory we could skip the GCP infoframe for deep color sinks in 8bpc mode as well since sinks must fall back to 8bpc whenever GCP isn't received for some time.
BSpec says we should disable GCP after disabling the port, so do that as well.
v2: s/intel_set_gcp_infoframe/intel_hdmi_set_gcp_infoframe/
Rebased due to crtc->config changesSigned-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 3 ++ drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+)drivers/gpu/drm/i915/i915_reg.h +3
-0@@ -6010,6 +6010,9 @@ enum skl_disp_power_wells {#define _VIDEO_DIP_CTL_A 0xe0200#define _VIDEO_DIP_DATA_A 0xe0208#define _VIDEO_DIP_GCP_A 0xe0210 +#define GCP_COLOR_INDICATION (1 << 2) +#define GCP_DEFAULT_PHASE_ENABLE (1 << 1) +#define GCP_AV_MUTE (1 << 0)#define _VIDEO_DIP_CTL_B 0xe1200#define _VIDEO_DIP_DATA_B 0xe1208drivers/gpu/drm/i915/intel_hdmi.c +72
-0@@ -541,6 +541,66 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,intel_hdmi_set_hdmi_infoframe (encoder, adjusted_mode); } +static bool hdmi_sink_is_deep_color (struct drm_encoder *encoder) +{ +struct drm_device *dev = encoder->dev; +struct drm_connector *connector; + +WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); + +/* +* HDMI cloning is only supported on g4x which doesn't +* support deep color or GCP infoframes anyway so no +* need to worry about multiple HDMI sinks here. +*/ +list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) +return connector->display_info.bpc >8 ; + +return false; +} + +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) +{ +struct drm_i915_private *dev_priv = encoder->dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->crtc); +u32 reg, val =0 ; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_GCP (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_GCP (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_GCP (crtc->pipe); +else +return false; + +/* Indicate color depth wheneven the sink supports deep color */ +if (hdmi_sink_is_deep_color (encoder)) + val |=GCP_COLOR_INDICATION ; + +I915_WRITE (reg, val); + +return val !=0 ; +} + +static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) +{ +struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; +u32 reg; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_CTL (crtc->pipe); +else +return ; + +I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); +} +static void ibx_set_infoframes (struct drm_encoder *encoder,bool enable,struct drm_display_mode *adjusted_mode)@@ -581,6 +641,9 @@ static void ibx_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -618,6 +681,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -666,6 +732,9 @@ static void vlv_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -695,6 +764,9 @@ static void hsw_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_GCP_HSW |VIDEO_DIP_ENABLE_VS_HSW |VIDEO_DIP_ENABLE_GMP_HSW ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP_HSW ; +I915_WRITE (reg, val);POSTING_READ (reg);
drivers/gpu/drm/i915/intel_hdmi.c static void intel_disable_hdmi(struct intel_encoder *encoder) · line 1062
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-0@@ -986,6 +1058,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); + +intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc));
BSpec says this should be disabled after disabling TRANS_DDI_FUNC_CTL, so shouldn't this go in post_disable?
Ander
drivers/gpu/drm/i915/intel_hdmi.c static void intel_disable_hdmi(struct intel_encoder *encoder) · line 1065
Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-0}static int hdmi_portclock_limit (struct intel_hdmi *hdmi,bool respect_dvi_limit)
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 2/9] drm/i915: Send GCP infoframes for deep color HDMI sinks
Quoted 153 lines · Ander Conselvan De Oliveira
Quoted 152 lines · On Tue, 2015-05-05 at 17:06 +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
GCP infoframes are required to inform the HDMI sink about the color depth.
Send the GCP infoframe whenever the sink supports any deep color modes since such sinks must anyway be capable of receiving them. For sinks that don't support deep color let's skip the GCP in case it might confuse the sink, although HDMI 1.4 spec does say all sinks must be capable of reciving them. In theory we could skip the GCP infoframe for deep color sinks in 8bpc mode as well since sinks must fall back to 8bpc whenever GCP isn't received for some time.
BSpec says we should disable GCP after disabling the port, so do that as well.
v2: s/intel_set_gcp_infoframe/intel_hdmi_set_gcp_infoframe/
Rebased due to crtc->config changesSigned-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 3 ++ drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+)drivers/gpu/drm/i915/i915_reg.h +3
-0@@ -6010,6 +6010,9 @@ enum skl_disp_power_wells {#define _VIDEO_DIP_CTL_A 0xe0200#define _VIDEO_DIP_DATA_A 0xe0208#define _VIDEO_DIP_GCP_A 0xe0210 +#define GCP_COLOR_INDICATION (1 << 2) +#define GCP_DEFAULT_PHASE_ENABLE (1 << 1) +#define GCP_AV_MUTE (1 << 0)#define _VIDEO_DIP_CTL_B 0xe1200#define _VIDEO_DIP_DATA_B 0xe1208drivers/gpu/drm/i915/intel_hdmi.c +72
-0@@ -541,6 +541,66 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,intel_hdmi_set_hdmi_infoframe (encoder, adjusted_mode); } +static bool hdmi_sink_is_deep_color (struct drm_encoder *encoder) +{ +struct drm_device *dev = encoder->dev; +struct drm_connector *connector; + +WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); + +/* +* HDMI cloning is only supported on g4x which doesn't +* support deep color or GCP infoframes anyway so no +* need to worry about multiple HDMI sinks here. +*/ +list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) +return connector->display_info.bpc >8 ; + +return false; +} + +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) +{ +struct drm_i915_private *dev_priv = encoder->dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->crtc); +u32 reg, val =0 ; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_GCP (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_GCP (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_GCP (crtc->pipe); +else +return false; + +/* Indicate color depth wheneven the sink supports deep color */ +if (hdmi_sink_is_deep_color (encoder)) + val |=GCP_COLOR_INDICATION ; + +I915_WRITE (reg, val); + +return val !=0 ; +} + +static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) +{ +struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; +u32 reg; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_CTL (crtc->pipe); +else +return ; + +I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); +} +static void ibx_set_infoframes (struct drm_encoder *encoder,bool enable,struct drm_display_mode *adjusted_mode)@@ -581,6 +641,9 @@ static void ibx_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -618,6 +681,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -666,6 +732,9 @@ static void vlv_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -695,6 +764,9 @@ static void hsw_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_GCP_HSW |VIDEO_DIP_ENABLE_VS_HSW |VIDEO_DIP_ENABLE_GMP_HSW ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP_HSW ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -986,6 +1058,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c static void intel_disable_hdmi(struct intel_encoder *encoder) · line 1062
Quoted 4 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-0if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); + +intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc));BSpec says this should be disabled after disabling
TRANS_DDI_FUNC_CTL, so shouldn't this go inpost_disable?
intel_disable_hdmi() isn't used on DDI platforms. I've not looked at the DDI code too much, but I expect it could have similar issues with the disable sequence like the earlier PCH platforms had.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ander Conselvan De Oliveira
Reviewed-byRe: [PATCH v2 2/9] drm/i915: Send GCP infoframes for deep color HDMI sinks
Quoted 162 lines · Ville Syrjälä
Quoted 153 lines · Ander Conselvan De Oliveira
Quoted 152 lines · On Tue, 2015-05-05 at 17:06 +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
GCP infoframes are required to inform the HDMI sink about the color depth.
Send the GCP infoframe whenever the sink supports any deep color modes since such sinks must anyway be capable of receiving them. For sinks that don't support deep color let's skip the GCP in case it might confuse the sink, although HDMI 1.4 spec does say all sinks must be capable of reciving them. In theory we could skip the GCP infoframe for deep color sinks in 8bpc mode as well since sinks must fall back to 8bpc whenever GCP isn't received for some time.
BSpec says we should disable GCP after disabling the port, so do that as well.
v2: s/intel_set_gcp_infoframe/intel_hdmi_set_gcp_infoframe/
Rebased due to crtc->config changesSigned-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 3 ++ drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+)drivers/gpu/drm/i915/i915_reg.h +3
-0@@ -6010,6 +6010,9 @@ enum skl_disp_power_wells {#define _VIDEO_DIP_CTL_A 0xe0200#define _VIDEO_DIP_DATA_A 0xe0208#define _VIDEO_DIP_GCP_A 0xe0210 +#define GCP_COLOR_INDICATION (1 << 2) +#define GCP_DEFAULT_PHASE_ENABLE (1 << 1) +#define GCP_AV_MUTE (1 << 0)#define _VIDEO_DIP_CTL_B 0xe1200#define _VIDEO_DIP_DATA_B 0xe1208drivers/gpu/drm/i915/intel_hdmi.c +72
-0@@ -541,6 +541,66 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,intel_hdmi_set_hdmi_infoframe (encoder, adjusted_mode); } +static bool hdmi_sink_is_deep_color (struct drm_encoder *encoder) +{ +struct drm_device *dev = encoder->dev; +struct drm_connector *connector; + +WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); + +/* +* HDMI cloning is only supported on g4x which doesn't +* support deep color or GCP infoframes anyway so no +* need to worry about multiple HDMI sinks here. +*/ +list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) +return connector->display_info.bpc >8 ; + +return false; +} + +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) +{ +struct drm_i915_private *dev_priv = encoder->dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->crtc); +u32 reg, val =0 ; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_GCP (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_GCP (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_GCP (crtc->pipe); +else +return false; + +/* Indicate color depth wheneven the sink supports deep color */ +if (hdmi_sink_is_deep_color (encoder)) + val |=GCP_COLOR_INDICATION ; + +I915_WRITE (reg, val); + +return val !=0 ; +} + +static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) +{ +struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; +u32 reg; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_CTL (crtc->pipe); +else +return ; + +I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); +} +static void ibx_set_infoframes (struct drm_encoder *encoder,bool enable,struct drm_display_mode *adjusted_mode)@@ -581,6 +641,9 @@ static void ibx_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -618,6 +681,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -666,6 +732,9 @@ static void vlv_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -695,6 +764,9 @@ static void hsw_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_GCP_HSW |VIDEO_DIP_ENABLE_VS_HSW |VIDEO_DIP_ENABLE_GMP_HSW ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP_HSW ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -986,6 +1058,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c static void intel_disable_hdmi(struct intel_encoder *encoder) · line 1062
Quoted 4 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-0if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); + +intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc));BSpec says this should be disabled after disabling
TRANS_DDI_FUNC_CTL, so shouldn't this go inpost_disable?
Quoted 3 lines
intel_disable_hdmi()isn't used on DDI platforms. I've not looked at the DDI code too much, but I expect it could have similar issues with the disable sequence like the earlier PCH platforms had.
Ah, right. So if the GCP would be disabled that would only be done in ->set_infoframes() called from ->pre_enable(), that is called while TRANS_DDI_FUNC_CTL is disabled. So no issue there.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 2/9] drm/i915: Send GCP infoframes for deep color HDMI sinks
Quoted 163 lines · Ander Conselvan De Oliveira
Quoted 162 lines · Ville Syrjälä
Quoted 160 lines · Ander Conselvan De Oliveira
Quoted 151 lines · On Tue, 2015-05-05 at 17:06 +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
GCP infoframes are required to inform the HDMI sink about the color depth.
Send the GCP infoframe whenever the sink supports any deep color modes since such sinks must anyway be capable of receiving them. For sinks that don't support deep color let's skip the GCP in case it might confuse the sink, although HDMI 1.4 spec does say all sinks must be capable of reciving them. In theory we could skip the GCP infoframe for deep color sinks in 8bpc mode as well since sinks must fall back to 8bpc whenever GCP isn't received for some time.
BSpec says we should disable GCP after disabling the port, so do that as well.
v2: s/intel_set_gcp_infoframe/intel_hdmi_set_gcp_infoframe/
Rebased due to crtc->config changesSigned-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 3 ++ drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+)drivers/gpu/drm/i915/i915_reg.h +3
-0@@ -6010,6 +6010,9 @@ enum skl_disp_power_wells {#define _VIDEO_DIP_CTL_A 0xe0200#define _VIDEO_DIP_DATA_A 0xe0208#define _VIDEO_DIP_GCP_A 0xe0210 +#define GCP_COLOR_INDICATION (1 << 2) +#define GCP_DEFAULT_PHASE_ENABLE (1 << 1) +#define GCP_AV_MUTE (1 << 0)#define _VIDEO_DIP_CTL_B 0xe1200#define _VIDEO_DIP_DATA_B 0xe1208drivers/gpu/drm/i915/intel_hdmi.c +72
-0@@ -541,6 +541,66 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,intel_hdmi_set_hdmi_infoframe (encoder, adjusted_mode); } +static bool hdmi_sink_is_deep_color (struct drm_encoder *encoder) +{ +struct drm_device *dev = encoder->dev; +struct drm_connector *connector; + +WARN_ON (!drm_modeset_is_locked (&dev->mode_config.connection_mutex)); + +/* +* HDMI cloning is only supported on g4x which doesn't +* support deep color or GCP infoframes anyway so no +* need to worry about multiple HDMI sinks here. +*/ +list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) +return connector->display_info.bpc >8 ; + +return false; +} + +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) +{ +struct drm_i915_private *dev_priv = encoder->dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->crtc); +u32 reg, val =0 ; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_GCP (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_GCP (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_GCP (crtc->pipe); +else +return false; + +/* Indicate color depth wheneven the sink supports deep color */ +if (hdmi_sink_is_deep_color (encoder)) + val |=GCP_COLOR_INDICATION ; + +I915_WRITE (reg, val); + +return val !=0 ; +} + +static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) +{ +struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; +u32 reg; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_CTL (crtc->pipe); +else +return ; + +I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); +} +static void ibx_set_infoframes (struct drm_encoder *encoder,bool enable,struct drm_display_mode *adjusted_mode)@@ -581,6 +641,9 @@ static void ibx_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -618,6 +681,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -666,6 +732,9 @@ static void vlv_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -695,6 +764,9 @@ static void hsw_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_GCP_HSW |VIDEO_DIP_ENABLE_VS_HSW |VIDEO_DIP_ENABLE_GMP_HSW ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP_HSW ; +I915_WRITE (reg, val);POSTING_READ (reg);drivers/gpu/drm/i915/intel_hdmi.c static void intel_disable_hdmi(struct intel_encoder *encoder) · line 1062
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-0@@ -986,6 +1058,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); + +intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc));BSpec says this should be disabled after disabling
TRANS_DDI_FUNC_CTL, so shouldn't this go inpost_disable?
Quoted 7 lines
Quoted 3 lines
intel_disable_hdmi()isn't used on DDI platforms. I've not looked at the DDI code too much, but I expect it could have similar issues with the disable sequence like the earlier PCH platforms had.Ah, right. So if the GCP would be disabled that would only be done in ->set_infoframes() called from ->pre_enable(), that is called while
TRANS_DDI_FUNC_CTLis disabled. So no issue there.
Perhaps. As stated I didn't really look at DDI. I do think we should change it do things the same way as everyone else, but for the time being I have enough things on my plate so I'll not take on another project.
Quoted 4 lines
Reviewed-by Ander Conselvan de Oliveira <[email protected]>
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 2/9] drm/i915: Send GCP infoframes for deep color HDMI sinks
In reply to [email protected]Quoted 53 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 2/9] drm/i915: Send GCP infoframes for deep color HDMI sinksFrom: Ville Syrjälä <[email protected]>
GCP infoframes are required to inform the HDMI sink about the color depth.
Send the GCP infoframe whenever the sink supports any deep color modes since such sinks must anyway be capable of receiving them. For sinks that don't support deep color let's skip the GCP in case it might confuse the sink, although HDMI 1.4 spec does say all sinks must be capable of reciving them. In theory we could skip the GCP infoframe for deep color sinks in 8bpc mode as well since sinks must fall back to 8bpc whenever GCP isn't received for some time.
BSpec says we should disable GCP after disabling the port, so do that as well.
v2: s/intel_set_gcp_infoframe/intel_hdmi_set_gcp_infoframe/
Rebased due to crtc->config changesSigned-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 3 ++ drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+)drivers/gpu/drm/i915/i915_reg.h +3
-0@@ -6010,6 +6010,9 @@ enum skl_disp_power_wells {#define _VIDEO_DIP_CTL_A 0xe0200#define _VIDEO_DIP_DATA_A 0xe0208#define _VIDEO_DIP_GCP_A 0xe0210 +#define GCP_COLOR_INDICATION (1 << 2) +#define GCP_DEFAULT_PHASE_ENABLE (1 << 1) +#define GCP_AV_MUTE (1 << 0)#define _VIDEO_DIP_CTL_B 0xe1200#define _VIDEO_DIP_DATA_B 0xe1208drivers/gpu/drm/i915/intel_hdmi.c +0
-0
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder · line 544
Quoted 4 lines
drivers/gpu/drm/i915/intel_hdmi.c +1
-0@@ -541,6 +541,66 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,intel_hdmi_set_hdmi_infoframe (encoder, adjusted_mode); } +static bool hdmi_sink_is_deep_color (struct drm_encoder *encoder) {
Some static functions are prefixed but this isn't. Can you add prefix?
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder, · line 555
Quoted 11 lines
drivers/gpu/drm/i915/intel_hdmi.c +10
-0+struct drm_device *dev = encoder->dev; +struct drm_connector *connector; + +WARN_ON (!drm_modeset_is_locked (&dev- >mode_config.connection_mutex)); + +/* +* HDMI cloning is only supported on g4x which doesn't +* support deep color or GCP infoframes anyway so no +* need to worry about multiple HDMI sinks here. +*/
There isn't any code specific for HDMI cloning or multiple HDMI sinks here, any relevance of above comment. Or am I missing something here?
Quoted 13 lines
drivers/gpu/drm/i915/intel_hdmi.c +12
-0+list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) +return connector->display_info.bpc >8 ; + +return false; +} + +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) { +struct drm_i915_private *dev_priv = encoder->dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->crtc); +u32 reg, val =0 ; +
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder, · line 578
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +10
-0+if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_GCP (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_GCP (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_GCP (crtc->pipe); +else +return false; + +/* Indicate color depth wheneven the sink supports deep color */
Typo
Quoted 48 lines
drivers/gpu/drm/i915/intel_hdmi.c +23
-0+if (hdmi_sink_is_deep_color (encoder)) + val |=GCP_COLOR_INDICATION ; + +I915_WRITE (reg, val); + +return val !=0 ; +} + +static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) { +struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; +u32 reg; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_CTL (crtc->pipe); +else +return ; + +I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); } +static void ibx_set_infoframes (struct drm_encoder *encoder,bool enable, struct drm_display_mode *adjusted_mode) @@ -581,6 +641,9 @@ static void ibx_set_infoframes(struct
drm_encoder*encoder,drivers/gpu/drm/i915/intel_hdmi.c +6
-0val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -618,6 +681,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);
drivers/gpu/drm/i915/intel_hdmi.c static void vlv_set_infoframes(struct drm_encoder · line 738
Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c +3
-0@@ -666,6 +732,9 @@ static void vlv_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +
There is a comment in the code that
"Note that g4x/vlv don't support 12bpc hdmi outputs."
Is above call still required for vlv? Or need an update to that comment.
Quoted 29 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-0I915_WRITE (reg, val);POSTING_READ (reg);@@ -695,6 +764,9 @@ static void hsw_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |
VIDEO_DIP_ENABLE_GCP_HSW|
VIDEO_DIP_ENABLE_VS_HSW|VIDEO_DIP_ENABLE_GMP_HSW);drivers/gpu/drm/i915/intel_hdmi.c +5
-0+if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP_HSW ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -986,6 +1058,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); + +intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc)); }static int
hdmi_portclock_limit(struct intel_hdmi *hdmi, bool respect_dvi_limit)
--
2.0.5
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 2/9] drm/i915: Send GCP infoframes for deep color HDMI sinks
Quoted 56 lines · Chandra
Quoted 56 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 2/9] drm/i915: Send GCP infoframes for deep color HDMI sinksFrom: Ville Syrjälä <[email protected]>
GCP infoframes are required to inform the HDMI sink about the color depth.
Send the GCP infoframe whenever the sink supports any deep color modes since such sinks must anyway be capable of receiving them. For sinks that don't support deep color let's skip the GCP in case it might confuse the sink, although HDMI 1.4 spec does say all sinks must be capable of reciving them. In theory we could skip the GCP infoframe for deep color sinks in 8bpc mode as well since sinks must fall back to 8bpc whenever GCP isn't received for some time.
BSpec says we should disable GCP after disabling the port, so do that as well.
v2: s/intel_set_gcp_infoframe/intel_hdmi_set_gcp_infoframe/
Rebased due to crtc->config changesSigned-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 3 ++ drivers/gpu/drm/i915/intel_hdmi.c | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+)drivers/gpu/drm/i915/i915_reg.h +3
-0@@ -6010,6 +6010,9 @@ enum skl_disp_power_wells {#define _VIDEO_DIP_CTL_A 0xe0200#define _VIDEO_DIP_DATA_A 0xe0208#define _VIDEO_DIP_GCP_A 0xe0210 +#define GCP_COLOR_INDICATION (1 << 2) +#define GCP_DEFAULT_PHASE_ENABLE (1 << 1) +#define GCP_AV_MUTE (1 << 0)#define _VIDEO_DIP_CTL_B 0xe1200#define _VIDEO_DIP_DATA_B 0xe1208drivers/gpu/drm/i915/intel_hdmi.c +0
-0@@ -541,6 +541,66 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,intel_hdmi_set_hdmi_infoframe (encoder, adjusted_mode); }
Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder · line 544
Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c +1
-0+static bool hdmi_sink_is_deep_color (struct drm_encoder *encoder) {Some static functions are prefixed but this isn't. Can you add prefix?
Is there any benefit from a prefix?
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/i915/intel_hdmi.c +4
-0+struct drm_device *dev = encoder->dev; +struct drm_connector *connector; + +WARN_ON (!drm_modeset_is_locked (&dev- >mode_config.connection_mutex));
Quoted 9 lines
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder, · line 555
Quoted 6 lines
drivers/gpu/drm/i915/intel_hdmi.c +6
-0+ +/* +* HDMI cloning is only supported on g4x which doesn't +* support deep color or GCP infoframes anyway so no +* need to worry about multiple HDMI sinks here. +*/ There isn't any code specific for HDMI cloning or multiple HDMI sinks here, any relevance of above comment. Or am I missing something here?
In a cloned setup we'd feed multiple sinks from the same transcoder, so we'd need to basically check that connector->encoder->crtc matches our crtc here, and only return true if all the relevant connectors were deep color capable. But since we can ignore cloning we can stop looking once we find the connector for our current encoder (ie. HDMI port).
Quoted 79 lines
Quoted 14 lines
drivers/gpu/drm/i915/intel_hdmi.c +12
-0+list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) +return connector->display_info.bpc >8 ; + +return false; +} + +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) { +struct drm_i915_private *dev_priv = encoder->dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->crtc); +u32 reg, val =0 ; +drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder, · line 578
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +10
-0+if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_GCP (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_GCP (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_GCP (crtc->pipe); +else +return false; + +/* Indicate color depth wheneven the sink supports deep color */ Typo
Quoted 52 lines
drivers/gpu/drm/i915/intel_hdmi.c +23
-0+if (hdmi_sink_is_deep_color (encoder)) + val |=GCP_COLOR_INDICATION ; + +I915_WRITE (reg, val); + +return val !=0 ; +} + +static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) { +struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; +u32 reg; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_CTL (crtc->pipe); +else +return ; + +I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); } +static void ibx_set_infoframes (struct drm_encoder *encoder,bool enable, struct drm_display_mode *adjusted_mode) @@ -581,6 +641,9 @@ static void ibx_set_infoframes(struct
drm_encoder*encoder,drivers/gpu/drm/i915/intel_hdmi.c +6
-0val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -618,6 +681,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -666,6 +732,9 @@ static void vlv_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP );
Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c static void ibx_set_infoframes(struct drm_encoder *encoder, · line 646
Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c +3
-0+if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +There is a comment in the code that
"Note that g4x/vlv don't support 12bpc hdmi outputs."
Is above call still required for vlv? Or need an update to that comment.
VLV/CHV support the GCP infoframe even though they don't support 12bpc output. The way I decided to do things is to send the GCP infoframe whenever there's a deep color sink hooked up, even if we feed it 8bpc data.
Quoted 34 lines
Quoted 34 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-0I915_WRITE (reg, val);POSTING_READ (reg);@@ -695,6 +764,9 @@ static void hsw_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |
VIDEO_DIP_ENABLE_GCP_HSW|
VIDEO_DIP_ENABLE_VS_HSW|VIDEO_DIP_ENABLE_GMP_HSW);drivers/gpu/drm/i915/intel_hdmi.c +5
-0+if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP_HSW ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -986,6 +1058,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); + +intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc)); }static int
hdmi_portclock_limit(struct intel_hdmi *hdmi, bool respect_dvi_limit)
--
2.0.5_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Konduru, Chandra
Reviewed-byRe: [PATCH v2 2/9] drm/i915: Send GCP infoframes for deep color HDMI sinks
Quoted 9 lines
Quoted 7 lines
Review static void g4x_set_infoframes(struct drm_encoder · line 544
Quoted 5 lines
(quoted diff) +1
-0@@ -541,6 +541,66 @@ static void g4x_set_infoframes(struct drm_encoder *encoder, intel_hdmi_set_hdmi_infoframe(encoder, adjusted_mode); } +static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder) {Some static functions are prefixed but this isn't. Can you add prefix?
Is there any benefit from a prefix?
Personally, I am fine either way. But based on review feedback seen so far, this is being looked at and asked to follow. From that perspective I mentioned that. If this is something optional and tied to benefit, then no issue here.
Quoted 17 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c +4
-0+struct drm_device *dev = encoder->dev; +struct drm_connector *connector; + +WARN_ON (!drm_modeset_is_locked (&dev- >mode_config.connection_mutex));Quoted 9 lines
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder, · line 555
Quoted 6 lines
drivers/gpu/drm/i915/intel_hdmi.c +6
-0+ +/* +* HDMI cloning is only supported on g4x which doesn't +* support deep color or GCP infoframes anyway so no +* need to worry about multiple HDMI sinks here. +*/ There isn't any code specific for HDMI cloning or multiple HDMI sinks here, any relevance of above comment. Or am I missing something here?
Quoted 5 lines
In a cloned setup we'd feed multiple sinks from the same transcoder, so we'd need to basically check that
connector->encoder->crtcmatches our crtc here, and only return true if all the relevant connectors were deep color capable. But since we can ignore cloning we can stop looking once we find the connector for our current encoder (ie. HDMI port).
OK, makes sense. Thanks for the background info.
Not sure if you are spinning another version to fix the typo below or prefix above, otherwise, this gets
Quoted 89 lines
Quoted 47 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_hdmi.c +12
-0+list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) +return connector->display_info.bpc >8 ; + +return false; +} + +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) { +struct drm_i915_private *dev_priv = encoder->dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->crtc); +u32 reg, val =0 ; +drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder, · line 578
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +10
-0+if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_GCP (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_GCP (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_GCP (crtc->pipe); +else +return false; + +/* Indicate color depth wheneven the sink supports deep color */ Typo
Quoted 19 lines
drivers/gpu/drm/i915/intel_hdmi.c +19
-0+if (hdmi_sink_is_deep_color (encoder)) + val |=GCP_COLOR_INDICATION ; + +I915_WRITE (reg, val); + +return val !=0 ; +} + +static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) { +struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; +u32 reg; + +if (HAS_DDI (dev_priv)) + reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); +else if (IS_VALLEYVIEW (dev_priv)) + reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); +else if (HAS_PCH_SPLIT (dev_priv->dev)) + reg =TVIDEO_DIP_CTL (crtc->pipe); +else Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c +4
-0+return ; + +I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); } +static void ibx_set_infoframes (struct drm_encoder *encoder,bool enable, struct drm_display_mode *adjusted_mode) @@ -581,6 +641,9 @@ static void ibx_set_infoframes(struct
drm_encoder*encoder,
Quoted 25 lines
Quoted 25 lines
drivers/gpu/drm/i915/intel_hdmi.c +6
-0val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -618,6 +681,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); +if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +I915_WRITE (reg, val);POSTING_READ (reg);@@ -666,6 +732,9 @@ static void vlv_set_infoframes(struct drm_encoder *encoder, val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP );Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c static void ibx_set_infoframes(struct drm_encoder *encoder, · line 646
Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c +3
-0+if (intel_hdmi_set_gcp_infoframe (encoder)) + val |=VIDEO_DIP_ENABLE_GCP ; +There is a comment in the code that
"Note that g4x/vlv don't support 12bpc hdmi outputs."
Is above call still required for vlv? Or need an update to that comment.
Quoted 4 lines
VLV/CHV support the GCP infoframe even though they don't support 12bpc output. The way I decided to do things is to send the GCP infoframe whenever there's a deep color sink hooked up, even if we feed it 8bpc data.
Got it. Should be ok then.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 3/9 drm/i915: Enable default_phase in GCP when possible
In reply to [email protected]From: Ville Syrjälä <[email protected]>
When the video timings are suitably aligned so that all different periods start at phase 0 (ie. none of the periods start mid-pixel) we can inform the sink about this. Supposedly the sink can then optimize certain things. Obviously this is only relevant when outputting >8bpc data since otherwise there are no mid-pixel phases.
v2: Rebased due to crtc->config changes
--- drivers/gpu/drm/i915/intel_hdmi.c | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
drivers/gpu/drm/i915/intel_hdmi.c +48 -0
@@ -560,6 +560,49 @@ static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder)return false; } +/* +* Determine if default_phase=1 can be indicated in the GCP infoframe. +* +* From HDMI specification 1.4a: +* - The first pixel of each Video Data Period shall always have a pixel packing phase of 0 +* - The first pixel following each Video Data Period shall have a pixel packing phase of 0 +* - The PP bits shall be constant for all GCPs and will be equal to the last packing phase +* - The first pixel following every transition of HSYNC or VSYNC shall have a pixel packing +* phase of 0 +*/ +static bool gcp_default_phase_possible (int pipe_bpp, +const struct drm_display_mode *mode) +{ +unsigned int pixels_per_group; + +switch (pipe_bpp) { +case 30 : +/* 4 pixels in 5 clocks */ + pixels_per_group =4 ; +break ; +case 36 : +/* 2 pixels in 3 clocks */ + pixels_per_group =2 ; +break ; +case 48 : +/* 1 pixel in 2 clocks */ + pixels_per_group =1 ; +break ; +default : +/* phase information not relevant for 8bpc */ +return false; + } + +return mode->crtc_hdisplay % pixels_per_group ==0 && + mode->crtc_htotal % pixels_per_group ==0 && + mode->crtc_hblank_start % pixels_per_group ==0 && + mode->crtc_hblank_end % pixels_per_group ==0 && + mode->crtc_hsync_start % pixels_per_group ==0 && + mode->crtc_hsync_end % pixels_per_group ==0 && + ((mode->flags &DRM_MODE_FLAG_INTERLACE ) ==0 || + mode->crtc_htotal/2 % pixels_per_group ==0 ); +} +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) {struct drm_i915_private *dev_priv = encoder->dev->dev_private;
@@ -579,6 +622,11 @@ static bool intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)if (hdmi_sink_is_deep_color (encoder)) val |=GCP_COLOR_INDICATION ; +/* Enable default_phase whenever the display mode is suitably aligned */ +if (gcp_default_phase_possible (crtc->config->pipe_bpp, + &crtc->config->base.adjusted_mode)) + val |=GCP_DEFAULT_PHASE_ENABLE ; +I915_WRITE (reg, val);return val !=0 ;
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 3/9] drm/i915: Enable default_phase in GCP when possible
Quoted 68 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 3/9] drm/i915: Enabledefault_phasein GCP when possibleFrom: Ville Syrjälä <[email protected]>
When the video timings are suitably aligned so that all different periods start at phase 0 (ie. none of the periods start mid-pixel) we can inform the sink about this. Supposedly the sink can then optimize certain things. Obviously this is only relevant when outputting >8bpc data since otherwise there are no mid-pixel phases.
v2: Rebased due to
crtc->configchangesSigned-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)drivers/gpu/drm/i915/intel_hdmi.c +11
-0@@ -560,6 +560,49 @@ static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder)return false; } +/* +* Determine if default_phase=1 can be indicated in the GCP infoframe. +* +* From HDMI specification 1.4a: +* - The first pixel of each Video Data Period shall always have a +pixel packing phase of 0 +* - The first pixel following each Video Data Period shall have a +pixel packing phase of 0 +* - The PP bits shall be constant for all GCPs and will be equal to +the last packing phase +* - The first pixel following every transition of HSYNC or VSYNC shall have a pixel packing
+ * phase of 0
+ */drivers/gpu/drm/i915/intel_hdmi.c +18
-0+static bool gcp_default_phase_possible (int pipe_bpp, +const struct drm_display_mode *mode) { +unsigned int pixels_per_group; + +switch (pipe_bpp) { +case 30 : +/* 4 pixels in 5 clocks */ + pixels_per_group =4 ; +break ; +case 36 : +/* 2 pixels in 3 clocks */ + pixels_per_group =2 ; +break ; +case 48 : +/* 1 pixel in 2 clocks */ + pixels_per_group =1 ; +break ; +default :
drivers/gpu/drm/i915/intel_hdmi.c static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder) · line 601
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +10
-0+/* phase information not relevant for 8bpc */ +return false; + } + +return mode->crtc_hdisplay % pixels_per_group ==0 && + mode->crtc_htotal % pixels_per_group ==0 && + mode->crtc_hblank_start % pixels_per_group ==0 && + mode->crtc_hblank_end % pixels_per_group ==0 && + mode->crtc_hsync_start % pixels_per_group ==0 && + mode->crtc_hsync_end % pixels_per_group == 0 &&
For hsync, bspec says Hsync is an even number.
Isn't it above check should be something like (hsync_end - hsync_start) % 2 == 0? And similarly for front & back porches, right?
Quoted 22 lines
drivers/gpu/drm/i915/intel_hdmi.c +3
-0+ ((mode->flags &DRM_MODE_FLAG_INTERLACE ) ==0 || + mode->crtc_htotal/2 % pixels_per_group ==0 ); } +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) { struct drm_i915_private *dev_priv = encoder->dev->dev_private; @@ -579,6 +622,11 @@ static bool
intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)drivers/gpu/drm/i915/intel_hdmi.c +1
-0if (hdmi_sink_is_deep_color (encoder)) val |=GCP_COLOR_INDICATION ; +/* Enable default_phase whenever the display mode is suitably aligned */
drivers/gpu/drm/i915/intel_hdmi.c +4
-1+if (gcp_default_phase_possible (crtc->config->pipe_bpp, + &crtc->config->base.adjusted_mode)) + val |=GCP_DEFAULT_PHASE_ENABLE ; +I915_WRITE (reg, val);return val !=0 ; --2.0.5
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 3/9] drm/i915: Enable default_phase in GCP when possible
Quoted 74 lines · Chandra
Quoted 74 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 3/9] drm/i915: Enabledefault_phasein GCP when possibleFrom: Ville Syrjälä <[email protected]>
When the video timings are suitably aligned so that all different periods start at phase 0 (ie. none of the periods start mid-pixel) we can inform the sink about this. Supposedly the sink can then optimize certain things. Obviously this is only relevant when outputting >8bpc data since otherwise there are no mid-pixel phases.
v2: Rebased due to
crtc->configchangesSigned-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)drivers/gpu/drm/i915/intel_hdmi.c +11
-0@@ -560,6 +560,49 @@ static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder)return false; } +/* +* Determine if default_phase=1 can be indicated in the GCP infoframe. +* +* From HDMI specification 1.4a: +* - The first pixel of each Video Data Period shall always have a +pixel packing phase of 0 +* - The first pixel following each Video Data Period shall have a +pixel packing phase of 0 +* - The PP bits shall be constant for all GCPs and will be equal to +the last packing phase +* - The first pixel following every transition of HSYNC or VSYNC shall have a pixel packing
+ * phase of 0
+ */drivers/gpu/drm/i915/intel_hdmi.c +24
-0+static bool gcp_default_phase_possible (int pipe_bpp, +const struct drm_display_mode *mode) { +unsigned int pixels_per_group; + +switch (pipe_bpp) { +case 30 : +/* 4 pixels in 5 clocks */ + pixels_per_group =4 ; +break ; +case 36 : +/* 2 pixels in 3 clocks */ + pixels_per_group =2 ; +break ; +case 48 : +/* 1 pixel in 2 clocks */ + pixels_per_group =1 ; +break ; +default : +/* phase information not relevant for 8bpc */ +return false; + } + +return mode->crtc_hdisplay % pixels_per_group ==0 && + mode->crtc_htotal % pixels_per_group == 0 &&
Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder) · line 601
Quoted 4 lines
drivers/gpu/drm/i915/intel_hdmi.c +4
-0+ mode->crtc_hblank_start % pixels_per_group ==0 && + mode->crtc_hblank_end % pixels_per_group ==0 && + mode->crtc_hsync_start % pixels_per_group ==0 && + mode->crtc_hsync_end % pixels_per_group == 0 &&For hsync, bspec says Hsync is an even number.
Isn't it above check should be something like (hsync_end-hsync_start) % 2 == 0? And similarly for front & back porches, right?
If X and Y are even then (X - Y) is even too. Also the text in bspec is less informative than the text in HDMI spec, which is why I quited the HDMI spec instead.
Quoted 27 lines
Quoted 27 lines
drivers/gpu/drm/i915/intel_hdmi.c +3
-0+ ((mode->flags &DRM_MODE_FLAG_INTERLACE ) ==0 || + mode->crtc_htotal/2 % pixels_per_group ==0 ); } +static bool intel_hdmi_set_gcp_infoframe (struct drm_encoder *encoder) { struct drm_i915_private *dev_priv = encoder->dev->dev_private; @@ -579,6 +622,11 @@ static bool
intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)drivers/gpu/drm/i915/intel_hdmi.c +1
-0if (hdmi_sink_is_deep_color (encoder)) val |=GCP_COLOR_INDICATION ; +/* Enable default_phase whenever the display mode is suitably aligned */
drivers/gpu/drm/i915/intel_hdmi.c +4
-1+if (gcp_default_phase_possible (crtc->config->pipe_bpp, + &crtc->config->base.adjusted_mode)) + val |=GCP_DEFAULT_PHASE_ENABLE ; +I915_WRITE (reg, val);return val !=0 ; --2.0.5
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 3/9] drm/i915: Enable default_phase in GCP when possible
Quoted 50 lines
Quoted 42 lines
Quoted 42 lines
(quoted diff) +11
-0@@ -560,6 +560,49 @@ static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder) return false; } +/* + * Determine if default_phase=1 can be indicated in the GCP infoframe. + * + * From HDMI specification 1.4a: + * - The first pixel of each Video Data Period shall always have a +pixel packing phase of 0 + * - The first pixel following each Video Data Period shall have a +pixel packing phase of 0 + * - The PP bits shall be constant for all GCPs and will be equal to +the last packing phase + * - The first pixel following every transition of HSYNC or VSYNC shall have apixel packing
+ * phase of 0
+ */drivers/gpu/drm/i915/intel_hdmi.c +23
-0+static bool gcp_default_phase_possible (int pipe_bpp, +const struct drm_display_mode *mode) { +unsigned int pixels_per_group; + +switch (pipe_bpp) { +case 30 : +/* 4 pixels in 5 clocks */ + pixels_per_group =4 ; +break ; +case 36 : +/* 2 pixels in 3 clocks */ + pixels_per_group =2 ; +break ; +case 48 : +/* 1 pixel in 2 clocks */ + pixels_per_group =1 ; +break ; +default : +/* phase information not relevant for 8bpc */ +return false; + } + + return mode->crtc_hdisplay % pixels_per_group == 0 &&Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder) · line 601
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +5
-0+ mode->crtc_htotal % pixels_per_group ==0 && + mode->crtc_hblank_start % pixels_per_group ==0 && + mode->crtc_hblank_end % pixels_per_group ==0 && + mode->crtc_hsync_start % pixels_per_group ==0 && + mode->crtc_hsync_end % pixels_per_group == 0 &&For hsync, bspec says Hsync is an even number.
Isn't it above check should be something like (hsync_end-hsync_start) % 2 ==
Quoted 6 lines
0?
Quoted 1 line
And similarly for front & back porches, right?
If X and Y are even then (X - Y) is even too. Also the text in bspec is less informative than the text in HDMI spec, which is why I quited the HDMI spec instead.
Sure, if X and Y are even X - Y is even, but it is more restrictive check than needed. Because if both X and Y are odd, X - Y is even, and in that case above code doesn't allow to use default phase. Which may be OK, but it didn't truly allow default phase when possible.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 3/9] drm/i915: Enable default_phase in GCP when possible
Quoted 53 lines · Chandra
Quoted 53 lines
Quoted 42 lines
Quoted 42 lines
(quoted diff) +11
-0@@ -560,6 +560,49 @@ static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder) return false; } +/* + * Determine if default_phase=1 can be indicated in the GCP infoframe. + * + * From HDMI specification 1.4a: + * - The first pixel of each Video Data Period shall always have a +pixel packing phase of 0 + * - The first pixel following each Video Data Period shall have a +pixel packing phase of 0 + * - The PP bits shall be constant for all GCPs and will be equal to +the last packing phase + * - The first pixel following every transition of HSYNC or VSYNC shall have apixel packing
+ * phase of 0
+ */drivers/gpu/drm/i915/intel_hdmi.c +23
-0+static bool gcp_default_phase_possible (int pipe_bpp, +const struct drm_display_mode *mode) { +unsigned int pixels_per_group; + +switch (pipe_bpp) { +case 30 : +/* 4 pixels in 5 clocks */ + pixels_per_group =4 ; +break ; +case 36 : +/* 2 pixels in 3 clocks */ + pixels_per_group =2 ; +break ; +case 48 : +/* 1 pixel in 2 clocks */ + pixels_per_group =1 ; +break ; +default : +/* phase information not relevant for 8bpc */ +return false; + } + + return mode->crtc_hdisplay % pixels_per_group == 0 &&Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder) · line 601
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +5
-0+ mode->crtc_htotal % pixels_per_group ==0 && + mode->crtc_hblank_start % pixels_per_group ==0 && + mode->crtc_hblank_end % pixels_per_group ==0 && + mode->crtc_hsync_start % pixels_per_group ==0 && + mode->crtc_hsync_end % pixels_per_group == 0 &&For hsync, bspec says Hsync is an even number.
Isn't it above check should be something like (hsync_end-hsync_start) % 2 ==0?
Quoted 1 line
And similarly for front & back porches, right?
Quoted 8 lines
Quoted 3 lines
If X and Y are even then (X - Y) is even too. Also the text in bspec is less informative than the text in HDMI spec, which is why I quited the HDMI spec instead.
Sure, if X and Y are even X - Y is even, but it is more restrictive check than needed. Because if both X and Y are odd, X - Y is even, and in that case above code doesn't allow to use default phase. Which may be OK, but it didn't truly allow default phase when possible.
Default phase should not be enabled in that case. As the HDMI spec says "The first pixel following every transition of HSYNC or VSYNC shall have a pixel packing phase of 0", so having a misaligned hsync_start or hsync_end is not allowed.
Or you can also read bspec. While the text is less clear there IMO it does disallow the case you outlined. What bspec does say is this:
"Htotal is an even number
Hactive is an even number
Hsync is an even number
Front and back porches for Hsync are even numbers
Vsync always starts on an even-numbered pixel within a line in interlaced modes (starting counting with 0)"
That doesn't allow hsync_start or hsync_end to be odd either.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Konduru, Chandra
Reviewed-byRe: [PATCH v2 3/9] drm/i915: Enable default_phase in GCP when possible
Quoted 66 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-0@@ -560,6 +560,49 @@ static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder)return false; }Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Review static bool hdmi_sink_is_deep_color(struct · line 574
Quoted 11 lines
(quoted diff) +11
-0+/* + * Determine if default_phase=1 can be indicated in the GCP infoframe. + * + * From HDMI specification 1.4a: + * - The first pixel of each Video Data Period shall always have a +pixel packing phase of 0 + * - The first pixel following each Video Data Period shall have a +pixel packing phase of 0 + * - The PP bits shall be constant for all GCPs and will be equal to +the last packing phase + * - The first pixel following every transition of HSYNC or VSYNC shallhave a
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Review
Quoted 5 lines
pixel packing
+ * phase of 0
+ */(quoted diff) +2
-0+static bool gcp_default_phase_possible(int pipe_bpp, + const struct drm_display_mode*mode) {
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/i915/intel_hdmi.c +21
-0+unsigned int pixels_per_group; + +switch (pipe_bpp) { +case 30 : +/* 4 pixels in 5 clocks */ + pixels_per_group =4 ; +break ; +case 36 : +/* 2 pixels in 3 clocks */ + pixels_per_group =2 ; +break ; +case 48 : +/* 1 pixel in 2 clocks */ + pixels_per_group =1 ; +break ; +default : +/* phase information not relevant for 8bpc */ +return false; + } + + return mode->crtc_hdisplay % pixels_per_group == 0 &&Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c static bool hdmi_sink_is_deep_color(struct drm_encoder *encoder) · line 601
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +5
-0+ mode->crtc_htotal % pixels_per_group ==0 && + mode->crtc_hblank_start % pixels_per_group ==0 && + mode->crtc_hblank_end % pixels_per_group ==0 && + mode->crtc_hsync_start % pixels_per_group ==0 && + mode->crtc_hsync_end % pixels_per_group == 0 &&For hsync, bspec says Hsync is an even number.
Isn't it above check should be something like (hsync_end-hsync_start) % 2==
Quoted 11 lines
Quoted 6 lines
0?
Quoted 1 line
And similarly for front & back porches, right?
If X and Y are even then (X - Y) is even too. Also the text in bspec is less informative than the text in HDMI spec, which is why I quited the HDMI spec instead.
Sure, if X and Y are even X - Y is even, but it is more restrictive check than needed. Because if both X and Y are odd, X - Y is even, and in that case above code doesn't allow to use default phase. Which may be OK, but it didn't truly allow default phase when possible.
Quoted 4 lines
Default phase should not be enabled in that case. As the HDMI spec says "The first pixel following every transition of HSYNC or VSYNC shall have a pixel packing phase of 0", so having a misaligned
hsync_startorhsync_endis not allowed.
OK. Thanks for clarification!
With that, it gets
Quoted 10 lines
Or you can also read bspec. While the text is less clear there IMO it does disallow the case you outlined. What bspec does say is this:
"Htotal is an even number
Hactive is an even number
Hsync is an even number
Front and back porches for Hsync are even numbers
Vsync always starts on an even-numbered pixel within a line in interlaced modes (starting counting with 0)"
Quoted 5 lines
That doesn't allow
hsync_startorhsync_endto be odd either.--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 4/9 drm/i915: Fix HDMI 12bpc TRANSCONF bpc value
In reply to [email protected]From: Ville Syrjälä <[email protected]>
IBX BSpec says we must specify 8bpc in TRANSCONF for both 8bpc and 12bpc HDMI output. Do so.
v2: Pass intel_crtc to intel_pipe_has_type()
--- drivers/gpu/drm/i915/intel_display.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -3
@@ -2001,11 +2001,15 @@ static void ironlake_enable_pch_transcoder(struct drm_i915_private *dev_priv,if (HAS_PCH_IBX (dev_priv->dev)) {/* -* make the BPC in transcoder be consistent with -* that in pipeconf reg. +* Make the BPC in transcoder be consistent with +* that in pipeconf reg. For HDMI we must use 8bpc +* here for both 8bpc and 12bpc. */ val &= ~PIPECONF_BPC_MASK ; - val |= pipeconf_val &PIPECONF_BPC_MASK ; +if (intel_pipe_has_type (intel_crtc,INTEL_OUTPUT_HDMI )) + val |=PIPECONF_8BPC ; +else + val |= pipeconf_val &PIPECONF_BPC_MASK ; } val &= ~TRANS_INTERLACE_MASK ;
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 4/9] drm/i915: Fix HDMI 12bpc TRANSCONF bpc value
Quoted 46 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 4/9] drm/i915: Fix HDMI 12bpc TRANSCONF bpc valueFrom: Ville Syrjälä <[email protected]>
IBX BSpec says we must specify 8bpc in TRANSCONF for both 8bpc and 12bpc HDMI output. Do so.
v2: Pass
intel_crtctointel_pipe_has_type()Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/intel_display.c +7
-3@@ -2001,11 +2001,15 @@ static void ironlake_enable_pch_transcoder(struct drm_i915_private *dev_priv, if (HAS_PCH_IBX(dev_priv->dev)) {/* -* make the BPC in transcoder be consistent with -* that in pipeconf reg. +* Make the BPC in transcoder be consistent with +* that in pipeconf reg. For HDMI we must use 8bpc +* here for both 8bpc and 12bpc. */ val &= ~PIPECONF_BPC_MASK ; - val |= pipeconf_val &PIPECONF_BPC_MASK ; +if (intel_pipe_has_type (intel_crtc,INTEL_OUTPUT_HDMI )) + val |=PIPECONF_8BPC ; +else + val |= pipeconf_val &PIPECONF_BPC_MASK ; }
Quoted 2 lines
val &= ~TRANS_INTERLACE_MASK;
--
Reviewed by: Chandra Konduru <[email protected]>
Quoted 6 lines
2.0.5
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 5/9 drm/i915: Fix 12bpc HDMI enable for IBX
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Follow the procedure listed in Bspec to toggle the port enable bit off and on when enabling HDMI with 12bpc and pixel repeat on IBX. The old code didn't actually enable the port before "toggling" the bit back off, so the whole workaround was essentially a nop.
Also take the opportunity to clarify the code by splitting the gmch platforms to a separate (much more straightforward) function.
v2: Rebased due to crtc->config changes
--- drivers/gpu/drm/i915/intel_hdmi.c | 78 ++++++++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 25 deletions(-)
drivers/gpu/drm/i915/intel_hdmi.c +53 -25
@@ -944,47 +944,73 @@ static void intel_enable_hdmi_audio(struct intel_encoder *encoder)intel_audio_codec_enable (encoder); } -static void intel_enable_hdmi (struct intel_encoder *encoder) +static void g4x_enable_hdmi (struct intel_encoder *encoder) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc);struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base);u32 temp; -u32 enable_bits =SDVO_ENABLE ; - -if (intel_crtc->config->has_audio) - enable_bits |=SDVO_AUDIO_ENABLE ; temp =I915_READ (intel_hdmi->hdmi_reg); -/* HW workaround for IBX, we need to move the port to transcoder A -* before disabling it, so restore the transcoder select bit here. */ -if (HAS_PCH_IBX (dev)) - enable_bits |=SDVO_PIPE_SEL (intel_crtc->pipe); + temp |=SDVO_ENABLE ; +if (crtc->config->has_audio) + temp |=SDVO_AUDIO_ENABLE ; -/* HW workaround, need to toggle enable bit off and on for 12bpc, but -* we do this anyway which shows more stable in testing. -*/ -if (HAS_PCH_SPLIT (dev)) { -I915_WRITE (intel_hdmi->hdmi_reg, temp & ~SDVO_ENABLE ); -POSTING_READ (intel_hdmi->hdmi_reg); - } +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg); - temp |= enable_bits; +if (crtc->config->has_audio) +intel_enable_hdmi_audio (encoder); +} +static void ibx_enable_hdmi (struct intel_encoder *encoder) +{ +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); +struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); +u32 temp; + + temp =I915_READ (intel_hdmi->hdmi_reg); + + temp |=SDVO_ENABLE ; +if (crtc->config->has_audio) + temp |=SDVO_AUDIO_ENABLE ; + +/* +* HW workaround, need to write this twice for issue +* that may result in first write getting masked. +*/ +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg);I915_WRITE (intel_hdmi->hdmi_reg, temp);POSTING_READ (intel_hdmi->hdmi_reg); -/* HW workaround, need to write this twice for issue that may result -* in first write getting masked. +/* +* HW workaround, need to toggle enable bit off and on +* for 12bpc with pixel repeat. +* +* FIXME: BSpec says this should be done at the end of +* of the modeset sequence, so not sure if this isn't too soon. */ -if (HAS_PCH_SPLIT (dev)) { +if (crtc->config->pipe_bpp >24 && + crtc->config->pixel_multiplier >1 ) { +I915_WRITE (intel_hdmi->hdmi_reg, temp & ~SDVO_ENABLE ); +POSTING_READ (intel_hdmi->hdmi_reg); + +/* +* HW workaround, need to write this twice for issue +* that may result in first write getting masked. +*/ +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg);I915_WRITE (intel_hdmi->hdmi_reg, temp);POSTING_READ (intel_hdmi->hdmi_reg); } -if (intel_crtc->config->has_audio) +if (crtc->config->has_audio)intel_enable_hdmi_audio (encoder); }
@@ -1509,7 +1535,7 @@ static void vlv_hdmi_pre_enable(struct intel_encoder *encoder) intel_crtc->config->has_hdmi_sink, adjusted_mode); -intel_enable_hdmi (encoder); +g4x_enable_hdmi (encoder);vlv_wait_port_ready (dev_priv, dport,0x0 ); }
@@ -1828,7 +1854,7 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder)chv_powergate_phy_lanes (encoder,0x0 ); -intel_enable_hdmi (encoder); +g4x_enable_hdmi (encoder);vlv_wait_port_ready (dev_priv, dport,0x0 ); }
@@ -2012,8 +2038,10 @@ void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port) intel_encoder->pre_enable = intel_hdmi_pre_enable;if (HAS_PCH_CPT (dev)) intel_encoder->enable = cpt_enable_hdmi; +else if (HAS_PCH_IBX (dev)) + intel_encoder->enable = ibx_enable_hdmi;else - intel_encoder->enable = intel_enable_hdmi; + intel_encoder->enable = g4x_enable_hdmi; } intel_encoder->type =INTEL_OUTPUT_HDMI ;
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 5/9] drm/i915: Fix 12bpc HDMI enable for IBX
Quoted 11 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 5/9] drm/i915: Fix 12bpc HDMI enable for IBXFrom: Ville Syrjälä <[email protected]>
Quoted 7 lines
Follow the procedure listed in Bspec to toggle the port enable bit off and on when enabling HDMI with 12bpc and pixel repeat on IBX. The old code didn't actually enable the port before "toggling" the bit back off, so the whole workaround was essentially a nop.
Also take the opportunity to clarify the code by splitting the gmch platforms to a separate (much more straightforward) function.
Per prior reviews seen before, it would be better if there are separate patches for fixing issue and refactoring code.
I think it is fine either way, but is bit easy for reviewing code having separate patches.
With that,
Quoted 16 lines
v2: Rebased due to
crtc->configchangesSigned-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 78 ++++++++++++++++++++++++++--------- ---- 1 file changed, 53 insertions(+), 25 deletions(-)drivers/gpu/drm/i915/intel_hdmi.c +0
-0@@ -944,47 +944,73 @@ static void intel_enable_hdmi_audio(struct intel_encoder *encoder)
drivers/gpu/drm/i915/intel_hdmi.c static void intel_enable_hdmi_audio(struct · line 952
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-2intel_audio_codec_enable (encoder); } -static void intel_enable_hdmi (struct intel_encoder *encoder) +static void g4x_enable_hdmi (struct intel_encoder *encoder) {struct drm_device *dev = encoder->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc); +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc);
Unrelated change
Quoted 121 lines
drivers/gpu/drm/i915/intel_hdmi.c +47
-21struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base);u32 temp; -u32 enable_bits =SDVO_ENABLE ; - -if (intel_crtc->config->has_audio) - enable_bits |=SDVO_AUDIO_ENABLE ; temp =I915_READ (intel_hdmi->hdmi_reg); -/* HW workaround for IBX, we need to move the port to transcoder A -* before disabling it, so restore the transcoder select bit here. */ -if (HAS_PCH_IBX (dev)) - enable_bits |=SDVO_PIPE_SEL (intel_crtc->pipe); + temp |=SDVO_ENABLE ; +if (crtc->config->has_audio) + temp |=SDVO_AUDIO_ENABLE ; -/* HW workaround, need to toggle enable bit off and on for 12bpc, but -* we do this anyway which shows more stable in testing. -*/ -if (HAS_PCH_SPLIT (dev)) { -I915_WRITE (intel_hdmi->hdmi_reg, temp & ~SDVO_ENABLE ); -POSTING_READ (intel_hdmi->hdmi_reg); - } +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg); - temp |= enable_bits; +if (crtc->config->has_audio) +intel_enable_hdmi_audio (encoder); +} +static void ibx_enable_hdmi (struct intel_encoder *encoder) +{ +struct drm_device *dev = encoder->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); +struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); +u32 temp; + + temp =I915_READ (intel_hdmi->hdmi_reg); + + temp |=SDVO_ENABLE ; +if (crtc->config->has_audio) + temp |=SDVO_AUDIO_ENABLE ; + +/* +* HW workaround, need to write this twice for issue +* that may result in first write getting masked. +*/ +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg);I915_WRITE (intel_hdmi->hdmi_reg, temp);POSTING_READ (intel_hdmi->hdmi_reg); -/* HW workaround, need to write this twice for issue that may result -* in first write getting masked. +/* +* HW workaround, need to toggle enable bit off and on +* for 12bpc with pixel repeat. +* +* FIXME: BSpec says this should be done at the end of +* of the modeset sequence, so not sure if this isn't too soon. */ -if (HAS_PCH_SPLIT (dev)) { +if (crtc->config->pipe_bpp >24 && + crtc->config->pixel_multiplier >1 ) { +I915_WRITE (intel_hdmi->hdmi_reg, temp & ~SDVO_ENABLE ); +POSTING_READ (intel_hdmi->hdmi_reg); + +/* +* HW workaround, need to write this twice for issue +* that may result in first write getting masked. +*/ +I915_WRITE (intel_hdmi->hdmi_reg, temp); +POSTING_READ (intel_hdmi->hdmi_reg);I915_WRITE (intel_hdmi->hdmi_reg, temp);POSTING_READ (intel_hdmi->hdmi_reg); } -if (intel_crtc->config->has_audio) +if (crtc->config->has_audio)intel_enable_hdmi_audio (encoder); }@@ -1509,7 +1535,7 @@ static void vlv_hdmi_pre_enable(struct intel_encoder *encoder) intel_crtc->config->has_hdmi_sink, adjusted_mode); -intel_enable_hdmi (encoder); +g4x_enable_hdmi (encoder);vlv_wait_port_ready (dev_priv, dport,0x0 );}
drivers/gpu/drm/i915/intel_hdmi.c +1
-1@@ -1828,7 +1854,7 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder)chv_powergate_phy_lanes (encoder,0x0 ); -intel_enable_hdmi (encoder); +g4x_enable_hdmi (encoder);vlv_wait_port_ready (dev_priv, dport,0x0 );}
drivers/gpu/drm/i915/intel_hdmi.c +3
-1@@ -2012,8 +2038,10 @@ void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port) intel_encoder->pre_enable = intel_hdmi_pre_enable;if (HAS_PCH_CPT (dev)) intel_encoder->enable = cpt_enable_hdmi; +else if (HAS_PCH_IBX (dev)) + intel_encoder->enable = ibx_enable_hdmi;else - intel_encoder->enable = intel_enable_hdmi; + intel_encoder->enable = g4x_enable_hdmi; }
intel_encoder->type=INTEL_OUTPUT_HDMI;
--
2.0.5
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 6/9 drm/i915: Disable all infoframes when turning off the HDMI port
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Currently we just disable the GCP infoframe when turning off the port. That means if the same transcoder is used on a DP port next, we might end up pushing infoframes over DP, which isn't intended. Just disable all the infoframes when turning off the port.
Also protect against two ports stomping on each other on g4x due to the single video DIP instance. Now only the first port to enable gets to send infoframes.
v2: Rebase
--- drivers/gpu/drm/i915/intel_hdmi.c | 85 ++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 45 deletions(-)
drivers/gpu/drm/i915/intel_hdmi.c +40 -45
@@ -514,7 +514,13 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; +if (port != (val &VIDEO_DIP_PORT_MASK )) { +DRM_DEBUG_KMS ("video DIP still enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ; + } + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );I915_WRITE (reg, val);POSTING_READ (reg);return ;
@@ -522,16 +528,17 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,if (port != (val &VIDEO_DIP_PORT_MASK )) {if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); +DRM_DEBUG_KMS ("video DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ; } val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~VIDEO_DIP_ENABLE_VENDOR ; + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );I915_WRITE (reg, val);POSTING_READ (reg);
@@ -632,23 +639,6 @@ static bool intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)return val !=0 ; } -static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) -{ -struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; -u32 reg; - -if (HAS_DDI (dev_priv)) - reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); -else if (IS_VALLEYVIEW (dev_priv)) - reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); -else if (HAS_PCH_SPLIT (dev_priv->dev)) - reg =TVIDEO_DIP_CTL (crtc->pipe); -else -return ; - -I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); -} -static void ibx_set_infoframes (struct drm_encoder *encoder,bool enable,struct drm_display_mode *adjusted_mode)
@@ -669,25 +659,26 @@ static void ibx_set_infoframes(struct drm_encoder *encoder,if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder)) val |=VIDEO_DIP_ENABLE_GCP ;
@@ -718,7 +709,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder,if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ); + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );I915_WRITE (reg, val);POSTING_READ (reg);return ;
@@ -727,7 +720,7 @@ static void cpt_set_infoframes(struct drm_encoder *encoder,/* Set both together, unset both together: see the spec. */ val |=VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ; val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder)) val |=VIDEO_DIP_ENABLE_GCP ;
@@ -760,25 +753,26 @@ static void vlv_set_infoframes(struct drm_encoder *encoder,if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR | -VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder)) val |=VIDEO_DIP_ENABLE_GCP ;
@@ -803,15 +797,16 @@ static void hsw_set_infoframes(struct drm_encoder *encoder,assert_hdmi_port_disabled (intel_hdmi); + val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_AVI_HSW | +VIDEO_DIP_ENABLE_GCP_HSW |VIDEO_DIP_ENABLE_VS_HSW | +VIDEO_DIP_ENABLE_GMP_HSW |VIDEO_DIP_ENABLE_SPD_HSW ); +if (!enable) { -I915_WRITE (reg,0 ); +I915_WRITE (reg, val);POSTING_READ (reg);return ; } - val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_GCP_HSW | -VIDEO_DIP_ENABLE_VS_HSW |VIDEO_DIP_ENABLE_GMP_HSW ); -if (intel_hdmi_set_gcp_infoframe (encoder)) val |=VIDEO_DIP_ENABLE_GCP_HSW ;
@@ -1133,7 +1128,7 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); -intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc)); + intel_hdmi->set_infoframes (&encoder->base, false,NULL ); }static int hdmi_portclock_limit (struct intel_hdmi *hdmi,bool respect_dvi_limit)
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI port
Quoted 10 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI port
Quoted 5 lines
From: Ville Syrjälä <[email protected]>
Currently we just disable the GCP infoframe when turning off the port. That means if the same transcoder is used on a DP port next, we might end up pushing infoframes over DP, which isn't intended. Just disable
Wonder how it is working. May be it is ok, or never hit using a previously used transcoder for HDMI port for DP.
By the way, you mean end up pushing "other" infoframes over DP?
Quoted 5 lines
all the infoframes when turning off the port.
Also protect against two ports stomping on each other on g4x due to the single video DIP instance. Now only the first port to enable gets to send infoframes.
So is, 2nd port doesn't gets to send infoframes, the expected behavior when two ports trying with a single DIP?
Seems like a corner case to test thoroughly. Is this path exercised in your testing?
Quoted 210 lines
v2: Rebase
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 85 ++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 45 deletions(-)drivers/gpu/drm/i915/intel_hdmi.c +7
-1@@ -514,7 +514,13 @@ static void g4x_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; +if (port != (val &VIDEO_DIP_PORT_MASK )) { + DRM_DEBUG_KMS("video DIP still enabled on port %c\n", + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ; + } + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );drivers/gpu/drm/i915/intel_hdmi.c +5
-4I915_WRITE (reg, val);POSTING_READ (reg);return ;@@ -522,16 +528,17 @@ static void g4x_set_infoframes(struct drm_encoder *encoder, if (port != (val & VIDEO_DIP_PORT_MASK)) {if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); + DRM_DEBUG_KMS("video DIP already enabled on port %c\n", + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ; } val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~VIDEO_DIP_ENABLE_VENDOR ; + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );drivers/gpu/drm/i915/intel_hdmi.c +0
-17I915_WRITE (reg, val);POSTING_READ (reg);@@ -632,23 +639,6 @@ static bool intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)return val !=0 ; } -static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) -{ -struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; -u32 reg; - -if (HAS_DDI (dev_priv)) - reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); -else if (IS_VALLEYVIEW (dev_priv)) - reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); -else if (HAS_PCH_SPLIT (dev_priv->dev)) - reg =TVIDEO_DIP_CTL (crtc->pipe); -else -return ; - -I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); -} - static void ibx_set_infoframes(struct drm_encoder *encoder, bool enable,drivers/gpu/drm/i915/intel_hdmi.c +9
-8struct drm_display_mode *adjusted_mode)@@ -669,25 +659,26 @@ static void ibx_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +2
-1val |=VIDEO_DIP_ENABLE_GCP ;@@ -718,7 +709,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ); + val &= ~(VIDEO_DIP_ENABLE | VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|drivers/gpu/drm/i915/intel_hdmi.c +2
-1+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP);I915_WRITE (reg, val);POSTING_READ (reg);return ;@@ -727,7 +720,7 @@ static void cpt_set_infoframes(struct drm_encoder *encoder,/* Set both together, unset both together: see the spec. */ val |=VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ; val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +9
-8val |=VIDEO_DIP_ENABLE_GCP ;@@ -760,25 +753,26 @@ static void vlv_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR | -VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +6
-5val |=VIDEO_DIP_ENABLE_GCP ;@@ -803,15 +797,16 @@ static void hsw_set_infoframes(struct drm_encoder *encoder,assert_hdmi_port_disabled (intel_hdmi); + val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_AVI_HSW | +VIDEO_DIP_ENABLE_GCP_HSW |VIDEO_DIP_ENABLE_VS_HSW | +VIDEO_DIP_ENABLE_GMP_HSW |VIDEO_DIP_ENABLE_SPD_HSW ); +if (!enable) { -I915_WRITE (reg,0 ); +I915_WRITE (reg, val);POSTING_READ (reg);return ; } - val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_GCP_HSW | -VIDEO_DIP_ENABLE_VS_HSW |VIDEO_DIP_ENABLE_GMP_HSW ); -if (intel_hdmi_set_gcp_infoframe (encoder)) val |=VIDEO_DIP_ENABLE_GCP_HSW ;@@ -1133,7 +1128,7 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); -intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc)); + intel_hdmi->set_infoframes (&encoder->base, false,NULL ); }static int
hdmi_portclock_limit(struct intel_hdmi *hdmi, bool respect_dvi_limit)
--
2.0.5
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI port
Quoted 12 lines · Chandra
Quoted 12 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI portFrom: Ville Syrjälä <[email protected]>
Quoted 8 lines
Quoted 3 lines
Currently we just disable the GCP infoframe when turning off the port. That means if the same transcoder is used on a DP port next, we might end up pushing infoframes over DP, which isn't intended. Just disable
Wonder how it is working. May be it is ok, or never hit using a previously used transcoder for HDMI port for DP.
By the way, you mean end up pushing "other" infoframes over DP?
We don't send infoframes over DP at all currently. Or I should say we never intended to send them. After this patch that should even be true. Well, unless the BIOS already enables them and we just fire up a DP port using the transcoder in question. So I suppose we should really have the DP code clear the infoframe settings explicitly, or we should clear them during the sanitize phase.
Quoted 9 lines
Quoted 6 lines
all the infoframes when turning off the port.
Also protect against two ports stomping on each other on g4x due to the single video DIP instance. Now only the first port to enable gets to send infoframes.
So is, 2nd port doesn't gets to send infoframes, the expected behavior when two ports trying with a single DIP?
I'm not sure what's the best behaviour here. Either we somehow pick one of the ports to send infoframes (first come first serve in this patch), or we could just disable infoframes entirely for cloned cases. But it's probably a rare configuration anyway since HDMI cloning is only allowed on g4x.
Quoted 2 lines
Seems like a corner case to test thoroughly. Is this path exercised in your testing?
I tested it long ago. Although I must admit that the patch looked a bit different back then.
Quoted 215 lines
Quoted 215 lines
v2: Rebase
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 85 ++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 45 deletions(-)drivers/gpu/drm/i915/intel_hdmi.c +7
-1@@ -514,7 +514,13 @@ static void g4x_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; +if (port != (val &VIDEO_DIP_PORT_MASK )) { + DRM_DEBUG_KMS("video DIP still enabled on port %c\n", + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ; + } + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );drivers/gpu/drm/i915/intel_hdmi.c +5
-4I915_WRITE (reg, val);POSTING_READ (reg);return ;@@ -522,16 +528,17 @@ static void g4x_set_infoframes(struct drm_encoder *encoder, if (port != (val & VIDEO_DIP_PORT_MASK)) {if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); + DRM_DEBUG_KMS("video DIP already enabled on port %c\n", + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ; } val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~VIDEO_DIP_ENABLE_VENDOR ; + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );drivers/gpu/drm/i915/intel_hdmi.c +0
-17I915_WRITE (reg, val);POSTING_READ (reg);@@ -632,23 +639,6 @@ static bool intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)return val !=0 ; } -static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) -{ -struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; -u32 reg; - -if (HAS_DDI (dev_priv)) - reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); -else if (IS_VALLEYVIEW (dev_priv)) - reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); -else if (HAS_PCH_SPLIT (dev_priv->dev)) - reg =TVIDEO_DIP_CTL (crtc->pipe); -else -return ; - -I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); -} - static void ibx_set_infoframes(struct drm_encoder *encoder, bool enable,drivers/gpu/drm/i915/intel_hdmi.c +9
-8struct drm_display_mode *adjusted_mode)@@ -669,25 +659,26 @@ static void ibx_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +2
-1val |=VIDEO_DIP_ENABLE_GCP ;@@ -718,7 +709,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ); + val &= ~(VIDEO_DIP_ENABLE | VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|drivers/gpu/drm/i915/intel_hdmi.c +2
-1+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP);I915_WRITE (reg, val);POSTING_READ (reg);return ;@@ -727,7 +720,7 @@ static void cpt_set_infoframes(struct drm_encoder *encoder,/* Set both together, unset both together: see the spec. */ val |=VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ; val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +9
-8val |=VIDEO_DIP_ENABLE_GCP ;@@ -760,25 +753,26 @@ static void vlv_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR | -VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +6
-5val |=VIDEO_DIP_ENABLE_GCP ;@@ -803,15 +797,16 @@ static void hsw_set_infoframes(struct drm_encoder *encoder,assert_hdmi_port_disabled (intel_hdmi); + val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_AVI_HSW | +VIDEO_DIP_ENABLE_GCP_HSW |VIDEO_DIP_ENABLE_VS_HSW | +VIDEO_DIP_ENABLE_GMP_HSW |VIDEO_DIP_ENABLE_SPD_HSW ); +if (!enable) { -I915_WRITE (reg,0 ); +I915_WRITE (reg, val);POSTING_READ (reg);return ; } - val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_GCP_HSW | -VIDEO_DIP_ENABLE_VS_HSW |VIDEO_DIP_ENABLE_GMP_HSW ); -if (intel_hdmi_set_gcp_infoframe (encoder)) val |=VIDEO_DIP_ENABLE_GCP_HSW ;@@ -1133,7 +1128,7 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); -intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc)); + intel_hdmi->set_infoframes (&encoder->base, false,NULL ); }static int
hdmi_portclock_limit(struct intel_hdmi *hdmi, bool respect_dvi_limit)
--
2.0.5_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Konduru, Chandra
Reviewed-byRe: [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI port
Quoted 31 lines
-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Tuesday, June 02, 2015 4:11 AM
To: Konduru, Chandra
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI portQuoted 4 lines · Chandra
Quoted 4 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On BehalfOf
Quoted 15 lines
Quoted 11 lines
[email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI portFrom: Ville Syrjälä <[email protected]>
Currently we just disable the GCP infoframe when turning off the port. That means if the same transcoder is used on a DP port next, we might end up pushing infoframes over DP, which isn't intended. Just disable
Wonder how it is working. May be it is ok, or never hit using a previously used transcoder for HDMI port for DP.
Quoted 8 lines
Quoted 1 line
By the way, you mean end up pushing "other" infoframes over DP?
We don't send infoframes over DP at all currently. Or I should say we never intended to send them. After this patch that should even be true. Well, unless the BIOS already enables them and we just fire up a DP port using the transcoder in question. So I suppose we should really have the DP code clear the infoframe settings explicitly, or we should clear them during the sanitize phase.
Agree that DP code path should clear the infoframe settings explicitly. As you are already touching this code, will you plan to handle it? Once it is taken care, it gets
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
all the infoframes when turning off the port.
Also protect against two ports stomping on each other on g4x due to the single video DIP instance. Now only the first port to enable gets to send infoframes.
Quoted 8 lines
Quoted 2 lines
So is, 2nd port doesn't gets to send infoframes, the expected behavior when two ports trying with a single DIP?
I'm not sure what's the best behaviour here. Either we somehow pick one of the ports to send infoframes (first come first serve in this patch), or we could just disable infoframes entirely for cloned cases. But it's probably a rare configuration anyway since HDMI cloning is only allowed on g4x.
I am fine with what you outlined above. If anything come up, this can be revisited.
Quoted 233 lines
Quoted 3 lines
Seems like a corner case to test thoroughly. Is this path exercised in your
testing?
I tested it long ago. Although I must admit that the patch looked a bit different back then.
Quoted 7 lines
Quoted 7 lines
v2: Rebase
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 85 ++++++++++++++++++---------------------
Quoted 18 lines
Quoted 18 lines
1 file changed, 40 insertions(+), 45 deletions(-)drivers/gpu/drm/i915/intel_hdmi.c +4
-1@@ -514,7 +514,13 @@ static void g4x_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; +if (port != (val &VIDEO_DIP_PORT_MASK )) { + DRM_DEBUG_KMS("video DIP still enabled on port %c\n", + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ;Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct
Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c +3
-0+ } + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );drivers/gpu/drm/i915/intel_hdmi.c +0
-0I915_WRITE (reg, val);POSTING_READ (reg);return ;@@ -522,16 +528,17 @@ static void g4x_set_infoframes(struct
drm_encoderQuoted 41 lines
Quoted 41 lines
drivers/gpu/drm/i915/intel_hdmi.c +5
-4*encoder, if (port != (val & VIDEO_DIP_PORT_MASK)) {if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); + DRM_DEBUG_KMS("video DIP already enabled on port %c\n", + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ; } val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~VIDEO_DIP_ENABLE_VENDOR ; + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );drivers/gpu/drm/i915/intel_hdmi.c +0
-13I915_WRITE (reg, val);POSTING_READ (reg);@@ -632,23 +639,6 @@ static bool intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)return val !=0 ; } -static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) -{ -struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; -u32 reg; - -if (HAS_DDI (dev_priv)) - reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); -else if (IS_VALLEYVIEW (dev_priv)) - reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); -else if (HAS_PCH_SPLIT (dev_priv->dev)) - reg =TVIDEO_DIP_CTL (crtc->pipe); -else -return ;Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c static void ibx_set_infoframes(struct
Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-4- -I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); -} - static void ibx_set_infoframes(struct drm_encoder *encoder, bool enable,drivers/gpu/drm/i915/intel_hdmi.c +0
-0struct drm_display_mode *adjusted_mode)@@ -669,25 +659,26 @@ static void ibx_set_infoframes(struct
drm_encoderQuoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder,
Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-1*encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE | VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|Quoted 49 lines
Quoted 49 lines
drivers/gpu/drm/i915/intel_hdmi.c +7
-7+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP);I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +2
-1val |=VIDEO_DIP_ENABLE_GCP ;@@ -718,7 +709,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ); + val &= ~(VIDEO_DIP_ENABLE | VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|drivers/gpu/drm/i915/intel_hdmi.c +2
-1+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP);I915_WRITE (reg, val);POSTING_READ (reg);return ;@@ -727,7 +720,7 @@ static void cpt_set_infoframes(struct drm_encoder *encoder,/* Set both together, unset both together: see the spec. */ val |=VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ; val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c static void vlv_set_infoframes(struct
Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-0if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +0
-0val |=VIDEO_DIP_ENABLE_GCP ;@@ -760,25 +753,26 @@ static void vlv_set_infoframes(struct
drm_encoderQuoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder,
Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-1*encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE | VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|Quoted 26 lines
Quoted 26 lines
drivers/gpu/drm/i915/intel_hdmi.c +7
-7+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP);I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR | -VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct
Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-0if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +0
-0val |=VIDEO_DIP_ENABLE_GCP ;@@ -803,15 +797,16 @@ static void hsw_set_infoframes(struct
drm_encoderQuoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct drm_encoder *encoder,
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +1
-0*encoder,assert_hdmi_port_disabled (intel_hdmi); + val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |
VIDEO_DIP_ENABLE_AVI_HSW|Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct · line 802
Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c +1
-0+ VIDEO_DIP_ENABLE_GCP_HSW |
VIDEO_DIP_ENABLE_VS_HSW|Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct · line 803
Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c +1
-0+ VIDEO_DIP_ENABLE_GMP_HSW |
VIDEO_DIP_ENABLE_SPD_HSW);Quoted 9 lines
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct drm_encoder *encoder,
Quoted 9 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-2+if (!enable) { -I915_WRITE (reg,0 ); +I915_WRITE (reg, val);POSTING_READ (reg);return ; } - val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |
VIDEO_DIP_ENABLE_GCP_HSW|Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct · line 814
Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c +0
-1- VIDEO_DIP_ENABLE_VS_HSW |
VIDEO_DIP_ENABLE_GMP_HSW);Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c static void intel_disable_hdmi(struct
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-1-if (intel_hdmi_set_gcp_infoframe (encoder)) val |=VIDEO_DIP_ENABLE_GCP_HSW ;@@ -1133,7 +1128,7 @@ static void intel_disable_hdmi(struct
intel_encoderQuoted 9 lines
Quoted 9 lines
drivers/gpu/drm/i915/intel_hdmi.c +1
-1*encoder)if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); -intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc)); + intel_hdmi->set_infoframes (&encoder->base, false,NULL ); }static int hdmi_portclock_limit(struct
intel_hdmi*hdmi, bool
respect_dvi_limit)Quoted 3 lines
Quoted 3 lines
--
2.0.5
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI port
Quoted 40 lines · Chandra
Quoted 31 lines
-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Tuesday, June 02, 2015 4:11 AM
To: Konduru, Chandra
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI portQuoted 4 lines · Chandra
Quoted 4 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On BehalfOf
Quoted 15 lines
Quoted 11 lines
[email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI portFrom: Ville Syrjälä <[email protected]>
Currently we just disable the GCP infoframe when turning off the port. That means if the same transcoder is used on a DP port next, we might end up pushing infoframes over DP, which isn't intended. Just disable
Wonder how it is working. May be it is ok, or never hit using a previously used transcoder for HDMI port for DP.
Quoted 8 lines
Quoted 1 line
By the way, you mean end up pushing "other" infoframes over DP?
We don't send infoframes over DP at all currently. Or I should say we never intended to send them. After this patch that should even be true. Well, unless the BIOS already enables them and we just fire up a DP port using the transcoder in question. So I suppose we should really have the DP code clear the infoframe settings explicitly, or we should clear them during the sanitize phase.
Quoted 2 lines
Agree that DP code path should clear the infoframe settings explicitly. As you are already touching this code, will you plan to handle it?
I don't think I'll go there now. It would require quite a bit more work to expose the infoframe stuff to the DP code. DP + infoframes in general sounds like a good project for someone else to figure out. A quick glance at the DP spec suggests that we should at least send the audio infoframe.
Quoted 264 lines
Once it is taken care, it gets
Reviewed-by Chandra Konduru <[email protected]>Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
all the infoframes when turning off the port.
Also protect against two ports stomping on each other on g4x due to the single video DIP instance. Now only the first port to enable gets to send infoframes.
Quoted 8 lines
Quoted 2 lines
So is, 2nd port doesn't gets to send infoframes, the expected behavior when two ports trying with a single DIP?
I'm not sure what's the best behaviour here. Either we somehow pick one of the ports to send infoframes (first come first serve in this patch), or we could just disable infoframes entirely for cloned cases. But it's probably a rare configuration anyway since HDMI cloning is only allowed on g4x.
I am fine with what you outlined above. If anything come up, this can be revisited.
Quoted 241 lines
Quoted 3 lines
Seems like a corner case to test thoroughly. Is this path exercised in your
testing?
I tested it long ago. Although I must admit that the patch looked a bit different back then.
Quoted 7 lines
Quoted 7 lines
v2: Rebase
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 85 ++++++++++++++++++---------------------
Quoted 18 lines
Quoted 18 lines
1 file changed, 40 insertions(+), 45 deletions(-)drivers/gpu/drm/i915/intel_hdmi.c +4
-1@@ -514,7 +514,13 @@ static void g4x_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; +if (port != (val &VIDEO_DIP_PORT_MASK )) { + DRM_DEBUG_KMS("video DIP still enabled on port %c\n", + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ;Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct
Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c +3
-0+ } + val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );drivers/gpu/drm/i915/intel_hdmi.c +0
-0I915_WRITE (reg, val);POSTING_READ (reg);return ;@@ -522,16 +528,17 @@ static void g4x_set_infoframes(struct
drm_encoderQuoted 41 lines
Quoted 41 lines
drivers/gpu/drm/i915/intel_hdmi.c +5
-4*encoder, if (port != (val & VIDEO_DIP_PORT_MASK)) {if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); + DRM_DEBUG_KMS("video DIP already enabled on port %c\n", + (val &VIDEO_DIP_PORT_MASK ) >>29 ); +return ; } val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~VIDEO_DIP_ENABLE_VENDOR ; + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );drivers/gpu/drm/i915/intel_hdmi.c +0
-13I915_WRITE (reg, val);POSTING_READ (reg);@@ -632,23 +639,6 @@ static bool intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)return val !=0 ; } -static void intel_disable_gcp_infoframe (struct intel_crtc *crtc) -{ -struct drm_i915_private *dev_priv = crtc->base.dev->dev_private; -u32 reg; - -if (HAS_DDI (dev_priv)) - reg =HSW_TVIDEO_DIP_CTL (crtc->config->cpu_transcoder); -else if (IS_VALLEYVIEW (dev_priv)) - reg =VLV_TVIDEO_DIP_CTL (crtc->pipe); -else if (HAS_PCH_SPLIT (dev_priv->dev)) - reg =TVIDEO_DIP_CTL (crtc->pipe); -else -return ;Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c static void ibx_set_infoframes(struct
Quoted 8 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-4- -I915_WRITE (reg,I915_READ (reg) & ~VIDEO_DIP_ENABLE_GCP ); -} - static void ibx_set_infoframes(struct drm_encoder *encoder, bool enable,drivers/gpu/drm/i915/intel_hdmi.c +0
-0struct drm_display_mode *adjusted_mode)@@ -669,25 +659,26 @@ static void ibx_set_infoframes(struct
drm_encoderQuoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder,
Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-1*encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE | VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|Quoted 49 lines
Quoted 49 lines
drivers/gpu/drm/i915/intel_hdmi.c +7
-7+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP);I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +2
-1val |=VIDEO_DIP_ENABLE_GCP ;@@ -718,7 +709,9 @@ static void cpt_set_infoframes(struct drm_encoder *encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~(VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ); + val &= ~(VIDEO_DIP_ENABLE | VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|drivers/gpu/drm/i915/intel_hdmi.c +2
-1+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP);I915_WRITE (reg, val);POSTING_READ (reg);return ;@@ -727,7 +720,7 @@ static void cpt_set_infoframes(struct drm_encoder *encoder,/* Set both together, unset both together: see the spec. */ val |=VIDEO_DIP_ENABLE |VIDEO_DIP_ENABLE_AVI ; val &= ~(VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | -VIDEO_DIP_ENABLE_GCP ); +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c static void vlv_set_infoframes(struct
Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-0if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +0
-0val |=VIDEO_DIP_ENABLE_GCP ;@@ -760,25 +753,26 @@ static void vlv_set_infoframes(struct
drm_encoderQuoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c static void g4x_set_infoframes(struct drm_encoder *encoder,
Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-1*encoder, if (!enable) {if (!(val &VIDEO_DIP_ENABLE ))return ; - val &= ~VIDEO_DIP_ENABLE ; + val &= ~(VIDEO_DIP_ENABLE | VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|Quoted 26 lines
Quoted 26 lines
drivers/gpu/drm/i915/intel_hdmi.c +7
-7+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP);I915_WRITE (reg, val);POSTING_READ (reg);return ; }if (port != (val &VIDEO_DIP_PORT_MASK )) { -if (val &VIDEO_DIP_ENABLE ) { - val &= ~VIDEO_DIP_ENABLE ; -I915_WRITE (reg, val); -POSTING_READ (reg); - } +WARN (val &VIDEO_DIP_ENABLE , +"DIP already enabled on port %c\n" , + (val &VIDEO_DIP_PORT_MASK ) >>29 ); val &= ~VIDEO_DIP_PORT_MASK ; val |= port; } val |=VIDEO_DIP_ENABLE ; - val &= ~(VIDEO_DIP_ENABLE_AVI |VIDEO_DIP_ENABLE_VENDOR | -VIDEO_DIP_ENABLE_GAMUT |VIDEO_DIP_ENABLE_GCP ); + val &= ~(VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP );Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct
Quoted 3 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-0if (intel_hdmi_set_gcp_infoframe (encoder))drivers/gpu/drm/i915/intel_hdmi.c +0
-0val |=VIDEO_DIP_ENABLE_GCP ;@@ -803,15 +797,16 @@ static void hsw_set_infoframes(struct
drm_encoderQuoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct drm_encoder *encoder,
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +1
-0*encoder,assert_hdmi_port_disabled (intel_hdmi); + val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |
VIDEO_DIP_ENABLE_AVI_HSW|Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct · line 802
Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c +1
-0+ VIDEO_DIP_ENABLE_GCP_HSW |
VIDEO_DIP_ENABLE_VS_HSW|Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct · line 803
Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c +1
-0+ VIDEO_DIP_ENABLE_GMP_HSW |
VIDEO_DIP_ENABLE_SPD_HSW);Quoted 9 lines
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct drm_encoder *encoder,
Quoted 9 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-2+if (!enable) { -I915_WRITE (reg,0 ); +I915_WRITE (reg, val);POSTING_READ (reg);return ; } - val &= ~(VIDEO_DIP_ENABLE_VSC_HSW |
VIDEO_DIP_ENABLE_GCP_HSW|Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c static void hsw_set_infoframes(struct · line 814
Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c +0
-1- VIDEO_DIP_ENABLE_VS_HSW |
VIDEO_DIP_ENABLE_GMP_HSW);Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c static void intel_disable_hdmi(struct
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-1-if (intel_hdmi_set_gcp_infoframe (encoder)) val |=VIDEO_DIP_ENABLE_GCP_HSW ;@@ -1133,7 +1128,7 @@ static void intel_disable_hdmi(struct
intel_encoderQuoted 9 lines
Quoted 9 lines
drivers/gpu/drm/i915/intel_hdmi.c +1
-1*encoder)if (IS_CHERRYVIEW (dev))chv_powergate_phy_lanes (encoder,0xf ); -intel_disable_gcp_infoframe (to_intel_crtc (encoder->base.crtc)); + intel_hdmi->set_infoframes (&encoder->base, false,NULL ); }static int hdmi_portclock_limit(struct
intel_hdmi*hdmi, bool
respect_dvi_limit)Quoted 7 lines
Quoted 7 lines
--
2.0.5_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Ville Syrjälä
Intel OTC
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 6/9] drm/i915: Disable all infoframes when turning off the HDMI port
Quoted 16 lines
Quoted 16 lines
Quoted 15 lines
Quoted 8 lines
Quoted 3 lines
Currently we just disable the GCP infoframe when turning off the port. That means if the same transcoder is used on a DP port next, we might end up pushing infoframes over DP, which isn't intended. Just disable
Wonder how it is working. May be it is ok, or never hit using a previously used transcoder for HDMI port for DP.
By the way, you mean end up pushing "other" infoframes over DP?
We don't send infoframes over DP at all currently. Or I should say we never intended to send them. After this patch that should even be true. Well, unless the BIOS already enables them and we just fire up a DP port using the transcoder in question. So I suppose we should really have the DP code clear the infoframe settings explicitly, or we should clear them during the sanitize phase.
Quoted 8 lines
Quoted 2 lines
Agree that DP code path should clear the infoframe settings explicitly. As you are already touching this code, will you plan to handle it?
I don't think I'll go there now. It would require quite a bit more work to expose the infoframe stuff to the DP code. DP + infoframes in general sounds like a good project for someone else to figure out. A quick glance at the DP spec suggests that we should at least send the audio infoframe.
OK, may be binned for future.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/9 drm/i915: Check infoframe state more diligently.
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Check that the DIP is enabled on the right port on IBX and VLV/CHV as we're doing on g4x, and also check for all the infoframe enable bits on all platforms.
Eventually we should track each infoframe type independently, and also their contents. This is a small step in that direction as .infoframe_enabled() return value could be easily turned into a bitmask.
--- drivers/gpu/drm/i915/intel_hdmi.c | 44 ++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_hdmi.c +32 -12
@@ -174,10 +174,14 @@ static bool g4x_infoframe_enabled(struct drm_encoder *encoder)struct intel_digital_port *intel_dig_port =enc_to_dig_port (encoder);u32 val =I915_READ (VIDEO_DIP_CTL ); -if (VIDEO_DIP_PORT (intel_dig_port->port) == (val &VIDEO_DIP_PORT_MASK )) -return val &VIDEO_DIP_ENABLE ; +if ((val &VIDEO_DIP_ENABLE ) ==0 ) +return false; -return false; +if ((val &VIDEO_DIP_PORT_MASK ) !=VIDEO_DIP_PORT (intel_dig_port->port)) +return false; + +return val & (VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD ); } static void ibx_write_infoframe(struct drm_encoder *encoder,
@@ -227,10 +231,15 @@ static bool ibx_infoframe_enabled(struct drm_encoder *encoder)int reg =TVIDEO_DIP_CTL (intel_crtc->pipe);u32 val =I915_READ (reg); -if (VIDEO_DIP_PORT (intel_dig_port->port) == (val &VIDEO_DIP_PORT_MASK )) -return val &VIDEO_DIP_ENABLE ; +if ((val &VIDEO_DIP_ENABLE ) ==0 ) +return false; -return false; +if ((val &VIDEO_DIP_PORT_MASK ) !=VIDEO_DIP_PORT (intel_dig_port->port)) +return false; + +return val & (VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP ); } static void cpt_write_infoframe(struct drm_encoder *encoder,
@@ -282,7 +291,12 @@ static bool cpt_infoframe_enabled(struct drm_encoder *encoder)int reg =TVIDEO_DIP_CTL (intel_crtc->pipe);u32 val =I915_READ (reg); -return val &VIDEO_DIP_ENABLE ; +if ((val &VIDEO_DIP_ENABLE ) ==0 ) +return false; + +return val & (VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP ); } static void vlv_write_infoframe(struct drm_encoder *encoder,
@@ -332,10 +346,15 @@ static bool vlv_infoframe_enabled(struct drm_encoder *encoder)int reg =VLV_TVIDEO_DIP_CTL (intel_crtc->pipe);u32 val =I915_READ (reg); -if (VIDEO_DIP_PORT (intel_dig_port->port) == (val &VIDEO_DIP_PORT_MASK )) -return val &VIDEO_DIP_ENABLE ; +if ((val &VIDEO_DIP_ENABLE ) ==0 ) +return false; -return false; +if ((val &VIDEO_DIP_PORT_MASK ) !=VIDEO_DIP_PORT (intel_dig_port->port)) +return false; + +return val & (VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_GAMUT | +VIDEO_DIP_ENABLE_SPD |VIDEO_DIP_ENABLE_GCP ); } static void hsw_write_infoframe(struct drm_encoder *encoder,
@@ -383,8 +402,9 @@ static bool hsw_infoframe_enabled(struct drm_encoder *encoder)u32 ctl_reg =HSW_TVIDEO_DIP_CTL (intel_crtc->config->cpu_transcoder);u32 val =I915_READ (ctl_reg); -return val & (VIDEO_DIP_ENABLE_AVI_HSW |VIDEO_DIP_ENABLE_SPD_HSW | -VIDEO_DIP_ENABLE_VS_HSW ); +return val & (VIDEO_DIP_ENABLE_VSC_HSW |VIDEO_DIP_ENABLE_AVI_HSW | +VIDEO_DIP_ENABLE_GCP_HSW |VIDEO_DIP_ENABLE_VS_HSW | +VIDEO_DIP_ENABLE_GMP_HSW |VIDEO_DIP_ENABLE_SPD_HSW ); }/*
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 7/9] drm/i915: Check infoframe state more diligently.
Quoted 128 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH 7/9] drm/i915: Check infoframe state more diligently.From: Ville Syrjälä <[email protected]>
Check that the DIP is enabled on the right port on IBX and VLV/CHV as we're doing on g4x, and also check for all the infoframe enable bits on all platforms.
Eventually we should track each infoframe type independently, and also their contents. This is a small step in that direction as .infoframe_enabled() return value could be easily turned into a bitmask.
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 44 ++++++++++++++++++++++++++++------ ----- 1 file changed, 32 insertions(+), 12 deletions(-)drivers/gpu/drm/i915/intel_hdmi.c +7
-3@@ -174,10 +174,14 @@ static bool g4x_infoframe_enabled(struct drm_encoder *encoder)struct intel_digital_port *intel_dig_port =enc_to_dig_port (encoder);u32 val =I915_READ (VIDEO_DIP_CTL ); -if (VIDEO_DIP_PORT (intel_dig_port->port) == (val & VIDEO_DIP_PORT_MASK)) -return val &VIDEO_DIP_ENABLE ; +if ((val &VIDEO_DIP_ENABLE ) ==0 ) +return false; -return false; +if ((val &VIDEO_DIP_PORT_MASK ) !=VIDEO_DIP_PORT (intel_dig_port- >port)) +return false; + +return val & (VIDEO_DIP_ENABLE_AVI | +VIDEO_DIP_ENABLE_VENDOR |VIDEO_DIP_ENABLE_SPD );}
static void ibx_write_infoframe(struct
drm_encoder*encoder,drivers/gpu/drm/i915/intel_hdmi.c +7
-3@@ -227,10 +231,15 @@ static bool ibx_infoframe_enabled(struct drm_encoder *encoder)int reg =TVIDEO_DIP_CTL (intel_crtc->pipe);u32 val =I915_READ (reg); -if (VIDEO_DIP_PORT (intel_dig_port->port) == (val & VIDEO_DIP_PORT_MASK)) -return val &VIDEO_DIP_ENABLE ; +if ((val &VIDEO_DIP_ENABLE ) ==0 ) +return false; -return false; +if ((val &VIDEO_DIP_PORT_MASK ) !=VIDEO_DIP_PORT (intel_dig_port- >port)) +return false; + + return val & (VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|drivers/gpu/drm/i915/intel_hdmi.c +6
-1+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP); } static void cpt_write_infoframe(struct drm_encoder *encoder,@@ -282,7 +291,12 @@ static bool cpt_infoframe_enabled(struct drm_encoder *encoder)int reg =TVIDEO_DIP_CTL (intel_crtc->pipe);u32 val =I915_READ (reg); -return val &VIDEO_DIP_ENABLE ; +if ((val &VIDEO_DIP_ENABLE ) ==0 ) +return false; + + return val & (VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|drivers/gpu/drm/i915/intel_hdmi.c +8
-3+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP); } static void vlv_write_infoframe(struct drm_encoder *encoder,@@ -332,10 +346,15 @@ static bool vlv_infoframe_enabled(struct drm_encoder *encoder)int reg =VLV_TVIDEO_DIP_CTL (intel_crtc->pipe);u32 val =I915_READ (reg); -if (VIDEO_DIP_PORT (intel_dig_port->port) == (val & VIDEO_DIP_PORT_MASK)) -return val &VIDEO_DIP_ENABLE ; +if ((val &VIDEO_DIP_ENABLE ) ==0 ) +return false; -return false; +if ((val &VIDEO_DIP_PORT_MASK ) !=VIDEO_DIP_PORT (intel_dig_port- >port)) +return false; + + return val & (VIDEO_DIP_ENABLE_AVI | + VIDEO_DIP_ENABLE_VENDOR |
VIDEO_DIP_ENABLE_GAMUT|drivers/gpu/drm/i915/intel_hdmi.c +1
-1+ VIDEO_DIP_ENABLE_SPD | VIDEO_DIP_ENABLE_GCP); } static void hsw_write_infoframe(struct drm_encoder *encoder,@@ -383,8 +402,9 @@ static bool hsw_infoframe_enabled(struct drm_encoder *encoder)u32 ctl_reg =HSW_TVIDEO_DIP_CTL (intel_crtc->config- >cpu_transcoder);u32 val =I915_READ (ctl_reg); - return val & (VIDEO_DIP_ENABLE_AVI_HSW |
VIDEO_DIP_ENABLE_SPD_HSW|drivers/gpu/drm/i915/intel_hdmi.c +1
-1- VIDEO_DIP_ENABLE_VS_HSW); + return val & (VIDEO_DIP_ENABLE_VSC_HSW |
VIDEO_DIP_ENABLE_AVI_HSW|drivers/gpu/drm/i915/intel_hdmi.c +1
-0+ VIDEO_DIP_ENABLE_GCP_HSW |
VIDEO_DIP_ENABLE_VS_HSW|drivers/gpu/drm/i915/intel_hdmi.c +1
-0+ VIDEO_DIP_ENABLE_GMP_HSW |
Quoted 3 lines
VIDEO_DIP_ENABLE_SPD_HSW);
}
Quoted 8 lines
/*
--
2.0.5_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/9 drm/i915: Fix hdmi clock readout with pixel repeat
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Account for the pixel multiplier when reading out the HDMI mode dotclock. Makes the state checked happier on my ILK when using double clocked modes.
--- drivers/gpu/drm/i915/intel_hdmi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_hdmi.c +3 -0
@@ -943,6 +943,9 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,else dotclock = pipe_config->port_clock; +if (pipe_config->pixel_multiplier) + dotclock /= pipe_config->pixel_multiplier; +if (HAS_PCH_SPLIT (dev_priv->dev))ironlake_check_encoder_dotclock (pipe_config, dotclock);
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 8/9] drm/i915: Fix hdmi clock readout with pixel repeat
Quoted 27 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH 8/9] drm/i915: Fix hdmi clock readout with pixel repeatFrom: Ville Syrjälä <[email protected]>
Account for the pixel multiplier when reading out the HDMI mode dotclock. Makes the state checked happier on my ILK when using double clocked modes.
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/i915/intel_hdmi.c +0
-0
drivers/gpu/drm/i915/intel_hdmi.c static void intel_hdmi_get_config(struct intel_encoder · line 949
Quoted 7 lines
drivers/gpu/drm/i915/intel_hdmi.c +3
-0@@ -943,6 +943,9 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder, else dotclock = pipe_config->port_clock; +if (pipe_config->pixel_multiplier) + dotclock /= pipe_config->pixel_multiplier; +
This is unrelated to HDMI 12bpc series. May be a separate patch.
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-1if (HAS_PCH_SPLIT (dev_priv->dev))ironlake_check_encoder_dotclock (pipe_config, dotclock); --2.0.5
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/9 drm/i915: Double the port clock when using double clocked modes with 12bpc
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Currently we're forgetting to double the port clock when using double clocked modes with 12bpc on HDMI. We're only accounting for the 1.5x factor due to the 12bpc. So further double the 1.5x port clock when we have a double clocked mode.
Unfortunately I don't have any displays that support both 12bpc and double clocked modes, so I was unable to test this.
--- drivers/gpu/drm/i915/intel_hdmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_hdmi.c +1 -0
@@ -1248,6 +1248,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,if (adjusted_mode->flags &DRM_MODE_FLAG_DBLCLK ) { pipe_config->pixel_multiplier =2 ; + clock_12bpc *=2 ; }if (intel_hdmi->color_range)
Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 9/9] drm/i915: Double the port clock when using double clocked modes with 12bpc
Quoted 9 lines · On Tue, May 05, 2015 at 05:06:27PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Currently we're forgetting to double the port clock when using double clocked modes with 12bpc on HDMI. We're only accounting for the 1.5x factor due to the 12bpc. So further double the 1.5x port clock when we have a double clocked mode.
Unfortunately I don't have any displays that support both 12bpc and double clocked modes, so I was unable to test this.
Actually I was able to test this by manually adding some CEA double clocked modes. My TV happily accepted them even if it didn't list them in the EDID.
Quoted 25 lines
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/i915/intel_hdmi.c +1
-0@@ -1248,6 +1248,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,if (adjusted_mode->flags &DRM_MODE_FLAG_DBLCLK ) { pipe_config->pixel_multiplier =2 ; + clock_12bpc *=2 ; }if (intel_hdmi->color_range)Signature · 6 lines
2.0.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 9/9] drm/i915: Double the port clock when using double clocked modes with 12bpc
In reply to [email protected]Quoted 38 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH 9/9] drm/i915: Double the port clock when using double clocked modes with 12bpcFrom: Ville Syrjälä <[email protected]>
Currently we're forgetting to double the port clock when using double clocked modes with 12bpc on HDMI. We're only accounting for the 1.5x factor due to the 12bpc. So further double the 1.5x port clock when we have a double clocked mode.
Unfortunately I don't have any displays that support both 12bpc and double clocked modes, so I was unable to test this.
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_hdmi.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/i915/intel_hdmi.c +1
-0@@ -1248,6 +1248,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK) { pipe_config->pixel_multiplier =2 ; + clock_12bpc *=2 ; }
Quoted 2 lines
if (
intel_hdmi->color_range)
--
Quoted 6 lines
2.0.5
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 19 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH 0/9] drm/i915: HDMI 12bpc fixesFrom: Ville Syrjälä <[email protected]>
Our HDMI 12bpc support has always been broken. This series aims to fix that.
The problems addressed include:
- missing GCP infoframes entirely
- IBX w/a code was mostly nonsense
- missing w/a for CPT/PPT
- 12bpc vs. DBLCLK was busted
Quoted 8 lines
Part of this was already posted [1] quite a while ago, but it's grown some new stuff since. The entire series is available in git [2].
I have additional stuff to fix the IBX transcoder B workarounds and some other random thigns on PCH platforms. I'll post that as a followup.
[1] http://lists.freedesktop.org/archives/intel-gfx/2014-October/053340.html
[2] hit://github.com/vsyrjala/linux.githdmi_12bpc_fixes_9
Broken link [2]. Some typo?
Quoted 19 lines
Ville Syrjälä (9):
drm/i915: Implement WaEnableHDMI8bpcBefore12bpc:snb,ivb drm/i915: Send GCP infoframes for deep color HDMI sinks drm/i915: Enabledefault_phasein GCP when possible drm/i915: Fix HDMI 12bpc TRANSCONF bpc value
drm/i915: Fix 12bpc HDMI enable for IBX
drm/i915: Disable all infoframes when turning off the HDMI port drm/i915: Check infoframe state more diligently. drm/i915: Fix hdmi clock readout with pixel repeat drm/i915: Double the port clock when using double clocked modes with12bpcdrivers/gpu/drm/i915/i915_reg.h | 4 + drivers/gpu/drm/i915/intel_display.c | 10 +- drivers/gpu/drm/i915/intel_hdmi.c | 359 ++++++++++++++++++++++++++++--- ---- 3 files changed, 306 insertions(+), 67 deletions(-)
Quoted 7 lines
--
2.0.5_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 22 lines · Chandra
Quoted 22 lines
-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, May 05, 2015 7:06 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH 0/9] drm/i915: HDMI 12bpc fixesFrom: Ville Syrjälä <[email protected]>
Our HDMI 12bpc support has always been broken. This series aims to fix that.
The problems addressed include:
- missing GCP infoframes entirely
- IBX w/a code was mostly nonsense
- missing w/a for CPT/PPT
- 12bpc vs. DBLCLK was bustedPart of this was already posted [1] quite a while ago, but it's grown some new stuff since. The entire series is available in git [2].
Quoted 7 lines
Quoted 5 lines
I have additional stuff to fix the IBX transcoder B workarounds and some other random thigns on PCH platforms. I'll post that as a followup.
[1] http://lists.freedesktop.org/archives/intel-gfx/2014-October/053340.html
[2] hit://github.com/vsyrjala/linux.githdmi_12bpc_fixes_9Broken link [2]. Some typo?
s/hit/git and then you have a git url ;-)
Anyway thanks for patches&review, all merged to dinq. -Daniel
Quoted 31 lines
Quoted 20 lines
Ville Syrjälä (9):
drm/i915: Implement WaEnableHDMI8bpcBefore12bpc:snb,ivb drm/i915: Send GCP infoframes for deep color HDMI sinks drm/i915: Enabledefault_phasein GCP when possible drm/i915: Fix HDMI 12bpc TRANSCONF bpc value
drm/i915: Fix 12bpc HDMI enable for IBX
drm/i915: Disable all infoframes when turning off the HDMI port drm/i915: Check infoframe state more diligently. drm/i915: Fix hdmi clock readout with pixel repeat drm/i915: Double the port clock when using double clocked modes with12bpcdrivers/gpu/drm/i915/i915_reg.h | 4 + drivers/gpu/drm/i915/intel_display.c | 10 +- drivers/gpu/drm/i915/intel_hdmi.c | 359 ++++++++++++++++++++++++++++--- ---- 3 files changed, 306 insertions(+), 67 deletions(-)Quoted 7 lines
--
2.0.5_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
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