fsl-diu-fb.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
  3. *
  4. * Freescale DIU Frame Buffer device driver
  5. *
  6. * Authors: Hongjun Chen <hong-jun.chen@freescale.com>
  7. * Paul Widmer <paul.widmer@freescale.com>
  8. * Srikanth Srinivasan <srikanth.srinivasan@freescale.com>
  9. * York Sun <yorksun@freescale.com>
  10. *
  11. * Based on imxfb.c Copyright (C) 2004 S.Hauer, Pengutronix
  12. *
  13. * This program is free software; you can redistribute it and/or modify it
  14. * under the terms of the GNU General Public License as published by the
  15. * Free Software Foundation; either version 2 of the License, or (at your
  16. * option) any later version.
  17. *
  18. */
  19. #ifndef __FSL_DIU_FB_H__
  20. #define __FSL_DIU_FB_H__
  21. #include <linux/types.h>
  22. struct mfb_chroma_key {
  23. int enable;
  24. __u8 red_max;
  25. __u8 green_max;
  26. __u8 blue_max;
  27. __u8 red_min;
  28. __u8 green_min;
  29. __u8 blue_min;
  30. };
  31. struct aoi_display_offset {
  32. __s32 x_aoi_d;
  33. __s32 y_aoi_d;
  34. };
  35. #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key)
  36. #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8)
  37. #define MFB_SET_ALPHA _IOW('M', 0, __u8)
  38. #define MFB_GET_ALPHA _IOR('M', 0, __u8)
  39. #define MFB_SET_AOID _IOW('M', 4, struct aoi_display_offset)
  40. #define MFB_GET_AOID _IOR('M', 4, struct aoi_display_offset)
  41. #define MFB_SET_PIXFMT _IOW('M', 8, __u32)
  42. #define MFB_GET_PIXFMT _IOR('M', 8, __u32)
  43. /*
  44. * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the
  45. * wrong value for 'size' field of the ioctl. The current macros above use the
  46. * right size, but we still need to provide backwards compatibility, at least
  47. * for a while.
  48. */
  49. #define MFB_SET_PIXFMT_OLD 0x80014d08
  50. #define MFB_GET_PIXFMT_OLD 0x40014d08
  51. #ifdef __KERNEL__
  52. /*
  53. * These are the fields of area descriptor(in DDR memory) for every plane
  54. */
  55. struct diu_ad {
  56. /* Word 0(32-bit) in DDR memory */
  57. /* __u16 comp; */
  58. /* __u16 pixel_s:2; */
  59. /* __u16 pallete:1; */
  60. /* __u16 red_c:2; */
  61. /* __u16 green_c:2; */
  62. /* __u16 blue_c:2; */
  63. /* __u16 alpha_c:3; */
  64. /* __u16 byte_f:1; */
  65. /* __u16 res0:3; */
  66. __be32 pix_fmt; /* hard coding pixel format */
  67. /* Word 1(32-bit) in DDR memory */
  68. __le32 addr;
  69. /* Word 2(32-bit) in DDR memory */
  70. /* __u32 delta_xs:11; */
  71. /* __u32 res1:1; */
  72. /* __u32 delta_ys:11; */
  73. /* __u32 res2:1; */
  74. /* __u32 g_alpha:8; */
  75. __le32 src_size_g_alpha;
  76. /* Word 3(32-bit) in DDR memory */
  77. /* __u32 delta_xi:11; */
  78. /* __u32 res3:5; */
  79. /* __u32 delta_yi:11; */
  80. /* __u32 res4:3; */
  81. /* __u32 flip:2; */
  82. __le32 aoi_size;
  83. /* Word 4(32-bit) in DDR memory */
  84. /*__u32 offset_xi:11;
  85. __u32 res5:5;
  86. __u32 offset_yi:11;
  87. __u32 res6:5;
  88. */
  89. __le32 offset_xyi;
  90. /* Word 5(32-bit) in DDR memory */
  91. /*__u32 offset_xd:11;
  92. __u32 res7:5;
  93. __u32 offset_yd:11;
  94. __u32 res8:5; */
  95. __le32 offset_xyd;
  96. /* Word 6(32-bit) in DDR memory */
  97. __u8 ckmax_r;
  98. __u8 ckmax_g;
  99. __u8 ckmax_b;
  100. __u8 res9;
  101. /* Word 7(32-bit) in DDR memory */
  102. __u8 ckmin_r;
  103. __u8 ckmin_g;
  104. __u8 ckmin_b;
  105. __u8 res10;
  106. /* __u32 res10:8; */
  107. /* Word 8(32-bit) in DDR memory */
  108. __le32 next_ad;
  109. /* Word 9(32-bit) in DDR memory, just for 64-bit aligned */
  110. __u32 paddr;
  111. } __attribute__ ((packed));
  112. /* DIU register map */
  113. struct diu {
  114. __be32 desc[3];
  115. __be32 gamma;
  116. __be32 pallete;
  117. __be32 cursor;
  118. __be32 curs_pos;
  119. __be32 diu_mode;
  120. __be32 bgnd;
  121. __be32 bgnd_wb;
  122. __be32 disp_size;
  123. __be32 wb_size;
  124. __be32 wb_mem_addr;
  125. __be32 hsyn_para;
  126. __be32 vsyn_para;
  127. __be32 syn_pol;
  128. __be32 thresholds;
  129. __be32 int_status;
  130. __be32 int_mask;
  131. __be32 colorbar[8];
  132. __be32 filling;
  133. __be32 plut;
  134. } __attribute__ ((packed));
  135. /*
  136. * Modes of operation of DIU. The DIU supports five different modes, but
  137. * the driver only supports modes 0 and 1.
  138. */
  139. #define MFB_MODE0 0 /* DIU off */
  140. #define MFB_MODE1 1 /* All three planes output to display */
  141. #endif /* __KERNEL__ */
  142. #endif /* __FSL_DIU_FB_H__ */