Skip to content

Commit 645f3d3

Browse files
josuahdanieldegrasse
authored andcommitted
drivers: video: fix order of fields to allow use with FIFOs
The struct video_buffer are currently used with `struct k_fifo`, which require them to preserve the first word of data for use by the kernel. Move the first fields to make it possible to keep using video buffers in FIFO safely. Fixes #92526 Signed-off-by: Josuah Demangeon <me@josuah.net>
1 parent 48c85cb commit 645f3d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/zephyr/drivers/video.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,11 @@ struct video_caps {
144144
* Represent a video frame.
145145
*/
146146
struct video_buffer {
147+
/** Pointer to driver specific data. */
148+
/* It must be kept as first field of the struct if used for @ref k_fifo APIs. */
149+
void *driver_data;
147150
/** type of the buffer */
148151
enum video_buf_type type;
149-
/** pointer to driver specific data. */
150-
void *driver_data;
151152
/** pointer to the start of the buffer. */
152153
uint8_t *buffer;
153154
/** index of the buffer, optionally set by the application */

0 commit comments

Comments
 (0)