Skip to content

Commit b480600

Browse files
Ben SkeggsLyude
authored andcommitted
drm/nouveau/fb/tu102-: fix register used to determine scrub status
Turing apparently needs to use the same register we use on Ampere. Not executing the scrubber ucode when required would result in large areas of VRAM being inaccessible to the driver. Signed-off-by: Ben Skeggs <[email protected]> Signed-off-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent d22915d commit b480600

File tree

7 files changed

+65
-17
lines changed

7 files changed

+65
-17
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ int gp100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct n
9797
int gp102_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
9898
int gp10b_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
9999
int gv100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
100+
int tu102_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
100101
int ga100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
101102
int ga102_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
102103

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,7 +2405,7 @@ nv162_chipset = {
24052405
.bus = { 0x00000001, gf100_bus_new },
24062406
.devinit = { 0x00000001, tu102_devinit_new },
24072407
.fault = { 0x00000001, tu102_fault_new },
2408-
.fb = { 0x00000001, gv100_fb_new },
2408+
.fb = { 0x00000001, tu102_fb_new },
24092409
.fuse = { 0x00000001, gm107_fuse_new },
24102410
.gpio = { 0x00000001, gk104_gpio_new },
24112411
.gsp = { 0x00000001, gv100_gsp_new },
@@ -2440,7 +2440,7 @@ nv164_chipset = {
24402440
.bus = { 0x00000001, gf100_bus_new },
24412441
.devinit = { 0x00000001, tu102_devinit_new },
24422442
.fault = { 0x00000001, tu102_fault_new },
2443-
.fb = { 0x00000001, gv100_fb_new },
2443+
.fb = { 0x00000001, tu102_fb_new },
24442444
.fuse = { 0x00000001, gm107_fuse_new },
24452445
.gpio = { 0x00000001, gk104_gpio_new },
24462446
.gsp = { 0x00000001, gv100_gsp_new },
@@ -2475,7 +2475,7 @@ nv166_chipset = {
24752475
.bus = { 0x00000001, gf100_bus_new },
24762476
.devinit = { 0x00000001, tu102_devinit_new },
24772477
.fault = { 0x00000001, tu102_fault_new },
2478-
.fb = { 0x00000001, gv100_fb_new },
2478+
.fb = { 0x00000001, tu102_fb_new },
24792479
.fuse = { 0x00000001, gm107_fuse_new },
24802480
.gpio = { 0x00000001, gk104_gpio_new },
24812481
.gsp = { 0x00000001, gv100_gsp_new },
@@ -2510,7 +2510,7 @@ nv167_chipset = {
25102510
.bus = { 0x00000001, gf100_bus_new },
25112511
.devinit = { 0x00000001, tu102_devinit_new },
25122512
.fault = { 0x00000001, tu102_fault_new },
2513-
.fb = { 0x00000001, gv100_fb_new },
2513+
.fb = { 0x00000001, tu102_fb_new },
25142514
.fuse = { 0x00000001, gm107_fuse_new },
25152515
.gpio = { 0x00000001, gk104_gpio_new },
25162516
.gsp = { 0x00000001, gv100_gsp_new },
@@ -2545,7 +2545,7 @@ nv168_chipset = {
25452545
.bus = { 0x00000001, gf100_bus_new },
25462546
.devinit = { 0x00000001, tu102_devinit_new },
25472547
.fault = { 0x00000001, tu102_fault_new },
2548-
.fb = { 0x00000001, gv100_fb_new },
2548+
.fb = { 0x00000001, tu102_fb_new },
25492549
.fuse = { 0x00000001, gm107_fuse_new },
25502550
.gpio = { 0x00000001, gk104_gpio_new },
25512551
.gsp = { 0x00000001, gv100_gsp_new },

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ nvkm-y += nvkm/subdev/fb/gp100.o
3232
nvkm-y += nvkm/subdev/fb/gp102.o
3333
nvkm-y += nvkm/subdev/fb/gp10b.o
3434
nvkm-y += nvkm/subdev/fb/gv100.o
35+
nvkm-y += nvkm/subdev/fb/tu102.o
3536
nvkm-y += nvkm/subdev/fb/ga100.o
3637
nvkm-y += nvkm/subdev/fb/ga102.o
3738

drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ ga102_fb_vpr_scrub(struct nvkm_fb *fb)
4040
return ret;
4141
}
4242

43-
static bool
44-
ga102_fb_vpr_scrub_required(struct nvkm_fb *fb)
45-
{
46-
return (nvkm_rd32(fb->subdev.device, 0x1fa80c) & 0x00000010) != 0;
47-
}
48-
4943
static const struct nvkm_fb_func
5044
ga102_fb = {
5145
.dtor = gf100_fb_dtor,
@@ -56,7 +50,7 @@ ga102_fb = {
5650
.sysmem.flush_page_init = gf100_fb_sysmem_flush_page_init,
5751
.ram_new = ga102_ram_new,
5852
.default_bigpage = 16,
59-
.vpr.scrub_required = ga102_fb_vpr_scrub_required,
53+
.vpr.scrub_required = tu102_fb_vpr_scrub_required,
6054
.vpr.scrub = ga102_fb_vpr_scrub,
6155
};
6256

drivers/gpu/drm/nouveau/nvkm/subdev/fb/gv100.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,3 @@ gv100_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, s
4949
}
5050

5151
MODULE_FIRMWARE("nvidia/gv100/nvdec/scrubber.bin");
52-
MODULE_FIRMWARE("nvidia/tu102/nvdec/scrubber.bin");
53-
MODULE_FIRMWARE("nvidia/tu104/nvdec/scrubber.bin");
54-
MODULE_FIRMWARE("nvidia/tu106/nvdec/scrubber.bin");
55-
MODULE_FIRMWARE("nvidia/tu116/nvdec/scrubber.bin");
56-
MODULE_FIRMWARE("nvidia/tu117/nvdec/scrubber.bin");

drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,6 @@ bool gp102_fb_vpr_scrub_required(struct nvkm_fb *);
8989
int gp102_fb_vpr_scrub(struct nvkm_fb *);
9090

9191
int gv100_fb_init_page(struct nvkm_fb *);
92+
93+
bool tu102_fb_vpr_scrub_required(struct nvkm_fb *);
9294
#endif
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2018 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 "gf100.h"
23+
#include "ram.h"
24+
25+
bool
26+
tu102_fb_vpr_scrub_required(struct nvkm_fb *fb)
27+
{
28+
return (nvkm_rd32(fb->subdev.device, 0x1fa80c) & 0x00000010) != 0;
29+
}
30+
31+
static const struct nvkm_fb_func
32+
tu102_fb = {
33+
.dtor = gf100_fb_dtor,
34+
.oneinit = gf100_fb_oneinit,
35+
.init = gm200_fb_init,
36+
.init_page = gv100_fb_init_page,
37+
.init_unkn = gp100_fb_init_unkn,
38+
.sysmem.flush_page_init = gf100_fb_sysmem_flush_page_init,
39+
.vpr.scrub_required = tu102_fb_vpr_scrub_required,
40+
.vpr.scrub = gp102_fb_vpr_scrub,
41+
.ram_new = gp100_ram_new,
42+
.default_bigpage = 16,
43+
};
44+
45+
int
46+
tu102_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
47+
{
48+
return gp102_fb_new_(&tu102_fb, device, type, inst, pfb);
49+
}
50+
51+
MODULE_FIRMWARE("nvidia/tu102/nvdec/scrubber.bin");
52+
MODULE_FIRMWARE("nvidia/tu104/nvdec/scrubber.bin");
53+
MODULE_FIRMWARE("nvidia/tu106/nvdec/scrubber.bin");
54+
MODULE_FIRMWARE("nvidia/tu116/nvdec/scrubber.bin");
55+
MODULE_FIRMWARE("nvidia/tu117/nvdec/scrubber.bin");

0 commit comments

Comments
 (0)