1bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/* 2bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This file is provided under a dual BSD/GPLv2 license. When using or 3bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee redistributing this file, you may do so under either license. 4bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 5bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee GPL LICENSE SUMMARY 6bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 7bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee Copyright(c) 2007-2009 Intel Corporation. All rights reserved. 8bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 9bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This program is free software; you can redistribute it and/or modify 10bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee it under the terms of version 2 of the GNU General Public License as 11bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee published by the Free Software Foundation. 12bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 13bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This program is distributed in the hope that it will be useful, but 14bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee WITHOUT ANY WARRANTY; without even the implied warranty of 15bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee General Public License for more details. 17bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 18bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee You should have received a copy of the GNU General Public License 19bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee along with this program; if not, write to the Free Software 20bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 21bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee The full GNU General Public License is included in this distribution 22bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee in the file called LICENSE.GPL. 23bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 24bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee Contact Information: 25bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 26bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee BSD LICENSE 27bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 28bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee Copyright(c) 2007-2009 Intel Corporation. All rights reserved. 29bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee All rights reserved. 30bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 31bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee Redistribution and use in source and binary forms, with or without 32bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee modification, are permitted provided that the following conditions 33bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee are met: 34bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 35bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee * Redistributions of source code must retain the above copyright 36bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee notice, this list of conditions and the following disclaimer. 37bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee * Redistributions in binary form must reproduce the above copyright 38bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee notice, this list of conditions and the following disclaimer in 39bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee the documentation and/or other materials provided with the 40bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee distribution. 41bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee * Neither the name of Intel Corporation nor the names of its 42bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee contributors may be used to endorse or promote products derived 43bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee from this software without specific prior written permission. 44bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 45bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 46bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 47bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 48bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 49bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 50bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 51bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 52bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 53bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 54bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 55bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 57bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 58bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 59bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee#ifndef VIDDEC_FW_PARSER_HOST_H 60bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee#define VIDDEC_FW_PARSER_HOST_H 61bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 62bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee#ifdef __cplusplus 63bd8388b4555645b3d29abc6a94c303638064d69awonjong.leeextern "C" { 64bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee#endif 65bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee#include "viddec_fw_common_defs.h" 66bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 67bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** @weakgroup viddec Fw Parser interface Functions */ 68bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** @ingroup viddec_fw_parser */ 69bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/*@{*/ 70bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 71bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 72bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function returns the size required for loading fw. 73bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval size : Required size. 74bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 75bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_query_fwsize(void); 76bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 77bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 78bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function loads Parser Firmware and initialises necessary state information.This a synchronous message to FW. 79bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] phys : Physical address on where firmware should be loaded. 80bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] len : Length of data allocated at phys. 81bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully loaded firmware. 82bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_FAILURE : Failed to communicate with firmware. 83bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_NORESOURCES : Failed to allocate resources for Loading firmware. 84bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid. 85bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 86bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_loadfw(uint32_t phys, uint32_t len); 87bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 88bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 89bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function returns the size required opening a stream. This a synchronous message to FW. 90bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] codec_type : Type of codec that we want information about. 91bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] num_wklds : Number of wklds required for initialisation. 92bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] size : Size of memory required for opening a stream. 93bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 94bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee void viddec_fw_parser_query_streamsize(uint32_t codec_type, uint32_t *num_wklds, uint32_t *size); 95bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 96bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 97bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function opens requested codec.This a synchronous message to FW. 98bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] codec_type : Type of codec that we want to open. 99bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] phys : Physical address of allocated memory for this codec. 100bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] prority : Priority of stream. 1 for realtime and 0 for background. 101bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] strm_handle : Handle of the opened stream. 102bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully Opened the stream. 103bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_FAILURE : Failed to Open a stream. 104bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_NORESOURCES : Failed to Open a stream as we are out of resources. 105bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 106bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_openstream(uint32_t codec_type, uint32_t *strm_handle, uint32_t phys, uint32_t priority); 107bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 108bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 109bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function closes stream.This a synchronous message to FW. 110bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee For the close stream to be effective, host has to do flush with discard first and then close the stream. 111bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] strm_handle : Handle of the stream to close. 112bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 113bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee void viddec_fw_parser_closestream(uint32_t strm_handle); 114bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 115bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 116bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function flushes the current stream. This is a synchronous message to FW. 117bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee Before calling this function the host has to make sure the output queue of the firmware 118bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee is empty. After this function is executed the FW will read all entries in input 119bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee es buffer queue into a free or partial workload and push it into output queue. 120bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee After this operation the host has to read all entries in output queue again to 121bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee finish the flush operation. 122bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] flush_type : Type of flush we want to perform.ex:flush and discard. 123bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] strm_handle : Handle of the stream we want to flush. 124bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully flushed the stream. 125bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid. 126bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_NEED_FREE_WKLD : Failed to flush sice a free wkld was not available. 127bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 128bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_flushstream(uint32_t strm_handle, uint32_t flush_type); 129bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 130bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 131bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function sends an input es buffer. 132bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] strm_handle : The handle of stream that we want to send es buffer to. 133bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] message : The es buffer we want to send. 134bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully Sent the message. 135bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_PORT_FULL : Port to fw full unsuccesful in sending message. 136bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid. 137bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 138bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_send(uint32_t strm_handle, ipc_msg_data *message); 139bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 140bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 141bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function gets the next processed workload. The host is required to add free workloads 142bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee to keep the parser busy. The FW will stall when it doesn't have enough workloads(2) to continue. 143bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] strm_handle : The handle of stream that we want to read workload from. 144bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] message : The workload descriptor. 145bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully Sent the message. 146bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_PORT_EMPTY : Workload port is empty,unsuccesful in reading wkld. 147bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid. 148bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 149bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_recv(uint32_t strm_handle, ipc_msg_data *message); 150bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 151bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 152bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function adds a free workload to current stream. 153bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] strm_handle : The handle of stream that we want to write workload to. 154bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] message : The workload descriptor. 155bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully Sent the message. 156bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_PORT_FULL : Workload port is full,unsuccesful in writing wkld. 157bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid. 158bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 159bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_addwkld(uint32_t strm_handle, ipc_msg_data *message); 160bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 161bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 162bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function enables or disables Interrupts for a stream. By default the FW will always enable interrupts. 163bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee The driver can disable/enable Interrupts if it needs for this particular stream. 164bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 165bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] strm_handle : The handle of stream that we want to get mask from 166bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] mask : This is read as boolean variable, true to enable, false to disable. 167bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully set mask. 168bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid. 169bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 170bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_set_interruptmask(uint32_t strm_handle, uint32_t mask); 171bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 172bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function gets the interrupt status for current stream. 173bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee When the host gets Interrupted since its a global interrupt it's expected that host will look at all active streams, 174bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee by calling this function. The status is what the FW thinks the current state of stream is. The status information that 175bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee FW provides is complete information on all possible events that are defined. The host should only access this information 176bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee in its ISR at which state FW doesn't modify this information. 177bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 178bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] strm_handle : The handle of stream that we want to get mask from 179bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] status : The status of the stream based on viddec_fw_parser_int_status_t enum. 180bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully in reading status. 181bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid. 182bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 183bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_getstatus(uint32_t strm_handle, uint32_t *status); 184bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 185bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 186bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function allows to set stream attributes that are supported. 187bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] strm_handle : The handle of stream that we want to set attribute on. 188bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] type : The type of attribute we want to set, this should be one of items in viddec_fw_stream_attributes_t. 189bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] value : The value of the type that we want to set. 190bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully Set the attribute. 191bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_INVALID_PARAM: The input parameters are not valid. 192bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 193bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_set_stream_attributes(uint32_t strm_handle, uint32_t type, uint32_t value); 194bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 195bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 196bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function allows to get current status of all the parser queues. If the current stream is active we return 197bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee number of inout messages that can be written to input queue, no of messages in output queue and number of 198bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee free available workloads the stream has. 199bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee Normally this is called when Host receives an interrupt from parser, In which case before releasing the INT 200bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee Host will try its best to keep the FW busy. We always get a interrupt if we passed the watermark on input or 201bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee a workload was pushed into output and INT line is free. If host holds onto INT when firmware tries to send an INT 202bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee FW would send the Interrupt after host releases INT. Since we have EDGE triggered interrupts we cannot guarantee 203bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee one interrupt per frame, ex: If three frames are generated and after the first frame FW was able to provide an INT 204bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee to host, but host held on to INT while the FW finished the next two frames, after host releases the INT the FW will 205bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee give only one INT and host should try to empty output queue. 206bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[in] strm_handle : The handle of stream that we want to get status of queues. 207bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] status : The status of each queue gets updated in here. 208bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_SUCCESS : Successfully Got the status information. 209bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @retval VIDDEC_FW_INVALID_PARAM: Invalid parameter in this case an inactive stream. 210bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 211bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee uint32_t viddec_fw_parser_get_queue_status(uint32_t strm_handle, viddec_fw_q_status_t *status); 212bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 213bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 214bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function unloads Parser Firmware and free's the resources allocated in Load fw. 215bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee If this function is called before load fw it will crash with a segmentation fault. 216bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 217bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee void viddec_fw_parser_deinit(void); 218bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 219bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 220bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function gets the major and minor revison numbers of the loaded firmware. 221bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] major : The major revision numner. 222bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] minor : The minor revision number. 223bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee @param[out] build : The Internal Build number. 224bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 225bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee void viddec_fw_parser_get_version_number(unsigned int *major, unsigned int *minor, unsigned int *build); 226bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 227bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/** 228bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee This function clears the global interrupt. This is the last thing host calls before exiting ISR. 229bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee*/ 230bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee void viddec_fw_parser_clear_global_interrupt(void); 231bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 232bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee/*@}*/ 233bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee#ifdef __cplusplus 234bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee} 235bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee#endif 236bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee 237bd8388b4555645b3d29abc6a94c303638064d69awonjong.lee#endif//#ifndef VIDDEC_FW_PARSER_HOST_H 238