nouveau_drm.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /*
  2. * Copyright 2005 Stephane Marchesin.
  3. * All Rights Reserved.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a
  6. * copy of this software and associated documentation files (the "Software"),
  7. * to deal in the Software without restriction, including without limitation
  8. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. * and/or sell copies of the Software, and to permit persons to whom the
  10. * Software is furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice (including the next
  13. * paragraph) shall be included in all copies or substantial portions of the
  14. * Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  20. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  21. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  22. * OTHER DEALINGS IN THE SOFTWARE.
  23. */
  24. #ifndef __NOUVEAU_DRM_H__
  25. #define __NOUVEAU_DRM_H__
  26. #define NOUVEAU_DRM_HEADER_PATCHLEVEL 16
  27. struct drm_nouveau_channel_alloc {
  28. uint32_t fb_ctxdma_handle;
  29. uint32_t tt_ctxdma_handle;
  30. int channel;
  31. uint32_t pushbuf_domains;
  32. /* Notifier memory */
  33. uint32_t notifier_handle;
  34. /* DRM-enforced subchannel assignments */
  35. struct {
  36. uint32_t handle;
  37. uint32_t grclass;
  38. } subchan[8];
  39. uint32_t nr_subchan;
  40. };
  41. struct drm_nouveau_channel_free {
  42. int channel;
  43. };
  44. struct drm_nouveau_grobj_alloc {
  45. int channel;
  46. uint32_t handle;
  47. int class;
  48. };
  49. struct drm_nouveau_notifierobj_alloc {
  50. uint32_t channel;
  51. uint32_t handle;
  52. uint32_t size;
  53. uint32_t offset;
  54. };
  55. struct drm_nouveau_gpuobj_free {
  56. int channel;
  57. uint32_t handle;
  58. };
  59. /* FIXME : maybe unify {GET,SET}PARAMs */
  60. #define NOUVEAU_GETPARAM_PCI_VENDOR 3
  61. #define NOUVEAU_GETPARAM_PCI_DEVICE 4
  62. #define NOUVEAU_GETPARAM_BUS_TYPE 5
  63. #define NOUVEAU_GETPARAM_FB_PHYSICAL 6
  64. #define NOUVEAU_GETPARAM_AGP_PHYSICAL 7
  65. #define NOUVEAU_GETPARAM_FB_SIZE 8
  66. #define NOUVEAU_GETPARAM_AGP_SIZE 9
  67. #define NOUVEAU_GETPARAM_PCI_PHYSICAL 10
  68. #define NOUVEAU_GETPARAM_CHIPSET_ID 11
  69. #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12
  70. #define NOUVEAU_GETPARAM_GRAPH_UNITS 13
  71. #define NOUVEAU_GETPARAM_PTIMER_TIME 14
  72. #define NOUVEAU_GETPARAM_HAS_BO_USAGE 15
  73. #define NOUVEAU_GETPARAM_HAS_PAGEFLIP 16
  74. struct drm_nouveau_getparam {
  75. uint64_t param;
  76. uint64_t value;
  77. };
  78. struct drm_nouveau_setparam {
  79. uint64_t param;
  80. uint64_t value;
  81. };
  82. #define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
  83. #define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
  84. #define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
  85. #define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)
  86. #define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4)
  87. #define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
  88. #define NOUVEAU_GEM_TILE_16BPP 0x00000001
  89. #define NOUVEAU_GEM_TILE_32BPP 0x00000002
  90. #define NOUVEAU_GEM_TILE_ZETA 0x00000004
  91. #define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008
  92. struct drm_nouveau_gem_info {
  93. uint32_t handle;
  94. uint32_t domain;
  95. uint64_t size;
  96. uint64_t offset;
  97. uint64_t map_handle;
  98. uint32_t tile_mode;
  99. uint32_t tile_flags;
  100. };
  101. struct drm_nouveau_gem_new {
  102. struct drm_nouveau_gem_info info;
  103. uint32_t channel_hint;
  104. uint32_t align;
  105. };
  106. #define NOUVEAU_GEM_MAX_BUFFERS 1024
  107. struct drm_nouveau_gem_pushbuf_bo_presumed {
  108. uint32_t valid;
  109. uint32_t domain;
  110. uint64_t offset;
  111. };
  112. struct drm_nouveau_gem_pushbuf_bo {
  113. uint64_t user_priv;
  114. uint32_t handle;
  115. uint32_t read_domains;
  116. uint32_t write_domains;
  117. uint32_t valid_domains;
  118. struct drm_nouveau_gem_pushbuf_bo_presumed presumed;
  119. };
  120. #define NOUVEAU_GEM_RELOC_LOW (1 << 0)
  121. #define NOUVEAU_GEM_RELOC_HIGH (1 << 1)
  122. #define NOUVEAU_GEM_RELOC_OR (1 << 2)
  123. #define NOUVEAU_GEM_MAX_RELOCS 1024
  124. struct drm_nouveau_gem_pushbuf_reloc {
  125. uint32_t reloc_bo_index;
  126. uint32_t reloc_bo_offset;
  127. uint32_t bo_index;
  128. uint32_t flags;
  129. uint32_t data;
  130. uint32_t vor;
  131. uint32_t tor;
  132. };
  133. #define NOUVEAU_GEM_MAX_PUSH 512
  134. struct drm_nouveau_gem_pushbuf_push {
  135. uint32_t bo_index;
  136. uint32_t pad;
  137. uint64_t offset;
  138. uint64_t length;
  139. };
  140. struct drm_nouveau_gem_pushbuf {
  141. uint32_t channel;
  142. uint32_t nr_buffers;
  143. uint64_t buffers;
  144. uint32_t nr_relocs;
  145. uint32_t nr_push;
  146. uint64_t relocs;
  147. uint64_t push;
  148. uint32_t suffix0;
  149. uint32_t suffix1;
  150. uint64_t vram_available;
  151. uint64_t gart_available;
  152. };
  153. #define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001
  154. #define NOUVEAU_GEM_CPU_PREP_NOBLOCK 0x00000002
  155. #define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004
  156. struct drm_nouveau_gem_cpu_prep {
  157. uint32_t handle;
  158. uint32_t flags;
  159. };
  160. struct drm_nouveau_gem_cpu_fini {
  161. uint32_t handle;
  162. };
  163. enum nouveau_bus_type {
  164. NV_AGP = 0,
  165. NV_PCI = 1,
  166. NV_PCIE = 2,
  167. };
  168. struct drm_nouveau_sarea {
  169. };
  170. #define DRM_NOUVEAU_GETPARAM 0x00
  171. #define DRM_NOUVEAU_SETPARAM 0x01
  172. #define DRM_NOUVEAU_CHANNEL_ALLOC 0x02
  173. #define DRM_NOUVEAU_CHANNEL_FREE 0x03
  174. #define DRM_NOUVEAU_GROBJ_ALLOC 0x04
  175. #define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x05
  176. #define DRM_NOUVEAU_GPUOBJ_FREE 0x06
  177. #define DRM_NOUVEAU_NVIF 0x07
  178. #define DRM_NOUVEAU_GEM_NEW 0x40
  179. #define DRM_NOUVEAU_GEM_PUSHBUF 0x41
  180. #define DRM_NOUVEAU_GEM_CPU_PREP 0x42
  181. #define DRM_NOUVEAU_GEM_CPU_FINI 0x43
  182. #define DRM_NOUVEAU_GEM_INFO 0x44
  183. #endif /* __NOUVEAU_DRM_H__ */