]> Pileus Git - ~andy/linux/blob - drivers/gpu/drm/nouveau/nouveau_drm.h
drm/nouveau: implement module init functions in nouveau_drm.c
[~andy/linux] / drivers / gpu / drm / nouveau / nouveau_drm.h
1 #ifndef __NOUVEAU_DRMCLI_H__
2 #define __NOUVEAU_DRMCLI_H__
3
4 #include <core/client.h>
5
6 #include <drmP.h>
7 #include <drm/nouveau_drm.h>
8
9 enum nouveau_drm_handle {
10         NVDRM_CLIENT = 0xffffffff,
11         NVDRM_DEVICE = 0xdddddddd,
12 };
13
14 struct nouveau_cli {
15         struct nouveau_client base;
16         struct list_head head;
17         struct mutex mutex;
18 };
19
20 struct nouveau_drm {
21         struct nouveau_cli client;
22         struct drm_device *dev;
23
24         struct nouveau_object *device;
25         struct list_head clients;
26 };
27
28 int nouveau_drm_suspend(struct pci_dev *, pm_message_t);
29 int nouveau_drm_resume(struct pci_dev *);
30
31 #define NV_PRINTK(level, code, drm, fmt, args...)                              \
32         printk(level "nouveau " code "[     DRM][%s] " fmt,                    \
33                pci_name((drm)->dev->pdev), ##args)
34 #define NV_FATAL(drm, fmt, args...)                                            \
35         NV_PRINTK(KERN_CRIT, "!", (drm), fmt, ##args)
36 #define NV_ERROR(drm, fmt, args...)                                            \
37         NV_PRINTK(KERN_ERR, "E", (drm), fmt, ##args)
38 #define NV_WARN(drm, fmt, args...)                                             \
39         NV_PRINTK(KERN_WARNING, "W", (drm), fmt, ##args)
40 #define NV_INFO(drm, fmt, args...)                                             \
41         NV_PRINTK(KERN_INFO, " ", (drm), fmt, ##args)
42 #define NV_DEBUG(drm, fmt, args...) do {                                       \
43         if (drm_debug & DRM_UT_DRIVER)                                         \
44                 NV_PRINTK(KERN_DEBUG, "D", drm, fmt, ##args);                  \
45 } while (0)
46
47 #endif