1 /* Copyright 2012-17 Advanced Micro Devices, Inc.
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:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
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.
25 #ifndef __DC_MCIF_WB_H__
26 #define __DC_MCIF_WB_H__
28 #include "dc_hw_types.h"
31 enum mmhubbub_wbif_mode {
38 struct mcif_arb_params {
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 unsigned int dram_speed_change_duration;
49 struct mcif_irq_params {
50 unsigned int sw_int_en;
51 unsigned int sw_slice_int_en;
52 unsigned int sw_overrun_int_en;
53 unsigned int vce_int_en;
54 unsigned int vce_slice_int_en;
58 /* / - mcif_wb_frame_dump_info is the info of the dumping WB data */
59 struct mcif_wb_frame_dump_info {
63 unsigned int luma_pitch;
64 unsigned int chroma_pitch;
65 enum dwb_scaler_mode format;
69 const struct mcif_wb_funcs *funcs;
70 struct dc_context *ctx;
74 struct mcif_wb_funcs {
77 struct mcif_wb *mcif_wb,
78 struct mcif_warmup_params *params);
79 void (*enable_mcif)(struct mcif_wb *mcif_wb);
81 void (*disable_mcif)(struct mcif_wb *mcif_wb);
83 void (*config_mcif_buf)(
84 struct mcif_wb *mcif_wb,
85 struct mcif_buf_params *params,
86 unsigned int dest_height);
88 void (*config_mcif_arb)(
89 struct mcif_wb *mcif_wb,
90 struct mcif_arb_params *params);
92 void (*config_mcif_irq)(
93 struct mcif_wb *mcif_wb,
94 struct mcif_irq_params *params);
97 struct mcif_wb *mcif_wb,
98 struct mcif_buf_params *mcif_params,
99 enum dwb_scaler_mode out_format,
100 unsigned int dest_width,
101 unsigned int dest_height,
102 struct mcif_wb_frame_dump_info *dump_info,
103 unsigned char *luma_buffer,
104 unsigned char *chroma_buffer,
105 unsigned char *dest_luma_buffer,
106 unsigned char *dest_chroma_buffer);