nouveau_drm.h 1.6 KB

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