linux/drivers/media/test-drivers/visl/visl-core.c

// SPDX-License-Identifier: GPL-2.0
/*
 * A virtual stateless decoder 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
 */

#include <linux/debugfs.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mem2mem.h>

#include "visl.h"
#include "visl-dec.h"
#include "visl-debugfs.h"
#include "visl-video.h"

unsigned int visl_debug;
module_param(visl_debug, uint, 0644);
MODULE_PARM_DESC();

unsigned int visl_transtime_ms;
module_param(visl_transtime_ms, uint, 0644);
MODULE_PARM_DESC();

/*
 * dprintk can be slow through serial. This lets one limit the tracing to a
 * particular number of frames
 */
int visl_dprintk_frame_start =;
module_param(visl_dprintk_frame_start, int, 0444);
MODULE_PARM_DESC();

unsigned int visl_dprintk_nframes;
module_param(visl_dprintk_nframes, uint, 0444);
MODULE_PARM_DESC();

bool keep_bitstream_buffers;
module_param(keep_bitstream_buffers, bool, 0444);
MODULE_PARM_DESC();

int bitstream_trace_frame_start =;
module_param(bitstream_trace_frame_start, int, 0444);
MODULE_PARM_DESC();

unsigned int bitstream_trace_nframes;
module_param(bitstream_trace_nframes, uint, 0444);
MODULE_PARM_DESC();

bool tpg_verbose;
module_param(tpg_verbose, bool, 0644);
MODULE_PARM_DESC();

static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] =;

const struct visl_ctrls visl_fwht_ctrls =;

static const struct visl_ctrl_desc visl_mpeg2_ctrl_descs[] =;

const struct visl_ctrls visl_mpeg2_ctrls =;

static const struct visl_ctrl_desc visl_vp8_ctrl_descs[] =;

const struct visl_ctrls visl_vp8_ctrls =;

static const struct visl_ctrl_desc visl_vp9_ctrl_descs[] =;

const struct visl_ctrls visl_vp9_ctrls =;

static const struct visl_ctrl_desc visl_h264_ctrl_descs[] =;

const struct visl_ctrls visl_h264_ctrls =;

static const struct visl_ctrl_desc visl_hevc_ctrl_descs[] =;

const struct visl_ctrls visl_hevc_ctrls =;

static const struct visl_ctrl_desc visl_av1_ctrl_descs[] =;

const struct visl_ctrls visl_av1_ctrls =;

struct v4l2_ctrl *visl_find_control(struct visl_ctx *ctx, u32 id)
{}

void *visl_find_control_data(struct visl_ctx *ctx, u32 id)
{}

u32 visl_control_num_elems(struct visl_ctx *ctx, u32 id)
{}

static void visl_device_release(struct video_device *vdev)
{}

#define VISL_CONTROLS_COUNT

static int visl_init_ctrls(struct visl_ctx *ctx)
{}

static int visl_open(struct file *file)
{}

static int visl_release(struct file *file)
{}

static const struct v4l2_file_operations visl_fops =;

static const struct video_device visl_videodev =;

static const struct v4l2_m2m_ops visl_m2m_ops =;

static const struct media_device_ops visl_m2m_media_ops =;

static int visl_probe(struct platform_device *pdev)
{}

static void visl_remove(struct platform_device *pdev)
{}

static struct platform_driver visl_pdrv =;

static void visl_dev_release(struct device *dev) {}

static struct platform_device visl_pdev =;

static void __exit visl_exit(void)
{}

static int __init visl_init(void)
{}

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();

module_init();
module_exit(visl_exit);