drmP.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Internal Header for the Direct Rendering Manager
  3. *
  4. * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
  5. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  6. * Copyright (c) 2009-2010, Code Aurora Forum.
  7. * All rights reserved.
  8. *
  9. * Author: Rickard E. (Rik) Faith <faith@valinux.com>
  10. * Author: Gareth Hughes <gareth@valinux.com>
  11. *
  12. * Permission is hereby granted, free of charge, to any person obtaining a
  13. * copy of this software and associated documentation files (the "Software"),
  14. * to deal in the Software without restriction, including without limitation
  15. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  16. * and/or sell copies of the Software, and to permit persons to whom the
  17. * Software is furnished to do so, subject to the following conditions:
  18. *
  19. * The above copyright notice and this permission notice (including the next
  20. * paragraph) shall be included in all copies or substantial portions of the
  21. * Software.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  24. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  25. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  26. * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  27. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  28. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  29. * OTHER DEALINGS IN THE SOFTWARE.
  30. */
  31. #ifndef _DRM_P_H_
  32. #define _DRM_P_H_
  33. #include <linux/agp_backend.h>
  34. #include <linux/cdev.h>
  35. #include <linux/dma-mapping.h>
  36. #include <linux/file.h>
  37. #include <linux/fs.h>
  38. #include <linux/highmem.h>
  39. #include <linux/idr.h>
  40. #include <linux/init.h>
  41. #include <linux/io.h>
  42. #include <linux/jiffies.h>
  43. #include <linux/kernel.h>
  44. #include <linux/kref.h>
  45. #include <linux/miscdevice.h>
  46. #include <linux/mm.h>
  47. #include <linux/mutex.h>
  48. #include <linux/platform_device.h>
  49. #include <linux/poll.h>
  50. #include <linux/ratelimit.h>
  51. #include <linux/sched.h>
  52. #include <linux/slab.h>
  53. #include <linux/types.h>
  54. #include <linux/vmalloc.h>
  55. #include <linux/workqueue.h>
  56. #include <linux/dma-fence.h>
  57. #include <linux/module.h>
  58. #include <asm/mman.h>
  59. #include <asm/pgalloc.h>
  60. #include <linux/uaccess.h>
  61. #include <uapi/drm/drm.h>
  62. #include <uapi/drm/drm_mode.h>
  63. #include <drm/drm_agpsupport.h>
  64. #include <drm/drm_crtc.h>
  65. #include <drm/drm_fourcc.h>
  66. #include <drm/drm_global.h>
  67. #include <drm/drm_hashtab.h>
  68. #include <drm/drm_mm.h>
  69. #include <drm/drm_os_linux.h>
  70. #include <drm/drm_sarea.h>
  71. #include <drm/drm_drv.h>
  72. #include <drm/drm_prime.h>
  73. #include <drm/drm_print.h>
  74. #include <drm/drm_pci.h>
  75. #include <drm/drm_file.h>
  76. #include <drm/drm_debugfs.h>
  77. #include <drm/drm_ioctl.h>
  78. #include <drm/drm_sysfs.h>
  79. #include <drm/drm_vblank.h>
  80. #include <drm/drm_irq.h>
  81. #include <drm/drm_device.h>
  82. struct module;
  83. struct device_node;
  84. struct videomode;
  85. struct reservation_object;
  86. struct dma_buf_attachment;
  87. struct pci_dev;
  88. struct pci_controller;
  89. #define DRM_IF_VERSION(maj, min) (maj << 16 | min)
  90. #define DRM_SWITCH_POWER_ON 0
  91. #define DRM_SWITCH_POWER_OFF 1
  92. #define DRM_SWITCH_POWER_CHANGING 2
  93. #define DRM_SWITCH_POWER_DYNAMIC_OFF 3
  94. /* returns true if currently okay to sleep */
  95. static inline bool drm_can_sleep(void)
  96. {
  97. if (in_atomic() || in_dbg_master() || irqs_disabled())
  98. return false;
  99. return true;
  100. }
  101. /* helper for handling conditionals in various for_each macros */
  102. #define for_each_if(condition) if (!(condition)) {} else
  103. #endif