aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2017-03-30 02:12:30 -0400
committerBen Skeggs <bskeggs@redhat.com>2017-04-06 00:39:04 -0400
commitb2c4ef70790cee37f243af2b303727394edae1d5 (patch)
treefedb2fc3ab640093c9c1df659d2a63d009ad2d08
parentfa1dbc49725bbd4231fa48f7c42a1ad2dd183786 (diff)
drm/nouveau/gr/gp107: initial support
Forked from GP106 implementation. Differences: - 1 PPC/GPC - Slightly different grctx magics Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h1
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/device/base.c17
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h3
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgp102.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgp107.c47
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h1
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/gp107.c53
9 files changed, 120 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h
index 4e32e78de898..c7944b19bed8 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h
@@ -44,5 +44,6 @@ int gm200_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
44int gm20b_gr_new(struct nvkm_device *, int, struct nvkm_gr **); 44int gm20b_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
45int gp100_gr_new(struct nvkm_device *, int, struct nvkm_gr **); 45int gp100_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
46int gp102_gr_new(struct nvkm_device *, int, struct nvkm_gr **); 46int gp102_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
47int gp107_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
47int gp10b_gr_new(struct nvkm_device *, int, struct nvkm_gr **); 48int gp10b_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
48#endif 49#endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
index 28122cad1a03..b690bc12a5b7 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
@@ -2201,8 +2201,6 @@ nv132_chipset = {
2201 .mc = gp100_mc_new, 2201 .mc = gp100_mc_new,
2202 .mmu = gf100_mmu_new, 2202 .mmu = gf100_mmu_new,
2203 .secboot = gp102_secboot_new, 2203 .secboot = gp102_secboot_new,
2204 .sec2 = gp102_sec2_new,
2205 .nvdec = gp102_nvdec_new,
2206 .pci = gp100_pci_new, 2204 .pci = gp100_pci_new,
2207 .pmu = gp102_pmu_new, 2205 .pmu = gp102_pmu_new,
2208 .timer = gk20a_timer_new, 2206 .timer = gk20a_timer_new,
@@ -2215,6 +2213,8 @@ nv132_chipset = {
2215 .dma = gf119_dma_new, 2213 .dma = gf119_dma_new,
2216 .fifo = gp100_fifo_new, 2214 .fifo = gp100_fifo_new,
2217 .gr = gp102_gr_new, 2215 .gr = gp102_gr_new,
2216 .nvdec = gp102_nvdec_new,
2217 .sec2 = gp102_sec2_new,
2218 .sw = gf100_sw_new, 2218 .sw = gf100_sw_new,
2219}; 2219};
2220 2220
@@ -2235,8 +2235,6 @@ nv134_chipset = {
2235 .mc = gp100_mc_new, 2235 .mc = gp100_mc_new,
2236 .mmu = gf100_mmu_new, 2236 .mmu = gf100_mmu_new,
2237 .secboot = gp102_secboot_new, 2237 .secboot = gp102_secboot_new,
2238 .sec2 = gp102_sec2_new,
2239 .nvdec = gp102_nvdec_new,
2240 .pci = gp100_pci_new, 2238 .pci = gp100_pci_new,
2241 .pmu = gp102_pmu_new, 2239 .pmu = gp102_pmu_new,
2242 .timer = gk20a_timer_new, 2240 .timer = gk20a_timer_new,
@@ -2249,6 +2247,8 @@ nv134_chipset = {
2249 .dma = gf119_dma_new, 2247 .dma = gf119_dma_new,
2250 .fifo = gp100_fifo_new, 2248 .fifo = gp100_fifo_new,
2251 .gr = gp102_gr_new, 2249 .gr = gp102_gr_new,
2250 .nvdec = gp102_nvdec_new,
2251 .sec2 = gp102_sec2_new,
2252 .sw = gf100_sw_new, 2252 .sw = gf100_sw_new,
2253}; 2253};
2254 2254
@@ -2269,8 +2269,6 @@ nv136_chipset = {
2269 .mc = gp100_mc_new, 2269 .mc = gp100_mc_new,
2270 .mmu = gf100_mmu_new, 2270 .mmu = gf100_mmu_new,
2271 .secboot = gp102_secboot_new, 2271 .secboot = gp102_secboot_new,
2272 .sec2 = gp102_sec2_new,
2273 .nvdec = gp102_nvdec_new,
2274 .pci = gp100_pci_new, 2272 .pci = gp100_pci_new,
2275 .pmu = gp102_pmu_new, 2273 .pmu = gp102_pmu_new,
2276 .timer = gk20a_timer_new, 2274 .timer = gk20a_timer_new,
@@ -2283,6 +2281,8 @@ nv136_chipset = {
2283 .dma = gf119_dma_new, 2281 .dma = gf119_dma_new,
2284 .fifo = gp100_fifo_new, 2282 .fifo = gp100_fifo_new,
2285 .gr = gp102_gr_new, 2283 .gr = gp102_gr_new,
2284 .nvdec = gp102_nvdec_new,
2285 .sec2 = gp102_sec2_new,
2286 .sw = gf100_sw_new, 2286 .sw = gf100_sw_new,
2287}; 2287};
2288 2288
@@ -2302,6 +2302,7 @@ nv137_chipset = {
2302 .ltc = gp100_ltc_new, 2302 .ltc = gp100_ltc_new,
2303 .mc = gp100_mc_new, 2303 .mc = gp100_mc_new,
2304 .mmu = gf100_mmu_new, 2304 .mmu = gf100_mmu_new,
2305 .secboot = gp102_secboot_new,
2305 .pci = gp100_pci_new, 2306 .pci = gp100_pci_new,
2306 .pmu = gp102_pmu_new, 2307 .pmu = gp102_pmu_new,
2307 .timer = gk20a_timer_new, 2308 .timer = gk20a_timer_new,
@@ -2313,6 +2314,10 @@ nv137_chipset = {
2313 .disp = gp102_disp_new, 2314 .disp = gp102_disp_new,
2314 .dma = gf119_dma_new, 2315 .dma = gf119_dma_new,
2315 .fifo = gp100_fifo_new, 2316 .fifo = gp100_fifo_new,
2317 .gr = gp107_gr_new,
2318 .nvdec = gp102_nvdec_new,
2319 .sec2 = gp102_sec2_new,
2320 .sw = gf100_sw_new,
2316}; 2321};
2317 2322
2318static const struct nvkm_device_chip 2323static const struct nvkm_device_chip
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild
index 6904932ff863..8a22558b7b52 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild
@@ -33,6 +33,7 @@ nvkm-y += nvkm/engine/gr/gm200.o
33nvkm-y += nvkm/engine/gr/gm20b.o 33nvkm-y += nvkm/engine/gr/gm20b.o
34nvkm-y += nvkm/engine/gr/gp100.o 34nvkm-y += nvkm/engine/gr/gp100.o
35nvkm-y += nvkm/engine/gr/gp102.o 35nvkm-y += nvkm/engine/gr/gp102.o
36nvkm-y += nvkm/engine/gr/gp107.o
36nvkm-y += nvkm/engine/gr/gp10b.o 37nvkm-y += nvkm/engine/gr/gp10b.o
37 38
38nvkm-y += nvkm/engine/gr/ctxnv40.o 39nvkm-y += nvkm/engine/gr/ctxnv40.o
@@ -53,3 +54,4 @@ nvkm-y += nvkm/engine/gr/ctxgm200.o
53nvkm-y += nvkm/engine/gr/ctxgm20b.o 54nvkm-y += nvkm/engine/gr/ctxgm20b.o
54nvkm-y += nvkm/engine/gr/ctxgp100.o 55nvkm-y += nvkm/engine/gr/ctxgp100.o
55nvkm-y += nvkm/engine/gr/ctxgp102.o 56nvkm-y += nvkm/engine/gr/ctxgp102.o
57nvkm-y += nvkm/engine/gr/ctxgp107.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h
index 0ae032fa2909..017180d147cf 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h
@@ -106,6 +106,9 @@ void gp100_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
106void gp100_grctx_generate_pagepool(struct gf100_grctx *); 106void gp100_grctx_generate_pagepool(struct gf100_grctx *);
107 107
108extern const struct gf100_grctx_func gp102_grctx; 108extern const struct gf100_grctx_func gp102_grctx;
109void gp102_grctx_generate_attrib(struct gf100_grctx *);
110
111extern const struct gf100_grctx_func gp107_grctx;
109 112
110/* context init value lists */ 113/* context init value lists */
111 114
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgp102.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgp102.c
index ee26d64af73a..80b7ab0bee3a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgp102.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgp102.c
@@ -29,7 +29,7 @@
29 * PGRAPH context implementation 29 * PGRAPH context implementation
30 ******************************************************************************/ 30 ******************************************************************************/
31 31
32static void 32void
33gp102_grctx_generate_attrib(struct gf100_grctx *info) 33gp102_grctx_generate_attrib(struct gf100_grctx *info)
34{ 34{
35 struct gf100_gr *gr = info->gr; 35 struct gf100_gr *gr = info->gr;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgp107.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgp107.c
new file mode 100644
index 000000000000..8da91a0b3bd2
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgp107.c
@@ -0,0 +1,47 @@
1/*
2 * Copyright 2017 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Ben Skeggs <bskeggs@redhat.com>
23 */
24#include "ctxgf100.h"
25
26#include <subdev/fb.h>
27
28/*******************************************************************************
29 * PGRAPH context implementation
30 ******************************************************************************/
31
32const struct gf100_grctx_func
33gp107_grctx = {
34 .main = gp100_grctx_generate_main,
35 .unkn = gk104_grctx_generate_unkn,
36 .bundle = gm107_grctx_generate_bundle,
37 .bundle_size = 0x3000,
38 .bundle_min_gpm_fifo_depth = 0x180,
39 .bundle_token_limit = 0x300,
40 .pagepool = gp100_grctx_generate_pagepool,
41 .pagepool_size = 0x20000,
42 .attrib = gp102_grctx_generate_attrib,
43 .attrib_nr_max = 0x15de,
44 .attrib_nr = 0x540,
45 .alpha_nr_max = 0xc00,
46 .alpha_nr = 0x800,
47};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
index 22e7c6f44e88..a36e45a4a635 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
@@ -305,4 +305,5 @@ void gm200_gr_init_gpc_mmu(struct gf100_gr *);
305 305
306void gp100_gr_init_num_active_ltcs(struct gf100_gr *gr); 306void gp100_gr_init_num_active_ltcs(struct gf100_gr *gr);
307 307
308void gp102_gr_init_swdx_pes_mask(struct gf100_gr *);
308#endif 309#endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c
index 109fda8eb124..61e3a0b08559 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c
@@ -26,7 +26,7 @@
26 26
27#include <nvif/class.h> 27#include <nvif/class.h>
28 28
29static void 29void
30gp102_gr_init_swdx_pes_mask(struct gf100_gr *gr) 30gp102_gr_init_swdx_pes_mask(struct gf100_gr *gr)
31{ 31{
32 struct nvkm_device *device = gr->base.engine.subdev.device; 32 struct nvkm_device *device = gr->base.engine.subdev.device;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp107.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp107.c
new file mode 100644
index 000000000000..f7272323f694
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp107.c
@@ -0,0 +1,53 @@
1/*
2 * Copyright 2017 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Ben Skeggs <bskeggs@redhat.com>
23 */
24#include "gf100.h"
25#include "ctxgf100.h"
26
27#include <nvif/class.h>
28
29static const struct gf100_gr_func
30gp107_gr = {
31 .init = gp100_gr_init,
32 .init_gpc_mmu = gm200_gr_init_gpc_mmu,
33 .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
34 .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
35 .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask,
36 .init_num_active_ltcs = gp100_gr_init_num_active_ltcs,
37 .rops = gm200_gr_rops,
38 .ppc_nr = 1,
39 .grctx = &gp107_grctx,
40 .sclass = {
41 { -1, -1, FERMI_TWOD_A },
42 { -1, -1, KEPLER_INLINE_TO_MEMORY_B },
43 { -1, -1, PASCAL_B, &gf100_fermi },
44 { -1, -1, PASCAL_COMPUTE_B },
45 {}
46 }
47};
48
49int
50gp107_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
51{
52 return gm200_gr_new_(&gp107_gr, device, index, pgr);
53}