From patchwork Thu Aug 2 07:21:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Knut Petersen X-Patchwork-Id: 1268251 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id DE8FF3FC71 for ; Thu, 2 Aug 2012 22:59:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE8E79E98A for ; Thu, 2 Aug 2012 15:59:49 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 907 seconds by postgrey-1.32 at gabe; Thu, 02 Aug 2012 09:36:32 CEST Received: from mailout10.t-online.de (mailout10.t-online.de [194.25.134.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 871FBA098B for ; Thu, 2 Aug 2012 00:36:32 -0700 (PDT) Received: from fwd25.aul.t-online.de (fwd25.aul.t-online.de ) by mailout10.t-online.de with smtp id 1Swpil-0000to-3K; Thu, 02 Aug 2012 09:21:23 +0200 Received: from [84.171.48.65] (EXXWR-Z-ghfyJrw7WJGr6QexvVZOpDawtt+kIVgghe8AJ2ngOGxjISXNf85w48cQ2p@[84.171.48.65]) by fwd25.t-online.de with esmtp id 1Swpii-28a2zI0; Thu, 2 Aug 2012 09:21:20 +0200 Message-ID: <501A2A6F.4030502@t-online.de> Date: Thu, 02 Aug 2012 09:21:19 +0200 From: Knut Petersen User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: David Airlie Subject: [PATCH] drm: ignore disconnected <-> unknown status changes X-ID: EXXWR-Z-ghfyJrw7WJGr6QexvVZOpDawtt+kIVgghe8AJ2ngOGxjISXNf85w48cQ2p X-TOI-MSGID: 952ebd05-d27a-4f1c-b720-c9a97f5b3c44 X-Mailman-Approved-At: Thu, 02 Aug 2012 15:58:41 -0700 Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org 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 Reviewed-by: Alex Deucher Reviewed-by: Daniel Vetter From f631128c46f916eb58bbdabf867248a04a0d2fc5 Mon Sep 17 00:00:00 2001 From: Knut Petersen 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 --- 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