drm/nouveau/devinit/tu102-: wait for GFW_BOOT_PROGRESS == COMPLETED
Subsystems (3)
PATCH 1/3 drm/nouveau/devinit/tu102-: wait for GFW_BOOT_PROGRESS == COMPLETED
Starting from Turing, the driver is no longer responsible for initiating DEVINIT when required as the GPU started loading a FW image from ROM and executing DEVINIT itself after power-on.
However - we apparently still need to wait for it to complete.
This should correct some issues with runpm on some systems, where we get control of the HW before it's been fully reinitialised after resume from suspend.
--- .../drm/nouveau/nvkm/subdev/devinit/tu102.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c +23 -0
@@ -65,10 +65,33 @@ tu102_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)return ret; } +static int +tu102_devinit_wait (struct nvkm_device *device) +{ +unsigned timeout =50 +2000 ; + +do { +if (nvkm_rd32 (device,0x118128 ) &0x00000001 ) { +if ((nvkm_rd32 (device,0x118234 ) &0x000000ff ) ==0xff ) +return 0 ; + } + +usleep_range (1000 ,2000 ); + }while (timeout--); + +return -ETIMEDOUT ; +} +int tu102_devinit_post (struct nvkm_devinit *base,bool post) {struct nv50_devinit *init =nv50_devinit (base); +int ret; + + ret =tu102_devinit_wait (init->base.subdev.device); +if (ret) +return ret; +gm200_devinit_preos (init, post);return 0 ; }
Signature · 1 line
2.35.1
PATCH 2/3 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.
--- .../gpu/drm/nouveau/include/nvkm/subdev/fb.h | 1 + .../gpu/drm/nouveau/nvkm/engine/device/base.c | 10 ++-- drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild | 1 + .../gpu/drm/nouveau/nvkm/subdev/fb/ga102.c | 8 +-- .../gpu/drm/nouveau/nvkm/subdev/fb/gv100.c | 5 -- drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h | 2 + .../gpu/drm/nouveau/nvkm/subdev/fb/tu102.c | 55 +++++++++++++++++++ 7 files changed, 65 insertions(+), 17 deletions(-) create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/fb/tu102.c
drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h +1 -0
@@ -97,6 +97,7 @@ int gp100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nint gp102_fb_new (struct nvkm_device *,enum nvkm_subdev_type ,int inst,struct nvkm_fb **);int gp10b_fb_new (struct nvkm_device *,enum nvkm_subdev_type ,int inst,struct nvkm_fb **);int gv100_fb_new (struct nvkm_device *,enum nvkm_subdev_type ,int inst,struct nvkm_fb **); +int tu102_fb_new (struct nvkm_device *,enum nvkm_subdev_type ,int inst,struct nvkm_fb **);int ga100_fb_new (struct nvkm_device *,enum nvkm_subdev_type ,int inst,struct nvkm_fb **);int ga102_fb_new (struct nvkm_device *,enum nvkm_subdev_type ,int inst,struct nvkm_fb **);
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +5 -5
@@ -2405,7 +2405,7 @@ nv162_chipset = { .bus = { 0x00000001, gf100_bus_new }, .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, - .fb = { 0x00000001, gv100_fb_new }, + .fb = { 0x00000001, tu102_fb_new }, .fuse = { 0x00000001, gm107_fuse_new }, .gpio = { 0x00000001, gk104_gpio_new }, .gsp = { 0x00000001, gv100_gsp_new },
@@ -2440,7 +2440,7 @@ nv164_chipset = { .bus = { 0x00000001, gf100_bus_new }, .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, - .fb = { 0x00000001, gv100_fb_new }, + .fb = { 0x00000001, tu102_fb_new }, .fuse = { 0x00000001, gm107_fuse_new }, .gpio = { 0x00000001, gk104_gpio_new }, .gsp = { 0x00000001, gv100_gsp_new },
@@ -2475,7 +2475,7 @@ nv166_chipset = { .bus = { 0x00000001, gf100_bus_new }, .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, - .fb = { 0x00000001, gv100_fb_new }, + .fb = { 0x00000001, tu102_fb_new }, .fuse = { 0x00000001, gm107_fuse_new }, .gpio = { 0x00000001, gk104_gpio_new }, .gsp = { 0x00000001, gv100_gsp_new },
@@ -2510,7 +2510,7 @@ nv167_chipset = { .bus = { 0x00000001, gf100_bus_new }, .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, - .fb = { 0x00000001, gv100_fb_new }, + .fb = { 0x00000001, tu102_fb_new }, .fuse = { 0x00000001, gm107_fuse_new }, .gpio = { 0x00000001, gk104_gpio_new }, .gsp = { 0x00000001, gv100_gsp_new },
@@ -2545,7 +2545,7 @@ nv168_chipset = { .bus = { 0x00000001, gf100_bus_new }, .devinit = { 0x00000001, tu102_devinit_new }, .fault = { 0x00000001, tu102_fault_new }, - .fb = { 0x00000001, gv100_fb_new }, + .fb = { 0x00000001, tu102_fb_new }, .fuse = { 0x00000001, gm107_fuse_new }, .gpio = { 0x00000001, gk104_gpio_new }, .gsp = { 0x00000001, gv100_gsp_new },
drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild +1 -0
@@ -32,6 +32,7 @@ nvkm-y += nvkm/subdev/fb/gp100.o nvkm-y += nvkm/subdev/fb/gp102.o nvkm-y += nvkm/subdev/fb/gp10b.o nvkm-y += nvkm/subdev/fb/gv100.o +nvkm-y += nvkm/subdev/fb/tu102.o nvkm-y += nvkm/subdev/fb/ga100.o nvkm-y += nvkm/subdev/fb/ga102.o
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ga102.c +1 -7
@@ -40,12 +40,6 @@ ga102_fb_vpr_scrub(struct nvkm_fb *fb)return ret; } -static bool -ga102_fb_vpr_scrub_required (struct nvkm_fb *fb) -{ -return (nvkm_rd32 (fb->subdev.device,0x1fa80c ) &0x00000010 ) !=0 ; -} -static const struct nvkm_fb_func ga102_fb = { .dtor = gf100_fb_dtor,
@@ -56,7 +50,7 @@ ga102_fb = { .sysmem.flush_page_init = gf100_fb_sysmem_flush_page_init, .ram_new = ga102_ram_new, .default_bigpage = 16, - .vpr.scrub_required = ga102_fb_vpr_scrub_required, + .vpr.scrub_required = tu102_fb_vpr_scrub_required, .vpr.scrub = ga102_fb_vpr_scrub, };
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gv100.c +0 -5
@@ -49,8 +49,3 @@ gv100_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, s }MODULE_FIRMWARE ("nvidia/gv100/nvdec/scrubber.bin" ); -MODULE_FIRMWARE ("nvidia/tu102/nvdec/scrubber.bin" ); -MODULE_FIRMWARE ("nvidia/tu104/nvdec/scrubber.bin" ); -MODULE_FIRMWARE ("nvidia/tu106/nvdec/scrubber.bin" ); -MODULE_FIRMWARE ("nvidia/tu116/nvdec/scrubber.bin" ); -MODULE_FIRMWARE ("nvidia/tu117/nvdec/scrubber.bin" );
drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h +2 -0
@@ -89,4 +89,6 @@ bool gp102_fb_vpr_scrub_required(struct nvkm_fb *);int gp102_fb_vpr_scrub (struct nvkm_fb *);int gv100_fb_init_page (struct nvkm_fb *); + +bool tu102_fb_vpr_scrub_required (struct nvkm_fb *);#endif
drivers/gpu/drm/nouveau/nvkm/subdev/fb/tu102.c new file +55 -0
55 lines not on this page · raw message
Signature · 1 line
2.35.1
PATCH 3/3 drm/nouveau/acr/gm20b: regression fixes
In reply to Ben SkeggsMissed some Tegra-specific quirks when reworking ACR to support Ampere.
--- drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 3 +++ drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c | 14 +++++++++++++- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/core/firmware.c +3 -0
@@ -151,6 +151,9 @@ nvkm_firmware_mem_page(struct nvkm_memory *memory)static enum nvkm_memory_target nvkm_firmware_mem_target (struct nvkm_memory *memory) { +if (nvkm_firmware_mem (memory)->device->func->tegra) +return NVKM_MEM_TARGET_NCOH ; +return NVKM_MEM_TARGET_HOST ; }
drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c +13 -1
@@ -48,6 +48,16 @@ gm200_flcn_pio_dmem_rd(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l img +=4 ; len -=4 ; } + +/* Sigh. Tegra PMU FW's init message... */ +if (len) { +u32 data =nvkm_falcon_rd32 (falcon,0x1c4 + (port *8 )); + +while (len--) { + *(u8 *)img++ = data &0xff ; + data >>=8 ; + } + } } static void
@@ -64,6 +74,8 @@ gm200_flcn_pio_dmem_wr(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l img +=4 ; len -=4 ; } + +WARN_ON (len); } static void
@@ -74,7 +86,7 @@ gm200_flcn_pio_dmem_wr_init(struct nvkm_falcon *falcon, u8 port, bool sec, u32 dconst struct nvkm_falcon_func_pio gm200_flcn_dmem_pio = { - .min =4 , + .min =1 , .max =0x100 , .wr_init = gm200_flcn_pio_dmem_wr_init, .wr = gm200_flcn_pio_dmem_wr,
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c +1 -1
@@ -225,7 +225,7 @@ gm20b_pmu_init(struct nvkm_pmu *pmu) pmu->initmsg_received = false; -nvkm_falcon_load_dmem (falcon, &args, addr_args,sizeof (args),0 ); +nvkm_falcon_pio_wr (falcon, (u8 *)&args,0 ,0 ,DMEM , addr_args,sizeof (args),0 , false);nvkm_falcon_start (falcon);return 0 ; }
Signature · 1 line
2.35.1
For the whole series:
Will push to drm-misc-fixes in just a moment
Quoted 53 lines · Ben Skeggs
Starting from Turing, the driver is no longer responsible for initiating DEVINIT when required as the GPU started loading a FW image from ROM and executing DEVINIT itself after power-on.
However - we apparently still need to wait for it to complete.
This should correct some issues with runpm on some systems, where we get control of the HW before it's been fully reinitialised after resume from suspend.
Signed-off-by Ben Skeggs <[email protected]>--- .../drm/nouveau/nvkm/subdev/devinit/tu102.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+)drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c +23
-0@@ -65,10 +65,33 @@ tu102_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)return ret; } +static int +tu102_devinit_wait (struct nvkm_device *device) +{ +unsigned timeout =50 +2000 ; + +do { +if (nvkm_rd32 (device,0x118128 ) &0x00000001 ) { +if ((nvkm_rd32 (device,0x118234 ) &0x000000ff ) ==0xff ) +return 0 ; + } + +usleep_range (1000 ,2000 ); + }while (timeout--); + +return -ETIMEDOUT ; +} +int tu102_devinit_post (struct nvkm_devinit *base,bool post) {struct nv50_devinit *init =nv50_devinit (base); +int ret; + + ret =tu102_devinit_wait (init->base.subdev.device); +if (ret) +return ret; +gm200_devinit_preos (init, post);return 0 ; }
Signature · 3 lines
Cheers, Lyude Paul (she/her) Software Engineer at Red Hat
Quoted 6 lines · Lyude Paul
For the whole series:
Reviewed-by Lyude Paul <[email protected]>Will push to drm-misc-fixes in just a moment
Thank you Lyude! Much appreciated.
Ben.
Quoted 61 lines · Ben Skeggs
Quoted 43 lines
Starting from Turing, the driver is no longer responsible for initiating DEVINIT when required as the GPU started loading a FW image from ROM and executing DEVINIT itself after power-on.
However - we apparently still need to wait for it to complete.
This should correct some issues with runpm on some systems, where we get control of the HW before it's been fully reinitialised after resume from suspend.
Signed-off-by Ben Skeggs <[email protected]>--- .../drm/nouveau/nvkm/subdev/devinit/tu102.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+)drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c +17
-0@@ -65,10 +65,33 @@ tu102_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)return ret; } +static int +tu102_devinit_wait (struct nvkm_device *device) +{ +unsigned timeout =50 +2000 ; + +do { +if (nvkm_rd32 (device,0x118128 ) &0x00000001 ) { +if ((nvkm_rd32 (device,0x118234 ) &0x000000ff ) ==0xff ) +return 0 ; + } + +usleep_range (1000 ,2000 ); + }while (timeout--); + +return -ETIMEDOUT ; +} +int tu102_devinit_post (struct nvkm_devinit *base,bool post) {drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c tu102_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq) · line 97
Quoted 10 lines
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c +6
-0struct nv50_devinit *init =nv50_devinit (base); +int ret; + + ret =tu102_devinit_wait (init->base.subdev.device); +if (ret) +return ret; +gm200_devinit_preos (init, post);return 0 ; }--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat