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

Commit 2db428de authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm: Add preemption records to QTI GPU snapshot"

parents 48a0c93e 96605f75
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -733,6 +733,35 @@ static void a5xx_snapshot_indexed_registers(struct msm_gpu *gpu,
	}
}

static void a5xx_snapshot_preemption(struct msm_gpu *gpu, struct msm_snapshot
		*snapshot)
{
	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
	struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu);
	struct msm_snapshot_gpu_object header = {
		.type = SNAPSHOT_GPU_OBJECT_GLOBAL,
		.size = A5XX_PREEMPT_RECORD_SIZE >> 2,
		.pt_base = 0,
	};
	int index;

	if (gpu->nr_rings <= 1)
		return;

	for (index = 0; index < gpu->nr_rings; index++) {

		header.gpuaddr = a5xx_gpu->preempt_iova[index];

		if (!SNAPSHOT_HEADER(snapshot, header,
			SNAPSHOT_SECTION_GPU_OBJECT_V2,
			A5XX_PREEMPT_RECORD_SIZE >> 2))
			return;

		SNAPSHOT_MEMCPY(snapshot, a5xx_gpu->preempt[index],
				A5XX_PREEMPT_RECORD_SIZE);
	}
}

int a5xx_snapshot(struct msm_gpu *gpu, struct msm_snapshot *snapshot)
{
	struct crashdump crashdump = { 0 };
@@ -787,6 +816,9 @@ int a5xx_snapshot(struct msm_gpu *gpu, struct msm_snapshot *snapshot)
	/* CP MERCIU */
	a5xx_snapshot_cp_merciu(gpu, snapshot);

	/* Preemption records*/
	a5xx_snapshot_preemption(gpu, snapshot);

	crashdump_destroy(gpu, &crashdump);
	snapshot->priv = NULL;

+13 −0
Original line number Diff line number Diff line
@@ -118,4 +118,17 @@ struct msm_snapshot_shader {
	__u32 size;
} __packed;

#define SNAPSHOT_GPU_OBJECT_SHADER  1
#define SNAPSHOT_GPU_OBJECT_IB      2
#define SNAPSHOT_GPU_OBJECT_GENERIC 3
#define SNAPSHOT_GPU_OBJECT_DRAW    4
#define SNAPSHOT_GPU_OBJECT_GLOBAL  5

struct msm_snapshot_gpu_object {
	struct msm_snapshot_section_header header;
	__u32 type;
	__u64 gpuaddr;
	__u64 pt_base;
	__u64 size;
} __packed;
#endif