Lines Matching refs:gpu
159 spin_lock(&ptdev->gpu->reqs_lock); in panthor_gpu_irq_handler()
160 if (status & ptdev->gpu->pending_reqs) { in panthor_gpu_irq_handler()
161 ptdev->gpu->pending_reqs &= ~status; in panthor_gpu_irq_handler()
162 wake_up_all(&ptdev->gpu->reqs_acked); in panthor_gpu_irq_handler()
164 spin_unlock(&ptdev->gpu->reqs_lock); in panthor_gpu_irq_handler()
166 PANTHOR_IRQ_HANDLER(gpu, GPU, panthor_gpu_irq_handler);
177 panthor_gpu_irq_suspend(&ptdev->gpu->irq); in panthor_gpu_unplug()
180 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_unplug()
181 ptdev->gpu->pending_reqs = 0; in panthor_gpu_unplug()
182 wake_up_all(&ptdev->gpu->reqs_acked); in panthor_gpu_unplug()
183 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_unplug()
194 struct panthor_gpu *gpu; in panthor_gpu_init() local
198 gpu = drmm_kzalloc(&ptdev->base, sizeof(*gpu), GFP_KERNEL); in panthor_gpu_init()
199 if (!gpu) in panthor_gpu_init()
202 spin_lock_init(&gpu->reqs_lock); in panthor_gpu_init()
203 init_waitqueue_head(&gpu->reqs_acked); in panthor_gpu_init()
204 ptdev->gpu = gpu; in panthor_gpu_init()
217 ret = panthor_request_gpu_irq(ptdev, &ptdev->gpu->irq, irq, GPU_INTERRUPTS_MASK); in panthor_gpu_init()
386 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
388 ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED)) { in panthor_gpu_flush_caches()
389 ptdev->gpu->pending_reqs |= GPU_IRQ_CLEAN_CACHES_COMPLETED; in panthor_gpu_flush_caches()
392 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
394 if (!wait_event_timeout(ptdev->gpu->reqs_acked, in panthor_gpu_flush_caches()
395 !(ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED), in panthor_gpu_flush_caches()
397 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
398 if ((ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED) != 0 && in panthor_gpu_flush_caches()
402 ptdev->gpu->pending_reqs &= ~GPU_IRQ_CLEAN_CACHES_COMPLETED; in panthor_gpu_flush_caches()
403 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
425 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
427 ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED)) { in panthor_gpu_soft_reset()
428 ptdev->gpu->pending_reqs |= GPU_IRQ_RESET_COMPLETED; in panthor_gpu_soft_reset()
432 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
434 if (!wait_event_timeout(ptdev->gpu->reqs_acked, in panthor_gpu_soft_reset()
435 !(ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED), in panthor_gpu_soft_reset()
437 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
438 if ((ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED) != 0 && in panthor_gpu_soft_reset()
442 ptdev->gpu->pending_reqs &= ~GPU_IRQ_RESET_COMPLETED; in panthor_gpu_soft_reset()
443 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
468 panthor_gpu_irq_suspend(&ptdev->gpu->irq); in panthor_gpu_suspend()
480 panthor_gpu_irq_resume(&ptdev->gpu->irq, GPU_INTERRUPTS_MASK); in panthor_gpu_resume()