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

Commit 6f215d4f authored by Jeykumar Sankaran's avatar Jeykumar Sankaran Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: reserve HW resources for primary display



Primary displays are validated with only certain set of HW
resources. As per the validation results, this change
reserves CTL and Layer Mixer blocks for primary display through
device tree bindings. Also, since we are not supporting dynamic
transition of DSC block bindings across displays, the DSC blocks
are hard selected for CTL 0/1 paths. So it is required that any
primary display which selects the DSC topology path must acquire
CTL0/1 paths during SDE RM allocation.

Change-Id: I84911f47908082c276dbc0304d185f6d83b98c75
Signed-off-by: default avatarJeykumar Sankaran <jsanka@codeaurora.org>
parent 32c5f604
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -367,6 +367,14 @@ Optional properties:
				match the number of xin-ids defined in
				property: qcom,sde-inline-rot-xin
- #power-domain-cells:		Number of cells in a power-domain specifier and should contain 0.
- qcom,sde-mixer-display-pref:  A string array indicating the preferred display type
				for the mixer block. Possible values:
				"primary" - preferred for primary display
				"none" - no preference on display
- qcom,sde-ctl-display-pref:    A string array indicating the preferred display type
                                for the ctl block. Possible values:
				"primary" - preferred for primary display
				"none" - no preference on display

Bus Scaling Subnodes:
- qcom,sde-reg-bus:		Property to provide Bus scaling for register access for
@@ -452,8 +460,12 @@ Example:
    qcom,sde-off = <0x1000>;
    qcom,sde-ctl-off = <0x00002000 0x00002200 0x00002400
		     0x00002600 0x00002800>;
    qcom,sde-ctl-display-pref = "primary", "none", "none",
	             "none", "none";
    qcom,sde-mixer-off = <0x00045000 0x00046000
			0x00047000 0x0004a000>;
    qcom,sde-mixer-display-pref = "primary", "none",
	                "none", "none";
    qcom,sde-dspp-top-off = <0x1300>;
    qcom,sde-dspp-off = <0x00055000 0x00057000>;
    qcom,sde-dspp-ad-off = <0x24000 0x22800>;
+1 −0
Original line number Diff line number Diff line
@@ -559,6 +559,7 @@ void sde_encoder_get_hw_resources(struct drm_encoder *drm_enc,
	}

	hw_res->topology = sde_enc->mode_info.topology;
	hw_res->is_primary = sde_enc->disp_info.is_primary;
}

void sde_encoder_destroy(struct drm_encoder *drm_enc)
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
 * @needs_cdm:	Encoder requests a CDM based on pixel format conversion needs
 * @display_num_of_h_tiles: Number of horizontal tiles in case of split
 *                          interface
 * @is_primary: set to true if the display is primary display
 * @topology:   Topology of the display
 */
struct sde_encoder_hw_resources {
@@ -47,6 +48,7 @@ struct sde_encoder_hw_resources {
	enum sde_intf_mode wbs[WB_MAX];
	bool needs_cdm;
	u32 display_num_of_h_tiles;
	bool is_primary;
	struct msm_display_topology topology;
};

+30 −18
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@
enum {
	HW_OFF,
	HW_LEN,
	HW_DISP,
	HW_PROP_MAX,
};

@@ -288,6 +289,7 @@ enum {
	MIXER_LEN,
	MIXER_PAIR_MASK,
	MIXER_BLOCKS,
	MIXER_DISP,
	MIXER_PROP_MAX,
};

@@ -475,6 +477,7 @@ static struct sde_prop_type rgb_prop[] = {
static struct sde_prop_type ctl_prop[] = {
	{HW_OFF, "qcom,sde-ctl-off", true, PROP_TYPE_U32_ARRAY},
	{HW_LEN, "qcom,sde-ctl-size", false, PROP_TYPE_U32},
	{HW_DISP, "qcom,sde-ctl-display-pref", false, PROP_TYPE_STRING_ARRAY},
};

struct sde_prop_type mixer_blend_prop[] = {
@@ -488,6 +491,8 @@ static struct sde_prop_type mixer_prop[] = {
	{MIXER_PAIR_MASK, "qcom,sde-mixer-pair-mask", true,
		PROP_TYPE_U32_ARRAY},
	{MIXER_BLOCKS, "qcom,sde-mixer-blocks", false, PROP_TYPE_NODE},
	{MIXER_DISP, "qcom,sde-mixer-display-pref", false,
		PROP_TYPE_STRING_ARRAY},
};

static struct sde_prop_type mixer_blocks_prop[] = {
@@ -1292,6 +1297,8 @@ static int sde_ctl_parse_dt(struct device_node *np,
		goto end;

	for (i = 0; i < off_count; i++) {
		const char *disp_pref = NULL;

		ctl = sde_cfg->ctl + i;
		ctl->base = PROP_VALUE_ACCESS(prop_value, HW_OFF, i);
		ctl->len = PROP_VALUE_ACCESS(prop_value, HW_LEN, 0);
@@ -1299,6 +1306,10 @@ static int sde_ctl_parse_dt(struct device_node *np,
		snprintf(ctl->name, SDE_HW_BLK_NAME_LEN, "ctl_%u",
				ctl->id - CTL_0);

		of_property_read_string_index(np,
				ctl_prop[HW_DISP].prop_name, i, &disp_pref);
		if (disp_pref && !strcmp(disp_pref, "primary"))
			set_bit(SDE_CTL_PRIMARY_PREF, &ctl->features);
		if (i < MAX_SPLIT_DISPLAY_CTL)
			set_bit(SDE_CTL_SPLIT_DISPLAY, &ctl->features);
		if (i < MAX_PP_SPLIT_DISPLAY_CTL)
@@ -1306,7 +1317,6 @@ static int sde_ctl_parse_dt(struct device_node *np,
		if (sde_cfg->has_sbuf)
			set_bit(SDE_CTL_SBUF, &ctl->features);
	}

end:
	kfree(prop_value);
	return rc;
@@ -1399,6 +1409,8 @@ static int sde_mixer_parse_dt(struct device_node *np,

	for (i = 0, mixer_count = 0, pp_idx = 0, dspp_idx = 0,
			ds_idx = 0; i < off_count; i++) {
		const char *disp_pref = NULL;

		mixer_base = PROP_VALUE_ACCESS(prop_value, MIXER_OFF, i);
		if (!mixer_base)
			continue;
@@ -1440,7 +1452,11 @@ static int sde_mixer_parse_dt(struct device_node *np,
		if (sde_cfg->has_dim_layer)
			set_bit(SDE_DIM_LAYER, &mixer->features);

		if ((i < ROT_LM_OFFSET) || (i >= LINE_LM_OFFSET)) {
		of_property_read_string_index(np,
			mixer_prop[MIXER_DISP].prop_name, i, &disp_pref);
		if (disp_pref && !strcmp(disp_pref, "primary"))
			set_bit(SDE_DISP_PRIMARY_PREF, &mixer->features);

		mixer->pingpong = pp_count > 0 ? pp_idx + PINGPONG_0
							: PINGPONG_MAX;
		mixer->dspp = dspp_count > 0 ? dspp_idx + DSPP_0
@@ -1452,11 +1468,7 @@ static int sde_mixer_parse_dt(struct device_node *np,
		pp_idx++;
		dspp_idx++;
		ds_idx++;
		} else {
			mixer->pingpong = PINGPONG_MAX;
			mixer->dspp = DSPP_MAX;
			mixer->ds = DS_MAX;
		}

		mixer_count++;

		sblk->gc.id = SDE_MIXER_GC;
+4 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ enum {
 * @SDE_MIXER_SOURCESPLIT     Layer mixer supports source-split configuration
 * @SDE_MIXER_GC              Gamma correction block
 * @SDE_DIM_LAYER             Layer mixer supports dim layer
 * @SDE_DISP_PRIMARY_PREF     Layer mixer preferred for primary display
 * @SDE_MIXER_MAX             maximum value
 */
enum {
@@ -159,6 +160,7 @@ enum {
	SDE_MIXER_SOURCESPLIT,
	SDE_MIXER_GC,
	SDE_DIM_LAYER,
	SDE_DISP_PRIMARY_PREF,
	SDE_MIXER_MAX
};

@@ -217,12 +219,14 @@ enum {
 * @SDE_CTL_SPLIT_DISPLAY       CTL supports video mode split display
 * @SDE_CTL_PINGPONG_SPLIT      CTL supports pingpong split
 * @SDE_CTL_SBUF                CTL supports inline stream buffer
 * @SDE_CTL_PRIMARY_PREF        CTL preferred for primary display
 * @SDE_CTL_MAX
 */
enum {
	SDE_CTL_SPLIT_DISPLAY = 0x1,
	SDE_CTL_PINGPONG_SPLIT,
	SDE_CTL_SBUF,
	SDE_CTL_PRIMARY_PREF,
	SDE_CTL_MAX
};

Loading