vic.c (7baa943e0bb22454887edd1fffb2d00a4b842fe5) vic.c (aacdf19849734d1be5e407932228ae101ba5b92f)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2015, NVIDIA Corporation.
4 */
5
6#include <linux/clk.h>
7#include <linux/delay.h>
8#include <linux/host1x.h>

--- 20 unchanged lines hidden (view full) ---

29
30struct vic {
31 struct falcon falcon;
32 bool booted;
33
34 void __iomem *regs;
35 struct tegra_drm_client client;
36 struct host1x_channel *channel;
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2015, NVIDIA Corporation.
4 */
5
6#include <linux/clk.h>
7#include <linux/delay.h>
8#include <linux/host1x.h>

--- 20 unchanged lines hidden (view full) ---

29
30struct vic {
31 struct falcon falcon;
32 bool booted;
33
34 void __iomem *regs;
35 struct tegra_drm_client client;
36 struct host1x_channel *channel;
37 struct iommu_group *group;
38 struct device *dev;
39 struct clk *clk;
40 struct reset_control *rst;
41
42 /* Platform configuration */
43 const struct vic_config *config;
44};
45

--- 137 unchanged lines hidden (view full) ---

183static int vic_init(struct host1x_client *client)
184{
185 struct tegra_drm_client *drm = host1x_to_drm_client(client);
186 struct drm_device *dev = dev_get_drvdata(client->parent);
187 struct tegra_drm *tegra = dev->dev_private;
188 struct vic *vic = to_vic(drm);
189 int err;
190
37 struct device *dev;
38 struct clk *clk;
39 struct reset_control *rst;
40
41 /* Platform configuration */
42 const struct vic_config *config;
43};
44

--- 137 unchanged lines hidden (view full) ---

182static int vic_init(struct host1x_client *client)
183{
184 struct tegra_drm_client *drm = host1x_to_drm_client(client);
185 struct drm_device *dev = dev_get_drvdata(client->parent);
186 struct tegra_drm *tegra = dev->dev_private;
187 struct vic *vic = to_vic(drm);
188 int err;
189
191 vic->group = host1x_client_iommu_attach(client, false);
192 if (IS_ERR(vic->group)) {
193 err = PTR_ERR(vic->group);
190 err = host1x_client_iommu_attach(client, false);
191 if (err < 0) {
194 dev_err(vic->dev, "failed to attach to domain: %d\n", err);
195 return err;
196 }
197
198 vic->channel = host1x_channel_request(client);
199 if (!vic->channel) {
200 err = -ENOMEM;
201 goto detach;

--- 17 unchanged lines hidden (view full) ---

219
220 return 0;
221
222free_syncpt:
223 host1x_syncpt_free(client->syncpts[0]);
224free_channel:
225 host1x_channel_put(vic->channel);
226detach:
192 dev_err(vic->dev, "failed to attach to domain: %d\n", err);
193 return err;
194 }
195
196 vic->channel = host1x_channel_request(client);
197 if (!vic->channel) {
198 err = -ENOMEM;
199 goto detach;

--- 17 unchanged lines hidden (view full) ---

217
218 return 0;
219
220free_syncpt:
221 host1x_syncpt_free(client->syncpts[0]);
222free_channel:
223 host1x_channel_put(vic->channel);
224detach:
227 host1x_client_iommu_detach(client, vic->group);
225 host1x_client_iommu_detach(client);
228
229 return err;
230}
231
232static int vic_exit(struct host1x_client *client)
233{
234 struct tegra_drm_client *drm = host1x_to_drm_client(client);
235 struct drm_device *dev = dev_get_drvdata(client->parent);

--- 5 unchanged lines hidden (view full) ---

241 client->dev->dma_parms = NULL;
242
243 err = tegra_drm_unregister_client(tegra, drm);
244 if (err < 0)
245 return err;
246
247 host1x_syncpt_free(client->syncpts[0]);
248 host1x_channel_put(vic->channel);
226
227 return err;
228}
229
230static int vic_exit(struct host1x_client *client)
231{
232 struct tegra_drm_client *drm = host1x_to_drm_client(client);
233 struct drm_device *dev = dev_get_drvdata(client->parent);

--- 5 unchanged lines hidden (view full) ---

239 client->dev->dma_parms = NULL;
240
241 err = tegra_drm_unregister_client(tegra, drm);
242 if (err < 0)
243 return err;
244
245 host1x_syncpt_free(client->syncpts[0]);
246 host1x_channel_put(vic->channel);
249 host1x_client_iommu_detach(client, vic->group);
247 host1x_client_iommu_detach(client);
250
251 return 0;
252}
253
254static const struct host1x_client_ops vic_client_ops = {
255 .init = vic_init,
256 .exit = vic_exit,
257};

--- 253 unchanged lines hidden ---
248
249 return 0;
250}
251
252static const struct host1x_client_ops vic_client_ops = {
253 .init = vic_init,
254 .exit = vic_exit,
255};

--- 253 unchanged lines hidden ---