Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2012-15 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 "dm_services.h"
0027 #include "dcn201_opp.h"
0028 #include "reg_helper.h"
0029 
0030 #define REG(reg) \
0031     (oppn201->regs->reg)
0032 
0033 #undef FN
0034 #define FN(reg_name, field_name) \
0035     oppn201->opp_shift->field_name, oppn201->opp_mask->field_name
0036 
0037 #define CTX \
0038     oppn201->base.ctx
0039 
0040 /*****************************************/
0041 /* Constructor, Destructor               */
0042 /*****************************************/
0043 
0044 static struct opp_funcs dcn201_opp_funcs = {
0045         .opp_set_dyn_expansion = opp1_set_dyn_expansion,
0046         .opp_program_fmt = opp1_program_fmt,
0047         .opp_program_bit_depth_reduction = opp1_program_bit_depth_reduction,
0048         .opp_program_stereo = opp1_program_stereo,
0049         .opp_pipe_clock_control = opp1_pipe_clock_control,
0050         .opp_set_disp_pattern_generator = opp2_set_disp_pattern_generator,
0051         .opp_program_dpg_dimensions = opp2_program_dpg_dimensions,
0052         .dpg_is_blanked = opp2_dpg_is_blanked,
0053         .opp_dpg_set_blank_color = opp2_dpg_set_blank_color,
0054         .opp_destroy = opp1_destroy,
0055         .opp_program_left_edge_extra_pixel = opp2_program_left_edge_extra_pixel,
0056 };
0057 
0058 void dcn201_opp_construct(struct dcn201_opp *oppn201,
0059     struct dc_context *ctx,
0060     uint32_t inst,
0061     const struct dcn201_opp_registers *regs,
0062     const struct dcn201_opp_shift *opp_shift,
0063     const struct dcn201_opp_mask *opp_mask)
0064 {
0065     oppn201->base.ctx = ctx;
0066     oppn201->base.inst = inst;
0067     oppn201->base.funcs = &dcn201_opp_funcs;
0068 
0069     oppn201->regs = regs;
0070     oppn201->opp_shift = opp_shift;
0071     oppn201->opp_mask = opp_mask;
0072 }