drm/i915: always update ELD connector type after get modes
Subsystems (2)
PATCH 1/1 drm/i915: always update ELD connector type after get modes
drm_edid_to_eld() initializes the connector ELD to zero, overwriting the ELD connector type initialized in intel_audio_codec_enable(). If userspace does getconnector and thus get_modes after modeset, a subsequent audio component i915_audio_component_get_eld() call will receive an ELD without the connector type properly set. It's fine for HDMI, but screws up audio for DP.
Always set the ELD connector type at intel_connector_update_modes() based on the connector type. We can drop the connector type update from intel_audio_codec_enable().
Credits to Joseph Nuzman <[email protected]> for figuring this out.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101583
---
We'll still need to cache and fix the av sync delay as well, but we need adjusted mode for that.
--- drivers/gpu/drm/i915/intel_audio.c | 5 ----- drivers/gpu/drm/i915/intel_modes.c | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +0 -5
@@ -606,11 +606,6 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder, connector->encoder->base.id, connector->encoder->name); -/* ELD Conn_Type */ - connector->eld[5 ] &= ~(3 <<2 ); -if (intel_crtc_has_dp_encoder (crtc_state)) - connector->eld[5 ] |= (1 <<2 ); - connector->eld[6 ] =drm_av_sync_delay (connector, adjusted_mode) /2 ;if (dev_priv->display.audio_codec_enable)
drivers/gpu/drm/i915/intel_modes.c +17 -0
@@ -30,6 +30,21 @@#include "intel_drv.h" #include "i915_drv.h" +static void intel_connector_update_eld_conn_type (struct drm_connector *connector) +{ +u8 conn_type; + +if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || + connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + conn_type =DRM_ELD_CONN_TYPE_DP ; + }else { + conn_type =DRM_ELD_CONN_TYPE_HDMI ; + } + + connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE ] &= ~DRM_ELD_CONN_TYPE_MASK ; + connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE ] |= conn_type; +} +/** * intel_connector_update_modes - update connector from edid * @connector: DRM connector device to use
@@ -44,6 +59,8 @@ int intel_connector_update_modes(struct drm_connector *connector, ret =drm_add_edid_modes (connector, edid);drm_edid_to_eld (connector, edid); +intel_connector_update_eld_conn_type (connector); +return ret; }
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 11 lines · Jani Nikula
drm_edid_to_eld()initializes the connector ELD to zero, overwriting the ELD connector type initialized inintel_audio_codec_enable(). If userspace does getconnector and thusget_modesafter modeset, a subsequent audio componenti915_audio_component_get_eld()call will receive an ELD without the connector type properly set. It's fine for HDMI, but screws up audio for DP.Always set the ELD connector type at
intel_connector_update_modes()based on the connector type. We can drop the connector type update fromintel_audio_codec_enable().
Quoted 7 lines
Credits to Joseph Nuzman <[email protected]> for figuring this out.
Cc Ville Syrjälä <[email protected]>Cc Joseph Nuzman <[email protected]>Reported-by Joseph Nuzman <[email protected]>Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101583
Signed-off-by Jani Nikula <[email protected]>
Probably
about as far back as it applies?
Quoted 60 lines
---
We'll still need to cache and fix the av sync delay as well, but we need adjusted mode for that.
--- drivers/gpu/drm/i915/intel_audio.c | 5 ----- drivers/gpu/drm/i915/intel_modes.c | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_audio.c +0
-5@@ -606,11 +606,6 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder, connector->encoder->base.id, connector->encoder->name); -/* ELD Conn_Type */ - connector->eld[5 ] &= ~(3 <<2 ); -if (intel_crtc_has_dp_encoder (crtc_state)) - connector->eld[5 ] |= (1 <<2 ); - connector->eld[6 ] =drm_av_sync_delay (connector, adjusted_mode) /2 ;if (dev_priv->display.audio_codec_enable)drivers/gpu/drm/i915/intel_modes.c +17
-0@@ -30,6 +30,21 @@#include "intel_drv.h" #include "i915_drv.h" +static void intel_connector_update_eld_conn_type (struct drm_connector *connector) +{ +u8 conn_type; + +if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || + connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + conn_type =DRM_ELD_CONN_TYPE_DP ; + }else { + conn_type =DRM_ELD_CONN_TYPE_HDMI ; + } + + connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE ] &= ~DRM_ELD_CONN_TYPE_MASK ; + connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE ] |= conn_type; +} +/** * intel_connector_update_modes - update connector from edid * @connector: DRM connector device to use @@ -44,6 +59,8 @@ int intel_connector_update_modes(struct drm_connector *connector, ret =drm_add_edid_modes (connector, edid);drm_edid_to_eld (connector, edid); +intel_connector_update_eld_conn_type (connector); +return ret; }
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 56 lines · Jani Nikula
drm_edid_to_eld()initializes the connector ELD to zero, overwriting the ELD connector type initialized inintel_audio_codec_enable(). If userspace does getconnector and thusget_modesafter modeset, a subsequent audio componenti915_audio_component_get_eld()call will receive an ELD without the connector type properly set. It's fine for HDMI, but screws up audio for DP.Always set the ELD connector type at
intel_connector_update_modes()based on the connector type. We can drop the connector type update fromintel_audio_codec_enable().Credits to Joseph Nuzman <[email protected]> for figuring this out.
Cc Ville Syrjälä <[email protected]>Cc Joseph Nuzman <[email protected]>Reported-by Joseph Nuzman <[email protected]>Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101583
Signed-off-by Jani Nikula <[email protected]>---
We'll still need to cache and fix the av sync delay as well, but we need adjusted mode for that.
--- drivers/gpu/drm/i915/intel_audio.c | 5 ----- drivers/gpu/drm/i915/intel_modes.c | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/intel_audio.c +0
-5@@ -606,11 +606,6 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder, connector->encoder->base.id, connector->encoder->name); -/* ELD Conn_Type */ - connector->eld[5 ] &= ~(3 <<2 ); -if (intel_crtc_has_dp_encoder (crtc_state)) - connector->eld[5 ] |= (1 <<2 ); - connector->eld[6 ] =drm_av_sync_delay (connector, adjusted_mode) /2 ;if (dev_priv->display.audio_codec_enable)drivers/gpu/drm/i915/intel_modes.c +4
-0@@ -30,6 +30,21 @@#include "intel_drv.h" #include "i915_drv.h" +static void intel_connector_update_eld_conn_type (struct drm_connector *connector) +{ +u8 conn_type; +
drivers/gpu/drm/i915/intel_modes.c line 46
Quoted 10 lines
drivers/gpu/drm/i915/intel_modes.c +10
-0+if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || + connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + conn_type =DRM_ELD_CONN_TYPE_DP ; + }else { + conn_type =DRM_ELD_CONN_TYPE_HDMI ; + } + + connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE ] &= ~DRM_ELD_CONN_TYPE_MASK ; + connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE ] |= conn_type; +}
Or should we just smash this into drm_edid_to_eld() ? Would require a quick review of other drivers I suppose.
It's a step forward so
And I guess we should still do something about the av sync delay always getting clobbered by get_modes()?
Quoted 15 lines
drivers/gpu/drm/i915/intel_modes.c +3
-0+/** * intel_connector_update_modes - update connector from edid * @connector: DRM connector device to use @@ -44,6 +59,8 @@ int intel_connector_update_modes(struct drm_connector *connector, ret =drm_add_edid_modes (connector, edid);drm_edid_to_eld (connector, edid); +intel_connector_update_eld_conn_type (connector); +return ret; }Signature · 1 line
2.11.0
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: warning for drm/i915: always update ELD connector type after get modes
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: drm/i915: always update ELD connector type after get modes
URL : https://patchwork.freedesktop.org/series/30602/
State : warning
== Summary ==
Series 30602v1 drm/i915: always update ELD connector type after get modes
https://patchwork.freedesktop.org/api/1.0/series/30602/revisions/1/mbox/
Test kms_addfb_basic:
Subgroup clobberred-modifier:
pass -> DMESG-WARN (fi-kbl-7500u)
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-legacy:
pass -> FAIL (fi-snb-2600) fdo#100215
Test kms_frontbuffer_tracking:
Subgroup basic:
dmesg-warn -> PASS (fi-kbl-7500u)
Test kms_pipe_crc_basic:
Subgroup hang-read-crc-pipe-b:
incomplete -> DMESG-WARN (fi-cfl-s) fdo#102294fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#102294 https://bugs.freedesktop.org/show_bug.cgi?id=102294
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:438s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:473s fi-blb-e6850 total:289 pass:224 dwarn:1 dfail:0 fail:0 skip:64 time:417s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:513s fi-bwr-2160 total:289 pass:184 dwarn:0 dfail:0 fail:0 skip:105 time:278s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:503s fi-byt-j1900 total:289 pass:254 dwarn:1 dfail:0 fail:0 skip:34 time:491s fi-byt-n2820 total:289 pass:250 dwarn:1 dfail:0 fail:0 skip:38 time:497s fi-cfl-s total:289 pass:223 dwarn:34 dfail:0 fail:0 skip:32 time:540s fi-elk-e7500 total:289 pass:230 dwarn:0 dfail:0 fail:0 skip:59 time:421s fi-glk-1 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:564s fi-hsw-4770 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:422s fi-hsw-4770r total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:405s fi-ilk-650 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:425s fi-ivb-3520m total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:490s fi-ivb-3770 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:461s fi-kbl-7500u total:245 pass:222 dwarn:2 dfail:0 fail:0 skip:20 fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:582s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:587s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:445s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:750s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:487s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:471s fi-snb-2520m total:289 pass:251 dwarn:0 dfail:0 fail:0 skip:38 time:563s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:1 skip:39 time:415s
fi-pnv-d510 failed to connect after reboot
bf6ecf6d25c1c45e576643b7d7a65e8b1e6b4f01 drm-tip: 2017y-09m-19d-17h-23m-04s UTC integration manifest 690262d1dc43 drm/i915: always update ELD connector type after get modes
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5751/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: always update ELD connector type after get modes
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: drm/i915: always update ELD connector type after get modes
URL : https://patchwork.freedesktop.org/series/30602/
State : failure
== Summary ==
Series 30602v1 drm/i915: always update ELD connector type after get modes
https://patchwork.freedesktop.org/api/1.0/series/30602/revisions/1/mbox/
Test chamelium:
Subgroup hdmi-hpd-fast:
fail -> SKIP (fi-kbl-7500u) fdo#102672
Test kms_busy:
Subgroup basic-flip-a:
pass -> INCOMPLETE (fi-bxt-j4205)
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-atomic:
pass -> FAIL (fi-snb-2600) fdo#100215 +1
Test pm_rpm:
Subgroup basic-rte:
pass -> DMESG-WARN (fi-cfl-s) fdo#102294fdo#102672 https://bugs.freedesktop.org/show_bug.cgi?id=102672
fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#102294 https://bugs.freedesktop.org/show_bug.cgi?id=102294
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:443s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:473s fi-blb-e6850 total:289 pass:224 dwarn:1 dfail:0 fail:0 skip:64 time:420s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:527s fi-bwr-2160 total:289 pass:184 dwarn:0 dfail:0 fail:0 skip:105 time:279s fi-bxt-j4205 total:206 pass:184 dwarn:0 dfail:0 fail:0 skip:21 fi-byt-j1900 total:289 pass:254 dwarn:1 dfail:0 fail:0 skip:34 time:498s fi-byt-n2820 total:289 pass:250 dwarn:1 dfail:0 fail:0 skip:38 time:498s fi-cfl-s total:289 pass:222 dwarn:35 dfail:0 fail:0 skip:32 time:550s fi-elk-e7500 total:289 pass:230 dwarn:0 dfail:0 fail:0 skip:59 time:422s fi-glk-1 total:289 pass:259 dwarn:1 dfail:0 fail:0 skip:29 time:570s fi-hsw-4770 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:431s fi-hsw-4770r total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:408s fi-ilk-650 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:432s fi-ivb-3520m total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:484s fi-ivb-3770 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:470s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:468s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:580s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:590s fi-pnv-d510 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:546s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:467s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:753s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:490s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:475s fi-snb-2520m total:289 pass:251 dwarn:0 dfail:0 fail:0 skip:38 time:570s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:1 skip:39 time:419s
85e28edde5bfb81a40cc95ce27cd84230114d6f0 drm-tip: 2017y-09m-19d-23h-07m-57s UTC integration manifest e62dbf899745 drm/i915: always update ELD connector type after get modes
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5761/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: always update ELD connector type after get modes
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: drm/i915: always update ELD connector type after get modes
URL : https://patchwork.freedesktop.org/series/30602/
State : success
== Summary ==
Series 30602v1 drm/i915: always update ELD connector type after get modes
https://patchwork.freedesktop.org/api/1.0/series/30602/revisions/1/mbox/
Test chamelium:
Subgroup hdmi-hpd-fast:
fail -> SKIP (fi-kbl-7500u) fdo#102672
Test pm_rpm:
Subgroup basic-rte:
pass -> DMESG-WARN (fi-cfl-s) fdo#102294
Test drv_module_reload:
Subgroup basic-reload:
dmesg-warn -> PASS (fi-glk-1) fdo#102777fdo#102672 https://bugs.freedesktop.org/show_bug.cgi?id=102672
fdo#102294 https://bugs.freedesktop.org/show_bug.cgi?id=102294
fdo#102777 https://bugs.freedesktop.org/show_bug.cgi?id=102777
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:437s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:471s fi-blb-e6850 total:289 pass:224 dwarn:1 dfail:0 fail:0 skip:64 time:473s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:507s fi-bwr-2160 total:289 pass:184 dwarn:0 dfail:0 fail:0 skip:105 time:277s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:502s fi-byt-j1900 total:289 pass:254 dwarn:1 dfail:0 fail:0 skip:34 time:494s fi-byt-n2820 total:289 pass:250 dwarn:1 dfail:0 fail:0 skip:38 time:489s fi-cfl-s total:289 pass:222 dwarn:35 dfail:0 fail:0 skip:32 time:546s fi-elk-e7500 total:289 pass:230 dwarn:0 dfail:0 fail:0 skip:59 time:417s fi-glk-1 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:569s fi-hsw-4770 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:426s fi-hsw-4770r total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:404s fi-ilk-650 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:422s fi-ivb-3520m total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:493s fi-ivb-3770 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:464s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:473s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:577s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:595s fi-pnv-d510 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:541s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:457s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:751s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:487s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:473s fi-snb-2520m total:289 pass:251 dwarn:0 dfail:0 fail:0 skip:38 time:572s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:1 skip:39 time:421s
85e28edde5bfb81a40cc95ce27cd84230114d6f0 drm-tip: 2017y-09m-19d-23h-07m-57s UTC integration manifest 3f40ff798dc8 drm/i915: always update ELD connector type after get modes
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5762/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915: always update ELD connector type after get modes
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: drm/i915: always update ELD connector type after get modes
URL : https://patchwork.freedesktop.org/series/30602/
State : success
== Summary ==
Test kms_setmode:
Subgroup basic:
fail -> PASS (shard-hsw) fdo#99912fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
shard-hsw total:2317 pass:1244 dwarn:3 dfail:0 fail:13 skip:1057 time:9667s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5762/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx