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

Commit 2ffbe5f0 authored by Abhijit Kulkarni's avatar Abhijit Kulkarni Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: add mux control for lower pipe blocks



This change adds functionality to explicitly control the input
and output muxing from lower pipe components.  This change add
this feature to dsc, interfaces and the writeback component by
providing additional api to configure the pp block id.

Change-Id: I2cdfaae075cdd931286cdde1965d066e8e8df6fc
Signed-off-by: default avatarSteve Cohen <cohens@codeaurora.org>
Signed-off-by: default avatarAbhijit Kulkarni <kabhijit@codeaurora.org>
parent 530b9f89
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1459,7 +1459,7 @@ static int sde_ctl_parse_dt(struct device_node *np,
			set_bit(SDE_CTL_PINGPONG_SPLIT, &ctl->features);
		if (sde_cfg->has_sbuf)
			set_bit(SDE_CTL_SBUF, &ctl->features);
		if (sde_cfg->ctl_rev == SDE_CTL_CFG_VERSION_1_0_0)
		if (IS_SDE_CTL_REV_100(sde_cfg->ctl_rev))
			set_bit(SDE_CTL_ACTIVE_CFG, &ctl->features);
	}
end:
@@ -1709,6 +1709,8 @@ static int sde_intf_parse_dt(struct device_node *np,

		if (sde_cfg->has_sbuf)
			set_bit(SDE_INTF_ROT_START, &intf->features);
		if (IS_SDE_CTL_REV_100(sde_cfg->ctl_rev))
			set_bit(SDE_INTF_INPUT_CTRL, &intf->features);
	}

end:
@@ -1805,6 +1807,9 @@ static int sde_wb_parse_dt(struct device_node *np, struct sde_mdss_cfg *sde_cfg)

		set_bit(SDE_WB_XY_ROI_OFFSET, &wb->features);

		if (IS_SDE_CTL_REV_100(sde_cfg->ctl_rev))
			set_bit(SDE_WB_INPUT_CTRL, &wb->features);

		for (j = 0; j < sde_cfg->mdp_count; j++) {
			sde_cfg->mdp[j].clk_ctrls[wb->clk_ctrl].reg_off =
				PROP_BITVALUE_ACCESS(prop_value,
@@ -2403,6 +2408,9 @@ static int sde_dsc_parse_dt(struct device_node *np,

		if (!prop_exists[DSC_LEN])
			dsc->len = DEFAULT_SDE_HW_BLOCK_LEN;

		if (IS_SDE_CTL_REV_100(sde_cfg->ctl_rev))
			set_bit(SDE_DSC_OUTPUT_CTRL, &dsc->features);
	}

end:
+18 −1
Original line number Diff line number Diff line
@@ -77,7 +77,8 @@
#define MAX_MERGE_3D_PER_CTL_V1             2
#define MAX_WB_PER_CTL_V1                   1
#define MAX_CDM_PER_CTL_V1                  1

#define IS_SDE_CTL_REV_100(rev) \
	((rev) == SDE_CTL_CFG_VERSION_1_0_0)

/**
 * Supported UBWC feature versions
@@ -232,6 +233,16 @@ enum {
	SDE_PINGPONG_MAX
};

/** DSC sub-blocks
 * @SDE_DSC_OUTPUT_CTRL         Supports the control of the pp id which gets
 *                              the pixel output from this DSC.
 * @SDE_DSC_MAX
 */
enum {
	SDE_DSC_OUTPUT_CTRL = 0x1,
	SDE_DSC_MAX
};

/**
 * CTL sub-blocks
 * @SDE_CTL_SPLIT_DISPLAY       CTL supports video mode split display
@@ -254,10 +265,13 @@ enum {
/**
 * INTF sub-blocks
 * @SDE_INTF_ROT_START          INTF supports rotator start trigger
 * @SDE_INTF_INPUT_CTRL         Supports the setting of pp block from which
 *                              pixel data arrives to this INTF
 * @SDE_INTF_MAX
 */
enum {
	SDE_INTF_ROT_START = 0x1,
	SDE_INTF_INPUT_CTRL,
	SDE_INTF_MAX
};

@@ -280,6 +294,8 @@ enum {
 * @SDE_WB_QOS,             Writeback supports QoS control, danger/safe/creq
 * @SDE_WB_QOS_8LVL,        Writeback supports 8-level QoS control
 * @SDE_WB_CDP              Writeback supports client driven prefetch
 * @SDE_WB_INPUT_CTRL       Writeback supports from which pp block input pixel
 *                          data arrives.
 * @SDE_WB_MAX              maximum value
 */
enum {
@@ -298,6 +314,7 @@ enum {
	SDE_WB_QOS,
	SDE_WB_QOS_8LVL,
	SDE_WB_CDP,
	SDE_WB_INPUT_CTRL,
	SDE_WB_MAX
};

+30 −2
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-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
@@ -38,6 +38,9 @@
#define DSC_RANGE_MAX_QP                0x0B0
#define DSC_RANGE_BPG_OFFSET            0x0EC

#define DSC_CTL(m)     \
	(((m == DSC_NONE) || (m >= DSC_MAX)) ? 0 : (0x1800 - 0x3FC * (m - 1)))

static void sde_hw_dsc_disable(struct sde_hw_dsc *dsc)
{
	struct sde_hw_blk_reg_map *dsc_c = &dsc->hw;
@@ -171,6 +174,29 @@ static void sde_hw_dsc_config_thresh(struct sde_hw_dsc *hw_dsc,
	}
}

static void sde_hw_dsc_bind_pingpong_blk(
		struct sde_hw_dsc *hw_dsc,
		bool enable,
		const enum sde_pingpong pp)
{
	struct sde_hw_blk_reg_map *c;
	int mux_cfg = 0xF;
	u32 dsc_ctl_offset;

	if (!hw_dsc)
		return;

	c = &hw_dsc->hw;
	dsc_ctl_offset = DSC_CTL(hw_dsc->idx);

	if (enable)
		mux_cfg = (pp - PINGPONG_0) & 0x7;

	if (dsc_ctl_offset)
		SDE_REG_WRITE(c, dsc_ctl_offset, mux_cfg);
}


static struct sde_dsc_cfg *_dsc_offset(enum sde_dsc dsc,
		struct sde_mdss_cfg *m,
		void __iomem *addr,
@@ -193,11 +219,13 @@ static struct sde_dsc_cfg *_dsc_offset(enum sde_dsc dsc,
}

static void _setup_dsc_ops(struct sde_hw_dsc_ops *ops,
		unsigned long cap)
		unsigned long features)
{
	ops->dsc_disable = sde_hw_dsc_disable;
	ops->dsc_config = sde_hw_dsc_config;
	ops->dsc_config_thresh = sde_hw_dsc_config_thresh;
	if (test_bit(SDE_DSC_OUTPUT_CTRL, &features))
		ops->bind_pingpong_blk = sde_hw_dsc_bind_pingpong_blk;
};

static struct sde_hw_blk_ops sde_hw_ops = {
+11 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-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
@@ -54,6 +54,16 @@ struct sde_hw_dsc_ops {
	 */
	void (*dsc_config_thresh)(struct sde_hw_dsc *hw_dsc,
			struct msm_display_dsc_info *dsc);

	/**
	 * bind_pingpong_blk - enable/disable the connection with pp
	 * @hw_dsc: Pointer to dsc context
	 * @enable: enable/disable connection
	 * @pp: pingpong blk id
	 */
	void (*bind_pingpong_blk)(struct sde_hw_dsc *hw_dsc,
			bool enable,
			const enum sde_pingpong pp);
};

struct sde_hw_dsc {
+23 −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
@@ -68,6 +68,8 @@
#define INTF_MISR_CTRL			0x180
#define INTF_MISR_SIGNATURE		0x184

#define INTF_MUX                        0x25C

static struct sde_intf_cfg *_intf_offset(enum sde_intf intf,
		struct sde_mdss_cfg *m,
		void __iomem *addr,
@@ -249,6 +251,24 @@ static void sde_hw_intf_setup_rot_start(
	SDE_REG_WRITE(c, INTF_CONFIG, fetch_enable);
}

static void sde_hw_intf_bind_pingpong_blk(
		struct sde_hw_intf *intf,
		bool enable,
		const enum sde_pingpong pp)
{
	struct sde_hw_blk_reg_map *c;
	int mux_cfg = 0xF;

	if (!intf)
		return;

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

	SDE_REG_WRITE(c, INTF_MUX, mux_cfg);
}

static void sde_hw_intf_get_status(
		struct sde_hw_intf *intf,
		struct intf_status *s)
@@ -313,6 +333,8 @@ static void _setup_intf_ops(struct sde_hw_intf_ops *ops,
	ops->get_line_count = sde_hw_intf_get_line_count;
	if (cap & BIT(SDE_INTF_ROT_START))
		ops->setup_rot_start = sde_hw_intf_setup_rot_start;
	if (cap & BIT(SDE_INTF_INPUT_CTRL))
		ops->bind_pingpong_blk = sde_hw_intf_bind_pingpong_blk;
}

static struct sde_hw_blk_ops sde_hw_ops = {
Loading