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: 112160 Delivered-To: patch@linaro.org Received: by 10.100.153.131 with SMTP id 3csp4867146pji; Sun, 10 Sep 2017 15:08:18 -0700 (PDT) X-Received: by 10.84.215.134 with SMTP id l6mr11442488pli.53.1505081298778; Sun, 10 Sep 2017 15:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505081298; cv=none; d=google.com; s=arc-20160816; b=VAi0UklXvhyMN8z2+wqCxZcfh3cLYbcahZ3tvXxcwS4+6eKWufDVSY5P4NSUl86Dwk 6lgUEh7ra49Q7kzSdQ0kJ3eoOWHR+2dzJSXHS+w/cjVeV0TsWw7T6RW9yfwcRRwX5pU5 3QSC7gUkYmT3T7MA4AwCxbjYNf4Fp6nxc0jrX61yZgibfvk9r+wH1irZZfbcMTRCKv3E tkDEimhASeyB3zyb5wDGcFq5nZ6mo/kTn3BjPgeOn3Qm2q9VDbx1FPGW+6Nzx/ZetLmm hSpjKHvu/W9g7BOZDIdPeduk5uQRs84GHL/A/xLraXos4PL+tnSWlmINh6bDyIQuTnWa JYxw== 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=YlITG2uZsj2OLj5cyVf4G1E36jhf+8AhvBvbEVOHRT0=; b=Pi3o/d9UxEENWRWYtY4Gfc/kTjRHo/lqzmEj0NZ28oZndSxXZRDAXHF1+OgIEBr/BO 4UUm9R14tUxVzAeZXOrEDAOONjJo4/kyeYz3x6V8HcEk9qL18qSohwow7XGLJw3TxuRz 8R45pP6V0Aw96GCEvJs1B7KYYQ93l4xwmmv4uOBMeNxnOeOrEcfvuvGnQ4qeJA/A7MAh VRX4tnUCvOv3OABe7ZvykftgBfN73AwNestM7oeLF0FKYZpga5ksWoL0yOCSQGBoweCw 3Oqb5MSXNtWUB3uEu9fqflNxHJCXsudN2DXMTsPX7DNO0nVhUIFiUyZTtRtMYCQvO75w QXsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kQwYkGRF; 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 y2si3025013pfb.327.2017.09.10.15.08.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Sep 2017 15:08:18 -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=kQwYkGRF; 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 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" 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);