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

Commit b5f1a490 authored by Guchun Chen's avatar Guchun Chen Committed by Gerrit - the friendly Code Review server
Browse files

drm: msm: add uevent handler to release pipes



To achieve glitch-free purpose for early RVC case, the pipes are set
to be unavailable to user Apps. So after splash handoff is done, kernel
needs to tell user Apps the update via this uevent. User Apps will get
this event and start further operation accordingly.

CRs-Fixed: 2225630
Change-Id: I96f023d72dea9c359730d0313e65e87cf9dc1fbc
Signed-off-by: default avatarGuchun Chen <guchunc@codeaurora.org>
parent 7cc625f1
Loading
Loading
Loading
Loading
+40 −0
Original line number Diff line number Diff line
@@ -283,6 +283,44 @@ static void _sde_splash_destroy_splash_node(struct sde_splash_info *sinfo)
	sinfo->splash_mem_size = NULL;
}

static void _sde_splash_sent_pipe_update_uevent(struct sde_kms *sde_kms)
{
	char *event_string;
	char *envp[2];
	struct drm_device *dev;
	struct device *kdev;
	int i =  0;

	if (!sde_kms || !sde_kms->dev) {
		DRM_ERROR("invalid input\n");
		return;
	}

	dev = sde_kms->dev;
	kdev = dev->primary->kdev;

	event_string = kzalloc(SZ_4K, GFP_KERNEL);
	if (!event_string) {
		SDE_ERROR("failed to allocate event string\n");
		return;
	}

	for (i = 0; i < MAX_BLOCKS; i++) {
		if (sde_kms->splash_info.reserved_pipe_info[i] != 0xFFFFFFFF)
			snprintf(event_string, SZ_4K, "pipe%d avialable",
				sde_kms->splash_info.reserved_pipe_info[i]);
	}

	DRM_INFO("generating pipe update event[%s]", event_string);

	envp[0] = event_string;
	envp[1] = NULL;

	kobject_uevent_env(&kdev->kobj, KOBJ_CHANGE, envp);

	kfree(event_string);
}

static void _sde_splash_get_connector_ref_cnt(struct sde_splash_info *sinfo,
					u32 *hdmi_cnt, u32 *dsi_cnt)
{
@@ -651,6 +689,8 @@ int sde_splash_clean_up_free_resource(struct msm_kms *kms,
		sde_power_data_bus_bandwidth_ctrl(phandle,
				sde_kms->core_client, false);

		_sde_splash_sent_pipe_update_uevent(sde_kms);

		mutex_unlock(&sde_splash_lock);
		return 0;
	}