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

Commit 947f0ec3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "DRM: SDE: Update Color API implementation"

parents 318dc882 5db86ecc
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -247,7 +247,19 @@ Optional properties:
				applied in scenarios where panel interface can
				be more tolerant to memory latency such as
				command mode panels.
- qcom,sde-mixer-display-pref: A string array indicating the preferred display type
				for the mixer block. Possible values:
				"primary" - preferred for primary display
				"secondary" - preferred for secondary display
				"tertiary" - preferred for tertiary display
				"none" - no preference for 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
				"secondary" - preferred for secondary display
				"tertiary" - preferred for tertiary display
				"none" - no preference for display
Bus Scaling Subnodes:
- qcom,sde-reg-bus:		Property to provide Bus scaling for register access for
				mdss blocks.
+8 −29
Original line number Diff line number Diff line
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016, 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 as published by
@@ -78,7 +78,7 @@ enum {
	SDE_CP_CRTC_DSPP_IGC,
	SDE_CP_CRTC_DSPP_PCC,
	SDE_CP_CRTC_DSPP_GC,
	SDE_CP_CRTC_DSPP_HUE,
	SDE_CP_CRTC_DSPP_HSIC,
	SDE_CP_CRTC_DSPP_SAT,
	SDE_CP_CRTC_DSPP_VAL,
	SDE_CP_CRTC_DSPP_CONT,
@@ -484,33 +484,12 @@ static void sde_cp_crtc_setfeature(struct sde_cp_node *prop_node,
			}
			hw_dspp->ops.setup_gc(hw_dspp, &hw_cfg);
			break;
		case SDE_CP_CRTC_DSPP_HUE:
			if (!hw_dspp || !hw_dspp->ops.setup_hue) {
		case SDE_CP_CRTC_DSPP_HSIC:
			if (!hw_dspp || !hw_dspp->ops.setup_pa_hsic) {
				ret = -EINVAL;
				continue;
			}
			hw_dspp->ops.setup_hue(hw_dspp, &hw_cfg);
			break;
		case SDE_CP_CRTC_DSPP_SAT:
			if (!hw_dspp || !hw_dspp->ops.setup_sat) {
				ret = -EINVAL;
				continue;
			}
			hw_dspp->ops.setup_sat(hw_dspp, &hw_cfg);
			break;
		case SDE_CP_CRTC_DSPP_VAL:
			if (!hw_dspp || !hw_dspp->ops.setup_val) {
				ret = -EINVAL;
				continue;
			}
			hw_dspp->ops.setup_val(hw_dspp, &hw_cfg);
			break;
		case SDE_CP_CRTC_DSPP_CONT:
			if (!hw_dspp || !hw_dspp->ops.setup_cont) {
				ret = -EINVAL;
				continue;
			}
			hw_dspp->ops.setup_cont(hw_dspp, &hw_cfg);
			hw_dspp->ops.setup_pa_hsic(hw_dspp, &hw_cfg);
			break;
		case SDE_CP_CRTC_DSPP_MEMCOLOR:
			if (!hw_dspp || !hw_dspp->ops.setup_pa_memcolor)
@@ -907,9 +886,9 @@ static void dspp_hsic_install_property(struct drm_crtc *crtc)
	switch (version) {
	case 1:
		snprintf(feature_name, ARRAY_SIZE(feature_name), "%s%d",
			"SDE_DSPP_HUE_V", version);
		sde_cp_crtc_install_range_property(crtc, feature_name,
			SDE_CP_CRTC_DSPP_HUE, 0, U32_MAX, 0);
			"SDE_DSPP_PA_HSIC_V", version);
		sde_cp_crtc_create_blob_property(crtc, feature_name,
			SDE_CP_CRTC_DSPP_HSIC);
		break;
	default:
		DRM_ERROR("version %d not supported\n", version);
+6 −6
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ struct sde_connector {
 * Returns: Pointer to associated private display structure
 */
#define sde_connector_get_display(C) \
	((C) ? to_sde_connector((C))->display : 0)
	((C) ? to_sde_connector((C))->display : NULL)

/**
 * sde_connector_get_panel - get sde connector's private panel pointer
@@ -241,7 +241,7 @@ struct sde_connector {
 * Returns: Pointer to associated private display structure
 */
#define sde_connector_get_panel(C) \
	((C) ? to_sde_connector((C))->panel : 0)
	((C) ? to_sde_connector((C))->panel : NULL)

/**
 * sde_connector_get_encoder - get sde connector's private encoder pointer
@@ -249,7 +249,7 @@ struct sde_connector {
 * Returns: Pointer to associated private encoder structure
 */
#define sde_connector_get_encoder(C) \
	((C) ? to_sde_connector((C))->encoder : 0)
	((C) ? to_sde_connector((C))->encoder : NULL)

/**
 * sde_connector_get_propinfo - get sde connector's property info pointer
@@ -257,7 +257,7 @@ struct sde_connector {
 * Returns: Pointer to associated private property info structure
 */
#define sde_connector_get_propinfo(C) \
	((C) ? &to_sde_connector((C))->property_info : 0)
	((C) ? &to_sde_connector((C))->property_info : NULL)

/**
 * struct sde_connector_state - private connector status structure
@@ -300,7 +300,7 @@ struct sde_connector_state {
 * Returns: Integer value of requested property
 */
#define sde_connector_get_property_values(S) \
	((S) ? (to_sde_connector_state((S))->property_values) : 0)
	((S) ? (to_sde_connector_state((S))->property_values) : NULL)

/**
 * sde_connector_get_out_fb - query out_fb value from sde connector state
@@ -308,7 +308,7 @@ struct sde_connector_state {
 * Returns: Output fb associated with specified connector state
 */
#define sde_connector_get_out_fb(S) \
	((S) ? to_sde_connector_state((S))->out_fb : 0)
	((S) ? to_sde_connector_state((S))->out_fb : NULL)

/**
 * sde_connector_get_topology_name - helper accessor to retrieve topology_name
+32 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@
enum {
	HW_OFF,
	HW_LEN,
	HW_DISP,
	HW_PROP_MAX,
};

@@ -201,6 +202,7 @@ enum {
	MIXER_OFF,
	MIXER_LEN,
	MIXER_BLOCKS,
	MIXER_DISP,
	MIXER_PROP_MAX,
};

@@ -320,12 +322,15 @@ 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},
};

static struct sde_prop_type mixer_prop[] = {
	{MIXER_OFF, "qcom,sde-mixer-off", true, PROP_TYPE_U32_ARRAY},
	{MIXER_LEN, "qcom,sde-mixer-size", false, PROP_TYPE_U32},
	{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[] = {
@@ -1102,6 +1107,7 @@ 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);
@@ -1109,6 +1115,16 @@ 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) {
			if (!strcmp(disp_pref, "primary"))
				set_bit(SDE_CTL_PRIMARY_PREF, &ctl->features);
			else if (!strcmp(disp_pref, "secondary"))
				set_bit(SDE_CTL_SECONDARY_PREF, &ctl->features);
			else if (!strcmp(disp_pref, "tertiary"))
				set_bit(SDE_CTL_TERTIARY_PREF, &ctl->features);
		}
		if (i < MAX_SPLIT_DISPLAY_CTL)
			set_bit(SDE_CTL_SPLIT_DISPLAY, &ctl->features);
		if (i < MAX_PP_SPLIT_DISPLAY_CTL)
@@ -1187,6 +1203,7 @@ static int sde_mixer_parse_dt(struct device_node *np,
	}

	for (i = 0, pp_idx = 0, dspp_idx = 0; i < off_count; i++) {
		const char *disp_pref = NULL;
		mixer = sde_cfg->mixer + i;
		sblk = kzalloc(sizeof(*sblk), GFP_KERNEL);
		if (!sblk) {
@@ -1216,6 +1233,21 @@ static int sde_mixer_parse_dt(struct device_node *np,
		if (sde_cfg->has_src_split)
			set_bit(SDE_MIXER_SOURCESPLIT, &mixer->features);

		of_property_read_string_index(np,
			mixer_prop[MIXER_DISP].prop_name, i, &disp_pref);

		if (disp_pref) {
			if (!strcmp(disp_pref, "primary"))
				set_bit(SDE_DISP_PRIMARY_PREF,
					&mixer->features);
			else if (!strcmp(disp_pref, "secondary"))
				set_bit(SDE_DISP_SECONDARY_PREF,
					&mixer->features);
			else if (!strcmp(disp_pref, "tertiary"))
				set_bit(SDE_DISP_TERTIARY_PREF,
					&mixer->features);
		}

		if ((i < ROT_LM_OFFSET) || (i >= LINE_LM_OFFSET)) {
			mixer->pingpong = pp_count > 0 ? pp_idx + PINGPONG_0
								: PINGPONG_MAX;
+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
@@ -119,12 +119,18 @@ enum {
 * @SDE_MIXER_LAYER           Layer mixer layer blend configuration,
 * @SDE_MIXER_SOURCESPLIT     Layer mixer supports source-split configuration
 * @SDE_MIXER_GC              Gamma correction block
 * @SDE_DISP_PRIMARY_PREF     Primary display prefers this mixer
 * @SDE_DISP_SECONDARY_PREF   Secondary display prefers this mixer
 * @SDE_DISP_TERTIARY_PREF    Tertiary display prefers this mixer
 * @SDE_MIXER_MAX             maximum value
 */
enum {
	SDE_MIXER_LAYER = 0x1,
	SDE_MIXER_SOURCESPLIT,
	SDE_MIXER_GC,
	SDE_DISP_PRIMARY_PREF,
	SDE_DISP_SECONDARY_PREF,
	SDE_DISP_TERTIARY_PREF,
	SDE_MIXER_MAX
};

@@ -180,11 +186,17 @@ enum {
 * CTL sub-blocks
 * @SDE_CTL_SPLIT_DISPLAY       CTL supports video mode split display
 * @SDE_CTL_PINGPONG_SPLIT      CTL supports pingpong split
 * @SDE_CTL_PRIMARY_PREF        Primary display perfers this CTL
 * @SDE_CTL_SECONDARY_PREF      Secondary display perfers this CTL
 * @SDE_CTL_TERTIARY_PREF       Tertiary display perfers this CTL
 * @SDE_CTL_MAX
 */
enum {
	SDE_CTL_SPLIT_DISPLAY = 0x1,
	SDE_CTL_PINGPONG_SPLIT,
	SDE_CTL_PRIMARY_PREF,
	SDE_CTL_SECONDARY_PREF,
	SDE_CTL_TERTIARY_PREF,
	SDE_CTL_MAX
};

Loading