diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/debug_gk20a.c | 36 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/debug_gk20a.h | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/hal_gk20a.c | 3 |
4 files changed, 41 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c index 602d713b..1351304d 100644 --- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/video/tegra/host/t20/debug_gk20a.c | 2 | * drivers/video/tegra/host/t20/debug_gk20a.c |
3 | * | 3 | * |
4 | * Copyright (C) 2011-2014 NVIDIA Corporation. All rights reserved. | 4 | * Copyright (C) 2011-2015 NVIDIA Corporation. All rights reserved. |
5 | * | 5 | * |
6 | * This software is licensed under the terms of the GNU General Public | 6 | * This software is licensed under the terms of the GNU General Public |
7 | * License version 2, as published by the Free Software Foundation, and | 7 | * License version 2, as published by the Free Software Foundation, and |
@@ -34,12 +34,6 @@ | |||
34 | unsigned int gk20a_debug_trace_cmdbuf; | 34 | unsigned int gk20a_debug_trace_cmdbuf; |
35 | static struct platform_device *gk20a_device; | 35 | static struct platform_device *gk20a_device; |
36 | 36 | ||
37 | struct gk20a_debug_output { | ||
38 | void (*fn)(void *ctx, const char *str, size_t len); | ||
39 | void *ctx; | ||
40 | char buf[256]; | ||
41 | }; | ||
42 | |||
43 | static const char * const ccsr_chan_status_str[] = { | 37 | static const char * const ccsr_chan_status_str[] = { |
44 | "idle", | 38 | "idle", |
45 | "pending", | 39 | "pending", |
@@ -160,11 +154,8 @@ static void gk20a_debug_show_channel(struct gk20a *g, | |||
160 | gk20a_debug_output(o, "\n"); | 154 | gk20a_debug_output(o, "\n"); |
161 | } | 155 | } |
162 | 156 | ||
163 | static void gk20a_debug_show_dump(struct platform_device *pdev, | 157 | void gk20a_debug_show_dump(struct gk20a *g, struct gk20a_debug_output *o) |
164 | struct gk20a_debug_output *o) | ||
165 | { | 158 | { |
166 | struct gk20a_platform *platform = gk20a_get_platform(pdev); | ||
167 | struct gk20a *g = platform->g; | ||
168 | struct fifo_gk20a *f = &g->fifo; | 159 | struct fifo_gk20a *f = &g->fifo; |
169 | u32 chid; | 160 | u32 chid; |
170 | int i, err; | 161 | int i, err; |
@@ -235,6 +226,7 @@ static void gk20a_debug_show_dump(struct platform_device *pdev, | |||
235 | void gk20a_debug_dump(struct platform_device *pdev) | 226 | void gk20a_debug_dump(struct platform_device *pdev) |
236 | { | 227 | { |
237 | struct gk20a_platform *platform = gk20a_get_platform(pdev); | 228 | struct gk20a_platform *platform = gk20a_get_platform(pdev); |
229 | struct gk20a *g = platform->g; | ||
238 | struct gk20a_debug_output o = { | 230 | struct gk20a_debug_output o = { |
239 | .fn = gk20a_debug_write_printk | 231 | .fn = gk20a_debug_write_printk |
240 | }; | 232 | }; |
@@ -242,7 +234,9 @@ void gk20a_debug_dump(struct platform_device *pdev) | |||
242 | if (platform->dump_platform_dependencies) | 234 | if (platform->dump_platform_dependencies) |
243 | platform->dump_platform_dependencies(pdev); | 235 | platform->dump_platform_dependencies(pdev); |
244 | 236 | ||
245 | gk20a_debug_show_dump(pdev, &o); | 237 | /* HAL only initialized after 1st power-on */ |
238 | if (g->ops.debug.show_dump) | ||
239 | g->ops.debug.show_dump(g, &o); | ||
246 | } | 240 | } |
247 | 241 | ||
248 | void gk20a_debug_dump_device(struct platform_device *pdev) | 242 | void gk20a_debug_dump_device(struct platform_device *pdev) |
@@ -250,6 +244,7 @@ void gk20a_debug_dump_device(struct platform_device *pdev) | |||
250 | struct gk20a_debug_output o = { | 244 | struct gk20a_debug_output o = { |
251 | .fn = gk20a_debug_write_printk | 245 | .fn = gk20a_debug_write_printk |
252 | }; | 246 | }; |
247 | struct gk20a *g; | ||
253 | 248 | ||
254 | /* Dump the first device if no info is provided */ | 249 | /* Dump the first device if no info is provided */ |
255 | if (!pdev) { | 250 | if (!pdev) { |
@@ -259,7 +254,10 @@ void gk20a_debug_dump_device(struct platform_device *pdev) | |||
259 | pdev = gk20a_device; | 254 | pdev = gk20a_device; |
260 | } | 255 | } |
261 | 256 | ||
262 | gk20a_debug_show_dump(pdev, &o); | 257 | g = gk20a_get_platform(pdev)->g; |
258 | /* HAL only initialized after 1st power-on */ | ||
259 | if (g->ops.debug.show_dump) | ||
260 | g->ops.debug.show_dump(g, &o); | ||
263 | } | 261 | } |
264 | EXPORT_SYMBOL(gk20a_debug_dump_device); | 262 | EXPORT_SYMBOL(gk20a_debug_dump_device); |
265 | 263 | ||
@@ -270,7 +268,12 @@ static int gk20a_debug_show(struct seq_file *s, void *unused) | |||
270 | .fn = gk20a_debug_write_to_seqfile, | 268 | .fn = gk20a_debug_write_to_seqfile, |
271 | .ctx = s, | 269 | .ctx = s, |
272 | }; | 270 | }; |
273 | gk20a_debug_show_dump(pdev, &o); | 271 | struct gk20a *g; |
272 | |||
273 | g = gk20a_get_platform(pdev)->g; | ||
274 | /* HAL only initialized after 1st power-on */ | ||
275 | if (g->ops.debug.show_dump) | ||
276 | g->ops.debug.show_dump(g, &o); | ||
274 | return 0; | 277 | return 0; |
275 | } | 278 | } |
276 | 279 | ||
@@ -286,6 +289,11 @@ static const struct file_operations gk20a_debug_fops = { | |||
286 | .release = single_release, | 289 | .release = single_release, |
287 | }; | 290 | }; |
288 | 291 | ||
292 | void gk20a_init_debug_ops(struct gpu_ops *gops) | ||
293 | { | ||
294 | gops->debug.show_dump = gk20a_debug_show_dump; | ||
295 | } | ||
296 | |||
289 | void gk20a_debug_init(struct platform_device *pdev) | 297 | void gk20a_debug_init(struct platform_device *pdev) |
290 | { | 298 | { |
291 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | 299 | struct gk20a_platform *platform = platform_get_drvdata(pdev); |
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.h b/drivers/gpu/nvgpu/gk20a/debug_gk20a.h index c70b19d9..30c87f35 100644 --- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GK20A Debug functionality | 2 | * GK20A Debug functionality |
3 | * | 3 | * |
4 | * Copyright (C) 2011-2014 NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (C) 2011-2015 NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This software is licensed under the terms of the GNU General Public | 6 | * This software is licensed under the terms of the GNU General Public |
7 | * License version 2, as published by the Free Software Foundation, and | 7 | * License version 2, as published by the Free Software Foundation, and |
@@ -18,10 +18,20 @@ | |||
18 | #define _DEBUG_GK20A_H_ | 18 | #define _DEBUG_GK20A_H_ |
19 | 19 | ||
20 | struct platform_device; | 20 | struct platform_device; |
21 | struct gk20a; | ||
22 | struct gpu_ops; | ||
21 | 23 | ||
22 | extern unsigned int gk20a_debug_trace_cmdbuf; | 24 | extern unsigned int gk20a_debug_trace_cmdbuf; |
23 | 25 | ||
26 | struct gk20a_debug_output { | ||
27 | void (*fn)(void *ctx, const char *str, size_t len); | ||
28 | void *ctx; | ||
29 | char buf[256]; | ||
30 | }; | ||
31 | |||
24 | void gk20a_debug_dump(struct platform_device *pdev); | 32 | void gk20a_debug_dump(struct platform_device *pdev); |
33 | void gk20a_debug_show_dump(struct gk20a *g, struct gk20a_debug_output *o); | ||
25 | void gk20a_debug_init(struct platform_device *pdev); | 34 | void gk20a_debug_init(struct platform_device *pdev); |
35 | void gk20a_init_debug_ops(struct gpu_ops *gops); | ||
26 | 36 | ||
27 | #endif | 37 | #endif |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 4ddea431..9bb890ca 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GK20A Graphics | 2 | * GK20A Graphics |
3 | * | 3 | * |
4 | * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -47,6 +47,7 @@ struct acr_gm20b; | |||
47 | #include "platform_gk20a.h" | 47 | #include "platform_gk20a.h" |
48 | #include "gm20b/acr_gm20b.h" | 48 | #include "gm20b/acr_gm20b.h" |
49 | #include "cde_gk20a.h" | 49 | #include "cde_gk20a.h" |
50 | #include "debug_gk20a.h" | ||
50 | 51 | ||
51 | struct cooling_device_gk20a { | 52 | struct cooling_device_gk20a { |
52 | struct thermal_cooling_device *gk20a_cooling_dev; | 53 | struct thermal_cooling_device *gk20a_cooling_dev; |
@@ -367,6 +368,10 @@ struct gpu_ops { | |||
367 | irqreturn_t (*isr_thread_nonstall)(struct gk20a *g); | 368 | irqreturn_t (*isr_thread_nonstall)(struct gk20a *g); |
368 | u32 intr_mask_restore[4]; | 369 | u32 intr_mask_restore[4]; |
369 | } mc; | 370 | } mc; |
371 | struct { | ||
372 | void (*show_dump)(struct gk20a *g, | ||
373 | struct gk20a_debug_output *o); | ||
374 | } debug; | ||
370 | }; | 375 | }; |
371 | 376 | ||
372 | struct gk20a { | 377 | struct gk20a { |
diff --git a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c index ada2f034..0e97d551 100644 --- a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * GK20A Tegra HAL interface. | 4 | * GK20A Tegra HAL interface. |
5 | * | 5 | * |
6 | * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. | 6 | * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify it | 8 | * This program is free software; you can redistribute it and/or modify it |
9 | * under the terms and conditions of the GNU General Public License, | 9 | * under the terms and conditions of the GNU General Public License, |
@@ -62,6 +62,7 @@ int gk20a_init_hal(struct gk20a *g) | |||
62 | gk20a_init_pmu_ops(gops); | 62 | gk20a_init_pmu_ops(gops); |
63 | gk20a_init_clk_ops(gops); | 63 | gk20a_init_clk_ops(gops); |
64 | gk20a_init_regops(gops); | 64 | gk20a_init_regops(gops); |
65 | gk20a_init_debug_ops(gops); | ||
65 | gops->name = "gk20a"; | 66 | gops->name = "gk20a"; |
66 | 67 | ||
67 | c->twod_class = FERMI_TWOD_A; | 68 | c->twod_class = FERMI_TWOD_A; |