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

Commit c05883a1 authored by Rajesh Kemisetti's avatar Rajesh Kemisetti
Browse files

msm: kgsl: Log context type in case of GPU faults



Log context type in case of GPU page faults or GPU faults.
Also add Vulkan context type to distinguish it from GL.

Change-Id: I7b93bf645b80abe82f2d6aa379296b2fffceb684
Signed-off-by: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
parent 7a6e9213
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1716,8 +1716,9 @@ static void adreno_fault_header(struct kgsl_device *device,
			ib2base, ib2sz, drawctxt->rb->id);

		pr_fault(device, drawobj,
			"gpu fault ctx %d ts %d status %8.8X rb %4.4x/%4.4x ib1 %16.16llX/%4.4x ib2 %16.16llX/%4.4x\n",
			drawobj->context->id, drawobj->timestamp, status,
			"gpu fault ctx %d ctx_type %s ts %d status %8.8X rb %4.4x/%4.4x ib1 %16.16llX/%4.4x ib2 %16.16llX/%4.4x\n",
			drawobj->context->id, get_api_type_str(drawctxt->type),
			drawobj->timestamp, status,
			rptr, wptr, ib1base, ib1sz, ib2base, ib2sz);

		if (rb != NULL)
+13 −1
Original line number Diff line number Diff line
/* Copyright (c) 2002,2007-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2018, 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
@@ -139,4 +139,16 @@ void adreno_drawctxt_invalidate(struct kgsl_device *device,
void adreno_drawctxt_dump(struct kgsl_device *device,
		struct kgsl_context *context);

static struct adreno_context_type ctxt_type_table[] = {KGSL_CONTEXT_TYPES};

static inline const char *get_api_type_str(unsigned int type)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(ctxt_type_table) - 1; i++) {
		if (ctxt_type_table[i].type == type)
			return ctxt_type_table[i].str;
	}
	return "UNKNOWN";
}
#endif  /* __ADRENO_DRAWCTXT_H */
+1 −14
Original line number Diff line number Diff line
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2018, 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
@@ -77,19 +77,6 @@
#define SIZE_PIPE_ENTRY(cnt) (50 + (cnt) * 62)
#define SIZE_LOG_ENTRY(cnt) (6 + (cnt) * 5)

static struct adreno_context_type ctxt_type_table[] = {KGSL_CONTEXT_TYPES};

static const char *get_api_type_str(unsigned int type)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(ctxt_type_table) - 1; i++) {
		if (ctxt_type_table[i].type == type)
			return ctxt_type_table[i].str;
	}
	return "UNKNOWN";
}

static inline uint _ib_start(struct adreno_device *adreno_dev,
			 unsigned int *cmds)
{
+2 −1
Original line number Diff line number Diff line
@@ -97,7 +97,8 @@ enum kgsl_event_results {
	{ KGSL_CONTEXT_TYPE_GL, "GL" }, \
	{ KGSL_CONTEXT_TYPE_CL, "CL" }, \
	{ KGSL_CONTEXT_TYPE_C2D, "C2D" }, \
	{ KGSL_CONTEXT_TYPE_RS, "RS" }
	{ KGSL_CONTEXT_TYPE_RS, "RS" }, \
	{ KGSL_CONTEXT_TYPE_VK, "VK" }

#define KGSL_CONTEXT_ID(_context) \
	((_context != NULL) ? (_context)->id : KGSL_MEMSTORE_GLOBAL)
+12 −2
Original line number Diff line number Diff line
@@ -836,11 +836,21 @@ static int kgsl_iommu_fault_handler(struct iommu_domain *domain,
		no_page_fault_log = kgsl_mmu_log_fault_addr(mmu, ptbase, addr);

	if (!no_page_fault_log && __ratelimit(&_rs)) {
		const char *api_str;

		if (context != NULL) {
			struct adreno_context *drawctxt =
					ADRENO_CONTEXT(context);

			api_str = get_api_type_str(drawctxt->type);
		} else
			api_str = "UNKNOWN";

		KGSL_MEM_CRIT(ctx->kgsldev,
			"GPU PAGE FAULT: addr = %lX pid= %d\n", addr, ptname);
		KGSL_MEM_CRIT(ctx->kgsldev,
			"context=%s TTBR0=0x%llx CIDR=0x%x (%s %s fault)\n",
			ctx->name, ptbase, contextidr,
			"context=%s ctx_type=%s TTBR0=0x%llx CIDR=0x%x (%s %s fault)\n",
			ctx->name, api_str, ptbase, contextidr,
			write ? "write" : "read", fault_type);

		if (gpudev->iommu_fault_block) {
Loading