Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2017 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 #ifndef __DAL_IPP_H__
0027 #define __DAL_IPP_H__
0028 
0029 #include "hw_shared.h"
0030 #include "dc_hw_types.h"
0031 
0032 #define MAXTRIX_COEFFICIENTS_NUMBER 12
0033 #define MAXTRIX_COEFFICIENTS_WRAP_NUMBER (MAXTRIX_COEFFICIENTS_NUMBER + 4)
0034 #define MAX_OVL_MATRIX_COUNT 12
0035 
0036 /* IPP RELATED */
0037 struct input_pixel_processor {
0038     struct  dc_context *ctx;
0039     unsigned int inst;
0040     const struct ipp_funcs *funcs;
0041 };
0042 
0043 enum ipp_prescale_mode {
0044     IPP_PRESCALE_MODE_BYPASS,
0045     IPP_PRESCALE_MODE_FIXED_SIGNED,
0046     IPP_PRESCALE_MODE_FLOAT_SIGNED,
0047     IPP_PRESCALE_MODE_FIXED_UNSIGNED,
0048     IPP_PRESCALE_MODE_FLOAT_UNSIGNED
0049 };
0050 
0051 struct ipp_prescale_params {
0052     enum ipp_prescale_mode mode;
0053     uint16_t bias;
0054     uint16_t scale;
0055 };
0056 
0057 
0058 
0059 enum ovl_color_space {
0060     OVL_COLOR_SPACE_UNKNOWN = 0,
0061     OVL_COLOR_SPACE_RGB,
0062     OVL_COLOR_SPACE_YUV601,
0063     OVL_COLOR_SPACE_YUV709
0064 };
0065 
0066 
0067 struct ipp_funcs {
0068 
0069     /*** cursor ***/
0070     void (*ipp_cursor_set_position)(
0071         struct input_pixel_processor *ipp,
0072         const struct dc_cursor_position *position,
0073         const struct dc_cursor_mi_param *param);
0074 
0075     void (*ipp_cursor_set_attributes)(
0076         struct input_pixel_processor *ipp,
0077         const struct dc_cursor_attributes *attributes);
0078 
0079     /*** setup input pixel processing ***/
0080 
0081     /* put the entire pixel processor to bypass */
0082     void (*ipp_full_bypass)(
0083             struct input_pixel_processor *ipp);
0084 
0085     /* setup ipp to expand/convert input to pixel processor internal format */
0086     void (*ipp_setup)(
0087         struct input_pixel_processor *ipp,
0088         enum surface_pixel_format format,
0089         enum expansion_mode mode,
0090         struct dc_csc_transform input_csc_color_matrix,
0091         enum dc_color_space input_color_space);
0092 
0093     /* DCE function to setup IPP.  TODO: see if we can consolidate to setup */
0094     void (*ipp_program_prescale)(
0095             struct input_pixel_processor *ipp,
0096             struct ipp_prescale_params *params);
0097 
0098     void (*ipp_program_input_lut)(
0099             struct input_pixel_processor *ipp,
0100             const struct dc_gamma *gamma);
0101 
0102     /*** DEGAMMA RELATED ***/
0103     void (*ipp_set_degamma)(
0104         struct input_pixel_processor *ipp,
0105         enum ipp_degamma_mode mode);
0106 
0107     void (*ipp_program_degamma_pwl)(
0108         struct input_pixel_processor *ipp,
0109         const struct pwl_params *params);
0110 
0111     void (*ipp_destroy)(struct input_pixel_processor **ipp);
0112 };
0113 
0114 #endif /* __DAL_IPP_H__ */