aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra/dc.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-03-28 14:30:41 +1000
committerDave Airlie <airlied@redhat.com>2018-03-28 14:30:41 +1000
commit2b4f44eec2be2688511c2b617d0e1b4f94c45ba4 (patch)
tree533c03602f4ae6d6404db6fa56c88e6f83e1bebe /drivers/gpu/drm/tegra/dc.c
parentMerge branch 'drm-next-4.17' of git://people.freedesktop.org/~agd5f/linux into drm-next (diff)
parentLinux 4.16-rc7 (diff)
downloadlinux-dev-2b4f44eec2be2688511c2b617d0e1b4f94c45ba4.tar.xz
linux-dev-2b4f44eec2be2688511c2b617d0e1b4f94c45ba4.zip
Backmerge tag 'v4.16-rc7' into drm-next
Linux 4.16-rc7 This was requested by Daniel, and things were getting a bit hard to reconcile, most of the conflicts were trivial though.
Diffstat (limited to 'drivers/gpu/drm/tegra/dc.c')
-rw-r--r--drivers/gpu/drm/tegra/dc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 71152776b04c..616c9634585e 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1916,8 +1916,12 @@ cleanup:
if (!IS_ERR(primary))
drm_plane_cleanup(primary);
- if (group && tegra->domain) {
- iommu_detach_group(tegra->domain, group);
+ if (group && dc->domain) {
+ if (group == tegra->group) {
+ iommu_detach_group(dc->domain, group);
+ tegra->group = NULL;
+ }
+
dc->domain = NULL;
}
@@ -1926,8 +1930,10 @@ cleanup:
static int tegra_dc_exit(struct host1x_client *client)
{
+ struct drm_device *drm = dev_get_drvdata(client->parent);
struct iommu_group *group = iommu_group_get(client->dev);
struct tegra_dc *dc = host1x_client_to_dc(client);
+ struct tegra_drm *tegra = drm->dev_private;
int err;
devm_free_irq(dc->dev, dc->irq, dc);
@@ -1939,7 +1945,11 @@ static int tegra_dc_exit(struct host1x_client *client)
}
if (group && dc->domain) {
- iommu_detach_group(dc->domain, group);
+ if (group == tegra->group) {
+ iommu_detach_group(dc->domain, group);
+ tegra->group = NULL;
+ }
+
dc->domain = NULL;
}