Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2020 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  * Authors: AMD
0023  *
0024  */
0025 
0026 #include "dcn10/dcn10_cm_common.h"
0027 
0028 #ifndef __DAL_DCN30_CM_COMMON_H__
0029 #define __DAL_DCN30_CM_COMMON_H__
0030 
0031 #define TF_HELPER_REG_FIELD_LIST_DCN3(type) \
0032     TF_HELPER_REG_FIELD_LIST(type);\
0033     type field_region_start_base;\
0034     type field_offset
0035 
0036 struct DCN3_xfer_func_shift {
0037     TF_HELPER_REG_FIELD_LIST_DCN3(uint8_t);
0038 };
0039 
0040 struct DCN3_xfer_func_mask {
0041     TF_HELPER_REG_FIELD_LIST_DCN3(uint32_t);
0042 };
0043 
0044 struct dcn3_xfer_func_reg {
0045     struct DCN3_xfer_func_shift shifts;
0046     struct DCN3_xfer_func_mask masks;
0047 
0048     TF_HELPER_REG_LIST;
0049     uint32_t offset_b;
0050     uint32_t offset_g;
0051     uint32_t offset_r;
0052     uint32_t start_base_cntl_b;
0053     uint32_t start_base_cntl_g;
0054     uint32_t start_base_cntl_r;
0055 };
0056 
0057 void cm_helper_program_gamcor_xfer_func(
0058     struct dc_context *ctx,
0059     const struct pwl_params *params,
0060     const struct dcn3_xfer_func_reg *reg);
0061 
0062 bool cm3_helper_translate_curve_to_hw_format(
0063     const struct dc_transfer_func *output_tf,
0064     struct pwl_params *lut_params, bool fixpoint);
0065 
0066 bool cm3_helper_translate_curve_to_degamma_hw_format(
0067                 const struct dc_transfer_func *output_tf,
0068                 struct pwl_params *lut_params);
0069 
0070 bool cm3_helper_convert_to_custom_float(
0071         struct pwl_result_data *rgb_resulted,
0072         struct curve_points3 *corner_points,
0073         uint32_t hw_points_num,
0074         bool fixpoint);
0075 
0076 bool is_rgb_equal(const struct pwl_result_data *rgb, uint32_t num);
0077 
0078 #endif