summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/cde_gp10b.c
diff options
context:
space:
mode:
authorSami Kiminki <skiminki@nvidia.com>2015-08-18 12:34:51 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:52:07 -0500
commit95a271905918d91468134728079c3025ea58b537 (patch)
treebde976d3e64bb7c92693560a72bbea81040d8dae /drivers/gpu/nvgpu/gp10b/cde_gp10b.c
parent6b2bfcbfe7f4134b7b640cdc61b250d27de5311f (diff)
gpu: nvgpu: Add CDE program number selection for GP10B
Add CDE program number selection for GP10B. Bug 1604102 Change-Id: I0054e670e3bc6b8c2380124eb58204088aaae275 Signed-off-by: Sami Kiminki <skiminki@nvidia.com> Reviewed-on: http://git-master/r/785459 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/cde_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/cde_gp10b.c64
1 files changed, 64 insertions, 0 deletions
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
19enum 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
31static 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
61void gp10b_init_cde_ops(struct gpu_ops *gops)
62{
63 gops->cde.get_program_numbers = gp10b_cde_get_program_numbers;
64}