From patchwork Tue Oct 23 18:23:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1632221 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 99061DF283 for ; Tue, 23 Oct 2012 19:34:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D5939F761 for ; Tue, 23 Oct 2012 12:34:33 -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 2DD689F729 for ; Tue, 23 Oct 2012 12:32:00 -0700 (PDT) Received: by mail-wi0-f177.google.com with SMTP id hj13so3054541wib.12 for ; Tue, 23 Oct 2012 12:31:59 -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=rv1/4LmA7h8T26u1kg4rbqhl1QQ4miAOKurVIcZr0ZA=; b=Lw8EnmoxbEJg+RvlDqa4dlBv6/ONpzKHLkf+q4oEwdHsMimLVXYY3uvfNWN7DXl2hy YOacyKbgBmXy7aosXrrBafeK/62K/qss2bD8lOUnm3al8frDG7NdNoN1iftaoP76Hz1G 46jyPWaMtOeOPaXExZ1od+bJ/zAsNxEkBCYXE= 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=rv1/4LmA7h8T26u1kg4rbqhl1QQ4miAOKurVIcZr0ZA=; b=AK9pGTQvS+RuhyhEcpN/ROckO9wpVIVnSNQV7uE/dcLriktWwKBhkVE1uKN75VfDEF akHx82Tj39IvRCwuagtndbT9Qa8Kqzk69am19NRlXKKxjwZ3A1QgwadiWbFzQpEJOYoW MFCrhwJkkU8TtDcoalVVQCD0VlVf4zwlH2aKeaf2ojYtIEJs5OTiQkq6b/hfiRTSLi+W PluZHTuEt3U/Imhvoq8DSlm8KqVPW7Ej+ZSHTVPGbs7iTjfQ64jDf0xR2Cf11u44JofW cgxOCuzNSS5nNpsF9C0k9IcbsP8OyCS/A3/sdeqa5lZ6bTEFgPGNkoQg5Xw1zV/jrwLZ Ru8Q== Received: by 10.216.142.25 with SMTP id h25mr8537209wej.157.1351020719215; Tue, 23 Oct 2012 12:31:59 -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 di7sm312800wib.11.2012.10.23.12.31.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Oct 2012 12:31:58 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 3/7] drm: run the hpd irq event code directly Date: Tue, 23 Oct 2012 20:23:34 +0200 Message-Id: <1351016618-2752-4-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1351016618-2752-1-git-send-email-daniel.vetter@ffwll.ch> References: <1351016618-2752-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQkCd9/f2dbPISGHrfe0Tve8HDDspl1MLQxibUUMwbYeAKmeHgSbwdKulIo1IzSS2A6x6qEK 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 All drivers already have a work item to run the hpd code, so we don't need to launch a new one in the helper code. Dave Airlie mentioned that the cancel+re-queue might paper over DP related hpd ping-pongs, hence why this is split out. Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/drm_crtc_helper.c | 14 +------------- include/drm/drm_crtc.h | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 7342f61..654080b 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -1001,12 +1001,9 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) } EXPORT_SYMBOL(drm_kms_helper_poll_enable); -static void hpd_irq_event_execute(struct work_struct *work); - void drm_kms_helper_poll_init(struct drm_device *dev) { INIT_DELAYED_WORK(&dev->mode_config.output_poll_work, output_poll_execute); - INIT_DELAYED_WORK(&dev->mode_config.hpd_irq_work, hpd_irq_event_execute); dev->mode_config.poll_enabled = true; drm_kms_helper_poll_enable(dev); @@ -1019,10 +1016,8 @@ void drm_kms_helper_poll_fini(struct drm_device *dev) } EXPORT_SYMBOL(drm_kms_helper_poll_fini); -static void hpd_irq_event_execute(struct work_struct *work) +void drm_helper_hpd_irq_event(struct drm_device *dev) { - struct delayed_work *delayed_work = to_delayed_work(work); - struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.hpd_irq_work); struct drm_connector *connector; enum drm_connector_status old_status; bool changed = false; @@ -1053,11 +1048,4 @@ static void hpd_irq_event_execute(struct work_struct *work) if (changed) drm_kms_helper_hotplug_event(dev); } - -void drm_helper_hpd_irq_event(struct drm_device *dev) -{ - cancel_delayed_work(&dev->mode_config.hpd_irq_work); - if (drm_kms_helper_poll) - schedule_delayed_work(&dev->mode_config.hpd_irq_work, 0); -} EXPORT_SYMBOL(drm_helper_hpd_irq_event); diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 1052348..3fa18b7 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -793,7 +793,6 @@ struct drm_mode_config { /* output poll support */ bool poll_enabled; struct delayed_work output_poll_work; - struct delayed_work hpd_irq_work; /* pointers to standard properties */ struct list_head property_blob_list;