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

Commit cb81bf6e authored by Jordan Crouse's avatar Jordan Crouse Committed by Carter Cooper
Browse files

msm: kgsl: Remove event worker



Scheduling issues were occurring with the GPU event worker after
b7be8076 (msm: kgsl: Unbind the kgsl-event workqueue) was merged.
In certain conditions, it seems that the kgsl-event workqueue
was conflicting with the KGSL worker and slowing it down.

It turns out that everywhere we schedule the event worker
and the dispatcher worker at the same time.  Since the worker
is singlethread, the event worker and the dispatcher run
synchronously anyway, so it makes sense to run the event processor
from within the dispatcher and save the extra schedule.

Change-Id: Ic0dedbad67eb04d41afb6add4477f146dfff9784
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent f2304aea
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -579,7 +579,6 @@ void adreno_cp_callback(struct adreno_device *adreno_dev, int bit)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	kgsl_schedule_work(&device->event_work);
	adreno_dispatcher_schedule(device);
}

+0 −3
Original line number Diff line number Diff line
@@ -3181,7 +3181,6 @@ static void a5xx_irq_storm_worker(struct work_struct *work)
	mutex_unlock(&device->mutex);

	/* Reschedule just to make sure everything retires */
	kgsl_schedule_work(&device->event_work);
	adreno_dispatcher_schedule(device);
}

@@ -3232,8 +3231,6 @@ static void a5xx_cp_callback(struct adreno_device *adreno_dev, int bit)
	}

	a5xx_preemption_trigger(adreno_dev);

	kgsl_schedule_work(&device->event_work);
	adreno_dispatcher_schedule(device);
}

+3 −4
Original line number Diff line number Diff line
@@ -2123,19 +2123,18 @@ static void adreno_dispatcher_work(struct work_struct *work)
			break;
	}

	kgsl_process_event_groups(device);

	/*
	 * dispatcher_do_fault() returns 0 if no faults occurred. If that is the
	 * case, then clean up preemption and try to schedule more work
	 */
	if (dispatcher_do_fault(adreno_dev) == 0) {

		/* Clean up after preemption */
		if (gpudev->preemption_schedule)
			gpudev->preemption_schedule(adreno_dev);

		/* Re-kick the event engine to catch stragglers */
		if (dispatcher->inflight == 0 && count != 0)
			kgsl_schedule_work(&device->event_work);

		/* Run the scheduler for to dispatch new commands */
		_adreno_dispatcher_issuecmds(adreno_dev);
	}
+2 −2
Original line number Diff line number Diff line
@@ -3951,8 +3951,8 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
				PM_QOS_DEFAULT_VALUE);
	}


	device->events_wq = create_singlethread_workqueue("kgsl-events");
	device->events_wq = alloc_workqueue("kgsl-events",
		WQ_UNBOUND | WQ_MEM_RECLAIM, 0);

	/* Initalize the snapshot engine */
	kgsl_device_snapshot_init(device);
+1 −4
Original line number Diff line number Diff line
@@ -275,7 +275,6 @@ struct kgsl_device {
	int mem_log;
	int pwr_log;
	struct kgsl_pwrscale pwrscale;
	struct work_struct event_work;

	int reset_counter; /* Track how many GPU core resets have occured */
	int cff_dump_enable;
@@ -295,8 +294,6 @@ struct kgsl_device {
	.cmdbatch_gate = COMPLETION_INITIALIZER((_dev).cmdbatch_gate),\
	.idle_check_ws = __WORK_INITIALIZER((_dev).idle_check_ws,\
			kgsl_idle_check),\
	.event_work  = __WORK_INITIALIZER((_dev).event_work,\
			kgsl_process_events),\
	.context_idr = IDR_INIT((_dev).context_idr),\
	.wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER((_dev).wait_queue),\
	.active_cnt_wq = __WAIT_QUEUE_HEAD_INITIALIZER((_dev).active_cnt_wq),\
@@ -617,7 +614,7 @@ void kgsl_process_event_group(struct kgsl_device *device,
	struct kgsl_event_group *group);
void kgsl_flush_event_group(struct kgsl_device *device,
		struct kgsl_event_group *group);
void kgsl_process_events(struct work_struct *work);
void kgsl_process_event_groups(struct kgsl_device *device);

void kgsl_context_destroy(struct kref *kref);

Loading