Select Git revision
map_perf_test_user.c
virtio_camera.h 1.61 KiB
/* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
/*
* Virtio Camera Device
*
* Copyright © 2022 Collabora, Ltd.
*/
#ifndef _LINUX_VIRTIO_CAMERA_H
#define _LINUX_VIRTIO_CAMERA_H
#include "standard-headers/linux/types.h"
enum virtio_camera_ctrl_type {
VIRTIO_CAMERA_CMD_GET_FORMAT = 0x1,
VIRTIO_CAMERA_CMD_SET_FORMAT,
VIRTIO_CAMERA_CMD_TRY_FORMAT,
VIRTIO_CAMERA_CMD_ENUM_FORMAT,
VIRTIO_CAMERA_CMD_ENUM_SIZE,
VIRTIO_CAMERA_CMD_CREATE_BUFFER,
VIRTIO_CAMERA_CMD_DESTROY_BUFFER,
VIRTIO_CAMERA_CMD_ENQUEUE_BUFFER,
VIRTIO_CAMERA_CMD_STREAM_ON,
VIRTIO_CAMERA_CMD_STREAM_OFF,
VIRTIO_CAMERA_CMD_RESP_OK_NODATA = 0x100,
VIRTIO_CAMERA_CMD_RESP_ERR_UNSPEC = 0x200,
VIRTIO_CAMERA_CMD_RESP_ERR_BUSY = 0x201,
VIRTIO_CAMERA_CMD_RESP_ERR_OUT_OF_MEMORY = 0x202,
};
struct virtio_camera_config {
uint8_t name[256];
};
struct virtio_camera_mem_entry {
uint64_t addr;
uint32_t length;
};
struct virtio_camera_ctrl_hdr {
uint32_t cmd;
uint32_t index;
};
struct virtio_camera_format_size {
union {
uint32_t min_width;
uint32_t width;
};
uint32_t max_width;
uint32_t step_width;
union {
uint32_t min_height;
uint32_t height;
};
uint32_t max_height;
uint32_t step_height;
uint32_t stride;
uint32_t sizeimage;
};
struct virtio_camera_req_format {
uint32_t pixelformat;
struct virtio_camera_format_size size;
};
struct virtio_camera_req_buffer {
uint32_t num_entries;
uint8_t uuid[16];
};
struct virtio_camera_op_ctrl_req {
struct virtio_camera_ctrl_hdr header;
union {
struct virtio_camera_req_format format;
struct virtio_camera_req_buffer buffer;
uint64_t padding[3];
} u;
};
#endif