dpp.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 igam_lut_mode;
  42. uint32_t igam_input_format;
  43. uint32_t dgam_lut_mode;
  44. uint32_t rgam_lut_mode;
  45. uint32_t gamut_remap_mode;
  46. uint32_t gamut_remap_c11_c12;
  47. uint32_t gamut_remap_c13_c14;
  48. uint32_t gamut_remap_c21_c22;
  49. uint32_t gamut_remap_c23_c24;
  50. uint32_t gamut_remap_c31_c32;
  51. uint32_t gamut_remap_c33_c34;
  52. };
  53. struct dpp_funcs {
  54. void (*dpp_read_state)(struct dpp *dpp, struct dcn_dpp_state *s);
  55. void (*dpp_reset)(struct dpp *dpp);
  56. void (*dpp_set_scaler)(struct dpp *dpp,
  57. const struct scaler_data *scl_data);
  58. void (*dpp_set_pixel_storage_depth)(
  59. struct dpp *dpp,
  60. enum lb_pixel_depth depth,
  61. const struct bit_depth_reduction_params *bit_depth_params);
  62. bool (*dpp_get_optimal_number_of_taps)(
  63. struct dpp *dpp,
  64. struct scaler_data *scl_data,
  65. const struct scaling_taps *in_taps);
  66. void (*dpp_set_gamut_remap)(
  67. struct dpp *dpp,
  68. const struct dpp_grph_csc_adjustment *adjust);
  69. void (*dpp_set_csc_default)(
  70. struct dpp *dpp,
  71. enum dc_color_space colorspace);
  72. void (*dpp_set_csc_adjustment)(
  73. struct dpp *dpp,
  74. const uint16_t *regval);
  75. void (*dpp_power_on_regamma_lut)(
  76. struct dpp *dpp,
  77. bool power_on);
  78. void (*dpp_program_regamma_lut)(
  79. struct dpp *dpp,
  80. const struct pwl_result_data *rgb,
  81. uint32_t num);
  82. void (*dpp_configure_regamma_lut)(
  83. struct dpp *dpp,
  84. bool is_ram_a);
  85. void (*dpp_program_regamma_lutb_settings)(
  86. struct dpp *dpp,
  87. const struct pwl_params *params);
  88. void (*dpp_program_regamma_luta_settings)(
  89. struct dpp *dpp,
  90. const struct pwl_params *params);
  91. void (*dpp_program_regamma_pwl)(
  92. struct dpp *dpp,
  93. const struct pwl_params *params,
  94. enum opp_regamma mode);
  95. void (*dpp_program_bias_and_scale)(
  96. struct dpp *dpp,
  97. struct dc_bias_and_scale *params);
  98. void (*dpp_set_degamma)(
  99. struct dpp *dpp_base,
  100. enum ipp_degamma_mode mode);
  101. void (*dpp_program_input_lut)(
  102. struct dpp *dpp_base,
  103. const struct dc_gamma *gamma);
  104. void (*dpp_program_degamma_pwl)(struct dpp *dpp_base,
  105. const struct pwl_params *params);
  106. void (*dpp_setup)(
  107. struct dpp *dpp_base,
  108. enum surface_pixel_format format,
  109. enum expansion_mode mode,
  110. struct dc_csc_transform input_csc_color_matrix,
  111. enum dc_color_space input_color_space);
  112. void (*dpp_full_bypass)(struct dpp *dpp_base);
  113. void (*set_cursor_attributes)(
  114. struct dpp *dpp_base,
  115. enum dc_cursor_color_format color_format);
  116. void (*set_cursor_position)(
  117. struct dpp *dpp_base,
  118. const struct dc_cursor_position *pos,
  119. const struct dc_cursor_mi_param *param,
  120. uint32_t width
  121. );
  122. void (*dpp_set_hdr_multiplier)(
  123. struct dpp *dpp_base,
  124. uint32_t multiplier);
  125. void (*dpp_dppclk_control)(
  126. struct dpp *dpp_base,
  127. bool dppclk_div,
  128. bool enable);
  129. };
  130. #endif