diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-17 19:20:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 19:20:14 -0500 |
commit | 8c2fcadc933f713d51f46ec4dcd9b12830e0df84 (patch) | |
tree | e0797b2db664d702f9d02dd0f45efddb2f0d7fe9 /drivers/gpu/drm/nouveau/nouveau_drv.h | |
parent | 232486e1e9f34889424b68ee6270440b554479a2 (diff) | |
parent | b0483e78e5c4c9871fc5541875b3bc006846d46b (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.h | 77 |
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 | ||
68 | struct nouveau_tile_reg { | ||
69 | struct nouveau_fence *fence; | ||
70 | uint32_t addr; | ||
71 | uint32_t size; | ||
72 | bool used; | ||
73 | }; | ||
74 | |||
67 | struct nouveau_bo { | 75 | struct 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 | ||
279 | struct nouveau_fb_engine { | 288 | struct 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 | ||
284 | struct nouveau_fifo_engine { | 298 | struct 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 | ||
335 | struct nouveau_engine { | 354 | struct 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; | |||
650 | extern int nouveau_reg_debug; | 677 | extern int nouveau_reg_debug; |
651 | extern char *nouveau_vbios; | 678 | extern char *nouveau_vbios; |
652 | extern int nouveau_ctxfw; | 679 | extern int nouveau_ctxfw; |
680 | extern int nouveau_ignorelid; | ||
681 | extern int nouveau_nofbaccel; | ||
682 | extern int nouveau_noaccel; | ||
653 | 683 | ||
654 | /* nouveau_state.c */ | 684 | /* nouveau_state.c */ |
655 | extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); | 685 | extern 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); | |||
685 | extern int nouveau_mem_init(struct drm_device *); | 715 | extern int nouveau_mem_init(struct drm_device *); |
686 | extern int nouveau_mem_init_agp(struct drm_device *); | 716 | extern int nouveau_mem_init_agp(struct drm_device *); |
687 | extern void nouveau_mem_close(struct drm_device *); | 717 | extern void nouveau_mem_close(struct drm_device *); |
718 | extern struct nouveau_tile_reg *nv10_mem_set_tiling(struct drm_device *dev, | ||
719 | uint32_t addr, | ||
720 | uint32_t size, | ||
721 | uint32_t pitch); | ||
722 | extern void nv10_mem_expire_tiling(struct drm_device *dev, | ||
723 | struct nouveau_tile_reg *tile, | ||
724 | struct nouveau_fence *fence); | ||
688 | extern int nv50_mem_vm_bind_linear(struct drm_device *, uint64_t virt, | 725 | extern 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); |
715 | extern void nouveau_channel_free(struct nouveau_channel *); | 752 | extern void nouveau_channel_free(struct nouveau_channel *); |
716 | extern int nouveau_channel_idle(struct nouveau_channel *chan); | ||
717 | 753 | ||
718 | /* nouveau_object.c */ | 754 | /* nouveau_object.c */ |
719 | extern int nouveau_gpuobj_early_init(struct drm_device *); | 755 | extern 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); |
757 | extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, int class, | 793 | extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, int class, |
758 | struct nouveau_gpuobj **); | 794 | struct nouveau_gpuobj **); |
795 | extern int nouveau_gpuobj_sw_new(struct nouveau_channel *, int class, | ||
796 | struct nouveau_gpuobj **); | ||
759 | extern int nouveau_ioctl_grobj_alloc(struct drm_device *, void *data, | 797 | extern int nouveau_ioctl_grobj_alloc(struct drm_device *, void *data, |
760 | struct drm_file *); | 798 | struct drm_file *); |
761 | extern int nouveau_ioctl_gpuobj_free(struct drm_device *, void *data, | 799 | extern 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 */ |
845 | extern void nouveau_dma_pre_init(struct nouveau_channel *); | ||
807 | extern int nouveau_dma_init(struct nouveau_channel *); | 846 | extern int nouveau_dma_init(struct nouveau_channel *); |
808 | extern int nouveau_dma_wait(struct nouveau_channel *, int size); | 847 | extern 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 */ |
880 | extern int nv10_fb_init(struct drm_device *); | 919 | extern int nv10_fb_init(struct drm_device *); |
881 | extern void nv10_fb_takedown(struct drm_device *); | 920 | extern void nv10_fb_takedown(struct drm_device *); |
921 | extern 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 */ |
884 | extern int nv40_fb_init(struct drm_device *); | 925 | extern int nv40_fb_init(struct drm_device *); |
885 | extern void nv40_fb_takedown(struct drm_device *); | 926 | extern void nv40_fb_takedown(struct drm_device *); |
927 | extern 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 */ |
888 | extern int nv04_fifo_init(struct drm_device *); | 931 | extern int nv04_fifo_init(struct drm_device *); |
889 | extern void nv04_fifo_disable(struct drm_device *); | 932 | extern void nv04_fifo_disable(struct drm_device *); |
890 | extern void nv04_fifo_enable(struct drm_device *); | 933 | extern void nv04_fifo_enable(struct drm_device *); |
891 | extern bool nv04_fifo_reassign(struct drm_device *, bool); | 934 | extern bool nv04_fifo_reassign(struct drm_device *, bool); |
935 | extern bool nv04_fifo_cache_flush(struct drm_device *); | ||
936 | extern bool nv04_fifo_cache_pull(struct drm_device *, bool); | ||
892 | extern int nv04_fifo_channel_id(struct drm_device *); | 937 | extern int nv04_fifo_channel_id(struct drm_device *); |
893 | extern int nv04_fifo_create_context(struct nouveau_channel *); | 938 | extern int nv04_fifo_create_context(struct nouveau_channel *); |
894 | extern void nv04_fifo_destroy_context(struct nouveau_channel *); | 939 | extern void nv04_fifo_destroy_context(struct nouveau_channel *); |
@@ -941,6 +986,8 @@ extern void nv10_graph_destroy_context(struct nouveau_channel *); | |||
941 | extern int nv10_graph_load_context(struct nouveau_channel *); | 986 | extern int nv10_graph_load_context(struct nouveau_channel *); |
942 | extern int nv10_graph_unload_context(struct drm_device *); | 987 | extern int nv10_graph_unload_context(struct drm_device *); |
943 | extern void nv10_graph_context_switch(struct drm_device *); | 988 | extern void nv10_graph_context_switch(struct drm_device *); |
989 | extern 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 */ |
946 | extern struct nouveau_pgraph_object_class nv20_graph_grclass[]; | 993 | extern struct nouveau_pgraph_object_class nv20_graph_grclass[]; |
@@ -952,6 +999,8 @@ extern int nv20_graph_unload_context(struct drm_device *); | |||
952 | extern int nv20_graph_init(struct drm_device *); | 999 | extern int nv20_graph_init(struct drm_device *); |
953 | extern void nv20_graph_takedown(struct drm_device *); | 1000 | extern void nv20_graph_takedown(struct drm_device *); |
954 | extern int nv30_graph_init(struct drm_device *); | 1001 | extern int nv30_graph_init(struct drm_device *); |
1002 | extern 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 */ |
957 | extern struct nouveau_pgraph_object_class nv40_graph_grclass[]; | 1006 | extern struct nouveau_pgraph_object_class nv40_graph_grclass[]; |
@@ -963,6 +1012,8 @@ extern void nv40_graph_destroy_context(struct nouveau_channel *); | |||
963 | extern int nv40_graph_load_context(struct nouveau_channel *); | 1012 | extern int nv40_graph_load_context(struct nouveau_channel *); |
964 | extern int nv40_graph_unload_context(struct drm_device *); | 1013 | extern int nv40_graph_unload_context(struct drm_device *); |
965 | extern void nv40_grctx_init(struct nouveau_grctx *); | 1014 | extern void nv40_grctx_init(struct nouveau_grctx *); |
1015 | extern 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 */ |
968 | extern struct nouveau_pgraph_object_class nv50_graph_grclass[]; | 1019 | extern 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 */ |
1032 | extern int nv04_dac_create(struct drm_device *dev, struct dcb_entry *entry); | 1083 | extern int nv04_dac_create(struct drm_device *dev, struct dcb_entry *entry); |
1033 | extern enum drm_connector_status nv17_dac_detect(struct drm_encoder *encoder, | 1084 | extern uint32_t nv17_dac_sample_load(struct drm_encoder *encoder); |
1034 | struct drm_connector *connector); | ||
1035 | extern int nv04_dac_output_offset(struct drm_encoder *encoder); | 1085 | extern int nv04_dac_output_offset(struct drm_encoder *encoder); |
1036 | extern void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable); | 1086 | extern 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 */ |
1051 | extern int nv17_tv_create(struct drm_device *dev, struct dcb_entry *entry); | 1101 | extern int nv17_tv_create(struct drm_device *dev, struct dcb_entry *entry); |
1052 | extern 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 */ |
1057 | extern int nv04_display_create(struct drm_device *); | 1104 | extern 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__ */ |