/* * Copyright 2012-15 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: AMD * */ #include "reg_helper.h" #include "dcn10_mpc.h" #define REG(reg) … #define CTX … #undef FN #define FN(reg_name, field_name) … void mpc1_set_bg_color(struct mpc *mpc, struct tg_color *bg_color, int mpcc_id) { … } static void mpc1_update_blending( struct mpc *mpc, struct mpcc_blnd_cfg *blnd_cfg, int mpcc_id) { … } void mpc1_update_stereo_mix( struct mpc *mpc, struct mpcc_sm_cfg *sm_cfg, int mpcc_id) { … } void mpc1_assert_idle_mpcc(struct mpc *mpc, int id) { … } struct mpcc *mpc1_get_mpcc(struct mpc *mpc, int mpcc_id) { … } struct mpcc *mpc1_get_mpcc_for_dpp(struct mpc_tree *tree, int dpp_id) { … } bool mpc1_is_mpcc_idle(struct mpc *mpc, int mpcc_id) { … } void mpc1_assert_mpcc_idle_before_connect(struct mpc *mpc, int mpcc_id) { … } /* * Insert DPP into MPC tree based on specified blending position. * Only used for planes that are part of blending chain for OPP output * * Parameters: * [in/out] mpc - MPC context. * [in/out] tree - MPC tree structure that plane will be added to. * [in] blnd_cfg - MPCC blending configuration for the new blending layer. * [in] sm_cfg - MPCC stereo mix configuration for the new blending layer. * stereo mix must disable for the very bottom layer of the tree config. * [in] insert_above_mpcc - Insert new plane above this MPCC. If NULL, insert as bottom plane. * [in] dpp_id - DPP instance for the plane to be added. * [in] mpcc_id - The MPCC physical instance to use for blending. * * Return: struct mpcc* - MPCC that was added. */ struct mpcc *mpc1_insert_plane( struct mpc *mpc, struct mpc_tree *tree, struct mpcc_blnd_cfg *blnd_cfg, struct mpcc_sm_cfg *sm_cfg, struct mpcc *insert_above_mpcc, int dpp_id, int mpcc_id) { … } /* * Remove a specified MPCC from the MPC tree. * * Parameters: * [in/out] mpc - MPC context. * [in/out] tree - MPC tree structure that plane will be removed from. * [in/out] mpcc - MPCC to be removed from tree. * * Return: void */ void mpc1_remove_mpcc( struct mpc *mpc, struct mpc_tree *tree, struct mpcc *mpcc_to_remove) { … } static void mpc1_init_mpcc(struct mpcc *mpcc, int mpcc_inst) { … } /* * Reset the MPCC HW status by disconnecting all muxes. * * Parameters: * [in/out] mpc - MPC context. * * Return: void */ void mpc1_mpc_init(struct mpc *mpc) { … } void mpc1_mpc_init_single_inst(struct mpc *mpc, unsigned int mpcc_id) { … } void mpc1_init_mpcc_list_from_hw( struct mpc *mpc, struct mpc_tree *tree) { … } void mpc1_read_mpcc_state( struct mpc *mpc, int mpcc_inst, struct mpcc_state *s) { … } void mpc1_cursor_lock(struct mpc *mpc, int opp_id, bool lock) { … } unsigned int mpc1_get_mpc_out_mux(struct mpc *mpc, int opp_id) { … } static const struct mpc_funcs dcn10_mpc_funcs = …; void dcn10_mpc_construct(struct dcn10_mpc *mpc10, struct dc_context *ctx, const struct dcn_mpc_registers *mpc_regs, const struct dcn_mpc_shift *mpc_shift, const struct dcn_mpc_mask *mpc_mask, int num_mpcc) { … }