|
My Project
|
Classes | |
| struct | base_stream |
| struct | base_fence |
| struct | base_jd_udata |
| Per-job data. More... | |
| struct | base_mem_aliasing_info |
| Memory aliasing info. More... | |
| struct | base_jit_alloc_info |
| struct | base_dependency |
| struct | base_jd_atom_v2 |
| struct | base_jd_atom_v2_uk6 |
| struct | base_external_resource |
| struct | base_external_resource_list |
| struct | base_jd_debug_copy_buffer |
| struct | base_jd_event_v2 |
| Event reporting structure. More... | |
| struct | base_dump_cpu_gpu_counters |
| Structure for BASE_JD_REQ_SOFT_DUMP_CPU_GPU_COUNTERS jobs. More... | |
Typedefs | |
| typedef int | platform_fence_type |
| typedef struct base_stream | base_stream |
| typedef struct base_fence | base_fence |
| typedef struct base_jd_udata | base_jd_udata |
| Per-job data. More... | |
| typedef u8 | base_jd_dep_type |
| Job dependency type. More... | |
| typedef u32 | base_jd_core_req |
| Job chain hardware requirements. More... | |
| typedef u8 | base_jd_prio |
| typedef u8 | base_atom_id |
| typedef struct base_jd_atom_v2 | base_jd_atom_v2 |
| typedef enum base_external_resource_access | base_external_resource_access |
| typedef struct base_external_resource | base_external_resource |
| typedef enum base_jd_event_code | base_jd_event_code |
| Job chain event codes. More... | |
| typedef struct base_jd_event_v2 | base_jd_event_v2 |
| Event reporting structure. More... | |
| typedef struct base_dump_cpu_gpu_counters | base_dump_cpu_gpu_counters |
| Structure for BASE_JD_REQ_SOFT_DUMP_CPU_GPU_COUNTERS jobs. More... | |
Enumerations | |
| enum | kbase_atom_coreref_state { KBASE_ATOM_COREREF_STATE_NO_CORES_REQUESTED, KBASE_ATOM_COREREF_STATE_WAITING_FOR_REQUESTED_CORES, KBASE_ATOM_COREREF_STATE_RECHECK_AFFINITY, KBASE_ATOM_COREREF_STATE_CHECK_AFFINITY_VIOLATIONS, KBASE_ATOM_COREREF_STATE_READY } |
| States to model state machine processed by kbasep_js_job_check_ref_cores(), which handles retaining cores for power management and affinity management. More... | |
| enum | kbase_jd_atom_state { KBASE_JD_ATOM_STATE_UNUSED, KBASE_JD_ATOM_STATE_QUEUED, KBASE_JD_ATOM_STATE_IN_JS, KBASE_JD_ATOM_STATE_HW_COMPLETED, KBASE_JD_ATOM_STATE_COMPLETED } |
| enum | base_external_resource_access { BASE_EXT_RES_ACCESS_SHARED, BASE_EXT_RES_ACCESS_EXCLUSIVE } |
| enum | { BASE_JD_SW_EVENT_KERNEL = (1u << 15), BASE_JD_SW_EVENT = (1u << 14), BASE_JD_SW_EVENT_SUCCESS = (1u << 13), BASE_JD_SW_EVENT_JOB = (0u << 11), BASE_JD_SW_EVENT_BAG = (1u << 11), BASE_JD_SW_EVENT_INFO = (2u << 11), BASE_JD_SW_EVENT_RESERVED = (3u << 11), BASE_JD_SW_EVENT_TYPE_MASK = (3u << 11) } |
| Job chain event code bits Defines the bits used to create base_jd_event_code. More... | |
| enum | base_jd_event_code { BASE_JD_EVENT_RANGE_HW_NONFAULT_START = 0, BASE_JD_EVENT_NOT_STARTED = 0x00, BASE_JD_EVENT_DONE = 0x01, BASE_JD_EVENT_STOPPED = 0x03, BASE_JD_EVENT_TERMINATED = 0x04, BASE_JD_EVENT_ACTIVE = 0x08, BASE_JD_EVENT_RANGE_HW_NONFAULT_END = 0x40, BASE_JD_EVENT_RANGE_HW_FAULT_OR_SW_ERROR_START = 0x40, BASE_JD_EVENT_JOB_CONFIG_FAULT = 0x40, BASE_JD_EVENT_JOB_POWER_FAULT = 0x41, BASE_JD_EVENT_JOB_READ_FAULT = 0x42, BASE_JD_EVENT_JOB_WRITE_FAULT = 0x43, BASE_JD_EVENT_JOB_AFFINITY_FAULT = 0x44, BASE_JD_EVENT_JOB_BUS_FAULT = 0x48, BASE_JD_EVENT_INSTR_INVALID_PC = 0x50, BASE_JD_EVENT_INSTR_INVALID_ENC = 0x51, BASE_JD_EVENT_INSTR_TYPE_MISMATCH = 0x52, BASE_JD_EVENT_INSTR_OPERAND_FAULT = 0x53, BASE_JD_EVENT_INSTR_TLS_FAULT = 0x54, BASE_JD_EVENT_INSTR_BARRIER_FAULT = 0x55, BASE_JD_EVENT_INSTR_ALIGN_FAULT = 0x56, BASE_JD_EVENT_DATA_INVALID_FAULT = 0x58, BASE_JD_EVENT_TILE_RANGE_FAULT = 0x59, BASE_JD_EVENT_STATE_FAULT = 0x5A, BASE_JD_EVENT_OUT_OF_MEMORY = 0x60, BASE_JD_EVENT_UNKNOWN = 0x7F, BASE_JD_EVENT_DELAYED_BUS_FAULT = 0x80, BASE_JD_EVENT_SHAREABILITY_FAULT = 0x88, BASE_JD_EVENT_TRANSLATION_FAULT_LEVEL1 = 0xC1, BASE_JD_EVENT_TRANSLATION_FAULT_LEVEL2 = 0xC2, BASE_JD_EVENT_TRANSLATION_FAULT_LEVEL3 = 0xC3, BASE_JD_EVENT_TRANSLATION_FAULT_LEVEL4 = 0xC4, BASE_JD_EVENT_PERMISSION_FAULT = 0xC8, BASE_JD_EVENT_TRANSTAB_BUS_FAULT_LEVEL1 = 0xD1, BASE_JD_EVENT_TRANSTAB_BUS_FAULT_LEVEL2 = 0xD2, BASE_JD_EVENT_TRANSTAB_BUS_FAULT_LEVEL3 = 0xD3, BASE_JD_EVENT_TRANSTAB_BUS_FAULT_LEVEL4 = 0xD4, BASE_JD_EVENT_ACCESS_FLAG = 0xD8, BASE_JD_EVENT_MEM_GROWTH_FAILED = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_JOB | 0x000, BASE_JD_EVENT_TIMED_OUT = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_JOB | 0x001, BASE_JD_EVENT_JOB_CANCELLED = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_JOB | 0x002, BASE_JD_EVENT_JOB_INVALID = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_JOB | 0x003, BASE_JD_EVENT_PM_EVENT = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_JOB | 0x004, BASE_JD_EVENT_FORCE_REPLAY = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_JOB | 0x005, BASE_JD_EVENT_BAG_INVALID = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_BAG | 0x003, BASE_JD_EVENT_RANGE_HW_FAULT_OR_SW_ERROR_END = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_RESERVED | 0x3FF, BASE_JD_EVENT_RANGE_SW_SUCCESS_START = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_SUCCESS | 0x000, BASE_JD_EVENT_PROGRESS_REPORT = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_SUCCESS | BASE_JD_SW_EVENT_JOB | 0x000, BASE_JD_EVENT_BAG_DONE = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_SUCCESS | BASE_JD_SW_EVENT_BAG | 0x000, BASE_JD_EVENT_DRV_TERMINATED = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_SUCCESS | BASE_JD_SW_EVENT_INFO | 0x000, BASE_JD_EVENT_RANGE_SW_SUCCESS_END = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_SUCCESS | BASE_JD_SW_EVENT_RESERVED | 0x3FF, BASE_JD_EVENT_RANGE_KERNEL_ONLY_START = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_KERNEL | 0x000, BASE_JD_EVENT_REMOVED_FROM_NEXT = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_KERNEL | BASE_JD_SW_EVENT_JOB | 0x000, BASE_JD_EVENT_RANGE_KERNEL_ONLY_END = BASE_JD_SW_EVENT | BASE_JD_SW_EVENT_KERNEL | BASE_JD_SW_EVENT_RESERVED | 0x3FF } |
| Job chain event codes. More... | |
| #define BASE_CPU_GPU_CACHE_LINE_PADDING (36) |
Padding required to ensure that the struct base_dump_cpu_gpu_counters structure fills a full cache line.
| #define BASE_EXT_RES_COUNT_MAX 10 |
The maximum number of external resources which can be mapped/unmapped in a single request.
| #define BASE_JD_DEP_TYPE_DATA (1U << 0) |
Data dependency
| #define BASE_JD_DEP_TYPE_INVALID (0) |
Invalid dependency
| #define BASE_JD_DEP_TYPE_ORDER (1U << 1) |
Order dependency
| #define BASE_JD_REQ_ATOM_TYPE |
Mask of all bits in base_jd_core_req that control the type of the atom.
This allows dependency only atoms to have flags set
| #define BASE_JD_REQ_CF ((base_jd_core_req)1 << 3) |
Requires cache flushes
| #define BASE_JD_REQ_COHERENT_GROUP ((base_jd_core_req)1 << 6) |
SW Only requirement: the job chain requires a coherent core group. We don't mind which coherent core group is used.
| #define BASE_JD_REQ_CS ((base_jd_core_req)1 << 1) |
Requires compute shaders This covers any of the following Midgard Job types:
Compare this with BASE_JD_REQ_ONLY_COMPUTE, which specifies that the job is specifically just the "Compute Shader" job type, and not the "Vertex Shader" nor the "Geometry Shader" job type.
| #define BASE_JD_REQ_DEP ((base_jd_core_req)0) |
No requirement, dependency only
| #define BASE_JD_REQ_EVENT_COALESCE ((base_jd_core_req)1 << 5) |
SW-only requirement: coalesce completion events. If this bit is set then completion of this atom will not cause an event to be sent to userspace, whether successful or not; completion events will be deferred until an atom completes which does not have this bit set.
This bit may not be used in combination with BASE_JD_REQ_EXTERNAL_RESOURCES.
| #define BASE_JD_REQ_EVENT_ONLY_ON_FAILURE ((base_jd_core_req)1 << 12) |
SW Flag: If this bit is set then the successful completion of this atom will not cause an event to be sent to userspace
| #define BASE_JD_REQ_EXTERNAL_RESOURCES ((base_jd_core_req)1 << 8) |
SW Only requirement: External resources are referenced by this atom. When external resources are referenced no syncsets can be bundled with the atom but should instead be part of a NULL jobs inserted into the dependency tree. The first pre_dep object must be configured for the external resouces to use, the second pre_dep object can be used to create other dependencies.
This bit may not be used in combination with BASE_JD_REQ_EVENT_COALESCE.
| #define BASE_JD_REQ_FS ((base_jd_core_req)1 << 0) |
Requires fragment shaders
| #define BASE_JD_REQ_ONLY_COMPUTE ((base_jd_core_req)1 << 10) |
HW Requirement: Requires Compute shaders (but not Vertex or Geometry Shaders)
This indicates that the Job Chain contains Midgard Jobs of the 'Compute Shaders' type.
In contrast to BASE_JD_REQ_CS, this does not indicate that the Job Chain contains 'Geometry Shader' or 'Vertex Shader' jobs.
| #define BASE_JD_REQ_PERMON ((base_jd_core_req)1 << 7) |
SW Only requirement: The performance counters should be enabled only when they are needed, to reduce power consumption.
| #define BASE_JD_REQ_SKIP_CACHE_END ((base_jd_core_req)1 << 16) |
SW Flag: Skip GPU cache clean and invalidation after a GPU job completes.
If this bit is set then the GPU's cache will not be cleaned and invalidated until a GPU job completes which does not have this bit set or a job starts which does not have the BASE_JD_REQ_SKIP_CACHE_START bti set. Do not use if the CPU may read from or partially overwrite memory addressed by the job before the next job without this bit set completes.
| #define BASE_JD_REQ_SKIP_CACHE_START ((base_jd_core_req)1 << 15) |
SW Flag: Skip GPU cache clean and invalidation before starting a GPU job.
If this bit is set then the GPU's cache will not be cleaned and invalidated until a GPU job starts which does not have this bit set or a job completes which does not have the BASE_JD_REQ_SKIP_CACHE_END bit set. Do not use if the CPU may have written to memory addressed by the job since the last job without this bit set was submitted.
| #define BASE_JD_REQ_SOFT_EVENT_WAIT (BASE_JD_REQ_SOFT_JOB | 0x5) |
SW only requirement: event wait/trigger job.
| #define BASE_JD_REQ_SOFT_EXT_RES_MAP (BASE_JD_REQ_SOFT_JOB | 0xb) |
SW only requirement: Map external resource
This job requests external resource(s) are mapped once the dependencies of the job have been satisfied. The list of external resources are passed via the jc element of the atom which is a pointer to a .
| #define BASE_JD_REQ_SOFT_EXT_RES_UNMAP (BASE_JD_REQ_SOFT_JOB | 0xc) |
SW only requirement: Unmap external resource
This job requests external resource(s) are unmapped once the dependencies of the job has been satisfied. The list of external resources are passed via the jc element of the atom which is a pointer to a .
| #define BASE_JD_REQ_SOFT_JIT_ALLOC (BASE_JD_REQ_SOFT_JOB | 0x9) |
SW only requirement: Just In Time allocation
This job requests a JIT allocation based on the request in the structure which is passed via the jc element of the atom.
It should be noted that the id entry in must not be reused until it has been released via .
Should this soft job fail it is expected that a soft job to free the JIT allocation is still made.
The job will complete immediately.
| #define BASE_JD_REQ_SOFT_JIT_FREE (BASE_JD_REQ_SOFT_JOB | 0xa) |
SW only requirement: Just In Time free
This job requests a JIT allocation created by to be freed. The ID of the JIT allocation is passed via the jc element of the atom.
The job will complete immediately.
| #define BASE_JD_REQ_SOFT_JOB ((base_jd_core_req)1 << 9) |
SW Only requirement: Software defined job. Jobs with this bit set will not be submitted to the hardware but will cause some action to happen within the driver
| #define BASE_JD_REQ_SOFT_JOB_OR_DEP | ( | core_req | ) |
| #define BASE_JD_REQ_SOFT_JOB_TYPE (BASE_JD_REQ_SOFT_JOB | 0x1f) |
Mask of all bits in base_jd_core_req that control the type of a soft job.
| #define BASE_JD_REQ_SOFT_REPLAY (BASE_JD_REQ_SOFT_JOB | 0x4) |
SW Only requirement : Replay job.
If the preceding job fails, the replay job will cause the jobs specified in the list of base_jd_replay_payload pointed to by the jc pointer to be replayed.
A replay job will only cause jobs to be replayed up to BASEP_JD_REPLAY_LIMIT times. If a job fails more than BASEP_JD_REPLAY_LIMIT times then the replay job is failed, as well as any following dependencies.
The replayed jobs will require a number of atom IDs. If there are not enough free atom IDs then the replay job will fail.
If the preceding job does not fail, then the replay job is returned as completed.
The replayed jobs will never be returned to userspace. The preceding failed job will be returned to userspace as failed; the status of this job should be ignored. Completion should be determined by the status of the replay soft job.
In order for the jobs to be replayed, the job headers will have to be modified. The Status field will be reset to NOT_STARTED. If the Job Type field indicates a Vertex Shader Job then it will be changed to Null Job.
The replayed jobs have the following assumptions :
| #define BASE_JD_REQ_SPECIFIC_COHERENT_GROUP ((base_jd_core_req)1 << 11) |
HW Requirement: Use the base_jd_atom::device_nr field to specify a particular core group
If both BASE_JD_REQ_COHERENT_GROUP and this flag are set, this flag takes priority
This is only guaranteed to work for BASE_JD_REQ_ONLY_COMPUTE atoms.
If the core availability policy is keeping the required core group turned off, then the job will fail with a BASE_JD_EVENT_PM_EVENT error code.
| #define BASE_JD_REQ_T ((base_jd_core_req)1 << 2) |
Requires tiling
| #define BASE_JD_REQ_V ((base_jd_core_req)1 << 4) |
Requires value writeback
| #define BASEP_JD_REQ_EVENT_NEVER ((base_jd_core_req)1 << 14) |
SW Flag: If this bit is set then completion of this atom will not cause an event to be sent to userspace, whether successful or not.
| #define BASEP_JD_REQ_RESERVED |
These requirement bits are currently unused in base_jd_core_req
| typedef u8 base_atom_id |
Type big enough to store an atom number in
| typedef struct base_dump_cpu_gpu_counters base_dump_cpu_gpu_counters |
Structure for BASE_JD_REQ_SOFT_DUMP_CPU_GPU_COUNTERS jobs.
This structure is stored into the memory pointed to by the jc field of base_jd_atom.
This structure must be padded to ensure that it will occupy whole cache lines. This is to avoid cases where access to pages containing the structure is shared between cached and un-cached memory regions, which would cause memory corruption. Here we set the structure size to be 64 bytes which is the cache line for ARM A15 processors.
| typedef struct base_fence base_fence |
Base fence handle.
References an underlying base fence object.
| typedef u32 base_jd_core_req |
Job chain hardware requirements.
A job chain must specify what GPU features it needs to allow the driver to schedule the job correctly. By not specifying the correct settings can/will cause an early job termination. Multiple values can be ORed together to specify multiple requirements. Special case is BASE_JD_REQ_DEP, which is used to express complex dependencies, and that doesn't execute anything on the hardware.
| typedef u8 base_jd_dep_type |
Job dependency type.
A flags field will be inserted into the atom structure to specify whether a dependency is a data or ordering dependency (by putting it before/after 'core_req' in the structure it should be possible to add without changing the structure size). When the flag is set for a particular dependency to signal that it is an ordering only dependency then errors will not be propagated.
| typedef enum base_jd_event_code base_jd_event_code |
Job chain event codes.
HW and low-level SW events are represented by event codes. The status of jobs which succeeded are also represented by an event code (see ::BASE_JD_EVENT_DONE). Events are usually reported as part of a ::base_jd_event.
The event codes are encoded in the following way:
Events are split up into ranges as follows:
code is in <description>'s range when:
BASE_JD_EVENT_RANGE_<description>_START <= code < BASE_JD_EVENT_RANGE_<description>_END Ranges can be asserted for adjacency by testing that the END of the previous is equal to the START of the next. This is useful for optimizing some tests for range.
A limitation is that the last member of this enum must explicitly be handled (with an assert-unreachable statement) in switch statements that use variables of this type. Otherwise, the compiler warns that we have not handled that enum value.
| typedef struct base_jd_event_v2 base_jd_event_v2 |
Event reporting structure.
This structure is used by the kernel driver to report information about GPU events. The can either be HW-specific events or low-level SW events, such as job-chain completion.
The event code contains an event type field which can be extracted by ANDing with BASE_JD_SW_EVENT_TYPE_MASK.
Based on the event type base_jd_event::data holds:
| typedef struct base_jd_udata base_jd_udata |
Per-job data.
This structure is used to store per-job data, and is completely unused by the Base driver. It can be used to store things such as callback function pointer, data to handle job completion. It is guaranteed to be untouched by the Base driver.
| typedef struct base_stream base_stream |
Base stream handle.
References an underlying base stream object.
| anonymous enum |
Job chain event code bits Defines the bits used to create base_jd_event_code.
| enum base_jd_event_code |
Job chain event codes.
HW and low-level SW events are represented by event codes. The status of jobs which succeeded are also represented by an event code (see ::BASE_JD_EVENT_DONE). Events are usually reported as part of a ::base_jd_event.
The event codes are encoded in the following way:
Events are split up into ranges as follows:
code is in <description>'s range when:
BASE_JD_EVENT_RANGE_<description>_START <= code < BASE_JD_EVENT_RANGE_<description>_END Ranges can be asserted for adjacency by testing that the END of the previous is equal to the START of the next. This is useful for optimizing some tests for range.
A limitation is that the last member of this enum must explicitly be handled (with an assert-unreachable statement) in switch statements that use variables of this type. Otherwise, the compiler warns that we have not handled that enum value.
States to model state machine processed by kbasep_js_job_check_ref_cores(), which handles retaining cores for power management and affinity management.
The state KBASE_ATOM_COREREF_STATE_RECHECK_AFFINITY prevents an attack where lots of atoms could be submitted before powerup, and each has an affinity chosen that causes other atoms to have an affinity violation. Whilst the affinity was not causing violations at the time it was chosen, it could cause violations thereafter. For example, 1000 jobs could have had their affinity chosen during the powerup time, so any of those 1000 jobs could cause an affinity violation later on.
The attack would otherwise occur because other atoms/contexts have to wait for:
By re-choosing the affinity (which is designed to avoid violations at the time it's chosen), we break condition (2) of the wait, which minimizes the problem to just waiting for current jobs to finish (which can be bounded if the Job Scheduling Policy has a timer).
| enum kbase_jd_atom_state |
1.8.13