Skip to contentSkip to conversation

drm: Schedule the output_poll_work with 1s delay if we have delayed event

PATCH In review Peter Ujfalusi 3 participants 4 messages Jan 9, 2017 – Jan 10, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm: Schedule the output_poll_work with 1s delay if we have delayed event

Instead of scheduling the work to handle the initial delayed event, use 1s delay.

This delay should not be needed, but Optimus/nouveau will fail in a mysterious way if the delayed event is handled as soon as possible like it is done in drm_helper_probe_single_connector_modes() in case the poll was enabled before.

Reverting 339fd36238dd would give back the 10 sec (!) delay to handle the delayed event. Adding 1sec delay to the poll_work is enough to work around the issue in Optimus setups and gives shorter response on handling the initial delayed event.

Fixes 339fd36238dd ("drm: drm_probe_helper: Fix output_poll_work scheduling")
---
 drivers/gpu/drm/drm_probe_helper.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_probe_helper.c +9 -1
index 06a62e37fbdc..258abed43e38 100644
@@ -146,8 +146,16 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
 	drm_connector_list_iter_put(&conn_iter);
 
 	if (dev->mode_config.delayed_event) {
+		/*
+		 * Use short (1s) delay to handle the initial delayed event.
+		 * This delay should not be needed, but Optimus/nouveau will
+		 * fail in a mysterious way if the delayed event is handled as
+		 * soon as possible like it is done in
+		 * drm_helper_probe_single_connector_modes() in case the poll
+		 * was enabled before.
+		 */
 		poll = true;
-		delay = 0;
+		delay = HZ;
 	}
 
 	if (poll)
Signature · 1 line
2.11.0
#1 lore raw
Quoted 5 lines · Peter Ujfalusi

Instead of scheduling the work to handle the initial delayed event, use 1s delay.

This delay should not be needed, but Optimus/nouveau will fail in a mysterious way if the delayed event is handled as soon as possible like it

Has anyone tried to demystify the failure? It seems like fixing the root problem would be better than this.

Perhaps we should just revert 339fd36238dd to fix stable.

Sean

Quoted 40 lines

is done in drm_helper_probe_single_connector_modes() in case the poll was enabled before.

Reverting 339fd36238dd would give back the 10 sec (!) delay to handle the delayed event. Adding 1sec delay to the poll_work is enough to work around the issue in Optimus setups and gives shorter response on handling the initial delayed event.

Fixes 339fd36238dd ("drm: drm_probe_helper: Fix output_poll_work scheduling")
---
 drivers/gpu/drm/drm_probe_helper.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_probe_helper.c +9 -2
index 06a62e37fbdc..258abed43e38 100644
@@ -146,8 +146,16 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
        drm_connector_list_iter_put(&conn_iter);
 
        if (dev->mode_config.delayed_event) {
+               /*
+                * Use short (1s) delay to handle the initial delayed event.
+                * This delay should not be needed, but Optimus/nouveau will
+                * fail in a mysterious way if the delayed event is handled as
+                * soon as possible like it is done in
+                * drm_helper_probe_single_connector_modes() in case the poll
+                * was enabled before.
+                */
                poll = true;
-               delay = 0;
+               delay = HZ;
        }
 
        if (poll)
--

2.11.0

Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
#2 lore raw
Quoted 9 lines · Sean Paul
Quoted 5 lines · Peter Ujfalusi

Instead of scheduling the work to handle the initial delayed event, use 1s delay.

This delay should not be needed, but Optimus/nouveau will fail in a mysterious way if the delayed event is handled as soon as possible like it

Has anyone tried to demystify the failure? It seems like fixing the root problem would be better than this.

Peter is on it, but fixing the regression meanwhile has priority imo.

Quoted 1 line

Perhaps we should just revert 339fd36238dd to fix stable.

That will make people unhappy about the delay again, so I think 1s delay is the better option.

Quoted 25 lines

Sean

Quoted 22 lines

is done in drm_helper_probe_single_connector_modes() in case the poll was enabled before.

Reverting 339fd36238dd would give back the 10 sec (!) delay to handle the delayed event. Adding 1sec delay to the poll_work is enough to work around the issue in Optimus setups and gives shorter response on handling the initial delayed event.

Fixes 339fd36238dd ("drm: drm_probe_helper: Fix output_poll_work scheduling")
---
 drivers/gpu/drm/drm_probe_helper.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_probe_helper.c +0 -0
index 06a62e37fbdc..258abed43e38 100644
@@ -146,8 +146,16 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
        drm_connector_list_iter_put(&conn_iter);
 
Quoted 2 lines

drivers/gpu/drm/drm_probe_helper.c void drm_kms_helper_poll_enable_locked(struct drm_device *dev) · line 149

Quoted 2 lines
drivers/gpu/drm/drm_probe_helper.c +1 -0
        if (dev->mode_config.delayed_event) {
+               /*

I added a FIXME: heading here to make it stick out more, and then applied the patch.

Thanks, Daniel

Quoted 25 lines
Quoted 16 lines
drivers/gpu/drm/drm_probe_helper.c +8 -2
+                * Use short (1s) delay to handle the initial delayed event.
+                * This delay should not be needed, but Optimus/nouveau will
+                * fail in a mysterious way if the delayed event is handled as
+                * soon as possible like it is done in
+                * drm_helper_probe_single_connector_modes() in case the poll
+                * was enabled before.
+                */
                poll = true;
-               delay = 0;
+               delay = HZ;
        }
 
        if (poll)
--

2.11.0

Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#3 lore raw
Quoted 11 lines · Daniel Vetter
Quoted 9 lines · Sean Paul
Quoted 5 lines · Peter Ujfalusi

Instead of scheduling the work to handle the initial delayed event, use 1s delay.

This delay should not be needed, but Optimus/nouveau will fail in a mysterious way if the delayed event is handled as soon as possible like it

Has anyone tried to demystify the failure? It seems like fixing the root problem would be better than this.

Quoted 6 lines

Peter is on it, but fixing the regression meanwhile has priority imo.

Quoted 1 line

Perhaps we should just revert 339fd36238dd to fix stable.

That will make people unhappy about the delay again, so I think 1s delay is the better option.

For the future: If you add an in-patch changelog then it'd would have been clear that we discussed all this already. Also good to cc all previous commenters when submitting a new version.
-Daniel

Quoted 64 lines
Quoted 26 lines

Sean

Quoted 22 lines

is done in drm_helper_probe_single_connector_modes() in case the poll was enabled before.

Reverting 339fd36238dd would give back the 10 sec (!) delay to handle the delayed event. Adding 1sec delay to the poll_work is enough to work around the issue in Optimus setups and gives shorter response on handling the initial delayed event.

Fixes 339fd36238dd ("drm: drm_probe_helper: Fix output_poll_work scheduling")
---
 drivers/gpu/drm/drm_probe_helper.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_probe_helper.c +0 -0
index 06a62e37fbdc..258abed43e38 100644
@@ -146,8 +146,16 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
        drm_connector_list_iter_put(&conn_iter);
 
Quoted 2 lines

drivers/gpu/drm/drm_probe_helper.c void drm_kms_helper_poll_enable_locked(struct drm_device *dev) · line 149

Quoted 2 lines
drivers/gpu/drm/drm_probe_helper.c +1 -0
        if (dev->mode_config.delayed_event) {
+               /*

I added a FIXME: heading here to make it stick out more, and then applied the patch.

Thanks, Daniel

Quoted 25 lines
Quoted 16 lines
drivers/gpu/drm/drm_probe_helper.c +8 -2
+                * Use short (1s) delay to handle the initial delayed event.
+                * This delay should not be needed, but Optimus/nouveau will
+                * fail in a mysterious way if the delayed event is handled as
+                * soon as possible like it is done in
+                * drm_helper_probe_single_connector_modes() in case the poll
+                * was enabled before.
+                */
                poll = true;
-               delay = 0;
+               delay = HZ;
        }
 
        if (poll)
--

2.11.0

Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch