Commit 2fe5ff63 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/gr/gf100-: virtualise init_vsc_stream_master

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a37279e9
...@@ -1930,6 +1930,13 @@ gf100_gr_init_gpc_mmu(struct gf100_gr *gr) ...@@ -1930,6 +1930,13 @@ gf100_gr_init_gpc_mmu(struct gf100_gr *gr)
nvkm_wr32(device, 0x4188b8, nvkm_memory_addr(fb->mmu_rd) >> 8); nvkm_wr32(device, 0x4188b8, nvkm_memory_addr(fb->mmu_rd) >> 8);
} }
void
gf100_gr_init_vsc_stream_master(struct gf100_gr *gr)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
nvkm_mask(device, TPC_UNIT(0, 0, 0x05c), 0x00000001, 0x00000001);
}
int int
gf100_gr_init(struct gf100_gr *gr) gf100_gr_init(struct gf100_gr *gr)
{ {
...@@ -1956,7 +1963,7 @@ gf100_gr_init(struct gf100_gr *gr) ...@@ -1956,7 +1963,7 @@ gf100_gr_init(struct gf100_gr *gr)
if (gr->func->init_bios) if (gr->func->init_bios)
gr->func->init_bios(gr); gr->func->init_bios(gr);
nvkm_mask(device, TPC_UNIT(0, 0, 0x05c), 0x00000001, 0x00000001); gr->func->init_vsc_stream_master(gr);
memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr)); memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr));
for (i = 0, gpc = -1; i < gr->tpc_total; i++) { for (i = 0, gpc = -1; i < gr->tpc_total; i++) {
...@@ -2068,6 +2075,7 @@ static const struct gf100_gr_func ...@@ -2068,6 +2075,7 @@ static const struct gf100_gr_func
gf100_gr = { gf100_gr = {
.init = gf100_gr_init, .init = gf100_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
.mmio = gf100_gr_pack_mmio, .mmio = gf100_gr_pack_mmio,
.fecs.ucode = &gf100_gr_fecs_ucode, .fecs.ucode = &gf100_gr_fecs_ucode,
.gpccs.ucode = &gf100_gr_gpccs_ucode, .gpccs.ucode = &gf100_gr_gpccs_ucode,
......
...@@ -124,6 +124,7 @@ struct gf100_gr_func { ...@@ -124,6 +124,7 @@ struct gf100_gr_func {
void (*init_gpc_mmu)(struct gf100_gr *); void (*init_gpc_mmu)(struct gf100_gr *);
void (*init_r405a14)(struct gf100_gr *); void (*init_r405a14)(struct gf100_gr *);
void (*init_bios)(struct gf100_gr *); void (*init_bios)(struct gf100_gr *);
void (*init_vsc_stream_master)(struct gf100_gr *);
void (*init_rop_active_fbps)(struct gf100_gr *); void (*init_rop_active_fbps)(struct gf100_gr *);
void (*init_ppc_exceptions)(struct gf100_gr *); void (*init_ppc_exceptions)(struct gf100_gr *);
void (*init_swdx_pes_mask)(struct gf100_gr *); void (*init_swdx_pes_mask)(struct gf100_gr *);
...@@ -143,10 +144,12 @@ struct gf100_gr_func { ...@@ -143,10 +144,12 @@ struct gf100_gr_func {
struct nvkm_sclass sclass[]; struct nvkm_sclass sclass[];
}; };
int gf100_gr_init(struct gf100_gr *);
int gf100_gr_rops(struct gf100_gr *); int gf100_gr_rops(struct gf100_gr *);
int gf100_gr_init(struct gf100_gr *);
void gf100_gr_init_vsc_stream_master(struct gf100_gr *);
int gk104_gr_init(struct gf100_gr *); int gk104_gr_init(struct gf100_gr *);
void gk104_gr_init_vsc_stream_master(struct gf100_gr *);
void gk104_gr_init_rop_active_fbps(struct gf100_gr *); void gk104_gr_init_rop_active_fbps(struct gf100_gr *);
void gk104_gr_init_ppc_exceptions(struct gf100_gr *); void gk104_gr_init_ppc_exceptions(struct gf100_gr *);
......
...@@ -116,6 +116,7 @@ static const struct gf100_gr_func ...@@ -116,6 +116,7 @@ static const struct gf100_gr_func
gf104_gr = { gf104_gr = {
.init = gf100_gr_init, .init = gf100_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
.mmio = gf104_gr_pack_mmio, .mmio = gf104_gr_pack_mmio,
.fecs.ucode = &gf100_gr_fecs_ucode, .fecs.ucode = &gf100_gr_fecs_ucode,
.gpccs.ucode = &gf100_gr_gpccs_ucode, .gpccs.ucode = &gf100_gr_gpccs_ucode,
......
...@@ -114,6 +114,7 @@ gf108_gr = { ...@@ -114,6 +114,7 @@ gf108_gr = {
.init = gf100_gr_init, .init = gf100_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_r405a14 = gf108_gr_init_r405a14, .init_r405a14 = gf108_gr_init_r405a14,
.init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
.mmio = gf108_gr_pack_mmio, .mmio = gf108_gr_pack_mmio,
.fecs.ucode = &gf100_gr_fecs_ucode, .fecs.ucode = &gf100_gr_fecs_ucode,
.gpccs.ucode = &gf100_gr_gpccs_ucode, .gpccs.ucode = &gf100_gr_gpccs_ucode,
......
...@@ -88,6 +88,7 @@ static const struct gf100_gr_func ...@@ -88,6 +88,7 @@ static const struct gf100_gr_func
gf110_gr = { gf110_gr = {
.init = gf100_gr_init, .init = gf100_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
.mmio = gf110_gr_pack_mmio, .mmio = gf110_gr_pack_mmio,
.fecs.ucode = &gf100_gr_fecs_ucode, .fecs.ucode = &gf100_gr_fecs_ucode,
.gpccs.ucode = &gf100_gr_gpccs_ucode, .gpccs.ucode = &gf100_gr_gpccs_ucode,
......
...@@ -124,6 +124,7 @@ static const struct gf100_gr_func ...@@ -124,6 +124,7 @@ static const struct gf100_gr_func
gf117_gr = { gf117_gr = {
.init = gf100_gr_init, .init = gf100_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
.mmio = gf117_gr_pack_mmio, .mmio = gf117_gr_pack_mmio,
.fecs.ucode = &gf117_gr_fecs_ucode, .fecs.ucode = &gf117_gr_fecs_ucode,
.gpccs.ucode = &gf117_gr_gpccs_ucode, .gpccs.ucode = &gf117_gr_gpccs_ucode,
......
...@@ -179,6 +179,7 @@ static const struct gf100_gr_func ...@@ -179,6 +179,7 @@ static const struct gf100_gr_func
gf119_gr = { gf119_gr = {
.init = gf100_gr_init, .init = gf100_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
.mmio = gf119_gr_pack_mmio, .mmio = gf119_gr_pack_mmio,
.fecs.ucode = &gf100_gr_fecs_ucode, .fecs.ucode = &gf100_gr_fecs_ucode,
.gpccs.ucode = &gf100_gr_gpccs_ucode, .gpccs.ucode = &gf100_gr_gpccs_ucode,
......
...@@ -404,6 +404,13 @@ gk104_gr_init_ppc_exceptions(struct gf100_gr *gr) ...@@ -404,6 +404,13 @@ gk104_gr_init_ppc_exceptions(struct gf100_gr *gr)
} }
} }
void
gk104_gr_init_vsc_stream_master(struct gf100_gr *gr)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001);
}
int int
gk104_gr_init(struct gf100_gr *gr) gk104_gr_init(struct gf100_gr *gr)
{ {
...@@ -421,7 +428,7 @@ gk104_gr_init(struct gf100_gr *gr) ...@@ -421,7 +428,7 @@ gk104_gr_init(struct gf100_gr *gr)
nvkm_therm_clkgate_init(gr->base.engine.subdev.device->therm, nvkm_therm_clkgate_init(gr->base.engine.subdev.device->therm,
gr->func->clkgate_pack); gr->func->clkgate_pack);
nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001); gr->func->init_vsc_stream_master(gr);
memset(data, 0x00, sizeof(data)); memset(data, 0x00, sizeof(data));
memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr)); memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr));
...@@ -536,6 +543,7 @@ static const struct gf100_gr_func ...@@ -536,6 +543,7 @@ static const struct gf100_gr_func
gk104_gr = { gk104_gr = {
.init = gk104_gr_init, .init = gk104_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gk104_gr_init_rop_active_fbps, .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.mmio = gk104_gr_pack_mmio, .mmio = gk104_gr_pack_mmio,
......
...@@ -338,6 +338,7 @@ static const struct gf100_gr_func ...@@ -338,6 +338,7 @@ static const struct gf100_gr_func
gk110_gr = { gk110_gr = {
.init = gk104_gr_init, .init = gk104_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gk104_gr_init_rop_active_fbps, .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.mmio = gk110_gr_pack_mmio, .mmio = gk110_gr_pack_mmio,
......
...@@ -104,6 +104,7 @@ static const struct gf100_gr_func ...@@ -104,6 +104,7 @@ static const struct gf100_gr_func
gk110b_gr = { gk110b_gr = {
.init = gk104_gr_init, .init = gk104_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gk104_gr_init_rop_active_fbps, .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.mmio = gk110b_gr_pack_mmio, .mmio = gk110b_gr_pack_mmio,
......
...@@ -163,6 +163,7 @@ static const struct gf100_gr_func ...@@ -163,6 +163,7 @@ static const struct gf100_gr_func
gk208_gr = { gk208_gr = {
.init = gk104_gr_init, .init = gk104_gr_init,
.init_gpc_mmu = gf100_gr_init_gpc_mmu, .init_gpc_mmu = gf100_gr_init_gpc_mmu,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gk104_gr_init_rop_active_fbps, .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.mmio = gk208_gr_pack_mmio, .mmio = gk208_gr_pack_mmio,
......
...@@ -337,7 +337,7 @@ gm107_gr_init(struct gf100_gr *gr) ...@@ -337,7 +337,7 @@ gm107_gr_init(struct gf100_gr *gr)
gr->func->init_bios(gr); gr->func->init_bios(gr);
nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001); gr->func->init_vsc_stream_master(gr);
memset(data, 0x00, sizeof(data)); memset(data, 0x00, sizeof(data));
memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr)); memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr));
...@@ -452,6 +452,7 @@ gm107_gr = { ...@@ -452,6 +452,7 @@ gm107_gr = {
.init = gm107_gr_init, .init = gm107_gr_init,
.init_gpc_mmu = gm107_gr_init_gpc_mmu, .init_gpc_mmu = gm107_gr_init_gpc_mmu,
.init_bios = gm107_gr_init_bios, .init_bios = gm107_gr_init_bios,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gk104_gr_init_rop_active_fbps, .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.mmio = gm107_gr_pack_mmio, .mmio = gm107_gr_pack_mmio,
......
...@@ -77,7 +77,7 @@ gm200_gr_init(struct gf100_gr *gr) ...@@ -77,7 +77,7 @@ gm200_gr_init(struct gf100_gr *gr)
gr->func->init_bios(gr); gr->func->init_bios(gr);
nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001); gr->func->init_vsc_stream_master(gr);
memset(data, 0x00, sizeof(data)); memset(data, 0x00, sizeof(data));
memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr)); memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr));
...@@ -211,6 +211,7 @@ gm200_gr = { ...@@ -211,6 +211,7 @@ gm200_gr = {
.init = gm200_gr_init, .init = gm200_gr_init,
.init_gpc_mmu = gm200_gr_init_gpc_mmu, .init_gpc_mmu = gm200_gr_init_gpc_mmu,
.init_bios = gm107_gr_init_bios, .init_bios = gm107_gr_init_bios,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gm200_gr_init_rop_active_fbps, .init_rop_active_fbps = gm200_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.rops = gm200_gr_rops, .rops = gm200_gr_rops,
......
...@@ -63,7 +63,7 @@ gp100_gr_init(struct gf100_gr *gr) ...@@ -63,7 +63,7 @@ gp100_gr_init(struct gf100_gr *gr)
gf100_gr_mmio(gr, gr->fuc_sw_nonctx); gf100_gr_mmio(gr, gr->fuc_sw_nonctx);
nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001); gr->func->init_vsc_stream_master(gr);
memset(data, 0x00, sizeof(data)); memset(data, 0x00, sizeof(data));
memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr)); memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr));
...@@ -160,6 +160,7 @@ static const struct gf100_gr_func ...@@ -160,6 +160,7 @@ static const struct gf100_gr_func
gp100_gr = { gp100_gr = {
.init = gp100_gr_init, .init = gp100_gr_init,
.init_gpc_mmu = gm200_gr_init_gpc_mmu, .init_gpc_mmu = gm200_gr_init_gpc_mmu,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gp100_gr_init_rop_active_fbps, .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.init_num_active_ltcs = gp100_gr_init_num_active_ltcs, .init_num_active_ltcs = gp100_gr_init_num_active_ltcs,
......
...@@ -44,6 +44,7 @@ static const struct gf100_gr_func ...@@ -44,6 +44,7 @@ static const struct gf100_gr_func
gp102_gr = { gp102_gr = {
.init = gp100_gr_init, .init = gp100_gr_init,
.init_gpc_mmu = gm200_gr_init_gpc_mmu, .init_gpc_mmu = gm200_gr_init_gpc_mmu,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gp100_gr_init_rop_active_fbps, .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask, .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask,
......
...@@ -30,6 +30,7 @@ static const struct gf100_gr_func ...@@ -30,6 +30,7 @@ static const struct gf100_gr_func
gp107_gr = { gp107_gr = {
.init = gp100_gr_init, .init = gp100_gr_init,
.init_gpc_mmu = gm200_gr_init_gpc_mmu, .init_gpc_mmu = gm200_gr_init_gpc_mmu,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gp100_gr_init_rop_active_fbps, .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask, .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask,
......
...@@ -37,6 +37,7 @@ static const struct gf100_gr_func ...@@ -37,6 +37,7 @@ static const struct gf100_gr_func
gp10b_gr = { gp10b_gr = {
.init = gp100_gr_init, .init = gp100_gr_init,
.init_gpc_mmu = gm200_gr_init_gpc_mmu, .init_gpc_mmu = gm200_gr_init_gpc_mmu,
.init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
.init_rop_active_fbps = gp100_gr_init_rop_active_fbps, .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
.init_ppc_exceptions = gk104_gr_init_ppc_exceptions, .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
.init_num_active_ltcs = gp10b_gr_init_num_active_ltcs, .init_num_active_ltcs = gp10b_gr_init_num_active_ltcs,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment