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: 111970 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp687832ybm; Thu, 7 Sep 2017 14:20:19 -0700 (PDT) X-Received: by 10.99.186.69 with SMTP id l5mr763408pgu.160.1504819219376; Thu, 07 Sep 2017 14:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504819219; cv=none; d=google.com; s=arc-20160816; b=Gv2gtvB4XwvgtpxzsoS6zLId5Svmf7fovME7YONi5/qziVPSPZ14vN6ka3OOx1Oca2 ouF0dESkrNGjnVoJj5ylHqHkqMAVYnxFaFvmicwMvWlKjqvoBADlRGG047UWYkQ2TRpH jauGyZ6FCPNGTWMRwsMLwayd7sRo1qNRpGVKit4hFKiQf1mccTOuUy9VYh5tTNzY+DtB 3oYASXe424BC+ACKm6FtLwjUHa+G7kEu+ycsay2Kc/1DH66p9DEiDXMluJbHgvxuFJV2 2GLowPyRY0VU3gThfPnaby5Bc5/3kqtv8rmfoFaqMS9vgf5PHLJzP9Ld9xJpdzKBR/2K G+Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:message-id:date:subject:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=xzNt5wGWSbjzZxjT/GgixHR2Nr6j4Uv+XPIk6KdFH6w=; b=kFiyw1R8Tk7NkfTmYNPdYmXGBYeK+boJR9HRjao5ORJbrgdrB88GNtlapqm9VRS1Et aRZLVimUvBGyaa5yeK3S/uyxXmb+aiKf+GKohbUmt4q1t/xOkjnfF7zZBn2f8Q7o/Qmq zvxbGjH4v8XW85H8dmwt4YxV9gy8vsnvxDS6olrY1IOYXOa3cLo3iTclCgWPveD3824z UFo+kUUXDvMKi33IpmxdWKiNRkDSYxYzKiiDUYl+0P2U9sX4OQEuQAstkcetN1cZLBb+ GDJH37h/IV8pWc7l3tJGYxHcugWXj0P52WjeiM1Gip/BBnwrjPhVYcrXMC0Wxm5Xbw6V rtGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iMu03HJ/; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id f1si371631pln.817.2017.09.07.14.20.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Sep 2017 14:20:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iMu03HJ/; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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" 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);