diff options
author | Thierry Reding <treding@nvidia.com> | 2013-09-24 07:22:17 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2013-10-31 04:20:05 -0400 |
commit | 386a2a71e2abde2d9fd529f8dc5f743102744100 (patch) | |
tree | db5bc9637e8d65ee83773e1d79a08aa6c5511abc /drivers/gpu/host1x | |
parent | d18d303378ad81fd73375c0148ac42e28bc0b2a4 (diff) |
drm/tegra: Rename host1x_drm structure to tegra_drm
The host1x and Tegra DRM drivers are currently tightly coupled. Renaming
the structure marks the boundary more clearly.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r-- | drivers/gpu/host1x/dev.c | 2 | ||||
-rw-r--r-- | drivers/gpu/host1x/drm/dc.c | 8 | ||||
-rw-r--r-- | drivers/gpu/host1x/drm/drm.c | 169 | ||||
-rw-r--r-- | drivers/gpu/host1x/drm/drm.h | 18 | ||||
-rw-r--r-- | drivers/gpu/host1x/drm/fb.c | 14 | ||||
-rw-r--r-- | drivers/gpu/host1x/drm/gr2d.c | 8 | ||||
-rw-r--r-- | drivers/gpu/host1x/drm/hdmi.c | 8 | ||||
-rw-r--r-- | drivers/gpu/host1x/host1x_client.h | 4 |
8 files changed, 115 insertions, 116 deletions
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 471630299878..0f7b44c55ec7 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c | |||
@@ -163,7 +163,7 @@ static int host1x_probe(struct platform_device *pdev) | |||
163 | 163 | ||
164 | host1x_debug_init(host); | 164 | host1x_debug_init(host); |
165 | 165 | ||
166 | host1x_drm_alloc(pdev); | 166 | tegra_drm_alloc(pdev); |
167 | 167 | ||
168 | return 0; | 168 | return 0; |
169 | 169 | ||
diff --git a/drivers/gpu/host1x/drm/dc.c b/drivers/gpu/host1x/drm/dc.c index b1a05ad901c3..c4765b3196c6 100644 --- a/drivers/gpu/host1x/drm/dc.c +++ b/drivers/gpu/host1x/drm/dc.c | |||
@@ -1109,7 +1109,7 @@ static const struct host1x_client_ops dc_client_ops = { | |||
1109 | 1109 | ||
1110 | static int tegra_dc_probe(struct platform_device *pdev) | 1110 | static int tegra_dc_probe(struct platform_device *pdev) |
1111 | { | 1111 | { |
1112 | struct host1x_drm *host1x = host1x_get_drm_data(pdev->dev.parent); | 1112 | struct tegra_drm *tegra = host1x_get_drm_data(pdev->dev.parent); |
1113 | struct resource *regs; | 1113 | struct resource *regs; |
1114 | struct tegra_dc *dc; | 1114 | struct tegra_dc *dc; |
1115 | int err; | 1115 | int err; |
@@ -1153,7 +1153,7 @@ static int tegra_dc_probe(struct platform_device *pdev) | |||
1153 | return err; | 1153 | return err; |
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | err = host1x_register_client(host1x, &dc->client); | 1156 | err = host1x_register_client(tegra, &dc->client); |
1157 | if (err < 0) { | 1157 | if (err < 0) { |
1158 | dev_err(&pdev->dev, "failed to register host1x client: %d\n", | 1158 | dev_err(&pdev->dev, "failed to register host1x client: %d\n", |
1159 | err); | 1159 | err); |
@@ -1167,11 +1167,11 @@ static int tegra_dc_probe(struct platform_device *pdev) | |||
1167 | 1167 | ||
1168 | static int tegra_dc_remove(struct platform_device *pdev) | 1168 | static int tegra_dc_remove(struct platform_device *pdev) |
1169 | { | 1169 | { |
1170 | struct host1x_drm *host1x = host1x_get_drm_data(pdev->dev.parent); | 1170 | struct tegra_drm *tegra = host1x_get_drm_data(pdev->dev.parent); |
1171 | struct tegra_dc *dc = platform_get_drvdata(pdev); | 1171 | struct tegra_dc *dc = platform_get_drvdata(pdev); |
1172 | int err; | 1172 | int err; |
1173 | 1173 | ||
1174 | err = host1x_unregister_client(host1x, &dc->client); | 1174 | err = host1x_unregister_client(tegra, &dc->client); |
1175 | if (err < 0) { | 1175 | if (err < 0) { |
1176 | dev_err(&pdev->dev, "failed to unregister host1x client: %d\n", | 1176 | dev_err(&pdev->dev, "failed to unregister host1x client: %d\n", |
1177 | err); | 1177 | err); |
diff --git a/drivers/gpu/host1x/drm/drm.c b/drivers/gpu/host1x/drm/drm.c index df7d90a3a4fa..8cd45c8592bb 100644 --- a/drivers/gpu/host1x/drm/drm.c +++ b/drivers/gpu/host1x/drm/drm.c | |||
@@ -30,56 +30,55 @@ | |||
30 | #define DRIVER_MINOR 0 | 30 | #define DRIVER_MINOR 0 |
31 | #define DRIVER_PATCHLEVEL 0 | 31 | #define DRIVER_PATCHLEVEL 0 |
32 | 32 | ||
33 | struct host1x_drm_client { | 33 | struct host1x_subdev { |
34 | struct host1x_client *client; | 34 | struct host1x_client *client; |
35 | struct device_node *np; | 35 | struct device_node *np; |
36 | struct list_head list; | 36 | struct list_head list; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static int host1x_add_drm_client(struct host1x_drm *host1x, | 39 | static int host1x_subdev_add(struct tegra_drm *tegra, struct device_node *np) |
40 | struct device_node *np) | ||
41 | { | 40 | { |
42 | struct host1x_drm_client *client; | 41 | struct host1x_subdev *subdev; |
43 | 42 | ||
44 | client = kzalloc(sizeof(*client), GFP_KERNEL); | 43 | subdev = kzalloc(sizeof(*subdev), GFP_KERNEL); |
45 | if (!client) | 44 | if (!subdev) |
46 | return -ENOMEM; | 45 | return -ENOMEM; |
47 | 46 | ||
48 | INIT_LIST_HEAD(&client->list); | 47 | INIT_LIST_HEAD(&subdev->list); |
49 | client->np = of_node_get(np); | 48 | subdev->np = of_node_get(np); |
50 | 49 | ||
51 | list_add_tail(&client->list, &host1x->drm_clients); | 50 | list_add_tail(&subdev->list, &tegra->subdevs); |
52 | 51 | ||
53 | return 0; | 52 | return 0; |
54 | } | 53 | } |
55 | 54 | ||
56 | static int host1x_activate_drm_client(struct host1x_drm *host1x, | 55 | static int host1x_subdev_register(struct tegra_drm *tegra, |
57 | struct host1x_drm_client *drm, | 56 | struct host1x_subdev *subdev, |
58 | struct host1x_client *client) | 57 | struct host1x_client *client) |
59 | { | 58 | { |
60 | mutex_lock(&host1x->drm_clients_lock); | 59 | mutex_lock(&tegra->subdevs_lock); |
61 | list_del_init(&drm->list); | 60 | list_del_init(&subdev->list); |
62 | list_add_tail(&drm->list, &host1x->drm_active); | 61 | list_add_tail(&subdev->list, &tegra->active); |
63 | drm->client = client; | 62 | subdev->client = client; |
64 | mutex_unlock(&host1x->drm_clients_lock); | 63 | mutex_unlock(&tegra->subdevs_lock); |
65 | 64 | ||
66 | return 0; | 65 | return 0; |
67 | } | 66 | } |
68 | 67 | ||
69 | static int host1x_remove_drm_client(struct host1x_drm *host1x, | 68 | static int host1x_subdev_unregister(struct tegra_drm *tegra, |
70 | struct host1x_drm_client *client) | 69 | struct host1x_subdev *subdev) |
71 | { | 70 | { |
72 | mutex_lock(&host1x->drm_clients_lock); | 71 | mutex_lock(&tegra->subdevs_lock); |
73 | list_del_init(&client->list); | 72 | list_del_init(&subdev->list); |
74 | mutex_unlock(&host1x->drm_clients_lock); | 73 | mutex_unlock(&tegra->subdevs_lock); |
75 | 74 | ||
76 | of_node_put(client->np); | 75 | of_node_put(subdev->np); |
77 | kfree(client); | 76 | kfree(subdev); |
78 | 77 | ||
79 | return 0; | 78 | return 0; |
80 | } | 79 | } |
81 | 80 | ||
82 | static int host1x_parse_dt(struct host1x_drm *host1x) | 81 | static int tegra_parse_dt(struct tegra_drm *tegra) |
83 | { | 82 | { |
84 | static const char * const compat[] = { | 83 | static const char * const compat[] = { |
85 | "nvidia,tegra20-dc", | 84 | "nvidia,tegra20-dc", |
@@ -95,10 +94,10 @@ static int host1x_parse_dt(struct host1x_drm *host1x) | |||
95 | for (i = 0; i < ARRAY_SIZE(compat); i++) { | 94 | for (i = 0; i < ARRAY_SIZE(compat); i++) { |
96 | struct device_node *np; | 95 | struct device_node *np; |
97 | 96 | ||
98 | for_each_child_of_node(host1x->dev->of_node, np) { | 97 | for_each_child_of_node(tegra->dev->of_node, np) { |
99 | if (of_device_is_compatible(np, compat[i]) && | 98 | if (of_device_is_compatible(np, compat[i]) && |
100 | of_device_is_available(np)) { | 99 | of_device_is_available(np)) { |
101 | err = host1x_add_drm_client(host1x, np); | 100 | err = host1x_subdev_add(tegra, np); |
102 | if (err < 0) | 101 | if (err < 0) |
103 | return err; | 102 | return err; |
104 | } | 103 | } |
@@ -108,108 +107,108 @@ static int host1x_parse_dt(struct host1x_drm *host1x) | |||
108 | return 0; | 107 | return 0; |
109 | } | 108 | } |
110 | 109 | ||
111 | int host1x_drm_alloc(struct platform_device *pdev) | 110 | int tegra_drm_alloc(struct platform_device *pdev) |
112 | { | 111 | { |
113 | struct host1x_drm *host1x; | 112 | struct tegra_drm *tegra; |
114 | int err; | 113 | int err; |
115 | 114 | ||
116 | host1x = devm_kzalloc(&pdev->dev, sizeof(*host1x), GFP_KERNEL); | 115 | tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); |
117 | if (!host1x) | 116 | if (!tegra) |
118 | return -ENOMEM; | 117 | return -ENOMEM; |
119 | 118 | ||
120 | mutex_init(&host1x->drm_clients_lock); | 119 | mutex_init(&tegra->subdevs_lock); |
121 | INIT_LIST_HEAD(&host1x->drm_clients); | 120 | INIT_LIST_HEAD(&tegra->subdevs); |
122 | INIT_LIST_HEAD(&host1x->drm_active); | 121 | INIT_LIST_HEAD(&tegra->active); |
123 | mutex_init(&host1x->clients_lock); | 122 | mutex_init(&tegra->clients_lock); |
124 | INIT_LIST_HEAD(&host1x->clients); | 123 | INIT_LIST_HEAD(&tegra->clients); |
125 | host1x->dev = &pdev->dev; | 124 | tegra->dev = &pdev->dev; |
126 | 125 | ||
127 | err = host1x_parse_dt(host1x); | 126 | err = tegra_parse_dt(tegra); |
128 | if (err < 0) { | 127 | if (err < 0) { |
129 | dev_err(&pdev->dev, "failed to parse DT: %d\n", err); | 128 | dev_err(&pdev->dev, "failed to parse DT: %d\n", err); |
130 | return err; | 129 | return err; |
131 | } | 130 | } |
132 | 131 | ||
133 | host1x_set_drm_data(&pdev->dev, host1x); | 132 | host1x_set_drm_data(&pdev->dev, tegra); |
134 | 133 | ||
135 | return 0; | 134 | return 0; |
136 | } | 135 | } |
137 | 136 | ||
138 | int host1x_drm_init(struct host1x_drm *host1x, struct drm_device *drm) | 137 | int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm) |
139 | { | 138 | { |
140 | struct host1x_client *client; | 139 | struct host1x_client *client; |
141 | 140 | ||
142 | mutex_lock(&host1x->clients_lock); | 141 | mutex_lock(&tegra->clients_lock); |
143 | 142 | ||
144 | list_for_each_entry(client, &host1x->clients, list) { | 143 | list_for_each_entry(client, &tegra->clients, list) { |
145 | if (client->ops && client->ops->drm_init) { | 144 | if (client->ops && client->ops->drm_init) { |
146 | int err = client->ops->drm_init(client, drm); | 145 | int err = client->ops->drm_init(client, drm); |
147 | if (err < 0) { | 146 | if (err < 0) { |
148 | dev_err(host1x->dev, | 147 | dev_err(tegra->dev, |
149 | "DRM setup failed for %s: %d\n", | 148 | "DRM setup failed for %s: %d\n", |
150 | dev_name(client->dev), err); | 149 | dev_name(client->dev), err); |
151 | mutex_unlock(&host1x->clients_lock); | 150 | mutex_unlock(&tegra->clients_lock); |
152 | return err; | 151 | return err; |
153 | } | 152 | } |
154 | } | 153 | } |
155 | } | 154 | } |
156 | 155 | ||
157 | mutex_unlock(&host1x->clients_lock); | 156 | mutex_unlock(&tegra->clients_lock); |
158 | 157 | ||
159 | return 0; | 158 | return 0; |
160 | } | 159 | } |
161 | 160 | ||
162 | int host1x_drm_exit(struct host1x_drm *host1x) | 161 | int tegra_drm_exit(struct tegra_drm *tegra) |
163 | { | 162 | { |
164 | struct platform_device *pdev = to_platform_device(host1x->dev); | 163 | struct platform_device *pdev = to_platform_device(tegra->dev); |
165 | struct host1x_client *client; | 164 | struct host1x_client *client; |
166 | 165 | ||
167 | if (!host1x->drm) | 166 | if (!tegra->drm) |
168 | return 0; | 167 | return 0; |
169 | 168 | ||
170 | mutex_lock(&host1x->clients_lock); | 169 | mutex_lock(&tegra->clients_lock); |
171 | 170 | ||
172 | list_for_each_entry_reverse(client, &host1x->clients, list) { | 171 | list_for_each_entry_reverse(client, &tegra->clients, list) { |
173 | if (client->ops && client->ops->drm_exit) { | 172 | if (client->ops && client->ops->drm_exit) { |
174 | int err = client->ops->drm_exit(client); | 173 | int err = client->ops->drm_exit(client); |
175 | if (err < 0) { | 174 | if (err < 0) { |
176 | dev_err(host1x->dev, | 175 | dev_err(tegra->dev, |
177 | "DRM cleanup failed for %s: %d\n", | 176 | "DRM cleanup failed for %s: %d\n", |
178 | dev_name(client->dev), err); | 177 | dev_name(client->dev), err); |
179 | mutex_unlock(&host1x->clients_lock); | 178 | mutex_unlock(&tegra->clients_lock); |
180 | return err; | 179 | return err; |
181 | } | 180 | } |
182 | } | 181 | } |
183 | } | 182 | } |
184 | 183 | ||
185 | mutex_unlock(&host1x->clients_lock); | 184 | mutex_unlock(&tegra->clients_lock); |
186 | 185 | ||
187 | drm_platform_exit(&tegra_drm_driver, pdev); | 186 | drm_platform_exit(&tegra_drm_driver, pdev); |
188 | host1x->drm = NULL; | 187 | tegra->drm = NULL; |
189 | 188 | ||
190 | return 0; | 189 | return 0; |
191 | } | 190 | } |
192 | 191 | ||
193 | int host1x_register_client(struct host1x_drm *host1x, | 192 | int host1x_register_client(struct tegra_drm *tegra, |
194 | struct host1x_client *client) | 193 | struct host1x_client *client) |
195 | { | 194 | { |
196 | struct host1x_drm_client *drm, *tmp; | 195 | struct host1x_subdev *subdev, *tmp; |
197 | int err; | 196 | int err; |
198 | 197 | ||
199 | mutex_lock(&host1x->clients_lock); | 198 | mutex_lock(&tegra->clients_lock); |
200 | list_add_tail(&client->list, &host1x->clients); | 199 | list_add_tail(&client->list, &tegra->clients); |
201 | mutex_unlock(&host1x->clients_lock); | 200 | mutex_unlock(&tegra->clients_lock); |
202 | 201 | ||
203 | list_for_each_entry_safe(drm, tmp, &host1x->drm_clients, list) | 202 | list_for_each_entry_safe(subdev, tmp, &tegra->subdevs, list) |
204 | if (drm->np == client->dev->of_node) | 203 | if (subdev->np == client->dev->of_node) |
205 | host1x_activate_drm_client(host1x, drm, client); | 204 | host1x_subdev_register(tegra, subdev, client); |
206 | 205 | ||
207 | if (list_empty(&host1x->drm_clients)) { | 206 | if (list_empty(&tegra->subdevs)) { |
208 | struct platform_device *pdev = to_platform_device(host1x->dev); | 207 | struct platform_device *pdev = to_platform_device(tegra->dev); |
209 | 208 | ||
210 | err = drm_platform_init(&tegra_drm_driver, pdev); | 209 | err = drm_platform_init(&tegra_drm_driver, pdev); |
211 | if (err < 0) { | 210 | if (err < 0) { |
212 | dev_err(host1x->dev, "drm_platform_init(): %d\n", err); | 211 | dev_err(tegra->dev, "drm_platform_init(): %d\n", err); |
213 | return err; | 212 | return err; |
214 | } | 213 | } |
215 | } | 214 | } |
@@ -217,45 +216,45 @@ int host1x_register_client(struct host1x_drm *host1x, | |||
217 | return 0; | 216 | return 0; |
218 | } | 217 | } |
219 | 218 | ||
220 | int host1x_unregister_client(struct host1x_drm *host1x, | 219 | int host1x_unregister_client(struct tegra_drm *tegra, |
221 | struct host1x_client *client) | 220 | struct host1x_client *client) |
222 | { | 221 | { |
223 | struct host1x_drm_client *drm, *tmp; | 222 | struct host1x_subdev *subdev, *tmp; |
224 | int err; | 223 | int err; |
225 | 224 | ||
226 | list_for_each_entry_safe(drm, tmp, &host1x->drm_active, list) { | 225 | list_for_each_entry_safe(subdev, tmp, &tegra->active, list) { |
227 | if (drm->client == client) { | 226 | if (subdev->client == client) { |
228 | err = host1x_drm_exit(host1x); | 227 | err = tegra_drm_exit(tegra); |
229 | if (err < 0) { | 228 | if (err < 0) { |
230 | dev_err(host1x->dev, "host1x_drm_exit(): %d\n", | 229 | dev_err(tegra->dev, "tegra_drm_exit(): %d\n", |
231 | err); | 230 | err); |
232 | return err; | 231 | return err; |
233 | } | 232 | } |
234 | 233 | ||
235 | host1x_remove_drm_client(host1x, drm); | 234 | host1x_subdev_unregister(tegra, subdev); |
236 | break; | 235 | break; |
237 | } | 236 | } |
238 | } | 237 | } |
239 | 238 | ||
240 | mutex_lock(&host1x->clients_lock); | 239 | mutex_lock(&tegra->clients_lock); |
241 | list_del_init(&client->list); | 240 | list_del_init(&client->list); |
242 | mutex_unlock(&host1x->clients_lock); | 241 | mutex_unlock(&tegra->clients_lock); |
243 | 242 | ||
244 | return 0; | 243 | return 0; |
245 | } | 244 | } |
246 | 245 | ||
247 | static int tegra_drm_load(struct drm_device *drm, unsigned long flags) | 246 | static int tegra_drm_load(struct drm_device *drm, unsigned long flags) |
248 | { | 247 | { |
249 | struct host1x_drm *host1x; | 248 | struct tegra_drm *tegra; |
250 | int err; | 249 | int err; |
251 | 250 | ||
252 | host1x = host1x_get_drm_data(drm->dev); | 251 | tegra = host1x_get_drm_data(drm->dev); |
253 | drm->dev_private = host1x; | 252 | drm->dev_private = tegra; |
254 | host1x->drm = drm; | 253 | tegra->drm = drm; |
255 | 254 | ||
256 | drm_mode_config_init(drm); | 255 | drm_mode_config_init(drm); |
257 | 256 | ||
258 | err = host1x_drm_init(host1x, drm); | 257 | err = tegra_drm_init(tegra, drm); |
259 | if (err < 0) | 258 | if (err < 0) |
260 | return err; | 259 | return err; |
261 | 260 | ||
@@ -311,9 +310,9 @@ static void host1x_drm_context_free(struct host1x_drm_context *context) | |||
311 | 310 | ||
312 | static void tegra_drm_lastclose(struct drm_device *drm) | 311 | static void tegra_drm_lastclose(struct drm_device *drm) |
313 | { | 312 | { |
314 | struct host1x_drm *host1x = drm->dev_private; | 313 | struct tegra_drm *tegra = drm->dev_private; |
315 | 314 | ||
316 | tegra_fbdev_restore_mode(host1x->fbdev); | 315 | tegra_fbdev_restore_mode(tegra->fbdev); |
317 | } | 316 | } |
318 | 317 | ||
319 | #ifdef CONFIG_DRM_TEGRA_STAGING | 318 | #ifdef CONFIG_DRM_TEGRA_STAGING |
@@ -407,18 +406,18 @@ static int tegra_syncpt_wait(struct drm_device *drm, void *data, | |||
407 | static int tegra_open_channel(struct drm_device *drm, void *data, | 406 | static int tegra_open_channel(struct drm_device *drm, void *data, |
408 | struct drm_file *file) | 407 | struct drm_file *file) |
409 | { | 408 | { |
409 | struct host1x_drm_file *fpriv = file->driver_priv; | ||
410 | struct tegra_drm *tegra = drm->dev_private; | ||
410 | struct drm_tegra_open_channel *args = data; | 411 | struct drm_tegra_open_channel *args = data; |
411 | struct host1x_client *client; | ||
412 | struct host1x_drm_context *context; | 412 | struct host1x_drm_context *context; |
413 | struct host1x_drm_file *fpriv = file->driver_priv; | 413 | struct host1x_client *client; |
414 | struct host1x_drm *host1x = drm->dev_private; | ||
415 | int err = -ENODEV; | 414 | int err = -ENODEV; |
416 | 415 | ||
417 | context = kzalloc(sizeof(*context), GFP_KERNEL); | 416 | context = kzalloc(sizeof(*context), GFP_KERNEL); |
418 | if (!context) | 417 | if (!context) |
419 | return -ENOMEM; | 418 | return -ENOMEM; |
420 | 419 | ||
421 | list_for_each_entry(client, &host1x->clients, list) | 420 | list_for_each_entry(client, &tegra->clients, list) |
422 | if (client->class == args->client) { | 421 | if (client->class == args->client) { |
423 | err = client->ops->open_channel(client, context); | 422 | err = client->ops->open_channel(client, context); |
424 | if (err) | 423 | if (err) |
diff --git a/drivers/gpu/host1x/drm/drm.h b/drivers/gpu/host1x/drm/drm.h index b8d9f433ebfe..858bfc0db78a 100644 --- a/drivers/gpu/host1x/drm/drm.h +++ b/drivers/gpu/host1x/drm/drm.h | |||
@@ -30,13 +30,13 @@ struct tegra_fbdev { | |||
30 | struct tegra_fb *fb; | 30 | struct tegra_fb *fb; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct host1x_drm { | 33 | struct tegra_drm { |
34 | struct drm_device *drm; | 34 | struct drm_device *drm; |
35 | struct device *dev; | 35 | struct device *dev; |
36 | 36 | ||
37 | struct mutex drm_clients_lock; | 37 | struct mutex subdevs_lock; |
38 | struct list_head drm_clients; | 38 | struct list_head subdevs; |
39 | struct list_head drm_active; | 39 | struct list_head active; |
40 | 40 | ||
41 | struct mutex clients_lock; | 41 | struct mutex clients_lock; |
42 | struct list_head clients; | 42 | struct list_head clients; |
@@ -68,7 +68,7 @@ struct host1x_drm_file { | |||
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct host1x_client { | 70 | struct host1x_client { |
71 | struct host1x_drm *host1x; | 71 | struct tegra_drm *tegra; |
72 | struct device *dev; | 72 | struct device *dev; |
73 | 73 | ||
74 | const struct host1x_client_ops *ops; | 74 | const struct host1x_client_ops *ops; |
@@ -82,12 +82,12 @@ struct host1x_client { | |||
82 | struct list_head list; | 82 | struct list_head list; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | extern int host1x_drm_init(struct host1x_drm *host1x, struct drm_device *drm); | 85 | extern int tegra_drm_init(struct tegra_drm *tegra, struct drm_device *drm); |
86 | extern int host1x_drm_exit(struct host1x_drm *host1x); | 86 | extern int tegra_drm_exit(struct tegra_drm *tegra); |
87 | 87 | ||
88 | extern int host1x_register_client(struct host1x_drm *host1x, | 88 | extern int host1x_register_client(struct tegra_drm *tegra, |
89 | struct host1x_client *client); | 89 | struct host1x_client *client); |
90 | extern int host1x_unregister_client(struct host1x_drm *host1x, | 90 | extern int host1x_unregister_client(struct tegra_drm *tegra, |
91 | struct host1x_client *client); | 91 | struct host1x_client *client); |
92 | 92 | ||
93 | struct tegra_output; | 93 | struct tegra_output; |
diff --git a/drivers/gpu/host1x/drm/fb.c b/drivers/gpu/host1x/drm/fb.c index 979a3e32b78b..7dcd7965b4d9 100644 --- a/drivers/gpu/host1x/drm/fb.c +++ b/drivers/gpu/host1x/drm/fb.c | |||
@@ -323,10 +323,10 @@ static void tegra_fbdev_free(struct tegra_fbdev *fbdev) | |||
323 | 323 | ||
324 | static void tegra_fb_output_poll_changed(struct drm_device *drm) | 324 | static void tegra_fb_output_poll_changed(struct drm_device *drm) |
325 | { | 325 | { |
326 | struct host1x_drm *host1x = drm->dev_private; | 326 | struct tegra_drm *tegra = drm->dev_private; |
327 | 327 | ||
328 | if (host1x->fbdev) | 328 | if (tegra->fbdev) |
329 | drm_fb_helper_hotplug_event(&host1x->fbdev->base); | 329 | drm_fb_helper_hotplug_event(&tegra->fbdev->base); |
330 | } | 330 | } |
331 | 331 | ||
332 | static const struct drm_mode_config_funcs tegra_drm_mode_funcs = { | 332 | static const struct drm_mode_config_funcs tegra_drm_mode_funcs = { |
@@ -336,7 +336,7 @@ static const struct drm_mode_config_funcs tegra_drm_mode_funcs = { | |||
336 | 336 | ||
337 | int tegra_drm_fb_init(struct drm_device *drm) | 337 | int tegra_drm_fb_init(struct drm_device *drm) |
338 | { | 338 | { |
339 | struct host1x_drm *host1x = drm->dev_private; | 339 | struct tegra_drm *tegra = drm->dev_private; |
340 | struct tegra_fbdev *fbdev; | 340 | struct tegra_fbdev *fbdev; |
341 | 341 | ||
342 | drm->mode_config.min_width = 0; | 342 | drm->mode_config.min_width = 0; |
@@ -352,16 +352,16 @@ int tegra_drm_fb_init(struct drm_device *drm) | |||
352 | if (IS_ERR(fbdev)) | 352 | if (IS_ERR(fbdev)) |
353 | return PTR_ERR(fbdev); | 353 | return PTR_ERR(fbdev); |
354 | 354 | ||
355 | host1x->fbdev = fbdev; | 355 | tegra->fbdev = fbdev; |
356 | 356 | ||
357 | return 0; | 357 | return 0; |
358 | } | 358 | } |
359 | 359 | ||
360 | void tegra_drm_fb_exit(struct drm_device *drm) | 360 | void tegra_drm_fb_exit(struct drm_device *drm) |
361 | { | 361 | { |
362 | struct host1x_drm *host1x = drm->dev_private; | 362 | struct tegra_drm *tegra = drm->dev_private; |
363 | 363 | ||
364 | tegra_fbdev_free(host1x->fbdev); | 364 | tegra_fbdev_free(tegra->fbdev); |
365 | } | 365 | } |
366 | 366 | ||
367 | void tegra_fbdev_restore_mode(struct tegra_fbdev *fbdev) | 367 | void tegra_fbdev_restore_mode(struct tegra_fbdev *fbdev) |
diff --git a/drivers/gpu/host1x/drm/gr2d.c b/drivers/gpu/host1x/drm/gr2d.c index 27ffcf15a4b4..5f838b191d05 100644 --- a/drivers/gpu/host1x/drm/gr2d.c +++ b/drivers/gpu/host1x/drm/gr2d.c | |||
@@ -256,7 +256,7 @@ static const struct of_device_id gr2d_match[] = { | |||
256 | static int gr2d_probe(struct platform_device *pdev) | 256 | static int gr2d_probe(struct platform_device *pdev) |
257 | { | 257 | { |
258 | struct device *dev = &pdev->dev; | 258 | struct device *dev = &pdev->dev; |
259 | struct host1x_drm *host1x = host1x_get_drm_data(dev->parent); | 259 | struct tegra_drm *tegra = host1x_get_drm_data(dev->parent); |
260 | int err; | 260 | int err; |
261 | struct gr2d *gr2d = NULL; | 261 | struct gr2d *gr2d = NULL; |
262 | struct host1x_syncpt **syncpts; | 262 | struct host1x_syncpt **syncpts; |
@@ -297,7 +297,7 @@ static int gr2d_probe(struct platform_device *pdev) | |||
297 | gr2d->client.syncpts = syncpts; | 297 | gr2d->client.syncpts = syncpts; |
298 | gr2d->client.num_syncpts = 1; | 298 | gr2d->client.num_syncpts = 1; |
299 | 299 | ||
300 | err = host1x_register_client(host1x, &gr2d->client); | 300 | err = host1x_register_client(tegra, &gr2d->client); |
301 | if (err < 0) { | 301 | if (err < 0) { |
302 | dev_err(dev, "failed to register host1x client: %d\n", err); | 302 | dev_err(dev, "failed to register host1x client: %d\n", err); |
303 | return err; | 303 | return err; |
@@ -312,12 +312,12 @@ static int gr2d_probe(struct platform_device *pdev) | |||
312 | 312 | ||
313 | static int __exit gr2d_remove(struct platform_device *pdev) | 313 | static int __exit gr2d_remove(struct platform_device *pdev) |
314 | { | 314 | { |
315 | struct host1x_drm *host1x = host1x_get_drm_data(pdev->dev.parent); | 315 | struct tegra_drm *tegra = host1x_get_drm_data(pdev->dev.parent); |
316 | struct gr2d *gr2d = platform_get_drvdata(pdev); | 316 | struct gr2d *gr2d = platform_get_drvdata(pdev); |
317 | unsigned int i; | 317 | unsigned int i; |
318 | int err; | 318 | int err; |
319 | 319 | ||
320 | err = host1x_unregister_client(host1x, &gr2d->client); | 320 | err = host1x_unregister_client(tegra, &gr2d->client); |
321 | if (err < 0) { | 321 | if (err < 0) { |
322 | dev_err(&pdev->dev, "failed to unregister client: %d\n", err); | 322 | dev_err(&pdev->dev, "failed to unregister client: %d\n", err); |
323 | return err; | 323 | return err; |
diff --git a/drivers/gpu/host1x/drm/hdmi.c b/drivers/gpu/host1x/drm/hdmi.c index 644d95c7d489..e7fb9d92cfcb 100644 --- a/drivers/gpu/host1x/drm/hdmi.c +++ b/drivers/gpu/host1x/drm/hdmi.c | |||
@@ -1181,7 +1181,7 @@ static const struct host1x_client_ops hdmi_client_ops = { | |||
1181 | 1181 | ||
1182 | static int tegra_hdmi_probe(struct platform_device *pdev) | 1182 | static int tegra_hdmi_probe(struct platform_device *pdev) |
1183 | { | 1183 | { |
1184 | struct host1x_drm *host1x = host1x_get_drm_data(pdev->dev.parent); | 1184 | struct tegra_drm *tegra = host1x_get_drm_data(pdev->dev.parent); |
1185 | struct tegra_hdmi *hdmi; | 1185 | struct tegra_hdmi *hdmi; |
1186 | struct resource *regs; | 1186 | struct resource *regs; |
1187 | int err; | 1187 | int err; |
@@ -1256,7 +1256,7 @@ static int tegra_hdmi_probe(struct platform_device *pdev) | |||
1256 | INIT_LIST_HEAD(&hdmi->client.list); | 1256 | INIT_LIST_HEAD(&hdmi->client.list); |
1257 | hdmi->client.dev = &pdev->dev; | 1257 | hdmi->client.dev = &pdev->dev; |
1258 | 1258 | ||
1259 | err = host1x_register_client(host1x, &hdmi->client); | 1259 | err = host1x_register_client(tegra, &hdmi->client); |
1260 | if (err < 0) { | 1260 | if (err < 0) { |
1261 | dev_err(&pdev->dev, "failed to register host1x client: %d\n", | 1261 | dev_err(&pdev->dev, "failed to register host1x client: %d\n", |
1262 | err); | 1262 | err); |
@@ -1270,11 +1270,11 @@ static int tegra_hdmi_probe(struct platform_device *pdev) | |||
1270 | 1270 | ||
1271 | static int tegra_hdmi_remove(struct platform_device *pdev) | 1271 | static int tegra_hdmi_remove(struct platform_device *pdev) |
1272 | { | 1272 | { |
1273 | struct host1x_drm *host1x = host1x_get_drm_data(pdev->dev.parent); | 1273 | struct tegra_drm *tegra = host1x_get_drm_data(pdev->dev.parent); |
1274 | struct tegra_hdmi *hdmi = platform_get_drvdata(pdev); | 1274 | struct tegra_hdmi *hdmi = platform_get_drvdata(pdev); |
1275 | int err; | 1275 | int err; |
1276 | 1276 | ||
1277 | err = host1x_unregister_client(host1x, &hdmi->client); | 1277 | err = host1x_unregister_client(tegra, &hdmi->client); |
1278 | if (err < 0) { | 1278 | if (err < 0) { |
1279 | dev_err(&pdev->dev, "failed to unregister host1x client: %d\n", | 1279 | dev_err(&pdev->dev, "failed to unregister host1x client: %d\n", |
1280 | err); | 1280 | err); |
diff --git a/drivers/gpu/host1x/host1x_client.h b/drivers/gpu/host1x/host1x_client.h index 9b85f10f4a44..6a0bd0268042 100644 --- a/drivers/gpu/host1x/host1x_client.h +++ b/drivers/gpu/host1x/host1x_client.h | |||
@@ -21,9 +21,9 @@ struct device; | |||
21 | struct platform_device; | 21 | struct platform_device; |
22 | 22 | ||
23 | #ifdef CONFIG_DRM_TEGRA | 23 | #ifdef CONFIG_DRM_TEGRA |
24 | int host1x_drm_alloc(struct platform_device *pdev); | 24 | int tegra_drm_alloc(struct platform_device *pdev); |
25 | #else | 25 | #else |
26 | static inline int host1x_drm_alloc(struct platform_device *pdev) | 26 | static inline int tegra_drm_alloc(struct platform_device *pdev) |
27 | { | 27 | { |
28 | return 0; | 28 | return 0; |
29 | } | 29 | } |