1 #ifndef __NOUVEAU_DRMCLI_H__
2 #define __NOUVEAU_DRMCLI_H__
4 #define DRIVER_AUTHOR "Nouveau Project"
5 #define DRIVER_EMAIL "nouveau@lists.freedesktop.org"
7 #define DRIVER_NAME "nouveau"
8 #define DRIVER_DESC "nVidia Riva/TNT/GeForce/Quadro/Tesla"
9 #define DRIVER_DATE "20120801"
11 #define DRIVER_MAJOR 1
12 #define DRIVER_MINOR 1
13 #define DRIVER_PATCHLEVEL 0
15 #include <core/client.h>
17 #include <subdev/vm.h>
20 #include <drm/nouveau_drm.h>
22 #include <drm/ttm/ttm_bo_api.h>
23 #include <drm/ttm/ttm_bo_driver.h>
24 #include <drm/ttm/ttm_placement.h>
25 #include <drm/ttm/ttm_memory.h>
26 #include <drm/ttm/ttm_module.h>
27 #include <drm/ttm/ttm_page_alloc.h>
29 struct nouveau_channel;
31 #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
33 #include "nouveau_fence.h"
34 #include "nouveau_bios.h"
36 struct nouveau_drm_tile {
37 struct nouveau_fence *fence;
41 enum nouveau_drm_handle {
42 NVDRM_CLIENT = 0xffffffff,
43 NVDRM_DEVICE = 0xdddddddd,
44 NVDRM_PUSH = 0xbbbb0000, /* |= client chid */
45 NVDRM_CHAN = 0xcccc0000, /* |= client chid */
49 struct nouveau_client base;
50 struct list_head head;
55 static inline struct nouveau_cli *
56 nouveau_cli(struct drm_file *fpriv)
58 return fpriv ? fpriv->driver_priv : NULL;
62 struct nouveau_cli client;
63 struct drm_device *dev;
65 struct nouveau_object *device;
66 struct list_head clients;
78 /* TTM interface support */
80 struct drm_global_reference mem_global_ref;
81 struct ttm_bo_global_ref bo_global_ref;
82 struct ttm_bo_device bdev;
83 atomic_t validate_sequence;
84 int (*move)(struct nouveau_channel *,
85 struct ttm_buffer_object *,
86 struct ttm_mem_reg *, struct ttm_mem_reg *);
90 /* GEM interface support */
99 /* context for accelerated drm-internal operations */
100 struct nouveau_channel *cechan;
101 struct nouveau_channel *channel;
102 struct nouveau_gpuobj *notify;
103 struct nouveau_fbdev *fbcon;
105 /* nv10-nv40 tiling regions */
107 struct nouveau_drm_tile reg[15];
113 struct nouveau_display *display;
114 struct backlight_device *backlight;
116 /* power management */
117 struct nouveau_pm *pm;
120 static inline struct nouveau_drm *
121 nouveau_drm(struct drm_device *dev)
123 return dev->dev_private;
126 static inline struct nouveau_device *
127 nouveau_dev(struct drm_device *dev)
129 return nv_device(nouveau_drm(dev)->device);
132 int nouveau_drm_suspend(struct pci_dev *, pm_message_t);
133 int nouveau_drm_resume(struct pci_dev *);
135 #define NV_FATAL(cli, fmt, args...) nv_fatal((cli), fmt, ##args)
136 #define NV_ERROR(cli, fmt, args...) nv_error((cli), fmt, ##args)
137 #define NV_WARN(cli, fmt, args...) nv_warn((cli), fmt, ##args)
138 #define NV_INFO(cli, fmt, args...) nv_info((cli), fmt, ##args)
139 #define NV_DEBUG(cli, fmt, args...) do { \
140 if (drm_debug & DRM_UT_DRIVER) \
141 nv_info((cli), fmt, ##args); \
144 extern int nouveau_modeset;