Loading drivers/gpu/msm/adreno.c +5 −0 Original line number Diff line number Diff line Loading @@ -2342,6 +2342,11 @@ int adreno_soft_reset(struct kgsl_device *device) return ret; } /* Clear the busy_data stats - we're starting over from scratch */ adreno_dev->busy_data.gpu_busy = 0; adreno_dev->busy_data.vbif_ram_cycles = 0; adreno_dev->busy_data.vbif_starved_ram = 0; /* Set the page table back to the default page table */ adreno_ringbuffer_set_global(adreno_dev, 0); kgsl_mmu_set_pt(&device->mmu, device->mmu.defaultpagetable); Loading drivers/gpu/msm/adreno_dispatch.c +26 −5 Original line number Diff line number Diff line Loading @@ -983,6 +983,13 @@ static void _adreno_dispatcher_issuecmds(struct adreno_device *adreno_dev) spin_unlock(&dispatcher->plist_lock); } static inline void _decrement_submit_now(struct kgsl_device *device) { spin_lock(&device->submit_lock); device->submit_now--; spin_unlock(&device->submit_lock); } /** * adreno_dispatcher_issuecmds() - Issue commmands from pending contexts * @adreno_dev: Pointer to the adreno device struct Loading @@ -992,15 +999,29 @@ static void _adreno_dispatcher_issuecmds(struct adreno_device *adreno_dev) static void adreno_dispatcher_issuecmds(struct adreno_device *adreno_dev) { struct adreno_dispatcher *dispatcher = &adreno_dev->dispatcher; struct kgsl_device *device = KGSL_DEVICE(adreno_dev); spin_lock(&device->submit_lock); /* If state transition to SLUMBER, schedule the work for later */ if (device->slumber == true) { spin_unlock(&device->submit_lock); goto done; } device->submit_now++; spin_unlock(&device->submit_lock); /* If the dispatcher is busy then schedule the work for later */ if (!mutex_trylock(&dispatcher->mutex)) { adreno_dispatcher_schedule(KGSL_DEVICE(adreno_dev)); return; _decrement_submit_now(device); goto done; } _adreno_dispatcher_issuecmds(adreno_dev); mutex_unlock(&dispatcher->mutex); _decrement_submit_now(device); return; done: adreno_dispatcher_schedule(device); } /** Loading Loading @@ -2452,7 +2473,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); Loading Loading @@ -2512,7 +2533,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); kthread_queue_work(&kgsl_driver.worker, &dispatcher->work); } /** Loading Loading @@ -2808,7 +2829,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); kthread_init_work(&dispatcher->work, adreno_dispatcher_work); init_completion(&dispatcher->idle_gate); complete_all(&dispatcher->idle_gate); Loading drivers/gpu/msm/adreno_dispatch.h +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading drivers/gpu/msm/kgsl.c +15 −0 Original line number Diff line number Diff line Loading @@ -4645,6 +4645,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) device->id, device->reg_phys, device->reg_len); rwlock_init(&device->context_lock); spin_lock_init(&device->submit_lock); setup_timer(&device->idle_timer, kgsl_timer, (unsigned long) device); Loading Loading @@ -4788,6 +4789,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"); Loading Loading @@ -4854,6 +4857,18 @@ static int __init kgsl_core_init(void) kgsl_driver.mem_workqueue = alloc_workqueue("kgsl-mementry", WQ_UNBOUND | WQ_MEM_RECLAIM, 0); kthread_init_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(); Loading drivers/gpu/msm/kgsl.h +4 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <linux/regulator/consumer.h> #include <linux/mm.h> #include <linux/uaccess.h> #include <linux/kthread.h> #include <asm/cacheflush.h> /* Loading Loading @@ -151,6 +152,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; Loading Loading @@ -300,7 +303,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; }; Loading Loading
drivers/gpu/msm/adreno.c +5 −0 Original line number Diff line number Diff line Loading @@ -2342,6 +2342,11 @@ int adreno_soft_reset(struct kgsl_device *device) return ret; } /* Clear the busy_data stats - we're starting over from scratch */ adreno_dev->busy_data.gpu_busy = 0; adreno_dev->busy_data.vbif_ram_cycles = 0; adreno_dev->busy_data.vbif_starved_ram = 0; /* Set the page table back to the default page table */ adreno_ringbuffer_set_global(adreno_dev, 0); kgsl_mmu_set_pt(&device->mmu, device->mmu.defaultpagetable); Loading
drivers/gpu/msm/adreno_dispatch.c +26 −5 Original line number Diff line number Diff line Loading @@ -983,6 +983,13 @@ static void _adreno_dispatcher_issuecmds(struct adreno_device *adreno_dev) spin_unlock(&dispatcher->plist_lock); } static inline void _decrement_submit_now(struct kgsl_device *device) { spin_lock(&device->submit_lock); device->submit_now--; spin_unlock(&device->submit_lock); } /** * adreno_dispatcher_issuecmds() - Issue commmands from pending contexts * @adreno_dev: Pointer to the adreno device struct Loading @@ -992,15 +999,29 @@ static void _adreno_dispatcher_issuecmds(struct adreno_device *adreno_dev) static void adreno_dispatcher_issuecmds(struct adreno_device *adreno_dev) { struct adreno_dispatcher *dispatcher = &adreno_dev->dispatcher; struct kgsl_device *device = KGSL_DEVICE(adreno_dev); spin_lock(&device->submit_lock); /* If state transition to SLUMBER, schedule the work for later */ if (device->slumber == true) { spin_unlock(&device->submit_lock); goto done; } device->submit_now++; spin_unlock(&device->submit_lock); /* If the dispatcher is busy then schedule the work for later */ if (!mutex_trylock(&dispatcher->mutex)) { adreno_dispatcher_schedule(KGSL_DEVICE(adreno_dev)); return; _decrement_submit_now(device); goto done; } _adreno_dispatcher_issuecmds(adreno_dev); mutex_unlock(&dispatcher->mutex); _decrement_submit_now(device); return; done: adreno_dispatcher_schedule(device); } /** Loading Loading @@ -2452,7 +2473,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); Loading Loading @@ -2512,7 +2533,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); kthread_queue_work(&kgsl_driver.worker, &dispatcher->work); } /** Loading Loading @@ -2808,7 +2829,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); kthread_init_work(&dispatcher->work, adreno_dispatcher_work); init_completion(&dispatcher->idle_gate); complete_all(&dispatcher->idle_gate); Loading
drivers/gpu/msm/adreno_dispatch.h +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
drivers/gpu/msm/kgsl.c +15 −0 Original line number Diff line number Diff line Loading @@ -4645,6 +4645,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) device->id, device->reg_phys, device->reg_len); rwlock_init(&device->context_lock); spin_lock_init(&device->submit_lock); setup_timer(&device->idle_timer, kgsl_timer, (unsigned long) device); Loading Loading @@ -4788,6 +4789,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"); Loading Loading @@ -4854,6 +4857,18 @@ static int __init kgsl_core_init(void) kgsl_driver.mem_workqueue = alloc_workqueue("kgsl-mementry", WQ_UNBOUND | WQ_MEM_RECLAIM, 0); kthread_init_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(); Loading
drivers/gpu/msm/kgsl.h +4 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <linux/regulator/consumer.h> #include <linux/mm.h> #include <linux/uaccess.h> #include <linux/kthread.h> #include <asm/cacheflush.h> /* Loading Loading @@ -151,6 +152,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; Loading Loading @@ -300,7 +303,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; }; Loading