libfunnel low-level GBM API integration
More...
#include "funnel.h"
#include <gbm.h>
Go to the source code of this file.
|
| int | funnel_stream_init_gbm (struct funnel_stream *stream, int gbm_fd) |
| | Set up a stream for GBM integration.
|
| int | funnel_stream_gbm_add_format (struct funnel_stream *stream, uint32_t format, uint64_t *modifiers, size_t num_modifiers) |
| | Add a supported GBM format.
|
| int | funnel_stream_gbm_set_flags (struct funnel_stream *stream, uint32_t flags) |
| | Set the GBM BO allocation flags.
|
| int | funnel_buffer_get_gbm_bo (struct funnel_buffer *buf, struct gbm_bo **pbo) |
| | Get the GBM buffer object for a Funnel buffer.
|
| int | funnel_buffer_get_acquire_sync_object (struct funnel_buffer *buf, uint32_t *phandle, uint64_t *ppoint) |
| | Get the sync object and point for acquiring the buffer.
|
| int | funnel_buffer_get_release_sync_object (struct funnel_buffer *buf, uint32_t *phandle, uint64_t *ppoint) |
| | Get the sync object and point for releasing the buffer.
|
| int | funnel_buffer_get_acquire_sync_file (struct funnel_buffer *buf, int *pfd) |
| | Get the sync object and point for acquiring the buffer.
|
| int | funnel_buffer_set_release_sync_file (struct funnel_buffer *buf, int fd) |
| | Set the sync file for releasing the buffer.
|
libfunnel low-level GBM API integration
See test-egl.c for a usage example.
◆ funnel_stream_init_gbm()
| int funnel_stream_init_gbm |
( |
struct funnel_stream * | stream, |
|
|
int | gbm_fd ) |
Set up a stream for GBM integration.
[Synchronization: external]
- Parameters
-
- Returns
- 0 on success, or a negative error number on error.
- Return values
-
| -EEXIST | The API was already initialized once |
| -EINVAL | Failed to create GBM device |
| -EPROTONOSUPPORT | GPU driver not supported (PipeWire version too old) |
| -EOPNOTSUPP | The GBM device does not have the required features |
◆ funnel_stream_gbm_add_format()
| int funnel_stream_gbm_add_format |
( |
struct funnel_stream * | stream, |
|
|
uint32_t | format, |
|
|
uint64_t * | modifiers, |
|
|
size_t | num_modifiers ) |
Add a supported GBM format.
Must be called in preference order (highest to lowest).
[Synchronization: external]
- Parameters
-
- Returns
- 0 on success, or a negative error number on error.
- Return values
-
| -EINVAL | Invalid argument |
| -EOPNOTSUPP | Format is not supported by libfunnel |
◆ funnel_stream_gbm_set_flags()
| int funnel_stream_gbm_set_flags |
( |
struct funnel_stream * | stream, |
|
|
uint32_t | flags ) |
Set the GBM BO allocation flags.
- Parameters
-
- Returns
- 0 on success, or a negative error number on error.
- Return values
-
◆ funnel_buffer_get_gbm_bo()
| int funnel_buffer_get_gbm_bo |
( |
struct funnel_buffer * | buf, |
|
|
struct gbm_bo ** | pbo ) |
Get the GBM buffer object for a Funnel buffer.
The BO will only be valid until buf is returned or enqueued, or the stream is destroyed.
NOTE: To ensure cross-GPU compatibility, LINEAR buffers might have a width that does not correspond to the user-configured size. Use funnel_buffer_get_size() to retrieve the intended texture dimensions, instead of gbm_bo_get_width() and gbm_bo_get_height().
[Synchronization: external]
- Parameters
-
- Returns
- 0 on success, or a negative error number on error.
◆ funnel_buffer_get_acquire_sync_object()
| int funnel_buffer_get_acquire_sync_object |
( |
struct funnel_buffer * | buf, |
|
|
uint32_t * | phandle, |
|
|
uint64_t * | ppoint ) |
Get the sync object and point for acquiring the buffer.
The user must wait on this timeline sync object point before accessing the buffer.
[Synchronization: external]
- Parameters
-
- Returns
- 0 on success, or a negative error number on error.
- Return values
-
| -EINVAL |
- Buffer does not require sync
- Sync file APIs were already already used
|
◆ funnel_buffer_get_release_sync_object()
| int funnel_buffer_get_release_sync_object |
( |
struct funnel_buffer * | buf, |
|
|
uint32_t * | phandle, |
|
|
uint64_t * | ppoint ) |
Get the sync object and point for releasing the buffer.
The user must signal this timeline sync object after access to the buffer is complete.
[Synchronization: external]
- Parameters
-
- Returns
- 0 on success, or a negative error number on error.
- Return values
-
| -EINVAL |
- Buffer does not require sync
- Sync file APIs were already already used
|
◆ funnel_buffer_get_acquire_sync_file()
| int funnel_buffer_get_acquire_sync_file |
( |
struct funnel_buffer * | buf, |
|
|
int * | pfd ) |
Get the sync object and point for acquiring the buffer.
The user must wait on this sync file before accessing the buffer.
[Synchronization: external]
- Parameters
-
- Returns
- 0 on success, or a negative error number on error.
- Return values
-
| -EINVAL |
- Invalid argument
- Buffer does not require sync
- Sync object APIs were already already used
|
◆ funnel_buffer_set_release_sync_file()
| int funnel_buffer_set_release_sync_file |
( |
struct funnel_buffer * | buf, |
|
|
int | fd ) |
Set the sync file for releasing the buffer.
This sync file must be signaled when access to the buffer is complete.
[Synchronization: external]
- Parameters
-
- Returns
- 0 on success, or a negative error number on error.
- Return values
-
| -EINVAL |
- Invalid argument
- Buffer does not require sync
- Sync object APIs were already already used
|