mtk_drm_ddp_addon.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * Copyright (C) 2016 MediaTek Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. * See http://www.gnu.org/licenses/gpl-2.0.html for more details.
  12. */
  13. #ifndef MTK_DRM_DDP_ADDON_H
  14. #define MTK_DRM_DDP_ADDON_H
  15. #include <drm/drm_crtc.h>
  16. #include <linux/soc/mediatek/mtk-cmdq.h>
  17. #include "mtk_rect.h"
  18. #include "mtk_layering_rule.h"
  19. enum addon_scenario {
  20. NONE,
  21. ONE_SCALING,
  22. TWO_SCALING,
  23. GAME_PQ,
  24. VP_PQ,
  25. TRIPLE_DISP,
  26. ADDON_SCN_NR,
  27. };
  28. enum addon_module {
  29. DISP_RSZ,
  30. DISP_RSZ_v2,
  31. DMDP_PQ_WITH_RDMA,
  32. ADDON_MODULE_NUM,
  33. };
  34. enum addon_type {
  35. ADDON_BETWEEN,
  36. ADDON_BEFORE,
  37. };
  38. struct mtk_lye_ddp_state {
  39. enum addon_scenario scn[HRT_TYPE_NUM];
  40. uint8_t lc_tgt_layer;
  41. uint8_t dmdp_tgt_layer;
  42. };
  43. struct mtk_addon_path_data {
  44. const int *path;
  45. unsigned int path_len;
  46. };
  47. struct mtk_addon_module_data {
  48. enum addon_module module;
  49. enum addon_type type;
  50. int attach_comp;
  51. };
  52. struct mtk_addon_scenario_data {
  53. unsigned int module_num;
  54. const struct mtk_addon_module_data *module_data;
  55. enum HRT_TB_TYPE hrt_type;
  56. };
  57. struct mtk_addon_config_type {
  58. enum addon_module module;
  59. enum addon_type type;
  60. };
  61. struct mtk_addon_rsz_config {
  62. struct mtk_addon_config_type config_type;
  63. struct mtk_rect rsz_src_roi;
  64. struct mtk_rect rsz_dst_roi;
  65. uint8_t lc_tgt_layer;
  66. };
  67. union mtk_addon_config {
  68. struct mtk_addon_config_type config_type;
  69. struct mtk_addon_rsz_config addon_rsz_config;
  70. };
  71. const struct mtk_addon_path_data *
  72. mtk_addon_module_get_path(enum addon_module module);
  73. const struct mtk_addon_scenario_data *
  74. mtk_addon_get_scenario_data(const char *source, struct drm_crtc *crtc,
  75. enum addon_scenario scn);
  76. bool mtk_addon_scenario_support(struct drm_crtc *crtc, enum addon_scenario scn);
  77. void mtk_addon_connect_between(struct drm_crtc *crtc, unsigned int ddp_mode,
  78. const struct mtk_addon_module_data *module_data,
  79. union mtk_addon_config *addon_config,
  80. struct cmdq_pkt *cmdq_handle);
  81. void mtk_addon_disconnect_between(
  82. struct drm_crtc *crtc, unsigned int ddp_mode,
  83. const struct mtk_addon_module_data *module_data,
  84. union mtk_addon_config *addon_config, struct cmdq_pkt *cmdq_handle);
  85. void mtk_addon_connect_before(struct drm_crtc *crtc, unsigned int ddp_mode,
  86. const struct mtk_addon_module_data *module_data,
  87. union mtk_addon_config *addon_config,
  88. struct cmdq_pkt *cmdq_handle);
  89. void mtk_addon_disconnect_before(
  90. struct drm_crtc *crtc, unsigned int ddp_mode,
  91. const struct mtk_addon_module_data *module_data,
  92. union mtk_addon_config *addon_config, struct cmdq_pkt *cmdq_handle);
  93. #endif