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

Commit b712bdb8 authored by Aman Mehta's avatar Aman Mehta Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Including drawobj flag for msm-perf api



The inclusion of draw object flag for msm_perf_events_update.
Since user-space thread is triggered based on kgsl events
this will be vital to distinguish the events based on frame
states and prevent undesirable user-space thread wake-ups.

Change-Id: I28040808d6c114b718aad0e0ab63554683e77460
Signed-off-by: default avatarAman Mehta <amanmeht@codeaurora.org>
parent b0d1963b
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -301,7 +301,8 @@ static void _retire_timestamp(struct kgsl_drawobj *drawobj)

	msm_perf_events_update(MSM_PERF_GFX, MSM_PERF_RETIRED,
				pid_nr(context->proc_priv->pid),
				context->id, drawobj->timestamp);
				context->id, drawobj->timestamp,
				!!(drawobj->flags & KGSL_DRAWOBJ_END_OF_FRAME));

	/*
	 * For A3xx we still get the rptr from the CP_RB_RPTR instead of
@@ -697,7 +698,8 @@ static int sendcmd(struct adreno_device *adreno_dev,

	msm_perf_events_update(MSM_PERF_GFX, MSM_PERF_SUBMIT,
			       pid_nr(context->proc_priv->pid),
			       context->id, drawobj->timestamp);
			       context->id, drawobj->timestamp,
			       !!(drawobj->flags & KGSL_DRAWOBJ_END_OF_FRAME));

	trace_adreno_cmdbatch_submitted(drawobj, &info,
			time.ticks, (unsigned long) secs, nsecs / 1000,
@@ -1220,7 +1222,8 @@ static void _queue_drawobj(struct adreno_context *drawctxt,
	drawctxt->queued++;
	msm_perf_events_update(MSM_PERF_GFX, MSM_PERF_QUEUE,
				pid_nr(context->proc_priv->pid),
				context->id, drawobj->timestamp);
				context->id, drawobj->timestamp,
				!!(drawobj->flags & KGSL_DRAWOBJ_END_OF_FRAME));
	trace_adreno_cmdbatch_queued(drawobj, drawctxt->queued);
}

@@ -2341,7 +2344,8 @@ static void retire_cmdobj(struct adreno_device *adreno_dev,

	msm_perf_events_update(MSM_PERF_GFX, MSM_PERF_RETIRED,
			       pid_nr(context->proc_priv->pid),
			       context->id, drawobj->timestamp);
			       context->id, drawobj->timestamp,
			       !!(drawobj->flags & KGSL_DRAWOBJ_END_OF_FRAME));

	/*
	 * For A3xx we still get the rptr from the CP_RB_RPTR instead of
+3 −2
Original line number Diff line number Diff line
@@ -877,7 +877,7 @@ module_param_cb(core_ctl_register, &param_ops_cc_register,

void  msm_perf_events_update(enum evt_update_t update_typ,
			enum gfx_evt_t evt_typ, pid_t pid,
			uint32_t ctx_id, uint32_t timestamp)
			uint32_t ctx_id, uint32_t timestamp, bool end_of_frame)
{
	unsigned long flags;
	int idx = 0;
@@ -885,7 +885,8 @@ void msm_perf_events_update(enum evt_update_t update_typ,
	if (update_typ != MSM_PERF_GFX)
		return;

	if (pid != atomic_read(&game_status_pid) || (timestamp == 0))
	if (pid != atomic_read(&game_status_pid) || (timestamp == 0)
		|| !(end_of_frame))
		return;

	spin_lock_irqsave(&gfx_circ_buff_lock, flags);
+2 −2
Original line number Diff line number Diff line
@@ -20,10 +20,10 @@ enum evt_update_t {
#if IS_ENABLED(CONFIG_MSM_PERFORMANCE) && IS_ENABLED(CONFIG_MSM_PERFORMANCE_QGKI)
void msm_perf_events_update(enum evt_update_t update_typ,
			enum gfx_evt_t evt_typ, pid_t pid,
			uint32_t ctx_id, uint32_t timestamp);
			uint32_t ctx_id, uint32_t timestamp, bool end_of_frame);
#else
static inline void msm_perf_events_update(enum evt_update_t update_typ,
			enum gfx_evt_t evt_typ, pid_t pid,
			uint32_t ctx_id, uint32_t timestamp){}
			uint32_t ctx_id, uint32_t timestamp, bool end_of_frame){}
#endif
#endif