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

Commit 19006e24 authored by Nilaan Gunabalachandran's avatar Nilaan Gunabalachandran
Browse files

disp: msm: sde: check power event before set clk rate



Clock rate can be set from debugfs, and this can attempt to
set clock rate even when display power is not enabled.
Set clock rate should check the last power event first.

Change-Id: Ibf01753a288e5a3003928664c99aa6dbf26350d6
Signed-off-by: default avatarNilaan Gunabalachandran <ngunabal@codeaurora.org>
parent 700f3cc7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1041,6 +1041,7 @@ static ssize_t _sde_core_perf_mode_write(struct file *file,
			SDE_ERROR("failed to set %s clock rate %llu\n",
					perf->clk_name,
					perf->max_core_clk_rate);
		else
			DRM_INFO("minimum performance mode\n");
	} else if (perf_mode == SDE_PERF_MODE_NORMAL) {
		/* reset the perf tune params to 0 */
+13 −1
Original line number Diff line number Diff line
@@ -43,8 +43,10 @@ static void sde_power_event_trigger_locked(struct sde_power_handle *phandle,
	struct sde_power_event *event;

	list_for_each_entry(event, &phandle->event_list, list) {
		if (event->event_type & event_type)
		if (event->event_type & event_type) {
			event->cb_fnc(event_type, event->usr);
			phandle->last_event_handled = event_type;
		}
	}
}

@@ -855,6 +857,15 @@ int sde_power_clk_set_rate(struct sde_power_handle *phandle, char *clock_name,
		pr_err("invalid input power handle\n");
		return -EINVAL;
	}

	mutex_lock(&phandle->phandle_lock);
	if (phandle->last_event_handled & SDE_POWER_EVENT_POST_DISABLE) {
		pr_debug("invalid power state %u\n",
				phandle->last_event_handled);
		mutex_unlock(&phandle->phandle_lock);
		return -EINVAL;
	}

	mp = &phandle->mp;

	for (i = 0; i < mp->num_clk; i++) {
@@ -875,6 +886,7 @@ int sde_power_clk_set_rate(struct sde_power_handle *phandle, char *clock_name,
			break;
		}
	}
	mutex_unlock(&phandle->phandle_lock);

	return rc;
}
+1 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ struct sde_power_handle {
	struct sde_power_data_bus_handle data_bus_handle
		[SDE_POWER_HANDLE_DBUS_ID_MAX];
	struct list_head event_list;
	u32 last_event_handled;
	struct sde_rsc_client *rsc_client;
	bool rsc_client_init;
	struct cx_ipeak_client *dss_cx_ipeak;