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

Commit c7b80d71 authored by Shubhraprakash Das's avatar Shubhraprakash Das Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: For soft fault detect only check rbbm_status



When deciding whether device has faulted or not using soft fault
detect only check the status of rbbm_status register and skip
checking interrupt status. Also, if device is detected to be
idle based on rbbm_status then there is no need to check the
timestamps because if another thread is about to submit
something to hardware then the timestamps will not match.

Change-Id: I3c14ec6ef18040a5b8ace250c4deaa4e693544bb
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent 709332e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2213,7 +2213,7 @@ bool adreno_hw_isidle(struct adreno_device *adreno_dev)
	adreno_readreg(adreno_dev, ADRENO_REG_RBBM_STATUS,
		&reg_rbbm_status);

	if (reg_rbbm_status & ~0x80000001)
	if (reg_rbbm_status & ADRENO_RBBM_STATUS_BUSY_MASK)
		return false;

	/* Don't consider ourselves idle if there is an IRQ pending */
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@
#define DEVICE_3D_NAME "kgsl-3d"
#define DEVICE_3D0_NAME "kgsl-3d0"

#define ADRENO_RBBM_STATUS_BUSY_MASK	~0x80000001

#define ADRENO_PRIORITY_MAX_RB_LEVELS	4

/* ADRENO_DEVICE - Given a kgsl_device return the adreno device struct */
+7 −11
Original line number Diff line number Diff line
@@ -170,24 +170,20 @@ static void fault_detect_read(struct kgsl_device *device)
static inline bool _isidle(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	unsigned int ts, i;
	unsigned int i;
	unsigned int reg_rbbm_status;

	if (!kgsl_state_is_awake(device))
		goto ret;

	/* If GPU HW status is not idle then return false */
	if (!adreno_hw_isidle(adreno_dev))
		return false;
	adreno_readreg(adreno_dev, ADRENO_REG_RBBM_STATUS,
			&reg_rbbm_status);

	/*
	 * only compare the current RB timestamp because the device has gone
	 * idle and therefore only the current RB ts can be equal, the other
	 * RB's may not be scheduled by dispatcher yet
	 * Check if gpu is busy by checking bits in RBBM_STATUS register
	 * which indicate gpu activity
	 */
	if (adreno_rb_readtimestamp(device,
		adreno_dev->cur_rb, KGSL_TIMESTAMP_RETIRED, &ts))
		return false;
	if (ts != adreno_dev->cur_rb->timestamp)
	if (reg_rbbm_status & ADRENO_RBBM_STATUS_BUSY_MASK)
		return false;
ret:
	for (i = 0; i < adreno_ft_regs_num; i++)