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

Commit de85fcd6 authored by Alan Kwong's avatar Alan Kwong
Browse files

msm: sde: clean up evtlog & trace for inline rotator



Clean up evtlog messages for inline commit and inline
start. Route evtlog to trace log so rotator events can
be correlated with DRM events.

Change-Id: I3439540f0f54dffa3c0687e32fb1bfd740cb0eaa
Signed-off-by: default avatarAlan Kwong <akwong@codeaurora.org>
parent 607b49ce
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -945,6 +945,11 @@ static struct sde_rot_hw_resource *sde_rotator_get_hw_resource(
				"timeout waiting for hw resource, a:%d p:%d\n",
				atomic_read(&hw->num_active),
				hw->pending_count);
			SDEROT_EVTLOG(entry->item.session_id,
					entry->item.sequence_id,
					atomic_read(&hw->num_active),
					hw->pending_count,
					SDE_ROT_EVTLOG_ERROR);
			return NULL;
		}
	}
@@ -1603,9 +1608,14 @@ static void sde_rotator_done_handler(struct kthread_work *work)
		entry->item.flags,
		entry->dnsc_factor_w, entry->dnsc_factor_h);

	wait_for_completion_timeout(
	ret = wait_for_completion_timeout(
			&entry->item.inline_start,
			msecs_to_jiffies(ROT_INLINE_START_TIMEOUT_IN_MS));
	if (!ret) {
		SDEROT_WARN("timeout waiting for inline start\n");
		SDEROT_EVTLOG(entry->item.session_id, entry->item.sequence_id,
				SDE_ROT_EVTLOG_ERROR);
	}

	if (entry->item.ts)
		entry->item.ts[SDE_ROTATOR_TS_START] = ktime_get();
+6 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include "sde_rotator_base.h"
#include "sde_rotator_core.h"
#include "sde_rotator_dev.h"
#include "sde_rotator_trace.h"

#ifdef CONFIG_MSM_SDE_ROTATOR_EVTLOG_DEBUG
#define SDE_EVTLOG_DEFAULT_ENABLE 1
@@ -639,11 +640,12 @@ static void sde_rot_evtlog_debug_work(struct work_struct *work)
/*
 * sde_rot_dump_panic - Issue evtlog dump and generic panic
 */
void sde_rot_dump_panic(void)
void sde_rot_dump_panic(bool do_panic)
{
	sde_rot_evtlog_dump_all();
	sde_rot_dump_reg_all();

	if (do_panic)
		panic("sde_rotator");
}

@@ -740,6 +742,8 @@ void sde_rot_evtlog(const char *name, int line, int flag, ...)
		(sde_rot_dbg_evtlog.curr + 1) % SDE_ROT_EVTLOG_ENTRY;
	sde_rot_dbg_evtlog.last++;

	trace_sde_rot_evtlog(name, line, log->data_cnt, log->data);

	spin_unlock_irqrestore(&sde_rot_xlock, flags);
}

+4 −1
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@

#define SDE_ROT_DATA_LIMITER (-1)
#define SDE_ROT_EVTLOG_TOUT_DATA_LIMITER (NULL)
#define SDE_ROT_EVTLOG_PANIC		0xdead
#define SDE_ROT_EVTLOG_FATAL		0xbad
#define SDE_ROT_EVTLOG_ERROR		0xebad

enum sde_rot_dbg_reg_dump_flag {
	SDE_ROT_DBG_DUMP_IN_LOG = BIT(0),
@@ -39,7 +42,7 @@ enum sde_rot_dbg_evtlog_flag {
		SDE_ROT_EVTLOG_TOUT_DATA_LIMITER)

void sde_rot_evtlog(const char *name, int line, int flag, ...);
void sde_rot_dump_panic(void);
void sde_rot_dump_panic(bool do_panic);
void sde_rot_evtlog_tout_handler(bool queue, const char *name, ...);

struct sde_rotator_device;
+24 −9
Original line number Diff line number Diff line
@@ -457,6 +457,9 @@ static void sde_rotator_stop_streaming(struct vb2_queue *q)
				"timeout to stream off s:%d t:%d p:%d\n",
				ctx->session_id, q->type,
				!list_empty(&ctx->pending_list));
		SDEROT_EVTLOG(ctx->session_id, q->type,
				!list_empty(&ctx->pending_list),
				SDE_ROT_EVTLOG_ERROR);
		sde_rot_mgr_lock(rot_dev->mgr);
		sde_rotator_cancel_all_requests(rot_dev->mgr, ctx->private);
		sde_rot_mgr_unlock(rot_dev->mgr);
@@ -1451,15 +1454,14 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd,
	SDEROT_EVTLOG(ctx->session_id, cmd->sequence_id,
		cmd->src_rect_x, cmd->src_rect_y,
		cmd->src_rect_w, cmd->src_rect_h,
		cmd->src_width, cmd->src_height,
		cmd->src_pixfmt,
		cmd->dst_rect_x, cmd->dst_rect_y,
		cmd->dst_rect_w, cmd->dst_rect_h,
		cmd->dst_pixfmt,
		cmd->rot90, cmd->hflip, cmd->vflip, cmd->secure, cmd->fps,
		cmd->clkrate, cmd->data_bw,
		cmd->dst_writeback, cmd->video_mode, cmd_type);

		(cmd->rot90 << 0) | (cmd->hflip << 1) | (cmd->vflip << 2) |
		(cmd->secure << 3) | (cmd->dst_writeback << 4) |
		(cmd->video_mode << 5),
		cmd->fps, cmd->clkrate, cmd->data_bw,
		cmd_type);

	sde_rot_mgr_lock(rot_dev->mgr);

@@ -1677,13 +1679,17 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd,
			ret = wait_event_timeout(ctx->wait_queue,
				sde_rotator_is_request_retired(request),
				msecs_to_jiffies(rot_dev->streamoff_timeout));
			if (!ret)
			if (!ret) {
				SDEROT_ERR("timeout w/o retire s:%d\n",
						ctx->session_id);
			else if (ret == 1)
				SDEROT_EVTLOG(ctx->session_id,
						SDE_ROT_EVTLOG_ERROR);
			} else if (ret == 1) {
				SDEROT_ERR("timeout w/ retire s:%d\n",
						ctx->session_id);

				SDEROT_EVTLOG(ctx->session_id,
						SDE_ROT_EVTLOG_ERROR);
			}
			sde_rot_mgr_lock(rot_dev->mgr);
		}

@@ -1708,6 +1714,12 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd,
}
EXPORT_SYMBOL(sde_rotator_inline_commit);

void sde_rotator_inline_reg_dump(struct platform_device *pdev)
{
	sde_rot_dump_panic(false);
}
EXPORT_SYMBOL(sde_rotator_inline_reg_dump);

/*
 * sde_rotator_open - Rotator device open method.
 * @file: Pointer to file struct.
@@ -2899,6 +2911,9 @@ static int sde_rotator_process_buffers(struct sde_rotator_ctx *ctx,
				"error waiting for fence s:%d.%d fd:%d r:%d\n",
				ctx->session_id,
				vbinfo_cap->fence_ts, vbinfo_out->fd, ret);
			SDEROT_EVTLOG(ctx->session_id, vbinfo_cap->fence_ts,
					vbinfo_out->fd, ret,
					SDE_ROT_EVTLOG_ERROR);
			goto error_fence_wait;
		} else {
			SDEDEV_DBG(rot_dev->dev, "fence exit s:%d.%d fd:%d\n",
+1 −0
Original line number Diff line number Diff line
@@ -112,5 +112,6 @@ int sde_rotator_inline_get_pixfmt_caps(struct platform_device *pdev,
int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd,
		enum sde_rotator_inline_cmd_type cmd_type);
int sde_rotator_inline_release(void *handle);
void sde_rotator_inline_reg_dump(struct platform_device *pdev);

#endif /* __SDE_ROTATOR_INLINE_H__ */
Loading