From patchwork Wed Mar 29 14:43:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 9651743 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 5EB24602BE for ; Wed, 29 Mar 2017 14:44:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53F32284D0 for ; Wed, 29 Mar 2017 14:44:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48D50284D4; Wed, 29 Mar 2017 14:44:50 +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 DD303284D0 for ; Wed, 29 Mar 2017 14:44:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1376D6E771; Wed, 29 Mar 2017 14:44:24 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BA9C6E764; Wed, 29 Mar 2017 14:44:15 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id w43so3621363wrb.1; Wed, 29 Mar 2017 07:44:15 -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=WSj+wdUn146zftMOimv78pk6zr5C4AdEszQj+PojvWw=; b=EA9ZTRv/a0w7g3R4QuaDoFzE9S6KyTlKbp9GpWqEt1RzQPDf6miE/H2BNRI5ZrP27M 9TswzelcSZNNJVU6bMaU/8k4Ni84tMmLjTQO1kOW/LrZeBAYWGqEFAbkmyx1k62CrhpJ EJcHtIilOVrUMV9xHIzyXI5fbGbmuXti0grL60/cJsJsD8mRs8Skx3NOv1IE3ro0mX8A l4Enh6XuZyKZZhofJH3qjYOURMvYPbBDJSd4SaRUgOvGhIL7iLRP81FK9jOfZ4KOPucc v+T1V45EUhnZ3b5lFdBeoXI7/p5hOEitHyOxfGf2aiybBwvRQZqQ49zF9uWPkb8rXIm1 G7QQ== 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=WSj+wdUn146zftMOimv78pk6zr5C4AdEszQj+PojvWw=; b=KlveJXhFGJ9JQQ8HVlu7k5vG50n8BVDLaE1t65NPRL0bzZ9NwNldtOrHAhR5vk841o NwExtoZTaTqA6JjEvRr1wfc3rl3gn7GnUOiH/RhcZWN36nA3fF9jC14wU5HTYfhFyKx6 u4AhYixjkahkwgwiSKbr6ZbPitro/4XgflMaMRPat1aIl5RbyUNuPiMsp+tg8C9UB0Md HLF5CUqATanzCMZ535TU9bwyhofmX0aIeax2w1VtLClVWDAbDB27arBDpQxNod6Kh09y NQ2lFymVHlvVIZtQ8Ksefy9Dx1uZlZrpfwnrV5lN5/2OEqsamtiThR99YIO6lzUwBRYL zIvA== X-Gm-Message-State: AFeK/H1w1zUNgVNu+uSDC2XNl4S8Kt//i5BmN1wyNvCsB5K3FqTzrD2gKGU9C0EEXvW4gw== X-Received: by 10.223.141.235 with SMTP id o98mr832744wrb.110.1490798654077; Wed, 29 Mar 2017 07:44:14 -0700 (PDT) Received: from localhost (port-5852.pppoe.wtnet.de. [84.46.22.242]) by smtp.gmail.com with ESMTPSA id c17sm9619546wre.30.2017.03.29.07.44.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Mar 2017 07:44:13 -0700 (PDT) From: Thierry Reding To: Daniel Vetter Date: Wed, 29 Mar 2017 16:43:59 +0200 Message-Id: <20170329144401.1804-10-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 09/11] 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. Reviewed-by: Daniel Vetter 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: