Loading drivers/gpu/drm/tegra/dc.c +4 −5 Original line number Diff line number Diff line Loading @@ -2014,9 +2014,8 @@ static int tegra_dc_init(struct host1x_client *client) if (!dc->syncpt) dev_warn(dc->dev, "failed to allocate syncpoint\n"); dc->group = host1x_client_iommu_attach(client, true); if (IS_ERR(dc->group)) { err = PTR_ERR(dc->group); err = host1x_client_iommu_attach(client, true); if (err < 0) { dev_err(client->dev, "failed to attach to domain: %d\n", err); return err; } Loading Loading @@ -2089,7 +2088,7 @@ static int tegra_dc_init(struct host1x_client *client) if (!IS_ERR(primary)) drm_plane_cleanup(primary); host1x_client_iommu_detach(client, dc->group); host1x_client_iommu_detach(client); host1x_syncpt_free(dc->syncpt); return err; Loading @@ -2114,7 +2113,7 @@ static int tegra_dc_exit(struct host1x_client *client) return err; } host1x_client_iommu_detach(client, dc->group); host1x_client_iommu_detach(client); host1x_syncpt_free(dc->syncpt); return 0; Loading drivers/gpu/drm/tegra/dc.h +0 −2 Original line number Diff line number Diff line Loading @@ -90,8 +90,6 @@ struct tegra_dc { struct drm_info_list *debugfs_files; const struct tegra_dc_soc_info *soc; struct iommu_group *group; }; static inline struct tegra_dc * Loading drivers/gpu/drm/tegra/drm.c +11 −11 Original line number Diff line number Diff line Loading @@ -1068,8 +1068,7 @@ int tegra_drm_unregister_client(struct tegra_drm *tegra, return 0; } struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, bool shared) int host1x_client_iommu_attach(struct host1x_client *client, bool shared) { struct drm_device *drm = dev_get_drvdata(client->parent); struct tegra_drm *tegra = drm->dev_private; Loading @@ -1080,7 +1079,7 @@ struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, group = iommu_group_get(client->dev); if (!group) { dev_err(client->dev, "failed to get IOMMU group\n"); return ERR_PTR(-ENODEV); return -ENODEV; } if (!shared || (shared && (group != tegra->group))) { Loading @@ -1095,7 +1094,7 @@ struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, err = iommu_attach_group(tegra->domain, group); if (err < 0) { iommu_group_put(group); return ERR_PTR(err); return err; } if (shared && !tegra->group) Loading @@ -1103,22 +1102,23 @@ struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, } } return group; client->group = group; return 0; } void host1x_client_iommu_detach(struct host1x_client *client, struct iommu_group *group) void host1x_client_iommu_detach(struct host1x_client *client) { struct drm_device *drm = dev_get_drvdata(client->parent); struct tegra_drm *tegra = drm->dev_private; if (group) { if (group == tegra->group) { iommu_detach_group(tegra->domain, group); if (client->group) { if (client->group == tegra->group) { iommu_detach_group(tegra->domain, client->group); tegra->group = NULL; } iommu_group_put(group); iommu_group_put(client->group); } } Loading drivers/gpu/drm/tegra/drm.h +2 −4 Original line number Diff line number Diff line Loading @@ -100,10 +100,8 @@ int tegra_drm_register_client(struct tegra_drm *tegra, struct tegra_drm_client *client); int tegra_drm_unregister_client(struct tegra_drm *tegra, struct tegra_drm_client *client); struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, bool shared); void host1x_client_iommu_detach(struct host1x_client *client, struct iommu_group *group); int host1x_client_iommu_attach(struct host1x_client *client, bool shared); void host1x_client_iommu_detach(struct host1x_client *client); int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm); int tegra_drm_exit(struct tegra_drm *tegra); Loading drivers/gpu/drm/tegra/gr2d.c +4 −6 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ struct gr2d_soc { }; struct gr2d { struct iommu_group *group; struct tegra_drm_client client; struct host1x_channel *channel; struct clk *clk; Loading Loading @@ -51,9 +50,8 @@ static int gr2d_init(struct host1x_client *client) goto put; } gr2d->group = host1x_client_iommu_attach(client, false); if (IS_ERR(gr2d->group)) { err = PTR_ERR(gr2d->group); err = host1x_client_iommu_attach(client, false); if (err < 0) { dev_err(client->dev, "failed to attach to domain: %d\n", err); goto free; } Loading @@ -67,7 +65,7 @@ static int gr2d_init(struct host1x_client *client) return 0; detach: host1x_client_iommu_detach(client, gr2d->group); host1x_client_iommu_detach(client); free: host1x_syncpt_free(client->syncpts[0]); put: Loading @@ -87,7 +85,7 @@ static int gr2d_exit(struct host1x_client *client) if (err < 0) return err; host1x_client_iommu_detach(client, gr2d->group); host1x_client_iommu_detach(client); host1x_syncpt_free(client->syncpts[0]); host1x_channel_put(gr2d->channel); Loading Loading
drivers/gpu/drm/tegra/dc.c +4 −5 Original line number Diff line number Diff line Loading @@ -2014,9 +2014,8 @@ static int tegra_dc_init(struct host1x_client *client) if (!dc->syncpt) dev_warn(dc->dev, "failed to allocate syncpoint\n"); dc->group = host1x_client_iommu_attach(client, true); if (IS_ERR(dc->group)) { err = PTR_ERR(dc->group); err = host1x_client_iommu_attach(client, true); if (err < 0) { dev_err(client->dev, "failed to attach to domain: %d\n", err); return err; } Loading Loading @@ -2089,7 +2088,7 @@ static int tegra_dc_init(struct host1x_client *client) if (!IS_ERR(primary)) drm_plane_cleanup(primary); host1x_client_iommu_detach(client, dc->group); host1x_client_iommu_detach(client); host1x_syncpt_free(dc->syncpt); return err; Loading @@ -2114,7 +2113,7 @@ static int tegra_dc_exit(struct host1x_client *client) return err; } host1x_client_iommu_detach(client, dc->group); host1x_client_iommu_detach(client); host1x_syncpt_free(dc->syncpt); return 0; Loading
drivers/gpu/drm/tegra/dc.h +0 −2 Original line number Diff line number Diff line Loading @@ -90,8 +90,6 @@ struct tegra_dc { struct drm_info_list *debugfs_files; const struct tegra_dc_soc_info *soc; struct iommu_group *group; }; static inline struct tegra_dc * Loading
drivers/gpu/drm/tegra/drm.c +11 −11 Original line number Diff line number Diff line Loading @@ -1068,8 +1068,7 @@ int tegra_drm_unregister_client(struct tegra_drm *tegra, return 0; } struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, bool shared) int host1x_client_iommu_attach(struct host1x_client *client, bool shared) { struct drm_device *drm = dev_get_drvdata(client->parent); struct tegra_drm *tegra = drm->dev_private; Loading @@ -1080,7 +1079,7 @@ struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, group = iommu_group_get(client->dev); if (!group) { dev_err(client->dev, "failed to get IOMMU group\n"); return ERR_PTR(-ENODEV); return -ENODEV; } if (!shared || (shared && (group != tegra->group))) { Loading @@ -1095,7 +1094,7 @@ struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, err = iommu_attach_group(tegra->domain, group); if (err < 0) { iommu_group_put(group); return ERR_PTR(err); return err; } if (shared && !tegra->group) Loading @@ -1103,22 +1102,23 @@ struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, } } return group; client->group = group; return 0; } void host1x_client_iommu_detach(struct host1x_client *client, struct iommu_group *group) void host1x_client_iommu_detach(struct host1x_client *client) { struct drm_device *drm = dev_get_drvdata(client->parent); struct tegra_drm *tegra = drm->dev_private; if (group) { if (group == tegra->group) { iommu_detach_group(tegra->domain, group); if (client->group) { if (client->group == tegra->group) { iommu_detach_group(tegra->domain, client->group); tegra->group = NULL; } iommu_group_put(group); iommu_group_put(client->group); } } Loading
drivers/gpu/drm/tegra/drm.h +2 −4 Original line number Diff line number Diff line Loading @@ -100,10 +100,8 @@ int tegra_drm_register_client(struct tegra_drm *tegra, struct tegra_drm_client *client); int tegra_drm_unregister_client(struct tegra_drm *tegra, struct tegra_drm_client *client); struct iommu_group *host1x_client_iommu_attach(struct host1x_client *client, bool shared); void host1x_client_iommu_detach(struct host1x_client *client, struct iommu_group *group); int host1x_client_iommu_attach(struct host1x_client *client, bool shared); void host1x_client_iommu_detach(struct host1x_client *client); int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm); int tegra_drm_exit(struct tegra_drm *tegra); Loading
drivers/gpu/drm/tegra/gr2d.c +4 −6 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ struct gr2d_soc { }; struct gr2d { struct iommu_group *group; struct tegra_drm_client client; struct host1x_channel *channel; struct clk *clk; Loading Loading @@ -51,9 +50,8 @@ static int gr2d_init(struct host1x_client *client) goto put; } gr2d->group = host1x_client_iommu_attach(client, false); if (IS_ERR(gr2d->group)) { err = PTR_ERR(gr2d->group); err = host1x_client_iommu_attach(client, false); if (err < 0) { dev_err(client->dev, "failed to attach to domain: %d\n", err); goto free; } Loading @@ -67,7 +65,7 @@ static int gr2d_init(struct host1x_client *client) return 0; detach: host1x_client_iommu_detach(client, gr2d->group); host1x_client_iommu_detach(client); free: host1x_syncpt_free(client->syncpts[0]); put: Loading @@ -87,7 +85,7 @@ static int gr2d_exit(struct host1x_client *client) if (err < 0) return err; host1x_client_iommu_detach(client, gr2d->group); host1x_client_iommu_detach(client); host1x_syncpt_free(client->syncpts[0]); host1x_channel_put(gr2d->channel); Loading