ddp_info.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* Copyright Statement:
  2. *
  3. * This software/firmware and related documentation ("MediaTek Software") are
  4. * protected under relevant copyright laws. The information contained herein
  5. * is confidential and proprietary to MediaTek Inc. and/or its licensors.
  6. * Without the prior written permission of MediaTek inc. and/or its licensors,
  7. * any reproduction, modification, use or disclosure of MediaTek Software,
  8. * and information contained herein, in whole or in part, shall be strictly prohibited.
  9. */
  10. /* MediaTek Inc. (C) 2015. All rights reserved.
  11. *
  12. * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  13. * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  14. * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
  15. * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  18. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  19. * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  20. * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
  21. * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
  22. * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
  23. * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
  24. * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
  25. * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
  26. * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  27. * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  28. * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
  29. * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  30. */
  31. #ifndef _H_DDP_INFO_
  32. #define _H_DDP_INFO_
  33. //#include <linux/types.h>
  34. #include "ddp_hal.h"
  35. #include "mt_typedefs.h"
  36. #include "ddp_data_type.h"
  37. #include "lcm_drv.h"
  38. #include "ddp_reg.h"
  39. #include "disp_event.h"
  40. #include "ddp_ovl.h"
  41. typedef struct _OVL_CONFIG_STRUCT {
  42. unsigned int ovl_index;
  43. unsigned int layer;
  44. unsigned int layer_en;
  45. enum OVL_LAYER_SOURCE source;
  46. unsigned int fmt;
  47. unsigned int addr;
  48. unsigned int vaddr;
  49. unsigned int src_x;
  50. unsigned int src_y;
  51. unsigned int src_w;
  52. unsigned int src_h;
  53. unsigned int src_pitch;
  54. unsigned int dst_x;
  55. unsigned int dst_y;
  56. unsigned int dst_w;
  57. unsigned int dst_h; // clip region
  58. unsigned int keyEn;
  59. unsigned int key;
  60. unsigned int aen;
  61. unsigned char alpha;
  62. unsigned int isTdshp;
  63. unsigned int isDirty;
  64. unsigned int buff_idx;
  65. unsigned int identity;
  66. unsigned int connected_type;
  67. unsigned int security;
  68. } OVL_CONFIG_STRUCT;
  69. typedef struct _RDMA_CONFIG_STRUCT {
  70. unsigned idx; // instance index
  71. DpColorFormat inputFormat;
  72. unsigned address;
  73. unsigned pitch;
  74. unsigned width;
  75. unsigned height;
  76. } RDMA_CONFIG_STRUCT;
  77. typedef struct _WDMA_CONFIG_STRUCT {
  78. unsigned srcWidth;
  79. unsigned srcHeight; // input
  80. unsigned clipX;
  81. unsigned clipY;
  82. unsigned clipWidth;
  83. unsigned clipHeight; // clip
  84. DpColorFormat outputFormat;
  85. unsigned dstAddress;
  86. unsigned dstWidth; // output
  87. unsigned int useSpecifiedAlpha;
  88. unsigned char alpha;
  89. } WDMA_CONFIG_STRUCT;
  90. typedef struct {
  91. // for ovl
  92. unsigned int ovl_dirty;
  93. unsigned int rdma_dirty;
  94. unsigned int wdma_dirty;
  95. unsigned int dst_dirty;
  96. int ovl_layer_scanned;
  97. OVL_CONFIG_STRUCT ovl_config[TOTAL_OVL_LAYER_NUM];
  98. RDMA_CONFIG_STRUCT rdma_config;
  99. WDMA_CONFIG_STRUCT wdma_config;
  100. LCM_DSI_PARAMS dsi_config;
  101. LCM_DPI_PARAMS dpi_config;
  102. unsigned int lcm_bpp;
  103. unsigned int dst_w;
  104. unsigned int dst_h;
  105. } disp_ddp_path_config;
  106. typedef int (*ddp_module_notify)(DISP_MODULE_ENUM, DISP_PATH_EVENT);
  107. typedef struct {
  108. DISP_MODULE_ENUM module;
  109. int (*init)(DISP_MODULE_ENUM module, void *handle);
  110. int (*deinit)(DISP_MODULE_ENUM module, void *handle);
  111. int (*config)(DISP_MODULE_ENUM module, disp_ddp_path_config *config, void *handle);
  112. int (*start)(DISP_MODULE_ENUM module, void *handle);
  113. int (*trigger)(DISP_MODULE_ENUM module, void *cmdq_handle);
  114. int (*stop)(DISP_MODULE_ENUM module, void *handle);
  115. int (*reset)(DISP_MODULE_ENUM module, void *handle);
  116. int (*power_on)(DISP_MODULE_ENUM module, void *handle);
  117. int (*power_off)(DISP_MODULE_ENUM module, void *handle);
  118. int (*is_idle)(DISP_MODULE_ENUM module);
  119. int (*is_busy)(DISP_MODULE_ENUM module);
  120. int (*dump_info)(DISP_MODULE_ENUM module, int level);
  121. int (*bypass)(DISP_MODULE_ENUM module, int bypass);
  122. int (*build_cmdq)(DISP_MODULE_ENUM module, void *cmdq_handle, CMDQ_STATE state);
  123. int (*set_lcm_utils)(DISP_MODULE_ENUM module, LCM_DRIVER *lcm_drv);
  124. int (*set_listener)(DISP_MODULE_ENUM module,ddp_module_notify notify);
  125. int (*polling_irq)(DISP_MODULE_ENUM module, int bit, int timeout);
  126. int (*connect)(DISP_MODULE_ENUM module, DISP_MODULE_ENUM prev, DISP_MODULE_ENUM next, int connect, void *handle);
  127. } DDP_MODULE_DRIVER;
  128. char *ddp_get_module_name(DISP_MODULE_ENUM module);
  129. //int ddp_get_module_max_irq_bit(DISP_MODULE_ENUM module);
  130. int ddp_enable_module_clock(DISP_MODULE_ENUM module);
  131. int ddp_disable_module_clock(DISP_MODULE_ENUM module);
  132. #endif