Skip to content

Commit fe3d9c4

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau: ltc/gf100-: fix cbc issues on certain boards
A mismatch between FB and LTC's idea of how big a large page is causes issues such as black "holes" in rendering to occur on some boards (those where LTC is configured for 64KiB large pages) when compression is used. Confirmed to fix at least the GK107 MBP. Signed-off-by: Ben Skeggs <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
1 parent 92a32a4 commit fe3d9c4

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ nvc0_bar_init(struct nouveau_object *object)
200200

201201
nv_mask(priv, 0x000200, 0x00000100, 0x00000000);
202202
nv_mask(priv, 0x000200, 0x00000100, 0x00000100);
203-
nv_mask(priv, 0x100c80, 0x00000001, 0x00000000);
204203

205204
nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12);
206205
if (priv->bar[0].mem)

drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ nvc0_fb_init(struct nouveau_object *object)
6060

6161
if (priv->r100c10_page)
6262
nv_wr32(priv, 0x100c10, priv->r100c10 >> 8);
63+
nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */
6364
return 0;
6465
}
6566

drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static int
9898
gf100_ltc_init(struct nouveau_object *object)
9999
{
100100
struct nvkm_ltc_priv *priv = (void *)object;
101+
u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
101102
int ret;
102103

103104
ret = nvkm_ltc_init(priv);
@@ -107,6 +108,7 @@ gf100_ltc_init(struct nouveau_object *object)
107108
nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */
108109
nv_wr32(priv, 0x17e8d8, priv->ltc_nr);
109110
nv_wr32(priv, 0x17e8d4, priv->tag_base);
111+
nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
110112
return 0;
111113
}
112114

drivers/gpu/drm/nouveau/core/subdev/ltc/gk104.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static int
2828
gk104_ltc_init(struct nouveau_object *object)
2929
{
3030
struct nvkm_ltc_priv *priv = (void *)object;
31+
u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
3132
int ret;
3233

3334
ret = nvkm_ltc_init(priv);
@@ -37,6 +38,7 @@ gk104_ltc_init(struct nouveau_object *object)
3738
nv_wr32(priv, 0x17e8d8, priv->ltc_nr);
3839
nv_wr32(priv, 0x17e000, priv->ltc_nr);
3940
nv_wr32(priv, 0x17e8d4, priv->tag_base);
41+
nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
4042
return 0;
4143
}
4244

drivers/gpu/drm/nouveau/core/subdev/ltc/gm107.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static int
9898
gm107_ltc_init(struct nouveau_object *object)
9999
{
100100
struct nvkm_ltc_priv *priv = (void *)object;
101+
u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
101102
int ret;
102103

103104
ret = nvkm_ltc_init(priv);
@@ -106,6 +107,7 @@ gm107_ltc_init(struct nouveau_object *object)
106107

107108
nv_wr32(priv, 0x17e27c, priv->ltc_nr);
108109
nv_wr32(priv, 0x17e278, priv->tag_base);
110+
nv_mask(priv, 0x17e264, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
109111
return 0;
110112
}
111113

0 commit comments

Comments
 (0)