aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_drv.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-02-17 19:20:14 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-17 19:20:14 -0500
commit8c2fcadc933f713d51f46ec4dcd9b12830e0df84 (patch)
treee0797b2db664d702f9d02dd0f45efddb2f0d7fe9 /drivers/gpu/drm/nouveau/nouveau_drv.h
parent232486e1e9f34889424b68ee6270440b554479a2 (diff)
parentb0483e78e5c4c9871fc5541875b3bc006846d46b (diff)
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drv.h')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h77
1 files changed, 62 insertions, 15 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 5f8cbb79c499..5445cefdd03e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -59,11 +59,19 @@ struct nouveau_grctx;
59#define MAX_NUM_DCB_ENTRIES 16 59#define MAX_NUM_DCB_ENTRIES 16
60 60
61#define NOUVEAU_MAX_CHANNEL_NR 128 61#define NOUVEAU_MAX_CHANNEL_NR 128
62#define NOUVEAU_MAX_TILE_NR 15
62 63
63#define NV50_VM_MAX_VRAM (2*1024*1024*1024ULL) 64#define NV50_VM_MAX_VRAM (2*1024*1024*1024ULL)
64#define NV50_VM_BLOCK (512*1024*1024ULL) 65#define NV50_VM_BLOCK (512*1024*1024ULL)
65#define NV50_VM_VRAM_NR (NV50_VM_MAX_VRAM / NV50_VM_BLOCK) 66#define NV50_VM_VRAM_NR (NV50_VM_MAX_VRAM / NV50_VM_BLOCK)
66 67
68struct nouveau_tile_reg {
69 struct nouveau_fence *fence;
70 uint32_t addr;
71 uint32_t size;
72 bool used;
73};
74
67struct nouveau_bo { 75struct nouveau_bo {
68 struct ttm_buffer_object bo; 76 struct ttm_buffer_object bo;
69 struct ttm_placement placement; 77 struct ttm_placement placement;
@@ -83,6 +91,7 @@ struct nouveau_bo {
83 91
84 uint32_t tile_mode; 92 uint32_t tile_mode;
85 uint32_t tile_flags; 93 uint32_t tile_flags;
94 struct nouveau_tile_reg *tile;
86 95
87 struct drm_gem_object *gem; 96 struct drm_gem_object *gem;
88 struct drm_file *cpu_filp; 97 struct drm_file *cpu_filp;
@@ -277,8 +286,13 @@ struct nouveau_timer_engine {
277}; 286};
278 287
279struct nouveau_fb_engine { 288struct nouveau_fb_engine {
289 int num_tiles;
290
280 int (*init)(struct drm_device *dev); 291 int (*init)(struct drm_device *dev);
281 void (*takedown)(struct drm_device *dev); 292 void (*takedown)(struct drm_device *dev);
293
294 void (*set_region_tiling)(struct drm_device *dev, int i, uint32_t addr,
295 uint32_t size, uint32_t pitch);
282}; 296};
283 297
284struct nouveau_fifo_engine { 298struct nouveau_fifo_engine {
@@ -292,6 +306,8 @@ struct nouveau_fifo_engine {
292 void (*disable)(struct drm_device *); 306 void (*disable)(struct drm_device *);
293 void (*enable)(struct drm_device *); 307 void (*enable)(struct drm_device *);
294 bool (*reassign)(struct drm_device *, bool enable); 308 bool (*reassign)(struct drm_device *, bool enable);
309 bool (*cache_flush)(struct drm_device *dev);
310 bool (*cache_pull)(struct drm_device *dev, bool enable);
295 311
296 int (*channel_id)(struct drm_device *); 312 int (*channel_id)(struct drm_device *);
297 313
@@ -330,6 +346,9 @@ struct nouveau_pgraph_engine {
330 void (*destroy_context)(struct nouveau_channel *); 346 void (*destroy_context)(struct nouveau_channel *);
331 int (*load_context)(struct nouveau_channel *); 347 int (*load_context)(struct nouveau_channel *);
332 int (*unload_context)(struct drm_device *); 348 int (*unload_context)(struct drm_device *);
349
350 void (*set_region_tiling)(struct drm_device *dev, int i, uint32_t addr,
351 uint32_t size, uint32_t pitch);
333}; 352};
334 353
335struct nouveau_engine { 354struct nouveau_engine {
@@ -490,6 +509,8 @@ struct drm_nouveau_private {
490 void __iomem *ramin; 509 void __iomem *ramin;
491 uint32_t ramin_size; 510 uint32_t ramin_size;
492 511
512 struct nouveau_bo *vga_ram;
513
493 struct workqueue_struct *wq; 514 struct workqueue_struct *wq;
494 struct work_struct irq_work; 515 struct work_struct irq_work;
495 516
@@ -548,6 +569,12 @@ struct drm_nouveau_private {
548 unsigned long sg_handle; 569 unsigned long sg_handle;
549 } gart_info; 570 } gart_info;
550 571
572 /* nv10-nv40 tiling regions */
573 struct {
574 struct nouveau_tile_reg reg[NOUVEAU_MAX_TILE_NR];
575 spinlock_t lock;
576 } tile;
577
551 /* G8x/G9x virtual address space */ 578 /* G8x/G9x virtual address space */
552 uint64_t vm_gart_base; 579 uint64_t vm_gart_base;
553 uint64_t vm_gart_size; 580 uint64_t vm_gart_size;
@@ -650,6 +677,9 @@ extern char *nouveau_tv_norm;
650extern int nouveau_reg_debug; 677extern int nouveau_reg_debug;
651extern char *nouveau_vbios; 678extern char *nouveau_vbios;
652extern int nouveau_ctxfw; 679extern int nouveau_ctxfw;
680extern int nouveau_ignorelid;
681extern int nouveau_nofbaccel;
682extern int nouveau_noaccel;
653 683
654/* nouveau_state.c */ 684/* nouveau_state.c */
655extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); 685extern void nouveau_preclose(struct drm_device *dev, struct drm_file *);
@@ -685,6 +715,13 @@ extern void nouveau_mem_release(struct drm_file *, struct mem_block *heap);
685extern int nouveau_mem_init(struct drm_device *); 715extern int nouveau_mem_init(struct drm_device *);
686extern int nouveau_mem_init_agp(struct drm_device *); 716extern int nouveau_mem_init_agp(struct drm_device *);
687extern void nouveau_mem_close(struct drm_device *); 717extern void nouveau_mem_close(struct drm_device *);
718extern struct nouveau_tile_reg *nv10_mem_set_tiling(struct drm_device *dev,
719 uint32_t addr,
720 uint32_t size,
721 uint32_t pitch);
722extern void nv10_mem_expire_tiling(struct drm_device *dev,
723 struct nouveau_tile_reg *tile,
724 struct nouveau_fence *fence);
688extern int nv50_mem_vm_bind_linear(struct drm_device *, uint64_t virt, 725extern int nv50_mem_vm_bind_linear(struct drm_device *, uint64_t virt,
689 uint32_t size, uint32_t flags, 726 uint32_t size, uint32_t flags,
690 uint64_t phys); 727 uint64_t phys);
@@ -713,7 +750,6 @@ extern int nouveau_channel_alloc(struct drm_device *dev,
713 struct drm_file *file_priv, 750 struct drm_file *file_priv,
714 uint32_t fb_ctxdma, uint32_t tt_ctxdma); 751 uint32_t fb_ctxdma, uint32_t tt_ctxdma);
715extern void nouveau_channel_free(struct nouveau_channel *); 752extern void nouveau_channel_free(struct nouveau_channel *);
716extern int nouveau_channel_idle(struct nouveau_channel *chan);
717 753
718/* nouveau_object.c */ 754/* nouveau_object.c */
719extern int nouveau_gpuobj_early_init(struct drm_device *); 755extern int nouveau_gpuobj_early_init(struct drm_device *);
@@ -756,6 +792,8 @@ extern int nouveau_gpuobj_gart_dma_new(struct nouveau_channel *,
756 uint32_t *o_ret); 792 uint32_t *o_ret);
757extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, int class, 793extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, int class,
758 struct nouveau_gpuobj **); 794 struct nouveau_gpuobj **);
795extern int nouveau_gpuobj_sw_new(struct nouveau_channel *, int class,
796 struct nouveau_gpuobj **);
759extern int nouveau_ioctl_grobj_alloc(struct drm_device *, void *data, 797extern int nouveau_ioctl_grobj_alloc(struct drm_device *, void *data,
760 struct drm_file *); 798 struct drm_file *);
761extern int nouveau_ioctl_gpuobj_free(struct drm_device *, void *data, 799extern int nouveau_ioctl_gpuobj_free(struct drm_device *, void *data,
@@ -804,6 +842,7 @@ nouveau_debugfs_channel_fini(struct nouveau_channel *chan)
804#endif 842#endif
805 843
806/* nouveau_dma.c */ 844/* nouveau_dma.c */
845extern void nouveau_dma_pre_init(struct nouveau_channel *);
807extern int nouveau_dma_init(struct nouveau_channel *); 846extern int nouveau_dma_init(struct nouveau_channel *);
808extern int nouveau_dma_wait(struct nouveau_channel *, int size); 847extern int nouveau_dma_wait(struct nouveau_channel *, int size);
809 848
@@ -879,16 +918,22 @@ extern void nv04_fb_takedown(struct drm_device *);
879/* nv10_fb.c */ 918/* nv10_fb.c */
880extern int nv10_fb_init(struct drm_device *); 919extern int nv10_fb_init(struct drm_device *);
881extern void nv10_fb_takedown(struct drm_device *); 920extern void nv10_fb_takedown(struct drm_device *);
921extern void nv10_fb_set_region_tiling(struct drm_device *, int, uint32_t,
922 uint32_t, uint32_t);
882 923
883/* nv40_fb.c */ 924/* nv40_fb.c */
884extern int nv40_fb_init(struct drm_device *); 925extern int nv40_fb_init(struct drm_device *);
885extern void nv40_fb_takedown(struct drm_device *); 926extern void nv40_fb_takedown(struct drm_device *);
927extern void nv40_fb_set_region_tiling(struct drm_device *, int, uint32_t,
928 uint32_t, uint32_t);
886 929
887/* nv04_fifo.c */ 930/* nv04_fifo.c */
888extern int nv04_fifo_init(struct drm_device *); 931extern int nv04_fifo_init(struct drm_device *);
889extern void nv04_fifo_disable(struct drm_device *); 932extern void nv04_fifo_disable(struct drm_device *);
890extern void nv04_fifo_enable(struct drm_device *); 933extern void nv04_fifo_enable(struct drm_device *);
891extern bool nv04_fifo_reassign(struct drm_device *, bool); 934extern bool nv04_fifo_reassign(struct drm_device *, bool);
935extern bool nv04_fifo_cache_flush(struct drm_device *);
936extern bool nv04_fifo_cache_pull(struct drm_device *, bool);
892extern int nv04_fifo_channel_id(struct drm_device *); 937extern int nv04_fifo_channel_id(struct drm_device *);
893extern int nv04_fifo_create_context(struct nouveau_channel *); 938extern int nv04_fifo_create_context(struct nouveau_channel *);
894extern void nv04_fifo_destroy_context(struct nouveau_channel *); 939extern void nv04_fifo_destroy_context(struct nouveau_channel *);
@@ -941,6 +986,8 @@ extern void nv10_graph_destroy_context(struct nouveau_channel *);
941extern int nv10_graph_load_context(struct nouveau_channel *); 986extern int nv10_graph_load_context(struct nouveau_channel *);
942extern int nv10_graph_unload_context(struct drm_device *); 987extern int nv10_graph_unload_context(struct drm_device *);
943extern void nv10_graph_context_switch(struct drm_device *); 988extern void nv10_graph_context_switch(struct drm_device *);
989extern void nv10_graph_set_region_tiling(struct drm_device *, int, uint32_t,
990 uint32_t, uint32_t);
944 991
945/* nv20_graph.c */ 992/* nv20_graph.c */
946extern struct nouveau_pgraph_object_class nv20_graph_grclass[]; 993extern struct nouveau_pgraph_object_class nv20_graph_grclass[];
@@ -952,6 +999,8 @@ extern int nv20_graph_unload_context(struct drm_device *);
952extern int nv20_graph_init(struct drm_device *); 999extern int nv20_graph_init(struct drm_device *);
953extern void nv20_graph_takedown(struct drm_device *); 1000extern void nv20_graph_takedown(struct drm_device *);
954extern int nv30_graph_init(struct drm_device *); 1001extern int nv30_graph_init(struct drm_device *);
1002extern void nv20_graph_set_region_tiling(struct drm_device *, int, uint32_t,
1003 uint32_t, uint32_t);
955 1004
956/* nv40_graph.c */ 1005/* nv40_graph.c */
957extern struct nouveau_pgraph_object_class nv40_graph_grclass[]; 1006extern struct nouveau_pgraph_object_class nv40_graph_grclass[];
@@ -963,6 +1012,8 @@ extern void nv40_graph_destroy_context(struct nouveau_channel *);
963extern int nv40_graph_load_context(struct nouveau_channel *); 1012extern int nv40_graph_load_context(struct nouveau_channel *);
964extern int nv40_graph_unload_context(struct drm_device *); 1013extern int nv40_graph_unload_context(struct drm_device *);
965extern void nv40_grctx_init(struct nouveau_grctx *); 1014extern void nv40_grctx_init(struct nouveau_grctx *);
1015extern void nv40_graph_set_region_tiling(struct drm_device *, int, uint32_t,
1016 uint32_t, uint32_t);
966 1017
967/* nv50_graph.c */ 1018/* nv50_graph.c */
968extern struct nouveau_pgraph_object_class nv50_graph_grclass[]; 1019extern struct nouveau_pgraph_object_class nv50_graph_grclass[];
@@ -1030,8 +1081,7 @@ extern long nouveau_compat_ioctl(struct file *file, unsigned int cmd,
1030 1081
1031/* nv04_dac.c */ 1082/* nv04_dac.c */
1032extern int nv04_dac_create(struct drm_device *dev, struct dcb_entry *entry); 1083extern int nv04_dac_create(struct drm_device *dev, struct dcb_entry *entry);
1033extern enum drm_connector_status nv17_dac_detect(struct drm_encoder *encoder, 1084extern uint32_t nv17_dac_sample_load(struct drm_encoder *encoder);
1034 struct drm_connector *connector);
1035extern int nv04_dac_output_offset(struct drm_encoder *encoder); 1085extern int nv04_dac_output_offset(struct drm_encoder *encoder);
1036extern void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable); 1086extern void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable);
1037 1087
@@ -1049,9 +1099,6 @@ extern int nv04_tv_create(struct drm_device *dev, struct dcb_entry *entry);
1049 1099
1050/* nv17_tv.c */ 1100/* nv17_tv.c */
1051extern int nv17_tv_create(struct drm_device *dev, struct dcb_entry *entry); 1101extern int nv17_tv_create(struct drm_device *dev, struct dcb_entry *entry);
1052extern enum drm_connector_status nv17_tv_detect(struct drm_encoder *encoder,
1053 struct drm_connector *connector,
1054 uint32_t pin_mask);
1055 1102
1056/* nv04_display.c */ 1103/* nv04_display.c */
1057extern int nv04_display_create(struct drm_device *); 1104extern int nv04_display_create(struct drm_device *);
@@ -1290,14 +1337,14 @@ nv_two_reg_pll(struct drm_device *dev)
1290 return false; 1337 return false;
1291} 1338}
1292 1339
1293#define NV50_NVSW 0x0000506e 1340#define NV_SW 0x0000506e
1294#define NV50_NVSW_DMA_SEMAPHORE 0x00000060 1341#define NV_SW_DMA_SEMAPHORE 0x00000060
1295#define NV50_NVSW_SEMAPHORE_OFFSET 0x00000064 1342#define NV_SW_SEMAPHORE_OFFSET 0x00000064
1296#define NV50_NVSW_SEMAPHORE_ACQUIRE 0x00000068 1343#define NV_SW_SEMAPHORE_ACQUIRE 0x00000068
1297#define NV50_NVSW_SEMAPHORE_RELEASE 0x0000006c 1344#define NV_SW_SEMAPHORE_RELEASE 0x0000006c
1298#define NV50_NVSW_DMA_VBLSEM 0x0000018c 1345#define NV_SW_DMA_VBLSEM 0x0000018c
1299#define NV50_NVSW_VBLSEM_OFFSET 0x00000400 1346#define NV_SW_VBLSEM_OFFSET 0x00000400
1300#define NV50_NVSW_VBLSEM_RELEASE_VALUE 0x00000404 1347#define NV_SW_VBLSEM_RELEASE_VALUE 0x00000404
1301#define NV50_NVSW_VBLSEM_RELEASE 0x00000408 1348#define NV_SW_VBLSEM_RELEASE 0x00000408
1302 1349
1303#endif /* __NOUVEAU_DRV_H__ */ 1350#endif /* __NOUVEAU_DRV_H__ */