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

Commit a3601028 authored by Shubhraprakash Das's avatar Shubhraprakash Das Committed by Jordan Crouse
Browse files

msm: kgsl: Read snapshot size from device tree



Different HW targets have different snapshot size requirements.
Read the snaphot size from device tree.

Change-Id: I6340b166d9a192532471f0cefc635a6306c07049
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent b8777b0a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -977,14 +977,18 @@ static struct kobj_type ktype_snapshot = {
int kgsl_device_snapshot_init(struct kgsl_device *device)
{
	int ret;
	unsigned int size;

	if (kgsl_property_read_u32(device, "qcom,snapshot-size", &size))
		size = KGSL_SNAPSHOT_MEMSIZE;

	if (device->snapshot == NULL)
		device->snapshot = kzalloc(KGSL_SNAPSHOT_MEMSIZE, GFP_KERNEL);
		device->snapshot = kzalloc(size, GFP_KERNEL);

	if (device->snapshot == NULL)
		return -ENOMEM;

	device->snapshot_maxsize = KGSL_SNAPSHOT_MEMSIZE;
	device->snapshot_maxsize = size;
	device->snapshot_timestamp = 0;
	device->snapshot_faultcount = 0;