linux/drivers/staging/media/imx/imx-media-vdic.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * V4L2 Deinterlacer Subdev for Freescale i.MX5/6 SOC
 *
 * Copyright (c) 2017 Mentor Graphics Inc.
 */
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mc.h>
#include <media/v4l2-subdev.h>
#include <media/imx.h>
#include "imx-media.h"

/*
 * This subdev implements two different video pipelines:
 *
 * CSI -> VDIC
 *
 * In this pipeline, the CSI sends a single interlaced field F(n-1)
 * directly to the VDIC (and optionally the following field F(n)
 * can be sent to memory via IDMAC channel 13). This pipeline only works
 * in VDIC's high motion mode, which only requires a single field for
 * processing. The other motion modes (low and medium) require three
 * fields, so this pipeline does not work in those modes. Also, it is
 * not clear how this pipeline can deal with the various field orders
 * (sequential BT/TB, interlaced BT/TB).
 *
 * MEM -> CH8,9,10 -> VDIC
 *
 * In this pipeline, previous field F(n-1), current field F(n), and next
 * field F(n+1) are transferred to the VDIC via IDMAC channels 8,9,10.
 * These memory buffers can come from a video output or mem2mem device.
 * All motion modes are supported by this pipeline.
 *
 * The "direct" CSI->VDIC pipeline requires no DMA, but it can only be
 * used in high motion mode.
 */

struct vdic_priv;

struct vdic_pipeline_ops {};

/*
 * Min/Max supported width and heights.
 */
#define MIN_W
#define MIN_H
#define MAX_W_VDIC
#define MAX_H_VDIC
#define W_ALIGN
#define H_ALIGN
#define S_ALIGN

struct vdic_priv {};

static void vdic_put_ipu_resources(struct vdic_priv *priv)
{}

static int vdic_get_ipu_resources(struct vdic_priv *priv)
{}

/*
 * This function is currently unused, but will be called when the
 * output/mem2mem device at the IDMAC input pad sends us a new
 * buffer. It kicks off the IDMAC read channels to bring in the
 * buffer fields from memory and begin the conversions.
 */
static void __maybe_unused prepare_vdi_in_buffers(struct vdic_priv *priv,
						  struct imx_media_buffer *curr)
{}

static int setup_vdi_channel(struct vdic_priv *priv,
			     struct ipuv3_channel *channel,
			     dma_addr_t phys0, dma_addr_t phys1)
{}

static int vdic_setup_direct(struct vdic_priv *priv)
{}

static void vdic_start_direct(struct vdic_priv *priv)
{}

static void vdic_stop_direct(struct vdic_priv *priv)
{}

static void vdic_disable_direct(struct vdic_priv *priv)
{}

static int vdic_setup_indirect(struct vdic_priv *priv)
{}

static void vdic_start_indirect(struct vdic_priv *priv)
{}

static void vdic_stop_indirect(struct vdic_priv *priv)
{}

static void vdic_disable_indirect(struct vdic_priv *priv)
{}

static struct vdic_pipeline_ops direct_ops =;

static struct vdic_pipeline_ops indirect_ops =;

static int vdic_start(struct vdic_priv *priv)
{}

static void vdic_stop(struct vdic_priv *priv)
{}

/*
 * V4L2 subdev operations.
 */

static int vdic_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vdic_ctrl_ops =;

static const char * const vdic_ctrl_motion_menu[] =;

static int vdic_init_controls(struct vdic_priv *priv)
{}

static int vdic_s_stream(struct v4l2_subdev *sd, int enable)
{}

static struct v4l2_mbus_framefmt *
__vdic_get_fmt(struct vdic_priv *priv, struct v4l2_subdev_state *sd_state,
	       unsigned int pad, enum v4l2_subdev_format_whence which)
{}

static int vdic_enum_mbus_code(struct v4l2_subdev *sd,
			       struct v4l2_subdev_state *sd_state,
			       struct v4l2_subdev_mbus_code_enum *code)
{}

static int vdic_get_fmt(struct v4l2_subdev *sd,
			struct v4l2_subdev_state *sd_state,
			struct v4l2_subdev_format *sdformat)
{}

static void vdic_try_fmt(struct vdic_priv *priv,
			 struct v4l2_subdev_state *sd_state,
			 struct v4l2_subdev_format *sdformat,
			 const struct imx_media_pixfmt **cc)
{}

static int vdic_set_fmt(struct v4l2_subdev *sd,
			struct v4l2_subdev_state *sd_state,
			struct v4l2_subdev_format *sdformat)
{}

static int vdic_link_setup(struct media_entity *entity,
			    const struct media_pad *local,
			    const struct media_pad *remote, u32 flags)
{}

static int vdic_link_validate(struct v4l2_subdev *sd,
			      struct media_link *link,
			      struct v4l2_subdev_format *source_fmt,
			      struct v4l2_subdev_format *sink_fmt)
{}

static int vdic_get_frame_interval(struct v4l2_subdev *sd,
				   struct v4l2_subdev_state *sd_state,
				   struct v4l2_subdev_frame_interval *fi)
{}

static int vdic_set_frame_interval(struct v4l2_subdev *sd,
				   struct v4l2_subdev_state *sd_state,
				   struct v4l2_subdev_frame_interval *fi)
{}

static int vdic_registered(struct v4l2_subdev *sd)
{}

static void vdic_unregistered(struct v4l2_subdev *sd)
{}

static const struct v4l2_subdev_pad_ops vdic_pad_ops =;

static const struct v4l2_subdev_video_ops vdic_video_ops =;

static const struct media_entity_operations vdic_entity_ops =;

static const struct v4l2_subdev_ops vdic_subdev_ops =;

static const struct v4l2_subdev_internal_ops vdic_internal_ops =;

struct v4l2_subdev *imx_media_vdic_register(struct v4l2_device *v4l2_dev,
					    struct device *ipu_dev,
					    struct ipu_soc *ipu,
					    u32 grp_id)
{}

int imx_media_vdic_unregister(struct v4l2_subdev *sd)
{}