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

Commit 457ba0c0 authored by Jeremy Gebben's avatar Jeremy Gebben Committed by Jordan Crouse
Browse files

msm: kgsl: manage active count in adreno_ioctl()



Most of the adreno specific ioctls do not need the hardware
on. The few that do are perfcounter related, it may be
better at some point to optimize them further to shadow
the counters when the hardware is not on rather than
forcing the power on.

Change-Id: I9ea83106e0aaf3d3ac8d261bdec4e4c2e21c4659
Signed-off-by: default avatarJeremy Gebben <jgebben@codeaurora.org>
parent 086cbdf0
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -3012,8 +3012,17 @@ static long adreno_ioctl(struct kgsl_device_private *dev_priv,
	}
	}
	case IOCTL_KGSL_PERFCOUNTER_GET: {
	case IOCTL_KGSL_PERFCOUNTER_GET: {
		struct kgsl_perfcounter_get *get = data;
		struct kgsl_perfcounter_get *get = data;
		/*
		 * adreno_perfcounter_get() is called by kernel clients
		 * during start(), so it is not safe to take an
		 * active count inside this function.
		 */
		result = kgsl_active_count_get(device);
		if (result)
			break;
		result = adreno_perfcounter_get(adreno_dev, get->groupid,
		result = adreno_perfcounter_get(adreno_dev, get->groupid,
			get->countable, &get->offset, PERFCOUNTER_FLAG_NONE);
			get->countable, &get->offset, PERFCOUNTER_FLAG_NONE);
		kgsl_active_count_put(device);
		break;
		break;
	}
	}
	case IOCTL_KGSL_PERFCOUNTER_PUT: {
	case IOCTL_KGSL_PERFCOUNTER_PUT: {
@@ -3031,8 +3040,12 @@ static long adreno_ioctl(struct kgsl_device_private *dev_priv,
	}
	}
	case IOCTL_KGSL_PERFCOUNTER_READ: {
	case IOCTL_KGSL_PERFCOUNTER_READ: {
		struct kgsl_perfcounter_read *read = data;
		struct kgsl_perfcounter_read *read = data;
		result = kgsl_active_count_get(device);
		if (result)
			break;
		result = adreno_perfcounter_read_group(adreno_dev,
		result = adreno_perfcounter_read_group(adreno_dev,
			read->reads, read->count);
			read->reads, read->count);
		kgsl_active_count_put(device);
		break;
		break;
	}
	}
	default:
	default:
+1 −2
Original line number Original line Diff line number Diff line
@@ -3295,7 +3295,7 @@ static long kgsl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
	struct kgsl_device_private *dev_priv = filep->private_data;
	struct kgsl_device_private *dev_priv = filep->private_data;
	unsigned int nr;
	unsigned int nr;
	kgsl_ioctl_func_t func;
	kgsl_ioctl_func_t func;
	int lock, ret, use_hw;
	int lock, ret, use_hw = 0;
	char ustack[64];
	char ustack[64];
	void *uptr = NULL;
	void *uptr = NULL;


@@ -3363,7 +3363,6 @@ static long kgsl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
			goto done;
			goto done;
		}
		}
		lock = 1;
		lock = 1;
		use_hw = 1;
	}
	}


	if (lock) {
	if (lock) {