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

Commit 265602e0 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Update GMU snapshot section IDs"

parents aee68569 9514de5f
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -1438,27 +1438,31 @@ struct gmu_mem_type_desc {
static size_t a6xx_snapshot_gmu_mem(struct kgsl_device *device,
		u8 *buf, size_t remain, void *priv)
{
	struct kgsl_snapshot_gmu *header = (struct kgsl_snapshot_gmu *)buf;
	struct kgsl_snapshot_gmu_mem *mem_hdr =
		(struct kgsl_snapshot_gmu_mem *)buf;
	struct gmu_mem_type_desc *desc = priv;
	unsigned int *data = (unsigned int *)(buf + sizeof(*header));
	unsigned int *data = (unsigned int *)(buf + sizeof(*mem_hdr));

	if (priv == NULL)
		return 0;

	if (remain < desc->memdesc->size + sizeof(*header)) {
	if (remain < desc->memdesc->size + sizeof(*mem_hdr)) {
		KGSL_CORE_ERR(
			"snapshot: Not enough memory for the gmu section %d\n",
			desc->type);
		return 0;
	}

	header->type = desc->type;
	header->size = desc->memdesc->size;
	memset(mem_hdr, 0, sizeof(*mem_hdr));
	mem_hdr->type = desc->type;
	mem_hdr->hostaddr = (uintptr_t)desc->memdesc->hostptr;
	mem_hdr->gmuaddr = desc->memdesc->gmuaddr;
	mem_hdr->gpuaddr = 0;

	/* Just copy the ringbuffer, there are no active IBs */
	memcpy(data, desc->memdesc->hostptr, desc->memdesc->size);

	return desc->memdesc->size + sizeof(*header);
	return desc->memdesc->size + sizeof(*mem_hdr);
}

/*
@@ -1476,9 +1480,9 @@ static void a6xx_gmu_snapshot(struct adreno_device *adreno_dev,
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);
	bool gx_on;
	struct gmu_mem_type_desc desc[] = {
		{gmu->hfi_mem, SNAPSHOT_GMU_HFIMEM},
		{gmu->gmu_log, SNAPSHOT_GMU_LOG},
		{gmu->dump_mem, SNAPSHOT_GMU_DUMPMEM} };
		{gmu->hfi_mem, SNAPSHOT_GMU_MEM_HFI},
		{gmu->gmu_log, SNAPSHOT_GMU_MEM_LOG},
		{gmu->dump_mem, SNAPSHOT_GMU_MEM_BIN_BLOCK} };
	unsigned int val, i;

	if (!gmu_core_isenabled(device))
@@ -1487,7 +1491,7 @@ static void a6xx_gmu_snapshot(struct adreno_device *adreno_dev,
	for (i = 0; i < ARRAY_SIZE(desc); i++) {
		if (desc[i].memdesc)
			kgsl_snapshot_add_section(device,
					KGSL_SNAPSHOT_SECTION_GMU,
					KGSL_SNAPSHOT_SECTION_GMU_MEMORY,
					snapshot, a6xx_snapshot_gmu_mem,
					&desc[i]);
	}
+14 −10
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, 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
@@ -60,6 +60,7 @@ struct kgsl_snapshot_section_header {
#define KGSL_SNAPSHOT_SECTION_SHADER       0x1201
#define KGSL_SNAPSHOT_SECTION_MVC          0x1501
#define KGSL_SNAPSHOT_SECTION_GMU          0x1601
#define KGSL_SNAPSHOT_SECTION_GMU_MEMORY   0x1701

#define KGSL_SNAPSHOT_SECTION_END          0xFFFF

@@ -184,17 +185,20 @@ struct kgsl_snapshot_ib_v2 {
	__u64 size;    /* Size of the IB */
} __packed;

#define SNAPSHOT_GMU_OTHER	0
#define SNAPSHOT_GMU_HFIMEM	1
#define SNAPSHOT_GMU_LOG	2
#define SNAPSHOT_GMU_BWMEM	3
#define SNAPSHOT_GMU_DUMPMEM	4
#define SNAPSHOT_GMU_DCACHE	5
/* GMU memory ID's */
#define SNAPSHOT_GMU_MEM_UNKNOWN        0x00
#define SNAPSHOT_GMU_MEM_HFI            0x01
#define SNAPSHOT_GMU_MEM_LOG            0x02
#define SNAPSHOT_GMU_MEM_BWTABLE        0x03
#define SNAPSHOT_GMU_MEM_DEBUG          0x04
#define SNAPSHOT_GMU_MEM_BIN_BLOCK      0x05

/* Indirect buffer sub-section header */
struct kgsl_snapshot_gmu {
	int type;    /* Type of data to dump */
	int size;    /* Size in bytes to dump */
struct kgsl_snapshot_gmu_mem {
	int type;
	uint64_t hostaddr;
	uint64_t gmuaddr;
	uint64_t gpuaddr;
} __packed;

/* Register sub-section header */