/* * Copyright 2016 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: AMD * */ #include "dc.h" #include "reg_helper.h" #include "dcn10/dcn10_dpp.h" #include "dcn10_cm_common.h" #include "custom_float.h" #define REG(reg) … #define CTX … #undef FN #define FN(reg_name, field_name) … void cm_helper_program_color_matrices( struct dc_context *ctx, const uint16_t *regval, const struct color_matrices_reg *reg) { … } void cm_helper_read_color_matrices(struct dc_context *ctx, uint16_t *regval, const struct color_matrices_reg *reg) { … } void cm_helper_program_xfer_func( struct dc_context *ctx, const struct pwl_params *params, const struct xfer_func_reg *reg) { … } bool cm_helper_convert_to_custom_float( struct pwl_result_data *rgb_resulted, struct curve_points3 *corner_points, uint32_t hw_points_num, bool fixpoint) { … } /* driver uses 32 regions or less, but DCN HW has 34, extra 2 are set to 0 */ #define MAX_REGIONS_NUMBER … #define MAX_LOW_POINT … #define NUMBER_REGIONS … #define NUMBER_SW_SEGMENTS … #define DC_LOGGER … bool cm_helper_translate_curve_to_hw_format(struct dc_context *ctx, const struct dc_transfer_func *output_tf, struct pwl_params *lut_params, bool fixpoint) { … } #define NUM_DEGAMMA_REGIONS … bool cm_helper_translate_curve_to_degamma_hw_format( const struct dc_transfer_func *output_tf, struct pwl_params *lut_params) { … }