From patchwork Wed Jun 28 09:08:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9813787 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 D51AD603D7 for ; Wed, 28 Jun 2017 09:08:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C431726E98 for ; Wed, 28 Jun 2017 09:08:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4D1627968; Wed, 28 Jun 2017 09:08:34 +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_SIGNED, 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 23EF526E98 for ; Wed, 28 Jun 2017 09:08:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 33E5E6E109; Wed, 28 Jun 2017 09:08:33 +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 2F6726E109 for ; Wed, 28 Jun 2017 09:08:31 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id j85so10235472wmj.0 for ; Wed, 28 Jun 2017 02:08:31 -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:in-reply-to:references; bh=WpbXpNauLBSlbb4mpyXMw/F1GFqpSqB9WOnJxHFSV50=; b=cx+1sRKaXvkvhUE8Fbs60F7vvyOHSyygP4q5Okqm7Rq8GqBlGTLM8kw0uBmglPB1K8 Fjp7hofgC7Y0i41DE/GOpgOmaxQ8Thct9ei+ajR8rdGi+6sCAPhhmmCV3Uz5fEx9Fbgo fEuQCUD1oHsSZTXL7zV/+lOb92jxp4US4z1aY= 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=WpbXpNauLBSlbb4mpyXMw/F1GFqpSqB9WOnJxHFSV50=; b=Y2D3CM8pI3J1MnX6pgDFJcHkqO3jr41ekkkfmCY61RFJ4KOsTCed6XSCOVr20G8wyX 5LC4LDvlXe21IvwkUYXYzonR+mAhrLEPmXzkKz5oUnl9lltToO04OJ+88nk6u3SAtf20 Tp8KvkLvG8q+q0O1e/TuM62ulk0RblgUyZTXRFARRhva4I5cbKsJjcg7FRklbmgJI7nl sE4panWJf4kyAcm/Fh9tvf9yx4T8XQrvq+a+KnPZ4uRM7z/S7W6jNVs+YYdZlU369QaY bi3Q8npNDxBDH2Kb5b/JFEMm0zzjpPAR6qtb4yLuJrBK3YEi69r6Sfa/GtenSGSuGg8P S/vg== X-Gm-Message-State: AKS2vOwGiJNcHvhTFKgolnUZmAxEijaWBXg07lwTJUbnGp+wh3bsxUQ4 YBqpY0n3Vz+njDWtrLM= X-Received: by 10.80.138.218 with SMTP id k26mr6890443edk.133.1498640909857; Wed, 28 Jun 2017 02:08:29 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5640:0:960b:2678:e223:c1c6]) by smtp.gmail.com with ESMTPSA id g24sm709797edh.20.2017.06.28.02.08.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 02:08:29 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Wed, 28 Jun 2017 11:08:24 +0200 Message-Id: <20170628090824.13830-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170627145936.18983-13-daniel.vetter@ffwll.ch> References: <20170627145936.18983-13-daniel.vetter@ffwll.ch> Cc: Chen Feng , Intel Graphics Development , Xinliang Liu , Xinwei Kong , Daniel Vetter , Rongrong Zou , Thierry Reding Subject: [Intel-gfx] [PATCH] 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. v2: Dont' resurrect drm_vblank_cleanup. Cc: Xinliang Liu Cc: Rongrong Zou Cc: Xinwei Kong Cc: Chen Feng Reviewed-by: Daniel Vetter Signed-off-by: Thierry Reding (v1) Signed-off-by: Daniel Vetter --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++---------- 1 file changed, 10 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 8065d6cb1d7f..1178341c3858 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -54,14 +54,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 @@ -128,11 +121,18 @@ 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); err_unbind_all: component_unbind_all(dev->dev, dev); err_dc_cleanup: