From patchwork Tue Oct 23 18:23:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1632201 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 7DB733FD4E for ; Tue, 23 Oct 2012 19:33:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A3549F757 for ; Tue, 23 Oct 2012 12:33:04 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 672719F69F for ; Tue, 23 Oct 2012 12:31:58 -0700 (PDT) Received: by mail-we0-f177.google.com with SMTP id u50so2216082wey.36 for ; Tue, 23 Oct 2012 12:31:57 -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=s5wbA0IfFBUlChatnVVtJUlO460QViQLtE/jP/qoSMk=; b=Fw3lefO7epsiIhXmTL2yWkKOCD1GmgmlKQP+Mv24ExtmDlfc49ThVuyNllID6xGziX tBCbbMy97IS+yiZcQ/FHg2JWiNCj63uzoThrblxjHtlV80fu3DS7V/3Hzw53dapx/zmI r5joVvnfGB2HK6445tVep811Gy68gjTWaoom4= 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=s5wbA0IfFBUlChatnVVtJUlO460QViQLtE/jP/qoSMk=; b=Rccn+XA0niK7KVUBBRmlYRIHQqcXEQPrw2WRME8i2guaIhnc99nPvG9S2HKqaJUvTC hMJ24tQ8Eq/sY7YE+qZbT7/huXm8QE8NK8Y+8F4f9MwSMaymlLEPoOzs2Y1rw/1RZZbO Pt83+EjJQo9SZdNfV9/2Z3OwyAtVzFcFlhTFabTfzsMeCtP9Mm0WJQrPOUYodatrMpye byaGMSytP2gFvv42Phz5uG+uNFL4tbY/8bZV7LY5xWmg4cyviQ82Epsh4l36QevUXYOg mnoY1b9HV5e3S+OSwpq7wirJToLtffBwOgkIaedI1pnUCOGXM8k/5gu/9nuPXNO9A8oC qEJA== Received: by 10.216.197.133 with SMTP id t5mr7446331wen.176.1351020717573; Tue, 23 Oct 2012 12:31:57 -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.56 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Oct 2012 12:31:56 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 1/7] drm: extract drm_kms_helper_hotplug_event Date: Tue, 23 Oct 2012 20:23:32 +0200 Message-Id: <1351016618-2752-2-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: ALoCoQkqMW2bItm9KZvUHo5Oan4jaBY7FWfHB+5YW8qB8lHzAUiwOx+kkOwVU5OK+2zKjwnKMHQa 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 Useful if drivers want to be slightly more clever about hotplug handling. Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/drm_crtc_helper.c | 17 +++++++++++------ include/drm/drm_crtc_helper.h | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 1227adf..accfd3b 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -918,6 +918,15 @@ int drm_helper_resume_force_mode(struct drm_device *dev) } EXPORT_SYMBOL(drm_helper_resume_force_mode); +void drm_kms_helper_hotplug_event(struct drm_device *dev) +{ + /* send a uevent + call fbdev */ + drm_sysfs_hotplug_event(dev); + if (dev->mode_config.funcs->output_poll_changed) + dev->mode_config.funcs->output_poll_changed(dev); +} +EXPORT_SYMBOL(drm_kms_helper_hotplug_event); + #define DRM_OUTPUT_POLL_PERIOD (10*HZ) static void output_poll_execute(struct work_struct *work) { @@ -960,12 +969,8 @@ static void output_poll_execute(struct work_struct *work) mutex_unlock(&dev->mode_config.mutex); - if (changed) { - /* send a uevent + call fbdev */ - drm_sysfs_hotplug_event(dev); - if (dev->mode_config.funcs->output_poll_changed) - dev->mode_config.funcs->output_poll_changed(dev); - } + if (changed) + drm_kms_helper_hotplug_event(dev); if (repoll) schedule_delayed_work(delayed_work, DRM_OUTPUT_POLL_PERIOD); diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index e01cc80..8f2842c 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h @@ -162,6 +162,7 @@ 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 void drm_kms_helper_hotplug_event(struct drm_device *dev); extern void drm_kms_helper_poll_disable(struct drm_device *dev); extern void drm_kms_helper_poll_enable(struct drm_device *dev);