Skip to content

Commit ef4e417

Browse files
Nicolin Chenthierryreding
authored andcommitted
drm/tegra: hub: Do not enable orphaned window group
Though the unconditional enable/disable code is not a final solution, we don't want to run into a NULL pointer situation when window group doesn't link to its DC parent if the DC is disabled in Device Tree. So this patch simply adds a check to make sure that window group has a valid parent before running into tegra_windowgroup_enable/disable. Signed-off-by: Nicolin Chen <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 109be8b commit ef4e417

File tree

1 file changed

+6
-2
lines changed
  • drivers/gpu/drm/tegra

1 file changed

+6
-2
lines changed

drivers/gpu/drm/tegra/hub.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ int tegra_display_hub_prepare(struct tegra_display_hub *hub)
149149
for (i = 0; i < hub->soc->num_wgrps; i++) {
150150
struct tegra_windowgroup *wgrp = &hub->wgrps[i];
151151

152-
tegra_windowgroup_enable(wgrp);
152+
/* Skip orphaned window group whose parent DC is disabled */
153+
if (wgrp->parent)
154+
tegra_windowgroup_enable(wgrp);
153155
}
154156

155157
return 0;
@@ -166,7 +168,9 @@ void tegra_display_hub_cleanup(struct tegra_display_hub *hub)
166168
for (i = 0; i < hub->soc->num_wgrps; i++) {
167169
struct tegra_windowgroup *wgrp = &hub->wgrps[i];
168170

169-
tegra_windowgroup_disable(wgrp);
171+
/* Skip orphaned window group whose parent DC is disabled */
172+
if (wgrp->parent)
173+
tegra_windowgroup_disable(wgrp);
170174
}
171175
}
172176

0 commit comments

Comments
 (0)