1 /* Copyright 2012-17 Advanced Micro Devices, Inc. 2 * 3 * Permission is hereby granted, free of charge, to any person obtaining a 4 * copy of this software and associated documentation files (the "Software"), 5 * to deal in the Software without restriction, including without limitation 6 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 * and/or sell copies of the Software, and to permit persons to whom the 8 * Software is furnished to do so, subject to the following conditions: 9 * 10 * The above copyright notice and this permission notice shall be included in 11 * all copies or substantial portions of the Software. 12 * 13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 17 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 18 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 19 * OTHER DEALINGS IN THE SOFTWARE. 20 * 21 * Authors: AMD 22 * 23 */ 24 25 #ifndef __DC_MCIF_WB_H__ 26 #define __DC_MCIF_WB_H__ 27 28 #include "dc_hw_types.h" 29 30 31 enum mmhubbub_wbif_mode { 32 PACKED_444 = 0, 33 PACKED_444_FP16 = 1, 34 PLANAR_420_8BPC = 2, 35 PLANAR_420_10BPC = 3 36 }; 37 38 struct mcif_arb_params { 39 40 unsigned int time_per_pixel; 41 unsigned int cli_watermark[4]; 42 unsigned int pstate_watermark[4]; 43 unsigned int arbitration_slice; 44 unsigned int slice_lines; 45 unsigned int max_scaled_time; 46 }; 47 48 struct mcif_irq_params { 49 unsigned int sw_int_en; 50 unsigned int sw_slice_int_en; 51 unsigned int sw_overrun_int_en; 52 unsigned int vce_int_en; 53 unsigned int vce_slice_int_en; 54 }; 55 56 57 /* / - mcif_wb_frame_dump_info is the info of the dumping WB data */ 58 struct mcif_wb_frame_dump_info { 59 unsigned int size; 60 unsigned int width; 61 unsigned int height; 62 unsigned int luma_pitch; 63 unsigned int chroma_pitch; 64 enum dwb_scaler_mode format; 65 }; 66 67 struct mcif_wb { 68 const struct mcif_wb_funcs *funcs; 69 struct dc_context *ctx; 70 int inst; 71 }; 72 73 struct mcif_wb_funcs { 74 75 void (*enable_mcif)(struct mcif_wb *mcif_wb); 76 77 void (*disable_mcif)(struct mcif_wb *mcif_wb); 78 79 void (*config_mcif_buf)( 80 struct mcif_wb *mcif_wb, 81 struct mcif_buf_params *params, 82 unsigned int dest_height); 83 84 void (*config_mcif_arb)( 85 struct mcif_wb *mcif_wb, 86 struct mcif_arb_params *params); 87 88 void (*config_mcif_irq)( 89 struct mcif_wb *mcif_wb, 90 struct mcif_irq_params *params); 91 92 void (*dump_frame)( 93 struct mcif_wb *mcif_wb, 94 struct mcif_buf_params *mcif_params, 95 enum dwb_scaler_mode out_format, 96 unsigned int dest_width, 97 unsigned int dest_height, 98 struct mcif_wb_frame_dump_info *dump_info, 99 unsigned char *luma_buffer, 100 unsigned char *chroma_buffer, 101 unsigned char *dest_luma_buffer, 102 unsigned char *dest_chroma_buffer); 103 }; 104 105 #endif 106