Lines Matching refs:gpu
161 spin_lock(&ptdev->gpu->reqs_lock); in panthor_gpu_irq_handler()
162 if (status & ptdev->gpu->pending_reqs) { in panthor_gpu_irq_handler()
163 ptdev->gpu->pending_reqs &= ~status; in panthor_gpu_irq_handler()
164 wake_up_all(&ptdev->gpu->reqs_acked); in panthor_gpu_irq_handler()
166 spin_unlock(&ptdev->gpu->reqs_lock); in panthor_gpu_irq_handler()
168 PANTHOR_IRQ_HANDLER(gpu, GPU, panthor_gpu_irq_handler);
180 panthor_gpu_irq_suspend(&ptdev->gpu->irq); in panthor_gpu_unplug()
183 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_unplug()
184 ptdev->gpu->pending_reqs = 0; in panthor_gpu_unplug()
185 wake_up_all(&ptdev->gpu->reqs_acked); in panthor_gpu_unplug()
186 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_unplug()
197 struct panthor_gpu *gpu; in panthor_gpu_init() local
201 gpu = drmm_kzalloc(&ptdev->base, sizeof(*gpu), GFP_KERNEL); in panthor_gpu_init()
202 if (!gpu) in panthor_gpu_init()
205 spin_lock_init(&gpu->reqs_lock); in panthor_gpu_init()
206 init_waitqueue_head(&gpu->reqs_acked); in panthor_gpu_init()
207 ptdev->gpu = gpu; in panthor_gpu_init()
220 ret = panthor_request_gpu_irq(ptdev, &ptdev->gpu->irq, irq, GPU_INTERRUPTS_MASK); in panthor_gpu_init()
356 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
358 ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED)) { in panthor_gpu_flush_caches()
359 ptdev->gpu->pending_reqs |= GPU_IRQ_CLEAN_CACHES_COMPLETED; in panthor_gpu_flush_caches()
362 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
364 if (!wait_event_timeout(ptdev->gpu->reqs_acked, in panthor_gpu_flush_caches()
365 !(ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED), in panthor_gpu_flush_caches()
367 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
368 if ((ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED) != 0 && in panthor_gpu_flush_caches()
372 ptdev->gpu->pending_reqs &= ~GPU_IRQ_CLEAN_CACHES_COMPLETED; in panthor_gpu_flush_caches()
373 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
395 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
397 ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED)) { in panthor_gpu_soft_reset()
398 ptdev->gpu->pending_reqs |= GPU_IRQ_RESET_COMPLETED; in panthor_gpu_soft_reset()
402 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
404 if (!wait_event_timeout(ptdev->gpu->reqs_acked, in panthor_gpu_soft_reset()
405 !(ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED), in panthor_gpu_soft_reset()
407 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
408 if ((ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED) != 0 && in panthor_gpu_soft_reset()
412 ptdev->gpu->pending_reqs &= ~GPU_IRQ_RESET_COMPLETED; in panthor_gpu_soft_reset()
413 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
439 panthor_gpu_irq_suspend(&ptdev->gpu->irq); in panthor_gpu_suspend()
451 panthor_gpu_irq_resume(&ptdev->gpu->irq, GPU_INTERRUPTS_MASK); in panthor_gpu_resume()