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 #include <linux/slab.h>
70 /* ***************************************************************************
71 * Server-side bridge entry points
75 PVRSRVBridgePVRSRVPDumpIsCapturing(IMG_UINT32 ui32DispatchTableEntry,
76 PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingIN,
77 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingOUT,
78 CONNECTION_DATA *psConnection)
83 PVR_UNREFERENCED_PARAMETER(psConnection);
84 PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsCapturingIN);
90 psPVRSRVPDumpIsCapturingOUT->eError =
91 PDumpIsCaptureFrameKM(
92 &psPVRSRVPDumpIsCapturingOUT->bIsCapturing);
106 PVRSRVBridgePVRSRVPDumpGetFrame(IMG_UINT32 ui32DispatchTableEntry,
107 PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameIN,
108 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameOUT,
109 CONNECTION_DATA *psConnection)
114 PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpGetFrameIN);
120 psPVRSRVPDumpGetFrameOUT->eError =
121 PDumpGetFrameKM(psConnection, OSGetDevData(psConnection),
122 &psPVRSRVPDumpGetFrameOUT->ui32Frame);
136 PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams(IMG_UINT32 ui32DispatchTableEntry,
137 PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsIN,
138 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsOUT,
139 CONNECTION_DATA *psConnection)
144 PVR_UNREFERENCED_PARAMETER(psConnection);
150 psPVRSRVPDumpSetDefaultCaptureParamsOUT->eError =
151 PDumpSetDefaultCaptureParamsKM(
152 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Mode,
153 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Start,
154 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32End,
155 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Interval,
156 psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32MaxParamFileSize);
170 PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame(IMG_UINT32 ui32DispatchTableEntry,
171 PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameIN,
172 PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameOUT,
173 CONNECTION_DATA *psConnection)
178 PVR_UNREFERENCED_PARAMETER(psConnection);
179 PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsLastCaptureFrameIN);
185 psPVRSRVPDumpIsLastCaptureFrameOUT->eError =
186 PDumpIsLastCaptureFrameKM(
187 &psPVRSRVPDumpIsLastCaptureFrameOUT->bpbIsLastCaptureFrame);
202 /* ***************************************************************************
203 * Server bridge dispatch related glue
206 static POS_LOCK pPDUMPCTRLBridgeLock;
207 static IMG_BOOL bUseLock = IMG_TRUE;
209 PVRSRV_ERROR InitPDUMPCTRLBridge(void);
210 PVRSRV_ERROR DeinitPDUMPCTRLBridge(void);
213 * Register all PDUMPCTRL functions with services
215 PVRSRV_ERROR InitPDUMPCTRLBridge(void)
217 PVR_LOGR_IF_ERROR(OSLockCreate(&pPDUMPCTRLBridgeLock, LOCK_TYPE_PASSIVE), "OSLockCreate");
219 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISCAPTURING, PVRSRVBridgePVRSRVPDumpIsCapturing,
220 pPDUMPCTRLBridgeLock, bUseLock);
222 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPGETFRAME, PVRSRVBridgePVRSRVPDumpGetFrame,
223 pPDUMPCTRLBridgeLock, bUseLock);
225 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS, PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams,
226 pPDUMPCTRLBridgeLock, bUseLock);
228 SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISLASTCAPTUREFRAME, PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame,
229 pPDUMPCTRLBridgeLock, bUseLock);
236 * Unregister all pdumpctrl functions with services
238 PVRSRV_ERROR DeinitPDUMPCTRLBridge(void)
240 PVR_LOGR_IF_ERROR(OSLockDestroy(pPDUMPCTRLBridgeLock), "OSLockDestroy");