summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-01-09 17:08:36 +0100
committerThierry Reding <treding@nvidia.com>2014-01-10 10:15:23 +0100
commited6cd9798c923ab784f2440f70ec611bd1376f53 (patch)
tree3e52e782287dd770cf7f53903adbf07b769421fe
parent690f3ef351121e8e2c4c9efa1ce6e0da4ff25343 (diff)
drm/tegra: Statically assign pipe number
The driver previously relied on the probe order to assign a pipe number to each head. With the introduction of panel support it is now possible for the display controller driver to defer probing and therefore it can happen that the heads are assigned the wrong pipe number, which causes breakage later on because the wrong values end up being programmed into registers of the various outputs. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/drm/tegra/dc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index d6bbac016f6e..9684109de6cc 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1175,8 +1175,6 @@ static int tegra_dc_init(struct host1x_client *client)
struct tegra_dc *dc = host1x_client_to_dc(client);
int err;
- dc->pipe = tegra->drm->mode_config.num_crtc;
-
drm_crtc_init(tegra->drm, &dc->base, &tegra_crtc_funcs);
drm_mode_crtc_set_gamma_size(&dc->base, 256);
drm_crtc_helper_add(&dc->base, &tegra_crtc_helper_funcs);
@@ -1303,6 +1301,11 @@ static int tegra_dc_probe(struct platform_device *pdev)
if (IS_ERR(dc->regs))
return PTR_ERR(dc->regs);
+ if (regs->start == 0x54200000)
+ dc->pipe = 0;
+ else
+ dc->pipe = 1;
+
dc->irq = platform_get_irq(pdev, 0);
if (dc->irq < 0) {
dev_err(&pdev->dev, "failed to get IRQ\n");