Back to home page

OSCL-LXR

 
 

    


0001 /* Copyright 2012-17 Advanced Micro Devices, Inc.
0002  *
0003  * Permission is hereby granted, free of charge, to any person obtaining a
0004  * copy of this software and associated documentation files (the "Software"),
0005  * to deal in the Software without restriction, including without limitation
0006  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0007  * and/or sell copies of the Software, and to permit persons to whom the
0008  * Software is furnished to do so, subject to the following conditions:
0009  *
0010  * The above copyright notice and this permission notice shall be included in
0011  * all copies or substantial portions of the Software.
0012  *
0013  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0014  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0015  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0016  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0017  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0018  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0019  * OTHER DEALINGS IN THE SOFTWARE.
0020  *
0021  * Authors: AMD
0022  *
0023  */
0024 
0025 #ifndef __DC_MCIF_WB_H__
0026 #define __DC_MCIF_WB_H__
0027 
0028 #include "dc_hw_types.h"
0029 
0030 
0031 enum mmhubbub_wbif_mode {
0032     PACKED_444 = 0,
0033     PACKED_444_FP16 = 1,
0034     PLANAR_420_8BPC = 2,
0035     PLANAR_420_10BPC = 3
0036 };
0037 
0038 struct mcif_arb_params {
0039 
0040     unsigned int        time_per_pixel;
0041     unsigned int        cli_watermark[4];
0042     unsigned int        pstate_watermark[4];
0043     unsigned int        arbitration_slice;
0044     unsigned int        slice_lines;
0045     unsigned int        max_scaled_time;
0046     unsigned int        dram_speed_change_duration;
0047 };
0048 
0049 struct mcif_irq_params {
0050     unsigned int        sw_int_en;
0051     unsigned int        sw_slice_int_en;
0052     unsigned int        sw_overrun_int_en;
0053     unsigned int        vce_int_en;
0054     unsigned int        vce_slice_int_en;
0055 };
0056 
0057 
0058 /* / - mcif_wb_frame_dump_info is the info of the dumping WB data */
0059 struct mcif_wb_frame_dump_info {
0060     unsigned int        size;
0061     unsigned int        width;
0062     unsigned int        height;
0063     unsigned int        luma_pitch;
0064     unsigned int        chroma_pitch;
0065     enum dwb_scaler_mode    format;
0066 };
0067 
0068 struct mcif_wb {
0069     const struct mcif_wb_funcs *funcs;
0070     struct dc_context *ctx;
0071     int inst;
0072 };
0073 
0074 struct mcif_wb_funcs {
0075 
0076     void (*warmup_mcif)(
0077         struct mcif_wb *mcif_wb,
0078         struct mcif_warmup_params *params);
0079     void (*enable_mcif)(struct mcif_wb *mcif_wb);
0080 
0081     void (*disable_mcif)(struct mcif_wb *mcif_wb);
0082 
0083     void (*config_mcif_buf)(
0084         struct mcif_wb *mcif_wb,
0085         struct mcif_buf_params *params,
0086         unsigned int dest_height);
0087 
0088      void (*config_mcif_arb)(
0089         struct mcif_wb *mcif_wb,
0090         struct mcif_arb_params *params);
0091 
0092      void (*config_mcif_irq)(
0093         struct mcif_wb *mcif_wb,
0094         struct mcif_irq_params *params);
0095 
0096     void (*dump_frame)(
0097         struct mcif_wb *mcif_wb,
0098         struct mcif_buf_params *mcif_params,
0099         enum dwb_scaler_mode out_format,
0100         unsigned int dest_width,
0101         unsigned int dest_height,
0102         struct mcif_wb_frame_dump_info *dump_info,
0103         unsigned char *luma_buffer,
0104         unsigned char *chroma_buffer,
0105         unsigned char *dest_luma_buffer,
0106         unsigned char *dest_chroma_buffer);
0107 };
0108 
0109 #endif