Lines Matching full:gpu
26 * struct panthor_gpu - GPU block management data.
29 /** @irq: GPU irq. */
35 /** @pending_reqs: Pending GPU requests. */
38 /** @reqs_acked: GPU request wait queue. */
87 drm_warn(&ptdev->base, "GPU Fault 0x%08x (%s) at 0x%016llx\n", in panthor_gpu_irq_handler()
92 drm_warn(&ptdev->base, "GPU Fault in protected mode\n"); in panthor_gpu_irq_handler()
94 spin_lock(&ptdev->gpu->reqs_lock); in panthor_gpu_irq_handler()
95 if (status & ptdev->gpu->pending_reqs) { in panthor_gpu_irq_handler()
96 ptdev->gpu->pending_reqs &= ~status; in panthor_gpu_irq_handler()
97 wake_up_all(&ptdev->gpu->reqs_acked); in panthor_gpu_irq_handler()
99 spin_unlock(&ptdev->gpu->reqs_lock); in panthor_gpu_irq_handler()
101 PANTHOR_IRQ_HANDLER(gpu, GPU, panthor_gpu_irq_handler);
104 * panthor_gpu_unplug() - Called when the GPU is unplugged.
113 panthor_gpu_irq_suspend(&ptdev->gpu->irq); in panthor_gpu_unplug()
116 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_unplug()
117 ptdev->gpu->pending_reqs = 0; in panthor_gpu_unplug()
118 wake_up_all(&ptdev->gpu->reqs_acked); in panthor_gpu_unplug()
119 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_unplug()
123 * panthor_gpu_init() - Initialize the GPU block
130 struct panthor_gpu *gpu; in panthor_gpu_init() local
134 gpu = drmm_kzalloc(&ptdev->base, sizeof(*gpu), GFP_KERNEL); in panthor_gpu_init()
135 if (!gpu) in panthor_gpu_init()
138 spin_lock_init(&gpu->reqs_lock); in panthor_gpu_init()
139 init_waitqueue_head(&gpu->reqs_acked); in panthor_gpu_init()
140 mutex_init(&gpu->cache_flush_lock); in panthor_gpu_init()
141 ptdev->gpu = gpu; in panthor_gpu_init()
149 irq = platform_get_irq_byname(to_platform_device(ptdev->base.dev), "gpu"); in panthor_gpu_init()
153 ret = panthor_request_gpu_irq(ptdev, &ptdev->gpu->irq, irq, GPU_INTERRUPTS_MASK); in panthor_gpu_init()
161 * panthor_gpu_block_power_off() - Power-off a specific block of the GPU
203 * panthor_gpu_block_power_on() - Power-on a specific block of the GPU
296 guard(mutex)(&ptdev->gpu->cache_flush_lock); in panthor_gpu_flush_caches()
298 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
300 ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED)) { in panthor_gpu_flush_caches()
301 ptdev->gpu->pending_reqs |= GPU_IRQ_CLEAN_CACHES_COMPLETED; in panthor_gpu_flush_caches()
304 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
306 if (!wait_event_timeout(ptdev->gpu->reqs_acked, in panthor_gpu_flush_caches()
307 !(ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED), in panthor_gpu_flush_caches()
309 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
310 if ((ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED) != 0 && in panthor_gpu_flush_caches()
314 ptdev->gpu->pending_reqs &= ~GPU_IRQ_CLEAN_CACHES_COMPLETED; in panthor_gpu_flush_caches()
315 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
337 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
339 ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED)) { in panthor_gpu_soft_reset()
340 ptdev->gpu->pending_reqs |= GPU_IRQ_RESET_COMPLETED; in panthor_gpu_soft_reset()
344 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
346 if (!wait_event_timeout(ptdev->gpu->reqs_acked, in panthor_gpu_soft_reset()
347 !(ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED), in panthor_gpu_soft_reset()
349 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
350 if ((ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED) != 0 && in panthor_gpu_soft_reset()
354 ptdev->gpu->pending_reqs &= ~GPU_IRQ_RESET_COMPLETED; in panthor_gpu_soft_reset()
355 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
367 * panthor_gpu_suspend() - Suspend the GPU block.
370 * Suspend the GPU irq. This should be called last in the suspend procedure,
381 panthor_gpu_irq_suspend(&ptdev->gpu->irq); in panthor_gpu_suspend()
385 * panthor_gpu_resume() - Resume the GPU block.
393 panthor_gpu_irq_resume(&ptdev->gpu->irq, GPU_INTERRUPTS_MASK); in panthor_gpu_resume()