mbxfb.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __MBX_FB_H
  3. #define __MBX_FB_H
  4. #include <asm/ioctl.h>
  5. #include <asm/types.h>
  6. struct mbxfb_val {
  7. unsigned int defval;
  8. unsigned int min;
  9. unsigned int max;
  10. };
  11. struct fb_info;
  12. struct mbxfb_platform_data {
  13. /* Screen info */
  14. struct mbxfb_val xres;
  15. struct mbxfb_val yres;
  16. struct mbxfb_val bpp;
  17. /* Memory info */
  18. unsigned long memsize; /* if 0 use ODFB? */
  19. unsigned long timings1;
  20. unsigned long timings2;
  21. unsigned long timings3;
  22. int (*probe)(struct fb_info *fb);
  23. int (*remove)(struct fb_info *fb);
  24. };
  25. /* planar */
  26. #define MBXFB_FMT_YUV16 0
  27. #define MBXFB_FMT_YUV12 1
  28. /* packed */
  29. #define MBXFB_FMT_UY0VY1 2
  30. #define MBXFB_FMT_VY0UY1 3
  31. #define MBXFB_FMT_Y0UY1V 4
  32. #define MBXFB_FMT_Y0VY1U 5
  33. struct mbxfb_overlaySetup {
  34. __u32 enable;
  35. __u32 x, y;
  36. __u32 width, height;
  37. __u32 fmt;
  38. __u32 mem_offset;
  39. __u32 scaled_width;
  40. __u32 scaled_height;
  41. /* Filled by the driver */
  42. __u32 U_offset;
  43. __u32 V_offset;
  44. __u16 Y_stride;
  45. __u16 UV_stride;
  46. };
  47. #define MBXFB_ALPHABLEND_NONE 0
  48. #define MBXFB_ALPHABLEND_GLOBAL 1
  49. #define MBXFB_ALPHABLEND_PIXEL 2
  50. #define MBXFB_COLORKEY_DISABLED 0
  51. #define MBXFB_COLORKEY_PREVIOUS 1
  52. #define MBXFB_COLORKEY_CURRENT 2
  53. struct mbxfb_alphaCtl {
  54. __u8 overlay_blend_mode;
  55. __u8 overlay_colorkey_mode;
  56. __u8 overlay_global_alpha;
  57. __u32 overlay_colorkey;
  58. __u32 overlay_colorkey_mask;
  59. __u8 graphics_blend_mode;
  60. __u8 graphics_colorkey_mode;
  61. __u8 graphics_global_alpha;
  62. __u32 graphics_colorkey;
  63. __u32 graphics_colorkey_mask;
  64. };
  65. #define MBXFB_PLANE_GRAPHICS 0
  66. #define MBXFB_PLANE_VIDEO 1
  67. struct mbxfb_planeorder {
  68. __u8 bottom;
  69. __u8 top;
  70. };
  71. struct mbxfb_reg {
  72. __u32 addr; /* offset from 0x03fe 0000 */
  73. __u32 val; /* value */
  74. __u32 mask; /* which bits to touch (for write) */
  75. };
  76. #define MBXFB_IOCX_OVERLAY _IOWR(0xF4, 0x00,struct mbxfb_overlaySetup)
  77. #define MBXFB_IOCG_ALPHA _IOR(0xF4, 0x01,struct mbxfb_alphaCtl)
  78. #define MBXFB_IOCS_ALPHA _IOW(0xF4, 0x02,struct mbxfb_alphaCtl)
  79. #define MBXFB_IOCS_PLANEORDER _IOR(0xF4, 0x03,struct mbxfb_planeorder)
  80. #define MBXFB_IOCS_REG _IOW(0xF4, 0x04,struct mbxfb_reg)
  81. #define MBXFB_IOCX_REG _IOWR(0xF4, 0x05,struct mbxfb_reg)
  82. #endif /* __MBX_FB_H */