From patchwork Thu Sep 7 21:19:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9942867 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 0D63E604D5 for ; Thu, 7 Sep 2017 21:19:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 044B6237A5 for ; Thu, 7 Sep 2017 21:19:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBA9625223; Thu, 7 Sep 2017 21:19: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_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 C201424B5B for ; Thu, 7 Sep 2017 21:19:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C3356E220; Thu, 7 Sep 2017 21:19:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id 60ADF6E220 for ; Thu, 7 Sep 2017 21:19:46 +0000 (UTC) Received: by mail-lf0-x236.google.com with SMTP id m199so1786148lfe.3 for ; Thu, 07 Sep 2017 14:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=K0YD1qqnoLTCxGc8tVwomq7bmXjbqrR8RFXzYaX7mmc=; b=iMu03HJ/sKBE+UDqhZiP8LY/RoBhzIntQl+bq7UovHKGKbt27JdNEwnVB/0orStN8N 97iN52T679NqFSzulwDkDcIcV3qH9wh7WVHguxc6cKdaEP2/0lMRLEUHYrhPe3qDD/2w jZRLiQ/ulcNNxXEgpf4EBqNpiSwLToYnZyDpA= 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; bh=K0YD1qqnoLTCxGc8tVwomq7bmXjbqrR8RFXzYaX7mmc=; b=VXhDc68IhbW5uC0UyrLmTNxXUsU4HsodfIkS+BvJKM+FqilcRDzJPJnwRrKiTJrOO3 eGMombl4loQ2k0+gGM/9dJANNzVcKzqkH7WScMZvH93emzEpMr0GqkGkhrcOun0cb0xR vUAzZNO9QxmtdDcWuWugdx15wKd3sRkDSgvoDrLL/f+kLy80gZyg9+v8fkDtXTt0Gje9 /aOWcuny5yXQH7/+cZU2dW7Q1V6c8w8vT/iFvbXuUFXZcklD+qItWrwbOLDkwXMr1fH7 QK8mSkcYjmmY9tH/S2MEA78b/WsSArnGFY3PfN0vG44ByAsN8W72XI229wPJu0lDf2s2 9ZCg== X-Gm-Message-State: AHPjjUg0hQ2Mjoo9Td/tcyMFzRzIejX2xaAxvKrnWjYGC1S1fpcF2Zm7 t2YRX7d0gyMbgFNQ6x0HuQ== X-Google-Smtp-Source: AOwi7QDq5std8s3HYR8DscX+6R5LiFjX755SwYez8jIclOZqhyCtfVBXe2V/TOXaDsVDfZF0gvEU7Q== X-Received: by 10.46.20.72 with SMTP id 8mr230203lju.23.1504819184137; Thu, 07 Sep 2017 14:19:44 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-2209e055.014-348-6c756e10.cust.bredbandsbolaget.se. [85.224.9.34]) by smtp.gmail.com with ESMTPSA id 26sm41887lfx.50.2017.09.07.14.19.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 14:19:43 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Eric Anholt , Daniel Vetter , Jani Nikula , Sean Paul Subject: [PATCH] drm/tve200: Clean up panel bridging Date: Thu, 7 Sep 2017 23:19:33 +0200 Message-Id: <20170907211933.8308-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This makes use of the drm_simple_display_pipe_attach_bridge() call and removes the two calls removing the bridge, which were erroneous: they unregister the bridge which is not what we want, we just want to unreference it and that is already handled by the core. Signed-off-by: Linus Walleij Acked-by: Daniel Vetter Reviewed-by: Eric Anholt --- drivers/gpu/drm/tve200/tve200_display.c | 3 --- drivers/gpu/drm/tve200/tve200_drv.c | 30 +++++++++++++----------------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c index cfdffc15a2ce..fd193377c3c0 100644 --- a/drivers/gpu/drm/tve200/tve200_display.c +++ b/drivers/gpu/drm/tve200/tve200_display.c @@ -332,8 +332,5 @@ int tve200_display_init(struct drm_device *drm) if (ret) return ret; - /* We need the encoder to attach the bridge */ - priv->encoder = &priv->pipe.encoder; - return 0; } diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c index c22644692a88..eae38b669f0a 100644 --- a/drivers/gpu/drm/tve200/tve200_drv.c +++ b/drivers/gpu/drm/tve200/tve200_drv.c @@ -87,6 +87,14 @@ static int tve200_modeset_init(struct drm_device *dev) ret = PTR_ERR(bridge); goto out_bridge; } + } else { + /* + * TODO: when we are using a different bridge than a panel + * (such as a dumb VGA connector) we need to devise a different + * method to get the connector out of the bridge. + */ + dev_err(dev->dev, "the bridge is not a panel\n"); + goto out_bridge; } ret = tve200_display_init(dev); @@ -95,21 +103,13 @@ static int tve200_modeset_init(struct drm_device *dev) goto out_bridge; } - if (bridge) { - ret = drm_bridge_attach(priv->encoder, bridge, NULL); - if (ret) - goto out_bridge; - } - - /* - * TODO: when we are using a different bridge than a panel - * (such as a dumb VGA connector) we need to devise a different - * method to get the connector out of the bridge. - */ - if (!panel) { - dev_err(dev->dev, "the bridge is not a panel\n"); + ret = drm_simple_display_pipe_attach_bridge(&priv->pipe, + bridge); + if (ret) { + dev_err(dev->dev, "failed to attach bridge\n"); goto out_bridge; } + priv->panel = panel; priv->connector = panel->connector; priv->bridge = bridge; @@ -138,8 +138,6 @@ static int tve200_modeset_init(struct drm_device *dev) out_bridge: if (panel) drm_panel_bridge_remove(bridge); - else - drm_bridge_remove(bridge); drm_mode_config_cleanup(dev); finish: return ret; @@ -275,8 +273,6 @@ static int tve200_remove(struct platform_device *pdev) drm_fbdev_cma_fini(priv->fbdev); if (priv->panel) drm_panel_bridge_remove(priv->bridge); - else - drm_bridge_remove(priv->bridge); drm_mode_config_cleanup(drm); clk_disable_unprepare(priv->pclk); drm_dev_unref(drm);