Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9371b711 authored by Nicolin Chen's avatar Nicolin Chen Committed by Greg Kroah-Hartman
Browse files

drm/tegra: hub: Do not enable orphaned window group



[ Upstream commit ef4e417eb3ec7fe657928f10ac1d2154d8a5fb38 ]

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: default avatarNicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2c8af319
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -143,6 +143,8 @@ int tegra_display_hub_prepare(struct tegra_display_hub *hub)
	for (i = 0; i < hub->soc->num_wgrps; i++) {
		struct tegra_windowgroup *wgrp = &hub->wgrps[i];

		/* Skip orphaned window group whose parent DC is disabled */
		if (wgrp->parent)
			tegra_windowgroup_enable(wgrp);
	}

@@ -160,6 +162,8 @@ void tegra_display_hub_cleanup(struct tegra_display_hub *hub)
	for (i = 0; i < hub->soc->num_wgrps; i++) {
		struct tegra_windowgroup *wgrp = &hub->wgrps[i];

		/* Skip orphaned window group whose parent DC is disabled */
		if (wgrp->parent)
			tegra_windowgroup_disable(wgrp);
	}
}