From: Matthieu Castet Date: Fri, 2 Feb 2007 22:01:03 +0000 (+0100) Subject: nouveau: nv ctx switch opps the size of array was wrong X-Git-Tag: android-x86-1.6~713 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=55f7859a256814e3843790d88b275150f6161a26;p=android-x86%2Fexternal-libdrm.git nouveau: nv ctx switch opps the size of array was wrong --- diff --git a/shared-core/nv10_graph.c b/shared-core/nv10_graph.c index 726ec6df..7270344d 100644 --- a/shared-core/nv10_graph.c +++ b/shared-core/nv10_graph.c @@ -545,10 +545,10 @@ void nouveau_nv10_context_switch(drm_device_t *dev) #endif // save PGRAPH context - for (i = 0; i < sizeof(nv10_graph_ctx_regs); i++) + for (i = 0; i < sizeof(nv10_graph_ctx_regs)/sizeof(nv10_graph_ctx_regs[0]); i++) dev_priv->fifos[channel_old].nv10_pgraph_ctx[i] = NV_READ(nv10_graph_ctx_regs[i]); if (dev_priv->chipset>=0x17) { - for (j = 0; j < sizeof(nv17_graph_ctx_regs); i++,j++) + for (j = 0; j < sizeof(nv17_graph_ctx_regs)/sizeof(nv17_graph_ctx_regs[0]); i++,j++) dev_priv->fifos[channel_old].nv10_pgraph_ctx[i] = NV_READ(nv17_graph_ctx_regs[j]); } @@ -561,10 +561,10 @@ void nouveau_nv10_context_switch(drm_device_t *dev) // restore PGRAPH context //XXX not working yet #if 1 - for (i = 0; i < sizeof(nv10_graph_ctx_regs); i++) + for (i = 0; i < sizeof(nv10_graph_ctx_regs)/sizeof(nv10_graph_ctx_regs[0]); i++) NV_WRITE(nv10_graph_ctx_regs[i], dev_priv->fifos[channel].nv10_pgraph_ctx[i]); if (dev_priv->chipset>=0x17) { - for (j = 0; j < sizeof(nv17_graph_ctx_regs); i++,j++) + for (j = 0; j < sizeof(nv17_graph_ctx_regs)/sizeof(nv17_graph_ctx_regs[0]); i++,j++) NV_WRITE(nv17_graph_ctx_regs[j], dev_priv->fifos[channel].nv10_pgraph_ctx[i]); } nouveau_wait_for_idle(dev);