// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
*/
/** * _stage_offset(): returns the relative offset of the blend registers * for the stage to be setup * @ctx: mixer ctx contains the mixer to be programmed * @stage: stage index to setup
*/ staticinlineint _stage_offset(struct dpu_hw_mixer *ctx, enum dpu_stage stage)
{ conststruct dpu_lm_sub_blks *sblk = ctx->cap->sblk; if (stage != DPU_STAGE_BASE && stage <= sblk->maxblendstages) return sblk->blendstage_base[stage - DPU_STAGE_0];
stages = ctx->cap->sblk->maxblendstages; if (stages <= 0) return;
for (i = DPU_STAGE_0; i <= stages; i++) {
stage_off = _stage_offset(ctx, i); if (WARN_ON(stage_off < 0)) return;
/* set color_out3 bit in blend0_op when enabled in mixer_op_mode */
op_mode = DPU_REG_READ(c, LM_BLEND0_OP + stage_off); if (mixer_op_mode & BIT(i))
op_mode |= BIT(30); else
op_mode &= ~BIT(30);
stages = ctx->cap->sblk->maxblendstages; if (stages <= 0) return -EINVAL;
if (test_bit(DPU_MIXER_SOURCESPLIT, &ctx->cap->features))
pipes_per_stage = PIPES_PER_STAGE; else
pipes_per_stage = 1;
/* * When stage configuration is empty, we can enable the * border color by setting the corresponding LAYER_ACTIVE bit * and un-staging all the pipes from the layer mixer.
*/ if (!stage_cfg)
DPU_REG_WRITE(c, LM_BG_SRC_SEL_V12, LM_BG_SRC_SEL_V12_RESET_VALUE);
for (i = DPU_STAGE_0; i <= stages; i++) {
stage_off = _stage_offset(ctx, i); if (stage_off < 0) return stage_off;
ret = _set_staged_sspp(i, stage_cfg, pipes_per_stage, &value); if (ret) return ret;
/** * dpu_hw_lm_init() - Initializes the mixer hw driver object. * should be called once before accessing every mixer. * @dev: Corresponding device for devres management * @cfg: mixer catalog entry for which driver object is required * @addr: mapped register io address of MDP * @mdss_ver: DPU core's major and minor versions
*/ struct dpu_hw_mixer *dpu_hw_lm_init(struct drm_device *dev, conststruct dpu_lm_cfg *cfg, void __iomem *addr, conststruct dpu_mdss_version *mdss_ver)
{ struct dpu_hw_mixer *c;
if (cfg->pingpong == PINGPONG_NONE) {
DPU_DEBUG("skip mixer %d without pingpong\n", cfg->id); return NULL;
}
c = drmm_kzalloc(dev, sizeof(*c), GFP_KERNEL); if (!c) return ERR_PTR(-ENOMEM);
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.