mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
video: rockchip: vtunnel: add video tunnel driver
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com> Change-Id: Ic621f6fcbc4924bd5567c9161f358e9365830618
This commit is contained in:
@@ -7,3 +7,4 @@ source "drivers/video/rockchip/iep/Kconfig"
|
||||
source "drivers/video/rockchip/mpp/Kconfig"
|
||||
source "drivers/video/rockchip/dvbm/Kconfig"
|
||||
source "drivers/video/rockchip/vehicle/Kconfig"
|
||||
source "drivers/video/rockchip/vtunnel/Kconfig"
|
||||
|
||||
@@ -7,3 +7,4 @@ obj-$(CONFIG_IEP) += iep/
|
||||
obj-$(CONFIG_ROCKCHIP_MPP_SERVICE) += mpp/
|
||||
obj-$(CONFIG_ROCKCHIP_DVBM) += dvbm/
|
||||
obj-$(CONFIG_VIDEO_REVERSE_IMAGE) += vehicle/
|
||||
obj-$(CONFIG_ROCKCHIP_VIDEO_TUNNEL) += vtunnel/
|
||||
|
||||
12
drivers/video/rockchip/vtunnel/Kconfig
Normal file
12
drivers/video/rockchip/vtunnel/Kconfig
Normal file
@@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
|
||||
menu "Rockchip video tunnel support"
|
||||
|
||||
config ROCKCHIP_VIDEO_TUNNEL
|
||||
tristate "Rockchip video tunnel device support"
|
||||
depends on ARCH_ROCKCHIP
|
||||
default n
|
||||
help
|
||||
Rockchip videotunnel device support.
|
||||
|
||||
endmenu
|
||||
3
drivers/video/rockchip/vtunnel/Makefile
Normal file
3
drivers/video/rockchip/vtunnel/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
obj-$(CONFIG_ROCKCHIP_VIDEO_TUNNEL) += rkvtunnel.o
|
||||
1523
drivers/video/rockchip/vtunnel/rkvtunnel.c
Normal file
1523
drivers/video/rockchip/vtunnel/rkvtunnel.c
Normal file
File diff suppressed because it is too large
Load Diff
81
drivers/video/rockchip/vtunnel/rkvtunnel.h
Normal file
81
drivers/video/rockchip/vtunnel/rkvtunnel.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
|
||||
/*
|
||||
* Copyright (c) 2022 Rockchip Electronics Co., Ltd
|
||||
*/
|
||||
#ifndef __ROCKCHIP_VIDEO_TUNNEL_H__
|
||||
#define __ROCKCHIP_VIDEO_TUNNEL_H__
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define MAX_BUF_HANDLE_FDS 16
|
||||
#define MAX_BUF_HANDLE_INTS 128
|
||||
|
||||
#define RKVT_IOC_MAGIC 'V'
|
||||
#define RKVT_IOWR(nr, type) _IOWR(RKVT_IOC_MAGIC, nr, type)
|
||||
|
||||
#define RKVT_IOC_ALLOC_ID RKVT_IOWR(0x0, struct rkvt_alloc_id_data)
|
||||
#define RKVT_IOC_FREE_ID RKVT_IOWR(0x1, struct rkvt_alloc_id_data)
|
||||
#define RKVT_IOC_CTRL RKVT_IOWR(0x2, struct rkvt_ctrl_data)
|
||||
#define RKVT_IOC_QUEUE_BUF RKVT_IOWR(0x3, struct rkvt_buf_data)
|
||||
#define RKVT_IOC_DEQUE_BUF RKVT_IOWR(0x4, struct rkvt_buf_data)
|
||||
#define RKVT_IOC_CANCEL_BUF RKVT_IOWR(0x5, struct rkvt_buf_data)
|
||||
#define RKVT_IOC_ACQUIRE_BUF RKVT_IOWR(0x6, struct rkvt_buf_data)
|
||||
#define RKVT_IOC_RELEASE_BUF RKVT_IOWR(0x7, struct rkvt_buf_data)
|
||||
|
||||
// caller type
|
||||
enum rkvt_caller_e {
|
||||
RKVT_CALLER_PRODUCER,
|
||||
RKVT_CALLER_CONSUMER,
|
||||
RKVT_CALLER_BUTT,
|
||||
};
|
||||
|
||||
// video tunnel caller control
|
||||
enum rkvt_ctrl_cmd_e {
|
||||
RKVT_CTRL_CONNECT,
|
||||
RKVT_CTRL_DISCONNECT,
|
||||
RKVT_CTRL_RESET,
|
||||
RKVT_CTRL_HAS_CONSUMER,
|
||||
RKVT_CTRL_BUTT,
|
||||
};
|
||||
|
||||
struct rkvt_alloc_id_data {
|
||||
int vt_id;
|
||||
};
|
||||
|
||||
struct rkvt_ctrl_data {
|
||||
int vt_id;
|
||||
enum rkvt_caller_e caller;
|
||||
enum rkvt_ctrl_cmd_e ctrl_cmd;
|
||||
int ctrl_data;
|
||||
};
|
||||
|
||||
struct rkvt_rect {
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
};
|
||||
|
||||
struct rkvt_buf_base {
|
||||
int vt_id;
|
||||
int fence_fd;
|
||||
int buf_status;
|
||||
int num_fds; /* number of file-descriptors at &data[0] */
|
||||
int num_ints; /* number of ints at &data[numFds] */
|
||||
int reserved;
|
||||
int fds[MAX_BUF_HANDLE_FDS];
|
||||
int ints[MAX_BUF_HANDLE_INTS];
|
||||
int64_t priv_data;
|
||||
uint64_t expected_present_time;
|
||||
uint64_t buffer_id;
|
||||
struct rkvt_rect crop;
|
||||
};
|
||||
|
||||
struct rkvt_buf_data {
|
||||
int vt_id;
|
||||
int timeout_ms; /* 0: non block, negative: block, other: timeout ms */
|
||||
struct rkvt_buf_base base;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user