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

Commit 88acaa31 authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran Committed by Gerrit - the friendly Code Review server
Browse files

disp: msm: sde: reuse cont-splash path for LE VM resource allocation



Add necessary checks during the splash init to check
& execute the splash/ramdump buffer mapping/unmapping
only for the cont-splash use-case. This would help in
reusing the same path for LE VM setup during device assign,
which does not have any splash buffer.

Change-Id: I3ce168c530c7db4b14465efa3fd87889b5f99f5b
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent 68b75aac
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -636,15 +636,22 @@ struct sde_splash_display {
	u8 pipe_cnt;
};

enum sde_handoff_type {
	SDE_SPLASH_HANDOFF,
	SDE_VM_HANDOFF,
};

/**
 * struct sde_splash_data - Struct contains details of continuous splash
 *	for all the displays connected by probe time
 * @type:                Indicates the type of handoff
 * @num_splash_regions:  Indicates number of splash memory regions from dtsi
 * @num_splash_displays: Indicates count of active displays in continuous splash
 * @splash_mem:          Array of all struct sde_splash_mem listed from dtsi
 * @splash_display:      Array of all struct sde_splash_display
 */
struct sde_splash_data {
	enum sde_handoff_type  type;
	u32 num_splash_regions;
	u32 num_splash_displays;
	struct sde_splash_mem splash_mem[MAX_DSI_DISPLAYS];
+14 −8
Original line number Diff line number Diff line
@@ -837,7 +837,7 @@ static int _sde_kms_unmap_all_splash_regions(struct sde_kms *sde_kms)
	int i = 0;
	int ret = 0;

	if (!sde_kms)
	if (!sde_kms || !sde_kms->splash_data.num_splash_regions)
		return -EINVAL;

	for (i = 0; i < sde_kms->splash_data.num_splash_displays; i++) {
@@ -936,13 +936,14 @@ static void sde_kms_commit(struct msm_kms *kms,
	SDE_ATRACE_END("sde_kms_commit");
}

static void _sde_kms_free_splash_region(struct sde_kms *sde_kms,
static void _sde_kms_free_splash_display_data(struct sde_kms *sde_kms,
		struct sde_splash_display *splash_display)
{
	if (!sde_kms || !splash_display ||
			!sde_kms->splash_data.num_splash_displays)
		return;

	if (sde_kms->splash_data.num_splash_regions)
		_sde_kms_splash_mem_put(sde_kms, splash_display->splash);
	sde_kms->splash_data.num_splash_displays--;
	SDE_DEBUG("cont_splash handoff done, remaining:%d\n",
@@ -981,7 +982,7 @@ static void _sde_kms_release_splash_resource(struct sde_kms *sde_kms,
	if (splash_display->cont_splash_enabled) {
		sde_encoder_update_caps_for_cont_splash(splash_display->encoder,
				splash_display, false);
		_sde_kms_free_splash_region(sde_kms, splash_display);
		_sde_kms_free_splash_display_data(sde_kms, splash_display);
	}

	/* remove the votes if all displays are done with splash */
@@ -2289,7 +2290,8 @@ static int sde_kms_cont_splash_config(struct msm_kms *kms)
		return -EINVAL;
	}

	if (!sde_kms->splash_data.num_splash_regions ||
	if (((sde_kms->splash_data.type == SDE_SPLASH_HANDOFF)
		&& (!sde_kms->splash_data.num_splash_regions)) ||
			!sde_kms->splash_data.num_splash_displays) {
		DRM_INFO("cont_splash feature not enabled\n");
		return rc;
@@ -3129,7 +3131,8 @@ static int sde_kms_pd_disable(struct generic_pm_domain *genpd)
	return 0;
}

static int _sde_kms_get_splash_data(struct sde_splash_data *data)
static int _sde_kms_get_splash_data(struct sde_kms *sde_kms,
			struct sde_splash_data *data)
{
	int i = 0;
	int ret = 0;
@@ -3212,6 +3215,8 @@ static int _sde_kms_get_splash_data(struct sde_splash_data *data)
				splash_display->splash->splash_buf_size);
	}

	sde_kms->splash_data.type = SDE_SPLASH_HANDOFF;

	return ret;
}

@@ -3413,7 +3418,8 @@ static int _sde_kms_hw_init_blocks(struct sde_kms *sde_kms,
			 * cont-splash disabled case
			 */
			if (!display->cont_splash_enabled || ret)
				_sde_kms_free_splash_region(sde_kms, display);
				_sde_kms_free_splash_display_data(
						sde_kms, display);
		}
	}

@@ -3528,7 +3534,7 @@ static int sde_kms_hw_init(struct msm_kms *kms)
	if (rc)
		goto error;

	rc = _sde_kms_get_splash_data(&sde_kms->splash_data);
	rc = _sde_kms_get_splash_data(sde_kms, &sde_kms->splash_data);
	if (rc)
		SDE_DEBUG("sde splash data fetch failed: %d\n", rc);