diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-05-13 21:37:18 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-05-19 23:24:06 -0400 |
commit | 49debbe4540efd08b4e9a1c499dce392a43bf1ed (patch) | |
tree | fe91eb893dc14e271b6580c854edf18fabece806 | |
parent | 6d5f83834dc2b064b8c1202ea281820286b675a8 (diff) |
drm/nvc0/ltcg: fix handling of disabled partitions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c index e4940fb166e8..7c6194f2e074 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c | |||
@@ -29,7 +29,6 @@ | |||
29 | struct nvc0_ltcg_priv { | 29 | struct nvc0_ltcg_priv { |
30 | struct nouveau_ltcg base; | 30 | struct nouveau_ltcg base; |
31 | u32 part_nr; | 31 | u32 part_nr; |
32 | u32 part_mask; | ||
33 | u32 subp_nr; | 32 | u32 subp_nr; |
34 | struct nouveau_mm tags; | 33 | struct nouveau_mm tags; |
35 | u32 num_tags; | 34 | u32 num_tags; |
@@ -105,8 +104,6 @@ nvc0_ltcg_tags_clear(struct nouveau_ltcg *ltcg, u32 first, u32 count) | |||
105 | 104 | ||
106 | /* wait until it's finished with clearing */ | 105 | /* wait until it's finished with clearing */ |
107 | for (p = 0; p < priv->part_nr; ++p) { | 106 | for (p = 0; p < priv->part_nr; ++p) { |
108 | if (!(priv->part_mask & (1 << p))) | ||
109 | continue; | ||
110 | for (i = 0; i < priv->subp_nr; ++i) | 107 | for (i = 0; i < priv->subp_nr; ++i) |
111 | nv_wait(priv, 0x1410c8 + p * 0x2000 + i * 0x400, ~0, 0); | 108 | nv_wait(priv, 0x1410c8 + p * 0x2000 + i * 0x400, ~0, 0); |
112 | } | 109 | } |
@@ -167,16 +164,20 @@ nvc0_ltcg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
167 | { | 164 | { |
168 | struct nvc0_ltcg_priv *priv; | 165 | struct nvc0_ltcg_priv *priv; |
169 | struct nouveau_fb *pfb = nouveau_fb(parent); | 166 | struct nouveau_fb *pfb = nouveau_fb(parent); |
170 | int ret; | 167 | u32 parts, mask; |
168 | int ret, i; | ||
171 | 169 | ||
172 | ret = nouveau_ltcg_create(parent, engine, oclass, &priv); | 170 | ret = nouveau_ltcg_create(parent, engine, oclass, &priv); |
173 | *pobject = nv_object(priv); | 171 | *pobject = nv_object(priv); |
174 | if (ret) | 172 | if (ret) |
175 | return ret; | 173 | return ret; |
176 | 174 | ||
177 | priv->part_nr = nv_rd32(priv, 0x022438); | 175 | parts = nv_rd32(priv, 0x022438); |
178 | priv->part_mask = nv_rd32(priv, 0x022554); | 176 | mask = nv_rd32(priv, 0x022554); |
179 | 177 | for (i = 0; i < parts; i++) { | |
178 | if (!(mask & (1 << i))) | ||
179 | priv->part_nr++; | ||
180 | } | ||
180 | priv->subp_nr = nv_rd32(priv, 0x17e8dc) >> 28; | 181 | priv->subp_nr = nv_rd32(priv, 0x17e8dc) >> 28; |
181 | 182 | ||
182 | nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */ | 183 | nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */ |