linux/drivers/media/platform/qcom/venus/venc.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 * Copyright (C) 2017 Linaro Ltd.
 */
#include <linux/clk.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <media/v4l2-mem2mem.h>
#include <media/videobuf2-dma-contig.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ctrls.h>

#include "hfi_venus_io.h"
#include "hfi_parser.h"
#include "core.h"
#include "helpers.h"
#include "venc.h"
#include "pm_helpers.h"

#define NUM_B_FRAMES_MAX

/*
 * Three resons to keep MPLANE formats (despite that the number of planes
 * currently is one):
 * - the MPLANE formats allow only one plane to be used
 * - the downstream driver use MPLANE formats too
 * - future firmware versions could add support for >1 planes
 */
static const struct venus_format venc_formats[] =;

static const struct venus_format *
find_format(struct venus_inst *inst, u32 pixfmt, u32 type)
{}

static const struct venus_format *
find_format_by_index(struct venus_inst *inst, unsigned int index, u32 type)
{}

static int venc_v4l2_to_hfi(int id, int value)
{}

static int
venc_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
{}

static int venc_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f)
{}

static const struct venus_format *
venc_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f)
{}

static int venc_try_fmt(struct file *file, void *fh, struct v4l2_format *f)
{}

static int venc_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
{}

static int venc_g_fmt(struct file *file, void *fh, struct v4l2_format *f)
{}

static int
venc_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
{}

static int
venc_s_selection(struct file *file, void *fh, struct v4l2_selection *s)
{}

static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
{}

static int venc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
{}

static int venc_enum_framesizes(struct file *file, void *fh,
				struct v4l2_frmsizeenum *fsize)
{}

static int venc_enum_frameintervals(struct file *file, void *fh,
				    struct v4l2_frmivalenum *fival)
{}

static int venc_subscribe_event(struct v4l2_fh *fh,
				const struct v4l2_event_subscription *sub)
{}

static int
venc_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd)
{}

static const struct v4l2_ioctl_ops venc_ioctl_ops =;

static int venc_pm_get(struct venus_inst *inst)
{}

static int venc_pm_put(struct venus_inst *inst, bool autosuspend)
{}

static int venc_pm_get_put(struct venus_inst *inst)
{}

static void venc_pm_touch(struct venus_inst *inst)
{}

static int venc_set_properties(struct venus_inst *inst)
{}

static int venc_init_session(struct venus_inst *inst)
{}

static int venc_out_num_buffers(struct venus_inst *inst, unsigned int *num)
{}

static int venc_queue_setup(struct vb2_queue *q,
			    unsigned int *num_buffers, unsigned int *num_planes,
			    unsigned int sizes[], struct device *alloc_devs[])
{}

static int venc_buf_init(struct vb2_buffer *vb)
{}

static void venc_release_session(struct venus_inst *inst)
{}

static void venc_buf_cleanup(struct vb2_buffer *vb)
{}

static int venc_verify_conf(struct venus_inst *inst)
{}

static int venc_start_streaming(struct vb2_queue *q, unsigned int count)
{}

static void venc_vb2_buf_queue(struct vb2_buffer *vb)
{}

static const struct vb2_ops venc_vb2_ops =;

static void venc_buf_done(struct venus_inst *inst, unsigned int buf_type,
			  u32 tag, u32 bytesused, u32 data_offset, u32 flags,
			  u32 hfi_flags, u64 timestamp_us)
{}

static void venc_event_notify(struct venus_inst *inst, u32 event,
			      struct hfi_event_data *data)
{}

static const struct hfi_inst_ops venc_hfi_ops =;

static const struct v4l2_m2m_ops venc_m2m_ops =;

static int m2m_queue_init(void *priv, struct vb2_queue *src_vq,
			  struct vb2_queue *dst_vq)
{}

static void venc_inst_init(struct venus_inst *inst)
{}

static int venc_open(struct file *file)
{}

static int venc_close(struct file *file)
{}

static const struct v4l2_file_operations venc_fops =;

static int venc_probe(struct platform_device *pdev)
{}

static void venc_remove(struct platform_device *pdev)
{}

static __maybe_unused int venc_runtime_suspend(struct device *dev)
{}

static __maybe_unused int venc_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops venc_pm_ops =;

static const struct of_device_id venc_dt_match[] =;
MODULE_DEVICE_TABLE(of, venc_dt_match);

static struct platform_driver qcom_venus_enc_driver =;
module_platform_driver();

MODULE_ALIAS();
MODULE_DESCRIPTION();
MODULE_LICENSE();