ddp_info.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. #ifndef _H_DDP_INFO
  2. #define _H_DDP_INFO
  3. #include <linux/types.h>
  4. #include "ddp_hal.h"
  5. #include "DpDataType.h"
  6. #include "lcm_drv.h"
  7. #include "disp_event.h"
  8. #include "ddp_ovl.h"
  9. #include <disp_session.h>
  10. typedef struct _OVL_CONFIG_STRUCT {
  11. unsigned int ovl_index;
  12. unsigned int layer;
  13. unsigned int layer_en;
  14. enum OVL_LAYER_SOURCE source;
  15. unsigned int fmt;
  16. unsigned long addr;
  17. unsigned long vaddr;
  18. unsigned int src_x;
  19. unsigned int src_y;
  20. unsigned int src_w;
  21. unsigned int src_h;
  22. unsigned int src_pitch;
  23. unsigned int dst_x;
  24. unsigned int dst_y;
  25. unsigned int dst_w;
  26. unsigned int dst_h; /* clip region */
  27. unsigned int keyEn;
  28. unsigned int key;
  29. unsigned int aen;
  30. unsigned char alpha;
  31. unsigned int sur_aen;
  32. unsigned int src_alpha;
  33. unsigned int dst_alpha;
  34. unsigned int isTdshp;
  35. unsigned int isDirty;
  36. unsigned int buff_idx;
  37. unsigned int identity;
  38. unsigned int connected_type;
  39. DISP_BUFFER_TYPE security;
  40. unsigned int yuv_range;
  41. } OVL_CONFIG_STRUCT;
  42. typedef struct _OVL_BASIC_STRUCT {
  43. unsigned int layer;
  44. unsigned int layer_en;
  45. unsigned int fmt;
  46. unsigned long addr;
  47. unsigned int src_w;
  48. unsigned int src_h;
  49. unsigned int src_pitch;
  50. unsigned int bpp;
  51. } OVL_BASIC_STRUCT;
  52. typedef struct _RDMA_BASIC_STRUCT {
  53. unsigned long addr;
  54. unsigned int src_w;
  55. unsigned int src_h;
  56. unsigned int bpp;
  57. } RDMA_BASIC_STRUCT;
  58. typedef struct _RDMA_CONFIG_STRUCT {
  59. unsigned idx; /* instance index */
  60. DpColorFormat inputFormat;
  61. unsigned long address;
  62. unsigned pitch;
  63. unsigned width;
  64. unsigned height;
  65. DISP_BUFFER_TYPE security;
  66. } RDMA_CONFIG_STRUCT;
  67. typedef struct _WDMA_CONFIG_STRUCT {
  68. unsigned srcWidth;
  69. unsigned srcHeight; /* input */
  70. unsigned clipX;
  71. unsigned clipY;
  72. unsigned clipWidth;
  73. unsigned clipHeight; /* clip */
  74. DpColorFormat outputFormat;
  75. unsigned long dstAddress;
  76. unsigned dstPitch; /* output */
  77. unsigned int useSpecifiedAlpha;
  78. unsigned char alpha;
  79. DISP_BUFFER_TYPE security;
  80. } WDMA_CONFIG_STRUCT;
  81. typedef struct {
  82. /* for ovl */
  83. bool ovl_dirty;
  84. bool rdma_dirty;
  85. bool wdma_dirty;
  86. bool dst_dirty;
  87. bool roi_dirty;
  88. bool is_memory;
  89. OVL_CONFIG_STRUCT ovl_config[OVL_LAYER_NUM];
  90. RDMA_CONFIG_STRUCT rdma_config;
  91. WDMA_CONFIG_STRUCT wdma_config;
  92. LCM_PARAMS dispif_config;
  93. unsigned int lcm_bpp;
  94. unsigned int dst_w;
  95. unsigned int dst_h;
  96. unsigned int fps;
  97. } disp_ddp_path_config;
  98. typedef int (*ddp_module_notify)(DISP_MODULE_ENUM, DISP_PATH_EVENT);
  99. typedef struct DDP_MODULE_DRIVER {
  100. DISP_MODULE_ENUM module;
  101. int (*init)(DISP_MODULE_ENUM module, void *handle);
  102. int (*deinit)(DISP_MODULE_ENUM module, void *handle);
  103. int (*config)(DISP_MODULE_ENUM module, disp_ddp_path_config *config, void *handle);
  104. int (*start)(DISP_MODULE_ENUM module, void *handle);
  105. int (*trigger)(DISP_MODULE_ENUM module, void *handle);
  106. int (*stop)(DISP_MODULE_ENUM module, void *handle);
  107. int (*reset)(DISP_MODULE_ENUM module, void *handle);
  108. int (*power_on)(DISP_MODULE_ENUM module, void *handle);
  109. int (*power_off)(DISP_MODULE_ENUM module, void *handle);
  110. int (*suspend)(DISP_MODULE_ENUM module, void *handle);
  111. int (*resume)(DISP_MODULE_ENUM module, void *handle);
  112. int (*is_idle)(DISP_MODULE_ENUM module);
  113. int (*is_busy)(DISP_MODULE_ENUM module);
  114. int (*dump_info)(DISP_MODULE_ENUM module, int level);
  115. int (*bypass)(DISP_MODULE_ENUM module, int bypass);
  116. int (*build_cmdq)(DISP_MODULE_ENUM module, void *cmdq_handle, CMDQ_STATE state);
  117. int (*set_lcm_utils)(DISP_MODULE_ENUM module, LCM_DRIVER *lcm_drv);
  118. int (*set_listener)(DISP_MODULE_ENUM module, ddp_module_notify notify);
  119. int (*cmd)(DISP_MODULE_ENUM module, int msg, unsigned long arg, void *handle);
  120. int (*ioctl)(DISP_MODULE_ENUM module, void *handle, unsigned int ioctl_cmd,
  121. unsigned long *params);
  122. int (*enable_irq)(DISP_MODULE_ENUM module, void *handle, DDP_IRQ_LEVEL irq_level);
  123. } DDP_MODULE_DRIVER;
  124. char *ddp_get_module_name(DISP_MODULE_ENUM module);
  125. char *ddp_get_reg_module_name(DISP_REG_ENUM module);
  126. int ddp_get_module_max_irq_bit(DISP_MODULE_ENUM module);
  127. extern DDP_MODULE_DRIVER *ddp_modules_driver[DISP_MODULE_NUM];
  128. /* TODO: FIXME */
  129. /* dsi */
  130. /* extern DDP_MODULE_DRIVER ddp_driver_dsi0; */
  131. /* extern DDP_MODULE_DRIVER ddp_driver_dsi1; */
  132. /* extern DDP_MODULE_DRIVER ddp_driver_dsidual; */
  133. /* dpi */
  134. #ifndef DISP_NO_DPI
  135. extern DDP_MODULE_DRIVER ddp_driver_dpi;
  136. #endif
  137. /* ovl */
  138. extern DDP_MODULE_DRIVER ddp_driver_ovl;
  139. /* rdma */
  140. extern DDP_MODULE_DRIVER ddp_driver_rdma;
  141. /* wdma */
  142. extern DDP_MODULE_DRIVER ddp_driver_wdma;
  143. /* color */
  144. extern DDP_MODULE_DRIVER ddp_driver_color;
  145. /* aal */
  146. extern DDP_MODULE_DRIVER ddp_driver_aal;
  147. /* od */
  148. #if defined(MTK_FB_OD_SUPPORT)
  149. extern DDP_MODULE_DRIVER ddp_driver_od;
  150. #endif
  151. /* gamma */
  152. extern DDP_MODULE_DRIVER ddp_driver_gamma;
  153. /* dither */
  154. extern DDP_MODULE_DRIVER ddp_driver_dither;
  155. /* ccorr */
  156. extern DDP_MODULE_DRIVER ddp_driver_ccorr;
  157. /* split */
  158. extern DDP_MODULE_DRIVER ddp_driver_split;
  159. /* pwm */
  160. extern DDP_MODULE_DRIVER ddp_driver_pwm;
  161. #endif