diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/cde_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/cde_gm20b.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/cde_gm20b.c b/drivers/gpu/nvgpu/common/linux/cde_gm20b.c new file mode 100644 index 00000000..1cd15c54 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/cde_gm20b.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * GM20B CDE | ||
3 | * | ||
4 | * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | * copy of this software and associated documentation files (the "Software"), | ||
8 | * to deal in the Software without restriction, including without limitation | ||
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
10 | * and/or sell copies of the Software, and to permit persons to whom the | ||
11 | * Software is furnished to do so, subject to the following conditions: | ||
12 | * | ||
13 | * The above copyright notice and this permission notice shall be included in | ||
14 | * all copies or substantial portions of the Software. | ||
15 | * | ||
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
22 | * DEALINGS IN THE SOFTWARE. | ||
23 | */ | ||
24 | |||
25 | #include "gk20a/gk20a.h" | ||
26 | #include "cde_gm20b.h" | ||
27 | |||
28 | enum programs { | ||
29 | PROG_HPASS = 0, | ||
30 | PROG_VPASS_LARGE = 1, | ||
31 | PROG_VPASS_SMALL = 2, | ||
32 | PROG_HPASS_DEBUG = 3, | ||
33 | PROG_VPASS_LARGE_DEBUG = 4, | ||
34 | PROG_VPASS_SMALL_DEBUG = 5, | ||
35 | PROG_PASSTHROUGH = 6, | ||
36 | }; | ||
37 | |||
38 | static void gm20b_cde_get_program_numbers(struct gk20a *g, | ||
39 | u32 block_height_log2, | ||
40 | u32 shader_parameter, | ||
41 | int *hprog_out, int *vprog_out) | ||
42 | { | ||
43 | int hprog = PROG_HPASS; | ||
44 | int vprog = (block_height_log2 >= 2) ? | ||
45 | PROG_VPASS_LARGE : PROG_VPASS_SMALL; | ||
46 | if (shader_parameter == 1) { | ||
47 | hprog = PROG_PASSTHROUGH; | ||
48 | vprog = PROG_PASSTHROUGH; | ||
49 | } else if (shader_parameter == 2) { | ||
50 | hprog = PROG_HPASS_DEBUG; | ||
51 | vprog = (block_height_log2 >= 2) ? | ||
52 | PROG_VPASS_LARGE_DEBUG : | ||
53 | PROG_VPASS_SMALL_DEBUG; | ||
54 | } | ||
55 | |||
56 | *hprog_out = hprog; | ||
57 | *vprog_out = vprog; | ||
58 | } | ||
59 | |||
60 | struct nvgpu_os_linux_ops gm20b_cde_ops = { | ||
61 | .cde = { | ||
62 | .get_program_numbers = gm20b_cde_get_program_numbers, | ||
63 | }, | ||
64 | }; | ||