linux/drivers/staging/media/atomisp/pci/runtime/bufq/src/bufq.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 "assert_support.h"		/* assert */
#include "ia_css_buffer.h"
#include "sp.h"
#include "ia_css_bufq.h"		/* Bufq API's */
#include "ia_css_queue.h"		/* ia_css_queue_t */
#include "sw_event_global.h"		/* Event IDs.*/
#include "ia_css_eventq.h"		/* ia_css_eventq_recv()*/
#include "ia_css_debug.h"		/* ia_css_debug_dtrace*/
#include "sh_css_internal.h"		/* sh_css_queue_type */
#include "sp_local.h"			/* sp_address_of */
#include "sh_css_firmware.h"		/* sh_css_sp_fw*/

#define BUFQ_DUMP_FILE_NAME_PREFIX_SIZE

static char prefix[BUFQ_DUMP_FILE_NAME_PREFIX_SIZE] =;

/*********************************************************/
/* Global Queue objects used by CSS                      */
/*********************************************************/

struct sh_css_queues {};

/*******************************************************
*** Static variables
********************************************************/
static struct sh_css_queues css_queues;

static int
buffer_type_to_queue_id_map[SH_CSS_MAX_SP_THREADS][IA_CSS_NUM_DYNAMIC_BUFFER_TYPE];
static bool queue_availability[SH_CSS_MAX_SP_THREADS][SH_CSS_MAX_NUM_QUEUES];

/*******************************************************
*** Static functions
********************************************************/
static void map_buffer_type_to_queue_id(
    unsigned int thread_id,
    enum ia_css_buffer_type buf_type
);
static void unmap_buffer_type_to_queue_id(
    unsigned int thread_id,
    enum ia_css_buffer_type buf_type
);

static ia_css_queue_t *bufq_get_qhandle(
    enum sh_css_queue_type type,
    enum sh_css_queue_id id,
    int thread
);

/*******************************************************
*** Public functions
********************************************************/
void ia_css_queue_map_init(void)
{}

void ia_css_queue_map(
    unsigned int thread_id,
    enum ia_css_buffer_type buf_type,
    bool map)
{}

/*
 * @brief Query the internal queue ID.
 */
bool ia_css_query_internal_queue_id(
    enum ia_css_buffer_type buf_type,
    unsigned int thread_id,
    enum sh_css_queue_id *val)
{}

/*******************************************************
*** Static functions
********************************************************/
static void map_buffer_type_to_queue_id(
    unsigned int thread_id,
    enum ia_css_buffer_type buf_type)
{}

static void unmap_buffer_type_to_queue_id(
    unsigned int thread_id,
    enum ia_css_buffer_type buf_type)
{}

static ia_css_queue_t *bufq_get_qhandle(
    enum sh_css_queue_type type,
    enum sh_css_queue_id id,
    int thread)
{}

/* Local function to initialize a buffer queue. This reduces
 * the chances of copy-paste errors or typos.
 */
static inline void
init_bufq(unsigned int desc_offset,
	  unsigned int elems_offset,
	  ia_css_queue_t *handle)
{}

void ia_css_bufq_init(void)
{}

int ia_css_bufq_enqueue_buffer(
    int thread_index,
    int queue_id,
    uint32_t item)
{}

int ia_css_bufq_dequeue_buffer(
    int queue_id,
    uint32_t *item)
{}

int ia_css_bufq_enqueue_psys_event(
    u8 evt_id,
    u8 evt_payload_0,
    u8 evt_payload_1,
    uint8_t evt_payload_2)
{}

int ia_css_bufq_dequeue_psys_event(
    u8 item[BUFQ_EVENT_SIZE])
{}

int ia_css_bufq_dequeue_isys_event(
    u8 item[BUFQ_EVENT_SIZE])
{}

int ia_css_bufq_enqueue_isys_event(uint8_t evt_id)
{}

int ia_css_bufq_enqueue_tag_cmd(
    uint32_t item)
{}

int ia_css_bufq_deinit(void)
{}

static void bufq_dump_queue_info(const char *prefix, ia_css_queue_t *qhandle)
{}

void ia_css_bufq_dump_queue_info(void)
{}