diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2017-03-29 05:31:20 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-04-06 00:39:04 -0400 |
commit | 51751f7db0c9f457318fba2004ca8fe2bb2c0b7e (patch) | |
tree | 7ad7321562049d79043a9c25c3a65ee5ea1a231e /drivers | |
parent | 0af0327cd92a8e2aa1573228a44e97e1a34ff2c1 (diff) |
drm/nouveau/gr: support for GP10B
GR is similar to GP100, with a few unavailable registers.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/gp100.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/gp10b.c | 59 |
6 files changed, 77 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h index 0a636833e0eb..4e32e78de898 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h | |||
@@ -44,4 +44,5 @@ int gm200_gr_new(struct nvkm_device *, int, struct nvkm_gr **); | |||
44 | int gm20b_gr_new(struct nvkm_device *, int, struct nvkm_gr **); | 44 | int gm20b_gr_new(struct nvkm_device *, int, struct nvkm_gr **); |
45 | int gp100_gr_new(struct nvkm_device *, int, struct nvkm_gr **); | 45 | int gp100_gr_new(struct nvkm_device *, int, struct nvkm_gr **); |
46 | int gp102_gr_new(struct nvkm_device *, int, struct nvkm_gr **); | 46 | int gp102_gr_new(struct nvkm_device *, int, struct nvkm_gr **); |
47 | int gp10b_gr_new(struct nvkm_device *, int, struct nvkm_gr **); | ||
47 | #endif | 48 | #endif |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild index 2938ad5aca40..6904932ff863 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 | |||
33 | nvkm-y += nvkm/engine/gr/gm20b.o | 33 | nvkm-y += nvkm/engine/gr/gm20b.o |
34 | nvkm-y += nvkm/engine/gr/gp100.o | 34 | nvkm-y += nvkm/engine/gr/gp100.o |
35 | nvkm-y += nvkm/engine/gr/gp102.o | 35 | nvkm-y += nvkm/engine/gr/gp102.o |
36 | nvkm-y += nvkm/engine/gr/gp10b.o | ||
36 | 37 | ||
37 | nvkm-y += nvkm/engine/gr/ctxnv40.o | 38 | nvkm-y += nvkm/engine/gr/ctxnv40.o |
38 | nvkm-y += nvkm/engine/gr/ctxnv50.o | 39 | nvkm-y += nvkm/engine/gr/ctxnv50.o |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h index 1d2101af2a87..22e7c6f44e88 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h | |||
@@ -125,6 +125,7 @@ struct gf100_gr_func { | |||
125 | void (*init_rop_active_fbps)(struct gf100_gr *); | 125 | void (*init_rop_active_fbps)(struct gf100_gr *); |
126 | void (*init_ppc_exceptions)(struct gf100_gr *); | 126 | void (*init_ppc_exceptions)(struct gf100_gr *); |
127 | void (*init_swdx_pes_mask)(struct gf100_gr *); | 127 | void (*init_swdx_pes_mask)(struct gf100_gr *); |
128 | void (*init_num_active_ltcs)(struct gf100_gr *); | ||
128 | void (*set_hww_esr_report_mask)(struct gf100_gr *); | 129 | void (*set_hww_esr_report_mask)(struct gf100_gr *); |
129 | const struct gf100_gr_pack *mmio; | 130 | const struct gf100_gr_pack *mmio; |
130 | struct { | 131 | struct { |
@@ -301,4 +302,7 @@ extern const struct gf100_gr_init gm107_gr_init_cbm_0[]; | |||
301 | void gm107_gr_init_bios(struct gf100_gr *); | 302 | void gm107_gr_init_bios(struct gf100_gr *); |
302 | 303 | ||
303 | void gm200_gr_init_gpc_mmu(struct gf100_gr *); | 304 | void gm200_gr_init_gpc_mmu(struct gf100_gr *); |
305 | |||
306 | void gp100_gr_init_num_active_ltcs(struct gf100_gr *gr); | ||
307 | |||
304 | #endif | 308 | #endif |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp100.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp100.c index 94ed7debb714..867a5f7cc5bc 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp100.c | |||
@@ -40,6 +40,15 @@ gp100_gr_init_rop_active_fbps(struct gf100_gr *gr) | |||
40 | nvkm_mask(device, 0x408958, 0x0000000f, fbp_count); /* crop */ | 40 | nvkm_mask(device, 0x408958, 0x0000000f, fbp_count); /* crop */ |
41 | } | 41 | } |
42 | 42 | ||
43 | void | ||
44 | gp100_gr_init_num_active_ltcs(struct gf100_gr *gr) | ||
45 | { | ||
46 | struct nvkm_device *device = gr->base.engine.subdev.device; | ||
47 | |||
48 | nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800)); | ||
49 | nvkm_wr32(device, GPC_BCAST(0x033c), nvkm_rd32(device, 0x100804)); | ||
50 | } | ||
51 | |||
43 | int | 52 | int |
44 | gp100_gr_init(struct gf100_gr *gr) | 53 | gp100_gr_init(struct gf100_gr *gr) |
45 | { | 54 | { |
@@ -81,8 +90,7 @@ gp100_gr_init(struct gf100_gr *gr) | |||
81 | } | 90 | } |
82 | 91 | ||
83 | nvkm_wr32(device, GPC_BCAST(0x3fd4), magicgpc918); | 92 | nvkm_wr32(device, GPC_BCAST(0x3fd4), magicgpc918); |
84 | nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800)); | 93 | gr->func->init_num_active_ltcs(gr); |
85 | nvkm_wr32(device, GPC_BCAST(0x033c), nvkm_rd32(device, 0x100804)); | ||
86 | 94 | ||
87 | gr->func->init_rop_active_fbps(gr); | 95 | gr->func->init_rop_active_fbps(gr); |
88 | if (gr->func->init_swdx_pes_mask) | 96 | if (gr->func->init_swdx_pes_mask) |
@@ -154,6 +162,7 @@ gp100_gr = { | |||
154 | .init_gpc_mmu = gm200_gr_init_gpc_mmu, | 162 | .init_gpc_mmu = gm200_gr_init_gpc_mmu, |
155 | .init_rop_active_fbps = gp100_gr_init_rop_active_fbps, | 163 | .init_rop_active_fbps = gp100_gr_init_rop_active_fbps, |
156 | .init_ppc_exceptions = gk104_gr_init_ppc_exceptions, | 164 | .init_ppc_exceptions = gk104_gr_init_ppc_exceptions, |
165 | .init_num_active_ltcs = gp100_gr_init_num_active_ltcs, | ||
157 | .rops = gm200_gr_rops, | 166 | .rops = gm200_gr_rops, |
158 | .ppc_nr = 2, | 167 | .ppc_nr = 2, |
159 | .grctx = &gp100_grctx, | 168 | .grctx = &gp100_grctx, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c index 1d5117a16299..109fda8eb124 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c | |||
@@ -47,6 +47,7 @@ gp102_gr = { | |||
47 | .init_rop_active_fbps = gp100_gr_init_rop_active_fbps, | 47 | .init_rop_active_fbps = gp100_gr_init_rop_active_fbps, |
48 | .init_ppc_exceptions = gk104_gr_init_ppc_exceptions, | 48 | .init_ppc_exceptions = gk104_gr_init_ppc_exceptions, |
49 | .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask, | 49 | .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask, |
50 | .init_num_active_ltcs = gp100_gr_init_num_active_ltcs, | ||
50 | .rops = gm200_gr_rops, | 51 | .rops = gm200_gr_rops, |
51 | .ppc_nr = 3, | 52 | .ppc_nr = 3, |
52 | .grctx = &gp102_grctx, | 53 | .grctx = &gp102_grctx, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp10b.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp10b.c new file mode 100644 index 000000000000..5f3d161a0842 --- /dev/null +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gp10b.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | #include "gf100.h" | ||
24 | #include "ctxgf100.h" | ||
25 | |||
26 | #include <nvif/class.h> | ||
27 | |||
28 | static void | ||
29 | gp10b_gr_init_num_active_ltcs(struct gf100_gr *gr) | ||
30 | { | ||
31 | struct nvkm_device *device = gr->base.engine.subdev.device; | ||
32 | |||
33 | nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800)); | ||
34 | } | ||
35 | |||
36 | static const struct gf100_gr_func | ||
37 | gp10b_gr = { | ||
38 | .init = gp100_gr_init, | ||
39 | .init_gpc_mmu = gm200_gr_init_gpc_mmu, | ||
40 | .init_rop_active_fbps = gp100_gr_init_rop_active_fbps, | ||
41 | .init_ppc_exceptions = gk104_gr_init_ppc_exceptions, | ||
42 | .init_num_active_ltcs = gp10b_gr_init_num_active_ltcs, | ||
43 | .rops = gm200_gr_rops, | ||
44 | .ppc_nr = 1, | ||
45 | .grctx = &gp102_grctx, | ||
46 | .sclass = { | ||
47 | { -1, -1, FERMI_TWOD_A }, | ||
48 | { -1, -1, KEPLER_INLINE_TO_MEMORY_B }, | ||
49 | { -1, -1, PASCAL_A, &gf100_fermi }, | ||
50 | { -1, -1, PASCAL_COMPUTE_A }, | ||
51 | {} | ||
52 | } | ||
53 | }; | ||
54 | |||
55 | int | ||
56 | gp10b_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr) | ||
57 | { | ||
58 | return gm200_gr_new_(&gp10b_gr, device, index, pgr); | ||
59 | } | ||