drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
Subsystems (2)
PATCH 1/1 drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
From: Ville Syrjälä <[email protected]>
When we're disabling the HDMI link we try to reset the scrambling and TMDS bit clock ratio back to the default values. This will fail if the sink has already been disconnected. Thus we should not print an error message when resetting the scrambling/TMDS bit clock ratio fail during disable. During enable we do want the error, and during disable we may still want to know what happended for debug purposes so let's use DRM_DEBUG_KMS() there.
Cc: Shashank Sharma <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105644
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
--- drivers/gpu/drm/i915/intel_ddi.c | 11 ++-- drivers/gpu/drm/i915/intel_drv.h | 10 ++-- drivers/gpu/drm/i915/intel_hdmi.c | 104 +++++++++++++++++++++++++------------- 3 files changed, 78 insertions(+), 47 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +4 -7
@@ -2426,10 +2426,8 @@ static void intel_enable_ddi_hdmi(struct intel_encoder *encoder,struct intel_digital_port *dig_port =enc_to_dig_port (&encoder->base);enum port port = encoder->port; -intel_hdmi_handle_sink_scrambling (encoder, - conn_state->connector, - crtc_state->hdmi_high_tmds_clock_ratio, - crtc_state->hdmi_scrambling); +intel_hdmi_sink_scrambling_enable (encoder, + crtc_state, conn_state);/* Display WA #1143: skl,kbl,cfl */ if (IS_GEN9_BC (dev_priv)) {
@@ -2524,9 +2522,8 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,intel_audio_codec_disable (encoder, old_crtc_state, old_conn_state); -intel_hdmi_handle_sink_scrambling (encoder, - old_conn_state->connector, - false, false); +intel_hdmi_sink_scrambling_enable (encoder, + old_crtc_state, old_conn_state); } static void intel_disable_ddi(struct intel_encoder *encoder,
drivers/gpu/drm/i915/intel_drv.h +6 -4
@@ -1783,10 +1783,12 @@ struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state); -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *intel_encoder, -struct drm_connector *connector, -bool high_tmds_clock_ratio, -bool scrambling); +void intel_hdmi_sink_scrambling_enable (struct intel_encoder *encoder, +struct intel_crtc_state *crtc_state, +struct drm_connector_state *conn_state); +void intel_hdmi_sink_scrambling_disable (struct intel_encoder *encoder, +struct intel_crtc_state *old_crtc_state, +struct drm_connector_state *old_conn_state);void intel_dp_dual_mode_set_tmds_output (struct intel_hdmi *hdmi,bool enable);void intel_infoframe_init (struct intel_digital_port *intel_dig_port);
drivers/gpu/drm/i915/intel_hdmi.c +68 -36
123 lines not on this page · raw message
Signature · 6 lines
2.16.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
== Series Details ==
== Series Details ==
Series: drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
URL : https://patchwork.freedesktop.org/series/40461/
State : failure
== Summary ==
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CHK include/generated/bounds.h
CHK include/generated/timeconst.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
DESCEND objtool
CHK scripts/mod/devicetable-offsets.h
CHK include/generated/compile.h
CHK kernel/config_data.h
CC [M] drivers/gpu/drm/i915/intel_ddi.o
drivers/gpu/drm/i915/intel_ddi.c: In function ‘intel_enable_ddi_hdmi’:
drivers/gpu/drm/i915/intel_ddi.c:2430:8: error: passing argument 2 of ‘intel_hdmi_sink_scrambling_enable’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
crtc_state, conn_state);
^~~~~~~~~~
In file included from drivers/gpu/drm/i915/i915_trace.h:11:0,
from drivers/gpu/drm/i915/i915_drv.h:2656,
from drivers/gpu/drm/i915/intel_ddi.c:29:
drivers/gpu/drm/i915/intel_drv.h:1786:6: note: expected ‘struct intel_crtc_state *’ but argument is of type ‘const struct intel_crtc_state *’
void intel_hdmi_sink_scrambling_enable(struct intel_encoder *encoder,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/intel_ddi.c:2430:20: error: passing argument 3 of ‘intel_hdmi_sink_scrambling_enable’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
crtc_state, conn_state);
^~~~~~~~~~
In file included from drivers/gpu/drm/i915/i915_trace.h:11:0,
from drivers/gpu/drm/i915/i915_drv.h:2656,
from drivers/gpu/drm/i915/intel_ddi.c:29:
drivers/gpu/drm/i915/intel_drv.h:1786:6: note: expected ‘struct drm_connector_state *’ but argument is of type ‘const struct drm_connector_state *’
void intel_hdmi_sink_scrambling_enable(struct intel_encoder *encoder,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/intel_ddi.c: In function ‘intel_disable_ddi_hdmi’:
drivers/gpu/drm/i915/intel_ddi.c:2526:8: error: passing argument 2 of ‘intel_hdmi_sink_scrambling_enable’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
old_crtc_state, old_conn_state);
^~~~~~~~~~~~~~
In file included from drivers/gpu/drm/i915/i915_trace.h:11:0,
from drivers/gpu/drm/i915/i915_drv.h:2656,
from drivers/gpu/drm/i915/intel_ddi.c:29:
drivers/gpu/drm/i915/intel_drv.h:1786:6: note: expected ‘struct intel_crtc_state *’ but argument is of type ‘const struct intel_crtc_state *’
void intel_hdmi_sink_scrambling_enable(struct intel_encoder *encoder,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/intel_ddi.c:2526:24: error: passing argument 3 of ‘intel_hdmi_sink_scrambling_enable’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
old_crtc_state, old_conn_state);
^~~~~~~~~~~~~~
In file included from drivers/gpu/drm/i915/i915_trace.h:11:0,
from drivers/gpu/drm/i915/i915_drv.h:2656,
from drivers/gpu/drm/i915/intel_ddi.c:29:
drivers/gpu/drm/i915/intel_drv.h:1786:6: note: expected ‘struct drm_connector_state *’ but argument is of type ‘const struct drm_connector_state *’
void intel_hdmi_sink_scrambling_enable(struct intel_encoder *encoder,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errorsscripts/Makefile.build:324: recipe for target 'drivers/gpu/drm/i915/intel_ddi.o' failed make[4]: *** [drivers/gpu/drm/i915/intel_ddi.o] Error 1 scripts/Makefile.build:583: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2scripts/Makefile.build:583: recipe for target 'drivers/gpu/drm' failed make[2]: *** [drivers/gpu/drm] Error 2scripts/Makefile.build:583: recipe for target 'drivers/gpu' failed make[1]: *** [drivers/gpu] Error 2
Makefile:1051: recipe for target 'drivers' failed
make: *** [drivers] Error 2
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
When we're disabling the HDMI link we try to reset the scrambling and TMDS bit clock ratio back to the default values. This will fail if the sink has already been disconnected. Thus we should not print an error message when resetting the scrambling/TMDS bit clock ratio fail during disable. During enable we do want the error, and during disable we may still want to know what happended for debug purposes so let's use DRM_DEBUG_KMS() there.
v2: Remember them consts
Cc: Shashank Sharma <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105644
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
--- drivers/gpu/drm/i915/intel_ddi.c | 11 ++-- drivers/gpu/drm/i915/intel_drv.h | 10 ++-- drivers/gpu/drm/i915/intel_hdmi.c | 104 +++++++++++++++++++++++++------------- 3 files changed, 78 insertions(+), 47 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +4 -7
@@ -2426,10 +2426,8 @@ static void intel_enable_ddi_hdmi(struct intel_encoder *encoder,struct intel_digital_port *dig_port =enc_to_dig_port (&encoder->base);enum port port = encoder->port; -intel_hdmi_handle_sink_scrambling (encoder, - conn_state->connector, - crtc_state->hdmi_high_tmds_clock_ratio, - crtc_state->hdmi_scrambling); +intel_hdmi_sink_scrambling_enable (encoder, + crtc_state, conn_state);/* Display WA #1143: skl,kbl,cfl */ if (IS_GEN9_BC (dev_priv)) {
@@ -2524,9 +2522,8 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,intel_audio_codec_disable (encoder, old_crtc_state, old_conn_state); -intel_hdmi_handle_sink_scrambling (encoder, - old_conn_state->connector, - false, false); +intel_hdmi_sink_scrambling_enable (encoder, + old_crtc_state, old_conn_state); } static void intel_disable_ddi(struct intel_encoder *encoder,
drivers/gpu/drm/i915/intel_drv.h +6 -4
@@ -1783,10 +1783,12 @@ struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state); -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *intel_encoder, -struct drm_connector *connector, -bool high_tmds_clock_ratio, -bool scrambling); +void intel_hdmi_sink_scrambling_enable (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +const struct drm_connector_state *conn_state); +void intel_hdmi_sink_scrambling_disable (struct intel_encoder *encoder, +const struct intel_crtc_state *old_crtc_state, +const struct drm_connector_state *old_conn_state);void intel_dp_dual_mode_set_tmds_output (struct intel_hdmi *hdmi,bool enable);void intel_infoframe_init (struct intel_digital_port *intel_dig_port);
drivers/gpu/drm/i915/intel_hdmi.c +68 -36
123 lines not on this page · raw message
Signature · 6 lines
2.16.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
When we're disabling the HDMI link we try to reset the scrambling and TMDS bit clock ratio back to the default values. This will fail if the sink has already been disconnected. Thus we should not print an error message when resetting the scrambling/TMDS bit clock ratio fail during disable. During enable we do want the error, and during disable we may still want to know what happended for debug purposes so let's use DRM_DEBUG_KMS() there.
v2: Remember them consts
Cc: Shashank Sharma <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105644
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
--- drivers/gpu/drm/i915/intel_ddi.c | 11 ++-- drivers/gpu/drm/i915/intel_drv.h | 10 ++-- drivers/gpu/drm/i915/intel_hdmi.c | 104 +++++++++++++++++++++++++------------- 3 files changed, 78 insertions(+), 47 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +4 -7
@@ -2426,10 +2426,8 @@ static void intel_enable_ddi_hdmi(struct intel_encoder *encoder,struct intel_digital_port *dig_port =enc_to_dig_port (&encoder->base);enum port port = encoder->port; -intel_hdmi_handle_sink_scrambling (encoder, - conn_state->connector, - crtc_state->hdmi_high_tmds_clock_ratio, - crtc_state->hdmi_scrambling); +intel_hdmi_sink_scrambling_enable (encoder, + crtc_state, conn_state);/* Display WA #1143: skl,kbl,cfl */ if (IS_GEN9_BC (dev_priv)) {
@@ -2524,9 +2522,8 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,intel_audio_codec_disable (encoder, old_crtc_state, old_conn_state); -intel_hdmi_handle_sink_scrambling (encoder, - old_conn_state->connector, - false, false); +intel_hdmi_sink_scrambling_enable (encoder, + old_crtc_state, old_conn_state); } static void intel_disable_ddi(struct intel_encoder *encoder,
drivers/gpu/drm/i915/intel_drv.h +6 -4
@@ -1783,10 +1783,12 @@ struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state); -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *intel_encoder, -struct drm_connector *connector, -bool high_tmds_clock_ratio, -bool scrambling); +void intel_hdmi_sink_scrambling_enable (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +const struct drm_connector_state *conn_state); +void intel_hdmi_sink_scrambling_disable (struct intel_encoder *encoder, +const struct intel_crtc_state *old_crtc_state, +const struct drm_connector_state *old_conn_state);void intel_dp_dual_mode_set_tmds_output (struct intel_hdmi *hdmi,bool enable);void intel_infoframe_init (struct intel_digital_port *intel_dig_port);
drivers/gpu/drm/i915/intel_hdmi.c +68 -36
123 lines not on this page · raw message
Signature · 6 lines
2.16.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Regards
Shashank
Quoted 9 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
When we're disabling the HDMI link we try to reset the scrambling and TMDS bit clock ratio back to the default values. This will fail if the sink has already been disconnected. Thus we should not print an error message when resetting the scrambling/TMDS bit clock ratio fail during disable. During enable we do want the error, and during disable we may still want to know what happended for debug purposes so let's use
DRM_DEBUG_KMS()there.
Yep, this reminds me of initial patch set of scrambling series :-)
Quoted 31 lines
v2: Remember them consts
Cc: Shashank Sharma <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105644
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_ddi.c | 11 ++-- drivers/gpu/drm/i915/intel_drv.h | 10 ++-- drivers/gpu/drm/i915/intel_hdmi.c | 104 +++++++++++++++++++++++++------------- 3 files changed, 78 insertions(+), 47 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +2
-4@@ -2426,10 +2426,8 @@ static void intel_enable_ddi_hdmi(struct intel_encoder *encoder,struct intel_digital_port *dig_port =enc_to_dig_port (&encoder->base);enum port port = encoder->port; -intel_hdmi_handle_sink_scrambling (encoder, - conn_state->connector, - crtc_state->hdmi_high_tmds_clock_ratio, - crtc_state->hdmi_scrambling); +intel_hdmi_sink_scrambling_enable (encoder, + crtc_state, conn_state);/* Display WA #1143: skl,kbl,cfl */ if (IS_GEN9_BC (dev_priv)) {
drivers/gpu/drm/i915/intel_ddi.c static void intel_disable_ddi_hdmi(struct intel_encoder *encoder, · line 2526
Quoted 8 lines
drivers/gpu/drm/i915/intel_ddi.c +2
-3@@ -2524,9 +2522,8 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,intel_audio_codec_disable (encoder, old_crtc_state, old_conn_state); -intel_hdmi_handle_sink_scrambling (encoder, - old_conn_state->connector, - false, false); +intel_hdmi_sink_scrambling_enable (encoder, + old_crtc_state, old_conn_state);
Calling enable again ? this must be a disable call.
Quoted 140 lines
drivers/gpu/drm/i915/intel_ddi.c +0
-0} static void intel_disable_ddi(struct intel_encoder *encoder,drivers/gpu/drm/i915/intel_drv.h +6
-4@@ -1783,10 +1783,12 @@ struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state); -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *intel_encoder, -struct drm_connector *connector, -bool high_tmds_clock_ratio, -bool scrambling); +void intel_hdmi_sink_scrambling_enable (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +const struct drm_connector_state *conn_state); +void intel_hdmi_sink_scrambling_disable (struct intel_encoder *encoder, +const struct intel_crtc_state *old_crtc_state, +const struct drm_connector_state *old_conn_state);void intel_dp_dual_mode_set_tmds_output (struct intel_hdmi *hdmi,bool enable);void intel_infoframe_init (struct intel_digital_port *intel_dig_port);drivers/gpu/drm/i915/intel_hdmi.c +59
-36@@ -2068,55 +2068,87 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c connector->state->picture_aspect_ratio =HDMI_PICTURE_ASPECT_NONE ; } -/* -* intel_hdmi_handle_sink_scrambling: handle sink scrambling/clock ratio setup -* @encoder: intel_encoder -* @connector: drm_connector -* @high_tmds_clock_ratio = bool to indicate if the function needs to set -* or reset the high tmds clock ratio for scrambling -* @scrambling: bool to Indicate if the function needs to set or reset -* sink scrambling -* -* This function handles scrambling on HDMI 2.0 capable sinks. -* If required clock rate is > 340 Mhz && scrambling is supported by sink -* it enables scrambling. This should be called before enabling the HDMI -* 2.0 port, as the sink can choose to disable the scrambling if it doesn't -* detect a scrambled clock within 100 ms. -*/ -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder, -struct drm_connector *connector, -bool high_tmds_clock_ratio, -bool scrambling) +static int intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder, +struct drm_connector *connector, +bool high_tmds_clock_ratio, +bool scrambling) { +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); -struct drm_i915_private *dev_priv = connector->dev->dev_private;struct drm_scrambling *sink_scrambling = &connector->display_info.hdmi.scdc.scrambling; -struct i2c_adapter *adptr =intel_gmbus_get_adapter (dev_priv, - intel_hdmi->ddc_bus); +struct i2c_adapter *adapter = +intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus);bool ret;if (!sink_scrambling->supported) -return ; +return 0 ; -DRM_DEBUG_KMS ("Setting sink scrambling for enc:%s connector:%s\n" , - encoder->base.name, connector->name); +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] scrambling=%s, TMDS bit clock ratio=1/%dX\n" , + connector->base.id, connector->name, +yesno (scrambling), high_tmds_clock_ratio ?40 :10 );/* Set TMDS bit clock ratio to 1/40 or 1/10 */ - ret =drm_scdc_set_high_tmds_clock_ratio (adptr, high_tmds_clock_ratio); -if (!ret) { -DRM_ERROR ("Set TMDS ratio failed\n" ); -return ; - } + ret =drm_scdc_set_high_tmds_clock_ratio (adapter, + high_tmds_clock_ratio); +if (ret) +return ret;/* Enable/disable sink scrambling */ - ret =drm_scdc_set_scrambling (adptr, scrambling); -if (!ret) { -DRM_ERROR ("Set sink scrambling failed\n" ); -return ; - } + ret =drm_scdc_set_scrambling (adapter, scrambling); +if (ret) +return ret; + +return 0 ; +} -DRM_DEBUG_KMS ("sink scrambling handled\n" ); +/* +* intel_hdmi_sink_scrambling_enable: configure sink scrambling/TMDS bit clock ratio +* @crtc_state: new crtc state +* @conn_state: new connector state +* +* Configure scrambling and TMDS bit clock ratio on HDMI 2.0 capable sinks. +* If required clock rate is > 340 Mhz && scrambling is supported by sink +* it enables scrambling. This should be called before enabling the HDMI +* 2.0 port, as the sink can choose to disable the scrambling if it doesn't +* detect a scrambled clock within 100 ms. +*/ +void intel_hdmi_sink_scrambling_enable (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +const struct drm_connector_state *conn_state) +{ +struct drm_connector *connector = conn_state->connector; +int ret; + + ret =intel_hdmi_handle_sink_scrambling (encoder, connector, + crtc_state->hdmi_high_tmds_clock_ratio, + crtc_state->hdmi_scrambling); +if (ret) +DRM_ERROR ("[CONNECTOR:%d:%s] Failed to configure sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name); +} + +/* +* intel_hdmi_sink_scrambling_disable: handle sink scrambling/clock ratio setup during disable +* @old_crtc_state: old crtc state +* @old_conn_state: old connector state +* +* Reset scrambling and TMDS bit clock ratio on HDMI 2.0 capable sinks. +* We do this to make sure the sink returns to the default settings once +* we're done using it. +*/ +void intel_hdmi_sink_scrambling_disable (struct intel_encoder *encoder, +const struct intel_crtc_state *old_crtc_state, +const struct drm_connector_state *old_conn_state)
drivers/gpu/drm/i915/intel_hdmi.c intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c · line 2152
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +9
-0+{ +struct drm_connector *connector = old_conn_state->connector; +int ret; + + ret =intel_hdmi_handle_sink_scrambling (encoder, connector, + false, false); +if (ret) +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] Failed to reset sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name); }
I think we can still keep only intel_hdmi_handle_sink_scrambling() function instead of having separate disable() and enable() functions, as the only difference between the two is one is printing error, other is kms(). How about
- keep only intel_hdmi_handle_sink_scrambling, but remove any error messges, and return ret as you have done in this patch.
- transfer the error message into ddi_enable_hdmi(error here) and ddi_disable_hdmi(kms here)
- Shashank
drivers/gpu/drm/i915/intel_hdmi.c intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c · line 2154
Quoted 2 lines
drivers/gpu/drm/i915/intel_hdmi.c +0
-0static u8 chv_port_to_ddc_pin (struct drm_i915_private *dev_priv,enum port port)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 50 lines · Shashank
Regards
Shashank
Quoted 9 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
When we're disabling the HDMI link we try to reset the scrambling and TMDS bit clock ratio back to the default values. This will fail if the sink has already been disconnected. Thus we should not print an error message when resetting the scrambling/TMDS bit clock ratio fail during disable. During enable we do want the error, and during disable we may still want to know what happended for debug purposes so let's use
DRM_DEBUG_KMS()there.Yep, this reminds me of initial patch set of scrambling series :-)
Quoted 34 lines
v2: Remember them consts
Cc: Shashank Sharma <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105644
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_ddi.c | 11 ++-- drivers/gpu/drm/i915/intel_drv.h | 10 ++-- drivers/gpu/drm/i915/intel_hdmi.c | 104 +++++++++++++++++++++++++------------- 3 files changed, 78 insertions(+), 47 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +2
-4@@ -2426,10 +2426,8 @@ static void intel_enable_ddi_hdmi(struct intel_encoder *encoder,struct intel_digital_port *dig_port =enc_to_dig_port (&encoder->base);enum port port = encoder->port; -intel_hdmi_handle_sink_scrambling (encoder, - conn_state->connector, - crtc_state->hdmi_high_tmds_clock_ratio, - crtc_state->hdmi_scrambling); +intel_hdmi_sink_scrambling_enable (encoder, + crtc_state, conn_state);/* Display WA #1143: skl,kbl,cfl */ if (IS_GEN9_BC (dev_priv)) {@@ -2524,9 +2522,8 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,intel_audio_codec_disable (encoder, old_crtc_state, old_conn_state);
Quoted 6 lines
drivers/gpu/drm/i915/intel_ddi.c static void intel_disable_ddi_hdmi(struct intel_encoder *encoder, · line 2526
Quoted 5 lines
drivers/gpu/drm/i915/intel_ddi.c +2
-3-intel_hdmi_handle_sink_scrambling (encoder, - old_conn_state->connector, - false, false); +intel_hdmi_sink_scrambling_enable (encoder, + old_crtc_state, old_conn_state);Calling enable again ? this must be a disable call.
Doh.
Quoted 150 lines
Quoted 140 lines
drivers/gpu/drm/i915/intel_ddi.c +0
-0} static void intel_disable_ddi(struct intel_encoder *encoder,drivers/gpu/drm/i915/intel_drv.h +6
-4@@ -1783,10 +1783,12 @@ struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state); -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *intel_encoder, -struct drm_connector *connector, -bool high_tmds_clock_ratio, -bool scrambling); +void intel_hdmi_sink_scrambling_enable (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +const struct drm_connector_state *conn_state); +void intel_hdmi_sink_scrambling_disable (struct intel_encoder *encoder, +const struct intel_crtc_state *old_crtc_state, +const struct drm_connector_state *old_conn_state);void intel_dp_dual_mode_set_tmds_output (struct intel_hdmi *hdmi,bool enable);void intel_infoframe_init (struct intel_digital_port *intel_dig_port);drivers/gpu/drm/i915/intel_hdmi.c +59
-36@@ -2068,55 +2068,87 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c connector->state->picture_aspect_ratio =HDMI_PICTURE_ASPECT_NONE ; } -/* -* intel_hdmi_handle_sink_scrambling: handle sink scrambling/clock ratio setup -* @encoder: intel_encoder -* @connector: drm_connector -* @high_tmds_clock_ratio = bool to indicate if the function needs to set -* or reset the high tmds clock ratio for scrambling -* @scrambling: bool to Indicate if the function needs to set or reset -* sink scrambling -* -* This function handles scrambling on HDMI 2.0 capable sinks. -* If required clock rate is > 340 Mhz && scrambling is supported by sink -* it enables scrambling. This should be called before enabling the HDMI -* 2.0 port, as the sink can choose to disable the scrambling if it doesn't -* detect a scrambled clock within 100 ms. -*/ -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder, -struct drm_connector *connector, -bool high_tmds_clock_ratio, -bool scrambling) +static int intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder, +struct drm_connector *connector, +bool high_tmds_clock_ratio, +bool scrambling) { +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); -struct drm_i915_private *dev_priv = connector->dev->dev_private;struct drm_scrambling *sink_scrambling = &connector->display_info.hdmi.scdc.scrambling; -struct i2c_adapter *adptr =intel_gmbus_get_adapter (dev_priv, - intel_hdmi->ddc_bus); +struct i2c_adapter *adapter = +intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus);bool ret;if (!sink_scrambling->supported) -return ; +return 0 ; -DRM_DEBUG_KMS ("Setting sink scrambling for enc:%s connector:%s\n" , - encoder->base.name, connector->name); +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] scrambling=%s, TMDS bit clock ratio=1/%dX\n" , + connector->base.id, connector->name, +yesno (scrambling), high_tmds_clock_ratio ?40 :10 );/* Set TMDS bit clock ratio to 1/40 or 1/10 */ - ret =drm_scdc_set_high_tmds_clock_ratio (adptr, high_tmds_clock_ratio); -if (!ret) { -DRM_ERROR ("Set TMDS ratio failed\n" ); -return ; - } + ret =drm_scdc_set_high_tmds_clock_ratio (adapter, + high_tmds_clock_ratio); +if (ret) +return ret;/* Enable/disable sink scrambling */ - ret =drm_scdc_set_scrambling (adptr, scrambling); -if (!ret) { -DRM_ERROR ("Set sink scrambling failed\n" ); -return ; - } + ret =drm_scdc_set_scrambling (adapter, scrambling); +if (ret) +return ret; + +return 0 ; +} -DRM_DEBUG_KMS ("sink scrambling handled\n" ); +/* +* intel_hdmi_sink_scrambling_enable: configure sink scrambling/TMDS bit clock ratio +* @crtc_state: new crtc state +* @conn_state: new connector state +* +* Configure scrambling and TMDS bit clock ratio on HDMI 2.0 capable sinks. +* If required clock rate is > 340 Mhz && scrambling is supported by sink +* it enables scrambling. This should be called before enabling the HDMI +* 2.0 port, as the sink can choose to disable the scrambling if it doesn't +* detect a scrambled clock within 100 ms. +*/ +void intel_hdmi_sink_scrambling_enable (struct intel_encoder *encoder, +const struct intel_crtc_state *crtc_state, +const struct drm_connector_state *conn_state) +{ +struct drm_connector *connector = conn_state->connector; +int ret; + + ret =intel_hdmi_handle_sink_scrambling (encoder, connector, + crtc_state->hdmi_high_tmds_clock_ratio, + crtc_state->hdmi_scrambling); +if (ret) +DRM_ERROR ("[CONNECTOR:%d:%s] Failed to configure sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name); +} + +/* +* intel_hdmi_sink_scrambling_disable: handle sink scrambling/clock ratio setup during disable +* @old_crtc_state: old crtc state +* @old_conn_state: old connector state +* +* Reset scrambling and TMDS bit clock ratio on HDMI 2.0 capable sinks. +* We do this to make sure the sink returns to the default settings once +* we're done using it. +*/ +void intel_hdmi_sink_scrambling_disable (struct intel_encoder *encoder, +const struct intel_crtc_state *old_crtc_state, +const struct drm_connector_state *old_conn_state)drivers/gpu/drm/i915/intel_hdmi.c intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c · line 2152
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +9
-0+{ +struct drm_connector *connector = old_conn_state->connector; +int ret; + + ret =intel_hdmi_handle_sink_scrambling (encoder, connector, + false, false); +if (ret) +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] Failed to reset sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name); }
Quoted 8 lines
I think we can still keep only
intel_hdmi_handle_sink_scrambling()function instead of having separatedisable()andenable()functions, as the only difference between the two is one is printing error, other iskms(). How about
- keep onlyintel_hdmi_handle_sink_scrambling, but remove any error messges, and return ret as you have done in this patch.
- transfer the error message intoddi_enable_hdmi(error here)andddi_disable_hdmi(kms here)
I suppose that'd work fine since we don't have other users for this.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev3)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev3)
URL : https://patchwork.freedesktop.org/series/40461/
State : success
== Summary ==
Series 40461v3 drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
https://patchwork.freedesktop.org/api/1.0/series/40461/revisions/3/mbox/
---- Known issues:
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (fi-snb-2520m) fdo#103713
Test prime_vgem:
Subgroup basic-fence-flip:
pass -> FAIL (fi-ilk-650) fdo#104008fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:432s fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:440s fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:379s fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:537s fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:296s fi-bxt-dsi total:285 pass:255 dwarn:0 dfail:0 fail:0 skip:30 time:512s fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:509s fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:513s fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:501s fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:412s fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:510s fi-cnl-drrs total:285 pass:254 dwarn:3 dfail:0 fail:0 skip:28 time:529s fi-cnl-y3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:588s fi-elk-e7500 total:285 pass:225 dwarn:1 dfail:0 fail:0 skip:59 time:419s fi-gdg-551 total:285 pass:176 dwarn:0 dfail:0 fail:1 skip:108 time:316s fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:537s fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:402s fi-ilk-650 total:285 pass:224 dwarn:0 dfail:0 fail:1 skip:60 time:419s fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:467s fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:432s fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:474s fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:474s fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:515s fi-pnv-d510 total:285 pass:219 dwarn:1 dfail:0 fail:0 skip:65 time:654s fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:443s fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:538s fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:506s fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:504s fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:427s fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:445s fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:587s fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:405s
fi-cfl-s3 failed to connect after reboot
7ae13170ff7a3e55b3f10149db1b34571d5bbd7b drm-tip: 2018y-03m-22d-14h-02m-32s UTC integration manifest 753c7188ee46 drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8450/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 1/1 drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
When we're disabling the HDMI link we try to reset the scrambling and TMDS bit clock ratio back to the default values. This will fail if the sink has already been disconnected. Thus we should not print an error message when resetting the scrambling/TMDS bit clock ratio fail during disable. During enable we do want the error, and during disable we may still want to know what happended for debug purposes so let's use DRM_DEBUG_KMS() there.
v2: Remember them consts
v3: Go back to just one function and print the errors/debugs
from callers (Shashank)
Cc: Shashank Sharma <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105644
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
--- drivers/gpu/drm/i915/intel_ddi.c | 19 ++++++++++++------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 40 ++++++++++++++++----------------------- 3 files changed, 29 insertions(+), 32 deletions(-)
drivers/gpu/drm/i915/intel_ddi.c +12 -7
@@ -2424,12 +2424,14 @@ static void intel_enable_ddi_hdmi(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_digital_port *dig_port =enc_to_dig_port (&encoder->base); +struct drm_connector *connector = conn_state->connector;enum port port = encoder->port; -intel_hdmi_handle_sink_scrambling (encoder, - conn_state->connector, - crtc_state->hdmi_high_tmds_clock_ratio, - crtc_state->hdmi_scrambling); +if (!intel_hdmi_handle_sink_scrambling (encoder, connector, + crtc_state->hdmi_high_tmds_clock_ratio, + crtc_state->hdmi_scrambling)) +DRM_ERROR ("[CONNECTOR:%d:%s] Failed to configure sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name);/* Display WA #1143: skl,kbl,cfl */ if (IS_GEN9_BC (dev_priv)) {
@@ -2520,13 +2522,16 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { + struct drm_connector *connector = old_conn_state->connector; +if (old_crtc_state->has_audio)intel_audio_codec_disable (encoder, old_crtc_state, old_conn_state); -intel_hdmi_handle_sink_scrambling (encoder , - old_conn_state->connector, -false ,false ); +if (!intel_hdmi_handle_sink_scrambling (encoder, connector, + false, false)) +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] Failed to reset sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name); } static void intel_disable_ddi(struct intel_encoder *encoder,
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -1783,7 +1783,7 @@ struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state); -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *intel_encoder, +bool intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder,struct drm_connector *connector,bool high_tmds_clock_ratio,bool scrambling);
drivers/gpu/drm/i915/intel_hdmi.c +16 -24
@@ -2082,41 +2082,33 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c* it enables scrambling. This should be called before enabling the HDMI * 2.0 port, as the sink can choose to disable the scrambling if it doesn't * detect a scrambled clock within 100 ms. +* +* Returns: +* True on success, false on failure. */ -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder, +bool intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder,struct drm_connector *connector,bool high_tmds_clock_ratio,bool scrambling) { +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); -struct drm_i915_private *dev_priv = connector->dev->dev_private;struct drm_scrambling *sink_scrambling = - &connector->display_info.hdmi.scdc.scrambling; -struct i2c_adapter *adptr =intel_gmbus_get_adapter (dev_priv, - intel_hdmi->ddc_bus); -bool ret; + &connector->display_info.hdmi.scdc.scrambling; +struct i2c_adapter *adapter = +intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus);if (!sink_scrambling->supported) -return ; - -DRM_DEBUG_KMS ("Setting sink scrambling for enc:%s connector:%s\n" , - encoder->base.name, connector->name); +return true; -/* Set TMDS bit clock ratio to 1/40 or 1/10 */ - ret =drm_scdc_set_high_tmds_clock_ratio (adptr, high_tmds_clock_ratio); -if (!ret) { -DRM_ERROR ("Set TMDS ratio failed\n" ); -return ; - } - -/* Enable/disable sink scrambling */ - ret =drm_scdc_set_scrambling (adptr, scrambling); -if (!ret) { -DRM_ERROR ("Set sink scrambling failed\n" ); -return ; - } +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] scrambling=%s, TMDS bit clock ratio=1/%d\n" , + connector->base.id, connector->name, +yesno (scrambling), high_tmds_clock_ratio ?40 :10 ); -DRM_DEBUG_KMS ("sink scrambling handled\n" ); +/* Set TMDS bit clock ratio to 1/40 or 1/10, and enable/disable scrambling */ +return drm_scdc_set_high_tmds_clock_ratio (adapter, + high_tmds_clock_ratio) && +drm_scdc_set_scrambling (adapter, scrambling); }static u8 chv_port_to_ddc_pin (struct drm_i915_private *dev_priv,enum port port)
Signature · 6 lines
2.16.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 132 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
When we're disabling the HDMI link we try to reset the scrambling and TMDS bit clock ratio back to the default values. This will fail if the sink has already been disconnected. Thus we should not print an error message when resetting the scrambling/TMDS bit clock ratio fail during disable. During enable we do want the error, and during disable we may still want to know what happended for debug purposes so let's use
DRM_DEBUG_KMS()there.v2: Remember them consts
v3: Go back to just one function and print the errors/debugs
from callers (Shashank)Cc: Shashank Sharma <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105644
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_ddi.c | 19 ++++++++++++------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 40 ++++++++++++++++----------------------- 3 files changed, 29 insertions(+), 32 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +12
-7@@ -2424,12 +2424,14 @@ static void intel_enable_ddi_hdmi(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_digital_port *dig_port =enc_to_dig_port (&encoder->base); +struct drm_connector *connector = conn_state->connector;enum port port = encoder->port; -intel_hdmi_handle_sink_scrambling (encoder, - conn_state->connector, - crtc_state->hdmi_high_tmds_clock_ratio, - crtc_state->hdmi_scrambling); +if (!intel_hdmi_handle_sink_scrambling (encoder, connector, + crtc_state->hdmi_high_tmds_clock_ratio, + crtc_state->hdmi_scrambling)) +DRM_ERROR ("[CONNECTOR:%d:%s] Failed to configure sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name);/* Display WA #1143: skl,kbl,cfl */ if (IS_GEN9_BC (dev_priv)) {@@ -2520,13 +2522,16 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { + struct drm_connector *connector = old_conn_state->connector; +if (old_crtc_state->has_audio)intel_audio_codec_disable (encoder, old_crtc_state, old_conn_state); -intel_hdmi_handle_sink_scrambling (encoder , - old_conn_state->connector, -false ,false ); +if (!intel_hdmi_handle_sink_scrambling (encoder, connector, + false, false)) +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] Failed to reset sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name); } static void intel_disable_ddi(struct intel_encoder *encoder,drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -1783,7 +1783,7 @@ struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state); -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *intel_encoder, +bool intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder,struct drm_connector *connector,bool high_tmds_clock_ratio,bool scrambling);drivers/gpu/drm/i915/intel_hdmi.c +11
-23@@ -2082,41 +2082,33 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c* it enables scrambling. This should be called before enabling the HDMI * 2.0 port, as the sink can choose to disable the scrambling if it doesn't * detect a scrambled clock within 100 ms. +* +* Returns: +* True on success, false on failure. */ -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder, +bool intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder,struct drm_connector *connector,bool high_tmds_clock_ratio,bool scrambling) { +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); -struct drm_i915_private *dev_priv = connector->dev->dev_private;struct drm_scrambling *sink_scrambling = - &connector->display_info.hdmi.scdc.scrambling; -struct i2c_adapter *adptr =intel_gmbus_get_adapter (dev_priv, - intel_hdmi->ddc_bus); -bool ret; + &connector->display_info.hdmi.scdc.scrambling; +struct i2c_adapter *adapter = +intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus);if (!sink_scrambling->supported) -return ; - -DRM_DEBUG_KMS ("Setting sink scrambling for enc:%s connector:%s\n" , - encoder->base.name, connector->name); +return true; -/* Set TMDS bit clock ratio to 1/40 or 1/10 */ - ret =drm_scdc_set_high_tmds_clock_ratio (adptr, high_tmds_clock_ratio); -if (!ret) { -DRM_ERROR ("Set TMDS ratio failed\n" ); -return ; - } - -/* Enable/disable sink scrambling */ - ret =drm_scdc_set_scrambling (adptr, scrambling); -if (!ret) { -DRM_ERROR ("Set sink scrambling failed\n" ); -return ; - } + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] scrambling=%s, TMDS bit clock ratio=1/%d\n", + connector->base.id, connector->name,
drivers/gpu/drm/i915/intel_hdmi.c intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c · line 2114
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +5
-1+ yesno(scrambling), high_tmds_clock_ratio ? 40 : 10); -DRM_DEBUG_KMS ("sink scrambling handled\n" ); +/* Set TMDS bit clock ratio to 1/40 or 1/10, and enable/disable scrambling */ +return drm_scdc_set_high_tmds_clock_ratio (adapter, + high_tmds_clock_ratio) && +drm_scdc_set_scrambling (adapter, scrambling); }static u8 chv_port_to_ddc_pin (struct drm_i915_private *dev_priv,enum port port)
Looks good to me.
Regards
Shashank
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 143 lines · Shashank
Quoted 141 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
When we're disabling the HDMI link we try to reset the scrambling and TMDS bit clock ratio back to the default values. This will fail if the sink has already been disconnected. Thus we should not print an error message when resetting the scrambling/TMDS bit clock ratio fail during disable. During enable we do want the error, and during disable we may still want to know what happended for debug purposes so let's use
DRM_DEBUG_KMS()there.v2: Remember them consts
v3: Go back to just one function and print the errors/debugs
from callers (Shashank)Cc: Shashank Sharma <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105644
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/intel_ddi.c | 19 ++++++++++++------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 40 ++++++++++++++++----------------------- 3 files changed, 29 insertions(+), 32 deletions(-)drivers/gpu/drm/i915/intel_ddi.c +12
-7@@ -2424,12 +2424,14 @@ static void intel_enable_ddi_hdmi(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_digital_port *dig_port =enc_to_dig_port (&encoder->base); +struct drm_connector *connector = conn_state->connector;enum port port = encoder->port; -intel_hdmi_handle_sink_scrambling (encoder, - conn_state->connector, - crtc_state->hdmi_high_tmds_clock_ratio, - crtc_state->hdmi_scrambling); +if (!intel_hdmi_handle_sink_scrambling (encoder, connector, + crtc_state->hdmi_high_tmds_clock_ratio, + crtc_state->hdmi_scrambling)) +DRM_ERROR ("[CONNECTOR:%d:%s] Failed to configure sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name);/* Display WA #1143: skl,kbl,cfl */ if (IS_GEN9_BC (dev_priv)) {@@ -2520,13 +2522,16 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { + struct drm_connector *connector = old_conn_state->connector; +if (old_crtc_state->has_audio)intel_audio_codec_disable (encoder, old_crtc_state, old_conn_state); -intel_hdmi_handle_sink_scrambling (encoder , - old_conn_state->connector, -false ,false ); +if (!intel_hdmi_handle_sink_scrambling (encoder, connector, + false, false)) +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] Failed to reset sink scrambling/TMDS bit clock ratio\n" , + connector->base.id, connector->name); } static void intel_disable_ddi(struct intel_encoder *encoder,drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -1783,7 +1783,7 @@ struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);bool intel_hdmi_compute_config (struct intel_encoder *encoder,struct intel_crtc_state *pipe_config,struct drm_connector_state *conn_state); -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *intel_encoder, +bool intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder,struct drm_connector *connector,bool high_tmds_clock_ratio,bool scrambling);drivers/gpu/drm/i915/intel_hdmi.c +16
-24@@ -2082,41 +2082,33 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c* it enables scrambling. This should be called before enabling the HDMI * 2.0 port, as the sink can choose to disable the scrambling if it doesn't * detect a scrambled clock within 100 ms. +* +* Returns: +* True on success, false on failure. */ -void intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder, +bool intel_hdmi_handle_sink_scrambling (struct intel_encoder *encoder,struct drm_connector *connector,bool high_tmds_clock_ratio,bool scrambling) { +struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (&encoder->base); -struct drm_i915_private *dev_priv = connector->dev->dev_private;struct drm_scrambling *sink_scrambling = - &connector->display_info.hdmi.scdc.scrambling; -struct i2c_adapter *adptr =intel_gmbus_get_adapter (dev_priv, - intel_hdmi->ddc_bus); -bool ret; + &connector->display_info.hdmi.scdc.scrambling; +struct i2c_adapter *adapter = +intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus);if (!sink_scrambling->supported) -return ; - -DRM_DEBUG_KMS ("Setting sink scrambling for enc:%s connector:%s\n" , - encoder->base.name, connector->name); +return true; -/* Set TMDS bit clock ratio to 1/40 or 1/10 */ - ret =drm_scdc_set_high_tmds_clock_ratio (adptr, high_tmds_clock_ratio); -if (!ret) { -DRM_ERROR ("Set TMDS ratio failed\n" ); -return ; - } - -/* Enable/disable sink scrambling */ - ret =drm_scdc_set_scrambling (adptr, scrambling); -if (!ret) { -DRM_ERROR ("Set sink scrambling failed\n" ); -return ; - } +DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] scrambling=%s, TMDS bit clock ratio=1/%d\n" , + connector->base.id, connector->name, +yesno (scrambling), high_tmds_clock_ratio ?40 :10 ); -DRM_DEBUG_KMS ("sink scrambling handled\n" ); +/* Set TMDS bit clock ratio to 1/40 or 1/10, and enable/disable scrambling */ +return drm_scdc_set_high_tmds_clock_ratio (adapter, + high_tmds_clock_ratio) && +drm_scdc_set_scrambling (adapter, scrambling); }
Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c · line 2114
Quoted 1 line
drivers/gpu/drm/i915/intel_hdmi.c +0
-0static u8 chv_port_to_ddc_pin (struct drm_i915_private *dev_priv,enum port port)Looks good to me.
Reviewed-by Shashank Sharma <[email protected]>
Thanks. Pushed to dinq.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev3)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev3)
URL : https://patchwork.freedesktop.org/series/40461/
State : success
== Summary ==
---- Known issues:
Test kms_flip:
Subgroup dpms-vs-vblank-race:
fail -> PASS (shard-hsw) fdo#103060 +1
Subgroup plain-flip-fb-recreate:
fail -> PASS (shard-hsw) fdo#100368 +3
Test kms_rotation_crc:
Subgroup sprite-rotation-180:
fail -> PASS (shard-apl) fdo#103925fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
shard-apl total:3484 pass:1820 dwarn:1 dfail:0 fail:7 skip:1655 time:13150s shard-hsw total:3484 pass:1770 dwarn:1 dfail:0 fail:5 skip:1707 time:11658s shard-snb total:3484 pass:1363 dwarn:1 dfail:0 fail:3 skip:2117 time:7261s
Blacklisted hosts:
shard-kbl total:3484 pass:1945 dwarn:1 dfail:0 fail:10 skip:1528 time:10014s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8450/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev4)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev4)
URL : https://patchwork.freedesktop.org/series/40461/
State : success
== Summary ==
Series 40461v4 drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
https://patchwork.freedesktop.org/api/1.0/series/40461/revisions/4/mbox/
---- Known issues:
Test debugfs_test:
Subgroup read_all_entries:
incomplete -> PASS (fi-snb-2520m) fdo#103713 +1
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
fail -> PASS (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
Subgroup nonblocking-crc-pipe-b-frame-sequence:
incomplete -> PASS (fi-cnl-y3) fdo#103191fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:432s fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:438s fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:379s fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:540s fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:297s fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:513s fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:516s fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:505s fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:412s fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:510s fi-cnl-drrs total:285 pass:254 dwarn:3 dfail:0 fail:0 skip:28 time:527s fi-cnl-y3 total:285 pass:258 dwarn:0 dfail:1 fail:0 skip:26 time:590s fi-elk-e7500 total:285 pass:225 dwarn:1 dfail:0 fail:0 skip:59 time:422s fi-gdg-551 total:285 pass:177 dwarn:0 dfail:0 fail:0 skip:108 time:317s fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:537s fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:400s fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:418s fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:479s fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:431s fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:475s fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:469s fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:513s fi-pnv-d510 total:285 pass:219 dwarn:1 dfail:0 fail:0 skip:65 time:653s fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:441s fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:527s fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:502s fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:488s fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:428s fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:443s fi-snb-2520m total:242 pass:208 dwarn:0 dfail:0 fail:0 skip:33 fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:402s
fi-cfl-s3 failed to connect after reboot
40fcdd23bec787a5913496f2b11c5d26bdff985a drm-tip: 2018y-03m-22d-15h-28m-32s UTC integration manifest baa62de60c2d drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8453/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.IGT: warning for drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev4)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev4)
URL : https://patchwork.freedesktop.org/series/40461/
State : warning
== Summary ==
---- Possible new issues:
Test kms_flip:
Subgroup 2x-flip-vs-dpms:
pass -> DMESG-WARN (shard-hsw)---- Known issues:
Test kms_flip:
Subgroup 2x-plain-flip-ts-check-interruptible:
pass -> FAIL (shard-hsw) fdo#100368 +1
Subgroup modeset-vs-vblank-race-interruptible:
pass -> FAIL (shard-hsw) fdo#103060 +2
Test kms_sysfs_edid_timing:
warn -> PASS (shard-apl) fdo#100047fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
shard-apl total:3484 pass:1821 dwarn:1 dfail:0 fail:7 skip:1655 time:13153s shard-hsw total:3484 pass:1770 dwarn:2 dfail:0 fail:4 skip:1707 time:11827s shard-snb total:3484 pass:1363 dwarn:1 dfail:0 fail:3 skip:2117 time:7284s
Blacklisted hosts:
shard-kbl total:3484 pass:1945 dwarn:1 dfail:0 fail:10 skip:1528 time:9960s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8453/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.IGT: warning for drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev4)
Quoted 6 lines · Patchwork
== Series Details ==
Series: drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev4)
URL : https://patchwork.freedesktop.org/series/40461/
State : warning
Quoted 7 lines
== Summary ==
---- Possible new issues:
Test
kms_flip:Subgroup 2x-flip-vs-dpms: pass -> DMESG-WARN (shard-hsw)
Seems unrelated
[ 1018.018832] [drm:intel_set_pch_fifo_underrun_reporting [i915]] *ERROR* uncleared pch fifo underrun on pch transcoder A [ 1018.019149] [drm:cpt_irq_handler [i915]] *ERROR* PCH transcoder A FIFO underrun
Quoted 24 lines
---- Known issues:
Test
kms_flip:Subgroup 2x-plain-flip-ts-check-interruptible: pass -> FAIL (shard-hsw) fdo#100368 +1 Subgroup modeset-vs-vblank-race-interruptible: pass -> FAIL (shard-hsw) fdo#103060 +2 Test kms_sysfs_edid_timing: warn -> PASS (shard-apl) fdo#100047fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047shard-apl total:3484 pass:1821 dwarn:1 dfail:0 fail:7 skip:1655 time:13153s shard-hsw total:3484 pass:1770 dwarn:2 dfail:0 fail:4 skip:1707 time:11827s shard-snb total:3484 pass:1363 dwarn:1 dfail:0 fail:3 skip:2117 time:7284sBlacklisted hosts:
shard-kbl total:3484 pass:1945 dwarn:1 dfail:0 fail:10 skip:1528 time:9960s== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8453/shards.html
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx