jznomoney

Untitled

Apr 27th, 2011
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.17 KB | None | 0 0
  1. /* include/linux/msm_mdp.h
  2. *
  3. * Copyright (C) 2007 Google Incorporated
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef _MSM_MDP_H_
  15. #define _MSM_MDP_H_
  16.  
  17. #include <linux/types.h>
  18.  
  19. #define MSMFB_IOCTL_MAGIC 'm'
  20. #define MSMFB_GRP_DISP _IOW(MSMFB_IOCTL_MAGIC, 1, unsigned int)
  21. #define MSMFB_BLIT _IOW(MSMFB_IOCTL_MAGIC, 2, unsigned int)
  22. #ifdef CONFIG_MSM_MDP40
  23. #define MSMFB_SUSPEND_SW_REFRESHER _IOW(MSMFB_IOCTL_MAGIC, 128, unsigned int)
  24. #define MSMFB_RESUME_SW_REFRESHER _IOW(MSMFB_IOCTL_MAGIC, 129, unsigned int)
  25. #define MSMFB_CURSOR _IOW(MSMFB_IOCTL_MAGIC, 130, struct fb_cursor)
  26. #define MSMFB_SET_LUT _IOW(MSMFB_IOCTL_MAGIC, 131, struct fb_cmap)
  27. #define MSMFB_HISTOGRAM _IOWR(MSMFB_IOCTL_MAGIC, 132, struct mdp_histogram)
  28. /* new ioctls's for set/get ccs matrix */
  29. #define MSMFB_GET_CCS_MATRIX _IOWR(MSMFB_IOCTL_MAGIC, 133, struct mdp_ccs)
  30. #define MSMFB_SET_CCS_MATRIX _IOW(MSMFB_IOCTL_MAGIC, 134, struct mdp_ccs)
  31. #define MSMFB_OVERLAY_SET _IOWR(MSMFB_IOCTL_MAGIC, 135, \
  32. struct mdp_overlay)
  33. #define MSMFB_OVERLAY_UNSET _IOW(MSMFB_IOCTL_MAGIC, 136, unsigned int)
  34. #define MSMFB_OVERLAY_PLAY _IOW(MSMFB_IOCTL_MAGIC, 137, \
  35. struct msmfb_overlay_data)
  36. #define MSMFB_GET_PAGE_PROTECTION _IOR(MSMFB_IOCTL_MAGIC, 138, \
  37. struct mdp_page_protection)
  38. #define MSMFB_SET_PAGE_PROTECTION _IOW(MSMFB_IOCTL_MAGIC, 139, \
  39. struct mdp_page_protection)
  40. #define MSMFB_OVERLAY_GET _IOR(MSMFB_IOCTL_MAGIC, 140, \
  41. struct mdp_overlay)
  42. #define MSMFB_OVERLAY_PLAY_ENABLE _IOW(MSMFB_IOCTL_MAGIC, 141, unsigned int)
  43. #define MSMFB_OVERLAY_BLT _IOWR(MSMFB_IOCTL_MAGIC, 142, \
  44. struct msmfb_overlay_blt)
  45. #define MSMFB_GET_GAMMA_CURVY _IOWR(MSMFB_IOCTL_MAGIC, 143, struct gamma_curvy)
  46. #define MSMFB_HISTOGRAM_START _IO(MSMFB_IOCTL_MAGIC, 144)
  47. #define MSMFB_HISTOGRAM_STOP _IO(MSMFB_IOCTL_MAGIC, 145)
  48. #define MSMFB_OVERLAY_CHANGE_ZORDER_VG_PIPES _IOW(MSMFB_IOCTL_MAGIC, 146, unsigned int)
  49. #define MSMFB_OVERLAY_3D _IOWR(MSMFB_IOCTL_MAGIC, 147, \
  50. struct msmfb_overlay_3d)
  51.  
  52. #endif
  53.  
  54. enum {
  55. MDP_RGB_565, // RGB 565 planer
  56. MDP_XRGB_8888, // RGB 888 padded
  57. MDP_Y_CBCR_H2V2, // Y and CbCr, pseudo planer w/ Cb is in MSB
  58. MDP_ARGB_8888, // ARGB 888
  59. MDP_RGB_888, // RGB 888 planer
  60. MDP_Y_CRCB_H2V2, // Y and CrCb, pseudo planer w/ Cr is in MSB
  61. MDP_YCRYCB_H2V1, // YCrYCb interleave
  62. MDP_Y_CRCB_H2V1, // Y and CrCb, pseduo planer w/ Cr is in MSB
  63. MDP_Y_CBCR_H2V1, // Y and CrCb, pseduo planer w/ Cr is in MSB
  64. MDP_RGBA_8888, // ARGB 888
  65. MDP_BGRA_8888, // ARGB 888
  66. MDP_RGBX_8888, // RGBX 888
  67. #ifdef CONFIG_MSM_MDP40
  68. MDP_Y_CRCB_H2V2_TILE, /* Y and CrCb, pseudo planer tile */
  69. MDP_Y_CBCR_H2V2_TILE, /* Y and CbCr, pseudo planer tile */
  70. #endif
  71. MDP_Y_CR_CB_H2V2, /* Y, Cr and Cb, planar */
  72. MDP_Y_CB_CR_H2V2, /* Y, Cb and Cr, planar */
  73. MDP_IMGTYPE_LIMIT, // Non valid image type after this enum
  74. MDP_IMGTYPE2_START = 0x10000,
  75. MDP_BGR_565 = MDP_IMGTYPE2_START, /* BGR 565 planer */
  76. MDP_FB_FORMAT, /* framebuffer format */
  77. MDP_IMGTYPE_LIMIT2 /* Non valid image type after this enum */
  78. };
  79.  
  80. enum {
  81. PMEM_IMG,
  82. FB_IMG,
  83. };
  84.  
  85. /* flag values */
  86. #define MDP_ROT_NOP 0
  87. #define MDP_FLIP_LR 0x1
  88. #define MDP_FLIP_UD 0x2
  89. #define MDP_ROT_90 0x4
  90. #define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR)
  91. #define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR)
  92. #define MDP_ROT_MASK 0x7
  93. #define MDP_DITHER 0x8
  94. #define MDP_BLUR 0x10
  95. #define MDP_BLEND_FG_PREMULT 0x20000
  96. #define MDP_DEINTERLACE 0x80000000
  97. #define MDP_SHARPENING 0x40000000
  98. #define MDP_NO_DMA_BARRIER_START 0x20000000
  99. #define MDP_NO_DMA_BARRIER_END 0x10000000
  100. #define MDP_NO_BLIT 0x08000000
  101. #define MDP_BLIT_WITH_DMA_BARRIERS 0x000
  102. #define MDP_BLIT_WITH_NO_DMA_BARRIERS \
  103. (MDP_NO_DMA_BARRIER_START | MDP_NO_DMA_BARRIER_END)
  104. #define MDP_BLIT_SRC_GEM 0x04000000
  105. #define MDP_BLIT_DST_GEM 0x02000000
  106. #define MDP_BLIT_NON_CACHED 0x01000000
  107. #define MDP_OV_PIPE_SHARE 0x00800000
  108. #define MDP_DEINTERLACE_ODD 0x00400000
  109.  
  110. #define MDP_TRANSP_NOP 0xffffffff
  111. #define MDP_ALPHA_NOP 0xff
  112.  
  113. #define MDP_FB_PAGE_PROTECTION_NONCACHED (0)
  114. #define MDP_FB_PAGE_PROTECTION_WRITECOMBINE (1)
  115. #define MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE (2)
  116. #define MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE (3)
  117. #define MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE (4)
  118. /* Sentinel: Don't use! */
  119. #define MDP_FB_PAGE_PROTECTION_INVALID (5)
  120. /* Count of the number of MDP_FB_PAGE_PROTECTION_... values. */
  121. #define MDP_NUM_FB_PAGE_PROTECTION_VALUES (5)
  122.  
  123. struct mdp_rect {
  124. uint32_t x;
  125. uint32_t y;
  126. uint32_t w;
  127. uint32_t h;
  128. };
  129.  
  130. struct mdp_img {
  131. uint32_t width;
  132. uint32_t height;
  133. uint32_t format;
  134. uint32_t offset;
  135. int memory_id; /* the file descriptor */
  136. uint32_t priv;
  137. };
  138.  
  139. /*
  140. * {3x3} + {3} ccs matrix
  141. */
  142.  
  143. #define MDP_CCS_RGB2YUV 0
  144. #define MDP_CCS_YUV2RGB 1
  145.  
  146. #define MDP_CCS_SIZE 9
  147. #define MDP_BV_SIZE 3
  148.  
  149. struct mdp_ccs {
  150. int direction; /* MDP_CCS_RGB2YUV or YUV2RGB */
  151. uint16_t ccs[MDP_CCS_SIZE]; /* 3x3 color coefficients */
  152. uint16_t bv[MDP_BV_SIZE]; /* 1x3 bias vector */
  153. };
  154.  
  155. /* The version of the mdp_blit_req structure so that
  156. * user applications can selectively decide which functionality
  157. * to include
  158. */
  159.  
  160. #define MDP_BLIT_REQ_VERSION 2
  161.  
  162. struct mdp_blit_req {
  163. struct mdp_img src;
  164. struct mdp_img dst;
  165. struct mdp_rect src_rect;
  166. struct mdp_rect dst_rect;
  167. uint32_t alpha;
  168. uint32_t transp_mask;
  169. uint32_t flags;
  170. int sharpening_strength; /* -127 <--> 127, default 64 */
  171. };
  172.  
  173. struct mdp_blit_req_list {
  174. uint32_t count;
  175. struct mdp_blit_req req[];
  176. };
  177.  
  178. #define MSMFB_DATA_VERSION 2
  179.  
  180. #ifdef CONFIG_MSM_MDP40
  181. struct mdp_histogram {
  182. uint32_t frame_cnt;
  183. uint32_t bin_cnt;
  184. uint32_t *r;
  185. uint32_t *g;
  186. uint32_t *b;
  187. };
  188.  
  189. struct msmfb_data {
  190. uint32_t offset;
  191. int memory_id;
  192. int id;
  193. uint32_t flags;
  194. uint32_t priv;
  195. };
  196.  
  197. #define MSMFB_NEW_REQUEST -1
  198.  
  199. struct msmfb_overlay_data {
  200. uint32_t id;
  201. struct msmfb_data data;
  202. };
  203.  
  204. struct msmfb_img {
  205. uint32_t width;
  206. uint32_t height;
  207. uint32_t format;
  208. };
  209.  
  210. struct mdp_overlay {
  211. struct msmfb_img src;
  212. struct mdp_rect src_rect;
  213. struct mdp_rect dst_rect;
  214. uint32_t z_order; /* stage number */
  215. uint32_t is_fg; /* control alpha & transp */
  216. uint32_t alpha;
  217. uint32_t transp_mask;
  218. uint32_t flags;
  219. uint32_t id;
  220. uint32_t user_data[8];
  221. };
  222.  
  223. struct msmfb_overlay_3d {
  224. uint32_t is_3d;
  225. uint32_t width;
  226. uint32_t height;
  227. };
  228.  
  229. struct msmfb_overlay_blt {
  230. uint32_t enable;
  231. struct msmfb_data data;
  232. };
  233.  
  234. struct mdp_page_protection {
  235. uint32_t page_protection;
  236. };
  237. #ifdef __KERNEL__
  238.  
  239. /* get the framebuffer physical address information */
  240. int get_fb_phys_info(unsigned long *start, unsigned long *len, int fb_num);
  241.  
  242. #endif
  243. #endif
  244. #endif //_MSM_MDP_H_
Advertisement
Add Comment
Please, Sign In to add comment