Go to the source code of this file.
|
These functions will wait until it is safe to access the buffer for the given purpose.
If used with mir_none, the buffer will be given the buffer immediately, and without synchronization. It is then up to the user to ensure that the buffer contents are not accessed at inapproprate times.
- Note
- the following functions (mir_buffer_get_native_buffer, mir_buffer_get_graphics_region) can only be used when the buffer is not submitted to the server.
|
| typedef int(* | mir_buffer_get_fence) (MirBuffer *) |
| | Retrieve the native fence associated with this buffer.
|
| typedef void(* | mir_buffer_associate_fence) (MirBuffer *buffer, int fence, MirBufferAccess access) |
| | Protect the buffer's contents by associating a native fence with it.
|
| typedef int(* | mir_buffer_wait_for_access) (MirBuffer *buffer, MirBufferAccess access, int timeout) |
| | Wait for the fence associated with the buffer to signal.
|
| typedef struct MirExtensionFencedBuffersV1 | MirExtensionFencedBuffersV1 |
◆ mir_buffer_associate_fence
Protect the buffer's contents by associating a native fence with it.
- Warning
- any fence currently associated with buffer will be replaced in favor of fence without waiting for the replaced fence to clear
-
The Mir client api assumes ownership of the fence fd.
- Parameters
-
| [in] | buffer | The buffer |
| [in] | fence | The fence that will be associated with buffer. If negative, this will remove the fence associated with this buffer. |
| [in] | access | The ongoing access that is represented by fence. If mir_none is set, this will remove the fence protecting the buffer content. |
◆ mir_buffer_get_fence
| typedef int(* mir_buffer_get_fence) (MirBuffer *) |
Retrieve the native fence associated with this buffer.
- Warning
- Take care not to close the fd, the Mir client api retains ownership of the fence fd.
- Parameters
-
- Returns
- The fd representing the fence associated with buffer.
◆ mir_buffer_wait_for_access
Wait for the fence associated with the buffer to signal.
After returning, it is permissible to access the buffer's content for the designated purpose in access.
- Parameters
-
| [in] | buffer | The buffer |
| [in] | access | The access to wait for. |
| [in] | timeout | The amount of time to wait for the fence in nanoseconds, or -1 for infinite timeout. |
- Returns
- zero when fence was cleared successfully, or a negative number when the timeout was reached before the fence signals
◆ MirBufferAccess
◆ MirExtensionFencedBuffersV1
| typedef struct MirExtensionFencedBuffersV1 MirExtensionFencedBuffersV1 |
◆ MirBufferAccess
| Enumerator |
|---|
| mir_none | |
| mir_read | |
| mir_read_write | |
Copyright © 2012-2026
Canonical Ltd.
Generated on Sun Mar 15 20:28:55 UTC 2026
This documentation is licensed under the GPL version 2 or 3.