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

Commit d7dac94d authored by Sachin Bhayare's avatar Sachin Bhayare Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: add XLOGs mdp3 driver



Add XLOGs in mdp3 driver for ease of debugging.

Change-Id: Ie0de3b70447272cdc4f3545b2e1636b347b384f8
Signed-off-by: default avatarSachin Bhayare <sachin.bhayare@codeaurora.org>
parent a3e227fc
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -449,12 +449,16 @@ static int mdp3_clk_update(u32 clk_idx, u32 enable)
			mdp3_res->clock_ref_count[clk_idx]--;
			return ret;
		}
		if (clk_idx == MDP3_CLK_MDP_CORE)
			MDSS_XLOG(enable);
		ret = clk_enable(clk);
		if (ret)
			pr_err("%s: clock enable failed %d\n", __func__,
					clk_idx);
	} else if (count == 0) {
		pr_debug("clk=%d disable\n", clk_idx);
		if (clk_idx == MDP3_CLK_MDP_CORE)
			MDSS_XLOG(enable);
		clk_disable(clk);
		clk_unprepare(clk);
		ret = 0;
@@ -2722,6 +2726,7 @@ int mdp3_footswitch_ctrl(int enable)
	int active_cnt = 0;

	mutex_lock(&mdp3_res->fs_idle_pc_lock);
	MDSS_XLOG(enable);
	if (!mdp3_res->fs_ena && enable) {
		rc = regulator_enable(mdp3_res->fs);
		if (rc) {
@@ -2960,7 +2965,7 @@ static int mdp3_resume_sub(void)
static int mdp3_pm_suspend(struct device *dev)
{
	dev_dbg(dev, "Display pm suspend\n");

	MDSS_XLOG(XLOG_FUNC_ENTRY);
	return mdp3_suspend_sub();
}

@@ -2977,6 +2982,7 @@ static int mdp3_pm_resume(struct device *dev)
	pm_runtime_set_suspended(dev);
	pm_runtime_enable(dev);

	MDSS_XLOG(XLOG_FUNC_ENTRY);
	return mdp3_resume_sub();
}
#endif
@@ -2986,6 +2992,7 @@ static int mdp3_suspend(struct platform_device *pdev, pm_message_t state)
{
	pr_debug("Display suspend\n");

	MDSS_XLOG(XLOG_FUNC_ENTRY);
	return mdp3_suspend_sub();
}

@@ -2993,6 +3000,7 @@ static int mdp3_resume(struct platform_device *pdev)
{
	pr_debug("Display resume\n");

	MDSS_XLOG(XLOG_FUNC_ENTRY);
	return mdp3_resume_sub();
}
#else
@@ -3013,6 +3021,7 @@ static int mdp3_runtime_resume(struct device *dev)
	if (!mdp3_res->idle_pc)
		device_for_each_child(dev, &device_on, mdss_fb_suspres_panel);

	MDSS_XLOG(XLOG_FUNC_ENTRY);
	mdp3_footswitch_ctrl(1);

	return 0;
@@ -3037,6 +3046,7 @@ static int mdp3_runtime_suspend(struct device *dev)
		return -EBUSY;
	}

	MDSS_XLOG(XLOG_FUNC_ENTRY);
	mdp3_footswitch_ctrl(0);

	/* do not suspend panels when going in to idle power collapse */
+12 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -148,7 +148,7 @@ static void mdp3_dispatch_dma_done(struct work_struct *work)
		return;

	cnt = atomic_read(&session->dma_done_cnt);

	MDSS_XLOG(cnt);
	while (cnt > 0) {
		mdp3_ctrl_notify(session, MDP_NOTIFY_FRAME_DONE);
		atomic_dec(&session->dma_done_cnt);
@@ -164,6 +164,7 @@ static void mdp3_dispatch_clk_off(struct work_struct *work)
	int retry_count = 2;

	pr_debug("%s\n", __func__);
	MDSS_XLOG(XLOG_FUNC_ENTRY, __LINE__);
	session = container_of(work, struct mdp3_session_data,
				clk_off_work);
	if (!session)
@@ -174,6 +175,7 @@ static void mdp3_dispatch_clk_off(struct work_struct *work)
		atomic_read(&session->vsync_countdown) > 0) {
		mutex_unlock(&session->lock);
		pr_debug("%s: Ignoring clk shut down\n", __func__);
		MDSS_XLOG(XLOG_FUNC_EXIT, __LINE__);
		return;
	}

@@ -202,6 +204,7 @@ retry_dma_done:
	}
	mdp3_ctrl_vsync_enable(session->mfd, 0);
	mdp3_ctrl_clk_enable(session->mfd, 0);
	MDSS_XLOG(XLOG_FUNC_EXIT, __LINE__);
	mutex_unlock(&session->lock);
}

@@ -248,6 +251,7 @@ void vsync_notify_handler(void *arg)
{
	struct mdp3_session_data *session = (struct mdp3_session_data *)arg;
	session->vsync_time = ktime_get();
	MDSS_XLOG(ktime_to_ms(session->vsync_time));
	sysfs_notify_dirent(session->vsync_event_sd);
}

@@ -795,6 +799,7 @@ static int mdp3_ctrl_on(struct msm_fb_data_type *mfd)
	}
	mutex_lock(&mdp3_session->lock);

	MDSS_XLOG(XLOG_FUNC_ENTRY, __LINE__, mfd->panel_power_state);
	panel = mdp3_session->panel;
	/* make sure DSI host is initialized properly */
	if (panel) {
@@ -819,6 +824,7 @@ static int mdp3_ctrl_on(struct msm_fb_data_type *mfd)

	if (mdp3_session->status) {
		pr_debug("fb%d is on already\n", mfd->index);
		MDSS_XLOG(XLOG_FUNC_EXIT, __LINE__, mfd->panel_power_state);
		goto end;
	}

@@ -905,6 +911,7 @@ static int mdp3_ctrl_on(struct msm_fb_data_type *mfd)
		mdp3_session->status = 1;

	mdp3_ctrl_pp_resume(mfd);
	MDSS_XLOG(XLOG_FUNC_EXIT, __LINE__, mfd->panel_power_state);
on_error:
	if (rc || (mdp3_res->idle_pc_enabled &&
			(mfd->panel_info->type == MIPI_CMD_PANEL))) {
@@ -942,6 +949,8 @@ static int mdp3_ctrl_off(struct msm_fb_data_type *mfd)
	 */
	pm_runtime_get_sync(&mdp3_res->pdev->dev);

	MDSS_XLOG(XLOG_FUNC_ENTRY, __LINE__, mdss_fb_is_power_on_ulp(mfd),
		mfd->panel_power_state);
	panel = mdp3_session->panel;
	mutex_lock(&mdp3_session->lock);

@@ -1083,6 +1092,7 @@ static int mdp3_ctrl_off(struct msm_fb_data_type *mfd)
		mdp3_ctrl_clk_enable(mdp3_session->mfd, 0);
	}
off_error:
	MDSS_XLOG(XLOG_FUNC_EXIT, __LINE__);
	mutex_unlock(&mdp3_session->lock);
	/* Release the last reference to the runtime device */
	pm_runtime_put(&mdp3_res->pdev->dev);
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2007, 2013-2014, 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2007, 2013-2014, 2016-2017, The Linux Foundation. All rights reserved.
 * Copyright (C) 2007 Google Incorporated
 *
 * This software is licensed under the terms of the GNU General Public
@@ -1200,6 +1200,7 @@ void mdp3_ppp_wait_for_fence(struct blit_req_list *req)
void mdp3_ppp_signal_timeline(struct blit_req_list *req)
{
	sw_sync_timeline_inc(ppp_stat->timeline, 1);
	MDSS_XLOG(ppp_stat->timeline->value, ppp_stat->timeline_value);
	req->last_rel_fence = req->cur_rel_fence;
	req->cur_rel_fence = 0;
}
@@ -1256,6 +1257,7 @@ static int mdp3_ppp_handle_buf_sync(struct blit_req_list *req,

	req->cur_rel_sync_pt = sw_sync_pt_create(ppp_stat->timeline,
			ppp_stat->timeline_value++);
	MDSS_XLOG(ppp_stat->timeline_value);
	if (req->cur_rel_sync_pt == NULL) {
		pr_err("%s: cannot create sync point\n", __func__);
		ret = -ENOMEM;
+6 −1
Original line number Diff line number Diff line
/* Copyright (c) 2007, 2012-2013, 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2007, 2012-2013, 2016-2017, The Linux Foundation. All rights reserved.
 * Copyright (C) 2007 Google Incorporated
 *
 * This software is licensed under the terms of the GNU General Public
@@ -23,6 +23,7 @@
#include "mdss_fb.h"
#include "mdp3_ppp.h"
#include "mdp3_hwio.h"
#include "mdss_debug.h"

/* SHIM Q Factor */
#define PHI_Q_FACTOR          29
@@ -1337,6 +1338,10 @@ int config_ppp_op_mode(struct ppp_blit_op *blit_op)

	PPP_WRITEL(ppp_operation_reg, MDP3_PPP_OP_MODE);
	mb();
	MDSS_XLOG(ppp_operation_reg, blit_op->src.roi.x, blit_op->src.roi.y,
		blit_op->src.roi.width, blit_op->src.roi.height);
	 MDSS_XLOG(blit_op->dst.roi.x, blit_op->dst.roi.y,
		blit_op->dst.roi.width, blit_op->dst.roi.height);
	return 0;
}

+9 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * Core MDSS framebuffer driver.
 *
 * Copyright (C) 2007 Google Incorporated
 * Copyright (c) 2008-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2017, The Linux Foundation. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
@@ -2834,7 +2834,8 @@ static int __mdss_fb_wait_for_fence_sub(struct msm_sync_pt_data *sync_pt_data,
					fences[i]->name);
			pr_cont("Waiting %ld.%ld more seconds\n",
				(wait_ms/MSEC_PER_SEC), (wait_ms%MSEC_PER_SEC));

			MDSS_XLOG(sync_pt_data->timeline_value);
			MDSS_XLOG_TOUT_HANDLER("mdp");
			ret = sync_fence_wait(fences[i], wait_ms);

			if (ret == -ETIME)
@@ -2880,6 +2881,7 @@ void mdss_fb_signal_timeline(struct msm_sync_pt_data *sync_pt_data)
	if (atomic_add_unless(&sync_pt_data->commit_cnt, -1, 0) &&
			sync_pt_data->timeline) {
		sw_sync_timeline_inc(sync_pt_data->timeline, 1);
		MDSS_XLOG(sync_pt_data->timeline_value);
		sync_pt_data->timeline_value++;

		pr_debug("%s: buffer signaled! timeline val=%d remaining=%d\n",
@@ -4144,6 +4146,11 @@ static int mdss_fb_handle_buf_sync_ioctl(struct msm_sync_pt_data *sync_pt_data,
	val = sync_pt_data->timeline_value + sync_pt_data->threshold +
			atomic_read(&sync_pt_data->commit_cnt);

	MDSS_XLOG(sync_pt_data->timeline_value, val,
		atomic_read(&sync_pt_data->commit_cnt));
	pr_debug("%s: fence CTL%d Commit_cnt%d\n", sync_pt_data->fence_name,
		sync_pt_data->timeline_value,
		atomic_read(&sync_pt_data->commit_cnt));
	/* Set release fence */
	rel_fence = mdss_fb_sync_get_fence(sync_pt_data->timeline,
			sync_pt_data->fence_name, val);