linux/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2013--2024 Intel Corporation
 */
#include <linux/atomic.h>
#include <linux/bug.h>
#include <linux/device.h>
#include <linux/list.h>
#include <linux/lockdep.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/types.h>

#include <media/media-entity.h>
#include <media/v4l2-subdev.h>
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-v4l2.h>

#include "ipu6-bus.h"
#include "ipu6-fw-isys.h"
#include "ipu6-isys.h"
#include "ipu6-isys-video.h"

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

static int ipu6_isys_buf_prepare(struct vb2_buffer *vb)
{}

/*
 * Queue a buffer list back to incoming or active queues. The buffers
 * are removed from the buffer list.
 */
void ipu6_isys_buffer_list_queue(struct ipu6_isys_buffer_list *bl,
				 unsigned long op_flags,
				 enum vb2_buffer_state state)
{}

/*
 * flush_firmware_streamon_fail() - Flush in cases where requests may
 * have been queued to firmware and the *firmware streamon fails for a
 * reason or another.
 */
static void flush_firmware_streamon_fail(struct ipu6_isys_stream *stream)
{}

/*
 * Attempt obtaining a buffer list from the incoming queues, a list of buffers
 * that contains one entry from each video buffer queue. If a buffer can't be
 * obtained from every queue, the buffers are returned back to the queue.
 */
static int buffer_list_get(struct ipu6_isys_stream *stream,
			   struct ipu6_isys_buffer_list *bl)
{}

static void
ipu6_isys_buf_to_fw_frame_buf_pin(struct vb2_buffer *vb,
				  struct ipu6_fw_isys_frame_buff_set_abi *set)
{}

/*
 * Convert a buffer list to a isys fw ABI framebuffer set. The
 * buffer list is not modified.
 */
#define IPU6_ISYS_FRAME_NUM_THRESHOLD
void
ipu6_isys_buf_to_fw_frame_buf(struct ipu6_fw_isys_frame_buff_set_abi *set,
			      struct ipu6_isys_stream *stream,
			      struct ipu6_isys_buffer_list *bl)
{}

/* Start streaming for real. The buffer list must be available. */
static int ipu6_isys_stream_start(struct ipu6_isys_video *av,
				  struct ipu6_isys_buffer_list *bl, bool error)
{}

static void buf_queue(struct vb2_buffer *vb)
{}

static int ipu6_isys_link_fmt_validate(struct ipu6_isys_queue *aq)
{}

static void return_buffers(struct ipu6_isys_queue *aq,
			   enum vb2_buffer_state state)
{}

static void ipu6_isys_stream_cleanup(struct ipu6_isys_video *av)
{}

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

static void stop_streaming(struct vb2_queue *q)
{}

static unsigned int
get_sof_sequence_by_timestamp(struct ipu6_isys_stream *stream,
			      struct ipu6_fw_isys_resp_info_abi *info)
{}

static u64 get_sof_ns_delta(struct ipu6_isys_video *av,
			    struct ipu6_fw_isys_resp_info_abi *info)
{}

void ipu6_isys_buf_calc_sequence_time(struct ipu6_isys_buffer *ib,
				      struct ipu6_fw_isys_resp_info_abi *info)
{}

void ipu6_isys_queue_buf_done(struct ipu6_isys_buffer *ib)
{}

void ipu6_isys_queue_buf_ready(struct ipu6_isys_stream *stream,
			       struct ipu6_fw_isys_resp_info_abi *info)
{}

static const struct vb2_ops ipu6_isys_queue_ops =;

int ipu6_isys_queue_init(struct ipu6_isys_queue *aq)
{}