summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarshdeep Dhatt <quic_hdhatt@quicinc.com>2022-10-05 12:15:54 -0600
committerGerrit - the friendly Code Review server <code-review@localhost>2023-02-25 09:34:14 -0800
commit7daef00166f7b94bd02b84a4d7987ec69983ef4c (patch)
tree6fc17c78e85b01a2af33427d6cdb6673711332fa
parentc940c4f283c7de1432435de3a5fc5b1169a65147 (diff)
downloadgraphics-7daef00166f7b94bd02b84a4d7987ec69983ef4c.tar.gz
msm: kgsl: Dump hw-fence buffer using unique type
Snapshot parsers need this to be able to identify this buffer uniquely (using type=SNAPSHOT_GMU_MEM_HW_FENCE) to parse it accordingly. Also, remove KGSL_MEMDESC_IOMEM flag as it is no longer needed. Change-Id: If0bf9c0efe9a099a8b6790737642b0fe2d69ce29 Signed-off-by: Harshdeep Dhatt <quic_hdhatt@quicinc.com>
-rw-r--r--adreno_gen7_gmu_snapshot.c8
-rw-r--r--adreno_gen7_hwsched.c18
-rw-r--r--adreno_hwsched.c1
-rw-r--r--adreno_snapshot.c5
-rw-r--r--kgsl.h6
-rw-r--r--kgsl_snapshot.h1
6 files changed, 22 insertions, 17 deletions
diff --git a/adreno_gen7_gmu_snapshot.c b/adreno_gen7_gmu_snapshot.c
index 6d21110..14fdcf3 100644
--- a/adreno_gen7_gmu_snapshot.c
+++ b/adreno_gen7_gmu_snapshot.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include "gen7_reg.h"
@@ -37,7 +37,11 @@ size_t gen7_snapshot_gmu_mem(struct kgsl_device *device,
mem_hdr->gmuaddr = desc->memdesc->gmuaddr;
mem_hdr->gpuaddr = 0;
- memcpy(data, desc->memdesc->hostptr, desc->memdesc->size);
+ /* The hw fence queues are mapped as iomem in the kernel */
+ if (desc->type == SNAPSHOT_GMU_MEM_HW_FENCE)
+ memcpy_fromio(data, desc->memdesc->hostptr, desc->memdesc->size);
+ else
+ memcpy(data, desc->memdesc->hostptr, desc->memdesc->size);
return desc->memdesc->size + sizeof(*mem_hdr);
}
diff --git a/adreno_gen7_hwsched.c b/adreno_gen7_hwsched.c
index a60e3eb..666b395 100644
--- a/adreno_gen7_hwsched.c
+++ b/adreno_gen7_hwsched.c
@@ -343,17 +343,23 @@ void gen7_hwsched_snapshot(struct adreno_device *adreno_dev,
snapshot, adreno_snapshot_global,
entry->md);
- if (entry->desc.mem_kind == HFI_MEMKIND_HW_FENCE)
- kgsl_snapshot_add_section(device,
- KGSL_SNAPSHOT_SECTION_GPU_OBJECT_V2,
- snapshot, adreno_snapshot_global,
- entry->md);
-
if (entry->desc.mem_kind == HFI_MEMKIND_AQE_BUFFER)
kgsl_snapshot_add_section(device,
KGSL_SNAPSHOT_SECTION_GPU_OBJECT_V2,
snapshot, snapshot_aqe_buffer,
entry->md);
+
+ if (entry->desc.mem_kind == HFI_MEMKIND_HW_FENCE) {
+ struct gmu_mem_type_desc desc;
+
+ desc.memdesc = entry->md;
+ desc.type = SNAPSHOT_GMU_MEM_HW_FENCE;
+
+ kgsl_snapshot_add_section(device,
+ KGSL_SNAPSHOT_SECTION_GMU_MEMORY,
+ snapshot, gen7_snapshot_gmu_mem, &desc);
+ }
+
}
if (!adreno_hwsched_context_queue_enabled(adreno_dev))
diff --git a/adreno_hwsched.c b/adreno_hwsched.c
index 40b1e56..6497ed4 100644
--- a/adreno_hwsched.c
+++ b/adreno_hwsched.c
@@ -2378,7 +2378,6 @@ void adreno_hwsched_register_hw_fence(struct adreno_device *adreno_dev)
hw_fence->memdesc.physaddr = hw_fence->mem_descriptor.device_addr;
hw_fence->memdesc.size = hw_fence->mem_descriptor.size;
hw_fence->memdesc.hostptr = hw_fence->mem_descriptor.virtual_addr;
- hw_fence->memdesc.priv |= KGSL_MEMDESC_IOMEM;
ret = kgsl_memdesc_sg_dma(&hw_fence->memdesc, hw_fence->memdesc.physaddr,
hw_fence->memdesc.size);
diff --git a/adreno_snapshot.c b/adreno_snapshot.c
index ff378a3..827422a 100644
--- a/adreno_snapshot.c
+++ b/adreno_snapshot.c
@@ -929,10 +929,7 @@ size_t adreno_snapshot_global(struct kgsl_device *device, u8 *buf,
header->ptbase = MMU_DEFAULT_TTBR0(device);
header->type = SNAPSHOT_GPU_OBJECT_GLOBAL;
- if ((memdesc->priv & KGSL_MEMDESC_IOMEM) != 0)
- memcpy_fromio(ptr, memdesc->hostptr, memdesc->size);
- else
- memcpy(ptr, memdesc->hostptr, memdesc->size);
+ memcpy(ptr, memdesc->hostptr, memdesc->size);
return memdesc->size + sizeof(*header);
}
diff --git a/kgsl.h b/kgsl.h
index a9a621f..0b33e2c 100644
--- a/kgsl.h
+++ b/kgsl.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2008-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef __KGSL_H
#define __KGSL_H
@@ -232,10 +232,8 @@ struct kgsl_memdesc_ops {
#define KGSL_MEMDESC_RECLAIMED BIT(11)
/* Skip reclaim of the memdesc pages */
#define KGSL_MEMDESC_SKIP_RECLAIM BIT(12)
-/* The memdesc is mapped as iomem */
-#define KGSL_MEMDESC_IOMEM BIT(13)
/* The memdesc is hypassigned to HLOS*/
-#define KGSL_MEMDESC_HYPASSIGNED_HLOS BIT(14)
+#define KGSL_MEMDESC_HYPASSIGNED_HLOS BIT(13)
/**
* struct kgsl_memdesc - GPU memory object descriptor
diff --git a/kgsl_snapshot.h b/kgsl_snapshot.h
index bf7860c..709bdf8 100644
--- a/kgsl_snapshot.h
+++ b/kgsl_snapshot.h
@@ -214,6 +214,7 @@ struct kgsl_snapshot_ib_v2 {
#define SNAPSHOT_GMU_MEM_DEBUG 0x04
#define SNAPSHOT_GMU_MEM_BIN_BLOCK 0x05
#define SNAPSHOT_GMU_MEM_CONTEXT_QUEUE 0x06
+#define SNAPSHOT_GMU_MEM_HW_FENCE 0x07
/* GMU memory section data */
struct kgsl_snapshot_gmu_mem {