Commit 9369f06a authored by Ben Skeggs's avatar Ben Skeggs Committed by Luis Henriques

drm/nouveau: ltc/gf100-: fix cbc issues on certain boards

commit fe3d9c4b upstream.

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: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Cc: Sven Joachim <svenjoac@gmx.de>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent a1b8144b
...@@ -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;
} }
......
...@@ -200,6 +200,7 @@ gf100_ltcg_init(struct nouveau_object *object) ...@@ -200,6 +200,7 @@ gf100_ltcg_init(struct nouveau_object *object)
{ {
struct nouveau_ltcg *ltcg = (struct nouveau_ltcg *)object; struct nouveau_ltcg *ltcg = (struct nouveau_ltcg *)object;
struct gf100_ltcg_priv *priv = (struct gf100_ltcg_priv *)ltcg; struct gf100_ltcg_priv *priv = (struct gf100_ltcg_priv *)ltcg;
u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
int ret; int ret;
ret = nouveau_ltcg_init(ltcg); ret = nouveau_ltcg_init(ltcg);
...@@ -211,6 +212,7 @@ gf100_ltcg_init(struct nouveau_object *object) ...@@ -211,6 +212,7 @@ gf100_ltcg_init(struct nouveau_object *object)
if (nv_device(ltcg)->card_type >= NV_E0) if (nv_device(ltcg)->card_type >= NV_E0)
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;
} }
......
...@@ -119,6 +119,7 @@ gm107_ltcg_init(struct nouveau_object *object) ...@@ -119,6 +119,7 @@ gm107_ltcg_init(struct nouveau_object *object)
{ {
struct nouveau_ltcg *ltcg = (struct nouveau_ltcg *)object; struct nouveau_ltcg *ltcg = (struct nouveau_ltcg *)object;
struct gf100_ltcg_priv *priv = (struct gf100_ltcg_priv *)ltcg; struct gf100_ltcg_priv *priv = (struct gf100_ltcg_priv *)ltcg;
u32 lpg128 = !(nv_rd32(priv, 0x100c80) & 0x00000001);
int ret; int ret;
ret = nouveau_ltcg_init(ltcg); ret = nouveau_ltcg_init(ltcg);
...@@ -127,6 +128,7 @@ gm107_ltcg_init(struct nouveau_object *object) ...@@ -127,6 +128,7 @@ gm107_ltcg_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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment