From patchwork Sun Sep 10 22:08:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9946393 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 0132E602C9 for ; Sun, 10 Sep 2017 22:08:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7A1728A54 for ; Sun, 10 Sep 2017 22:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBE0228A69; Sun, 10 Sep 2017 22:08:49 +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 5185228A54 for ; Sun, 10 Sep 2017 22:08:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5CAE36E1E4; Sun, 10 Sep 2017 22:08:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::231]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E5A96E1E4 for ; Sun, 10 Sep 2017 22:08:14 +0000 (UTC) Received: by mail-lf0-x231.google.com with SMTP id l196so14479498lfl.1 for ; Sun, 10 Sep 2017 15:08:14 -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=r7144KNA9JDY43MtfnW2kskdqaPyK5MIH9TlAEzw6k4=; b=kQwYkGRFpK8bLmIdtp5JtLpft/2ZQt1bZERN4e629hTqleaotrCoZaP2/w4JDrmmUW k9QHTdsEmro6jtXTJBgbpwL6nrV/RS5PUE5Yjc7hGhMOW7PpWIUaeKf0NC7OdM7KiHyM ChZ0Joi/cHYEYqW4uEtfmDVBCwKk9u3xsIzTQ= 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=r7144KNA9JDY43MtfnW2kskdqaPyK5MIH9TlAEzw6k4=; b=dedc7D3R4NvzFWGL1cgSNuwnR+/QlZldtSEHP63YYmuyFbuZj1G3/eMtzyrgx2CpIS u04x9RVW1TApylclGASZ0miPTqoWQtzQPgGKm+cfQZE6Vb3dOzMIzuupDt+p7IxZKJ0B N/7vq6ornPhF7d2OZVQ0649LFndMCkg1XnY1OCemZ6gbnoeH/mEqCmb46I5FV4DCPcWc dO+SUamNhxcf7HP3Lzrf7GF+eopVNmoSSuDSiEbLdcyxAEzQI9dP/0x3tbNQQVyjkWAH qgz8HTX+3iXj7gcGQQ1w0tnsnTbm2vjSWI+emNpNiVzeuLfmNh/vuc+7OpEHE3j8ieMp q8mg== X-Gm-Message-State: AHPjjUjOnJTuEHd23dqSTvJVOAKjovKFhqkrw5Sm/TwupsFplGoVCvWv fKMuWiNaCT/2eesX3v3sQw== X-Google-Smtp-Source: AOwi7QDejZmWsn38dBZ7LW6RWyrQydnaYrYCdzdCSr+rVxBu5zPov6TkMeRI7zziWKdzLoZJ+ktrWw== X-Received: by 10.25.235.220 with SMTP id f89mr3236676lfk.194.1505081293061; Sun, 10 Sep 2017 15:08:13 -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 19sm352648ljs.34.2017.09.10.15.08.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Sep 2017 15:08:12 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Eric Anholt , Daniel Vetter , Jani Nikula , Sean Paul Subject: [PATCH v2] drm/tve200: Clean up panel bridging Date: Mon, 11 Sep 2017 00:08:01 +0200 Message-Id: <20170910220801.28588-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. Reviewed-by: Eric Anholt Acked-by: Daniel Vetter Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Dropped the encoder field from private data. --- drivers/gpu/drm/tve200/tve200_display.c | 3 --- drivers/gpu/drm/tve200/tve200_drm.h | 1 - drivers/gpu/drm/tve200/tve200_drv.c | 30 +++++++++++++----------------- 3 files changed, 13 insertions(+), 21 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_drm.h b/drivers/gpu/drm/tve200/tve200_drm.h index b463624c1f29..628b79324c48 100644 --- a/drivers/gpu/drm/tve200/tve200_drm.h +++ b/drivers/gpu/drm/tve200/tve200_drm.h @@ -100,7 +100,6 @@ struct tve200_drm_dev_private { struct drm_device *drm; struct drm_connector *connector; - struct drm_encoder *encoder; struct drm_panel *panel; struct drm_bridge *bridge; struct drm_simple_display_pipe pipe; 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);