linux/drivers/staging/media/atomisp/pci/runtime/isys/src/virtual_isys.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 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 <linux/string.h> /* for memcpy() */

#include "system_global.h"


#include "ia_css_isys.h"
#include "ia_css_debug.h"
#include "math_support.h"
#include "virtual_isys.h"
#include "isp.h"
#include "sh_css_defs.h"

/*************************************************
 *
 * Forwarded Declaration
 *
 *************************************************/

static bool create_input_system_channel(
    isp2401_input_system_cfg_t	*cfg,
    bool			metadata,
    input_system_channel_t	*channel);

static void destroy_input_system_channel(
    input_system_channel_t	*channel);

static bool create_input_system_input_port(
    isp2401_input_system_cfg_t		*cfg,
    input_system_input_port_t	*input_port);

static void destroy_input_system_input_port(
    input_system_input_port_t	*input_port);

static bool calculate_input_system_channel_cfg(
    input_system_channel_t		*channel,
    input_system_input_port_t	*input_port,
    isp2401_input_system_cfg_t		*isys_cfg,
    input_system_channel_cfg_t	*channel_cfg,
    bool metadata);

static bool calculate_input_system_input_port_cfg(
    input_system_channel_t		*channel,
    input_system_input_port_t	*input_port,
    isp2401_input_system_cfg_t		*isys_cfg,
    input_system_input_port_cfg_t	*input_port_cfg);

static bool acquire_sid(
    stream2mmio_ID_t	stream2mmio,
    stream2mmio_sid_ID_t	*sid);

static void release_sid(
    stream2mmio_ID_t	stream2mmio,
    stream2mmio_sid_ID_t	*sid);

static bool acquire_ib_buffer(
    s32 bits_per_pixel,
    s32 pixels_per_line,
    s32 lines_per_frame,
    s32 align_in_bytes,
    bool online,
    isp2401_ib_buffer_t *buf);

static void release_ib_buffer(
    isp2401_ib_buffer_t *buf);

static bool acquire_dma_channel(
    isys2401_dma_ID_t	dma_id,
    isys2401_dma_channel	*channel);

static void release_dma_channel(
    isys2401_dma_ID_t	dma_id,
    isys2401_dma_channel	*channel);

static bool acquire_be_lut_entry(
    csi_rx_backend_ID_t		backend,
    csi_mipi_packet_type_t		packet_type,
    csi_rx_backend_lut_entry_t	*entry);

static void release_be_lut_entry(
    csi_rx_backend_ID_t		backend,
    csi_mipi_packet_type_t		packet_type,
    csi_rx_backend_lut_entry_t	*entry);

static bool calculate_prbs_cfg(
    input_system_channel_t		*channel,
    input_system_input_port_t	*input_port,
    isp2401_input_system_cfg_t		*isys_cfg,
    pixelgen_prbs_cfg_t		*cfg);

static bool calculate_fe_cfg(
    const isp2401_input_system_cfg_t	*isys_cfg,
    csi_rx_frontend_cfg_t		*cfg);

static bool calculate_be_cfg(
    const input_system_input_port_t	*input_port,
    const isp2401_input_system_cfg_t	*isys_cfg,
    bool				metadata,
    csi_rx_backend_cfg_t		*cfg);

static bool calculate_stream2mmio_cfg(
    const isp2401_input_system_cfg_t	*isys_cfg,
    bool				metadata,
    stream2mmio_cfg_t		*cfg);

static bool calculate_ibuf_ctrl_cfg(
    const input_system_channel_t	*channel,
    const input_system_input_port_t	*input_port,
    const isp2401_input_system_cfg_t	*isys_cfg,
    ibuf_ctrl_cfg_t			*cfg);

static bool calculate_isys2401_dma_cfg(
    const input_system_channel_t	*channel,
    const isp2401_input_system_cfg_t	*isys_cfg,
    isys2401_dma_cfg_t		*cfg);

static bool calculate_isys2401_dma_port_cfg(
    const isp2401_input_system_cfg_t	*isys_cfg,
    bool				raw_packed,
    bool				metadata,
    isys2401_dma_port_cfg_t		*cfg);

static csi_mipi_packet_type_t get_csi_mipi_packet_type(
    int32_t data_type);

static int32_t calculate_stride(
    s32 bits_per_pixel,
    s32 pixels_per_line,
    bool	raw_packed,
    int32_t	align_in_bytes);

/* end of Forwarded Declaration */

/**************************************************
 *
 * Public Methods
 *
 **************************************************/
ia_css_isys_error_t ia_css_isys_stream_create(
    ia_css_isys_descr_t	*isys_stream_descr,
    ia_css_isys_stream_h	isys_stream,
    uint32_t isys_stream_id)
{}

void ia_css_isys_stream_destroy(
    ia_css_isys_stream_h	isys_stream)
{}

ia_css_isys_error_t ia_css_isys_stream_calculate_cfg(
    ia_css_isys_stream_h		isys_stream,
    ia_css_isys_descr_t		*isys_stream_descr,
    ia_css_isys_stream_cfg_t	*isys_stream_cfg)
{}

/* end of Public Methods */

/**************************************************
 *
 * Private Methods
 *
 **************************************************/
static bool create_input_system_channel(
    isp2401_input_system_cfg_t	*cfg,
    bool			metadata,
    input_system_channel_t	*me)
{}

static void destroy_input_system_channel(
    input_system_channel_t	*me)
{}

static bool create_input_system_input_port(
    isp2401_input_system_cfg_t		*cfg,
    input_system_input_port_t	*me)
{}

static void destroy_input_system_input_port(
    input_system_input_port_t	*me)
{}

static bool calculate_input_system_channel_cfg(
    input_system_channel_t		*channel,
    input_system_input_port_t	*input_port,
    isp2401_input_system_cfg_t		*isys_cfg,
    input_system_channel_cfg_t	*channel_cfg,
    bool metadata)
{}

static bool calculate_input_system_input_port_cfg(
    input_system_channel_t		*channel,
    input_system_input_port_t	*input_port,
    isp2401_input_system_cfg_t		*isys_cfg,
    input_system_input_port_cfg_t	*input_port_cfg)
{}

static bool acquire_sid(
    stream2mmio_ID_t	stream2mmio,
    stream2mmio_sid_ID_t	*sid)
{}

static void release_sid(
    stream2mmio_ID_t	stream2mmio,
    stream2mmio_sid_ID_t	*sid)
{}

/* See also: ia_css_dma_configure_from_info() */
static int32_t calculate_stride(
    s32 bits_per_pixel,
    s32 pixels_per_line,
    bool	raw_packed,
    int32_t align_in_bytes)
{}

static bool acquire_ib_buffer(
    s32 bits_per_pixel,
    s32 pixels_per_line,
    s32 lines_per_frame,
    s32 align_in_bytes,
    bool online,
    isp2401_ib_buffer_t *buf)
{}

static void release_ib_buffer(
    isp2401_ib_buffer_t *buf)
{}

static bool acquire_dma_channel(
    isys2401_dma_ID_t	dma_id,
    isys2401_dma_channel	*channel)
{}

static void release_dma_channel(
    isys2401_dma_ID_t	dma_id,
    isys2401_dma_channel	*channel)
{}

static bool acquire_be_lut_entry(
    csi_rx_backend_ID_t		backend,
    csi_mipi_packet_type_t		packet_type,
    csi_rx_backend_lut_entry_t	*entry)
{}

static void release_be_lut_entry(
    csi_rx_backend_ID_t		backend,
    csi_mipi_packet_type_t		packet_type,
    csi_rx_backend_lut_entry_t	*entry)
{}

static bool calculate_prbs_cfg(
    input_system_channel_t		*channel,
    input_system_input_port_t	*input_port,
    isp2401_input_system_cfg_t		*isys_cfg,
    pixelgen_prbs_cfg_t		*cfg)
{}

static bool calculate_fe_cfg(
    const isp2401_input_system_cfg_t	*isys_cfg,
    csi_rx_frontend_cfg_t		*cfg)
{}

static bool calculate_be_cfg(
    const input_system_input_port_t	*input_port,
    const isp2401_input_system_cfg_t	*isys_cfg,
    bool				metadata,
    csi_rx_backend_cfg_t		*cfg)
{}

static bool calculate_stream2mmio_cfg(
    const isp2401_input_system_cfg_t	*isys_cfg,
    bool				metadata,
    stream2mmio_cfg_t		*cfg
)
{}

static bool calculate_ibuf_ctrl_cfg(
    const input_system_channel_t	*channel,
    const input_system_input_port_t	*input_port,
    const isp2401_input_system_cfg_t	*isys_cfg,
    ibuf_ctrl_cfg_t			*cfg)
{}

static bool calculate_isys2401_dma_cfg(
    const input_system_channel_t	*channel,
    const isp2401_input_system_cfg_t	*isys_cfg,
    isys2401_dma_cfg_t		*cfg)
{}

/* See also: ia_css_dma_configure_from_info() */
static bool calculate_isys2401_dma_port_cfg(
    const isp2401_input_system_cfg_t	*isys_cfg,
    bool				raw_packed,
    bool				metadata,
    isys2401_dma_port_cfg_t		*cfg)
{}

static csi_mipi_packet_type_t get_csi_mipi_packet_type(
    int32_t data_type)
{}

/* end of Private Methods */