Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 334b114b authored by Abhijit Kulkarni's avatar Abhijit Kulkarni
Browse files

drm/msm/sde: fix issues with the cdm configuration



This change adds support for configuring the pp block id
which will feed the pixels to cdm block in the current
control path configuration. This change addtionally fixes
cdm programming in the interface configuration implementation.

Change-Id: If5491b1cc806d66ef4601cfda7122a0484d123d6
Signed-off-by: default avatarAbhijit Kulkarni <kabhijit@codeaurora.org>
parent 33ba9737
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -165,12 +165,14 @@ void sde_encoder_phys_setup_cdm(struct sde_encoder_phys *phys_enc,
{
	struct sde_hw_cdm *hw_cdm;
	struct sde_hw_cdm_cfg *cdm_cfg;
	struct sde_hw_pingpong *hw_pp;
	int ret;

	if (!phys_enc || !format)
		return;

	cdm_cfg = &phys_enc->cdm_cfg;
	hw_pp = phys_enc->hw_pp;
	hw_cdm = phys_enc->hw_cdm;
	if (!hw_cdm)
		return;
@@ -245,6 +247,11 @@ void sde_encoder_phys_setup_cdm(struct sde_encoder_phys *phys_enc,
		}
	}

	/* setup which pp blk will connect to this cdm */
	if (hw_pp && hw_cdm->ops.bind_pingpong_blk)
		hw_cdm->ops.bind_pingpong_blk(hw_cdm, true,
				hw_pp->idx);

	if (hw_cdm && hw_cdm->ops.enable) {
		ret = hw_cdm->ops.enable(hw_cdm, cdm_cfg);
		if (ret < 0) {
+3 −0
Original line number Diff line number Diff line
@@ -2504,6 +2504,9 @@ static int sde_cdm_parse_dt(struct device_node *np,
		/* intf3 and wb2 for cdm block */
		cdm->wb_connect = sde_cfg->wb_count ? BIT(WB_2) : BIT(31);
		cdm->intf_connect = sde_cfg->intf_count ? BIT(INTF_3) : BIT(31);

		if (IS_SDE_CTL_REV_100(sde_cfg->ctl_rev))
			set_bit(SDE_CDM_INPUT_CTRL, &cdm->features);
	}

end:
+10 −0
Original line number Diff line number Diff line
@@ -336,6 +336,16 @@ enum {
	SDE_WB_MAX
};

/* CDM features
 * @SDE_CDM_INPUT_CTRL     CDM supports from which pp block intput pixel data
 *                         arrives
 * @SDE_CDM_MAX            maximum value
 */
enum {
	SDE_CDM_INPUT_CTRL = 0x1,
	SDE_CDM_MAX
};

/**
 * VBIF sub-blocks and features
 * @SDE_VBIF_QOS_OTLIM        VBIF supports OT Limit
+24 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -37,6 +37,8 @@
#define CDM_HDMI_PACK_OP_MODE              0x200
#define CDM_CSC_10_MATRIX_COEFF_0          0x004

#define CDM_MUX                            0x224

/**
 * Horizontal coefficients for cosite chroma downscale
 * s13 representation of coefficients
@@ -260,6 +262,25 @@ void sde_hw_cdm_disable(struct sde_hw_cdm *ctx)
		ctx->hw_mdp->ops.setup_cdm_output(ctx->hw_mdp, &cdm_cfg);
}

static void sde_hw_cdm_bind_pingpong_blk(
		struct sde_hw_cdm *ctx,
		bool enable,
		const enum sde_pingpong pp)
{
	struct sde_hw_blk_reg_map *c;
	int mux_cfg = 0xF;

	if (!ctx)
		return;

	c = &ctx->hw;
	if (enable)
		mux_cfg = (pp - PINGPONG_0) & 0x7;

	SDE_REG_WRITE(c, CDM_MUX, mux_cfg);
}


static void _setup_cdm_ops(struct sde_hw_cdm_ops *ops,
	unsigned long features)
{
@@ -267,6 +288,8 @@ static void _setup_cdm_ops(struct sde_hw_cdm_ops *ops,
	ops->setup_cdwn = sde_hw_cdm_setup_cdwn;
	ops->enable = sde_hw_cdm_enable;
	ops->disable = sde_hw_cdm_disable;
	if (features & BIT(SDE_CDM_INPUT_CTRL))
		ops->bind_pingpong_blk = sde_hw_cdm_bind_pingpong_blk;
}

static struct sde_hw_blk_ops sde_hw_ops = {
+13 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -57,6 +57,8 @@ enum sde_hw_cdwn_output_bit_depth {
 *  @enable:               Enables the output to interface and programs the
 *                         output packer
 *  @disable:              Puts the cdm in bypass mode
 * @bind_pingpong_blk:    enable/disable the connection with pingpong which
 *                        will feed pixels to this cdm
 */
struct sde_hw_cdm_ops {
	/**
@@ -90,6 +92,16 @@ struct sde_hw_cdm_ops {
	 * @cdm         Pointer to chroma down context
	 */
	void (*disable)(struct sde_hw_cdm *cdm);

	/**
	 * Enable/disable the connection with pingpong
	 * @cdm         Pointer to chroma down context
	 * @enable      Enable/disable control
	 * @pp          pingpong block id.
	 */
	void (*bind_pingpong_blk)(struct sde_hw_cdm *cdm,
			bool enable,
			const enum sde_pingpong pp);
};

struct sde_hw_cdm {
Loading