diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2016-04-13 21:14:33 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-05-20 00:43:04 -0400 |
commit | e976278ad231dbc44c00729df72cf9fe9a164412 (patch) | |
tree | e9022cee3154142d91ff266b77c67460ab80f4e1 | |
parent | 834b21f5e902b4fdf3217779d10d4f388b667e85 (diff) |
drm/nouveau/fb/gm200: setup mmu debug buffer registers at init()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/fb/gm200.c | 60 |
5 files changed, 65 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h index bb9247d88190..0a734fd06acf 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h | |||
@@ -90,6 +90,7 @@ int gf100_fb_new(struct nvkm_device *, int, struct nvkm_fb **); | |||
90 | int gk104_fb_new(struct nvkm_device *, int, struct nvkm_fb **); | 90 | int gk104_fb_new(struct nvkm_device *, int, struct nvkm_fb **); |
91 | int gk20a_fb_new(struct nvkm_device *, int, struct nvkm_fb **); | 91 | int gk20a_fb_new(struct nvkm_device *, int, struct nvkm_fb **); |
92 | int gm107_fb_new(struct nvkm_device *, int, struct nvkm_fb **); | 92 | int gm107_fb_new(struct nvkm_device *, int, struct nvkm_fb **); |
93 | int gm200_fb_new(struct nvkm_device *, int, struct nvkm_fb **); | ||
93 | 94 | ||
94 | #include <subdev/bios.h> | 95 | #include <subdev/bios.h> |
95 | #include <subdev/bios/ramcfg.h> | 96 | #include <subdev/bios/ramcfg.h> |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c index be7633f36d6b..a364efe60a18 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | |||
@@ -1995,7 +1995,7 @@ nv120_chipset = { | |||
1995 | .bios = nvkm_bios_new, | 1995 | .bios = nvkm_bios_new, |
1996 | .bus = gf100_bus_new, | 1996 | .bus = gf100_bus_new, |
1997 | .devinit = gm200_devinit_new, | 1997 | .devinit = gm200_devinit_new, |
1998 | .fb = gm107_fb_new, | 1998 | .fb = gm200_fb_new, |
1999 | .fuse = gm107_fuse_new, | 1999 | .fuse = gm107_fuse_new, |
2000 | .gpio = gk104_gpio_new, | 2000 | .gpio = gk104_gpio_new, |
2001 | .i2c = gm200_i2c_new, | 2001 | .i2c = gm200_i2c_new, |
@@ -2029,7 +2029,7 @@ nv124_chipset = { | |||
2029 | .bios = nvkm_bios_new, | 2029 | .bios = nvkm_bios_new, |
2030 | .bus = gf100_bus_new, | 2030 | .bus = gf100_bus_new, |
2031 | .devinit = gm200_devinit_new, | 2031 | .devinit = gm200_devinit_new, |
2032 | .fb = gm107_fb_new, | 2032 | .fb = gm200_fb_new, |
2033 | .fuse = gm107_fuse_new, | 2033 | .fuse = gm107_fuse_new, |
2034 | .gpio = gk104_gpio_new, | 2034 | .gpio = gk104_gpio_new, |
2035 | .i2c = gm200_i2c_new, | 2035 | .i2c = gm200_i2c_new, |
@@ -2063,7 +2063,7 @@ nv126_chipset = { | |||
2063 | .bios = nvkm_bios_new, | 2063 | .bios = nvkm_bios_new, |
2064 | .bus = gf100_bus_new, | 2064 | .bus = gf100_bus_new, |
2065 | .devinit = gm200_devinit_new, | 2065 | .devinit = gm200_devinit_new, |
2066 | .fb = gm107_fb_new, | 2066 | .fb = gm200_fb_new, |
2067 | .fuse = gm107_fuse_new, | 2067 | .fuse = gm107_fuse_new, |
2068 | .gpio = gk104_gpio_new, | 2068 | .gpio = gk104_gpio_new, |
2069 | .i2c = gm200_i2c_new, | 2069 | .i2c = gm200_i2c_new, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c index 6e992c6f9532..28002a606ac8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include "gf100.h" | 24 | #include "gf100.h" |
25 | #include "ctxgf100.h" | 25 | #include "ctxgf100.h" |
26 | 26 | ||
27 | #include <subdev/fb.h> | ||
28 | #include <subdev/secboot.h> | 27 | #include <subdev/secboot.h> |
29 | 28 | ||
30 | #include <nvif/class.h> | 29 | #include <nvif/class.h> |
@@ -57,17 +56,12 @@ int | |||
57 | gm200_gr_init(struct gf100_gr *gr) | 56 | gm200_gr_init(struct gf100_gr *gr) |
58 | { | 57 | { |
59 | struct nvkm_device *device = gr->base.engine.subdev.device; | 58 | struct nvkm_device *device = gr->base.engine.subdev.device; |
60 | struct nvkm_fb *fb = device->fb; | ||
61 | const u32 magicgpc918 = DIV_ROUND_UP(0x00800000, gr->tpc_total); | 59 | const u32 magicgpc918 = DIV_ROUND_UP(0x00800000, gr->tpc_total); |
62 | u32 data[TPC_MAX / 8] = {}; | 60 | u32 data[TPC_MAX / 8] = {}; |
63 | u8 tpcnr[GPC_MAX]; | 61 | u8 tpcnr[GPC_MAX]; |
64 | int gpc, tpc, ppc, rop; | 62 | int gpc, tpc, ppc, rop; |
65 | int i; | 63 | int i; |
66 | 64 | ||
67 | /*XXX: belongs in fb */ | ||
68 | nvkm_wr32(device, 0x100cc8, nvkm_memory_addr(fb->mmu_wr) >> 8); | ||
69 | nvkm_wr32(device, 0x100ccc, nvkm_memory_addr(fb->mmu_rd) >> 8); | ||
70 | nvkm_mask(device, 0x100cc4, 0x00040000, 0x00040000); | ||
71 | gr->func->init_gpc_mmu(gr); | 65 | gr->func->init_gpc_mmu(gr); |
72 | 66 | ||
73 | gf100_gr_mmio(gr, gr->fuc_sw_nonctx); | 67 | gf100_gr_mmio(gr, gr->fuc_sw_nonctx); |
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild index 08105701af7e..842d5de96d73 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild | |||
@@ -23,6 +23,7 @@ nvkm-y += nvkm/subdev/fb/gf100.o | |||
23 | nvkm-y += nvkm/subdev/fb/gk104.o | 23 | nvkm-y += nvkm/subdev/fb/gk104.o |
24 | nvkm-y += nvkm/subdev/fb/gk20a.o | 24 | nvkm-y += nvkm/subdev/fb/gk20a.o |
25 | nvkm-y += nvkm/subdev/fb/gm107.o | 25 | nvkm-y += nvkm/subdev/fb/gm107.o |
26 | nvkm-y += nvkm/subdev/fb/gm200.o | ||
26 | 27 | ||
27 | nvkm-y += nvkm/subdev/fb/ram.o | 28 | nvkm-y += nvkm/subdev/fb/ram.o |
28 | nvkm-y += nvkm/subdev/fb/ramnv04.o | 29 | nvkm-y += nvkm/subdev/fb/ramnv04.o |
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gm200.c new file mode 100644 index 000000000000..44f5716f64d8 --- /dev/null +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gm200.c | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Copyright 2012 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 | * Authors: Ben Skeggs | ||
23 | */ | ||
24 | #include "gf100.h" | ||
25 | #include "ram.h" | ||
26 | |||
27 | #include <core/memory.h> | ||
28 | |||
29 | static void | ||
30 | gm200_fb_init(struct nvkm_fb *base) | ||
31 | { | ||
32 | struct gf100_fb *fb = gf100_fb(base); | ||
33 | struct nvkm_device *device = fb->base.subdev.device; | ||
34 | |||
35 | if (fb->r100c10_page) | ||
36 | nvkm_wr32(device, 0x100c10, fb->r100c10 >> 8); | ||
37 | |||
38 | nvkm_mask(device, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */ | ||
39 | |||
40 | nvkm_wr32(device, 0x100cc8, nvkm_memory_addr(fb->base.mmu_wr) >> 8); | ||
41 | nvkm_wr32(device, 0x100ccc, nvkm_memory_addr(fb->base.mmu_rd) >> 8); | ||
42 | nvkm_mask(device, 0x100cc4, 0x00060000, | ||
43 | min(nvkm_memory_size(fb->base.mmu_rd) >> 16, (u64)2) << 17); | ||
44 | } | ||
45 | |||
46 | static const struct nvkm_fb_func | ||
47 | gm200_fb = { | ||
48 | .dtor = gf100_fb_dtor, | ||
49 | .oneinit = gf100_fb_oneinit, | ||
50 | .init = gm200_fb_init, | ||
51 | .intr = gf100_fb_intr, | ||
52 | .ram_new = gm107_ram_new, | ||
53 | .memtype_valid = gf100_fb_memtype_valid, | ||
54 | }; | ||
55 | |||
56 | int | ||
57 | gm200_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) | ||
58 | { | ||
59 | return gf100_fb_new_(&gm200_fb, device, index, pfb); | ||
60 | } | ||