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

Commit 68996c38 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Add support to disable CP Crash Dumper"

parents ad9c337a ca6be18a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -836,6 +836,7 @@ void a5xx_snapshot(struct adreno_device *adreno_dev,
	a5xx_hwcg_set(adreno_dev, false);

	/* Try to run the crash dumper */
	if (device->snapshot_crashdumper)
		_a5xx_do_crashdump(device);

	kgsl_snapshot_add_section(device, KGSL_SNAPSHOT_SECTION_REGS,
+4 −0
Original line number Diff line number Diff line
@@ -266,6 +266,10 @@ struct kgsl_device {

	u32 snapshot_faultcount;	/* Total number of faults since boot */
	bool force_panic;		/* Force panic after snapshot dump */

	/* Use CP Crash dumper to get GPU snapshot*/
	bool snapshot_crashdumper;

	struct kobject snapshot_kobj;

	struct kobject ppd_kobj;
+35 −0
Original line number Diff line number Diff line
@@ -826,6 +826,32 @@ static ssize_t force_panic_store(struct kgsl_device *device, const char *buf,

	return (ssize_t) ret < 0 ? ret : count;
}

/* Show the snapshot_crashdumper request status */
static ssize_t snapshot_crashdumper_show(struct kgsl_device *device, char *buf)
{
	return snprintf(buf, PAGE_SIZE, "%d\n", device->snapshot_crashdumper);
}


/* Store the value to snapshot_crashdumper*/
static ssize_t snapshot_crashdumper_store(struct kgsl_device *device,
	const char *buf, size_t count)
{
	unsigned int val = 0;
	int ret;

	if (device && count > 0)
		device->snapshot_crashdumper = 1;

	ret = kgsl_sysfs_store(buf, &val);

	if (!ret && device)
		device->snapshot_crashdumper = (bool)val;

	return (ssize_t) ret < 0 ? ret : count;
}

/* Show the timestamp of the last collected snapshot */
static ssize_t timestamp_show(struct kgsl_device *device, char *buf)
{
@@ -852,6 +878,8 @@ struct kgsl_snapshot_attribute attr_##_name = { \
static SNAPSHOT_ATTR(timestamp, 0444, timestamp_show, NULL);
static SNAPSHOT_ATTR(faultcount, 0644, faultcount_show, faultcount_store);
static SNAPSHOT_ATTR(force_panic, 0644, force_panic_show, force_panic_store);
static SNAPSHOT_ATTR(snapshot_crashdumper, 0644, snapshot_crashdumper_show,
	snapshot_crashdumper_store);

static ssize_t snapshot_sysfs_show(struct kobject *kobj,
	struct attribute *attr, char *buf)
@@ -932,6 +960,7 @@ int kgsl_device_snapshot_init(struct kgsl_device *device)
	device->snapshot = NULL;
	device->snapshot_faultcount = 0;
	device->force_panic = 0;
	device->snapshot_crashdumper = 1;

	ret = kobject_init_and_add(&device->snapshot_kobj, &ktype_snapshot,
		&device->dev->kobj, "snapshot");
@@ -952,6 +981,11 @@ int kgsl_device_snapshot_init(struct kgsl_device *device)

	ret  = sysfs_create_file(&device->snapshot_kobj,
			&attr_force_panic.attr);
	if (ret)
		goto done;

	ret  = sysfs_create_file(&device->snapshot_kobj,
			&attr_snapshot_crashdumper.attr);
done:
	return ret;
}
@@ -977,6 +1011,7 @@ void kgsl_device_snapshot_close(struct kgsl_device *device)
	device->snapshot_memory.size = 0;
	device->snapshot_faultcount = 0;
	device->force_panic = 0;
	device->snapshot_crashdumper = 1;
}
EXPORT_SYMBOL(kgsl_device_snapshot_close);