Skip to contentSkip to conversation

drm/crtc-helpers: fix dpms on logic

PATCH New Daniel Vetter 1 participant 2 messages Apr 1, 2014

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

PATCH 1/2 drm/crtc-helpers: fix dpms on logic

This was introduced in

commit 25f397a429dfa43f22c278d0119a60a343aa568f

Author: Daniel Vetter <[email protected]>
Date:   Fri Jul 19 18:57:11 2013 +0200

drm/crtc-helper: explicit DPMS on after modeset

but due to a bit of rebase fail on my side the patch actually merged put one hunk on the wrong side of a break statement. Fix this up.

---
 drivers/gpu/drm/drm_crtc_helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_crtc_helper.c +2 -1
index c0f2d6266070..8108db95e12b 100644
@@ -695,12 +695,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
 				if (new_encoder == NULL)
 					/* don't break so fail path works correct */
 					fail = 1;
-				break;
 
 				if (connector->dpms != DRM_MODE_DPMS_ON) {
 					DRM_DEBUG_KMS("connector dpms not on, full mode switch\n");
 					mode_changed = true;
 				}
+
+				break;
 			}
 		}
 
Signature · 1 line
1.8.5.2
#1 lore raw

PATCH 2/2 drm/crtc-helper: don't disable disconnected outputs

This is the equivalent change in the crtc helpers as done to the i915 modeset infrastructure in

commit b0a2658acb5bf9ca86b4aab011b7106de3af0add

Author: Daniel Vetter <[email protected]>
Date:   Tue Dec 18 09:37:54 2012 +0100

drm/i915: don't disable disconnected outputs

This was originally introduced to make encoder sharing on radone easier for userspace, but:

- It is policy and as such belongs into userspace. E.g. personally I'm fairly annoyed that a flaky cable results in permanent changes of the desktop layout, so I'll kick out DEs which do this. Worse if the kernel also tries to be clever.

- It's inconsistent: We only kill disconnected outputs on setCrtc (which userspace might also call when just changing the framebuffer), but not when e.g. we receive a hpd event or in the output poll worker.

- It's unexpected behaviour for the userspace driver, at least in the intel ddx we've had tons of bugs where the driver fell over and killed the X session becuase pageflips/vblanks suddenly stopped working. We've had to fix this by wrapping every single setCrtc int a big "recover kms state from the kernel again" operation.

- It's suprising for the kernel, too: It took a few mails between Rob, Matt and me for them to notice that little dragon wreaking havoc with the universal plane framebuffer refcounting.

- Userspace can cope with it and e.g. Gnome already kills disconnected outputs and reconfigures the desktop automatically. And since there have been no regression reports for the i915 change from over 1 year ago I think all other DEs are also ready.

Note that the lines removed in this patch go back to

commit a3a0544b2c84e1d7a2022b558ecf66d8c6a8dd93

Author: Dave Airlie <[email protected]>
Date:   Mon Aug 31 15:16:30 2009 +1000

drm/kms: add explicit encoder disable function and detach harder.

Unfortunately the patch itself doesn't explain a hole lot about why it was added ...

Cc Matt Roper <[email protected]>
Cc Rob Clark <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Alex Deucher <[email protected]>
---
 drivers/gpu/drm/drm_crtc_helper.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/drm_crtc_helper.c +0 -2
index 8108db95e12b..003924025aa7 100644
@@ -289,8 +289,6 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev)
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
 		if (!connector->encoder)
 			continue;
-		if (connector->status == connector_status_disconnected)
-			connector->encoder = NULL;
 	}
 
 	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
Signature · 1 line
1.8.5.2