omapfb.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * File: include/linux/omapfb.h
  4. *
  5. * Framebuffer driver for TI OMAP boards
  6. *
  7. * Copyright (C) 2004 Nokia Corporation
  8. * Author: Imre Deak <imre.deak@nokia.com>
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License along
  21. * with this program; if not, write to the Free Software Foundation, Inc.,
  22. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  23. */
  24. #ifndef _UAPI__LINUX_OMAPFB_H__
  25. #define _UAPI__LINUX_OMAPFB_H__
  26. #include <linux/fb.h>
  27. #include <linux/ioctl.h>
  28. #include <linux/types.h>
  29. /* IOCTL commands. */
  30. #define OMAP_IOW(num, dtype) _IOW('O', num, dtype)
  31. #define OMAP_IOR(num, dtype) _IOR('O', num, dtype)
  32. #define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype)
  33. #define OMAP_IO(num) _IO('O', num)
  34. #define OMAPFB_MIRROR OMAP_IOW(31, int)
  35. #define OMAPFB_SYNC_GFX OMAP_IO(37)
  36. #define OMAPFB_VSYNC OMAP_IO(38)
  37. #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
  38. #define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps)
  39. #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
  40. #define OMAPFB_LCD_TEST OMAP_IOW(45, int)
  41. #define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
  42. #define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
  43. #define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key)
  44. #define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key)
  45. #define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
  46. #define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
  47. #define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
  48. #define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
  49. #define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
  50. #define OMAPFB_WAITFORVSYNC OMAP_IO(57)
  51. #define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read)
  52. #define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
  53. #define OMAPFB_WAITFORGO OMAP_IO(60)
  54. #define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info)
  55. #define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info)
  56. #define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(63, struct omapfb_display_info)
  57. #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
  58. #define OMAPFB_CAPS_LCDC_MASK 0x00fff000
  59. #define OMAPFB_CAPS_PANEL_MASK 0xff000000
  60. #define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000
  61. #define OMAPFB_CAPS_TEARSYNC 0x00002000
  62. #define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
  63. #define OMAPFB_CAPS_PLANE_SCALE 0x00008000
  64. #define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
  65. #define OMAPFB_CAPS_WINDOW_SCALE 0x00020000
  66. #define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000
  67. #define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000
  68. #define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000
  69. /* Values from DSP must map to lower 16-bits */
  70. #define OMAPFB_FORMAT_MASK 0x00ff
  71. #define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100
  72. #define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
  73. #define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
  74. #define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800
  75. #define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
  76. #define OMAPFB_MEMTYPE_SDRAM 0
  77. #define OMAPFB_MEMTYPE_SRAM 1
  78. #define OMAPFB_MEMTYPE_MAX 1
  79. #define OMAPFB_MEM_IDX_ENABLED 0x80
  80. #define OMAPFB_MEM_IDX_MASK 0x7f
  81. enum omapfb_color_format {
  82. OMAPFB_COLOR_RGB565 = 0,
  83. OMAPFB_COLOR_YUV422,
  84. OMAPFB_COLOR_YUV420,
  85. OMAPFB_COLOR_CLUT_8BPP,
  86. OMAPFB_COLOR_CLUT_4BPP,
  87. OMAPFB_COLOR_CLUT_2BPP,
  88. OMAPFB_COLOR_CLUT_1BPP,
  89. OMAPFB_COLOR_RGB444,
  90. OMAPFB_COLOR_YUY422,
  91. OMAPFB_COLOR_ARGB16,
  92. OMAPFB_COLOR_RGB24U, /* RGB24, 32-bit container */
  93. OMAPFB_COLOR_RGB24P, /* RGB24, 24-bit container */
  94. OMAPFB_COLOR_ARGB32,
  95. OMAPFB_COLOR_RGBA32,
  96. OMAPFB_COLOR_RGBX32,
  97. };
  98. struct omapfb_update_window {
  99. __u32 x, y;
  100. __u32 width, height;
  101. __u32 format;
  102. __u32 out_x, out_y;
  103. __u32 out_width, out_height;
  104. __u32 reserved[8];
  105. };
  106. struct omapfb_update_window_old {
  107. __u32 x, y;
  108. __u32 width, height;
  109. __u32 format;
  110. };
  111. enum omapfb_plane {
  112. OMAPFB_PLANE_GFX = 0,
  113. OMAPFB_PLANE_VID1,
  114. OMAPFB_PLANE_VID2,
  115. };
  116. enum omapfb_channel_out {
  117. OMAPFB_CHANNEL_OUT_LCD = 0,
  118. OMAPFB_CHANNEL_OUT_DIGIT,
  119. };
  120. struct omapfb_plane_info {
  121. __u32 pos_x;
  122. __u32 pos_y;
  123. __u8 enabled;
  124. __u8 channel_out;
  125. __u8 mirror;
  126. __u8 mem_idx;
  127. __u32 out_width;
  128. __u32 out_height;
  129. __u32 reserved2[12];
  130. };
  131. struct omapfb_mem_info {
  132. __u32 size;
  133. __u8 type;
  134. __u8 reserved[3];
  135. };
  136. struct omapfb_caps {
  137. __u32 ctrl;
  138. __u32 plane_color;
  139. __u32 wnd_color;
  140. };
  141. enum omapfb_color_key_type {
  142. OMAPFB_COLOR_KEY_DISABLED = 0,
  143. OMAPFB_COLOR_KEY_GFX_DST,
  144. OMAPFB_COLOR_KEY_VID_SRC,
  145. };
  146. struct omapfb_color_key {
  147. __u8 channel_out;
  148. __u32 background;
  149. __u32 trans_key;
  150. __u8 key_type;
  151. };
  152. enum omapfb_update_mode {
  153. OMAPFB_UPDATE_DISABLED = 0,
  154. OMAPFB_AUTO_UPDATE,
  155. OMAPFB_MANUAL_UPDATE
  156. };
  157. struct omapfb_memory_read {
  158. __u16 x;
  159. __u16 y;
  160. __u16 w;
  161. __u16 h;
  162. size_t buffer_size;
  163. void __user *buffer;
  164. };
  165. struct omapfb_ovl_colormode {
  166. __u8 overlay_idx;
  167. __u8 mode_idx;
  168. __u32 bits_per_pixel;
  169. __u32 nonstd;
  170. struct fb_bitfield red;
  171. struct fb_bitfield green;
  172. struct fb_bitfield blue;
  173. struct fb_bitfield transp;
  174. };
  175. struct omapfb_vram_info {
  176. __u32 total;
  177. __u32 free;
  178. __u32 largest_free_block;
  179. __u32 reserved[5];
  180. };
  181. struct omapfb_tearsync_info {
  182. __u8 enabled;
  183. __u8 reserved1[3];
  184. __u16 line;
  185. __u16 reserved2;
  186. };
  187. struct omapfb_display_info {
  188. __u16 xres;
  189. __u16 yres;
  190. __u32 width; /* phys width of the display in micrometers */
  191. __u32 height; /* phys height of the display in micrometers */
  192. __u32 reserved[5];
  193. };
  194. #endif /* _UAPI__LINUX_OMAPFB_H__ */