drm/dp: Do not prune the last mode on the connector
Subsystems (2)
PATCH 1/1 drm/dp: Do not prune the last mode on the connector
Currently the drm_mode_prune_invalid() function will prune all the modes if it finds that the mode-status
is not MODE_OK. But if it ends up pruning all modes then there are no modes left for that connector which will eventually result into a black screen as userspace sees no modes from the kernel. This can happen pretty quickly in case of eDP panel that has only mode that might get pruned. This patch fixes this problem by checking if the mode being pruned is the last mode on that connector and if so doesnt prune it.
--- drivers/gpu/drm/drm_modes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_modes.c +2 -1
@@ -1185,7 +1185,8 @@ void drm_mode_prune_invalid(struct drm_device *dev,struct drm_display_mode *mode, *t;list_for_each_entry_safe (mode, t, mode_list, head) { -if (mode->status !=MODE_OK ) { +if (mode->status !=MODE_OK && + !(list_is_last (&mode->head, mode_list))) {list_del (&mode->head);if (verbose) {drm_mode_debug_printmodeline (mode);
Signature · 6 lines
2.1.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI✗ Fi.CI.BAT: failure for drm/dp: Do not prune the last mode on the connector
== Series Details ==
== Series Details ==
Series: drm/dp: Do not prune the last mode on the connector
URL : https://patchwork.freedesktop.org/series/31018/
State : failure
== Summary ==
Series 31018v1 drm/dp: Do not prune the last mode on the connector
https://patchwork.freedesktop.org/api/1.0/series/31018/revisions/1/mbox/
Test kms_force_connector_basic:
Subgroup force-connector-state:
pass -> FAIL (fi-bwr-2160)
pass -> FAIL (fi-elk-e7500)
pass -> FAIL (fi-snb-2520m)
pass -> FAIL (fi-snb-2600)
pass -> FAIL (fi-ivb-3520m)
pass -> FAIL (fi-ivb-3770)
pass -> FAIL (fi-byt-j1900)
Test kms_pipe_crc_basic:
Subgroup hang-read-crc-pipe-b:
dmesg-warn -> INCOMPLETE (fi-cfl-s) fdo#102294
Test prime_vgem:
Subgroup basic-fence-flip:
skip -> PASS (fi-ivb-3520m)
Test drv_module_reload:
Subgroup basic-reload:
dmesg-warn -> PASS (fi-glk-1) fdo#102777fdo#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:445s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:472s fi-blb-e6850 total:289 pass:224 dwarn:1 dfail:0 fail:0 skip:64 time:422s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:533s fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:1 skip:105 time:280s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:511s fi-byt-j1900 total:289 pass:253 dwarn:1 dfail:0 fail:1 skip:34 time:501s fi-cfl-s total:231 pass:188 dwarn:17 dfail:0 fail:0 skip:25 fi-cnl-y total:289 pass:259 dwarn:0 dfail:0 fail:3 skip:27 time:657s fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:1 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:429s 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:440s fi-ivb-3520m total:289 pass:261 dwarn:0 dfail:0 fail:1 skip:27 time:498s fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:1 skip:28 time:465s 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:578s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:593s 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:456s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:756s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:491s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:476s fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:1 skip:38 time:571s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:1 skip:39 time:417s
7f93222785e4887c083c85b76fcbb391bb1991d9 drm-tip: 2017y-09m-27d-20h-05m-25s UTC integration manifest 57fb30346021 drm/dp: Do not prune the last mode on the connector
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5837/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 2 lines · Manasi Navare
This patch fixes this problem by checking if the mode being pruned is the last mode on that connector and if so doesnt prune it.
I think you want to stop pruning when you've gotten to a single mode on the list, not at the last mode in the list (which may well need to be pruned).
This is entirely untested, but perhaps
+ !(list_is_singular(mode_list))) {
is what you want?
Signature · 1 line
-keith
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 13 lines · Keith Packard
Quoted 2 lines · Manasi Navare
This patch fixes this problem by checking if the mode being pruned is the last mode on that connector and if so doesnt prune it.
I think you want to stop pruning when you've gotten to a single mode on the list, not at the last mode in the list (which may well need to be pruned).
This is entirely untested, but perhaps
(quoted diff) +1
-0+ !(list_is_singular(mode_list))) {
Quoted 2 lines
is what you want?
Thanks Keith. Yes thats correct, I got confused by the macro name. But its correct I should use the list_is_singular instead.
Manasi
Quoted 2 lines
Signature · 1 line
-keith
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 drm/dp: Do not prune the last mode on the connector
In reply to Manasi NavareCurrently the drm_mode_prune_invalid() function will
prune all the modes if it finds that the mode-status
is not MODE_OK. But if it ends up pruning all modes
then there are no modes left for that connector which will eventually result into a black screen as userspace sees no modes from the kernel. This can happen pretty quickly in case of eDP panel that has only mode that might get pruned.
This patch fixes this problem by checking if the mode being pruned is the last mode(only mode) on that connector and if so doesnt prune it.
v2:
* Use correct macro from list.h (Keith Packard)
--- drivers/gpu/drm/drm_modes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_modes.c +2 -1
@@ -1185,7 +1185,8 @@ void drm_mode_prune_invalid(struct drm_device *dev,struct drm_display_mode *mode, *t;list_for_each_entry_safe (mode, t, mode_list, head) { -if (mode->status !=MODE_OK ) { +if (mode->status !=MODE_OK && + !list_is_singular (mode_list)) {list_del (&mode->head);if (verbose) {drm_mode_debug_printmodeline (mode);
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/dp: Do not prune the last mode on the connector (rev2)
In reply to Manasi Navare== Series Details ==
== Series Details ==
Series: drm/dp: Do not prune the last mode on the connector (rev2)
URL : https://patchwork.freedesktop.org/series/31018/
State : failure
== Summary ==
Series 31018v2 drm/dp: Do not prune the last mode on the connector
https://patchwork.freedesktop.org/api/1.0/series/31018/revisions/2/mbox/
Test kms_force_connector_basic:
Subgroup force-connector-state:
pass -> FAIL (fi-bwr-2160)
pass -> FAIL (fi-elk-e7500)
pass -> FAIL (fi-snb-2520m)
pass -> FAIL (fi-snb-2600)
pass -> FAIL (fi-ivb-3520m)
pass -> FAIL (fi-ivb-3770)
pass -> FAIL (fi-byt-j1900)
Test prime_vgem:
Subgroup basic-fence-flip:
skip -> PASS (fi-ivb-3520m)
Test drv_module_reload:
Subgroup basic-reload:
dmesg-warn -> PASS (fi-glk-1) fdo#102777 +1fdo#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:439s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:477s 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:517s fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:1 skip:105 time:277s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:516s fi-byt-j1900 total:289 pass:253 dwarn:1 dfail:0 fail:1 skip:34 time:493s fi-cfl-s total:289 pass:223 dwarn:34 dfail:0 fail:0 skip:32 time:544s fi-cnl-y total:289 pass:258 dwarn:0 dfail:0 fail:4 skip:27 time:654s fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:1 skip:59 time:417s fi-glk-1 total:289 pass:259 dwarn:1 dfail:0 fail:0 skip:29 time:564s fi-hsw-4770 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:423s 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:431s fi-ivb-3520m total:289 pass:261 dwarn:0 dfail:0 fail:1 skip:27 time:492s fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:1 skip:28 time:464s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:478s 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:589s fi-pnv-d510 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:545s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:455s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:754s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:485s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:476s fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:1 skip:38 time:566s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:1 skip:39 time:415s
7f93222785e4887c083c85b76fcbb391bb1991d9 drm-tip: 2017y-09m-27d-20h-05m-25s UTC integration manifest 120bf9f3f5c0 drm/dp: Do not prune the last mode on the connector
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5839/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx