dpp.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /*
  2. * Copyright 2012-15 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * Authors: AMD
  23. *
  24. */
  25. #ifndef __DAL_DPP_H__
  26. #define __DAL_DPP_H__
  27. #include "transform.h"
  28. struct dpp {
  29. const struct dpp_funcs *funcs;
  30. struct dc_context *ctx;
  31. int inst;
  32. struct dpp_caps *caps;
  33. struct pwl_params regamma_params;
  34. struct pwl_params degamma_params;
  35. };
  36. struct dpp_grph_csc_adjustment {
  37. struct fixed31_32 temperature_matrix[CSC_TEMPERATURE_MATRIX_SIZE];
  38. enum graphics_gamut_adjust_type gamut_adjust_type;
  39. };
  40. struct dcn_dpp_state {
  41. uint32_t is_enabled;
  42. uint32_t igam_lut_mode;
  43. uint32_t igam_input_format;
  44. uint32_t dgam_lut_mode;
  45. uint32_t rgam_lut_mode;
  46. uint32_t gamut_remap_mode;
  47. uint32_t gamut_remap_c11_c12;
  48. uint32_t gamut_remap_c13_c14;
  49. uint32_t gamut_remap_c21_c22;
  50. uint32_t gamut_remap_c23_c24;
  51. uint32_t gamut_remap_c31_c32;
  52. uint32_t gamut_remap_c33_c34;
  53. };
  54. struct dpp_funcs {
  55. void (*dpp_read_state)(struct dpp *dpp, struct dcn_dpp_state *s);
  56. void (*dpp_reset)(struct dpp *dpp);
  57. void (*dpp_set_scaler)(struct dpp *dpp,
  58. const struct scaler_data *scl_data);
  59. void (*dpp_set_pixel_storage_depth)(
  60. struct dpp *dpp,
  61. enum lb_pixel_depth depth,
  62. const struct bit_depth_reduction_params *bit_depth_params);
  63. bool (*dpp_get_optimal_number_of_taps)(
  64. struct dpp *dpp,
  65. struct scaler_data *scl_data,
  66. const struct scaling_taps *in_taps);
  67. void (*dpp_set_gamut_remap)(
  68. struct dpp *dpp,
  69. const struct dpp_grph_csc_adjustment *adjust);
  70. void (*dpp_set_csc_default)(
  71. struct dpp *dpp,
  72. enum dc_color_space colorspace);
  73. void (*dpp_set_csc_adjustment)(
  74. struct dpp *dpp,
  75. const uint16_t *regval);
  76. void (*dpp_power_on_regamma_lut)(
  77. struct dpp *dpp,
  78. bool power_on);
  79. void (*dpp_program_regamma_lut)(
  80. struct dpp *dpp,
  81. const struct pwl_result_data *rgb,
  82. uint32_t num);
  83. void (*dpp_configure_regamma_lut)(
  84. struct dpp *dpp,
  85. bool is_ram_a);
  86. void (*dpp_program_regamma_lutb_settings)(
  87. struct dpp *dpp,
  88. const struct pwl_params *params);
  89. void (*dpp_program_regamma_luta_settings)(
  90. struct dpp *dpp,
  91. const struct pwl_params *params);
  92. void (*dpp_program_regamma_pwl)(
  93. struct dpp *dpp,
  94. const struct pwl_params *params,
  95. enum opp_regamma mode);
  96. void (*dpp_program_bias_and_scale)(
  97. struct dpp *dpp,
  98. struct dc_bias_and_scale *params);
  99. void (*dpp_set_degamma)(
  100. struct dpp *dpp_base,
  101. enum ipp_degamma_mode mode);
  102. void (*dpp_program_input_lut)(
  103. struct dpp *dpp_base,
  104. const struct dc_gamma *gamma);
  105. void (*dpp_program_degamma_pwl)(struct dpp *dpp_base,
  106. const struct pwl_params *params);
  107. void (*dpp_setup)(
  108. struct dpp *dpp_base,
  109. enum surface_pixel_format format,
  110. enum expansion_mode mode,
  111. struct dc_csc_transform input_csc_color_matrix,
  112. enum dc_color_space input_color_space);
  113. void (*dpp_full_bypass)(struct dpp *dpp_base);
  114. void (*set_cursor_attributes)(
  115. struct dpp *dpp_base,
  116. enum dc_cursor_color_format color_format);
  117. void (*set_cursor_position)(
  118. struct dpp *dpp_base,
  119. const struct dc_cursor_position *pos,
  120. const struct dc_cursor_mi_param *param,
  121. uint32_t width,
  122. uint32_t height
  123. );
  124. void (*dpp_set_hdr_multiplier)(
  125. struct dpp *dpp_base,
  126. uint32_t multiplier);
  127. void (*set_optional_cursor_attributes)(
  128. struct dpp *dpp_base,
  129. struct dpp_cursor_attributes *attr);
  130. void (*dpp_dppclk_control)(
  131. struct dpp *dpp_base,
  132. bool dppclk_div,
  133. bool enable);
  134. };
  135. #endif