1 /*******************************************************************************
3 @Title Direct client bridge for pvrtl
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Implements the client side of the bridge for pvrtl
6 which is used in calls from Server context.
7 @License Dual MIT/GPLv2
9 The contents of this file are subject to the MIT license as set out below.
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13 in the Software without restriction, including without limitation the rights
14 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom the Software is
16 furnished to do so, subject to the following conditions:
18 The above copyright notice and this permission notice shall be included in
19 all copies or substantial portions of the Software.
21 Alternatively, the contents of this file may be used under the terms of
22 the GNU General Public License Version 2 ("GPL") in which case the provisions
23 of GPL are applicable instead of those above.
25 If you wish to allow use of your version of this file only under the terms of
26 GPL, and not to allow others to use your version of this file under the terms
27 of the MIT license, indicate your decision by deleting the provisions above
28 and replace them with the notice and other provisions required by GPL as set
29 out in the file called "GPL-COPYING" included in this distribution. If you do
30 not delete the provisions above, a recipient may use your version of this file
31 under the terms of either the MIT license or GPL.
33 This License is also included in this distribution in the file called
36 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
37 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
38 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
39 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
40 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
41 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
42 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43 *******************************************************************************/
45 #include "client_pvrtl_bridge.h"
47 #include "pvr_debug.h"
49 /* Module specific includes */
50 #include "devicemem_typedefs.h"
51 #include "pvrsrv_tlcommon.h"
55 IMG_INTERNAL PVRSRV_ERROR BridgeTLOpenStream(IMG_HANDLE hBridge,
56 const IMG_CHAR * puiName,
58 IMG_HANDLE * phSD, IMG_HANDLE * phTLPMR)
61 TL_STREAM_DESC *psSDInt = NULL;
62 PMR *psTLPMRInt = NULL;
63 PVR_UNREFERENCED_PARAMETER(hBridge);
65 eError = TLServerOpenStreamKM(puiName, ui32Mode, &psSDInt, &psTLPMRInt);
68 *phTLPMR = psTLPMRInt;
72 IMG_INTERNAL PVRSRV_ERROR BridgeTLCloseStream(IMG_HANDLE hBridge, IMG_HANDLE hSD)
75 TL_STREAM_DESC *psSDInt;
76 PVR_UNREFERENCED_PARAMETER(hBridge);
78 psSDInt = (TL_STREAM_DESC *) hSD;
80 eError = TLServerCloseStreamKM(psSDInt);
85 IMG_INTERNAL PVRSRV_ERROR BridgeTLAcquireData(IMG_HANDLE hBridge,
87 IMG_UINT32 * pui32ReadOffset,
88 IMG_UINT32 * pui32ReadLen)
91 TL_STREAM_DESC *psSDInt;
92 PVR_UNREFERENCED_PARAMETER(hBridge);
94 psSDInt = (TL_STREAM_DESC *) hSD;
96 eError = TLServerAcquireDataKM(psSDInt, pui32ReadOffset, pui32ReadLen);
101 IMG_INTERNAL PVRSRV_ERROR BridgeTLReleaseData(IMG_HANDLE hBridge,
103 IMG_UINT32 ui32ReadOffset, IMG_UINT32 ui32ReadLen)
106 TL_STREAM_DESC *psSDInt;
107 PVR_UNREFERENCED_PARAMETER(hBridge);
109 psSDInt = (TL_STREAM_DESC *) hSD;
111 eError = TLServerReleaseDataKM(psSDInt, ui32ReadOffset, ui32ReadLen);
116 IMG_INTERNAL PVRSRV_ERROR BridgeTLDiscoverStreams(IMG_HANDLE hBridge,
117 const IMG_CHAR * puiNamePattern,
119 IMG_CHAR * puiStreams, IMG_UINT32 * pui32NumFound)
122 PVR_UNREFERENCED_PARAMETER(hBridge);
124 eError = TLServerDiscoverStreamsKM(puiNamePattern, ui32Size, puiStreams, pui32NumFound);
129 IMG_INTERNAL PVRSRV_ERROR BridgeTLReserveStream(IMG_HANDLE hBridge,
131 IMG_UINT32 * pui32BufferOffset,
133 IMG_UINT32 ui32SizeMin, IMG_UINT32 * pui32Available)
136 TL_STREAM_DESC *psSDInt;
137 PVR_UNREFERENCED_PARAMETER(hBridge);
139 psSDInt = (TL_STREAM_DESC *) hSD;
142 TLServerReserveStreamKM(psSDInt,
143 pui32BufferOffset, ui32Size, ui32SizeMin, pui32Available);
148 IMG_INTERNAL PVRSRV_ERROR BridgeTLCommitStream(IMG_HANDLE hBridge,
149 IMG_HANDLE hSD, IMG_UINT32 ui32ReqSize)
152 TL_STREAM_DESC *psSDInt;
153 PVR_UNREFERENCED_PARAMETER(hBridge);
155 psSDInt = (TL_STREAM_DESC *) hSD;
157 eError = TLServerCommitStreamKM(psSDInt, ui32ReqSize);
162 IMG_INTERNAL PVRSRV_ERROR BridgeTLWriteData(IMG_HANDLE hBridge,
164 IMG_UINT32 ui32Size, IMG_BYTE * pui8Data)
167 TL_STREAM_DESC *psSDInt;
168 PVR_UNREFERENCED_PARAMETER(hBridge);
170 psSDInt = (TL_STREAM_DESC *) hSD;
172 eError = TLServerWriteDataKM(psSDInt, ui32Size, pui8Data);