omap_drm.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * include/uapi/drm/omap_drm.h
  4. *
  5. * Copyright (C) 2011 Texas Instruments
  6. * Author: Rob Clark <rob@ti.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License version 2 as published by
  10. * the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along with
  18. * this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef __OMAP_DRM_H__
  21. #define __OMAP_DRM_H__
  22. #include "drm.h"
  23. #if defined(__cplusplus)
  24. extern "C" {
  25. #endif
  26. /* Please note that modifications to all structs defined here are
  27. * subject to backwards-compatibility constraints.
  28. */
  29. #define OMAP_PARAM_CHIPSET_ID 1 /* ie. 0x3430, 0x4430, etc */
  30. struct drm_omap_param {
  31. __u64 param; /* in */
  32. __u64 value; /* in (set_param), out (get_param) */
  33. };
  34. #define OMAP_BO_SCANOUT 0x00000001 /* scanout capable (phys contiguous) */
  35. #define OMAP_BO_CACHE_MASK 0x00000006 /* cache type mask, see cache modes */
  36. #define OMAP_BO_TILED_MASK 0x00000f00 /* tiled mapping mask, see tiled modes */
  37. /* cache modes */
  38. #define OMAP_BO_CACHED 0x00000000 /* default */
  39. #define OMAP_BO_WC 0x00000002 /* write-combine */
  40. #define OMAP_BO_UNCACHED 0x00000004 /* strongly-ordered (uncached) */
  41. /* tiled modes */
  42. #define OMAP_BO_TILED_8 0x00000100
  43. #define OMAP_BO_TILED_16 0x00000200
  44. #define OMAP_BO_TILED_32 0x00000300
  45. #define OMAP_BO_TILED (OMAP_BO_TILED_8 | OMAP_BO_TILED_16 | OMAP_BO_TILED_32)
  46. union omap_gem_size {
  47. __u32 bytes; /* (for non-tiled formats) */
  48. struct {
  49. __u16 width;
  50. __u16 height;
  51. } tiled; /* (for tiled formats) */
  52. };
  53. struct drm_omap_gem_new {
  54. union omap_gem_size size; /* in */
  55. __u32 flags; /* in */
  56. __u32 handle; /* out */
  57. __u32 __pad;
  58. };
  59. /* mask of operations: */
  60. enum omap_gem_op {
  61. OMAP_GEM_READ = 0x01,
  62. OMAP_GEM_WRITE = 0x02,
  63. };
  64. struct drm_omap_gem_cpu_prep {
  65. __u32 handle; /* buffer handle (in) */
  66. __u32 op; /* mask of omap_gem_op (in) */
  67. };
  68. struct drm_omap_gem_cpu_fini {
  69. __u32 handle; /* buffer handle (in) */
  70. __u32 op; /* mask of omap_gem_op (in) */
  71. /* TODO maybe here we pass down info about what regions are touched
  72. * by sw so we can be clever about cache ops? For now a placeholder,
  73. * set to zero and we just do full buffer flush..
  74. */
  75. __u32 nregions;
  76. __u32 __pad;
  77. };
  78. struct drm_omap_gem_info {
  79. __u32 handle; /* buffer handle (in) */
  80. __u32 pad;
  81. __u64 offset; /* mmap offset (out) */
  82. /* note: in case of tiled buffers, the user virtual size can be
  83. * different from the physical size (ie. how many pages are needed
  84. * to back the object) which is returned in DRM_IOCTL_GEM_OPEN..
  85. * This size here is the one that should be used if you want to
  86. * mmap() the buffer:
  87. */
  88. __u32 size; /* virtual size for mmap'ing (out) */
  89. __u32 __pad;
  90. };
  91. #define DRM_OMAP_GET_PARAM 0x00
  92. #define DRM_OMAP_SET_PARAM 0x01
  93. #define DRM_OMAP_GEM_NEW 0x03
  94. #define DRM_OMAP_GEM_CPU_PREP 0x04 /* Deprecated, to be removed */
  95. #define DRM_OMAP_GEM_CPU_FINI 0x05 /* Deprecated, to be removed */
  96. #define DRM_OMAP_GEM_INFO 0x06
  97. #define DRM_OMAP_NUM_IOCTLS 0x07
  98. #define DRM_IOCTL_OMAP_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_PARAM, struct drm_omap_param)
  99. #define DRM_IOCTL_OMAP_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_SET_PARAM, struct drm_omap_param)
  100. #define DRM_IOCTL_OMAP_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_NEW, struct drm_omap_gem_new)
  101. #define DRM_IOCTL_OMAP_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_PREP, struct drm_omap_gem_cpu_prep)
  102. #define DRM_IOCTL_OMAP_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_FINI, struct drm_omap_gem_cpu_fini)
  103. #define DRM_IOCTL_OMAP_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_INFO, struct drm_omap_gem_info)
  104. #if defined(__cplusplus)
  105. }
  106. #endif
  107. #endif /* __OMAP_DRM_H__ */