1 /*************************************************************************/ /*!
3 @Title Server bridge for pdumpctrl
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Implements the server side of the bridge for pdumpctrl
6 @License Dual MIT/GPLv2
8 The contents of this file are subject to the MIT license as set out below.
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
20 Alternatively, the contents of this file may be used under the terms of
21 the GNU General Public License Version 2 ("GPL") in which case the provisions
22 of GPL are applicable instead of those above.
24 If you wish to allow use of your version of this file only under the terms of
25 GPL, and not to allow others to use your version of this file under the terms
26 of the MIT license, indicate your decision by deleting the provisions above
27 and replace them with the notice and other provisions required by GPL as set
28 out in the file called "GPL-COPYING" included in this distribution. If you do
29 not delete the provisions above, a recipient may use your version of this file
30 under the terms of either the MIT license or GPL.
32 This License is also included in this distribution in the file called
35 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 */ /**************************************************************************/
45 #include <asm/uaccess.h>
52 #include "common_pdumpctrl_bridge.h"
55 #include "pvr_debug.h"
56 #include "connection_server.h"
57 #include "pvr_bridge.h"
58 #include "rgx_bridge.h"
62 #if defined (SUPPORT_AUTH)
66 #include <linux/slab.h>
72 /* ***************************************************************************
73 * Server-side bridge entry points
77 PVRSRVBridgePVRSRVPDumpIsCapturing(IMG_UINT32 ui32DispatchTableEntry,
78 PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingIN,
79 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingOUT,
80 CONNECTION_DATA *psConnection)
83 PVR_UNREFERENCED_PARAMETER(psConnection);
84 PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsCapturingIN);
91 psPVRSRVPDumpIsCapturingOUT->eError =
92 PDumpIsCaptureFrameKM(
93 &psPVRSRVPDumpIsCapturingOUT->bIsCapturing);
103 PVRSRVBridgePVRSRVPDumpGetFrame(IMG_UINT32 ui32DispatchTableEntry,
104 PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameIN,
105 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameOUT,
106 CONNECTION_DATA *psConnection)
109 PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpGetFrameIN);
116 psPVRSRVPDumpGetFrameOUT->eError =
117 PDumpGetFrameKM(psConnection,
118 &psPVRSRVPDumpGetFrameOUT->ui32Frame);
128 PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams(IMG_UINT32 ui32DispatchTableEntry,
129 PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsIN,
130 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsOUT,
131 CONNECTION_DATA *psConnection)
134 PVR_UNREFERENCED_PARAMETER(psConnection);
141 psPVRSRVPDumpSetDefaultCaptureParamsOUT->eError =
142 PDumpSetDefaultCaptureParamsKM(
143 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Mode,
144 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Start,
145 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32End,
146 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Interval,
147 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32MaxParamFileSize);
157 PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame(IMG_UINT32 ui32DispatchTableEntry,
158 PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameIN,
159 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameOUT,
160 CONNECTION_DATA *psConnection)
163 PVR_UNREFERENCED_PARAMETER(psConnection);
164 PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsLastCaptureFrameIN);
171 psPVRSRVPDumpIsLastCaptureFrameOUT->eError =
172 PDumpIsLastCaptureFrameKM(
183 PVRSRVBridgePVRSRVPDumpStartInitPhase(IMG_UINT32 ui32DispatchTableEntry,
184 PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseIN,
185 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseOUT,
186 CONNECTION_DATA *psConnection)
189 PVR_UNREFERENCED_PARAMETER(psConnection);
190 PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpStartInitPhaseIN);
197 psPVRSRVPDumpStartInitPhaseOUT->eError =
198 PDumpStartInitPhaseKM(
209 PVRSRVBridgePVRSRVPDumpStopInitPhase(IMG_UINT32 ui32DispatchTableEntry,
210 PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseIN,
211 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseOUT,
212 CONNECTION_DATA *psConnection)
215 PVR_UNREFERENCED_PARAMETER(psConnection);
222 psPVRSRVPDumpStopInitPhaseOUT->eError =
223 PDumpStopInitPhaseKM(
224 psPVRSRVPDumpStopInitPhaseIN->eModuleID);
235 /* ***************************************************************************
236 * Server bridge dispatch related glue
239 static POS_LOCK pPDUMPCTRLBridgeLock;
240 static IMG_BYTE pbyPDUMPCTRLBridgeBuffer[20 + 8];
242 PVRSRV_ERROR InitPDUMPCTRLBridge(IMG_VOID);
243 PVRSRV_ERROR DeinitPDUMPCTRLBridge(IMG_VOID);
246 * Register all PDUMPCTRL functions with services
248 PVRSRV_ERROR InitPDUMPCTRLBridge(IMG_VOID)
250 PVR_LOGR_IF_ERROR(OSLockCreate(&pPDUMPCTRLBridgeLock, LOCK_TYPE_PASSIVE), "OSLockCreate");
252 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISCAPTURING, PVRSRVBridgePVRSRVPDumpIsCapturing,
253 pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
256 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPGETFRAME, PVRSRVBridgePVRSRVPDumpGetFrame,
257 pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
260 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS, PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams,
261 pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
264 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISLASTCAPTUREFRAME, PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame,
265 pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
268 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTARTINITPHASE, PVRSRVBridgePVRSRVPDumpStartInitPhase,
269 pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
272 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTOPINITPHASE, PVRSRVBridgePVRSRVPDumpStopInitPhase,
273 pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
281 * Unregister all pdumpctrl functions with services
283 PVRSRV_ERROR DeinitPDUMPCTRLBridge(IMG_VOID)
285 PVR_LOGR_IF_ERROR(OSLockDestroy(pPDUMPCTRLBridgeLock), "OSLockDestroy");