dpp.h 3.6 KB

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