aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_drv.h
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-06-01 01:32:24 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-07-12 20:12:51 -0400
commitb833ac26f1f1c8e8d9149d83dbdd91432f2807d5 (patch)
tree2899ec81e2c41c6942d75d9039748c0a882ce321 /drivers/gpu/drm/nouveau/nouveau_drv.h
parentd17f395cdcec39033a481f96d75e8b3d3c41d43a (diff)
drm/nouveau: use drm_mm in preference to custom code doing the same thing
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drv.h')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h24
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index c69719106489..20c54884dcb7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -123,14 +123,6 @@ nvbo_kmap_obj_iovirtual(struct nouveau_bo *nvbo)
123 return ioptr; 123 return ioptr;
124} 124}
125 125
126struct mem_block {
127 struct mem_block *next;
128 struct mem_block *prev;
129 uint64_t start;
130 uint64_t size;
131 struct drm_file *file_priv; /* NULL: free, -1: heap, other: real files */
132};
133
134enum nouveau_flags { 126enum nouveau_flags {
135 NV_NFORCE = 0x10000000, 127 NV_NFORCE = 0x10000000,
136 NV_NFORCE2 = 0x20000000 128 NV_NFORCE2 = 0x20000000
@@ -149,7 +141,7 @@ struct nouveau_gpuobj {
149 struct list_head list; 141 struct list_head list;
150 142
151 struct nouveau_channel *im_channel; 143 struct nouveau_channel *im_channel;
152 struct mem_block *im_pramin; 144 struct drm_mm_node *im_pramin;
153 struct nouveau_bo *im_backing; 145 struct nouveau_bo *im_backing;
154 uint32_t im_backing_start; 146 uint32_t im_backing_start;
155 uint32_t *im_backing_suspend; 147 uint32_t *im_backing_suspend;
@@ -206,7 +198,7 @@ struct nouveau_channel {
206 198
207 /* Notifier memory */ 199 /* Notifier memory */
208 struct nouveau_bo *notifier_bo; 200 struct nouveau_bo *notifier_bo;
209 struct mem_block *notifier_heap; 201 struct drm_mm notifier_heap;
210 202
211 /* PFIFO context */ 203 /* PFIFO context */
212 struct nouveau_gpuobj_ref *ramfc; 204 struct nouveau_gpuobj_ref *ramfc;
@@ -224,7 +216,7 @@ struct nouveau_channel {
224 216
225 /* Objects */ 217 /* Objects */
226 struct nouveau_gpuobj_ref *ramin; /* Private instmem */ 218 struct nouveau_gpuobj_ref *ramin; /* Private instmem */
227 struct mem_block *ramin_heap; /* Private PRAMIN heap */ 219 struct drm_mm ramin_heap; /* Private PRAMIN heap */
228 struct nouveau_gpuobj_ref *ramht; /* Hash table */ 220 struct nouveau_gpuobj_ref *ramht; /* Hash table */
229 struct list_head ramht_refs; /* Objects referenced by RAMHT */ 221 struct list_head ramht_refs; /* Objects referenced by RAMHT */
230 222
@@ -595,7 +587,7 @@ struct drm_nouveau_private {
595 struct nouveau_gpuobj *vm_vram_pt[NV50_VM_VRAM_NR]; 587 struct nouveau_gpuobj *vm_vram_pt[NV50_VM_VRAM_NR];
596 int vm_vram_pt_nr; 588 int vm_vram_pt_nr;
597 589
598 struct mem_block *ramin_heap; 590 struct drm_mm ramin_heap;
599 591
600 /* context table pointed to be NV_PGRAPH_CHANNEL_CTX_TABLE (0x400780) */ 592 /* context table pointed to be NV_PGRAPH_CHANNEL_CTX_TABLE (0x400780) */
601 uint32_t ctx_table_size; 593 uint32_t ctx_table_size;
@@ -707,15 +699,7 @@ extern bool nouveau_wait_for_idle(struct drm_device *);
707extern int nouveau_card_init(struct drm_device *); 699extern int nouveau_card_init(struct drm_device *);
708 700
709/* nouveau_mem.c */ 701/* nouveau_mem.c */
710extern int nouveau_mem_init_heap(struct mem_block **, uint64_t start,
711 uint64_t size);
712extern struct mem_block *nouveau_mem_alloc_block(struct mem_block *,
713 uint64_t size, int align2,
714 struct drm_file *, int tail);
715extern void nouveau_mem_takedown(struct mem_block **heap);
716extern void nouveau_mem_free_block(struct mem_block *);
717extern int nouveau_mem_detect(struct drm_device *dev); 702extern int nouveau_mem_detect(struct drm_device *dev);
718extern void nouveau_mem_release(struct drm_file *, struct mem_block *heap);
719extern int nouveau_mem_init(struct drm_device *); 703extern int nouveau_mem_init(struct drm_device *);
720extern int nouveau_mem_init_agp(struct drm_device *); 704extern int nouveau_mem_init_agp(struct drm_device *);
721extern void nouveau_mem_close(struct drm_device *); 705extern void nouveau_mem_close(struct drm_device *);