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

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

Merge "drm/msm/dsi-staging: Set the dsi panel type"

parents d3acd90b ee8afc1e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -79,6 +79,10 @@ then 3 options can be tried.

Optional properties:
- qcom,mdss-dsi-panel-name:		A string used as a descriptive name of the panel
- qcom,mdss-dsi-physical-type:		A string used as a decriptive type of the panel.
					"oled" : That indicate it's an OLED panel.
					"lcd" : That indicate it's an LCD panel.
					If it is not set, consider it is a LCD panel as default.
- qcom,mdss-dsi-panel-phy-timings:	An array of length 'n' char that specifies the DSI PHY lane
					timing settings for the panel. This is specific to SDE DRM driver.
					The value of 'n' depends on the DSI PHY h/w revision and parsing this
+14 −2
Original line number Diff line number Diff line
@@ -1071,10 +1071,22 @@ int dsi_display_set_power(struct drm_connector *connector,
	case SDE_MODE_DPMS_LP2:
		rc = dsi_panel_set_lp2(display->panel);
		break;
	default:
	case SDE_MODE_DPMS_ON:
		if (display->panel->power_mode == SDE_MODE_DPMS_LP1 ||
			display->panel->power_mode == SDE_MODE_DPMS_LP2)
			rc = dsi_panel_set_nolp(display->panel);
		break;
	case SDE_MODE_DPMS_OFF:
	default:
		return rc;
	}

	pr_debug("Power mode transition from %d to %d %s",
		 display->panel->power_mode, power_mode,
		 rc ? "failed" : "successful");
	if (!rc)
		display->panel->power_mode = power_mode;

	return rc;
}

+11 −0
Original line number Diff line number Diff line
@@ -3131,6 +3131,7 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
{
	struct dsi_panel *panel;
	struct dsi_parser_utils *utils;
	const char *panel_physical_type;
	int rc = 0;

	panel = kzalloc(sizeof(*panel), GFP_KERNEL);
@@ -3149,6 +3150,15 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
	if (!panel->name)
		panel->name = DSI_PANEL_DEFAULT_LABEL;

	/*
	 * Set panel type to LCD as default.
	 */
	panel->panel_type = DSI_DISPLAY_PANEL_TYPE_LCD;
	panel_physical_type  = utils->get_property(utils->data,
				"qcom,mdss-dsi-panel-physical-type", NULL);
	if (panel_physical_type && !strcmp(panel_physical_type, "oled"))
		panel->panel_type = DSI_DISPLAY_PANEL_TYPE_OLED;

	rc = dsi_panel_parse_host_config(panel);
	if (rc) {
		pr_err("failed to parse host configuration, rc=%d\n", rc);
@@ -3221,6 +3231,7 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
	if (rc)
		pr_debug("failed to parse esd config, rc=%d\n", rc);

	panel->power_mode = SDE_MODE_DPMS_OFF;
	drm_panel_init(&panel->drm_panel);
	mutex_init(&panel->panel_lock);

+13 −0
Original line number Diff line number Diff line
@@ -71,6 +71,12 @@ enum dsi_dms_mode {
	DSI_DMS_MODE_RES_SWITCH_IMMEDIATE,
};

enum dsi_panel_physical_type {
	DSI_DISPLAY_PANEL_TYPE_LCD = 0,
	DSI_DISPLAY_PANEL_TYPE_OLED,
	DSI_DISPLAY_PANEL_TYPE_MAX,
};

struct dsi_dfps_capabilities {
	enum dsi_dfps_type type;
	u32 min_refresh_rate;
@@ -203,6 +209,8 @@ struct dsi_panel {
	enum dsi_dms_mode dms_mode;

	bool sync_broadcast_en;
	int power_mode;
	enum dsi_panel_physical_type panel_type;
};

static inline bool dsi_panel_ulps_feature_enabled(struct dsi_panel *panel)
@@ -225,6 +233,11 @@ static inline void dsi_panel_release_panel_lock(struct dsi_panel *panel)
	mutex_unlock(&panel->panel_lock);
}

static inline bool dsi_panel_is_type_oled(struct dsi_panel *panel)
{
	return (panel->panel_type == DSI_DISPLAY_PANEL_TYPE_OLED);
}

struct dsi_panel *dsi_panel_get(struct device *parent,
				struct device_node *of_node,
				struct device_node *parser_node,