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

Commit 2170450d authored by Guchun Chen's avatar Guchun Chen
Browse files

msm: sde: add early display handoff feature



When enabling animation/static splash in LK, drm/kms driver needs
to involve handoff code to support smooth transition. In display
driver's probe, it will do following items:
1. Check the status in LK for early splash.
2. Add data bus bandwidth voting in function sde_splash_init.
2. Handle SMMU mapping issue to avoid SMMU fault problem.
3. Bypass hardware reset to avoid glitch.

And after user's space is up, when first commit's vblank comes,
it will call functions to:
1. Tell LK to stop static/animation display and to exit.
2. Set early_domain_map_attr to 1 to enable stage 1 translation in
   iommu driver.
3. Check the property of commit.If it's for HDMI, release HDMI
resource. If for DSI, release DSI resource.
4. Recycle the memory to be available to system.
5. Withdraw the bus bandwidth voting.

Change-Id: If425f044e2c40301eed57375a33a26ec1970abd5
Signed-off-by: default avatarGuchun Chen <guchunc@codeaurora.org>
parent f4ae45e8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ Qualcomm Technologies,Inc. Adreno/Snapdragon display controller
Required properties:

Optional properties:
- contiguous-region: reserved memory for HDMI and DSI buffer.
- qcom,sde-plane-id-map: plane id mapping for virtual plane.
- qcom,sde-plane-id: each virtual plane mapping node.
- reg: reg property.
@@ -17,6 +18,8 @@ Optional properties:
Example:

&mdss_mdp {
	contiguous-region = <&cont_splash_mem &cont_splash_mem_hdmi>;

	qcom,sde-plane-id-map {
		qcom,sde-plane-id@0 {
			reg = <0x0>;
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ msm_drm-y := \
	sde/sde_backlight.o \
	sde/sde_color_processing.o \
	sde/sde_vbif.o \
	sde/sde_splash.o \
	sde_dbg_evtlog.o \
	sde_io_util.o \
	dba_bridge.o \
+26 −3
Original line number Diff line number Diff line
@@ -1254,6 +1254,13 @@ static int _sde_hdmi_hpd_enable(struct sde_hdmi *sde_hdmi)
	uint32_t hpd_ctrl;
	int i, ret;
	unsigned long flags;
	struct drm_connector *connector;
	struct msm_drm_private *priv;
	struct sde_kms *sde_kms;

	connector = hdmi->connector;
	priv = connector->dev->dev_private;
	sde_kms = to_sde_kms(priv->kms);

	for (i = 0; i < config->hpd_reg_cnt; i++) {
		ret = regulator_enable(hdmi->hpd_regs[i]);
@@ -1293,9 +1300,11 @@ static int _sde_hdmi_hpd_enable(struct sde_hdmi *sde_hdmi)
		}
	}

	if (!sde_kms->splash_info.handoff) {
		sde_hdmi_set_mode(hdmi, false);
		_sde_hdmi_phy_reset(hdmi);
		sde_hdmi_set_mode(hdmi, true);
	}

	hdmi_write(hdmi, REG_HDMI_USEC_REFTIMER, 0x0001001b);

@@ -2822,6 +2831,7 @@ int sde_hdmi_drm_init(struct sde_hdmi *display, struct drm_encoder *enc)
	struct msm_drm_private *priv = NULL;
	struct hdmi *hdmi;
	struct platform_device *pdev;
	struct sde_kms *sde_kms;

	DBG("");
	if (!display || !display->drm_dev || !enc) {
@@ -2880,6 +2890,19 @@ int sde_hdmi_drm_init(struct sde_hdmi *display, struct drm_encoder *enc)
	enc->bridge = hdmi->bridge;
	priv->bridges[priv->num_bridges++] = hdmi->bridge;

	/*
	 * After initialising HDMI bridge, we need to check
	 * whether the early display is enabled for HDMI.
	 * If yes, we need to increase refcount of hdmi power
	 * clocks. This can skip the clock disabling operation in
	 * clock_late_init when finding clk.count == 1.
	 */
	sde_kms = to_sde_kms(priv->kms);
	if (sde_kms->splash_info.handoff) {
		sde_hdmi_bridge_power_on(hdmi->bridge);
		hdmi->power_on = true;
	}

	mutex_unlock(&display->display_lock);
	return 0;

+7 −0
Original line number Diff line number Diff line
@@ -345,6 +345,13 @@ int sde_hdmi_set_property(struct drm_connector *connector,
			int property_index,
			uint64_t value,
			void *display);
/**
 * sde_hdmi_bridge_power_on -- A wrapper of _sde_hdmi_bridge_power_on.
 * @bridge:          Handle to the drm bridge.
 *
 * Return: void.
 */
void sde_hdmi_bridge_power_on(struct drm_bridge *bridge);

/**
 * sde_hdmi_get_property() - get the connector properties
+5 −0
Original line number Diff line number Diff line
@@ -736,6 +736,11 @@ static void _sde_hdmi_bridge_mode_set(struct drm_bridge *bridge,
	_sde_hdmi_bridge_setup_scrambler(hdmi, mode);
}

void sde_hdmi_bridge_power_on(struct drm_bridge *bridge)
{
	_sde_hdmi_bridge_power_on(bridge);
}

static const struct drm_bridge_funcs _sde_hdmi_bridge_funcs = {
		.pre_enable = _sde_hdmi_bridge_pre_enable,
		.enable = _sde_hdmi_bridge_enable,
Loading