diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drm.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.h b/drivers/gpu/drm/nouveau/nouveau_drm.h index 87698067244b..2e3364d50ca0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.h +++ b/drivers/gpu/drm/nouveau/nouveau_drm.h | |||
@@ -3,20 +3,50 @@ | |||
3 | 3 | ||
4 | #include <core/client.h> | 4 | #include <core/client.h> |
5 | 5 | ||
6 | #include <subdev/vm.h> | ||
7 | |||
6 | #include <drmP.h> | 8 | #include <drmP.h> |
7 | #include <drm/nouveau_drm.h> | 9 | #include <drm/nouveau_drm.h> |
8 | 10 | ||
11 | #include "ttm/ttm_bo_api.h" | ||
12 | #include "ttm/ttm_bo_driver.h" | ||
13 | #include "ttm/ttm_placement.h" | ||
14 | #include "ttm/ttm_memory.h" | ||
15 | #include "ttm/ttm_module.h" | ||
16 | #include "ttm/ttm_page_alloc.h" | ||
17 | |||
18 | struct nouveau_channel; | ||
19 | |||
20 | #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT) | ||
21 | |||
22 | #include "nouveau_revcompat.h" | ||
23 | #include "nouveau_fence.h" | ||
24 | |||
25 | struct nouveau_drm_tile { | ||
26 | struct nouveau_fence *fence; | ||
27 | bool used; | ||
28 | }; | ||
29 | |||
9 | enum nouveau_drm_handle { | 30 | enum nouveau_drm_handle { |
10 | NVDRM_CLIENT = 0xffffffff, | 31 | NVDRM_CLIENT = 0xffffffff, |
11 | NVDRM_DEVICE = 0xdddddddd, | 32 | NVDRM_DEVICE = 0xdddddddd, |
33 | NVDRM_PUSH = 0xbbbb0000, /* |= client chid */ | ||
34 | NVDRM_CHAN = 0xcccc0000, /* |= client chid */ | ||
12 | }; | 35 | }; |
13 | 36 | ||
14 | struct nouveau_cli { | 37 | struct nouveau_cli { |
15 | struct nouveau_client base; | 38 | struct nouveau_client base; |
16 | struct list_head head; | 39 | struct list_head head; |
17 | struct mutex mutex; | 40 | struct mutex mutex; |
41 | void *abi16; | ||
18 | }; | 42 | }; |
19 | 43 | ||
44 | static inline struct nouveau_cli * | ||
45 | nouveau_cli(struct drm_file *fpriv) | ||
46 | { | ||
47 | return fpriv ? fpriv->driver_priv : NULL; | ||
48 | } | ||
49 | |||
20 | struct nouveau_drm { | 50 | struct nouveau_drm { |
21 | struct nouveau_cli client; | 51 | struct nouveau_cli client; |
22 | struct drm_device *dev; | 52 | struct drm_device *dev; |
@@ -33,8 +63,46 @@ struct nouveau_drm { | |||
33 | u32 base; | 63 | u32 base; |
34 | u32 size; | 64 | u32 size; |
35 | } agp; | 65 | } agp; |
66 | |||
67 | /* TTM interface support */ | ||
68 | struct { | ||
69 | struct drm_global_reference mem_global_ref; | ||
70 | struct ttm_bo_global_ref bo_global_ref; | ||
71 | struct ttm_bo_device bdev; | ||
72 | atomic_t validate_sequence; | ||
73 | int (*move)(struct nouveau_channel *, | ||
74 | struct ttm_buffer_object *, | ||
75 | struct ttm_mem_reg *, struct ttm_mem_reg *); | ||
76 | int mtrr; | ||
77 | } ttm; | ||
78 | |||
79 | /* GEM interface support */ | ||
80 | struct { | ||
81 | u64 vram_available; | ||
82 | u64 gart_available; | ||
83 | } gem; | ||
84 | |||
85 | /* synchronisation */ | ||
86 | void *fence; | ||
87 | |||
88 | /* context for accelerated drm-internal operations */ | ||
89 | struct nouveau_channel *channel; | ||
90 | struct nouveau_gpuobj *notify; | ||
91 | struct nouveau_fbdev *fbcon; | ||
92 | |||
93 | /* nv10-nv40 tiling regions */ | ||
94 | struct { | ||
95 | struct nouveau_drm_tile reg[15]; | ||
96 | spinlock_t lock; | ||
97 | } tile; | ||
36 | }; | 98 | }; |
37 | 99 | ||
100 | static inline struct nouveau_drm * | ||
101 | nouveau_drm(struct drm_device *dev) | ||
102 | { | ||
103 | return nouveau_newpriv(dev); | ||
104 | } | ||
105 | |||
38 | int nouveau_drm_suspend(struct pci_dev *, pm_message_t); | 106 | int nouveau_drm_suspend(struct pci_dev *, pm_message_t); |
39 | int nouveau_drm_resume(struct pci_dev *); | 107 | int nouveau_drm_resume(struct pci_dev *); |
40 | 108 | ||