提交 fe3d9c4b 编写于 作者: B Ben Skeggs 提交者: Dave Airlie

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: NBen Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 92a32a47
...@@ -200,7 +200,6 @@ nvc0_bar_init(struct nouveau_object *object) ...@@ -200,7 +200,6 @@ nvc0_bar_init(struct nouveau_object *object)
nv_mask(priv, 0x000200, 0x00000100, 0x00000000); nv_mask(priv, 0x000200, 0x00000100, 0x00000000);
nv_mask(priv, 0x000200, 0x00000100, 0x00000100); nv_mask(priv, 0x000200, 0x00000100, 0x00000100);
nv_mask(priv, 0x100c80, 0x00000001, 0x00000000);
nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12); nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12);
if (priv->bar[0].mem) if (priv->bar[0].mem)
......
...@@ -60,6 +60,7 @@ nvc0_fb_init(struct nouveau_object *object) ...@@ -60,6 +60,7 @@ nvc0_fb_init(struct nouveau_object *object)
if (priv->r100c10_page) if (priv->r100c10_page)
nv_wr32(priv, 0x100c10, priv->r100c10 >> 8); nv_wr32(priv, 0x100c10, priv->r100c10 >> 8);
nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */
return 0; return 0;
} }
......
...@@ -98,6 +98,7 @@ static int ...@@ -98,6 +98,7 @@ static int
gf100_ltc_init(struct nouveau_object *object) gf100_ltc_init(struct nouveau_object *object)
{ {
struct nvkm_ltc_priv *priv = (void *)object; struct nvkm_ltc_priv *priv = (void *)object;
u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
int ret; int ret;
ret = nvkm_ltc_init(priv); ret = nvkm_ltc_init(priv);
...@@ -107,6 +108,7 @@ gf100_ltc_init(struct nouveau_object *object) ...@@ -107,6 +108,7 @@ gf100_ltc_init(struct nouveau_object *object)
nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */ nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */
nv_wr32(priv, 0x17e8d8, priv->ltc_nr); nv_wr32(priv, 0x17e8d8, priv->ltc_nr);
nv_wr32(priv, 0x17e8d4, priv->tag_base); nv_wr32(priv, 0x17e8d4, priv->tag_base);
nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
return 0; return 0;
} }
......
...@@ -28,6 +28,7 @@ static int ...@@ -28,6 +28,7 @@ static int
gk104_ltc_init(struct nouveau_object *object) gk104_ltc_init(struct nouveau_object *object)
{ {
struct nvkm_ltc_priv *priv = (void *)object; struct nvkm_ltc_priv *priv = (void *)object;
u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
int ret; int ret;
ret = nvkm_ltc_init(priv); ret = nvkm_ltc_init(priv);
...@@ -37,6 +38,7 @@ gk104_ltc_init(struct nouveau_object *object) ...@@ -37,6 +38,7 @@ gk104_ltc_init(struct nouveau_object *object)
nv_wr32(priv, 0x17e8d8, priv->ltc_nr); nv_wr32(priv, 0x17e8d8, priv->ltc_nr);
nv_wr32(priv, 0x17e000, priv->ltc_nr); nv_wr32(priv, 0x17e000, priv->ltc_nr);
nv_wr32(priv, 0x17e8d4, priv->tag_base); nv_wr32(priv, 0x17e8d4, priv->tag_base);
nv_mask(priv, 0x17e8c0, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
return 0; return 0;
} }
......
...@@ -98,6 +98,7 @@ static int ...@@ -98,6 +98,7 @@ static int
gm107_ltc_init(struct nouveau_object *object) gm107_ltc_init(struct nouveau_object *object)
{ {
struct nvkm_ltc_priv *priv = (void *)object; struct nvkm_ltc_priv *priv = (void *)object;
u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
int ret; int ret;
ret = nvkm_ltc_init(priv); ret = nvkm_ltc_init(priv);
...@@ -106,6 +107,7 @@ gm107_ltc_init(struct nouveau_object *object) ...@@ -106,6 +107,7 @@ gm107_ltc_init(struct nouveau_object *object)
nv_wr32(priv, 0x17e27c, priv->ltc_nr); nv_wr32(priv, 0x17e27c, priv->ltc_nr);
nv_wr32(priv, 0x17e278, priv->tag_base); nv_wr32(priv, 0x17e278, priv->tag_base);
nv_mask(priv, 0x17e264, 0x00000002, lpg128 ? 0x00000002 : 0x00000000);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册