| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-2012, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bdsp_context.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/3 $ |
|---|
| 12 | * $brcm_Date: 1/27/12 1:02p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: Host DSP Context Interface |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/basemodules/dsp/common/bdsp_context.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/3 1/27/12 1:02p ashoky |
|---|
| 21 | * FWRAA-377: Merging h264 soft dsp video encoder to mainline. |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/2 5/16/11 10:06p srajapur |
|---|
| 24 | * SW7425-572: [7425] Adding VP6 support in basemodules |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/1 4/6/11 2:16p srajapur |
|---|
| 27 | * SW7425-291: [7425]BDSP directory structure changes |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/4 1/20/11 8:13a gautamk |
|---|
| 30 | * SW7422-191: Implementing code review comments |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/3 1/13/11 5:58a gautamk |
|---|
| 33 | * SW7422-191:[7422]Adding DSP support for Audio decode in Basemodule It |
|---|
| 34 | * includes - DSP Booting - Open time Download : - Start Time Audio |
|---|
| 35 | * Decode algorithm download - Message buffer interaction with DSP: - |
|---|
| 36 | * Synchronized Interrupt: - Async interrupts: - Config Commands for |
|---|
| 37 | * Decode/TSM/IDS: - Status Buffer for Decode/TSM/IDS: - Start AC3 Audio |
|---|
| 38 | * Decode: - Pause/Resume Command: - Frame Advance command: - Device |
|---|
| 39 | * level interrupt |
|---|
| 40 | * |
|---|
| 41 | * Hydra_Software_Devel/2 12/15/10 6:47p jgarrett |
|---|
| 42 | * SW7422-146: Initial compileable prototype |
|---|
| 43 | * |
|---|
| 44 | * Hydra_Software_Devel/1 12/14/10 2:17p jgarrett |
|---|
| 45 | * SW7422-146: Adding initial API for APE/DSP |
|---|
| 46 | * |
|---|
| 47 | ***************************************************************************/ |
|---|
| 48 | |
|---|
| 49 | #ifndef BDSP_CONTEXT_H_ |
|---|
| 50 | #define BDSP_CONTEXT_H_ |
|---|
| 51 | |
|---|
| 52 | #include "bchp.h" |
|---|
| 53 | #include "bint.h" |
|---|
| 54 | #include "bmem.h" |
|---|
| 55 | #include "breg_mem.h" |
|---|
| 56 | #include "btmr.h" |
|---|
| 57 | #include "bimg.h" |
|---|
| 58 | #include "bdsp.h" |
|---|
| 59 | |
|---|
| 60 | /*************************************************************************** |
|---|
| 61 | Summary: |
|---|
| 62 | DSP Audio Context Settings |
|---|
| 63 | ***************************************************************************/ |
|---|
| 64 | typedef struct BDSP_ContextCreateAudioSettings |
|---|
| 65 | { |
|---|
| 66 | unsigned maxNumAudioDatasyncDownloadBuffer; |
|---|
| 67 | unsigned maxNumAudioPassthruDownloadBuffer; |
|---|
| 68 | unsigned maxNumAudioDecodeDownloadBuffer; |
|---|
| 69 | unsigned maxNumAudioProcessingDownloadBuffer; |
|---|
| 70 | unsigned maxNumAudioEncodeDownloadBuffer; |
|---|
| 71 | } BDSP_ContextCreateAudioSettings; |
|---|
| 72 | |
|---|
| 73 | /*************************************************************************** |
|---|
| 74 | Summary: |
|---|
| 75 | DSP Video Context Settings |
|---|
| 76 | ***************************************************************************/ |
|---|
| 77 | typedef struct BDSP_ContextCreateVideoSettings |
|---|
| 78 | { |
|---|
| 79 | unsigned maxNumVideoDecodeDownloadBuffer; |
|---|
| 80 | } BDSP_ContextCreateVideoSettings; |
|---|
| 81 | |
|---|
| 82 | /*************************************************************************** |
|---|
| 83 | Summary: |
|---|
| 84 | DSP Video Encode Context Settings |
|---|
| 85 | ***************************************************************************/ |
|---|
| 86 | typedef struct BDSP_ContextCreateVideoEncodeSettings |
|---|
| 87 | { |
|---|
| 88 | unsigned maxNumVideoEncodeDownloadBuffer; |
|---|
| 89 | } BDSP_ContextCreateVideoEncodeSettings; |
|---|
| 90 | |
|---|
| 91 | typedef struct BDSP_ContextCreateSettings |
|---|
| 92 | { |
|---|
| 93 | unsigned maxTasks; |
|---|
| 94 | BDSP_ContextType contextType; |
|---|
| 95 | unsigned maxBranch; |
|---|
| 96 | unsigned maxStagePerBranch; |
|---|
| 97 | BDSP_ContextCreateAudioSettings audioDownloadBuffer; |
|---|
| 98 | BDSP_ContextCreateVideoSettings videoDownloadBuffer; |
|---|
| 99 | BDSP_ContextCreateVideoEncodeSettings videoEncodeDownloadBuffer; |
|---|
| 100 | } BDSP_ContextCreateSettings; |
|---|
| 101 | |
|---|
| 102 | /*************************************************************************** |
|---|
| 103 | Summary: |
|---|
| 104 | Get Default DSP Context Settings |
|---|
| 105 | ***************************************************************************/ |
|---|
| 106 | void BDSP_Context_GetDefaultCreateSettings( |
|---|
| 107 | BDSP_Handle dsp, |
|---|
| 108 | BDSP_ContextType contextType, |
|---|
| 109 | BDSP_ContextCreateSettings *pSettings /* [out] */ |
|---|
| 110 | ); |
|---|
| 111 | |
|---|
| 112 | /*************************************************************************** |
|---|
| 113 | Summary: |
|---|
| 114 | Create a DSP context |
|---|
| 115 | ***************************************************************************/ |
|---|
| 116 | BERR_Code BDSP_Context_Create( |
|---|
| 117 | BDSP_Handle dsp, |
|---|
| 118 | const BDSP_ContextCreateSettings *pSettings, |
|---|
| 119 | BDSP_ContextHandle *pContext /* [out] */ |
|---|
| 120 | ); |
|---|
| 121 | |
|---|
| 122 | /*************************************************************************** |
|---|
| 123 | Summary: |
|---|
| 124 | Destroy a DSP context |
|---|
| 125 | ***************************************************************************/ |
|---|
| 126 | void BDSP_Context_Destroy( |
|---|
| 127 | BDSP_ContextHandle context |
|---|
| 128 | ); |
|---|
| 129 | |
|---|
| 130 | /*************************************************************************** |
|---|
| 131 | Summary: |
|---|
| 132 | Context Level Interrupts |
|---|
| 133 | ***************************************************************************/ |
|---|
| 134 | typedef struct BDSP_ContextInterruptHandlers |
|---|
| 135 | { |
|---|
| 136 | struct |
|---|
| 137 | { |
|---|
| 138 | void (*pCallback_isr)(void *pParam1, int param2); |
|---|
| 139 | void *pParam1; |
|---|
| 140 | int param2; |
|---|
| 141 | } watchdog; |
|---|
| 142 | } BDSP_ContextInterruptHandlers; |
|---|
| 143 | |
|---|
| 144 | /*************************************************************************** |
|---|
| 145 | Summary: |
|---|
| 146 | Get Currently Registered Interrupt Handlers |
|---|
| 147 | ***************************************************************************/ |
|---|
| 148 | void BDSP_Context_GetInterruptHandlers( |
|---|
| 149 | BDSP_ContextHandle context, |
|---|
| 150 | BDSP_ContextInterruptHandlers *pInterrupts /* [out] */ |
|---|
| 151 | ); |
|---|
| 152 | |
|---|
| 153 | /*************************************************************************** |
|---|
| 154 | Summary: |
|---|
| 155 | Set Interrupt Handlers |
|---|
| 156 | |
|---|
| 157 | Description: |
|---|
| 158 | To disable any unwanted interrupt, pass NULL for its callback routine |
|---|
| 159 | ***************************************************************************/ |
|---|
| 160 | BERR_Code BDSP_Context_SetInterruptHandlers( |
|---|
| 161 | BDSP_ContextHandle context, |
|---|
| 162 | const BDSP_ContextInterruptHandlers *pInterrupts |
|---|
| 163 | ); |
|---|
| 164 | |
|---|
| 165 | /*************************************************************************** |
|---|
| 166 | Summary: |
|---|
| 167 | Process a watchdog interrupt for this context |
|---|
| 168 | ***************************************************************************/ |
|---|
| 169 | BERR_Code BDSP_Context_ProcessWatchdogInterrupt( |
|---|
| 170 | BDSP_ContextHandle context |
|---|
| 171 | ); |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | #endif |
|---|
| 175 | |
|---|