tegra_drm.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. struct drm_tegra_gem_create {
  20. __u64 size;
  21. __u32 flags;
  22. __u32 handle;
  23. };
  24. struct drm_tegra_gem_mmap {
  25. __u32 handle;
  26. __u32 offset;
  27. };
  28. struct drm_tegra_syncpt_read {
  29. __u32 id;
  30. __u32 value;
  31. };
  32. struct drm_tegra_syncpt_incr {
  33. __u32 id;
  34. __u32 pad;
  35. };
  36. struct drm_tegra_syncpt_wait {
  37. __u32 id;
  38. __u32 thresh;
  39. __u32 timeout;
  40. __u32 value;
  41. };
  42. #define DRM_TEGRA_NO_TIMEOUT (0xffffffff)
  43. struct drm_tegra_open_channel {
  44. __u32 client;
  45. __u32 pad;
  46. __u64 context;
  47. };
  48. struct drm_tegra_close_channel {
  49. __u64 context;
  50. };
  51. struct drm_tegra_get_syncpt {
  52. __u64 context;
  53. __u32 index;
  54. __u32 id;
  55. };
  56. struct drm_tegra_syncpt {
  57. __u32 id;
  58. __u32 incrs;
  59. };
  60. struct drm_tegra_cmdbuf {
  61. __u32 handle;
  62. __u32 offset;
  63. __u32 words;
  64. __u32 pad;
  65. };
  66. struct drm_tegra_reloc {
  67. struct {
  68. __u32 handle;
  69. __u32 offset;
  70. } cmdbuf;
  71. struct {
  72. __u32 handle;
  73. __u32 offset;
  74. } target;
  75. __u32 shift;
  76. __u32 pad;
  77. };
  78. struct drm_tegra_waitchk {
  79. __u32 handle;
  80. __u32 offset;
  81. __u32 syncpt;
  82. __u32 thresh;
  83. };
  84. struct drm_tegra_submit {
  85. __u64 context;
  86. __u32 num_syncpts;
  87. __u32 num_cmdbufs;
  88. __u32 num_relocs;
  89. __u32 num_waitchks;
  90. __u32 waitchk_mask;
  91. __u32 timeout;
  92. __u32 pad;
  93. __u64 syncpts;
  94. __u64 cmdbufs;
  95. __u64 relocs;
  96. __u64 waitchks;
  97. __u32 fence; /* Return value */
  98. __u32 reserved[5]; /* future expansion */
  99. };
  100. #define DRM_TEGRA_GEM_CREATE 0x00
  101. #define DRM_TEGRA_GEM_MMAP 0x01
  102. #define DRM_TEGRA_SYNCPT_READ 0x02
  103. #define DRM_TEGRA_SYNCPT_INCR 0x03
  104. #define DRM_TEGRA_SYNCPT_WAIT 0x04
  105. #define DRM_TEGRA_OPEN_CHANNEL 0x05
  106. #define DRM_TEGRA_CLOSE_CHANNEL 0x06
  107. #define DRM_TEGRA_GET_SYNCPT 0x07
  108. #define DRM_TEGRA_SUBMIT 0x08
  109. #define DRM_IOCTL_TEGRA_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_CREATE, struct drm_tegra_gem_create)
  110. #define DRM_IOCTL_TEGRA_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_MMAP, struct drm_tegra_gem_mmap)
  111. #define DRM_IOCTL_TEGRA_SYNCPT_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_READ, struct drm_tegra_syncpt_read)
  112. #define DRM_IOCTL_TEGRA_SYNCPT_INCR DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_INCR, struct drm_tegra_syncpt_incr)
  113. #define DRM_IOCTL_TEGRA_SYNCPT_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SYNCPT_WAIT, struct drm_tegra_syncpt_wait)
  114. #define DRM_IOCTL_TEGRA_OPEN_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_OPEN_CHANNEL, struct drm_tegra_open_channel)
  115. #define DRM_IOCTL_TEGRA_CLOSE_CHANNEL DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_CLOSE_CHANNEL, struct drm_tegra_open_channel)
  116. #define DRM_IOCTL_TEGRA_GET_SYNCPT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GET_SYNCPT, struct drm_tegra_get_syncpt)
  117. #define DRM_IOCTL_TEGRA_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_SUBMIT, struct drm_tegra_submit)
  118. #endif