aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-09-04 22:19:26 -0400
committerBen Skeggs <bskeggs@redhat.com>2012-10-02 23:13:09 -0400
commitcd8c14b407d59ac4b8d324f5f9cdf223a2079c88 (patch)
treeacefb0b8c55217d6e9663fd29f75f08f1b992b0d /drivers/gpu
parente5bf578ce61aecd4612d16e60235c11ed5f92c0e (diff)
drm/nvc0/ltcg: read LTS count at startup
Not really sure how to confirm this 100%, but, the numbers match on all the traces I have for NVCx (2 LTS), NVD9 (1LTS) and NVEx (4LTS). Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c
index 7c2840cc2bbf..078a2b9d6bd6 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c
@@ -26,6 +26,7 @@
26 26
27struct nvc0_ltcg_priv { 27struct nvc0_ltcg_priv {
28 struct nouveau_ltcg base; 28 struct nouveau_ltcg base;
29 u32 subp_nr;
29}; 30};
30 31
31static void 32static void
@@ -49,7 +50,7 @@ nvc0_ltcg_intr(struct nouveau_subdev *subdev)
49 units = nv_rd32(priv, 0x00017c); 50 units = nv_rd32(priv, 0x00017c);
50 while (units) { 51 while (units) {
51 u32 subp, unit = ffs(units) - 1; 52 u32 subp, unit = ffs(units) - 1;
52 for (subp = 0; subp < 2; subp++) 53 for (subp = 0; subp < priv->subp_nr; subp++)
53 nvc0_ltcg_subp_isr(priv, unit, subp); 54 nvc0_ltcg_subp_isr(priv, unit, subp);
54 units &= ~(1 << unit); 55 units &= ~(1 << unit);
55 } 56 }
@@ -73,6 +74,7 @@ nvc0_ltcg_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
73 if (ret) 74 if (ret)
74 return ret; 75 return ret;
75 76
77 priv->subp_nr = nv_rd32(priv, 0x17e8dc) >> 24;
76 nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */ 78 nv_mask(priv, 0x17e820, 0x00100000, 0x00000000); /* INTR_EN &= ~0x10 */
77 79
78 nv_subdev(priv)->intr = nvc0_ltcg_intr; 80 nv_subdev(priv)->intr = nvc0_ltcg_intr;