diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/cde_gm20b.c | 53 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/cde_gm20b.h | 23 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 2 |
3 files changed, 78 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/cde_gm20b.c b/drivers/gpu/nvgpu/gm20b/cde_gm20b.c new file mode 100644 index 00000000..d23ba8c5 --- /dev/null +++ b/drivers/gpu/nvgpu/gm20b/cde_gm20b.c | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * GM20B CDE | ||
3 | * | ||
4 | * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
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, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | */ | ||
15 | |||
16 | #include "gk20a/gk20a.h" | ||
17 | #include "cde_gm20b.h" | ||
18 | |||
19 | enum programs { | ||
20 | PROG_HPASS = 0, | ||
21 | PROG_VPASS_LARGE = 1, | ||
22 | PROG_VPASS_SMALL = 2, | ||
23 | PROG_HPASS_DEBUG = 3, | ||
24 | PROG_VPASS_LARGE_DEBUG = 4, | ||
25 | PROG_VPASS_SMALL_DEBUG = 5, | ||
26 | PROG_PASSTHROUGH = 6, | ||
27 | }; | ||
28 | |||
29 | static void gm20b_cde_get_program_numbers(struct gk20a *g, | ||
30 | u32 block_height_log2, | ||
31 | int *hprog_out, int *vprog_out) | ||
32 | { | ||
33 | int hprog = PROG_HPASS; | ||
34 | int vprog = (block_height_log2 >= 2) ? | ||
35 | PROG_VPASS_LARGE : PROG_VPASS_SMALL; | ||
36 | if (g->cde_app.shader_parameter == 1) { | ||
37 | hprog = PROG_PASSTHROUGH; | ||
38 | vprog = PROG_PASSTHROUGH; | ||
39 | } else if (g->cde_app.shader_parameter == 2) { | ||
40 | hprog = PROG_HPASS_DEBUG; | ||
41 | vprog = (block_height_log2 >= 2) ? | ||
42 | PROG_VPASS_LARGE_DEBUG : | ||
43 | PROG_VPASS_SMALL_DEBUG; | ||
44 | } | ||
45 | |||
46 | *hprog_out = hprog; | ||
47 | *vprog_out = vprog; | ||
48 | } | ||
49 | |||
50 | void gm20b_init_cde_ops(struct gpu_ops *gops) | ||
51 | { | ||
52 | gops->cde.get_program_numbers = gm20b_cde_get_program_numbers; | ||
53 | } | ||
diff --git a/drivers/gpu/nvgpu/gm20b/cde_gm20b.h b/drivers/gpu/nvgpu/gm20b/cde_gm20b.h new file mode 100644 index 00000000..66e303f5 --- /dev/null +++ b/drivers/gpu/nvgpu/gm20b/cde_gm20b.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * GM20B CDE | ||
3 | * | ||
4 | * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
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, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _NVHOST_GM20B_CDE | ||
17 | #define _NVHOST_GM20B_CDE | ||
18 | |||
19 | struct gpu_ops; | ||
20 | |||
21 | void gm20b_init_cde_ops(struct gpu_ops *gops); | ||
22 | |||
23 | #endif | ||
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 1ab65836..e32f8943 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/tegra-fuse.h> | 32 | #include <linux/tegra-fuse.h> |
33 | #include "regops_gm20b.h" | 33 | #include "regops_gm20b.h" |
34 | #include "debug_gm20b.h" | 34 | #include "debug_gm20b.h" |
35 | #include "cde_gm20b.h" | ||
35 | 36 | ||
36 | #define FUSE_OPT_PRIV_SEC_DIS_0 0x264 | 37 | #define FUSE_OPT_PRIV_SEC_DIS_0 0x264 |
37 | #define PRIV_SECURITY_DISABLE 0x01 | 38 | #define PRIV_SECURITY_DISABLE 0x01 |
@@ -133,6 +134,7 @@ int gm20b_init_hal(struct gk20a *g) | |||
133 | gm20b_init_clk_ops(gops); | 134 | gm20b_init_clk_ops(gops); |
134 | gm20b_init_regops(gops); | 135 | gm20b_init_regops(gops); |
135 | gm20b_init_debug_ops(gops); | 136 | gm20b_init_debug_ops(gops); |
137 | gm20b_init_cde_ops(gops); | ||
136 | gops->name = "gm20b"; | 138 | gops->name = "gm20b"; |
137 | 139 | ||
138 | c->twod_class = FERMI_TWOD_A; | 140 | c->twod_class = FERMI_TWOD_A; |