ipp.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Copyright 2015 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_IPP_H__
  26. #define __DAL_IPP_H__
  27. #include "hw_shared.h"
  28. #define MAXTRIX_COEFFICIENTS_NUMBER 12
  29. #define MAXTRIX_COEFFICIENTS_WRAP_NUMBER (MAXTRIX_COEFFICIENTS_NUMBER + 4)
  30. #define MAX_OVL_MATRIX_COUNT 12
  31. /* IPP RELATED */
  32. struct input_pixel_processor {
  33. struct dc_context *ctx;
  34. uint32_t inst;
  35. const struct ipp_funcs *funcs;
  36. };
  37. enum ipp_prescale_mode {
  38. IPP_PRESCALE_MODE_BYPASS,
  39. IPP_PRESCALE_MODE_FIXED_SIGNED,
  40. IPP_PRESCALE_MODE_FLOAT_SIGNED,
  41. IPP_PRESCALE_MODE_FIXED_UNSIGNED,
  42. IPP_PRESCALE_MODE_FLOAT_UNSIGNED
  43. };
  44. struct ipp_prescale_params {
  45. enum ipp_prescale_mode mode;
  46. uint16_t bias;
  47. uint16_t scale;
  48. };
  49. enum ipp_degamma_mode {
  50. IPP_DEGAMMA_MODE_BYPASS,
  51. IPP_DEGAMMA_MODE_HW_sRGB,
  52. IPP_DEGAMMA_MODE_HW_xvYCC,
  53. IPP_DEGAMMA_MODE_USER_PWL
  54. };
  55. enum ovl_color_space {
  56. OVL_COLOR_SPACE_UNKNOWN = 0,
  57. OVL_COLOR_SPACE_RGB,
  58. OVL_COLOR_SPACE_YUV601,
  59. OVL_COLOR_SPACE_YUV709
  60. };
  61. enum expansion_mode {
  62. EXPANSION_MODE_DYNAMIC,
  63. EXPANSION_MODE_ZERO
  64. };
  65. enum ipp_output_format {
  66. IPP_OUTPUT_FORMAT_12_BIT_FIX,
  67. IPP_OUTPUT_FORMAT_16_BIT_BYPASS,
  68. IPP_OUTPUT_FORMAT_FLOAT
  69. };
  70. struct ipp_funcs {
  71. /*** cursor ***/
  72. void (*ipp_cursor_set_position)(
  73. struct input_pixel_processor *ipp,
  74. const struct dc_cursor_position *position);
  75. bool (*ipp_cursor_set_attributes)(
  76. struct input_pixel_processor *ipp,
  77. const struct dc_cursor_attributes *attributes);
  78. /*** setup input pixel processing ***/
  79. /* put the entire pixel processor to bypass */
  80. void (*ipp_full_bypass)(
  81. struct input_pixel_processor *ipp);
  82. /* setup ipp to expand/convert input to pixel processor internal format */
  83. void (*ipp_setup)(
  84. struct input_pixel_processor *ipp,
  85. enum surface_pixel_format input_format,
  86. enum expansion_mode mode,
  87. enum ipp_output_format output_format);
  88. /* DCE function to setup IPP. TODO: see if we can consolidate to setup */
  89. void (*ipp_program_prescale)(
  90. struct input_pixel_processor *ipp,
  91. struct ipp_prescale_params *params);
  92. /*** DEGAMMA RELATED ***/
  93. bool (*ipp_set_degamma)(
  94. struct input_pixel_processor *ipp,
  95. enum ipp_degamma_mode mode);
  96. bool (*ipp_program_degamma_pwl)(
  97. struct input_pixel_processor *ipp,
  98. const struct pwl_params *params);
  99. };
  100. #endif /* __DAL_IPP_H__ */