diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-09-01 01:24:35 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-09-24 02:23:22 -0400 |
commit | e05c5a317efb03854950a3fcc5c9501bfefc7d68 (patch) | |
tree | 188a3d497848cd383e69734a17e4d76f7939056f /drivers/gpu/drm/nouveau | |
parent | fbd2895e45aebdb3d3ea73a3a796cf3bb9c912da (diff) |
drm/nouveau: tidy ram{ht,fc,ro} a bit
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_object.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ramht.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ramht.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_fifo.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_instmem.c | 87 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv10_fifo.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv40_fifo.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_fifo.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_instmem.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvc0_instmem.c | 4 |
11 files changed, 69 insertions, 101 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 3ba7a649fe51..71e27087951b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -545,15 +545,11 @@ struct drm_nouveau_private { | |||
545 | spinlock_t context_switch_lock; | 545 | spinlock_t context_switch_lock; |
546 | 546 | ||
547 | /* RAMIN configuration, RAMFC, RAMHT and RAMRO offsets */ | 547 | /* RAMIN configuration, RAMFC, RAMHT and RAMRO offsets */ |
548 | struct nouveau_ramht *ramht; | 548 | struct nouveau_ramht *ramht; |
549 | struct nouveau_gpuobj *ramfc; | ||
550 | struct nouveau_gpuobj *ramro; | ||
551 | |||
549 | uint32_t ramin_rsvd_vram; | 552 | uint32_t ramin_rsvd_vram; |
550 | uint32_t ramht_offset; | ||
551 | uint32_t ramht_size; | ||
552 | uint32_t ramht_bits; | ||
553 | uint32_t ramfc_offset; | ||
554 | uint32_t ramfc_size; | ||
555 | uint32_t ramro_offset; | ||
556 | uint32_t ramro_size; | ||
557 | 553 | ||
558 | struct { | 554 | struct { |
559 | enum { | 555 | enum { |
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c index b68922f2fe54..198c2514f893 100644 --- a/drivers/gpu/drm/nouveau/nouveau_object.c +++ b/drivers/gpu/drm/nouveau/nouveau_object.c | |||
@@ -192,8 +192,6 @@ nouveau_gpuobj_takedown(struct drm_device *dev) | |||
192 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 192 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
193 | 193 | ||
194 | NV_DEBUG(dev, "\n"); | 194 | NV_DEBUG(dev, "\n"); |
195 | |||
196 | nouveau_ramht_ref(NULL, &dev_priv->ramht, NULL); | ||
197 | } | 195 | } |
198 | 196 | ||
199 | void | 197 | void |
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.c b/drivers/gpu/drm/nouveau/nouveau_ramht.c index 5f9d52f06305..ccbc8d69ea68 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ramht.c +++ b/drivers/gpu/drm/nouveau/nouveau_ramht.c | |||
@@ -28,21 +28,23 @@ | |||
28 | #include "nouveau_ramht.h" | 28 | #include "nouveau_ramht.h" |
29 | 29 | ||
30 | static uint32_t | 30 | static uint32_t |
31 | nouveau_ramht_hash_handle(struct drm_device *dev, int channel, uint32_t handle) | 31 | nouveau_ramht_hash_handle(struct nouveau_channel *chan, uint32_t handle) |
32 | { | 32 | { |
33 | struct drm_device *dev = chan->dev; | ||
33 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 34 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
35 | struct nouveau_ramht *ramht = chan->ramht; | ||
34 | uint32_t hash = 0; | 36 | uint32_t hash = 0; |
35 | int i; | 37 | int i; |
36 | 38 | ||
37 | NV_DEBUG(dev, "ch%d handle=0x%08x\n", channel, handle); | 39 | NV_DEBUG(dev, "ch%d handle=0x%08x\n", chan->id, handle); |
38 | 40 | ||
39 | for (i = 32; i > 0; i -= dev_priv->ramht_bits) { | 41 | for (i = 32; i > 0; i -= ramht->bits) { |
40 | hash ^= (handle & ((1 << dev_priv->ramht_bits) - 1)); | 42 | hash ^= (handle & ((1 << ramht->bits) - 1)); |
41 | handle >>= dev_priv->ramht_bits; | 43 | handle >>= ramht->bits; |
42 | } | 44 | } |
43 | 45 | ||
44 | if (dev_priv->card_type < NV_50) | 46 | if (dev_priv->card_type < NV_50) |
45 | hash ^= channel << (dev_priv->ramht_bits - 4); | 47 | hash ^= chan->id << (ramht->bits - 4); |
46 | hash <<= 3; | 48 | hash <<= 3; |
47 | 49 | ||
48 | NV_DEBUG(dev, "hash=0x%08x\n", hash); | 50 | NV_DEBUG(dev, "hash=0x%08x\n", hash); |
@@ -103,7 +105,7 @@ nouveau_ramht_insert(struct nouveau_channel *chan, u32 handle, | |||
103 | } | 105 | } |
104 | } | 106 | } |
105 | 107 | ||
106 | co = ho = nouveau_ramht_hash_handle(dev, chan->id, handle); | 108 | co = ho = nouveau_ramht_hash_handle(chan, handle); |
107 | do { | 109 | do { |
108 | if (!nouveau_ramht_entry_valid(dev, ramht, co)) { | 110 | if (!nouveau_ramht_entry_valid(dev, ramht, co)) { |
109 | NV_DEBUG(dev, | 111 | NV_DEBUG(dev, |
@@ -119,7 +121,7 @@ nouveau_ramht_insert(struct nouveau_channel *chan, u32 handle, | |||
119 | chan->id, co, nv_ro32(ramht, co)); | 121 | chan->id, co, nv_ro32(ramht, co)); |
120 | 122 | ||
121 | co += 8; | 123 | co += 8; |
122 | if (co >= dev_priv->ramht_size) | 124 | if (co >= ramht->size) |
123 | co = 0; | 125 | co = 0; |
124 | } while (co != ho); | 126 | } while (co != ho); |
125 | 127 | ||
@@ -149,7 +151,7 @@ nouveau_ramht_remove(struct nouveau_channel *chan, u32 handle) | |||
149 | break; | 151 | break; |
150 | } | 152 | } |
151 | 153 | ||
152 | co = ho = nouveau_ramht_hash_handle(dev, chan->id, handle); | 154 | co = ho = nouveau_ramht_hash_handle(chan, handle); |
153 | do { | 155 | do { |
154 | if (nouveau_ramht_entry_valid(dev, ramht, co) && | 156 | if (nouveau_ramht_entry_valid(dev, ramht, co) && |
155 | (handle == nv_ro32(ramht, co))) { | 157 | (handle == nv_ro32(ramht, co))) { |
@@ -163,7 +165,7 @@ nouveau_ramht_remove(struct nouveau_channel *chan, u32 handle) | |||
163 | } | 165 | } |
164 | 166 | ||
165 | co += 8; | 167 | co += 8; |
166 | if (co >= dev_priv->ramht_size) | 168 | if (co >= ramht->size) |
167 | co = 0; | 169 | co = 0; |
168 | } while (co != ho); | 170 | } while (co != ho); |
169 | 171 | ||
@@ -196,6 +198,7 @@ nouveau_ramht_new(struct drm_device *dev, struct nouveau_gpuobj *gpuobj, | |||
196 | 198 | ||
197 | ramht->dev = dev; | 199 | ramht->dev = dev; |
198 | ramht->refcount = 1; | 200 | ramht->refcount = 1; |
201 | ramht->bits = drm_order(gpuobj->size / 8); | ||
199 | INIT_LIST_HEAD(&ramht->entries); | 202 | INIT_LIST_HEAD(&ramht->entries); |
200 | nouveau_gpuobj_ref(gpuobj, &ramht->gpuobj); | 203 | nouveau_gpuobj_ref(gpuobj, &ramht->gpuobj); |
201 | 204 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.h b/drivers/gpu/drm/nouveau/nouveau_ramht.h index 7076ae4c07a5..f37737a93642 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ramht.h +++ b/drivers/gpu/drm/nouveau/nouveau_ramht.h | |||
@@ -37,6 +37,7 @@ struct nouveau_ramht { | |||
37 | int refcount; | 37 | int refcount; |
38 | struct nouveau_gpuobj *gpuobj; | 38 | struct nouveau_gpuobj *gpuobj; |
39 | struct list_head entries; | 39 | struct list_head entries; |
40 | int bits; | ||
40 | }; | 41 | }; |
41 | 42 | ||
42 | extern int nouveau_ramht_new(struct drm_device *, struct nouveau_gpuobj *, | 43 | extern int nouveau_ramht_new(struct drm_device *, struct nouveau_gpuobj *, |
diff --git a/drivers/gpu/drm/nouveau/nv04_fifo.c b/drivers/gpu/drm/nouveau/nv04_fifo.c index b7ecafb78d77..64dc0e215eeb 100644 --- a/drivers/gpu/drm/nouveau/nv04_fifo.c +++ b/drivers/gpu/drm/nouveau/nv04_fifo.c | |||
@@ -27,8 +27,9 @@ | |||
27 | #include "drmP.h" | 27 | #include "drmP.h" |
28 | #include "drm.h" | 28 | #include "drm.h" |
29 | #include "nouveau_drv.h" | 29 | #include "nouveau_drv.h" |
30 | #include "nouveau_ramht.h" | ||
30 | 31 | ||
31 | #define NV04_RAMFC(c) (dev_priv->ramfc_offset + ((c) * NV04_RAMFC__SIZE)) | 32 | #define NV04_RAMFC(c) (dev_priv->ramfc->pinst + ((c) * NV04_RAMFC__SIZE)) |
32 | #define NV04_RAMFC__SIZE 32 | 33 | #define NV04_RAMFC__SIZE 32 |
33 | #define NV04_RAMFC_DMA_PUT 0x00 | 34 | #define NV04_RAMFC_DMA_PUT 0x00 |
34 | #define NV04_RAMFC_DMA_GET 0x04 | 35 | #define NV04_RAMFC_DMA_GET 0x04 |
@@ -262,10 +263,10 @@ nv04_fifo_init_ramxx(struct drm_device *dev) | |||
262 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 263 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
263 | 264 | ||
264 | nv_wr32(dev, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ | | 265 | nv_wr32(dev, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ | |
265 | ((dev_priv->ramht_bits - 9) << 16) | | 266 | ((dev_priv->ramht->bits - 9) << 16) | |
266 | (dev_priv->ramht_offset >> 8)); | 267 | (dev_priv->ramht->gpuobj->pinst >> 8)); |
267 | nv_wr32(dev, NV03_PFIFO_RAMRO, dev_priv->ramro_offset>>8); | 268 | nv_wr32(dev, NV03_PFIFO_RAMRO, dev_priv->ramro->pinst >> 8); |
268 | nv_wr32(dev, NV03_PFIFO_RAMFC, dev_priv->ramfc_offset >> 8); | 269 | nv_wr32(dev, NV03_PFIFO_RAMFC, dev_priv->ramfc->pinst >> 8); |
269 | } | 270 | } |
270 | 271 | ||
271 | static void | 272 | static void |
diff --git a/drivers/gpu/drm/nouveau/nv04_instmem.c b/drivers/gpu/drm/nouveau/nv04_instmem.c index 15cd468f4c29..88316100389b 100644 --- a/drivers/gpu/drm/nouveau/nv04_instmem.c +++ b/drivers/gpu/drm/nouveau/nv04_instmem.c | |||
@@ -18,65 +18,15 @@ nouveau_fifo_ctx_size(struct drm_device *dev) | |||
18 | return 32; | 18 | return 32; |
19 | } | 19 | } |
20 | 20 | ||
21 | static void | ||
22 | nv04_instmem_configure_fixed_tables(struct drm_device *dev) | ||
23 | { | ||
24 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
25 | struct nouveau_engine *engine = &dev_priv->engine; | ||
26 | |||
27 | /* FIFO hash table (RAMHT) | ||
28 | * use 4k hash table at RAMIN+0x10000 | ||
29 | * TODO: extend the hash table | ||
30 | */ | ||
31 | dev_priv->ramht_offset = 0x10000; | ||
32 | dev_priv->ramht_bits = 9; | ||
33 | dev_priv->ramht_size = (1 << dev_priv->ramht_bits); /* nr entries */ | ||
34 | dev_priv->ramht_size *= 8; /* 2 32-bit values per entry in RAMHT */ | ||
35 | NV_DEBUG(dev, "RAMHT offset=0x%x, size=%d\n", dev_priv->ramht_offset, | ||
36 | dev_priv->ramht_size); | ||
37 | |||
38 | /* FIFO runout table (RAMRO) - 512k at 0x11200 */ | ||
39 | dev_priv->ramro_offset = 0x11200; | ||
40 | dev_priv->ramro_size = 512; | ||
41 | NV_DEBUG(dev, "RAMRO offset=0x%x, size=%d\n", dev_priv->ramro_offset, | ||
42 | dev_priv->ramro_size); | ||
43 | |||
44 | /* FIFO context table (RAMFC) | ||
45 | * NV40 : Not sure exactly how to position RAMFC on some cards, | ||
46 | * 0x30002 seems to position it at RAMIN+0x20000 on these | ||
47 | * cards. RAMFC is 4kb (32 fifos, 128byte entries). | ||
48 | * Others: Position RAMFC at RAMIN+0x11400 | ||
49 | */ | ||
50 | dev_priv->ramfc_size = engine->fifo.channels * | ||
51 | nouveau_fifo_ctx_size(dev); | ||
52 | switch (dev_priv->card_type) { | ||
53 | case NV_40: | ||
54 | dev_priv->ramfc_offset = 0x20000; | ||
55 | break; | ||
56 | case NV_30: | ||
57 | case NV_20: | ||
58 | case NV_10: | ||
59 | case NV_04: | ||
60 | default: | ||
61 | dev_priv->ramfc_offset = 0x11400; | ||
62 | break; | ||
63 | } | ||
64 | NV_DEBUG(dev, "RAMFC offset=0x%x, size=%d\n", dev_priv->ramfc_offset, | ||
65 | dev_priv->ramfc_size); | ||
66 | } | ||
67 | |||
68 | int nv04_instmem_init(struct drm_device *dev) | 21 | int nv04_instmem_init(struct drm_device *dev) |
69 | { | 22 | { |
70 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 23 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
71 | struct nouveau_gpuobj *ramht = NULL; | 24 | struct nouveau_gpuobj *ramht = NULL; |
72 | uint32_t offset; | 25 | u32 offset, length; |
73 | int ret; | 26 | int ret; |
74 | 27 | ||
75 | nv04_instmem_configure_fixed_tables(dev); | ||
76 | |||
77 | /* Setup shared RAMHT */ | 28 | /* Setup shared RAMHT */ |
78 | ret = nouveau_gpuobj_new_fake(dev, dev_priv->ramht_offset, ~0, | 29 | ret = nouveau_gpuobj_new_fake(dev, 0x10000, ~0, 4096, |
79 | dev_priv->ramht_size, | ||
80 | NVOBJ_FLAG_ZERO_ALLOC, &ramht); | 30 | NVOBJ_FLAG_ZERO_ALLOC, &ramht); |
81 | if (ret) | 31 | if (ret) |
82 | return ret; | 32 | return ret; |
@@ -86,10 +36,30 @@ int nv04_instmem_init(struct drm_device *dev) | |||
86 | if (ret) | 36 | if (ret) |
87 | return ret; | 37 | return ret; |
88 | 38 | ||
89 | /* Create a heap to manage RAMIN allocations, we don't allocate | 39 | /* And RAMRO */ |
90 | * the space that was reserved for RAMHT/FC/RO. | 40 | ret = nouveau_gpuobj_new_fake(dev, 0x11200, ~0, 512, |
91 | */ | 41 | NVOBJ_FLAG_ZERO_ALLOC, &dev_priv->ramro); |
92 | offset = dev_priv->ramfc_offset + dev_priv->ramfc_size; | 42 | if (ret) |
43 | return ret; | ||
44 | |||
45 | /* And RAMFC */ | ||
46 | length = dev_priv->engine.fifo.channels * nouveau_fifo_ctx_size(dev); | ||
47 | switch (dev_priv->card_type) { | ||
48 | case NV_40: | ||
49 | offset = 0x20000; | ||
50 | break; | ||
51 | default: | ||
52 | offset = 0x11400; | ||
53 | break; | ||
54 | } | ||
55 | |||
56 | ret = nouveau_gpuobj_new_fake(dev, offset, ~0, length, | ||
57 | NVOBJ_FLAG_ZERO_ALLOC, &dev_priv->ramfc); | ||
58 | if (ret) | ||
59 | return ret; | ||
60 | |||
61 | /* Only allow space after RAMFC to be used for object allocation */ | ||
62 | offset += length; | ||
93 | 63 | ||
94 | /* It appears RAMRO (or something?) is controlled by 0x2220/0x2230 | 64 | /* It appears RAMRO (or something?) is controlled by 0x2220/0x2230 |
95 | * on certain NV4x chipsets as well as RAMFC. When 0x2230 == 0 | 65 | * on certain NV4x chipsets as well as RAMFC. When 0x2230 == 0 |
@@ -118,6 +88,11 @@ int nv04_instmem_init(struct drm_device *dev) | |||
118 | void | 88 | void |
119 | nv04_instmem_takedown(struct drm_device *dev) | 89 | nv04_instmem_takedown(struct drm_device *dev) |
120 | { | 90 | { |
91 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
92 | |||
93 | nouveau_ramht_ref(NULL, &dev_priv->ramht, NULL); | ||
94 | nouveau_gpuobj_ref(NULL, &dev_priv->ramro); | ||
95 | nouveau_gpuobj_ref(NULL, &dev_priv->ramfc); | ||
121 | } | 96 | } |
122 | 97 | ||
123 | int | 98 | int |
diff --git a/drivers/gpu/drm/nouveau/nv10_fifo.c b/drivers/gpu/drm/nouveau/nv10_fifo.c index ccb07fb701ca..f1b03ad58fd5 100644 --- a/drivers/gpu/drm/nouveau/nv10_fifo.c +++ b/drivers/gpu/drm/nouveau/nv10_fifo.c | |||
@@ -27,8 +27,9 @@ | |||
27 | #include "drmP.h" | 27 | #include "drmP.h" |
28 | #include "drm.h" | 28 | #include "drm.h" |
29 | #include "nouveau_drv.h" | 29 | #include "nouveau_drv.h" |
30 | #include "nouveau_ramht.h" | ||
30 | 31 | ||
31 | #define NV10_RAMFC(c) (dev_priv->ramfc_offset + ((c) * NV10_RAMFC__SIZE)) | 32 | #define NV10_RAMFC(c) (dev_priv->ramfc->pinst + ((c) * NV10_RAMFC__SIZE)) |
32 | #define NV10_RAMFC__SIZE ((dev_priv->chipset) >= 0x17 ? 64 : 32) | 33 | #define NV10_RAMFC__SIZE ((dev_priv->chipset) >= 0x17 ? 64 : 32) |
33 | 34 | ||
34 | int | 35 | int |
@@ -202,14 +203,14 @@ nv10_fifo_init_ramxx(struct drm_device *dev) | |||
202 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 203 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
203 | 204 | ||
204 | nv_wr32(dev, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ | | 205 | nv_wr32(dev, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ | |
205 | ((dev_priv->ramht_bits - 9) << 16) | | 206 | ((dev_priv->ramht->bits - 9) << 16) | |
206 | (dev_priv->ramht_offset >> 8)); | 207 | (dev_priv->ramht->gpuobj->pinst >> 8)); |
207 | nv_wr32(dev, NV03_PFIFO_RAMRO, dev_priv->ramro_offset>>8); | 208 | nv_wr32(dev, NV03_PFIFO_RAMRO, dev_priv->ramro->pinst >> 8); |
208 | 209 | ||
209 | if (dev_priv->chipset < 0x17) { | 210 | if (dev_priv->chipset < 0x17) { |
210 | nv_wr32(dev, NV03_PFIFO_RAMFC, dev_priv->ramfc_offset >> 8); | 211 | nv_wr32(dev, NV03_PFIFO_RAMFC, dev_priv->ramfc->pinst >> 8); |
211 | } else { | 212 | } else { |
212 | nv_wr32(dev, NV03_PFIFO_RAMFC, (dev_priv->ramfc_offset >> 8) | | 213 | nv_wr32(dev, NV03_PFIFO_RAMFC, (dev_priv->ramfc->pinst >> 8) | |
213 | (1 << 16) /* 64 Bytes entry*/); | 214 | (1 << 16) /* 64 Bytes entry*/); |
214 | /* XXX nvidia blob set bit 18, 21,23 for nv20 & nv30 */ | 215 | /* XXX nvidia blob set bit 18, 21,23 for nv20 & nv30 */ |
215 | } | 216 | } |
diff --git a/drivers/gpu/drm/nouveau/nv40_fifo.c b/drivers/gpu/drm/nouveau/nv40_fifo.c index 03f4dc13725b..d337b8b28cdd 100644 --- a/drivers/gpu/drm/nouveau/nv40_fifo.c +++ b/drivers/gpu/drm/nouveau/nv40_fifo.c | |||
@@ -27,8 +27,9 @@ | |||
27 | #include "drmP.h" | 27 | #include "drmP.h" |
28 | #include "nouveau_drv.h" | 28 | #include "nouveau_drv.h" |
29 | #include "nouveau_drm.h" | 29 | #include "nouveau_drm.h" |
30 | #include "nouveau_ramht.h" | ||
30 | 31 | ||
31 | #define NV40_RAMFC(c) (dev_priv->ramfc_offset + ((c) * NV40_RAMFC__SIZE)) | 32 | #define NV40_RAMFC(c) (dev_priv->ramfc->pinst + ((c) * NV40_RAMFC__SIZE)) |
32 | #define NV40_RAMFC__SIZE 128 | 33 | #define NV40_RAMFC__SIZE 128 |
33 | 34 | ||
34 | int | 35 | int |
@@ -240,9 +241,9 @@ nv40_fifo_init_ramxx(struct drm_device *dev) | |||
240 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 241 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
241 | 242 | ||
242 | nv_wr32(dev, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ | | 243 | nv_wr32(dev, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ | |
243 | ((dev_priv->ramht_bits - 9) << 16) | | 244 | ((dev_priv->ramht->bits - 9) << 16) | |
244 | (dev_priv->ramht_offset >> 8)); | 245 | (dev_priv->ramht->gpuobj->pinst >> 8)); |
245 | nv_wr32(dev, NV03_PFIFO_RAMRO, dev_priv->ramro_offset>>8); | 246 | nv_wr32(dev, NV03_PFIFO_RAMRO, dev_priv->ramro->pinst >> 8); |
246 | 247 | ||
247 | switch (dev_priv->chipset) { | 248 | switch (dev_priv->chipset) { |
248 | case 0x47: | 249 | case 0x47: |
@@ -270,7 +271,7 @@ nv40_fifo_init_ramxx(struct drm_device *dev) | |||
270 | nv_wr32(dev, 0x2230, 0); | 271 | nv_wr32(dev, 0x2230, 0); |
271 | nv_wr32(dev, NV40_PFIFO_RAMFC, | 272 | nv_wr32(dev, NV40_PFIFO_RAMFC, |
272 | ((dev_priv->vram_size - 512 * 1024 + | 273 | ((dev_priv->vram_size - 512 * 1024 + |
273 | dev_priv->ramfc_offset) >> 16) | (3 << 16)); | 274 | dev_priv->ramfc->pinst) >> 16) | (3 << 16)); |
274 | break; | 275 | break; |
275 | } | 276 | } |
276 | } | 277 | } |
diff --git a/drivers/gpu/drm/nouveau/nv50_fifo.c b/drivers/gpu/drm/nouveau/nv50_fifo.c index 4fc8b59cc41e..a46a961102f3 100644 --- a/drivers/gpu/drm/nouveau/nv50_fifo.c +++ b/drivers/gpu/drm/nouveau/nv50_fifo.c | |||
@@ -259,7 +259,7 @@ nv50_fifo_create_context(struct nouveau_channel *chan) | |||
259 | spin_lock_irqsave(&dev_priv->context_switch_lock, flags); | 259 | spin_lock_irqsave(&dev_priv->context_switch_lock, flags); |
260 | 260 | ||
261 | nv_wo32(ramfc, 0x48, chan->pushbuf->cinst >> 4); | 261 | nv_wo32(ramfc, 0x48, chan->pushbuf->cinst >> 4); |
262 | nv_wo32(ramfc, 0x80, (0 << 27) /* 4KiB */ | | 262 | nv_wo32(ramfc, 0x80, ((chan->ramht->bits - 9) << 27) | |
263 | (4 << 24) /* SEARCH_FULL */ | | 263 | (4 << 24) /* SEARCH_FULL */ | |
264 | (chan->ramht->gpuobj->cinst >> 4)); | 264 | (chan->ramht->gpuobj->cinst >> 4)); |
265 | nv_wo32(ramfc, 0x44, 0x2101ffff); | 265 | nv_wo32(ramfc, 0x44, 0x2101ffff); |
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c index d932594449c1..2e0aaf971b2f 100644 --- a/drivers/gpu/drm/nouveau/nv50_instmem.c +++ b/drivers/gpu/drm/nouveau/nv50_instmem.c | |||
@@ -230,10 +230,6 @@ nv50_instmem_init(struct drm_device *dev) | |||
230 | for (i = 0; i < 8; i++) | 230 | for (i = 0; i < 8; i++) |
231 | nv_wr32(dev, 0x1900 + (i*4), 0); | 231 | nv_wr32(dev, 0x1900 + (i*4), 0); |
232 | 232 | ||
233 | /*XXX: incorrect, but needed to make hash func "work" */ | ||
234 | dev_priv->ramht_offset = 0x10000; | ||
235 | dev_priv->ramht_bits = 9; | ||
236 | dev_priv->ramht_size = (1 << dev_priv->ramht_bits) * 8; | ||
237 | return 0; | 233 | return 0; |
238 | } | 234 | } |
239 | 235 | ||
diff --git a/drivers/gpu/drm/nouveau/nvc0_instmem.c b/drivers/gpu/drm/nouveau/nvc0_instmem.c index 0ffdcf6c7f5d..595540975637 100644 --- a/drivers/gpu/drm/nouveau/nvc0_instmem.c +++ b/drivers/gpu/drm/nouveau/nvc0_instmem.c | |||
@@ -220,10 +220,6 @@ nvc0_instmem_init(struct drm_device *dev) | |||
220 | return -ENOMEM; | 220 | return -ENOMEM; |
221 | } | 221 | } |
222 | 222 | ||
223 | /*XXX: incorrect, but needed to make hash func "work" */ | ||
224 | dev_priv->ramht_offset = 0x10000; | ||
225 | dev_priv->ramht_bits = 9; | ||
226 | dev_priv->ramht_size = (1 << dev_priv->ramht_bits) * 8; | ||
227 | return 0; | 223 | return 0; |
228 | } | 224 | } |
229 | 225 | ||