linux/drivers/staging/media/atomisp/pci/runtime/inputfifo/src/inputfifo.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2010 - 2015, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */

#include "platform_support.h"

#include "ia_css_inputfifo.h"

#include "device_access.h"

#define __INLINE_SP__
#include "sp.h"
#define __INLINE_ISP__
#include "isp.h"
#define __INLINE_IRQ__
#include "irq.h"
#define __INLINE_FIFO_MONITOR__
#include "fifo_monitor.h"

#define __INLINE_EVENT__
#include "event_fifo.h"
#define __INLINE_SP__

#include "input_system.h"	/* MIPI_PREDICTOR_NONE,... */

#include "assert_support.h"

/* System independent */
#include "sh_css_internal.h"
#include "ia_css_isys.h"

#define HBLANK_CYCLES
#define MARKER_CYCLES

#include <hive_isp_css_streaming_to_mipi_types_hrt.h>

/* The data type is used to send special cases:
 * yuv420: odd lines (1, 3 etc) are twice as wide as even
 *         lines (0, 2, 4 etc).
 * rgb: for two pixels per clock, the R and B values are sent
 *      to output_0 while only G is sent to output_1. This means
 *      that output_1 only gets half the number of values of output_0.
 *      WARNING: This type should also be used for Legacy YUV420.
 * regular: used for all other data types (RAW, YUV422, etc)
 */
enum inputfifo_mipi_data_type {};

static unsigned int inputfifo_curr_ch_id, inputfifo_curr_fmt_type;
struct inputfifo_instance {};

/*
 * Maintain a basic streaming to Mipi administration with ch_id as index
 * ch_id maps on the "Mipi virtual channel ID" and can have value 0..3
 */
#define INPUTFIFO_NR_OF_S2M_CHANNELS
static struct inputfifo_instance
	inputfifo_inst_admin[INPUTFIFO_NR_OF_S2M_CHANNELS];

/* Streaming to MIPI */
static unsigned int inputfifo_wrap_marker(
    /* static inline unsigned inputfifo_wrap_marker( */
    unsigned int marker)
{}

static inline void
_sh_css_fifo_snd(unsigned int token)
{}

static void inputfifo_send_data_a(
    /* static inline void inputfifo_send_data_a( */
    unsigned int data)
{}

static void inputfifo_send_data_b(
    /* static inline void inputfifo_send_data_b( */
    unsigned int data)
{}

static void inputfifo_send_data(
    /* static inline void inputfifo_send_data( */
    unsigned int a,
    unsigned int b)
{}

static void inputfifo_send_sol(void)
/* static inline void inputfifo_send_sol(void) */
{}

static void inputfifo_send_eol(void)
/* static inline void inputfifo_send_eol(void) */
{}

static void inputfifo_send_sof(void)
/* static inline void inputfifo_send_sof(void) */
{}

static void inputfifo_send_eof(void)
/* static inline void inputfifo_send_eof(void) */
{}

static void inputfifo_send_ch_id_and_fmt_type(
    /* static inline
    void inputfifo_send_ch_id_and_fmt_type( */
    unsigned int ch_id,
    unsigned int fmt_type)
{}

static void inputfifo_send_empty_token(void)
/* static inline void inputfifo_send_empty_token(void) */
{}

static void inputfifo_start_frame(
    /* static inline void inputfifo_start_frame( */
    unsigned int ch_id,
    unsigned int fmt_type)
{}

static void inputfifo_end_frame(
    unsigned int marker_cycles)
{}

static void inputfifo_send_line2(
    const unsigned short *data,
    unsigned int width,
    const unsigned short *data2,
    unsigned int width2,
    unsigned int hblank_cycles,
    unsigned int marker_cycles,
    unsigned int two_ppc,
    enum inputfifo_mipi_data_type type)
{}

static void
inputfifo_send_line(const unsigned short *data,
		    unsigned int width,
		    unsigned int hblank_cycles,
		    unsigned int marker_cycles,
		    unsigned int two_ppc,
		    enum inputfifo_mipi_data_type type)
{}

/* Send a frame of data into the input network via the GP FIFO.
 *  Parameters:
 *   - data: array of 16 bit values that contains all data for the frame.
 *   - width: width of a line in number of subpixels, for yuv420 it is the
 *            number of Y components per line.
 *   - height: height of the frame in number of lines.
 *   - ch_id: channel ID.
 *   - fmt_type: format type.
 *   - hblank_cycles: length of horizontal blanking in cycles.
 *   - marker_cycles: number of empty cycles after start-of-line and before
 *                    end-of-frame.
 *   - two_ppc: boolean, describes whether to send one or two pixels per clock
 *              cycle. In this mode, we sent pixels N and N+1 in the same cycle,
 *              to IF_PRIM_A and IF_PRIM_B respectively. The caller must make
 *              sure the input data has been formatted correctly for this.
 *              For example, for RGB formats this means that unused values
 *              must be inserted.
 *   - yuv420: boolean, describes whether (non-legacy) yuv420 data is used. In
 *             this mode, the odd lines (1,3,5 etc) are half as long as the
 *             even lines (2,4,6 etc).
 *             Note that the first line is odd (1) and the second line is even
 *             (2).
 *
 * This function does not do any reordering of pixels, the caller must make
 * sure the data is in the righ format. Please refer to the CSS receiver
 * documentation for details on the data formats.
 */

static void inputfifo_send_frame(
    const unsigned short *data,
    unsigned int width,
    unsigned int height,
    unsigned int ch_id,
    unsigned int fmt_type,
    unsigned int hblank_cycles,
    unsigned int marker_cycles,
    unsigned int two_ppc,
    enum inputfifo_mipi_data_type type)
{}

static enum inputfifo_mipi_data_type inputfifo_determine_type(
    enum atomisp_input_format input_format)
{}

static struct inputfifo_instance *inputfifo_get_inst(
    unsigned int ch_id)
{}

void ia_css_inputfifo_send_input_frame(
    const unsigned short *data,
    unsigned int width,
    unsigned int height,
    unsigned int ch_id,
    enum atomisp_input_format input_format,
    bool two_ppc)
{}

void ia_css_inputfifo_start_frame(
    unsigned int ch_id,
    enum atomisp_input_format input_format,
    bool two_ppc)
{}

void ia_css_inputfifo_send_line(
    unsigned int ch_id,
    const unsigned short *data,
    unsigned int width,
    const unsigned short *data2,
    unsigned int width2)
{}

void ia_css_inputfifo_send_embedded_line(
    unsigned int	ch_id,
    enum atomisp_input_format	data_type,
    const unsigned short	*data,
    unsigned int	width)
{}

void ia_css_inputfifo_end_frame(
    unsigned int	ch_id)
{}