tegra_drm.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef _UAPI_TEGRA_DRM_H_
  17. #define _UAPI_TEGRA_DRM_H_
  18. #include <drm/drm.h>
  19. #define DRM_TEGRA_GEM_CREATE_TILED (1 << 0)
  20. #define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
  21. struct drm_tegra_gem_create {
  22. __u64 size;
  23. __u32 flags;
  24. __u32 handle;
  25. };
  26. struct drm_tegra_gem_mmap {
  27. __u32 handle;
  28. __u32 offset;
  29. };
  30. struct drm_tegra_syncpt_read {
  31. __u32 id;
  32. __u32 value;
  33. };
  34. struct drm_tegra_syncpt_incr {
  35. __u32 id;
  36. __u32 pad;
  37. };
  38. struct drm_tegra_syncpt_wait {
  39. __u32 id;
  40. __u32 thresh;
  41. __u32 timeout;
  42. __u32 value;
  43. };
  44. #define DRM_TEGRA_NO_TIMEOUT (0xffffffff)
  45. struct drm_tegra_open_channel {
  46. __u32 client;
  47. __u32 pad;
  48. __u64 context;
  49. };
  50. struct drm_tegra_close_channel {
  51. __u64 context;
  52. };
  53. struct drm_tegra_get_syncpt {
  54. __u64 context;
  55. __u32 index;
  56. __u32 id;
  57. };
  58. struct drm_tegra_get_syncpt_base {
  59. __u64 context;
  60. __u32 syncpt;
  61. __u32 id;
  62. };
  63. struct drm_tegra_syncpt {
  64. __u32 id;
  65. __u32 incrs;
  66. };
  67. struct drm_tegra_cmdbuf {
  68. __u32 handle;
  69. __u32 offset;
  70. __u32 words;
  71. __u32 pad;
  72. };
  73. struct drm_tegra_reloc {
  74. struct {
  75. __u32 handle;
  76. __u32 offset;
  77. } cmdbuf;
  78. struct {
  79. __u32 handle;
  80. __u32 offset;
  81. } target;
  82. __u32 shift;
  83. __u32 pad;
  84. };
  85. struct drm_tegra_waitchk {
  86. __u32 handle;
  87. __u32 offset;
  88. __u32 syncpt;
  89. __u32 thresh;
  90. };
  91. struct drm_tegra_submit {
  92. __u64 context;
  93. __u32 num_syncpts;
  94. __u32 num_cmdbufs;
  95. __u32 num_relocs;
  96. __u32 num_waitchks;
  97. __u32 waitchk_mask;
  98. __u32 timeout;
  99. __u32 pad;
  100. __u64 syncpts;
  101. __u64 cmdbufs;
  102. __u64 relocs;
  103. __u64 waitchks;
  104. __u32 fence; /* Return value */
  105. __u32 reserved[5]; /* future expansion */
  106. };
  107. #define DRM_TEGRA_GEM_CREATE 0x00
  108. #define DRM_TEGRA_GEM_MMAP 0x01
  109. #define DRM_TEGRA_SYNCPT_READ 0x02
  110. #define DRM_TEGRA_SYNCPT_INCR 0x03
  111. #define DRM_TEGRA_SYNCPT_WAIT 0x04
  112. #define DRM_TEGRA_OPEN_CHANNEL 0x05
  113. #define DRM_TEGRA_CLOSE_CHANNEL 0x06
  114. #define DRM_TEGRA_GET_SYNCPT 0x07
  115. #define DRM_TEGRA_SUBMIT 0x08
  116. #define DRM_TEGRA_GET_SYNCPT_BASE 0x09
  117. #define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create)
  118. #define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap)
  119. #define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read)
  120. #define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr)
  121. #define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait)
  122. #define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
  123. #define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_open_channel)
  124. #define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt)
  125. #define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit)
  126. #define DRM_IOCTL_TEGRA_GET_SYNCPT_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT_BASE, struct drm_tegra_get_syncpt_base)
  127. #endif