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

Commit b2f0a442 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Add a6xx_hwsched_snapshot function



Since GMU tells us the exact submission that faulted via
the context bad hfi, look up the command object corresponding
to the submission and mark it for snapshot purposes. Create the
top level gpudev snapshot function for hw scheduling which first
snapshots the faulted command object and then calls into the
generic gmu snapshot function.

Change-Id: I5c5300b7b147dfcf0c009b44376ba0c6e1f8e25b
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 44ed382d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1773,6 +1773,13 @@ static inline void adreno_reg_offset_init(u32 *reg_offsets)
	}
}

static inline u32 adreno_get_level(u32 priority)
{
	u32 level = priority / KGSL_PRIORITY_MAX_RB_LEVELS;

	return min_t(u32, level, KGSL_PRIORITY_MAX_RB_LEVELS - 1);
}

int adreno_gmu_fenced_write(struct adreno_device *adreno_dev,
	enum adreno_regs offset, unsigned int val,
	unsigned int fence_mask);
+1 −1
Original line number Diff line number Diff line
@@ -2801,7 +2801,7 @@ struct adreno_gpudev adreno_a6xx_gpudev = {
struct adreno_gpudev adreno_a6xx_hwsched_gpudev = {
	.reg_offsets = a6xx_register_offsets,
	.probe = a6xx_hwsched_probe,
	.snapshot = a6xx_gmu_snapshot,
	.snapshot = a6xx_hwsched_snapshot,
	.irq_handler = a6xx_irq_handler,
	.perfcounters = &a6xx_perfcounters,
	.read_throttling_counters = a6xx_read_throttling_counters,
+8 −0
Original line number Diff line number Diff line
@@ -15,6 +15,14 @@
#include "kgsl_trace.h"
#include "kgsl_util.h"

void a6xx_hwsched_snapshot(struct adreno_device *adreno_dev,
	struct kgsl_snapshot *snapshot)
{
	adreno_hwsched_parse_fault_cmdobj(adreno_dev, snapshot);

	a6xx_gmu_snapshot(adreno_dev, snapshot);
}

static int a6xx_hwsched_gmu_first_boot(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
+10 −0
Original line number Diff line number Diff line
@@ -39,4 +39,14 @@ int a6xx_hwsched_probe(struct platform_device *pdev,
 * @adreno_dev: Pointer to the adreno device
 */
void a6xx_hwsched_restart(struct adreno_device *adreno_dev);

/**
 * a6xx_hwsched_snapshot - take a6xx hwsched snapshot
 * @adreno_dev: Pointer to the adreno device
 * @snapshot: Pointer to the snapshot instance
 *
 * Snapshot the faulty ib and then snapshot rest of a6xx gmu things
 */
void a6xx_hwsched_snapshot(struct adreno_device *adreno_dev,
	struct kgsl_snapshot *snapshot);
#endif
+6 −11
Original line number Diff line number Diff line
@@ -151,13 +151,6 @@ static void a6xx_receive_ack_async(struct adreno_device *adreno_dev, void *rcvd)
			MSG_HDR_GET_SEQNUM(waiters[i]));
}

static u32 get_level(u32 priority)
{
	u32 level = priority / KGSL_PRIORITY_MAX_RB_LEVELS;

	return min_t(u32, level, KGSL_PRIORITY_MAX_RB_LEVELS - 1);
}

static void log_profiling_info(struct adreno_device *adreno_dev, u32 *rcvd)
{
	struct hfi_ts_retire_cmd *cmd = (struct hfi_ts_retire_cmd *)rcvd;
@@ -169,7 +162,7 @@ static void log_profiling_info(struct adreno_device *adreno_dev, u32 *rcvd)
		return;

	info.timestamp = cmd->ts;
	info.rb_id = get_level(context->priority);
	info.rb_id = adreno_get_level(context->priority);
	info.gmu_dispatch_queue = context->gmu_dispatch_queue;
	info.submitted_to_rb = cmd->submitted_to_rb;
	info.sop = cmd->sop;
@@ -832,10 +825,12 @@ static void process_ts_retire(struct adreno_device *adreno_dev, u32 *rcvd)

static void process_ctx_bad(struct adreno_device *adreno_dev, void *rcvd)
{
	struct hfi_context_bad_cmd *cmd = rcvd;

	/* Block dispatcher to submit more commands */
	adreno_get_gpu_halt(adreno_dev);

	adreno_hwsched_set_fault(adreno_dev);
	adreno_hwsched_mark_drawobj(adreno_dev, cmd->ctxt_id, cmd->ts);
}

static int hfi_f2h_main(void *arg)
@@ -942,7 +937,7 @@ static void add_profile_events(struct adreno_device *adreno_dev,
	time_in_ns = do_div(time_in_s, 1000000000);

	info.inflight = -1;
	info.rb_id = get_level(context->priority);
	info.rb_id = adreno_get_level(context->priority);
	info.gmu_dispatch_queue = context->gmu_dispatch_queue;

	trace_adreno_cmdbatch_submitted(drawobj, &info, time->ticks,
@@ -985,7 +980,7 @@ static u32 get_next_dq(u32 priority)

static u32 get_dq_id(u32 priority)
{
	u32 level = get_level(priority);
	u32 level = adreno_get_level(priority);

	return get_next_dq(level);
}
Loading