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

Commit 5da70b20 authored by Kyle Piefer's avatar Kyle Piefer Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Fix the preemption sysfs node



The preemption sysfs node does not change the assigned ringbuffer
for existing draw contexts, so turning preemption from
on to off does not work. Add a loop that goes through
each context and updates the draw contexts to fix this.

Change-Id: I9c5b3bcdc4cfd70f5c1da6f6458b9e1290c0444f
Signed-off-by: default avatarKyle Piefer <kpiefer@codeaurora.org>
parent 0d30e3c9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -208,6 +208,9 @@ static int _preemption_store(struct adreno_device *adreno_dev,
		unsigned int val)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct kgsl_context *context;
	struct adreno_context *drawctxt;
	int id;

	mutex_lock(&device->mutex);

@@ -221,6 +224,15 @@ static int _preemption_store(struct adreno_device *adreno_dev,
	kgsl_pwrctrl_change_state(device, KGSL_STATE_SUSPEND);
	change_bit(ADRENO_DEVICE_PREEMPTION, &adreno_dev->priv);
	adreno_dev->cur_rb = &(adreno_dev->ringbuffers[0]);

	/* Update the ringbuffer for each draw context */
	write_lock(&device->context_lock);
	idr_for_each_entry(&device->context_idr, context, id) {
		drawctxt = ADRENO_CONTEXT(context);
		drawctxt->rb = adreno_ctx_get_rb(adreno_dev, drawctxt);
	}
	write_unlock(&device->context_lock);

	kgsl_pwrctrl_change_state(device, KGSL_STATE_SLUMBER);

	mutex_unlock(&device->mutex);