Skip to content

Commit c4bdac7

Browse files
author
Ben Skeggs
committed
drm/nouveau/gr/ga102: initial support
v2: - whitespace Signed-off-by: Ben Skeggs <[email protected]> Signed-off-by: Gourav Samaiya <[email protected]>
1 parent 21e938d commit c4bdac7

File tree

15 files changed

+565
-9
lines changed

15 files changed

+565
-9
lines changed

drivers/gpu/drm/nouveau/include/nvif/class.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@
190190

191191
#define TURING_A /* cl9097.h */ 0x0000c597
192192

193+
#define AMPERE_B /* cl9097.h */ 0x0000c797
194+
193195
#define NV74_BSP 0x000074b0
194196

195197
#define GT212_MSVLD 0x000085b1
@@ -234,6 +236,7 @@
234236
#define PASCAL_COMPUTE_B 0x0000c1c0
235237
#define VOLTA_COMPUTE_A 0x0000c3c0
236238
#define TURING_COMPUTE_A 0x0000c5c0
239+
#define AMPERE_COMPUTE_B 0x0000c7c0
237240

238241
#define NV74_CIPHER 0x000074c1
239242
#endif

drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ int gp108_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct n
5454
int gp10b_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
5555
int gv100_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
5656
int tu102_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
57+
int ga102_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
5758
#endif

drivers/gpu/drm/nouveau/include/nvkm/subdev/acr.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ struct nvkm_acr_lsf_func {
118118
#define NVKM_ACR_LSF_DMACTL_REQ_CTX 0x00000004
119119
#define NVKM_ACR_LSF_FORCE_PRIV_LOAD 0x00000008
120120
u32 flags;
121+
u32 bl_entry;
121122
u32 bld_size;
122123
void (*bld_write)(struct nvkm_acr *, u32 bld, struct nvkm_acr_lsfw *);
123124
void (*bld_patch)(struct nvkm_acr *, u32 bld, s64 adjust);
@@ -144,4 +145,10 @@ int
144145
nvkm_acr_lsfw_load_bl_inst_data_sig(struct nvkm_subdev *, struct nvkm_falcon *,
145146
enum nvkm_acr_lsf_id, const char *path,
146147
int ver, const struct nvkm_acr_lsf_func *);
148+
149+
int
150+
nvkm_acr_lsfw_load_bl_sig_net(struct nvkm_subdev *, struct nvkm_falcon *,
151+
enum nvkm_acr_lsf_id, const char *path,
152+
int ver, const struct nvkm_acr_lsf_func *,
153+
const void *, u32, const void *, u32);
147154
#endif

drivers/gpu/drm/nouveau/nvkm/engine/device/base.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,6 +2618,7 @@ nv172_chipset = {
26182618
.disp = { 0x00000001, ga102_disp_new },
26192619
.dma = { 0x00000001, gv100_dma_new },
26202620
.fifo = { 0x00000001, ga102_fifo_new },
2621+
.gr = { 0x00000001, ga102_gr_new },
26212622
.nvdec = { 0x00000001, ga102_nvdec_new },
26222623
.sec2 = { 0x00000001, ga102_sec2_new },
26232624
};
@@ -2647,6 +2648,7 @@ nv173_chipset = {
26472648
.disp = { 0x00000001, ga102_disp_new },
26482649
.dma = { 0x00000001, gv100_dma_new },
26492650
.fifo = { 0x00000001, ga102_fifo_new },
2651+
.gr = { 0x00000001, ga102_gr_new },
26502652
.nvdec = { 0x00000001, ga102_nvdec_new },
26512653
.sec2 = { 0x00000001, ga102_sec2_new },
26522654
};
@@ -2676,6 +2678,7 @@ nv174_chipset = {
26762678
.disp = { 0x00000001, ga102_disp_new },
26772679
.dma = { 0x00000001, gv100_dma_new },
26782680
.fifo = { 0x00000001, ga102_fifo_new },
2681+
.gr = { 0x00000001, ga102_gr_new },
26792682
.nvdec = { 0x00000001, ga102_nvdec_new },
26802683
.sec2 = { 0x00000001, ga102_sec2_new },
26812684
};
@@ -2705,6 +2708,7 @@ nv176_chipset = {
27052708
.disp = { 0x00000001, ga102_disp_new },
27062709
.dma = { 0x00000001, gv100_dma_new },
27072710
.fifo = { 0x00000001, ga102_fifo_new },
2711+
.gr = { 0x00000001, ga102_gr_new },
27082712
.nvdec = { 0x00000001, ga102_nvdec_new },
27092713
.sec2 = { 0x00000001, ga102_sec2_new },
27102714
};
@@ -2734,6 +2738,7 @@ nv177_chipset = {
27342738
.disp = { 0x00000001, ga102_disp_new },
27352739
.dma = { 0x00000001, gv100_dma_new },
27362740
.fifo = { 0x00000001, ga102_fifo_new },
2741+
.gr = { 0x00000001, ga102_gr_new },
27372742
.nvdec = { 0x00000001, ga102_nvdec_new },
27382743
.sec2 = { 0x00000001, ga102_sec2_new },
27392744
};

drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ nvkm-y += nvkm/engine/gr/gp108.o
4040
nvkm-y += nvkm/engine/gr/gp10b.o
4141
nvkm-y += nvkm/engine/gr/gv100.o
4242
nvkm-y += nvkm/engine/gr/tu102.o
43+
nvkm-y += nvkm/engine/gr/ga102.o
4344

4445
nvkm-y += nvkm/engine/gr/ctxnv40.o
4546
nvkm-y += nvkm/engine/gr/ctxnv50.o
@@ -63,3 +64,4 @@ nvkm-y += nvkm/engine/gr/ctxgp104.o
6364
nvkm-y += nvkm/engine/gr/ctxgp107.o
6465
nvkm-y += nvkm/engine/gr/ctxgv100.o
6566
nvkm-y += nvkm/engine/gr/ctxtu102.o
67+
nvkm-y += nvkm/engine/gr/ctxga102.o
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Copyright 2019 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+
#include "ctxgf100.h"
23+
24+
static void
25+
ga102_grctx_generate_sm_id(struct gf100_gr *gr, int gpc, int tpc, int sm)
26+
{
27+
struct nvkm_device *device = gr->base.engine.subdev.device;
28+
29+
tpc = gv100_gr_nonpes_aware_tpc(gr, gpc, tpc);
30+
31+
nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x608), sm);
32+
}
33+
34+
static void
35+
ga102_grctx_generate_unkn(struct gf100_gr *gr)
36+
{
37+
struct nvkm_device *device = gr->base.engine.subdev.device;
38+
39+
nvkm_mask(device, 0x41980c, 0x00000010, 0x00000010);
40+
nvkm_mask(device, 0x41be08, 0x00000004, 0x00000004);
41+
}
42+
43+
static void
44+
ga102_grctx_generate_r419ea8(struct gf100_gr *gr)
45+
{
46+
struct nvkm_device *device = gr->base.engine.subdev.device;
47+
48+
nvkm_wr32(device, 0x419ea8, nvkm_rd32(device, 0x504728) | 0x08000000);
49+
}
50+
51+
const struct gf100_grctx_func
52+
ga102_grctx = {
53+
.main = gf100_grctx_generate_main,
54+
.unkn = ga102_grctx_generate_unkn,
55+
.bundle = gm107_grctx_generate_bundle,
56+
.bundle_size = 0x3000,
57+
.bundle_min_gpm_fifo_depth = 0x180,
58+
.bundle_token_limit = 0x1140,
59+
.pagepool = gp100_grctx_generate_pagepool,
60+
.pagepool_size = 0x20000,
61+
.attrib_cb_size = gp102_grctx_generate_attrib_cb_size,
62+
.attrib_cb = gv100_grctx_generate_attrib_cb,
63+
.attrib = gv100_grctx_generate_attrib,
64+
.attrib_nr_max = 0x800,
65+
.attrib_nr = 0x4a1,
66+
.alpha_nr_max = 0xc00,
67+
.alpha_nr = 0x800,
68+
.unknown_size = 0x80000,
69+
.unknown = tu102_grctx_generate_unknown,
70+
.gfxp_nr = 0xd28,
71+
.sm_id = ga102_grctx_generate_sm_id,
72+
.skip_pd_num_tpc_per_gpc = true,
73+
.rop_mapping = gv100_grctx_generate_rop_mapping,
74+
.r406500 = gm200_grctx_generate_r406500,
75+
.r400088 = gv100_grctx_generate_r400088,
76+
.r419ea8 = ga102_grctx_generate_r419ea8,
77+
};

drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,8 @@ gf100_grctx_generate_main(struct gf100_gr_chan *chan)
13611361

13621362
if (gr->func->init_419bd8)
13631363
gr->func->init_419bd8(gr);
1364+
if (grctx->r419ea8)
1365+
grctx->r419ea8(gr);
13641366

13651367
gf100_gr_wait_idle(gr);
13661368

drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct gf100_grctx_func {
6969
void (*r419a3c)(struct gf100_gr *);
7070
void (*r408840)(struct gf100_gr *);
7171
void (*r419c0c)(struct gf100_gr *);
72+
void (*r419ea8)(struct gf100_gr *);
7273
};
7374

7475
extern const struct gf100_grctx_func gf100_grctx;
@@ -161,6 +162,8 @@ void gv100_grctx_generate_r400088(struct gf100_gr *, bool);
161162

162163
void tu102_grctx_generate_unknown(struct gf100_gr_chan *, u64, u32);
163164

165+
extern const struct gf100_grctx_func ga102_grctx;
166+
164167
/* context init value lists */
165168

166169
extern const struct gf100_gr_pack gf100_grctx_pack_icmd[];

0 commit comments

Comments
 (0)