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

Commit 5bdb616c authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Skip gpu registers dumping when gx is off"

parents f1a95ed7 c73a87b8
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -1674,13 +1674,25 @@ static inline const char *_kgsl_context_comm(struct kgsl_context *context)


static void adreno_fault_header(struct kgsl_device *device,
		struct adreno_ringbuffer *rb, struct kgsl_drawobj_cmd *cmdobj)
		struct adreno_ringbuffer *rb, struct kgsl_drawobj_cmd *cmdobj,
		int fault, bool gx_on)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct kgsl_drawobj *drawobj = DRAWOBJ(cmdobj);
	unsigned int status, rptr, wptr, ib1sz, ib2sz;
	uint64_t ib1base, ib2base;

	/*
	 * GPU registers can't be accessed if the gx headswitch is off.
	 * During the gx off case access to GPU gx blocks will show data
	 * as 0x5c00bd00. Hence skip adreno fault header dump.
	 */
	if (!gx_on) {
		dev_err(device->dev, "%s fault and gx is off\n",
				fault & ADRENO_GMU_FAULT ? "GMU" : "GPU");
		return;
	}

	adreno_readreg(adreno_dev, ADRENO_REG_RBBM_STATUS, &status);
	adreno_readreg(adreno_dev, ADRENO_REG_CP_RB_RPTR, &rptr);
	adreno_readreg(adreno_dev, ADRENO_REG_CP_RB_WPTR, &wptr);
@@ -2036,13 +2048,14 @@ static void recover_dispatch_q(struct kgsl_device *device,
}

static void do_header_and_snapshot(struct kgsl_device *device, int fault,
		struct adreno_ringbuffer *rb, struct kgsl_drawobj_cmd *cmdobj)
		struct adreno_ringbuffer *rb, struct kgsl_drawobj_cmd *cmdobj,
		bool gx_on)
{
	struct kgsl_drawobj *drawobj = DRAWOBJ(cmdobj);

	/* Always dump the snapshot on a non-drawobj failure */
	if (cmdobj == NULL) {
		adreno_fault_header(device, rb, NULL);
		adreno_fault_header(device, rb, NULL, fault, gx_on);
		kgsl_device_snapshot(device, NULL, fault & ADRENO_GMU_FAULT);
		return;
	}
@@ -2052,7 +2065,7 @@ static void do_header_and_snapshot(struct kgsl_device *device, int fault,
		return;

	/* Print the fault header */
	adreno_fault_header(device, rb, cmdobj);
	adreno_fault_header(device, rb, cmdobj, fault, gx_on);

	if (!(drawobj->context->flags & KGSL_CONTEXT_NO_SNAPSHOT))
		kgsl_device_snapshot(device, drawobj->context,
@@ -2180,7 +2193,7 @@ static int dispatcher_do_fault(struct adreno_device *adreno_dev)
		adreno_readreg64(adreno_dev, ADRENO_REG_CP_IB1_BASE,
			ADRENO_REG_CP_IB1_BASE_HI, &base);

	do_header_and_snapshot(device, fault, hung_rb, cmdobj);
	do_header_and_snapshot(device, fault, hung_rb, cmdobj, gx_on);

	/* Turn off the KEEPALIVE vote from the ISR for hard fault */
	if (gpudev->gpu_keepalive && fault & ADRENO_HARD_FAULT)
+4 −4
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
@@ -839,9 +839,6 @@ void adreno_snapshot(struct kgsl_device *device, struct kgsl_snapshot *snapshot,

	snapshot_frozen_objsize = 0;

	setup_fault_process(device, snapshot,
			context ? context->proc_priv : NULL);

	/* Add GPU specific sections - registers mainly, but other stuff too */
	if (gpudev->snapshot)
		gpudev->snapshot(adreno_dev, snapshot);
@@ -851,6 +848,9 @@ void adreno_snapshot(struct kgsl_device *device, struct kgsl_snapshot *snapshot,
			!gmu_dev_ops->gx_is_on(adreno_dev))
		return;

	setup_fault_process(device, snapshot,
			context ? context->proc_priv : NULL);

	adreno_readreg64(adreno_dev, ADRENO_REG_CP_IB1_BASE,
			ADRENO_REG_CP_IB1_BASE_HI, &snapshot->ib1base);
	adreno_readreg(adreno_dev, ADRENO_REG_CP_IB1_BUFSZ, &snapshot->ib1size);