Skip to content

Commit 1cb9e2e

Browse files
committed
drm/nouveau/gr: enable memory loads on helper invocation on all channels
We have a lurking bug where Fragment Shader Helper Invocations can't load from memory. But this is actually required in OpenGL and is causing random hangs or failures in random shaders. It is unknown how widespread this issue is, but shaders hitting this can end up with infinite loops. We enable those only on all Kepler and newer GPUs where we use our own Firmware. Nvidia's firmware provides a way to set a kernelspace controlled list of mmio registers in the gr space from push buffers via MME macros. v2: drop code for gm200 and newer. Cc: Ben Skeggs <bskeggs@redhat.com> Cc: David Airlie <airlied@gmail.com> Cc: nouveau@lists.freedesktop.org Cc: stable@vger.kernel.org # 4.19+ Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230622152017.2512101-1-kherbst@redhat.com
1 parent e9d699a commit 1cb9e2e

File tree

6 files changed

+17
-1
lines changed

6 files changed

+17
-1
lines changed

drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ void gk104_grctx_generate_r418800(struct gf100_gr *);
117117

118118
extern const struct gf100_grctx_func gk110_grctx;
119119
void gk110_grctx_generate_r419eb0(struct gf100_gr *);
120+
void gk110_grctx_generate_r419f78(struct gf100_gr *);
120121

121122
extern const struct gf100_grctx_func gk110b_grctx;
122123
extern const struct gf100_grctx_func gk208_grctx;

drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk104.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,9 @@ static void
906906
gk104_grctx_generate_r419f78(struct gf100_gr *gr)
907907
{
908908
struct nvkm_device *device = gr->base.engine.subdev.device;
909-
nvkm_mask(device, 0x419f78, 0x00000001, 0x00000000);
909+
910+
/* bit 3 set disables loads in fp helper invocations, we need it enabled */
911+
nvkm_mask(device, 0x419f78, 0x00000009, 0x00000000);
910912
}
911913

912914
void

drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk110.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,15 @@ gk110_grctx_generate_r419eb0(struct gf100_gr *gr)
820820
nvkm_mask(device, 0x419eb0, 0x00001000, 0x00001000);
821821
}
822822

823+
void
824+
gk110_grctx_generate_r419f78(struct gf100_gr *gr)
825+
{
826+
struct nvkm_device *device = gr->base.engine.subdev.device;
827+
828+
/* bit 3 set disables loads in fp helper invocations, we need it enabled */
829+
nvkm_mask(device, 0x419f78, 0x00000008, 0x00000000);
830+
}
831+
823832
const struct gf100_grctx_func
824833
gk110_grctx = {
825834
.main = gf100_grctx_generate_main,
@@ -854,4 +863,5 @@ gk110_grctx = {
854863
.gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr,
855864
.r418800 = gk104_grctx_generate_r418800,
856865
.r419eb0 = gk110_grctx_generate_r419eb0,
866+
.r419f78 = gk110_grctx_generate_r419f78,
857867
};

drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk110b.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,5 @@ gk110b_grctx = {
103103
.gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr,
104104
.r418800 = gk104_grctx_generate_r418800,
105105
.r419eb0 = gk110_grctx_generate_r419eb0,
106+
.r419f78 = gk110_grctx_generate_r419f78,
106107
};

drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk208.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,4 +568,5 @@ gk208_grctx = {
568568
.dist_skip_table = gf117_grctx_generate_dist_skip_table,
569569
.gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr,
570570
.r418800 = gk104_grctx_generate_r418800,
571+
.r419f78 = gk110_grctx_generate_r419f78,
571572
};

drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,4 +988,5 @@ gm107_grctx = {
988988
.r406500 = gm107_grctx_generate_r406500,
989989
.gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr,
990990
.r419e00 = gm107_grctx_generate_r419e00,
991+
.r419f78 = gk110_grctx_generate_r419f78,
991992
};

0 commit comments

Comments
 (0)