From patchwork Fri Oct 18 14:11:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 3068071 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D39FFBF924 for ; Fri, 18 Oct 2013 14:48:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3687520513 for ; Fri, 18 Oct 2013 14:47:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9BE7C2050E for ; Fri, 18 Oct 2013 14:47:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 740EAE6D09 for ; Fri, 18 Oct 2013 07:47:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f174.google.com (mail-ea0-f174.google.com [209.85.215.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 12779E612D for ; Fri, 18 Oct 2013 07:11:59 -0700 (PDT) Received: by mail-ea0-f174.google.com with SMTP id z15so1989947ead.19 for ; Fri, 18 Oct 2013 07:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=5mB8CpYCKwXA++pT4kZHCEQ8LyA6FzDiNBkmEWKcS+0=; b=wSqZlgvqxrZkhrAvr6gl6Mf1HOXBkboE0MeRMUl2GSFFtu6Z58nBd+I7ePxTYagPoK k4IFBKBHFwkcMrvcr9EOH7cFg5AcHu7/+1d9PmsUmzmNVDI7VoeTn9mw4j+XxX42d2Xm E3siDq96Zsu6uTHIdGXnH7fVnFz9SqnqqIOZDl6uDcheWOI1GIsCmlow2lkuz72GPTWq WWamV3xE+2pP4vKqeQ7vwEySiqMf9S41+ErAfEqjG1qDNUEZDifUuSlZcWdfBD5dc3hG rUba/MPcvATlG8Xn0JEmnrwLz7g1uP37Jt0XXZk9Mvo7HuuC2eC9zs+/T2dzsuV1G4G/ W1Dg== X-Received: by 10.14.219.198 with SMTP id m46mr4721947eep.41.1382105519174; Fri, 18 Oct 2013 07:11:59 -0700 (PDT) Received: from localhost (122.Red-83-45-5.dynamicIP.rima-tde.net. [83.45.5.122]) by mx.google.com with ESMTPSA id k7sm4940302eeg.13.2013.10.18.07.11.57 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2013 07:11:58 -0700 (PDT) From: "=?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=" To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/7] drm: return if changed in drm_helper_hpd_irq_event() Date: Fri, 18 Oct 2013 16:11:28 +0200 Message-Id: <1382105493-2152-2-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1382105493-2152-1-git-send-email-marcandre.lureau@redhat.com> References: <1382105493-2152-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Cc: airlied@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The caller may want to know whether the configuration was changed, and if an hotplug event was sent. Signed-off-by: Marc-André Lureau --- drivers/gpu/drm/drm_crtc_helper.c | 6 ++++-- include/drm/drm_crtc_helper.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 6a64749..8712bdc 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -1074,14 +1074,14 @@ void drm_kms_helper_poll_fini(struct drm_device *dev) } EXPORT_SYMBOL(drm_kms_helper_poll_fini); -void drm_helper_hpd_irq_event(struct drm_device *dev) +bool drm_helper_hpd_irq_event(struct drm_device *dev) { struct drm_connector *connector; enum drm_connector_status old_status; bool changed = false; if (!dev->mode_config.poll_enabled) - return; + return false; mutex_lock(&dev->mode_config.mutex); list_for_each_entry(connector, &dev->mode_config.connector_list, head) { @@ -1106,5 +1106,7 @@ void drm_helper_hpd_irq_event(struct drm_device *dev) if (changed) drm_kms_helper_hotplug_event(dev); + + return changed; } EXPORT_SYMBOL(drm_helper_hpd_irq_event); diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index f43d556..ef6ad3a 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h @@ -163,7 +163,7 @@ static inline void drm_connector_helper_add(struct drm_connector *connector, extern int drm_helper_resume_force_mode(struct drm_device *dev); extern void drm_kms_helper_poll_init(struct drm_device *dev); extern void drm_kms_helper_poll_fini(struct drm_device *dev); -extern void drm_helper_hpd_irq_event(struct drm_device *dev); +extern bool drm_helper_hpd_irq_event(struct drm_device *dev); extern void drm_kms_helper_hotplug_event(struct drm_device *dev); extern void drm_kms_helper_poll_disable(struct drm_device *dev);