aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_ramht.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-09-01 01:24:29 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-09-24 02:20:00 -0400
commitb3beb167af0de6d7cb03aed0687eca645cfd06a6 (patch)
tree2699384f75536511e57a862b206c83b4405fa197 /drivers/gpu/drm/nouveau/nouveau_ramht.c
parent479dcaea09bf17e8de7005015345e4266723666d (diff)
drm/nouveau: modify object accessors, offset in bytes rather than dwords
Reviewed-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_ramht.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_ramht.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.c b/drivers/gpu/drm/nouveau/nouveau_ramht.c
index 8b27ee5411b3..e5cc93c55d80 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ramht.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ramht.c
@@ -54,7 +54,7 @@ nouveau_ramht_entry_valid(struct drm_device *dev, struct nouveau_gpuobj *ramht,
54 uint32_t offset) 54 uint32_t offset)
55{ 55{
56 struct drm_nouveau_private *dev_priv = dev->dev_private; 56 struct drm_nouveau_private *dev_priv = dev->dev_private;
57 uint32_t ctx = nv_ro32(dev, ramht, (offset + 4)/4); 57 uint32_t ctx = nv_ro32(ramht, offset + 4);
58 58
59 if (dev_priv->card_type < NV_40) 59 if (dev_priv->card_type < NV_40)
60 return ((ctx & NV_RAMHT_CONTEXT_VALID) != 0); 60 return ((ctx & NV_RAMHT_CONTEXT_VALID) != 0);
@@ -100,15 +100,15 @@ nouveau_ramht_insert(struct drm_device *dev, struct nouveau_gpuobj_ref *ref)
100 NV_DEBUG(dev, 100 NV_DEBUG(dev,
101 "insert ch%d 0x%08x: h=0x%08x, c=0x%08x\n", 101 "insert ch%d 0x%08x: h=0x%08x, c=0x%08x\n",
102 chan->id, co, ref->handle, ctx); 102 chan->id, co, ref->handle, ctx);
103 nv_wo32(dev, ramht, (co + 0)/4, ref->handle); 103 nv_wo32(ramht, co + 0, ref->handle);
104 nv_wo32(dev, ramht, (co + 4)/4, ctx); 104 nv_wo32(ramht, co + 4, ctx);
105 105
106 list_add_tail(&ref->list, &chan->ramht_refs); 106 list_add_tail(&ref->list, &chan->ramht_refs);
107 instmem->flush(dev); 107 instmem->flush(dev);
108 return 0; 108 return 0;
109 } 109 }
110 NV_DEBUG(dev, "collision ch%d 0x%08x: h=0x%08x\n", 110 NV_DEBUG(dev, "collision ch%d 0x%08x: h=0x%08x\n",
111 chan->id, co, nv_ro32(dev, ramht, co/4)); 111 chan->id, co, nv_ro32(ramht, co));
112 112
113 co += 8; 113 co += 8;
114 if (co >= dev_priv->ramht_size) 114 if (co >= dev_priv->ramht_size)
@@ -136,13 +136,13 @@ nouveau_ramht_remove(struct drm_device *dev, struct nouveau_gpuobj_ref *ref)
136 co = ho = nouveau_ramht_hash_handle(dev, chan->id, ref->handle); 136 co = ho = nouveau_ramht_hash_handle(dev, chan->id, ref->handle);
137 do { 137 do {
138 if (nouveau_ramht_entry_valid(dev, ramht, co) && 138 if (nouveau_ramht_entry_valid(dev, ramht, co) &&
139 (ref->handle == nv_ro32(dev, ramht, (co/4)))) { 139 (ref->handle == nv_ro32(ramht, co))) {
140 NV_DEBUG(dev, 140 NV_DEBUG(dev,
141 "remove ch%d 0x%08x: h=0x%08x, c=0x%08x\n", 141 "remove ch%d 0x%08x: h=0x%08x, c=0x%08x\n",
142 chan->id, co, ref->handle, 142 chan->id, co, ref->handle,
143 nv_ro32(dev, ramht, (co + 4))); 143 nv_ro32(ramht, co + 4));
144 nv_wo32(dev, ramht, (co + 0)/4, 0x00000000); 144 nv_wo32(ramht, co + 0, 0x00000000);
145 nv_wo32(dev, ramht, (co + 4)/4, 0x00000000); 145 nv_wo32(ramht, co + 4, 0x00000000);
146 146
147 list_del(&ref->list); 147 list_del(&ref->list);
148 instmem->flush(dev); 148 instmem->flush(dev);