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

Commit 56d95ba3 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "disp: msm: sde: add support for spr hw block configuration"

parents 0bf10988 8120e65f
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -561,6 +561,38 @@ struct drm_msm_ltm_buffer {
	__u32 status;
};

#define SPR_INIT_PARAM_SIZE_1 4
#define SPR_INIT_PARAM_SIZE_2 5
#define SPR_INIT_PARAM_SIZE_3 16
#define SPR_INIT_PARAM_SIZE_4 24
#define SPR_INIT_PARAM_SIZE_5 32

/**
 * struct drm_msm_spr_init_cfg - SPR initial configuration structure
 *
 */
struct drm_msm_spr_init_cfg {
	__u64 flags;
	__u16 cfg0;
	__u16 cfg1;
	__u16 cfg2;
	__u16 cfg3;
	__u16 cfg4;
	__u16 cfg5;
	__u16 cfg6;
	__u16 cfg7;
	__u16 cfg8;
	__u16 cfg9;
	__u32 cfg10;
	__u16 cfg11[SPR_INIT_PARAM_SIZE_1];
	__u16 cfg12[SPR_INIT_PARAM_SIZE_1];
	__u16 cfg13[SPR_INIT_PARAM_SIZE_1];
	__u16 cfg14[SPR_INIT_PARAM_SIZE_2];
	__u16 cfg15[SPR_INIT_PARAM_SIZE_5];
	int cfg16[SPR_INIT_PARAM_SIZE_3];
	int cfg17[SPR_INIT_PARAM_SIZE_4];
};

/**
 * struct drm_msm_ad4_manual_str_cfg - ad4 manual strength config set
 * by user-space client.
+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
Loading