aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra/dc.c
diff options
context:
space:
mode:
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 b8403ed48285..fbffe1948b3b 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1903,8 +1903,12 @@ cleanup:
1903 if (!IS_ERR(primary)) 1903 if (!IS_ERR(primary))
1904 drm_plane_cleanup(primary); 1904 drm_plane_cleanup(primary);
1905 1905
1906 if (group && tegra->domain) { 1906 if (group && dc->domain) {
1907 iommu_detach_group(tegra->domain, group); 1907 if (group == tegra->group) {
1908 iommu_detach_group(dc->domain, group);
1909 tegra->group = NULL;
1910 }
1911
1908 dc->domain = NULL; 1912 dc->domain = NULL;
1909 } 1913 }
1910 1914
@@ -1913,8 +1917,10 @@ cleanup:
1913 1917
1914static int tegra_dc_exit(struct host1x_client *client) 1918static int tegra_dc_exit(struct host1x_client *client)
1915{ 1919{
1920 struct drm_device *drm = dev_get_drvdata(client->parent);
1916 struct iommu_group *group = iommu_group_get(client->dev); 1921 struct iommu_group *group = iommu_group_get(client->dev);
1917 struct tegra_dc *dc = host1x_client_to_dc(client); 1922 struct tegra_dc *dc = host1x_client_to_dc(client);
1923 struct tegra_drm *tegra = drm->dev_private;
1918 int err; 1924 int err;
1919 1925
1920 devm_free_irq(dc->dev, dc->irq, dc); 1926 devm_free_irq(dc->dev, dc->irq, dc);
@@ -1926,7 +1932,11 @@ static int tegra_dc_exit(struct host1x_client *client)
1926 } 1932 }
1927 1933
1928 if (group && dc->domain) { 1934 if (group && dc->domain) {
1929 iommu_detach_group(dc->domain, group); 1935 if (group == tegra->group) {
1936 iommu_detach_group(dc->domain, group);
1937 tegra->group = NULL;
1938 }
1939
1930 dc->domain = NULL; 1940 dc->domain = NULL;
1931 } 1941 }
1932 1942