Interface for GPU drivers.
More...
|
| #define | PBL_GPU_STATE_DEFINE(sym) |
| | Define the class state of GPU sym, for the PBL_*_DEFINE() macro of a driver.
|
| |
| #define | PBL_GPU_INIT(sym, _name, _parent, _ops, ...) |
| | Initializer for the struct pbl_gpu of GPU sym.
|
| |
Interface for GPU drivers.
A driver embeds a struct pbl_gpu in its instance, sets it up with PBL_GPU_STATE_DEFINE() and PBL_GPU_INIT(), implements the struct pbl_gpu_ops the class calls and ends each job with pbl_gpu_complete().
◆ pbl_gpu
| Data Fields |
|
struct pbl_gpu_caps |
caps |
Capabilities. |
|
struct pbl_device |
dev |
Device. |
|
const struct pbl_gpu_ops * |
ops |
Driver operations. |
|
struct pbl_gpu_state * |
state |
Runtime state. |
◆ PBL_GPU_INIT
| #define PBL_GPU_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_parent, |
|
|
|
_ops, |
|
|
|
... |
|
) |
| |
Value: { \
.ops = (_ops), .state = &sym##_gpu_state, .caps = {__VA_ARGS__} \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
int pbl_gpu_dev_init(const struct pbl_device *dev)
Device init of every GPU: calls the driver's init.
Initializer for the struct pbl_gpu of GPU sym.
- Parameters
-
| sym | Symbol of the GPU instance, with its state defined by PBL_GPU_STATE_DEFINE(). |
| _name | Name. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
| ... | Capabilities, designated initializers of struct pbl_gpu_caps. |
◆ PBL_GPU_STATE_DEFINE
| #define PBL_GPU_STATE_DEFINE |
( |
|
sym | ) |
|
Value:
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
#define PBL_SEM_INITIALIZER(init, lim)
Static initializer for a semaphore.
Definition sem.h:56
Define the class state of GPU sym, for the PBL_*_DEFINE() macro of a driver.
- Parameters
-
| sym | Symbol of the GPU instance. |
◆ pbl_gpu_complete()
| void pbl_gpu_complete |
( |
const struct pbl_gpu * |
gpu, |
|
|
int |
status |
|
) |
| |
End the job running, for drivers.
Callable from an interrupt.
- Parameters
-
| gpu | GPU. |
| status | 0 or a negative errno. |
◆ pbl_gpu_dev_init()
| int pbl_gpu_dev_init |
( |
const struct pbl_device * |
dev | ) |
|
Device init of every GPU: calls the driver's init.
- Parameters
-
- Returns
- 0 or a negative errno.