| .. | .. |
|---|
| 25 | 25 | * PGRAPH context implementation |
|---|
| 26 | 26 | ******************************************************************************/ |
|---|
| 27 | 27 | |
|---|
| 28 | | -static const struct gf100_gr_init |
|---|
| 28 | +const struct gf100_gr_init |
|---|
| 29 | 29 | gv100_grctx_init_sw_veid_bundle_init_0[] = { |
|---|
| 30 | 30 | { 0x00001000, 64, 0x00100000, 0x00000008 }, |
|---|
| 31 | 31 | { 0x00000941, 64, 0x00100000, 0x00000000 }, |
|---|
| .. | .. |
|---|
| 58 | 58 | {} |
|---|
| 59 | 59 | }; |
|---|
| 60 | 60 | |
|---|
| 61 | | -static void |
|---|
| 61 | +void |
|---|
| 62 | 62 | gv100_grctx_generate_attrib(struct gf100_grctx *info) |
|---|
| 63 | 63 | { |
|---|
| 64 | 64 | struct gf100_gr *gr = info->gr; |
|---|
| .. | .. |
|---|
| 67 | 67 | const u32 attrib = grctx->attrib_nr; |
|---|
| 68 | 68 | const u32 gfxp = grctx->gfxp_nr; |
|---|
| 69 | 69 | const int s = 12; |
|---|
| 70 | | - const int max_batches = 0xffff; |
|---|
| 71 | 70 | u32 size = grctx->alpha_nr_max * gr->tpc_total; |
|---|
| 72 | 71 | u32 ao = 0; |
|---|
| 73 | 72 | u32 bo = ao + size; |
|---|
| 74 | 73 | int gpc, ppc, b, n = 0; |
|---|
| 75 | 74 | |
|---|
| 76 | | - size += grctx->gfxp_nr * gr->tpc_total; |
|---|
| 77 | | - size = ((size * 0x20) + 128) & ~127; |
|---|
| 75 | + for (gpc = 0; gpc < gr->gpc_nr; gpc++) |
|---|
| 76 | + size += grctx->gfxp_nr * gr->ppc_nr[gpc] * gr->ppc_tpc_max; |
|---|
| 77 | + size = ((size * 0x20) + 127) & ~127; |
|---|
| 78 | 78 | b = mmio_vram(info, size, (1 << s), false); |
|---|
| 79 | 79 | |
|---|
| 80 | 80 | mmio_refn(info, 0x418810, 0x80000000, s, b); |
|---|
| .. | .. |
|---|
| 84 | 84 | mmio_wr32(info, 0x419e04, 0x80000000 | size >> 7); |
|---|
| 85 | 85 | mmio_wr32(info, 0x405830, attrib); |
|---|
| 86 | 86 | mmio_wr32(info, 0x40585c, alpha); |
|---|
| 87 | | - mmio_wr32(info, 0x4064c4, ((alpha / 4) << 16) | max_batches); |
|---|
| 88 | 87 | |
|---|
| 89 | 88 | for (gpc = 0; gpc < gr->gpc_nr; gpc++) { |
|---|
| 90 | 89 | for (ppc = 0; ppc < gr->ppc_nr[gpc]; ppc++, n++) { |
|---|
| 91 | 90 | const u32 as = alpha * gr->ppc_tpc_nr[gpc][ppc]; |
|---|
| 92 | | - const u32 bs = attrib * gr->ppc_tpc_nr[gpc][ppc]; |
|---|
| 93 | | - const u32 gs = gfxp * gr->ppc_tpc_nr[gpc][ppc]; |
|---|
| 91 | + const u32 bs = attrib * gr->ppc_tpc_max; |
|---|
| 92 | + const u32 gs = gfxp * gr->ppc_tpc_max; |
|---|
| 94 | 93 | const u32 u = 0x418ea0 + (n * 0x04); |
|---|
| 95 | 94 | const u32 o = PPC_UNIT(gpc, ppc, 0); |
|---|
| 96 | 95 | if (!(gr->ppc_mask[gpc] & (1 << ppc))) |
|---|
| .. | .. |
|---|
| 110 | 109 | mmio_wr32(info, 0x41befc, 0x00000100); |
|---|
| 111 | 110 | } |
|---|
| 112 | 111 | |
|---|
| 113 | | -static void |
|---|
| 112 | +void |
|---|
| 114 | 113 | gv100_grctx_generate_rop_mapping(struct gf100_gr *gr) |
|---|
| 115 | 114 | { |
|---|
| 116 | 115 | struct nvkm_device *device = gr->base.engine.subdev.device; |
|---|
| .. | .. |
|---|
| 147 | 146 | gr->screen_tile_row_offset); |
|---|
| 148 | 147 | } |
|---|
| 149 | 148 | |
|---|
| 150 | | -static void |
|---|
| 149 | +void |
|---|
| 151 | 150 | gv100_grctx_generate_r400088(struct gf100_gr *gr, bool on) |
|---|
| 152 | 151 | { |
|---|
| 153 | 152 | struct nvkm_device *device = gr->base.engine.subdev.device; |
|---|
| .. | .. |
|---|
| 163 | 162 | nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x088), sm); |
|---|
| 164 | 163 | } |
|---|
| 165 | 164 | |
|---|
| 166 | | -static void |
|---|
| 165 | +void |
|---|
| 167 | 166 | gv100_grctx_generate_unkn(struct gf100_gr *gr) |
|---|
| 168 | 167 | { |
|---|
| 169 | 168 | struct nvkm_device *device = gr->base.engine.subdev.device; |
|---|
| .. | .. |
|---|
| 174 | 173 | nvkm_mask(device, 0x419c00, 0x00000008, 0x00000008); |
|---|
| 175 | 174 | } |
|---|
| 176 | 175 | |
|---|
| 177 | | -static void |
|---|
| 176 | +void |
|---|
| 178 | 177 | gv100_grctx_unkn88c(struct gf100_gr *gr, bool on) |
|---|
| 179 | 178 | { |
|---|
| 180 | 179 | struct nvkm_device *device = gr->base.engine.subdev.device; |
|---|