Skip to content

Commit 21e938d

Browse files
author
Ben Skeggs
committed
drm/nouveau/ltc/ga102: initial support
v2. fixup for ga103 early merge Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Lyude Paul <[email protected]>
1 parent 4b569de commit 21e938d

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <core/subdev.h>
55
#include <core/mm.h>
66

7-
#define NVKM_LTC_MAX_ZBC_COLOR_CNT 16
7+
#define NVKM_LTC_MAX_ZBC_COLOR_CNT 32
88
#define NVKM_LTC_MAX_ZBC_DEPTH_CNT 16
99

1010
struct nvkm_ltc {
@@ -44,4 +44,5 @@ int gm200_ltc_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct
4444
int gp100_ltc_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_ltc **);
4545
int gp102_ltc_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_ltc **);
4646
int gp10b_ltc_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_ltc **);
47+
int ga102_ltc_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_ltc **);
4748
#endif

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,6 +2606,7 @@ nv172_chipset = {
26062606
.gsp = { 0x00000001, ga102_gsp_new },
26072607
.i2c = { 0x00000001, gm200_i2c_new },
26082608
.imem = { 0x00000001, nv50_instmem_new },
2609+
.ltc = { 0x00000001, ga102_ltc_new },
26092610
.mc = { 0x00000001, ga100_mc_new },
26102611
.mmu = { 0x00000001, tu102_mmu_new },
26112612
.pci = { 0x00000001, gp100_pci_new },
@@ -2634,6 +2635,7 @@ nv173_chipset = {
26342635
.gsp = { 0x00000001, ga102_gsp_new },
26352636
.i2c = { 0x00000001, gm200_i2c_new },
26362637
.imem = { 0x00000001, nv50_instmem_new },
2638+
.ltc = { 0x00000001, ga102_ltc_new },
26372639
.mc = { 0x00000001, ga100_mc_new },
26382640
.mmu = { 0x00000001, tu102_mmu_new },
26392641
.pci = { 0x00000001, gp100_pci_new },
@@ -2662,6 +2664,7 @@ nv174_chipset = {
26622664
.gsp = { 0x00000001, ga102_gsp_new },
26632665
.i2c = { 0x00000001, gm200_i2c_new },
26642666
.imem = { 0x00000001, nv50_instmem_new },
2667+
.ltc = { 0x00000001, ga102_ltc_new },
26652668
.mc = { 0x00000001, ga100_mc_new },
26662669
.mmu = { 0x00000001, tu102_mmu_new },
26672670
.pci = { 0x00000001, gp100_pci_new },
@@ -2690,6 +2693,7 @@ nv176_chipset = {
26902693
.gsp = { 0x00000001, ga102_gsp_new },
26912694
.i2c = { 0x00000001, gm200_i2c_new },
26922695
.imem = { 0x00000001, nv50_instmem_new },
2696+
.ltc = { 0x00000001, ga102_ltc_new },
26932697
.mc = { 0x00000001, ga100_mc_new },
26942698
.mmu = { 0x00000001, tu102_mmu_new },
26952699
.pci = { 0x00000001, gp100_pci_new },
@@ -2718,6 +2722,7 @@ nv177_chipset = {
27182722
.gsp = { 0x00000001, ga102_gsp_new },
27192723
.i2c = { 0x00000001, gm200_i2c_new },
27202724
.imem = { 0x00000001, nv50_instmem_new },
2725+
.ltc = { 0x00000001, ga102_ltc_new },
27212726
.mc = { 0x00000001, ga100_mc_new },
27222727
.mmu = { 0x00000001, tu102_mmu_new },
27232728
.pci = { 0x00000001, gp100_pci_new },

drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ nvkm-y += nvkm/subdev/ltc/gm200.o
77
nvkm-y += nvkm/subdev/ltc/gp100.o
88
nvkm-y += nvkm/subdev/ltc/gp102.o
99
nvkm-y += nvkm/subdev/ltc/gp10b.o
10+
nvkm-y += nvkm/subdev/ltc/ga102.o
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright 2021 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 "priv.h"
23+
24+
static void
25+
ga102_ltc_zbc_clear_color(struct nvkm_ltc *ltc, int i, const u32 color[4])
26+
{
27+
struct nvkm_device *device = ltc->subdev.device;
28+
29+
nvkm_mask(device, 0x17e338, 0x0000001f, i);
30+
nvkm_wr32(device, 0x17e33c, color[0]);
31+
nvkm_wr32(device, 0x17e340, color[1]);
32+
nvkm_wr32(device, 0x17e344, color[2]);
33+
nvkm_wr32(device, 0x17e348, color[3]);
34+
}
35+
36+
static const struct nvkm_ltc_func
37+
ga102_ltc = {
38+
.oneinit = gp100_ltc_oneinit,
39+
.init = gp100_ltc_init,
40+
.intr = gp100_ltc_intr,
41+
.cbc_clear = gm107_ltc_cbc_clear,
42+
.cbc_wait = gm107_ltc_cbc_wait,
43+
.zbc_color = 31,
44+
.zbc_depth = 16,
45+
.zbc_clear_color = ga102_ltc_zbc_clear_color,
46+
.zbc_clear_depth = gm107_ltc_zbc_clear_depth,
47+
.zbc_clear_stencil = gp102_ltc_zbc_clear_stencil,
48+
.invalidate = gf100_ltc_invalidate,
49+
.flush = gf100_ltc_flush,
50+
};
51+
52+
int
53+
ga102_ltc_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
54+
struct nvkm_ltc **pltc)
55+
{
56+
return nvkm_ltc_new_(&ga102_ltc, device, type, inst, pltc);
57+
}

0 commit comments

Comments
 (0)