summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gp10b/Makefile1
-rw-r--r--drivers/gpu/nvgpu/gp10b/fb_gp10b.c96
-rw-r--r--drivers/gpu/nvgpu/gp10b/fb_gp10b.h21
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c4
-rw-r--r--drivers/gpu/nvgpu/gp10b/hw_gmmu_gp10b.h28
5 files changed, 148 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/Makefile b/drivers/gpu/nvgpu/gp10b/Makefile
index ecb09cf6..6f1fb9e2 100644
--- a/drivers/gpu/nvgpu/gp10b/Makefile
+++ b/drivers/gpu/nvgpu/gp10b/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_GK20A) += \
13 mc_gp10b.o \ 13 mc_gp10b.o \
14 ltc_gp10b.o \ 14 ltc_gp10b.o \
15 mm_gp10b.o \ 15 mm_gp10b.o \
16 fb_gp10b.o \
16 hal_gp10b.o 17 hal_gp10b.o
17 18
18obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o 19obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o
diff --git a/drivers/gpu/nvgpu/gp10b/fb_gp10b.c b/drivers/gpu/nvgpu/gp10b/fb_gp10b.c
new file mode 100644
index 00000000..df35c5b0
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/fb_gp10b.c
@@ -0,0 +1,96 @@
1/*
2 * GP10B FB
3 *
4 * Copyright (c) 2014, 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 <linux/types.h>
17
18#include "gk20a/gk20a.h"
19#include "gm20b/fb_gm20b.h"
20#include "gk20a/kind_gk20a.h"
21
22#include "hw_gmmu_gp10b.h"
23
24static void gp10b_init_uncompressed_kind_map(void)
25{
26 gm20b_init_uncompressed_kind_map();
27
28 gk20a_uc_kind_map[gmmu_pte_kind_z16_2cz_v()] =
29 gk20a_uc_kind_map[gmmu_pte_kind_z16_ms2_2cz_v()] =
30 gk20a_uc_kind_map[gmmu_pte_kind_z16_ms4_2cz_v()] =
31 gk20a_uc_kind_map[gmmu_pte_kind_z16_ms8_2cz_v()] =
32 gk20a_uc_kind_map[gmmu_pte_kind_z16_ms16_2cz_v()] =
33 gmmu_pte_kind_z16_v();
34
35 gk20a_uc_kind_map[gmmu_pte_kind_c32_ms4_4cbra_v()] =
36 gk20a_uc_kind_map[gmmu_pte_kind_c64_ms4_4cbra_v()] =
37 gmmu_pte_kind_generic_16bx2_v();
38}
39
40static bool gp10b_kind_supported(u8 k)
41{
42 return (k >= gmmu_pte_kind_z16_2cz_v() &&
43 k <= gmmu_pte_kind_z16_ms8_2cz_v())
44 || k == gmmu_pte_kind_z16_ms16_2cz_v()
45 || k == gmmu_pte_kind_c32_ms4_4cbra_v()
46 || k == gmmu_pte_kind_c64_ms4_4cbra_v();
47}
48
49static bool gp10b_kind_z(u8 k)
50{
51 return (k >= gmmu_pte_kind_z16_2cz_v() &&
52 k <= gmmu_pte_kind_z16_ms8_2cz_v()) ||
53 k == gmmu_pte_kind_z16_ms16_2cz_v();
54}
55
56static bool gp10b_kind_compressible(u8 k)
57{
58 return (k >= gmmu_pte_kind_z16_2cz_v() &&
59 k <= gmmu_pte_kind_z16_ms8_2cz_v()) ||
60 k == gmmu_pte_kind_z16_ms16_2cz_v() ||
61 (k >= gmmu_pte_kind_z16_4cz_v() &&
62 k <= gmmu_pte_kind_z16_ms16_4cz_v());
63}
64
65static bool gp10b_kind_zbc(u8 k)
66{
67 return (k >= gmmu_pte_kind_z16_2cz_v() &&
68 k <= gmmu_pte_kind_z16_ms8_2cz_v()) ||
69 k == gmmu_pte_kind_z16_ms16_2cz_v();
70}
71
72static void gp10b_init_kind_attr(void)
73{
74 u16 k;
75
76 gm20b_init_kind_attr();
77
78 for (k = 0; k < 256; k++) {
79 if (gp10b_kind_supported((u8)k))
80 gk20a_kind_attr[k] |= GK20A_KIND_ATTR_SUPPORTED;
81 if (gp10b_kind_compressible((u8)k))
82 gk20a_kind_attr[k] |= GK20A_KIND_ATTR_COMPRESSIBLE;
83 if (gp10b_kind_z((u8)k))
84 gk20a_kind_attr[k] |= GK20A_KIND_ATTR_Z;
85 if (gp10b_kind_zbc((u8)k))
86 gk20a_kind_attr[k] |= GK20A_KIND_ATTR_ZBC;
87 }
88}
89
90void gp10b_init_fb(struct gpu_ops *gops)
91{
92 gm20b_init_fb(gops);
93
94 gp10b_init_uncompressed_kind_map();
95 gp10b_init_kind_attr();
96}
diff --git a/drivers/gpu/nvgpu/gp10b/fb_gp10b.h b/drivers/gpu/nvgpu/gp10b/fb_gp10b.h
new file mode 100644
index 00000000..76efd331
--- /dev/null
+++ b/drivers/gpu/nvgpu/gp10b/fb_gp10b.h
@@ -0,0 +1,21 @@
1/*
2 * GP10B FB
3 *
4 * Copyright (c) 2014, 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 _NVGPU_GP10B_FB
17#define _NVGPU_GP10B_FB
18struct gpu_ops;
19
20void gp10b_init_fb(struct gpu_ops *gops);
21#endif
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index acd1b73c..a739ce77 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -24,9 +24,9 @@
24#include "gp10b/mc_gp10b.h" 24#include "gp10b/mc_gp10b.h"
25#include "gp10b/ltc_gp10b.h" 25#include "gp10b/ltc_gp10b.h"
26#include "gp10b/mm_gp10b.h" 26#include "gp10b/mm_gp10b.h"
27#include "gp10b/fb_gp10b.h"
27 28
28#include "gm20b/gr_gm20b.h" 29#include "gm20b/gr_gm20b.h"
29#include "gm20b/fb_gm20b.h"
30#include "gm20b/gm20b_gating_reglist.h" 30#include "gm20b/gm20b_gating_reglist.h"
31#include "gm20b/fifo_gm20b.h" 31#include "gm20b/fifo_gm20b.h"
32#include "gm20b/gr_ctx_gm20b.h" 32#include "gm20b/gr_ctx_gm20b.h"
@@ -91,7 +91,7 @@ int gp10b_init_hal(struct gk20a *g)
91 gp10b_init_mc(gops); 91 gp10b_init_mc(gops);
92 gp10b_init_gr(gops); 92 gp10b_init_gr(gops);
93 gp10b_init_ltc(gops); 93 gp10b_init_ltc(gops);
94 gm20b_init_fb(gops); 94 gp10b_init_fb(gops);
95 gm20b_init_fifo(gops); 95 gm20b_init_fifo(gops);
96 gm20b_init_gr_ctx(gops); 96 gm20b_init_gr_ctx(gops);
97 gp10b_init_mm(gops); 97 gp10b_init_mm(gops);
diff --git a/drivers/gpu/nvgpu/gp10b/hw_gmmu_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_gmmu_gp10b.h
index f6020434..5a0f9fe2 100644
--- a/drivers/gpu/nvgpu/gp10b/hw_gmmu_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/hw_gmmu_gp10b.h
@@ -270,6 +270,26 @@ static inline u32 gmmu_pte_kind_z16_ms16_2z_v(void)
270{ 270{
271 return 0x0000000b; 271 return 0x0000000b;
272} 272}
273static inline u32 gmmu_pte_kind_z16_2cz_v(void)
274{
275 return 0x00000036;
276}
277static inline u32 gmmu_pte_kind_z16_ms2_2cz_v(void)
278{
279 return 0x00000037;
280}
281static inline u32 gmmu_pte_kind_z16_ms4_2cz_v(void)
282{
283 return 0x00000038;
284}
285static inline u32 gmmu_pte_kind_z16_ms8_2cz_v(void)
286{
287 return 0x00000039;
288}
289static inline u32 gmmu_pte_kind_z16_ms16_2cz_v(void)
290{
291 return 0x0000005f;
292}
273static inline u32 gmmu_pte_kind_z16_4cz_v(void) 293static inline u32 gmmu_pte_kind_z16_4cz_v(void)
274{ 294{
275 return 0x0000000c; 295 return 0x0000000c;
@@ -1026,6 +1046,10 @@ static inline u32 gmmu_pte_kind_c32_ms4_2bra_v(void)
1026{ 1046{
1027 return 0x000000e3; 1047 return 0x000000e3;
1028} 1048}
1049static inline u32 gmmu_pte_kind_c32_ms4_4cbra_v(void)
1050{
1051 return 0x0000002c;
1052}
1029static inline u32 gmmu_pte_kind_c32_ms8_ms16_2c_v(void) 1053static inline u32 gmmu_pte_kind_c32_ms8_ms16_2c_v(void)
1030{ 1054{
1031 return 0x000000e4; 1055 return 0x000000e4;
@@ -1086,6 +1110,10 @@ static inline u32 gmmu_pte_kind_c64_ms4_2bra_v(void)
1086{ 1110{
1087 return 0x000000f1; 1111 return 0x000000f1;
1088} 1112}
1113static inline u32 gmmu_pte_kind_c64_ms4_4cbra_v(void)
1114{
1115 return 0x0000002d;
1116}
1089static inline u32 gmmu_pte_kind_c64_ms8_ms16_2c_v(void) 1117static inline u32 gmmu_pte_kind_c64_ms8_ms16_2c_v(void)
1090{ 1118{
1091 return 0x000000f2; 1119 return 0x000000f2;