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

Commit 6fcfc349 authored by Pankaj Gupta's avatar Pankaj Gupta
Browse files

msm: kgsl: Add chipid check of a620v1 for rbbm batch registers



This patch enables reading rbbm batch registers multiple time
when the read value is 0xdeafbead for a620_v1.
For rbbm batch registers when the reg read value is 0xdeafbead,
there is a possibility that this value could be incorrect.
To get the actual register value, retry reading the register for
several times.

Change-Id: Id12b9d2643740e4aa2b7e46c2231958128c97f6d
Signed-off-by: default avatarPankaj Gupta <gpankaj@codeaurora.org>
parent 46e7ca64
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -3042,14 +3042,17 @@ static void adreno_retry_rbbm_read(struct kgsl_device *device,
	}
}

static inline bool adreno_is_a650_rbbm_batch_reg(unsigned int offsetwords)
static bool adreno_is_rbbm_batch_reg(struct kgsl_device *device,
	unsigned int offsetwords)
{
	if (adreno_is_a650(ADRENO_DEVICE(device)) ||
		adreno_is_a620v1(ADRENO_DEVICE(device))) {
		if (((offsetwords > 0x0) && (offsetwords < 0x3FF)) ||
			((offsetwords > 0x4FA) && (offsetwords < 0x53F)) ||
			((offsetwords > 0x556) && (offsetwords < 0x5FF)) ||
			((offsetwords > 0xF400) && (offsetwords < 0xFFFF)))
			return  true;

	}
	return false;
}

@@ -3064,8 +3067,8 @@ static void adreno_regread(struct kgsl_device *device, unsigned int offsetwords,
	adreno_read(device, device->reg_virt, offsetwords, value,
						device->reg_len);

	if ((*value == 0xdeafbead) && adreno_is_a650(ADRENO_DEVICE(device)) &&
		adreno_is_a650_rbbm_batch_reg(offsetwords))
	if ((*value == 0xdeafbead) &&
		adreno_is_rbbm_batch_reg(device, offsetwords))
		adreno_retry_rbbm_read(device, device->reg_virt, offsetwords,
			value, device->reg_len);
}
+6 −0
Original line number Diff line number Diff line
@@ -1209,6 +1209,12 @@ static inline int adreno_is_a650_family(struct adreno_device *adreno_dev)
	return (rev == ADRENO_REV_A650 || rev == ADRENO_REV_A620);
}

static inline int adreno_is_a620v1(struct adreno_device *adreno_dev)
{
	return (ADRENO_GPUREV(adreno_dev) == ADRENO_REV_A620) &&
		(ADRENO_CHIPID_PATCH(adreno_dev->chipid) == 0);
}

static inline int adreno_is_a640v2(struct adreno_device *adreno_dev)
{
	return (ADRENO_GPUREV(adreno_dev) == ADRENO_REV_A640) &&