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

Commit 6d79ee20 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Featurize soft fault detect" into msm-4.8

parents 8810e5fa ae67281c
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
		.major = 0,
		.minor = 6,
		.patchid = 0x00,
		.features = ADRENO_SOFT_FAULT_DETECT,
		.pm4fw_name = "a300_pm4.fw",
		.pfpfw_name = "a300_pfp.fw",
		.gpudev = &adreno_a3xx_gpudev,
@@ -32,6 +33,7 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
		.major = 0,
		.minor = 6,
		.patchid = 0x20,
		.features = ADRENO_SOFT_FAULT_DETECT,
		.pm4fw_name = "a300_pm4.fw",
		.pfpfw_name = "a300_pfp.fw",
		.gpudev = &adreno_a3xx_gpudev,
@@ -44,6 +46,7 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
		.major = 0,
		.minor = 4,
		.patchid = 0x00,
		.features = ADRENO_SOFT_FAULT_DETECT,
		.pm4fw_name = "a300_pm4.fw",
		.pfpfw_name = "a300_pfp.fw",
		.gpudev = &adreno_a3xx_gpudev,
@@ -56,7 +59,7 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
		.major = 0,
		.minor = 5,
		.patchid = ANY_ID,
		.features = 0,
		.features = ADRENO_SOFT_FAULT_DETECT,
		.pm4fw_name = "a420_pm4.fw",
		.pfpfw_name = "a420_pfp.fw",
		.gpudev = &adreno_a4xx_gpudev,
@@ -70,7 +73,7 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
		.minor = 0,
		.patchid = ANY_ID,
		.features = ADRENO_USES_OCMEM | ADRENO_WARM_START |
					ADRENO_USE_BOOTSTRAP,
			ADRENO_USE_BOOTSTRAP | ADRENO_SOFT_FAULT_DETECT,
		.pm4fw_name = "a420_pm4.fw",
		.pfpfw_name = "a420_pfp.fw",
		.gpudev = &adreno_a4xx_gpudev,
@@ -92,7 +95,8 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
		.patchid = ANY_ID,
		.features = ADRENO_USES_OCMEM  | ADRENO_WARM_START |
			ADRENO_USE_BOOTSTRAP | ADRENO_SPTP_PC | ADRENO_PPD |
			ADRENO_CONTENT_PROTECTION | ADRENO_PREEMPTION,
			ADRENO_CONTENT_PROTECTION | ADRENO_PREEMPTION |
			ADRENO_SOFT_FAULT_DETECT,
		.pm4fw_name = "a420_pm4.fw",
		.pfpfw_name = "a420_pfp.fw",
		.gpudev = &adreno_a4xx_gpudev,
@@ -116,7 +120,8 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
		.minor = 8,
		.patchid = ANY_ID,
		.features = ADRENO_USES_OCMEM  | ADRENO_WARM_START |
			ADRENO_USE_BOOTSTRAP | ADRENO_SPTP_PC,
			ADRENO_USE_BOOTSTRAP | ADRENO_SPTP_PC |
			ADRENO_SOFT_FAULT_DETECT,
		.pm4fw_name = "a420_pm4.fw",
		.pfpfw_name = "a420_pfp.fw",
		.gpudev = &adreno_a4xx_gpudev,
+10 −4
Original line number Diff line number Diff line
@@ -48,6 +48,10 @@ static bool nopreempt;
module_param(nopreempt, bool, 0444);
MODULE_PARM_DESC(nopreempt, "Disable GPU preemption");

static bool swfdetect;
module_param(swfdetect, bool, 0444);
MODULE_PARM_DESC(swfdetect, "Enable soft fault detection");

#define DRIVER_VERSION_MAJOR   3
#define DRIVER_VERSION_MINOR   1

@@ -92,7 +96,6 @@ static struct adreno_device device_3d0 = {
	.pm4_fw = NULL,
	.ft_policy = KGSL_FT_DEFAULT_POLICY,
	.ft_pf_policy = KGSL_FT_PAGEFAULT_DEFAULT_POLICY,
	.fast_hang_detect = 1,
	.long_ib_detect = 1,
	.input_work = __WORK_INITIALIZER(device_3d0.input_work,
		adreno_input_work),
@@ -1107,7 +1110,11 @@ static int adreno_remove(struct platform_device *pdev)
static void adreno_fault_detect_init(struct adreno_device *adreno_dev)
{
	struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev);
	int i, val = adreno_dev->fast_hang_detect;
	int i;

	if (!(swfdetect ||
			ADRENO_FEATURE(adreno_dev, ADRENO_SOFT_FAULT_DETECT)))
		return;

	/* Disable the fast hang detect bit until we know its a go */
	adreno_dev->fast_hang_detect = 0;
@@ -1136,7 +1143,6 @@ static void adreno_fault_detect_init(struct adreno_device *adreno_dev)

	set_bit(ADRENO_DEVICE_SOFT_FAULT_DETECT, &adreno_dev->priv);

	if (val)
	adreno_fault_detect_start(adreno_dev);
}

+2 −0
Original line number Diff line number Diff line
@@ -108,6 +108,8 @@
#define ADRENO_64BIT BIT(9)
/* The GPU supports retention for cpz registers */
#define ADRENO_CPZ_RETENTION BIT(10)
/* The core has soft fault detection available */
#define ADRENO_SOFT_FAULT_DETECT BIT(11)

/*
 * Adreno GPU quirks - control bits for various workarounds
+3 −0
Original line number Diff line number Diff line
@@ -237,6 +237,9 @@ static int fault_detect_read_compare(struct adreno_device *adreno_dev)
	int i, ret = 0;
	unsigned int ts;

	if (!test_bit(ADRENO_DEVICE_SOFT_FAULT_DETECT, &adreno_dev->priv))
		return 1;

	/* Check to see if the device is idle - if so report no hang */
	if (_isidle(adreno_dev) == true)
		ret = 1;
+0 −30
Original line number Diff line number Diff line
@@ -77,34 +77,6 @@ static unsigned int _ft_pagefault_policy_show(struct adreno_device *adreno_dev)
	return adreno_dev->ft_pf_policy;
}

static int _ft_fast_hang_detect_store(struct adreno_device *adreno_dev,
		unsigned int val)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	if (!test_bit(ADRENO_DEVICE_SOFT_FAULT_DETECT, &adreno_dev->priv))
		return 0;

	mutex_lock(&device->mutex);

	if (val) {
		if (!kgsl_active_count_get(device)) {
			adreno_fault_detect_start(adreno_dev);
			kgsl_active_count_put(device);
		}
	} else
		adreno_fault_detect_stop(adreno_dev);

	mutex_unlock(&device->mutex);

	return 0;
}

static unsigned int _ft_fast_hang_detect_show(struct adreno_device *adreno_dev)
{
	return adreno_dev->fast_hang_detect;
}

static int _ft_long_ib_detect_store(struct adreno_device *adreno_dev,
		unsigned int val)
{
@@ -316,7 +288,6 @@ static ssize_t _sysfs_show_bool(struct device *dev,

static ADRENO_SYSFS_U32(ft_policy);
static ADRENO_SYSFS_U32(ft_pagefault_policy);
static ADRENO_SYSFS_BOOL(ft_fast_hang_detect);
static ADRENO_SYSFS_BOOL(ft_long_ib_detect);
static ADRENO_SYSFS_BOOL(ft_hang_intr_status);

@@ -334,7 +305,6 @@ static ADRENO_SYSFS_BOOL(throttling);
static const struct device_attribute *_attr_list[] = {
	&adreno_attr_ft_policy.attr,
	&adreno_attr_ft_pagefault_policy.attr,
	&adreno_attr_ft_fast_hang_detect.attr,
	&adreno_attr_ft_long_ib_detect.attr,
	&adreno_attr_ft_hang_intr_status.attr,
	&dev_attr_wake_nice.attr,