Lines Matching full:gpu
24 * struct panthor_gpu - GPU block management data.
27 /** @irq: GPU irq. */
33 /** @pending_reqs: Pending GPU requests. */
36 /** @reqs_acked: GPU request wait queue. */
41 * struct panthor_model - GPU model description
55 * GPU_MODEL() - Define a GPU model. A GPU product can be uniquely identified
58 * @_name: Name for the GPU model.
158 drm_warn(&ptdev->base, "GPU Fault 0x%08x (%s) at 0x%016llx\n", in panthor_gpu_irq_handler()
163 drm_warn(&ptdev->base, "GPU Fault in protected mode\n"); in panthor_gpu_irq_handler()
165 spin_lock(&ptdev->gpu->reqs_lock); in panthor_gpu_irq_handler()
166 if (status & ptdev->gpu->pending_reqs) { in panthor_gpu_irq_handler()
167 ptdev->gpu->pending_reqs &= ~status; in panthor_gpu_irq_handler()
168 wake_up_all(&ptdev->gpu->reqs_acked); in panthor_gpu_irq_handler()
170 spin_unlock(&ptdev->gpu->reqs_lock); in panthor_gpu_irq_handler()
172 PANTHOR_IRQ_HANDLER(gpu, GPU, panthor_gpu_irq_handler);
175 * panthor_gpu_unplug() - Called when the GPU is unplugged.
184 panthor_gpu_irq_suspend(&ptdev->gpu->irq); in panthor_gpu_unplug()
187 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_unplug()
188 ptdev->gpu->pending_reqs = 0; in panthor_gpu_unplug()
189 wake_up_all(&ptdev->gpu->reqs_acked); in panthor_gpu_unplug()
190 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_unplug()
194 * panthor_gpu_init() - Initialize the GPU block
201 struct panthor_gpu *gpu; in panthor_gpu_init() local
205 gpu = drmm_kzalloc(&ptdev->base, sizeof(*gpu), GFP_KERNEL); in panthor_gpu_init()
206 if (!gpu) in panthor_gpu_init()
209 spin_lock_init(&gpu->reqs_lock); in panthor_gpu_init()
210 init_waitqueue_head(&gpu->reqs_acked); in panthor_gpu_init()
211 ptdev->gpu = gpu; in panthor_gpu_init()
220 irq = platform_get_irq_byname(to_platform_device(ptdev->base.dev), "gpu"); in panthor_gpu_init()
224 ret = panthor_request_gpu_irq(ptdev, &ptdev->gpu->irq, irq, GPU_INTERRUPTS_MASK); in panthor_gpu_init()
232 * panthor_gpu_block_power_off() - Power-off a specific block of the GPU
292 * panthor_gpu_block_power_on() - Power-on a specific block of the GPU
396 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
398 ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED)) { in panthor_gpu_flush_caches()
399 ptdev->gpu->pending_reqs |= GPU_IRQ_CLEAN_CACHES_COMPLETED; in panthor_gpu_flush_caches()
402 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
404 if (!wait_event_timeout(ptdev->gpu->reqs_acked, in panthor_gpu_flush_caches()
405 !(ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED), in panthor_gpu_flush_caches()
407 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
408 if ((ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED) != 0 && in panthor_gpu_flush_caches()
412 ptdev->gpu->pending_reqs &= ~GPU_IRQ_CLEAN_CACHES_COMPLETED; in panthor_gpu_flush_caches()
413 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_flush_caches()
435 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
437 ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED)) { in panthor_gpu_soft_reset()
438 ptdev->gpu->pending_reqs |= GPU_IRQ_RESET_COMPLETED; in panthor_gpu_soft_reset()
442 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
444 if (!wait_event_timeout(ptdev->gpu->reqs_acked, in panthor_gpu_soft_reset()
445 !(ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED), in panthor_gpu_soft_reset()
447 spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
448 if ((ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED) != 0 && in panthor_gpu_soft_reset()
452 ptdev->gpu->pending_reqs &= ~GPU_IRQ_RESET_COMPLETED; in panthor_gpu_soft_reset()
453 spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags); in panthor_gpu_soft_reset()
465 * panthor_gpu_suspend() - Suspend the GPU block.
468 * Suspend the GPU irq. This should be called last in the suspend procedure,
479 panthor_gpu_irq_suspend(&ptdev->gpu->irq); in panthor_gpu_suspend()
483 * panthor_gpu_resume() - Resume the GPU block.
491 panthor_gpu_irq_resume(&ptdev->gpu->irq, GPU_INTERRUPTS_MASK); in panthor_gpu_resume()
519 * Return: The GPU timestamp value.
530 * Return: The GPU timestamp offset value.