2 * Copyright 2012-15 Advanced Micro Devices, Inc.
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:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
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.
30 #include "transform.h"
33 const struct dpp_funcs
*funcs
;
34 struct dc_context
*ctx
;
36 struct dpp_caps
*caps
;
37 struct pwl_params regamma_params
;
40 struct dpp_grph_csc_adjustment
{
41 struct fixed31_32 temperature_matrix
[CSC_TEMPERATURE_MATRIX_SIZE
];
42 enum graphics_gamut_adjust_type gamut_adjust_type
;
46 void (*dpp_reset
)(struct dpp
*dpp
);
48 void (*dpp_set_scaler
)(struct dpp
*dpp
,
49 const struct scaler_data
*scl_data
);
51 void (*dpp_set_pixel_storage_depth
)(
53 enum lb_pixel_depth depth
,
54 const struct bit_depth_reduction_params
*bit_depth_params
);
56 bool (*dpp_get_optimal_number_of_taps
)(
58 struct scaler_data
*scl_data
,
59 const struct scaling_taps
*in_taps
);
61 void (*dpp_set_gamut_remap
)(
63 const struct dpp_grph_csc_adjustment
*adjust
);
65 void (*opp_set_csc_default
)(
67 const struct default_adjustment
*default_adjust
);
69 void (*opp_set_csc_adjustment
)(
71 const struct out_csc_color_matrix
*tbl_entry
);
73 void (*opp_power_on_regamma_lut
)(
77 void (*opp_program_regamma_lut
)(
79 const struct pwl_result_data
*rgb
,
82 void (*opp_configure_regamma_lut
)(
86 void (*opp_program_regamma_lutb_settings
)(
88 const struct pwl_params
*params
);
90 void (*opp_program_regamma_luta_settings
)(
92 const struct pwl_params
*params
);
94 void (*opp_program_regamma_pwl
)(
95 struct dpp
*dpp
, const struct pwl_params
*params
);
97 void (*opp_set_regamma_mode
)(
99 enum opp_regamma mode
);
101 void (*ipp_set_degamma
)(
102 struct dpp
*dpp_base
,
103 enum ipp_degamma_mode mode
);
105 void (*ipp_program_input_lut
)(
106 struct dpp
*dpp_base
,
107 const struct dc_gamma
*gamma
);
109 void (*ipp_program_degamma_pwl
)(struct dpp
*dpp_base
,
110 const struct pwl_params
*params
);
113 struct dpp
*dpp_base
,
114 enum surface_pixel_format input_format
,
115 enum expansion_mode mode
);
117 void (*ipp_full_bypass
)(struct dpp
*dpp_base
);
119 void (*set_cursor_attributes
)(
120 struct dpp
*dpp_base
,
121 const struct dc_cursor_attributes
*attr
);
123 void (*set_cursor_position
)(
124 struct dpp
*dpp_base
,
125 const struct dc_cursor_position
*pos
,
126 const struct dc_cursor_mi_param
*param
,