drm/nv50-nvc0: ramht_size is meant to be in bytes, not entries
authorBen Skeggs <bskeggs@redhat.com>
Fri, 13 Aug 2010 00:22:41 +0000 (10:22 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 17 Aug 2010 01:59:24 +0000 (11:59 +1000)
Fixes an infinite loop that can happen in RAMHT lookup.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nv50_instmem.c
drivers/gpu/drm/nouveau/nvc0_instmem.c

index 37c7b48ab24af8a37c3e8ac29656b989ec5935f5..c95bf9b681ddc2352b8a251805e05456100f70b2 100644 (file)
@@ -278,7 +278,7 @@ nv50_instmem_init(struct drm_device *dev)
        /*XXX: incorrect, but needed to make hash func "work" */
        dev_priv->ramht_offset = 0x10000;
        dev_priv->ramht_bits   = 9;
-       dev_priv->ramht_size   = (1 << dev_priv->ramht_bits);
+       dev_priv->ramht_size   = (1 << dev_priv->ramht_bits) * 8;
        return 0;
 }
 
index 3ab3cdc42173300490c7e667eced2f39b0d36690..854e0d72fc0db5c5981b414910feb407c13c1f39 100644 (file)
@@ -221,7 +221,7 @@ nvc0_instmem_init(struct drm_device *dev)
        /*XXX: incorrect, but needed to make hash func "work" */
        dev_priv->ramht_offset = 0x10000;
        dev_priv->ramht_bits   = 9;
-       dev_priv->ramht_size   = (1 << dev_priv->ramht_bits);
+       dev_priv->ramht_size   = (1 << dev_priv->ramht_bits) * 8;
        return 0;
 }