Commit a31500fe authored by Thierry Reding's avatar Thierry Reding

drm/tegra: dc: Restore coupling of display controllers

Coupling of display controllers used to rely on runtime PM to take the
companion controller out of reset. Commit fd67e9c6 ("drm/tegra: Do
not implement runtime PM") accidentally broke this when runtime PM was
removed.

Restore this functionality by reusing the hierarchical host1x client
suspend/resume infrastructure that's similar to runtime PM and which
perfectly fits this use-case.

Fixes: fd67e9c6 ("drm/tegra: Do not implement runtime PM")
Reported-by: default avatarDmitry Osipenko <digetx@gmail.com>
Reported-by: default avatarPaul Fertser <fercerpav@gmail.com>
Tested-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent a24f9817
...@@ -2501,22 +2501,18 @@ static int tegra_dc_couple(struct tegra_dc *dc) ...@@ -2501,22 +2501,18 @@ static int tegra_dc_couple(struct tegra_dc *dc)
* POWER_CONTROL registers during CRTC enabling. * POWER_CONTROL registers during CRTC enabling.
*/ */
if (dc->soc->coupled_pm && dc->pipe == 1) { if (dc->soc->coupled_pm && dc->pipe == 1) {
u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER; struct device *companion;
struct device_link *link; struct tegra_dc *parent;
struct device *partner;
partner = driver_find_device(dc->dev->driver, NULL, NULL, companion = driver_find_device(dc->dev->driver, NULL, (const void *)0,
tegra_dc_match_by_pipe); tegra_dc_match_by_pipe);
if (!partner) if (!companion)
return -EPROBE_DEFER; return -EPROBE_DEFER;
link = device_link_add(dc->dev, partner, flags); parent = dev_get_drvdata(companion);
if (!link) { dc->client.parent = &parent->client;
dev_err(dc->dev, "failed to link controllers\n");
return -EINVAL;
}
dev_dbg(dc->dev, "coupled to %s\n", dev_name(partner)); dev_dbg(dc->dev, "coupled to %s\n", dev_name(companion));
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment