From patchwork Wed Mar 29 14:43:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 9651753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B107602BE for ; Wed, 29 Mar 2017 14:45:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EFF4205FC for ; Wed, 29 Mar 2017 14:45:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83DD1284D0; Wed, 29 Mar 2017 14:45:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0AF73205FC for ; Wed, 29 Mar 2017 14:45:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34BF36E784; Wed, 29 Mar 2017 14:44:27 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6051C6E764; Wed, 29 Mar 2017 14:44:14 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id p52so3624109wrc.2; Wed, 29 Mar 2017 07:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8+FXM7qrq1M3gNatUG7h6oGyWWRKjg5m9qH7oCIAtlU=; b=tjUYcLEA0aIosCGK997BJCqdPWQmJjS3qM1xYksbzLF/IYDFJZoIRa0KcgfmF9BScP UBaqhlXwXpcPOXy5fAhOTxeEqV373M5phdB/SaEYTos3GgzpnphRkyrsxghnhUFFaGWr 88CMzOPxTWrSgm1c6d5XGK7oZr+lTyHJTcMhnWaWmuviTCTPG8cLzJ5THNFSEbLQwrsX 0fl8J6qrvmlkg+/crcvXfNXcg796wIGWc8vblvBl2kNjzLJuRqwLWHXisos9qOvSsaOh ih7Gn8DYHIZx+wjtsDQctSjMwIcsDHBvtnmX9DXsljKZq4A8n9ViFGQBDD0Ldn82xkoK jfJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8+FXM7qrq1M3gNatUG7h6oGyWWRKjg5m9qH7oCIAtlU=; b=FP1whb7vkWCX7XsGJ+0SWkBXng7flw42jfdMc7sUMGNMnnEKwk3tCmTVuHNHkDkctm f3IwxekBb4QaHyhiuYh80ae9pM5pQaJgf4qy6zdqdRuDW5FVv10VIfCFjWbOim+9fYZr BprNRUIFO1PxWWU3oQpx8GkrU+rs9VKi4SgTb+Qbt3RxXBa4ooAlyWrBeVSPMUTsnxXr QIHaOVFfNJNyzUd86CCoKu+GkehVm3N+GF9oVb1I8KcQr9MnibEhANuxOl+Bp3E6YsDT ZfPtkk5XF+CEO9i05IVSMQTw1rSBjjFQLTjSpzfqwjS+cA9AK8y5NjEs9iX93WnB5n5G VIjg== X-Gm-Message-State: AFeK/H1ATPRF0mCjB4WD3kc4dR4n4/RgopvLQT0gL99OVQzps47WMfKF+8SD8Ra/A0Fnug== X-Received: by 10.223.171.210 with SMTP id s76mr876560wrc.102.1490798652722; Wed, 29 Mar 2017 07:44:12 -0700 (PDT) Received: from localhost (port-5852.pppoe.wtnet.de. [84.46.22.242]) by smtp.gmail.com with ESMTPSA id z40sm9703140wrz.67.2017.03.29.07.44.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Mar 2017 07:44:12 -0700 (PDT) From: Thierry Reding To: Daniel Vetter Date: Wed, 29 Mar 2017 16:43:58 +0200 Message-Id: <20170329144401.1804-9-thierry.reding@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170329144401.1804-1-thierry.reding@gmail.com> References: <20170329144401.1804-1-thierry.reding@gmail.com> Cc: John Stultz , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH v4 08/11] drm/exynos: Remove custom FB helper deferred setup X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding The FB helper core now supports deferred setup, so the driver's custom implementation can be removed. Signed-off-by: Thierry Reding Reviewed-by: Daniel Vetter --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 6 ++++-- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 23 ----------------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 09d3c4c3c858..08f9533ddbe8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -399,8 +399,9 @@ static int exynos_drm_bind(struct device *dev) /* init kms poll for handling hpd */ drm_kms_helper_poll_init(drm); - /* force connectors detection */ - drm_helper_hpd_irq_event(drm); + ret = exynos_drm_fbdev_init(drm); + if (ret) + goto err_cleanup_poll; /* register the DRM device */ ret = drm_dev_register(drm, 0); @@ -411,6 +412,7 @@ static int exynos_drm_bind(struct device *dev) err_cleanup_fbdev: exynos_drm_fbdev_fini(drm); +err_cleanup_poll: drm_kms_helper_poll_fini(drm); exynos_drm_device_subdrv_remove(drm); err_cleanup_vblank: diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 641531243e04..e64a1041dd29 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -183,24 +183,6 @@ static const struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = { .fb_probe = exynos_drm_fbdev_create, }; -static bool exynos_drm_fbdev_is_anything_connected(struct drm_device *dev) -{ - struct drm_connector *connector; - bool ret = false; - - mutex_lock(&dev->mode_config.mutex); - list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - if (connector->status != connector_status_connected) - continue; - - ret = true; - break; - } - mutex_unlock(&dev->mode_config.mutex); - - return ret; -} - int exynos_drm_fbdev_init(struct drm_device *dev) { struct exynos_drm_fbdev *fbdev; @@ -211,9 +193,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev) if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector) return 0; - if (!exynos_drm_fbdev_is_anything_connected(dev)) - return 0; - fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); if (!fbdev) return -ENOMEM; @@ -306,6 +285,4 @@ void exynos_drm_output_poll_changed(struct drm_device *dev) if (fb_helper) drm_fb_helper_hotplug_event(fb_helper); - else - exynos_drm_fbdev_init(dev); }