3 * (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
20 * Register-based HW access backend specific APIs
23 #ifndef _KBASE_HWACCESS_GPU_H_
24 #define _KBASE_HWACCESS_GPU_H_
26 #include <backend/gpu/mali_kbase_pm_internal.h>
29 * kbase_gpu_irq_evict - Evict an atom from a NEXT slot
31 * @kbdev: Device pointer
32 * @js: Job slot to evict from
34 * Evict the atom in the NEXT slot for the specified job slot. This function is
35 * called from the job complete IRQ handler when the previous job has failed.
37 * Return: true if job evicted from NEXT registers, false otherwise
39 bool kbase_gpu_irq_evict(struct kbase_device *kbdev, int js);
42 * kbase_gpu_complete_hw - Complete an atom on job slot js
44 * @kbdev: Device pointer
45 * @js: Job slot that has completed
46 * @completion_code: Event code from job that has completed
47 * @job_tail: The tail address from the hardware if the job has partially
49 * @end_timestamp: Time of completion
51 void kbase_gpu_complete_hw(struct kbase_device *kbdev, int js,
54 ktime_t *end_timestamp);
57 * kbase_gpu_inspect - Inspect the contents of the HW access ringbuffer
59 * @kbdev: Device pointer
60 * @js: Job slot to inspect
61 * @idx: Index into ringbuffer. 0 is the job currently running on
62 * the slot, 1 is the job waiting, all other values are invalid.
63 * Return: The atom at that position in the ringbuffer
64 * or NULL if no atom present
66 struct kbase_jd_atom *kbase_gpu_inspect(struct kbase_device *kbdev, int js,
70 * kbase_gpu_slot_update - Update state based on slot ringbuffers
72 * @kbdev: Device pointer
74 * Inspect the jobs in the slot ringbuffers and update state.
76 * This will cause jobs to be submitted to hardware if they are unblocked
78 void kbase_gpu_slot_update(struct kbase_device *kbdev);
81 * kbase_gpu_dump_slots - Print the contents of the slot ringbuffers
83 * @kbdev: Device pointer
85 void kbase_gpu_dump_slots(struct kbase_device *kbdev);
87 #endif /* _KBASE_HWACCESS_GPU_H_ */