Merge "msm: kgsl: convert some workqueues to use kthreads."
This commit is contained in:
commit
fb2390c8b1
5 changed files with 26 additions and 9 deletions
|
@ -2443,7 +2443,7 @@ static void _dispatcher_power_down(struct adreno_device *adreno_dev)
|
|||
mutex_unlock(&device->mutex);
|
||||
}
|
||||
|
||||
static void adreno_dispatcher_work(struct work_struct *work)
|
||||
static void adreno_dispatcher_work(struct kthread_work *work)
|
||||
{
|
||||
struct adreno_dispatcher *dispatcher =
|
||||
container_of(work, struct adreno_dispatcher, work);
|
||||
|
@ -2503,7 +2503,7 @@ void adreno_dispatcher_schedule(struct kgsl_device *device)
|
|||
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
|
||||
struct adreno_dispatcher *dispatcher = &adreno_dev->dispatcher;
|
||||
|
||||
kgsl_schedule_work(&dispatcher->work);
|
||||
queue_kthread_work(&kgsl_driver.worker, &dispatcher->work);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2799,7 +2799,7 @@ int adreno_dispatcher_init(struct adreno_device *adreno_dev)
|
|||
setup_timer(&dispatcher->fault_timer, adreno_dispatcher_fault_timer,
|
||||
(unsigned long) adreno_dev);
|
||||
|
||||
INIT_WORK(&dispatcher->work, adreno_dispatcher_work);
|
||||
init_kthread_work(&dispatcher->work, adreno_dispatcher_work);
|
||||
|
||||
init_completion(&dispatcher->idle_gate);
|
||||
complete_all(&dispatcher->idle_gate);
|
||||
|
|
|
@ -91,7 +91,7 @@ struct adreno_dispatcher {
|
|||
atomic_t fault;
|
||||
struct plist_head pending;
|
||||
spinlock_t plist_lock;
|
||||
struct work_struct work;
|
||||
struct kthread_work work;
|
||||
struct kobject kobj;
|
||||
struct completion idle_gate;
|
||||
unsigned int disp_preempt_fair_sched;
|
||||
|
|
|
@ -4864,6 +4864,8 @@ static void kgsl_core_exit(void)
|
|||
static int __init kgsl_core_init(void)
|
||||
{
|
||||
int result = 0;
|
||||
struct sched_param param = { .sched_priority = 2 };
|
||||
|
||||
/* alloc major and minor device numbers */
|
||||
result = alloc_chrdev_region(&kgsl_driver.major, 0, KGSL_DEVICE_MAX,
|
||||
"kgsl");
|
||||
|
@ -4929,6 +4931,18 @@ static int __init kgsl_core_init(void)
|
|||
kgsl_driver.mem_workqueue = alloc_workqueue("kgsl-mementry",
|
||||
WQ_MEM_RECLAIM, 0);
|
||||
|
||||
init_kthread_worker(&kgsl_driver.worker);
|
||||
|
||||
kgsl_driver.worker_thread = kthread_run(kthread_worker_fn,
|
||||
&kgsl_driver.worker, "kgsl_worker_thread");
|
||||
|
||||
if (IS_ERR(kgsl_driver.worker_thread)) {
|
||||
pr_err("unable to start kgsl thread\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
sched_setscheduler(kgsl_driver.worker_thread, SCHED_FIFO, ¶m);
|
||||
|
||||
kgsl_events_init();
|
||||
|
||||
result = kgsl_drawobjs_cache_init();
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/dma-attrs.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
/*
|
||||
|
@ -152,6 +153,8 @@ struct kgsl_driver {
|
|||
unsigned int full_cache_threshold;
|
||||
struct workqueue_struct *workqueue;
|
||||
struct workqueue_struct *mem_workqueue;
|
||||
struct kthread_worker worker;
|
||||
struct task_struct *worker_thread;
|
||||
};
|
||||
|
||||
extern struct kgsl_driver kgsl_driver;
|
||||
|
@ -301,7 +304,7 @@ struct kgsl_event {
|
|||
void *priv;
|
||||
struct list_head node;
|
||||
unsigned int created;
|
||||
struct work_struct work;
|
||||
struct kthread_work work;
|
||||
int result;
|
||||
struct kgsl_event_group *group;
|
||||
};
|
||||
|
|
|
@ -32,7 +32,7 @@ static inline void signal_event(struct kgsl_device *device,
|
|||
{
|
||||
list_del(&event->node);
|
||||
event->result = result;
|
||||
queue_work(device->events_wq, &event->work);
|
||||
queue_kthread_work(&kgsl_driver.worker, &event->work);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,7 +42,7 @@ static inline void signal_event(struct kgsl_device *device,
|
|||
* Each event callback has its own work struct and is run on a event specific
|
||||
* workqeuue. This is the worker that queues up the event callback function.
|
||||
*/
|
||||
static void _kgsl_event_worker(struct work_struct *work)
|
||||
static void _kgsl_event_worker(struct kthread_work *work)
|
||||
{
|
||||
struct kgsl_event *event = container_of(work, struct kgsl_event, work);
|
||||
int id = KGSL_CONTEXT_ID(event->context);
|
||||
|
@ -282,7 +282,7 @@ int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group,
|
|||
event->created = jiffies;
|
||||
event->group = group;
|
||||
|
||||
INIT_WORK(&event->work, _kgsl_event_worker);
|
||||
init_kthread_work(&event->work, _kgsl_event_worker);
|
||||
|
||||
trace_kgsl_register_event(KGSL_CONTEXT_ID(context), timestamp, func);
|
||||
|
||||
|
@ -297,7 +297,7 @@ int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group,
|
|||
|
||||
if (timestamp_cmp(retired, timestamp) >= 0) {
|
||||
event->result = KGSL_EVENT_RETIRED;
|
||||
queue_work(device->events_wq, &event->work);
|
||||
queue_kthread_work(&kgsl_driver.worker, &event->work);
|
||||
spin_unlock(&group->lock);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue