3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2015, Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 Support for Intel Camera Imaging ISP subsystem.
18 Copyright (c) 2010 - 2015, Intel Corporation.
20 This program is free software; you can redistribute it and/or modify it
21 under the terms and conditions of the GNU General Public License,
22 version 2, as published by the Free Software Foundation.
24 This program is distributed in the hope it will be useful, but WITHOUT
25 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
31 #ifndef _IA_CSS_BUFQ_H
32 #define _IA_CSS_BUFQ_H
34 #include <type_support.h>
35 #include "ia_css_bufq_comm.h"
36 #include "ia_css_buffer.h"
37 #include "ia_css_err.h"
38 #define BUFQ_EVENT_SIZE 4
42 * @brief Query the internal frame ID.
44 * @param[in] key The query key.
45 * @param[out] val The query value.
48 * true, if the query succeeds;
49 * false, if the query fails.
51 bool ia_css_query_internal_queue_id(
52 enum ia_css_buffer_type buf_type,
53 unsigned int thread_id,
54 enum sh_css_queue_id *val
59 * @brief Map buffer type to a internal queue id.
61 * @param[in] thread id Thread in which the buffer type has to be mapped or unmapped
62 * @param[in] buf_type buffer type.
63 * @param[in] map boolean flag to specify map or unmap
66 void ia_css_queue_map(
67 unsigned int thread_id,
68 enum ia_css_buffer_type buf_type,
74 * @brief Initilize buffer type to a queue id mapping
77 void ia_css_queue_map_init(void);
81 * @brief initializes bufq module
82 * It create instances of
83 * -host to SP buffer queue which is a list with predefined size,
84 * MxN queues where M is the number threads and N is the number queues per thread
85 *-SP to host buffer queue , is a list with N queues
86 *-host to SP event communication queue
87 * -SP to host event communication queue
88 * -queue for tagger commands
91 void ia_css_bufq_init(void);
95 * @brief Enqueues an item into host to SP buffer queue
97 * @param thread_index[in] Thread in which the item to be enqueued
99 * @param queue_id[in] Index of the queue in the specified thread
100 * @param item[in] Object to enqueue.
101 * @return IA_CSS_SUCCESS or error code upon error.
104 enum ia_css_err ia_css_bufq_enqueue_buffer(
110 * @brief Dequeues an item from SP to host buffer queue.
112 * @param queue_id[in] Specifies the index of the queue in the list where
113 * the item has to be read.
114 * @paramitem [out] Object to be dequeued into this item.
115 * @return IA_CSS_SUCCESS or error code upon error.
118 enum ia_css_err ia_css_bufq_dequeue_buffer(
123 * @brief Enqueue an event item into host to SP communication event queue.
125 * @param[in] evt_id The event ID.
126 * @param[in] evt_payload_0 The event payload.
127 * @param[in] evt_payload_1 The event payload.
128 * @param[in] evt_payload_2 The event payload.
129 * @return IA_CSS_SUCCESS or error code upon error.
132 enum ia_css_err ia_css_bufq_enqueue_psys_event(
134 uint8_t evt_payload_0,
135 uint8_t evt_payload_1,
136 uint8_t evt_payload_2
140 * @brief Dequeue an item from SP to host communication event queue.
142 * @param item Object to be dequeued into this item.
143 * @return IA_CSS_SUCCESS or error code upon error.
146 enum ia_css_err ia_css_bufq_dequeue_psys_event(
147 uint8_t item[BUFQ_EVENT_SIZE]
151 * @brief Enqueue an event item into host to SP EOF event queue.
153 * @param[in] evt_id The event ID.
154 * @return IA_CSS_SUCCESS or error code upon error.
157 enum ia_css_err ia_css_bufq_enqueue_isys_event(
161 * @brief Dequeue an item from SP to host communication EOF event queue.
164 * @param item Object to be dequeued into this item.
165 * @return IA_CSS_SUCCESS or error code upon error.
168 enum ia_css_err ia_css_bufq_dequeue_isys_event(
169 uint8_t item[BUFQ_EVENT_SIZE]);
172 * @brief Enqueue a tagger command item into tagger command queue..
174 * @param item Object to be enqueue.
175 * @return IA_CSS_SUCCESS or error code upon error.
178 enum ia_css_err ia_css_bufq_enqueue_tag_cmd(
182 * @brief Uninitializes bufq module.
184 * @return IA_CSS_SUCCESS or error code upon error.
187 enum ia_css_err ia_css_bufq_deinit(void);
190 * @brief Dump queue states
195 void ia_css_bufq_dump_queue_info(void);
197 #endif /* _IA_CSS_BUFQ_H */