msm: kgsl: Use event workqueue for event work instead of RT Kthread worker

Currently, both dispatcher work and event work is handled by real time
kthread worker. This results in two problems:

1) Event work can result in freeing memory either as part of
free on timestamp or while putting a context. As freeing memory
can take time it shouldn't be done as part of RT thread as it can
result in hogging CPU for longer duration and not giving chance to
other tasks to run.

2) Event work remains unprocessed till kthread worker finishes
dispatcher work. As dispatcher work first schedules the event
work for previously retired commands and then tries to submit
new commands. The scheduled event work doesn't get processed till
dispatcher work finishes. This can result in even longer delays
in case dispatcher work gets blocked after scheduling event work
because of mutexes locks etc.

To avoid this, use event workqueue for event work. This will decouple
both dispatcher and event work and will also make sure that high
latency work like freeing-up memory is not done as part of RT thread.

Change-Id: I74734a1bc177feecaac6626109349752da44da80
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2 files changed