Skip to content
Snippets Groups Projects
Select Git revision
  • 7888fc0b3d07151ddefe8e388c557554c3679745
  • master default
  • virtio-camera
  • venus
  • venus-rebased
  • virgl-blob-fixes
  • staging
  • stable-6.1
  • stable-6.0
  • stable-6.0-staging
  • stable-5.0
  • stable-4.2
  • stable-4.1
  • stable-4.0
  • stable-3.1
  • stable-3.0
  • stable-2.12
  • stable-2.11
  • stable-2.10
  • stable-2.9
  • stable-2.8
  • v7.1.0-rc2
  • v7.1.0-rc1
  • v7.1.0-rc0
  • v7.0.0
  • v7.0.0-rc4
  • v7.0.0-rc3
  • v7.0.0-rc2
  • v7.0.0-rc1
  • v7.0.0-rc0
  • v6.1.1
  • v6.2.0
  • v6.2.0-rc4
  • v6.2.0-rc3
  • v6.2.0-rc2
  • v6.2.0-rc1
  • v6.2.0-rc0
  • v6.0.1
  • v6.1.0
  • v6.1.0-rc4
  • v6.1.0-rc3
41 results

virtio_camera.h

Blame
  • 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