Skip to contentSkip to conversation

drm: Set connector DPMS status to ON in drm_crtc_helper_set_config

PATCH In review Keith Packard 3 participants 7 messages Nov 26, 2010 – Dec 8, 2010

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

PATCH 1/2 drm: Set connector DPMS status to ON in drm_crtc_helper_set_config

When setting a new crtc configuration, force the DPMS state of all connectors to ON. Otherwise, they'll be left at OFF and a future mode set that disables the specified connector will not turn the connector off.

---
 drivers/gpu/drm/drm_crtc_helper.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/gpu/drm/drm_crtc_helper.c +7 -0
index f7af91c..232ee93 100644
@@ -471,6 +471,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
 	int count = 0, ro, fail = 0;
 	struct drm_crtc_helper_funcs *crtc_funcs;
 	int ret = 0;
+	int i;
 
 	DRM_DEBUG_KMS("\n");
 
@@ -666,6 +667,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
 		if (ret != 0)
 			goto fail;
 	}
+	DRM_DEBUG_KMS("Setting connector DPMS state to on\n");
+	for (i = 0; i < set->num_connectors; i++) {
+		DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id,
+			      drm_get_connector_name(set->connectors[i]));
+		set->connectors[i]->dpms = DRM_MODE_DPMS_ON;
+	}
 
 	kfree(save_connectors);
 	kfree(save_encoders);
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 2/2 drm: record monitor status in output_poll_execute

In order to correctly report monitor connected status changes, the previous monitor status must be recorded in the connector->status value instead of being discarded.

---
 drivers/gpu/drm/drm_crtc_helper.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_crtc_helper.c +4 -3
index 232ee93..7ca5935 100644
@@ -848,7 +848,7 @@ static void output_poll_execute(struct work_struct *work)
 	struct delayed_work *delayed_work = to_delayed_work(work);
 	struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work);
 	struct drm_connector *connector;
-	enum drm_connector_status old_status, status;
+	enum drm_connector_status old_status;
 	bool repoll = false, changed = false;
 
 	if (!drm_kms_helper_poll)
@@ -873,8 +873,9 @@ static void output_poll_execute(struct work_struct *work)
 		    !(connector->polled & DRM_CONNECTOR_POLL_HPD))
 			continue;
 
-		status = connector->funcs->detect(connector, false);
-		if (old_status != status)
+		connector->status = connector->funcs->detect(connector, false);
+		DRM_DEBUG_KMS("connector status updated to %d\n", connector->status);
+		if (old_status != connector->status)
 			changed = true;
 	}
 
Signature · 1 line
1.7.2.3
#2 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm: record monitor status in output_poll_execute

Quoted 5 lines · On Fri, 26 Nov 2010 10:45:59 -0800 Keith Packard <[email protected]> wrote:

In order to correctly report monitor connected status changes, the previous monitor status must be recorded in the connector->status value instead of being discarded.

Keith, am I right to assume that these address
https://bugzilla.kernel.org/show_bug.cgi?id=22672
and probably:
https://bugzilla.kernel.org/show_bug.cgi?id=23472

Regards,
Flo

Quoted 29 lines
---
 drivers/gpu/drm/drm_crtc_helper.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_crtc_helper.c +4 -3
index 232ee93..7ca5935 100644
@@ -848,7 +848,7 @@ static void output_poll_execute(struct work_struct *work)
 	struct delayed_work *delayed_work = to_delayed_work(work);
 	struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work);
 	struct drm_connector *connector;
-	enum drm_connector_status old_status, status;
+	enum drm_connector_status old_status;
 	bool repoll = false, changed = false;
 
 	if (!drm_kms_helper_poll)
@@ -873,8 +873,9 @@ static void output_poll_execute(struct work_struct *work)
 		    !(connector->polled & DRM_CONNECTOR_POLL_HPD))
 			continue;
 
-		status = connector->funcs->detect(connector, false);
-		if (old_status != status)
+		connector->status = connector->funcs->detect(connector, false);
+		DRM_DEBUG_KMS("connector status updated to %d\n", connector->status);
+		if (old_status != connector->status)
 			changed = true;
 	}
 
#3 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm: record monitor status in output_poll_execute

Quoted 7 lines · Florian Mickler
Quoted 4 lines · On Fri, 26 Nov 2010 10:45:59 -0800 Keith Packard <[email protected]> wrote:

In order to correctly report monitor connected status changes, the previous monitor status must be recorded in the connector->status value instead of being discarded.

Quoted 6 lines
Quoted 1 line

Keith, am I right to assume that these address
https://bugzilla.kernel.org/show_bug.cgi?id=22672
and probably:
https://bugzilla.kernel.org/show_bug.cgi?id=23472

Yes, this is part of the patch for that. The other piece is in the 2D driver which has a matching bug. That patch is already on master.

Signature · 1 line
[email protected]
#4 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm: record monitor status in output_poll_execute

Quoted 10 lines · On Sun, 05 Dec 2010 13:08:18 -0800 Keith Packard <[email protected]> wrote:
Quoted 9 lines · Florian Mickler
Quoted 5 lines · On Fri, 26 Nov 2010 10:45:59 -0800 Keith Packard <[email protected]> wrote:

In order to correctly report monitor connected status changes, the previous monitor status must be recorded in the connector->status value instead of being discarded.

Quoted 8 lines
Quoted 4 lines

Keith, am I right to assume that these address
https://bugzilla.kernel.org/show_bug.cgi?id=22672
and probably:
https://bugzilla.kernel.org/show_bug.cgi?id=23472

Yes, this is part of the patch for that. The other piece is in the 2D driver which has a matching bug. That patch is already on master.

Does that mean that the kernel regression will not be fixed/worked-around for old userspace?

Regards,
Flo

#5 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm: record monitor status in output_poll_execute

Quoted 2 lines · Florian Mickler

Does that mean that the kernel regression will not be fixed/worked-around for old userspace?

I think there is some confusion in that I believe there is more than one backlight bug at play here.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#6 lore raw

Re: [Intel-gfx] [PATCH 2/2] drm: record monitor status in output_poll_execute

Quoted 6 lines · Chris Wilson
Quoted 2 lines · Florian Mickler

Does that mean that the kernel regression will not be fixed/worked-around for old userspace?

I think there is some confusion in that I believe there is more than one backlight bug at play here.

The kernel and user space fixes addressed the same technical problem (failing to note that mode setting turned on the devices), but the symptoms that this caused were different; in kernel mode, the result would be that monitors would be left turned on when user space asked that they be turned off (and left pointing at random memory too, which was amusing). I think that the backlight issue was caused by the user-space bug though.

Signature · 1 line
[email protected]