/* * 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 *
*/
/* find bottommost mpcc. */ while (bottommost_mpcc->mpcc_bot) { /* avoid circular linked link */
ASSERT(bottommost_mpcc != bottommost_mpcc->mpcc_bot); if (bottommost_mpcc == bottommost_mpcc->mpcc_bot) break;
bottommost_mpcc = bottommost_mpcc->mpcc_bot;
}
/* mpc color is 12 bit. tg_color is 10 bit */ /* todo: might want to use 16 bit to represent color and have each * hw block translate to correct color depth.
*/
bg_r_cr = bg_color->color_r_cr << 2;
bg_g_y = bg_color->color_g_y << 2;
bg_b_cb = bg_color->color_b_cb << 2;
if (top_sel == 0xf) {
REG_GET_2(MPCC_STATUS[mpcc_id],
MPCC_BUSY, &mpc_busy,
MPCC_IDLE, &mpc_idle);
ASSERT(mpc_busy == 0);
ASSERT(mpc_idle == 1);
}
}
/* * 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)
{ struct dcn10_mpc *mpc10 = TO_DCN10_MPC(mpc); struct mpcc *new_mpcc = NULL;
/* Configure VUPDATE lock set for this MPCC to map to the OPP */
REG_SET(MPCC_UPDATE_LOCK_SEL[mpcc_id], 0, MPCC_UPDATE_LOCK_SEL, tree->opp_id);
/* update mpc tree mux setting */ if (tree->opp_list == insert_above_mpcc) { /* insert the toppest mpcc */
tree->opp_list = new_mpcc;
REG_UPDATE(MUX[tree->opp_id], MPC_OUT_MUX, mpcc_id);
} else { /* find insert position */ struct mpcc *temp_mpcc = tree->opp_list;
while (temp_mpcc && temp_mpcc->mpcc_bot != insert_above_mpcc)
temp_mpcc = temp_mpcc->mpcc_bot; if (temp_mpcc && temp_mpcc->mpcc_bot == insert_above_mpcc) {
REG_SET(MPCC_BOT_SEL[temp_mpcc->mpcc_id], 0, MPCC_BOT_SEL, mpcc_id);
temp_mpcc->mpcc_bot = new_mpcc; if (!insert_above_mpcc)
REG_UPDATE(MPCC_CONTROL[temp_mpcc->mpcc_id],
MPCC_MODE, MPCC_BLEND_MODE_TOP_BOT_BLENDING);
}
}
/* update the blending configuration */
mpc->funcs->update_blending(mpc, blnd_cfg, mpcc_id);
/* update the stereo mix settings, if provided */ if (sm_cfg != NULL) {
new_mpcc->sm_cfg = *sm_cfg;
mpc1_update_stereo_mix(mpc, sm_cfg, mpcc_id);
}
/* mark this mpcc as in use */
mpc10->mpcc_in_use_mask |= 1 << mpcc_id;
return new_mpcc;
}
/* * 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)
{ struct dcn10_mpc *mpc10 = TO_DCN10_MPC(mpc); bool found = false; int mpcc_id = mpcc_to_remove->mpcc_id;
if (tree->opp_list == mpcc_to_remove) {
found = true; /* remove MPCC from top of tree */ if (mpcc_to_remove->mpcc_bot) { /* set the next MPCC in list to be the top MPCC */
tree->opp_list = mpcc_to_remove->mpcc_bot;
REG_UPDATE(MUX[tree->opp_id], MPC_OUT_MUX, tree->opp_list->mpcc_id);
} else { /* there are no other MPCC is list */
tree->opp_list = NULL;
REG_UPDATE(MUX[tree->opp_id], MPC_OUT_MUX, 0xf);
}
} else { /* find mpcc to remove MPCC list */ struct mpcc *temp_mpcc = tree->opp_list;
while (temp_mpcc && temp_mpcc->mpcc_bot != mpcc_to_remove)
temp_mpcc = temp_mpcc->mpcc_bot;
if (temp_mpcc && temp_mpcc->mpcc_bot == mpcc_to_remove) {
found = true;
temp_mpcc->mpcc_bot = mpcc_to_remove->mpcc_bot; if (mpcc_to_remove->mpcc_bot) { /* remove MPCC in middle of list */
REG_SET(MPCC_BOT_SEL[temp_mpcc->mpcc_id], 0,
MPCC_BOT_SEL, mpcc_to_remove->mpcc_bot->mpcc_id);
} else { /* remove MPCC from bottom of list */
REG_SET(MPCC_BOT_SEL[temp_mpcc->mpcc_id], 0,
MPCC_BOT_SEL, 0xf);
REG_UPDATE(MPCC_CONTROL[temp_mpcc->mpcc_id],
MPCC_MODE, MPCC_BLEND_MODE_TOP_LAYER_PASSTHROUGH);
}
}
}
/* mark this mpcc as not in use */
mpc10->mpcc_in_use_mask &= ~(1 << mpcc_id);
mpcc_to_remove->dpp_id = 0xf;
mpcc_to_remove->mpcc_bot = NULL;
} else { /* In case of resume from S3/S4, remove mpcc from bios left over */
REG_SET(MPCC_TOP_SEL[mpcc_id], 0, MPCC_TOP_SEL, 0xf);
REG_SET(MPCC_BOT_SEL[mpcc_id], 0, MPCC_BOT_SEL, 0xf);
REG_SET(MPCC_OPP_ID[mpcc_id], 0, MPCC_OPP_ID, 0xf);
REG_SET(MPCC_UPDATE_LOCK_SEL[mpcc_id], 0, MPCC_UPDATE_LOCK_SEL, 0xf);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.