From patchwork Tue Mar 21 08:13:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 9636189 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 C4584602CC for ; Tue, 21 Mar 2017 08:14:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B412C1FF8F for ; Tue, 21 Mar 2017 08:14:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A920427D29; Tue, 21 Mar 2017 08:14:56 +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=unavailable 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 4E33627F10 for ; Tue, 21 Mar 2017 08:14:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A28D6E305; Tue, 21 Mar 2017 08:14:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4E1D76E266; Tue, 21 Mar 2017 08:14:11 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id z133so1490099wmb.2; Tue, 21 Mar 2017 01:14:11 -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=WE205aqvswhr0dBeI0RUjy2Os1CQ/bncjm+c5ACjn5U=; b=Xoxb8ojjnSCWUKjYjvaWxqSJfm0EcX0y1mqwLV0hNL3YJ0bilBkc9M1ON1LLxZ4Rqi 3aqc70wy48qRGfqrT98qlSXCZlIq7iTqwz8JmQAHaVJDNcvnaxfz5L6K8FT6akHdqybl UodZtgDDeCLXKaPXS58c5fWKoBaarg1zPyyZ7elm6CNEtJvhdpZgzYquWzCxjHqzcHcD 8MPKJt4GQhTGOPs8tolbFzr6ebCC2YRBw6gDWDPP1fIXMiCOQZS5dLJNgAfYmts1JhGI 4zyWFyXLoxc05xrp6vIi7v8Aguki66m+UgKzVioc3KFLtu+daRbXvM6mNbUVGDvTEkNQ PfvA== 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=WE205aqvswhr0dBeI0RUjy2Os1CQ/bncjm+c5ACjn5U=; b=eesgfSI5dR8Ye+xurvagMn50NoHLqYXj1r8gETjnukRkcUTHkE98qEYUqh2yD2dtVn BZL0o84xjgmCuT8JPQpDGZO+J0ERrhZtLHlXpOsunPUWXlhDwQ+eusF9AS9y+j78DhVu VC0RZQxRfb5NQyIAPxpN0NvcysQRzBWhRPggjdH8Kdvo+ewSCa3jBYVgEnco7w6mx/6h 9x0cw5ooZamDnNR3deAHn2hAMGFlWfy6m8YVYaS3tn+5aALR+RbTWTVL5ICFel6NPXbq bp86yWl7S3FZR2htGnwbNUJlBQWYhboex61l/I8rFjwGx2gTZ+5z4wKOs05yY6LeTaHw PeKQ== X-Gm-Message-State: AFeK/H1oE4l5Lp6ElGtcjCgz6jnSLYHeclYpmf419dhu4KZyENGTryzahHnV+QJbj/yJbQ== X-Received: by 10.28.48.67 with SMTP id w64mr1523379wmw.125.1490084049913; Tue, 21 Mar 2017 01:14:09 -0700 (PDT) Received: from localhost (port-52488.pppoe.wtnet.de. [46.59.205.174]) by smtp.gmail.com with ESMTPSA id 10sm10046060wrz.44.2017.03.21.01.14.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Mar 2017 01:14:09 -0700 (PDT) From: Thierry Reding To: Daniel Vetter Date: Tue, 21 Mar 2017 09:13:56 +0100 Message-Id: <20170321081358.27237-9-thierry.reding@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170321081358.27237-1-thierry.reding@gmail.com> References: <20170321081358.27237-1-thierry.reding@gmail.com> Cc: John Stultz , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH v3 08/10] drm/hisilicon: 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 --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index df4f50713e54..408c7cfc180c 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -55,14 +55,7 @@ static void kirin_fbdev_output_poll_changed(struct drm_device *dev) { struct kirin_drm_private *priv = dev->dev_private; - if (priv->fbdev) { - drm_fbdev_cma_hotplug_event(priv->fbdev); - } else { - priv->fbdev = drm_fbdev_cma_init(dev, 32, - dev->mode_config.num_connector); - if (IS_ERR(priv->fbdev)) - priv->fbdev = NULL; - } + drm_fbdev_cma_hotplug_event(priv->fbdev); } #endif @@ -129,11 +122,19 @@ static int kirin_drm_kms_init(struct drm_device *dev) /* init kms poll for handling hpd */ drm_kms_helper_poll_init(dev); - /* force detection after connectors init */ - (void)drm_helper_hpd_irq_event(dev); + priv->fbdev = drm_fbdev_cma_init(dev, 32, + dev->mode_config.num_connector); + if (IS_ERR(priv->fbdev)) { + DRM_ERROR("failed to initialize fbdev.\n"); + ret = PTR_ERR(priv->fbdev); + goto err_cleanup_poll; + } return 0; +err_cleanup_poll: + drm_kms_helper_poll_fini(dev); + drm_vblank_cleanup(dev); err_unbind_all: component_unbind_all(dev->dev, dev); err_dc_cleanup: