dpp.h 3.8 KB

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