From patchwork Wed Oct 24 13:35:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1638831 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 17461DF2AB for ; Wed, 24 Oct 2012 14:44:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 19D37A086E for ; Wed, 24 Oct 2012 07:44:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id EFCB8A086B for ; Wed, 24 Oct 2012 07:44:10 -0700 (PDT) Received: by mail-wi0-f177.google.com with SMTP id hj13so436665wib.12 for ; Wed, 24 Oct 2012 07:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=mG4Zj+Or4ibtjJdJyjo+NUD2m/G8QfCPWd85kPNpEn8=; b=b8yatWkwdpVegZ+gQ6Rr6Yz+OOxqvUZyuqhoV6wpyGrKinbbIVnHl5VZPbhmkFxYZ3 8wQ5eNode41/d1UcVI62MDKc/SKeOMh9xseIhLLQyL4+hgvZYG58ABc3dSeZ0xntWl/B E1Q/aCi6M0saDo+X65Gj0qxzpnoPaOLe5j0vg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=mG4Zj+Or4ibtjJdJyjo+NUD2m/G8QfCPWd85kPNpEn8=; b=dylBoP3KDmUMpEk9QhbtHaj1TrGTfbwblCzQFk4scl/CmF1tBZLANIgBIuD0TqGDVS 4AEBqM4i+7NR655BnsMALKg8+SRzmQjNFvNY3A3teoyF2AiCBs22ILwiv7W3pQITje7Y Zaeb9dqKm9Hq6SBr0ER8tKW4Ki6YzFDLzHoK4u5rI6UHCI5t2/Bv9CXJrk42sShZPG9L aYd4SyGZMTczLpIVG/3WUw64xaOsjHqJyzOyuDqNYBGZ6H9I+sk8X7P1uAxykRwnbv57 Hru/atS6HJ3QmK3MarKhwHAb5moS1tZHQulcfhYENGmbpyS/L8lEdZF4e69vX/0KIdzt 4wMQ== Received: by 10.180.79.202 with SMTP id l10mr6486683wix.9.1351089850090; Wed, 24 Oct 2012 07:44:10 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id eq2sm5310025wib.1.2012.10.24.07.44.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Oct 2012 07:44:09 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH] drm: don't unnecessarily enable the polling work Date: Wed, 24 Oct 2012 15:35:50 +0200 Message-Id: <1351085750-31255-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1351016618-2752-7-git-send-email-daniel.vetter@ffwll.ch> References: <1351016618-2752-7-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQmxL6LaVAKpKAUcKd1oBpdZDpSeX2pk8ktcwcF2Y7G0Wr1kYF/ofdFFEWiH1fMFctnzy9c3 Cc: Daniel Vetter 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: , MIME-Version: 1.0 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 ... by properly checking connector->polled. This doesn't matter too much because the polling work itself gets this slightly more right and doesn't set repoll if there's nothing to do. But we can do better. v2: Chris Wilson noticed that I broke polling, since repoll will never ever be set true. Fix this up, and simplify the logic a bit while at it. Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/drm_crtc_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index bb94b6d..6f03afb 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -952,8 +952,7 @@ static void output_poll_execute(struct work_struct *work) if (!connector->polled || connector->polled == DRM_CONNECTOR_POLL_HPD) continue; - else if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT)) - repoll = true; + repoll = true; old_status = connector->status; /* if we are connected and don't want to poll for disconnect @@ -997,7 +996,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) return; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - if (connector->polled) + if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | + DRM_CONNECTOR_POLL_DISCONNECT)) poll = true; }