1 #ifndef __NOUVEAU_DRMCLI_H__
2 #define __NOUVEAU_DRMCLI_H__
4 #include <core/client.h>
9 #include <drm/nouveau_drm.h>
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"
18 struct nouveau_channel;
20 #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
22 #include "nouveau_revcompat.h"
23 #include "nouveau_fence.h"
25 struct nouveau_drm_tile {
26 struct nouveau_fence *fence;
30 enum nouveau_drm_handle {
31 NVDRM_CLIENT = 0xffffffff,
32 NVDRM_DEVICE = 0xdddddddd,
33 NVDRM_PUSH = 0xbbbb0000, /* |= client chid */
34 NVDRM_CHAN = 0xcccc0000, /* |= client chid */
38 struct nouveau_client base;
39 struct list_head head;
44 static inline struct nouveau_cli *
45 nouveau_cli(struct drm_file *fpriv)
47 return fpriv ? fpriv->driver_priv : NULL;
51 struct nouveau_cli client;
52 struct drm_device *dev;
54 struct nouveau_object *device;
55 struct list_head clients;
67 /* TTM interface support */
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 *);
79 /* GEM interface support */
88 /* context for accelerated drm-internal operations */
89 struct nouveau_channel *channel;
90 struct nouveau_gpuobj *notify;
91 struct nouveau_fbdev *fbcon;
93 /* nv10-nv40 tiling regions */
95 struct nouveau_drm_tile reg[15];
99 struct backlight_device *backlight;
102 static inline struct nouveau_drm *
103 nouveau_drm(struct drm_device *dev)
105 return nouveau_newpriv(dev);
108 int nouveau_drm_suspend(struct pci_dev *, pm_message_t);
109 int nouveau_drm_resume(struct pci_dev *);
111 #define NV_PRINTK(level, code, drm, fmt, args...) \
112 printk(level "nouveau " code "[ DRM][%s] " fmt, \
113 pci_name((drm)->dev->pdev), ##args)
114 #define NV_FATAL(drm, fmt, args...) \
115 NV_PRINTK(KERN_CRIT, "!", (drm), fmt, ##args)
116 #define NV_ERROR(drm, fmt, args...) \
117 NV_PRINTK(KERN_ERR, "E", (drm), fmt, ##args)
118 #define NV_WARN(drm, fmt, args...) \
119 NV_PRINTK(KERN_WARNING, "W", (drm), fmt, ##args)
120 #define NV_INFO(drm, fmt, args...) \
121 NV_PRINTK(KERN_INFO, " ", (drm), fmt, ##args)
122 #define NV_DEBUG(drm, fmt, args...) do { \
123 if (drm_debug & DRM_UT_DRIVER) \
124 NV_PRINTK(KERN_DEBUG, "D", drm, fmt, ##args); \