/* SPDX-License-Identifier: GPL-2.0 */ /* * A virtual stateless device for stateless uAPI development purposes. * * This tool's objective is to help the development and testing of userspace * applications that use the V4L2 stateless API to decode media. * * A userspace implementation can use visl to run a decoding loop even when no * hardware is available or when the kernel uAPI for the codec has not been * upstreamed yet. This can reveal bugs at an early stage. * * This driver can also trace the contents of the V4L2 controls submitted to it. * It can also dump the contents of the vb2 buffers through a debugfs * interface. This is in many ways similar to the tracing infrastructure * available for other popular encode/decode APIs out there and can help develop * a userspace application by using another (working) one as a reference. * * Note that no actual decoding of video frames is performed by visl. The V4L2 * test pattern generator is used to write various debug information to the * capture buffers instead. * * Copyright (C) 2022 Collabora, Ltd. * * Based on the vim2m driver, that is: * * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. * Pawel Osciak, <[email protected]> * Marek Szyprowski, <[email protected]> * * Based on the vicodec driver, that is: * * Copyright 2018 Cisco Systems, Inc. and/or its affiliates. All rights reserved. * * Based on the Cedrus VPU driver, that is: * * Copyright (C) 2016 Florent Revest <[email protected]> * Copyright (C) 2018 Paul Kocialkowski <[email protected]> * Copyright (C) 2018 Bootlin */ #ifndef _VISL_H_ #define _VISL_H_ #include <linux/debugfs.h> #include <linux/list.h> #include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/tpg/v4l2-tpg.h> #define VISL_NAME … #define VISL_M2M_NQUEUES … #define TPG_STR_BUF_SZ … extern unsigned int visl_transtime_ms; struct visl_ctrls { … }; struct visl_coded_format_desc { … }; extern const struct visl_coded_format_desc visl_coded_fmts[]; extern const size_t num_coded_fmts; enum { … }; extern unsigned int visl_debug; #define dprintk(dev, fmt, arg...) … extern int visl_dprintk_frame_start; extern unsigned int visl_dprintk_nframes; extern bool keep_bitstream_buffers; extern int bitstream_trace_frame_start; extern unsigned int bitstream_trace_nframes; extern bool tpg_verbose; #define frame_dprintk(dev, current, fmt, arg...) … \ struct visl_q_data { … }; struct visl_dev { … }; enum visl_codec { … }; struct visl_blob { … }; struct visl_ctx { … }; struct visl_ctrl_desc { … }; static inline struct visl_ctx *visl_file_to_ctx(struct file *file) { … } static inline struct visl_ctx *visl_v4l2fh_to_ctx(struct v4l2_fh *v4l2_fh) { … } void *visl_find_control_data(struct visl_ctx *ctx, u32 id); struct v4l2_ctrl *visl_find_control(struct visl_ctx *ctx, u32 id); u32 visl_control_num_elems(struct visl_ctx *ctx, u32 id); #endif /* _VISL_H_ */