mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm: ignore disconnected <-> unknown status changes
@ 2012-08-02  7:21 Knut Petersen
  2012-08-03 13:32 ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Knut Petersen @ 2012-08-02  7:21 UTC (permalink / raw)
  To: David Airlie; +Cc: dri-devel, linux-kernel, Chris Wilson

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

On an AOpen i915GMm-hfs the hotplug events generated
by transitions between connector_status_unknown and
connector_status_disconnected cause screen distortions.

The attached patch cures the problem by disabling the
generation of hotplug events in those cases. That should
be safe for everybody as the only relevant changes are
those from / to connector_status_connected.

cu,
  Knut

[-- Attachment #2: 0001-drm-ignore-disconnected-unknown-status-changes.patch --]
[-- Type: text/x-patch, Size: 1539 bytes --]

>From f631128c46f916eb58bbdabf867248a04a0d2fc5 Mon Sep 17 00:00:00 2001
From: Knut Petersen <Knut_Petersen@t-online.de>
Date: Thu, 2 Aug 2012 08:52:04 +0200
Subject: [PATCH] drm: ignore disconnected <-> unknown status changes

Only generate a hotplug event if the status changed
to / from connector_status_connected.

On some hardware the connector status is oscillating
between disconnected and unknown, and the hotplug
events mirroring these transitions cause screen
distortions. As the only reasonable action on such
a status change is to ignore it, it also is safe
not to genereate a hotplug event at all.

Needed for / tested on AOpen i915GMm-hfs mobo.

Signed-off-by: Knut Petersen <Knut_Petersen@t-online.de>
---
 drivers/gpu/drm/drm_crtc_helper.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 3252e70..fb6160b 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -954,7 +954,11 @@ static void output_poll_execute(struct work_struct *work)
 			      connector->base.id,
 			      drm_get_connector_name(connector),
 			      old_status, connector->status);
-		if (old_status != connector->status)
+		/* changes are only relevant if previous or
+		    current status is connector_status_connected */
+		if (old_status != connector->status &&
+		    (old_status == connector_status_connected ||
+		    connector->status == connector_status_connected))
 			changed = true;
 	}
 
-- 
1.7.7


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: ignore disconnected <-> unknown status changes
  2012-08-02  7:21 [PATCH] drm: ignore disconnected <-> unknown status changes Knut Petersen
@ 2012-08-03 13:32 ` Alex Deucher
  2012-08-05 21:06   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2012-08-03 13:32 UTC (permalink / raw)
  To: Knut Petersen; +Cc: David Airlie, linux-kernel, dri-devel

On Thu, Aug 2, 2012 at 3:21 AM, Knut Petersen <Knut_Petersen@t-online.de> wrote:
> On an AOpen i915GMm-hfs the hotplug events generated
> by transitions between connector_status_unknown and
> connector_status_disconnected cause screen distortions.
>
> The attached patch cures the problem by disabling the
> generation of hotplug events in those cases. That should
> be safe for everybody as the only relevant changes are
> those from / to connector_status_connected.

Seems reasonable to me.  We should just drop unknown.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

>
> cu,
>  Knut
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: ignore disconnected <-> unknown status changes
  2012-08-03 13:32 ` Alex Deucher
@ 2012-08-05 21:06   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-08-05 21:06 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Knut Petersen, linux-kernel, dri-devel

On Fri, Aug 03, 2012 at 09:32:44AM -0400, Alex Deucher wrote:
> On Thu, Aug 2, 2012 at 3:21 AM, Knut Petersen <Knut_Petersen@t-online.de> wrote:
> > On an AOpen i915GMm-hfs the hotplug events generated
> > by transitions between connector_status_unknown and
> > connector_status_disconnected cause screen distortions.
> >
> > The attached patch cures the problem by disabling the
> > generation of hotplug events in those cases. That should
> > be safe for everybody as the only relevant changes are
> > those from / to connector_status_connected.
> 
> Seems reasonable to me.  We should just drop unknown.

We (ab)use that in i915 to avoid some (more costly) load-detection tricks
in the hotplug code (but only on rather ancient hw), instead returning
unknown. When userspace then inquires the connector status, we flip-flop
back to connected. The issue is that we need to avoid these, for the
current kms locking would stall the cursor for a while, which is not
acceptable to do every 10s. Until the kms locking is fixed, we hence can't
drop the unknown state.

> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-05 21:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-02  7:21 [PATCH] drm: ignore disconnected <-> unknown status changes Knut Petersen
2012-08-03 13:32 ` Alex Deucher
2012-08-05 21:06   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome