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

Commit 06345e29 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm: msm: sde: Update splash handoff with new APIs"

parents 082fa7fa 4b5e419a
Loading
Loading
Loading
Loading
+2 −26
Original line number Diff line number Diff line
@@ -17,10 +17,6 @@
#include "sde_connector.h"
#include "sde_backlight.h"
#include "sde_splash.h"
#include <linux/workqueue.h>
#include <linux/atomic.h>
#include <linux/cpu.h>
#include <linux/device.h>

#define SDE_DEBUG_CONN(c, fmt, ...) SDE_DEBUG("conn%d " fmt,\
		(c) ? (c)->base.base.id : -1, ##__VA_ARGS__)
@@ -55,8 +51,6 @@ static const struct drm_prop_enum_list hpd_clock_state[] = {
	{SDE_MODE_HPD_OFF,     "OFF"},
};

static struct work_struct cpu_up_work;

int sde_connector_get_info(struct drm_connector *connector,
		struct msm_display_info *info)
{
@@ -574,25 +568,11 @@ void sde_connector_prepare_fence(struct drm_connector *connector)
	sde_fence_prepare(&to_sde_connector(connector)->retire_fence);
}

static void wake_up_cpu(struct work_struct *work)
{
	struct device *cpu_dev = NULL;

	cpu_dev = get_cpu_device(1);
	if (!cpu_dev) {
		pr_err("Could not get cpu1 device\n");
		return;
	}
	if (!device_online(cpu_dev))
		pr_info("cpu1 is online\n");
}

void sde_connector_complete_commit(struct drm_connector *connector)
{
	struct drm_device *dev;
	struct msm_drm_private *priv;
	struct sde_connector *c_conn;
	static atomic_t cpu_up_scheduled = ATOMIC_INIT(0);

	if (!connector) {
		SDE_ERROR("invalid connector\n");
@@ -607,8 +587,7 @@ void sde_connector_complete_commit(struct drm_connector *connector)

	/*
	 * After LK totally exits, LK's early splash resource
	 * should be released, cpu1 is hot-plugged in case LK's
	 * early domain has reserved it.
	 * should be released.
	 */
	if (sde_splash_get_lk_complete_status(priv->kms)) {
		c_conn = to_sde_connector(connector);
@@ -616,11 +595,8 @@ void sde_connector_complete_commit(struct drm_connector *connector)
		sde_splash_free_resource(priv->kms, &priv->phandle,
					c_conn->connector_type,
					c_conn->display);
		if (atomic_add_unless(&cpu_up_scheduled, 1, 1)) {
			INIT_WORK(&cpu_up_work, wake_up_cpu);
			schedule_work(&cpu_up_work);
		}
	}

}

static int sde_connector_dpms(struct drm_connector *connector,
+9 −65
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
#include <linux/of_address.h>
#include <linux/debugfs.h>
#include <linux/memblock.h>

#include <soc/qcom/early_domain.h>
#include "msm_drv.h"
#include "msm_mmu.h"
#include "sde_kms.h"
@@ -66,49 +66,6 @@ static void _sde_splash_free_bootup_memory_to_system(phys_addr_t phys,
		free_reserved_page(pfn_to_page(pfn_idx));
}

static int _sde_splash_parse_dt_get_lk_pool_node(struct drm_device *dev,
					struct sde_splash_info *sinfo)
{
	struct device_node *parent, *node;
	struct resource r;
	int ret = 0;

	if (!sinfo)
		return -EINVAL;

	parent = of_find_node_by_path("/reserved-memory");
	if (!parent)
		return -EINVAL;

	node = of_find_node_by_name(parent, "lk_pool");
	if (!node) {
		SDE_ERROR("mem reservation for lk_pool is not presented\n");
		ret = -EINVAL;
		goto parent_node_err;
	}

	/* find the mode */
	if (of_address_to_resource(node, 0, &r)) {
		ret = -EINVAL;
		goto child_node_err;
	}

	sinfo->lk_pool_paddr = (dma_addr_t)r.start;
	sinfo->lk_pool_size = r.end - r.start;

	DRM_INFO("lk_pool: addr:%pK, size:%pK\n",
			(void *)sinfo->lk_pool_paddr,
			(void *)sinfo->lk_pool_size);

child_node_err:
	of_node_put(node);

parent_node_err:
	of_node_put(parent);

	return ret;
}

static int _sde_splash_parse_dt_get_display_node(struct drm_device *dev,
					struct sde_splash_info *sinfo)
{
@@ -183,10 +140,9 @@ error:
	return -ENOMEM;
}

static bool _sde_splash_lk_check(struct sde_hw_intr *intr)
static bool _sde_splash_lk_check(void)
{
	return (SDE_LK_RUNNING_VALUE == SDE_REG_READ(&intr->hw,
			SCRATCH_REGISTER_1)) ? true : false;
	return get_early_service_status(EARLY_DISPLAY);
}

/**
@@ -194,10 +150,9 @@ static bool _sde_splash_lk_check(struct sde_hw_intr *intr)
 *
 * Function to stop early splash in LK.
 */
static inline void _sde_splash_notify_lk_stop_splash(struct sde_hw_intr *intr)
static inline void _sde_splash_notify_lk_stop_splash(void)
{
	/* write splash stop signal to scratch register*/
	SDE_REG_WRITE(&intr->hw, SCRATCH_REGISTER_1, SDE_LK_STOP_SPLASH_VALUE);
	request_early_service_shutdown(EARLY_DISPLAY);
}

static int _sde_splash_gem_new(struct drm_device *dev,
@@ -502,12 +457,6 @@ int sde_splash_parse_memory_dt(struct drm_device *dev)
		SDE_ERROR("get display node failed\n");
		return -EINVAL;
	}

	if (_sde_splash_parse_dt_get_lk_pool_node(dev, sinfo)) {
		SDE_ERROR("get LK pool node failed\n");
		return -EINVAL;
	}

	return 0;
}

@@ -781,9 +730,8 @@ bool sde_splash_get_lk_complete_status(struct msm_kms *kms)

	if (sde_kms->splash_info.handoff &&
		!sde_kms->splash_info.display_splash_enabled &&
		SDE_LK_EXIT_VALUE == SDE_REG_READ(&intr->hw,
					SCRATCH_REGISTER_1)) {
		SDE_DEBUG("LK totoally exits\n");
		!_sde_splash_lk_check()) {
		SDE_DEBUG("LK totally exits\n");
		return true;
	}

@@ -841,10 +789,6 @@ int sde_splash_free_resource(struct msm_kms *kms,

		_sde_splash_destroy_splash_node(sinfo);

		/* free lk_pool heap memory */
		_sde_splash_free_bootup_memory_to_system(sinfo->lk_pool_paddr,
						sinfo->lk_pool_size);

		/* withdraw data bus vote */
		sde_power_data_bus_bandwidth_ctrl(phandle,
					sde_kms->core_client, false);
@@ -974,8 +918,8 @@ int sde_splash_lk_stop_splash(struct msm_kms *kms,
	mutex_lock(&sde_splash_lock);
	if (_sde_splash_validate_commit(sde_kms, state) &&
			sinfo->display_splash_enabled) {
		if (_sde_splash_lk_check(sde_kms->hw_intr))
			_sde_splash_notify_lk_stop_splash(sde_kms->hw_intr);
		if (_sde_splash_lk_check())
			_sde_splash_notify_lk_stop_splash();

		sinfo->display_splash_enabled = false;

+0 −6
Original line number Diff line number Diff line
@@ -68,12 +68,6 @@ struct sde_splash_info {
	/* constructed gem objects for smmu mapping */
	struct drm_gem_object **obj;

	/* physical address of lk pool */
	phys_addr_t lk_pool_paddr;

	/* memory size of lk pool */
	size_t lk_pool_size;

	/* enabled statue of displays*/
	uint32_t intf_sel_status;