diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/Makefile | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/cde_gp10b.c | 64 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/cde_gp10b.h | 23 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 2 |
4 files changed, 91 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/Makefile b/drivers/gpu/nvgpu/gp10b/Makefile index 688965da..ad198327 100644 --- a/drivers/gpu/nvgpu/gp10b/Makefile +++ b/drivers/gpu/nvgpu/gp10b/Makefile | |||
@@ -22,6 +22,7 @@ obj-$(CONFIG_GK20A) += \ | |||
22 | hal_gp10b.o \ | 22 | hal_gp10b.o \ |
23 | rpfb_gp10b.o \ | 23 | rpfb_gp10b.o \ |
24 | gp10b_gating_reglist.o \ | 24 | gp10b_gating_reglist.o \ |
25 | regops_gp10b.o | 25 | regops_gp10b.o \ |
26 | cde_gp10b.o | ||
26 | 27 | ||
27 | obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o | 28 | obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o |
diff --git a/drivers/gpu/nvgpu/gp10b/cde_gp10b.c b/drivers/gpu/nvgpu/gp10b/cde_gp10b.c new file mode 100644 index 00000000..acb8aee3 --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/cde_gp10b.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * GP10B 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_gp10b.h" | ||
18 | |||
19 | enum gp10b_programs { | ||
20 | GP10B_PROG_HPASS = 0, | ||
21 | GP10B_PROG_HPASS_4K = 1, | ||
22 | GP10B_PROG_VPASS = 2, | ||
23 | GP10B_PROG_VPASS_4K = 3, | ||
24 | GP10B_PROG_HPASS_DEBUG = 4, | ||
25 | GP10B_PROG_HPASS_4K_DEBUG = 5, | ||
26 | GP10B_PROG_VPASS_DEBUG = 6, | ||
27 | GP10B_PROG_VPASS_4K_DEBUG = 7, | ||
28 | GP10B_PROG_PASSTHROUGH = 8, | ||
29 | }; | ||
30 | |||
31 | static void gp10b_cde_get_program_numbers(struct gk20a *g, | ||
32 | u32 block_height_log2, | ||
33 | int *hprog_out, int *vprog_out) | ||
34 | { | ||
35 | int hprog, vprog; | ||
36 | |||
37 | if (g->cde_app.shader_parameter == 1) { | ||
38 | hprog = GP10B_PROG_PASSTHROUGH; | ||
39 | vprog = GP10B_PROG_PASSTHROUGH; | ||
40 | } else { | ||
41 | hprog = GP10B_PROG_HPASS; | ||
42 | vprog = GP10B_PROG_VPASS; | ||
43 | if (g->cde_app.shader_parameter == 2) { | ||
44 | hprog = GP10B_PROG_HPASS_DEBUG; | ||
45 | vprog = GP10B_PROG_VPASS_DEBUG; | ||
46 | } | ||
47 | if (g->mm.bypass_smmu) { | ||
48 | if (!g->mm.disable_bigpage) { | ||
49 | gk20a_warn(&g->dev->dev, | ||
50 | "when bypass_smmu is 1, disable_bigpage must be 1 too"); | ||
51 | } | ||
52 | hprog |= 1; | ||
53 | vprog |= 1; | ||
54 | } | ||
55 | } | ||
56 | |||
57 | *hprog_out = hprog; | ||
58 | *vprog_out = vprog; | ||
59 | } | ||
60 | |||
61 | void gp10b_init_cde_ops(struct gpu_ops *gops) | ||
62 | { | ||
63 | gops->cde.get_program_numbers = gp10b_cde_get_program_numbers; | ||
64 | } | ||
diff --git a/drivers/gpu/nvgpu/gp10b/cde_gp10b.h b/drivers/gpu/nvgpu/gp10b/cde_gp10b.h new file mode 100644 index 00000000..52f785f1 --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/cde_gp10b.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * GP10B 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_GP10B_CDE | ||
17 | #define _NVHOST_GP10B_CDE | ||
18 | |||
19 | struct gpu_ops; | ||
20 | |||
21 | void gp10b_init_cde_ops(struct gpu_ops *gops); | ||
22 | |||
23 | #endif | ||
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 9eba5571..983b985d 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "gp10b/fifo_gp10b.h" | 31 | #include "gp10b/fifo_gp10b.h" |
32 | #include "gp10b/gp10b_gating_reglist.h" | 32 | #include "gp10b/gp10b_gating_reglist.h" |
33 | #include "gp10b/regops_gp10b.h" | 33 | #include "gp10b/regops_gp10b.h" |
34 | #include "gp10b/cde_gp10b.h" | ||
34 | 35 | ||
35 | #include "gm20b/gr_gm20b.h" | 36 | #include "gm20b/gr_gm20b.h" |
36 | #include "gm20b/fifo_gm20b.h" | 37 | #include "gm20b/fifo_gm20b.h" |
@@ -103,6 +104,7 @@ int gp10b_init_hal(struct gk20a *g) | |||
103 | gp10b_init_pmu_ops(gops); | 104 | gp10b_init_pmu_ops(gops); |
104 | gk20a_init_debug_ops(gops); | 105 | gk20a_init_debug_ops(gops); |
105 | gp10b_init_regops(gops); | 106 | gp10b_init_regops(gops); |
107 | gp10b_init_cde_ops(gops); | ||
106 | gops->name = "gp10b"; | 108 | gops->name = "gp10b"; |
107 | 109 | ||
108 | c->twod_class = FERMI_TWOD_A; | 110 | c->twod_class = FERMI_TWOD_A; |