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

Commit 45af4566 authored by Prabhanjan Kandula's avatar Prabhanjan Kandula
Browse files

disp: msm: dsi: add support for spr enable from panel config



This change parses SPR enable entry from panel device tree and
populates SPR specific information in panel data structure.
Valid entry of SPR pack type is treated as panel requirement
to enable SPR for specified pack type from source end. This change
also populate connector capabilities blob with SPR pack type.

Change-Id: I9d9ab8a990476fba281e12890bf3f7b17a174d79
Signed-off-by: default avatarPrabhanjan Kandula <pkandula@codeaurora.org>
parent 89a141df
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -650,6 +650,10 @@ int dsi_conn_set_info_blob(struct drm_connector *connector,
		break;
	}

	if (panel->spr_info.enable)
		sde_kms_info_add_keystr(info, "spr_pack_type",
			msm_spr_pack_type_str[panel->spr_info.pack_type]);

	if (mode_info && mode_info->roi_caps.enabled) {
		sde_kms_info_add_keyint(info, "partial_update_num_roi",
				mode_info->roi_caps.num_roi);
+25 −0
Original line number Diff line number Diff line
@@ -1860,6 +1860,8 @@ static int dsi_panel_parse_reset_sequence(struct dsi_panel *panel)
static int dsi_panel_parse_misc_features(struct dsi_panel *panel)
{
	struct dsi_parser_utils *utils = &panel->utils;
	const char *string;
	int i, rc = 0;

	panel->ulps_feature_enabled =
		utils->read_bool(utils->data, "qcom,ulps-enabled");
@@ -1881,6 +1883,29 @@ static int dsi_panel_parse_misc_features(struct dsi_panel *panel)

	panel->lp11_init = utils->read_bool(utils->data,
			"qcom,mdss-dsi-lp11-init");

	panel->spr_info.enable = false;
	panel->spr_info.pack_type = MSM_DISPLAY_SPR_TYPE_MAX;

	rc = utils->read_string(utils->data, "qcom,spr-pack-type", &string);
	if (!rc) {
		// find match for pack-type string
		for (i = 0; i < MSM_DISPLAY_SPR_TYPE_MAX; i++) {
			if (msm_spr_pack_type_str[i] &&
				(!strcmp(string, msm_spr_pack_type_str[i]))) {
				panel->spr_info.enable = true;
				panel->spr_info.pack_type = i;
				break;
			}
		}
	}

	pr_debug("%s source side spr packing, pack-type %s\n",
		panel->spr_info.enable ? "enable" : "disable",
		panel->spr_info.enable ?
		msm_spr_pack_type_str[panel->spr_info.pack_type] : "none");


	return 0;
}

+7 −0
Original line number Diff line number Diff line
@@ -155,6 +155,11 @@ struct drm_panel_esd_config {
	u32 groups;
};

struct dsi_panel_spr_info {
	bool enable;
	enum msm_display_spr_pack_type pack_type;
};

struct dsi_panel {
	const char *name;
	const char *type;
@@ -203,6 +208,8 @@ struct dsi_panel {
	char dce_pps_cmd[DSI_CMD_PPS_SIZE];
	enum dsi_dms_mode dms_mode;

	struct dsi_panel_spr_info spr_info;

	bool sync_broadcast_en;

	int panel_test_gpio;
+26 −0
Original line number Diff line number Diff line
@@ -231,6 +231,32 @@ enum msm_display_compression_type {
#define MSM_DISPLAY_COMPRESSION_RATIO_NONE 1
#define MSM_DISPLAY_COMPRESSION_RATIO_MAX 5

/**
 * enum msm_display_spr_pack_type - sub pixel rendering pack patterns supported
 * @MSM_DISPLAY_SPR_TYPE_NONE:	        Bypass, no special packing
 * @MSM_DISPLAY_SPR_TYPE_PENTILE:	pentile pack pattern
 * @MSM_DISPLAY_SPR_TYPE_RGBW:		RGBW pack pattern
 * @MSM_DISPLAY_SPR_TYPE_YYGM:		YYGM pack pattern
 * @MSM_DISPLAY_SPR_TYPE_YYGW:		YYGW pack patterm
 * @MSM_DISPLAY_SPR_TYPE_MAX:		max and invalid
 */
enum msm_display_spr_pack_type {
	MSM_DISPLAY_SPR_TYPE_NONE,
	MSM_DISPLAY_SPR_TYPE_PENTILE,
	MSM_DISPLAY_SPR_TYPE_RGBW,
	MSM_DISPLAY_SPR_TYPE_YYGM,
	MSM_DISPLAY_SPR_TYPE_YYGW,
	MSM_DISPLAY_SPR_TYPE_MAX
};

static const char *msm_spr_pack_type_str[MSM_DISPLAY_SPR_TYPE_MAX] = {
	[MSM_DISPLAY_SPR_TYPE_NONE] = "",
	[MSM_DISPLAY_SPR_TYPE_PENTILE] = "pentile",
	[MSM_DISPLAY_SPR_TYPE_RGBW] = "rgbw",
	[MSM_DISPLAY_SPR_TYPE_YYGM] = "yygm",
	[MSM_DISPLAY_SPR_TYPE_YYGW] = "yygw"
};

/**
 * enum msm_display_caps - features/capabilities supported by displays
 * @MSM_DISPLAY_CAP_VID_MODE:           Video or "active" mode supported