aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2018-09-21 06:27:42 -0400
committerThierry Reding <treding@nvidia.com>2018-09-26 10:03:51 -0400
commit759d706f7cb4adbec1c222f7550dc8fa2683c089 (patch)
tree2f70d5ae22a0452844bd301f9fe3b83318dca64b
parent47022003f94d1eecf49b9b7a7804814faaea9f08 (diff)
drm/tegra: dc: Do not register DC without primary plane
Tegra194 contains a fourth display controller that does not own any windows. Therefore, we cannot currently assign a primary plane to it which causes KMS to eventually crash. Do not register the display controller if it owns no windows to work around this. Note that we still have to enable and probe the display controller because for some reason all display controllers need to be powered (and/or clocked) before any registers can be accessed in any of the display controllers. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/drm/tegra/dc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 965088afcfad..7e36ca204cbb 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1988,6 +1988,28 @@ static int tegra_dc_init(struct host1x_client *client)
1988 struct drm_plane *cursor = NULL; 1988 struct drm_plane *cursor = NULL;
1989 int err; 1989 int err;
1990 1990
1991 /*
1992 * XXX do not register DCs with no window groups because we cannot
1993 * assign a primary plane to them, which in turn will cause KMS to
1994 * crash.
1995 */
1996 if (dc->soc->wgrps) {
1997 bool has_wgrps = false;
1998 unsigned int i;
1999
2000 for (i = 0; i < dc->soc->num_wgrps; i++) {
2001 const struct tegra_windowgroup_soc *wgrp = &dc->soc->wgrps[i];
2002
2003 if (wgrp->dc == dc->pipe && wgrp->num_windows > 0) {
2004 has_wgrps = true;
2005 break;
2006 }
2007 }
2008
2009 if (!has_wgrps)
2010 return 0;
2011 }
2012
1991 dc->syncpt = host1x_syncpt_request(client, flags); 2013 dc->syncpt = host1x_syncpt_request(client, flags);
1992 if (!dc->syncpt) 2014 if (!dc->syncpt)
1993 dev_warn(dc->dev, "failed to allocate syncpoint\n"); 2015 dev_warn(dc->dev, "failed to allocate syncpoint\n");