1 /*************************************************************************/ /*!
3 @Title Server bridge for ri
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Implements the server side of the bridge for ri
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>
49 #include "ri_server.h"
52 #include "common_ri_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>
69 /* ***************************************************************************
70 * Server-side bridge entry points
74 PVRSRVBridgeRIWritePMREntry(IMG_UINT32 ui32DispatchTableEntry,
75 PVRSRV_BRIDGE_IN_RIWRITEPMRENTRY *psRIWritePMREntryIN,
76 PVRSRV_BRIDGE_OUT_RIWRITEPMRENTRY *psRIWritePMREntryOUT,
77 CONNECTION_DATA *psConnection)
79 IMG_HANDLE hPMRHandle = psRIWritePMREntryIN->hPMRHandle;
80 PMR * psPMRHandleInt = NULL;
81 IMG_CHAR *uiTextAInt = NULL;
83 IMG_UINT32 ui32NextOffset = 0;
84 IMG_BYTE *pArrayArgsBuffer = NULL;
85 #if !defined(INTEGRITY_OS)
86 IMG_BOOL bHaveEnoughSpace = IMG_FALSE;
89 IMG_UINT32 ui32BufferSize =
90 (psRIWritePMREntryIN->ui32TextASize * sizeof(IMG_CHAR)) +
97 if (ui32BufferSize != 0)
99 #if !defined(INTEGRITY_OS)
100 /* Try to use remainder of input buffer for copies if possible, word-aligned for safety. */
101 IMG_UINT32 ui32InBufferOffset = PVR_ALIGN(sizeof(*psRIWritePMREntryIN), sizeof(unsigned long));
102 IMG_UINT32 ui32InBufferExcessSize = ui32InBufferOffset >= PVRSRV_MAX_BRIDGE_IN_SIZE ? 0 :
103 PVRSRV_MAX_BRIDGE_IN_SIZE - ui32InBufferOffset;
105 bHaveEnoughSpace = ui32BufferSize <= ui32InBufferExcessSize;
106 if (bHaveEnoughSpace)
108 IMG_BYTE *pInputBuffer = (IMG_BYTE *)psRIWritePMREntryIN;
110 pArrayArgsBuffer = &pInputBuffer[ui32InBufferOffset]; }
114 pArrayArgsBuffer = OSAllocMemNoStats(ui32BufferSize);
116 if(!pArrayArgsBuffer)
118 psRIWritePMREntryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
119 goto RIWritePMREntry_exit;
124 if (psRIWritePMREntryIN->ui32TextASize != 0)
126 uiTextAInt = (IMG_CHAR*)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
127 ui32NextOffset += psRIWritePMREntryIN->ui32TextASize * sizeof(IMG_CHAR);
130 /* Copy the data over */
131 if (psRIWritePMREntryIN->ui32TextASize * sizeof(IMG_CHAR) > 0)
133 if ( OSCopyFromUser(NULL, uiTextAInt, psRIWritePMREntryIN->puiTextA, psRIWritePMREntryIN->ui32TextASize * sizeof(IMG_CHAR)) != PVRSRV_OK )
135 psRIWritePMREntryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
137 goto RIWritePMREntry_exit;
141 /* Lock over handle lookup. */
149 /* Look up the address from the handle */
150 psRIWritePMREntryOUT->eError =
151 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
152 (void **) &psPMRHandleInt,
154 PVRSRV_HANDLE_TYPE_PHYSMEM_PMR,
156 if(psRIWritePMREntryOUT->eError != PVRSRV_OK)
159 goto RIWritePMREntry_exit;
162 /* Release now we have looked up handles. */
165 psRIWritePMREntryOUT->eError =
168 psRIWritePMREntryIN->ui32TextASize,
170 psRIWritePMREntryIN->ui64LogicalSize);
175 RIWritePMREntry_exit:
177 /* Lock over handle lookup cleanup. */
186 /* Unreference the previously looked up handle */
189 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
191 PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
194 /* Release now we have cleaned up look up handles. */
197 /* Allocated space should be equal to the last updated offset */
198 PVR_ASSERT(ui32BufferSize == ui32NextOffset);
200 #if defined(INTEGRITY_OS)
203 if(!bHaveEnoughSpace && pArrayArgsBuffer)
205 OSFreeMemNoStats(pArrayArgsBuffer);
213 PVRSRVBridgeRIWriteMEMDESCEntry(IMG_UINT32 ui32DispatchTableEntry,
214 PVRSRV_BRIDGE_IN_RIWRITEMEMDESCENTRY *psRIWriteMEMDESCEntryIN,
215 PVRSRV_BRIDGE_OUT_RIWRITEMEMDESCENTRY *psRIWriteMEMDESCEntryOUT,
216 CONNECTION_DATA *psConnection)
218 IMG_HANDLE hPMRHandle = psRIWriteMEMDESCEntryIN->hPMRHandle;
219 PMR * psPMRHandleInt = NULL;
220 IMG_CHAR *uiTextBInt = NULL;
221 RI_HANDLE psRIHandleInt = NULL;
223 IMG_UINT32 ui32NextOffset = 0;
224 IMG_BYTE *pArrayArgsBuffer = NULL;
225 #if !defined(INTEGRITY_OS)
226 IMG_BOOL bHaveEnoughSpace = IMG_FALSE;
229 IMG_UINT32 ui32BufferSize =
230 (psRIWriteMEMDESCEntryIN->ui32TextBSize * sizeof(IMG_CHAR)) +
237 if (ui32BufferSize != 0)
239 #if !defined(INTEGRITY_OS)
240 /* Try to use remainder of input buffer for copies if possible, word-aligned for safety. */
241 IMG_UINT32 ui32InBufferOffset = PVR_ALIGN(sizeof(*psRIWriteMEMDESCEntryIN), sizeof(unsigned long));
242 IMG_UINT32 ui32InBufferExcessSize = ui32InBufferOffset >= PVRSRV_MAX_BRIDGE_IN_SIZE ? 0 :
243 PVRSRV_MAX_BRIDGE_IN_SIZE - ui32InBufferOffset;
245 bHaveEnoughSpace = ui32BufferSize <= ui32InBufferExcessSize;
246 if (bHaveEnoughSpace)
248 IMG_BYTE *pInputBuffer = (IMG_BYTE *)psRIWriteMEMDESCEntryIN;
250 pArrayArgsBuffer = &pInputBuffer[ui32InBufferOffset]; }
254 pArrayArgsBuffer = OSAllocMemNoStats(ui32BufferSize);
256 if(!pArrayArgsBuffer)
258 psRIWriteMEMDESCEntryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
259 goto RIWriteMEMDESCEntry_exit;
264 if (psRIWriteMEMDESCEntryIN->ui32TextBSize != 0)
266 uiTextBInt = (IMG_CHAR*)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
267 ui32NextOffset += psRIWriteMEMDESCEntryIN->ui32TextBSize * sizeof(IMG_CHAR);
270 /* Copy the data over */
271 if (psRIWriteMEMDESCEntryIN->ui32TextBSize * sizeof(IMG_CHAR) > 0)
273 if ( OSCopyFromUser(NULL, uiTextBInt, psRIWriteMEMDESCEntryIN->puiTextB, psRIWriteMEMDESCEntryIN->ui32TextBSize * sizeof(IMG_CHAR)) != PVRSRV_OK )
275 psRIWriteMEMDESCEntryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
277 goto RIWriteMEMDESCEntry_exit;
281 /* Lock over handle lookup. */
289 /* Look up the address from the handle */
290 psRIWriteMEMDESCEntryOUT->eError =
291 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
292 (void **) &psPMRHandleInt,
294 PVRSRV_HANDLE_TYPE_PHYSMEM_PMR,
296 if(psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK)
299 goto RIWriteMEMDESCEntry_exit;
302 /* Release now we have looked up handles. */
305 psRIWriteMEMDESCEntryOUT->eError =
306 RIWriteMEMDESCEntryKM(
308 psRIWriteMEMDESCEntryIN->ui32TextBSize,
310 psRIWriteMEMDESCEntryIN->ui64Offset,
311 psRIWriteMEMDESCEntryIN->ui64Size,
312 psRIWriteMEMDESCEntryIN->ui64BackedSize,
313 psRIWriteMEMDESCEntryIN->bIsImport,
314 psRIWriteMEMDESCEntryIN->bIsExportable,
316 /* Exit early if bridged call fails */
317 if(psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK)
319 goto RIWriteMEMDESCEntry_exit;
322 /* Lock over handle creation. */
329 psRIWriteMEMDESCEntryOUT->eError = PVRSRVAllocHandleUnlocked(psConnection->psHandleBase,
331 &psRIWriteMEMDESCEntryOUT->hRIHandle,
332 (void *) psRIHandleInt,
333 PVRSRV_HANDLE_TYPE_RI_HANDLE,
334 PVRSRV_HANDLE_ALLOC_FLAG_MULTI
335 ,(PFN_HANDLE_RELEASE)&RIDeleteMEMDESCEntryKM);
336 if (psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK)
339 goto RIWriteMEMDESCEntry_exit;
342 /* Release now we have created handles. */
347 RIWriteMEMDESCEntry_exit:
349 /* Lock over handle lookup cleanup. */
358 /* Unreference the previously looked up handle */
361 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
363 PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
366 /* Release now we have cleaned up look up handles. */
369 if (psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK)
373 RIDeleteMEMDESCEntryKM(psRIHandleInt);
377 /* Allocated space should be equal to the last updated offset */
378 PVR_ASSERT(ui32BufferSize == ui32NextOffset);
380 #if defined(INTEGRITY_OS)
383 if(!bHaveEnoughSpace && pArrayArgsBuffer)
385 OSFreeMemNoStats(pArrayArgsBuffer);
393 PVRSRVBridgeRIWriteProcListEntry(IMG_UINT32 ui32DispatchTableEntry,
394 PVRSRV_BRIDGE_IN_RIWRITEPROCLISTENTRY *psRIWriteProcListEntryIN,
395 PVRSRV_BRIDGE_OUT_RIWRITEPROCLISTENTRY *psRIWriteProcListEntryOUT,
396 CONNECTION_DATA *psConnection)
398 IMG_CHAR *uiTextBInt = NULL;
399 RI_HANDLE psRIHandleInt = NULL;
401 IMG_UINT32 ui32NextOffset = 0;
402 IMG_BYTE *pArrayArgsBuffer = NULL;
403 #if !defined(INTEGRITY_OS)
404 IMG_BOOL bHaveEnoughSpace = IMG_FALSE;
407 IMG_UINT32 ui32BufferSize =
408 (psRIWriteProcListEntryIN->ui32TextBSize * sizeof(IMG_CHAR)) +
415 if (ui32BufferSize != 0)
417 #if !defined(INTEGRITY_OS)
418 /* Try to use remainder of input buffer for copies if possible, word-aligned for safety. */
419 IMG_UINT32 ui32InBufferOffset = PVR_ALIGN(sizeof(*psRIWriteProcListEntryIN), sizeof(unsigned long));
420 IMG_UINT32 ui32InBufferExcessSize = ui32InBufferOffset >= PVRSRV_MAX_BRIDGE_IN_SIZE ? 0 :
421 PVRSRV_MAX_BRIDGE_IN_SIZE - ui32InBufferOffset;
423 bHaveEnoughSpace = ui32BufferSize <= ui32InBufferExcessSize;
424 if (bHaveEnoughSpace)
426 IMG_BYTE *pInputBuffer = (IMG_BYTE *)psRIWriteProcListEntryIN;
428 pArrayArgsBuffer = &pInputBuffer[ui32InBufferOffset]; }
432 pArrayArgsBuffer = OSAllocMemNoStats(ui32BufferSize);
434 if(!pArrayArgsBuffer)
436 psRIWriteProcListEntryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
437 goto RIWriteProcListEntry_exit;
442 if (psRIWriteProcListEntryIN->ui32TextBSize != 0)
444 uiTextBInt = (IMG_CHAR*)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
445 ui32NextOffset += psRIWriteProcListEntryIN->ui32TextBSize * sizeof(IMG_CHAR);
448 /* Copy the data over */
449 if (psRIWriteProcListEntryIN->ui32TextBSize * sizeof(IMG_CHAR) > 0)
451 if ( OSCopyFromUser(NULL, uiTextBInt, psRIWriteProcListEntryIN->puiTextB, psRIWriteProcListEntryIN->ui32TextBSize * sizeof(IMG_CHAR)) != PVRSRV_OK )
453 psRIWriteProcListEntryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
455 goto RIWriteProcListEntry_exit;
460 psRIWriteProcListEntryOUT->eError =
461 RIWriteProcListEntryKM(
462 psRIWriteProcListEntryIN->ui32TextBSize,
464 psRIWriteProcListEntryIN->ui64Size,
465 psRIWriteProcListEntryIN->ui64BackedSize,
466 psRIWriteProcListEntryIN->ui64DevVAddr,
468 /* Exit early if bridged call fails */
469 if(psRIWriteProcListEntryOUT->eError != PVRSRV_OK)
471 goto RIWriteProcListEntry_exit;
474 /* Lock over handle creation. */
481 psRIWriteProcListEntryOUT->eError = PVRSRVAllocHandleUnlocked(psConnection->psHandleBase,
483 &psRIWriteProcListEntryOUT->hRIHandle,
484 (void *) psRIHandleInt,
485 PVRSRV_HANDLE_TYPE_RI_HANDLE,
486 PVRSRV_HANDLE_ALLOC_FLAG_MULTI
487 ,(PFN_HANDLE_RELEASE)&RIDeleteMEMDESCEntryKM);
488 if (psRIWriteProcListEntryOUT->eError != PVRSRV_OK)
491 goto RIWriteProcListEntry_exit;
494 /* Release now we have created handles. */
499 RIWriteProcListEntry_exit:
503 if (psRIWriteProcListEntryOUT->eError != PVRSRV_OK)
507 RIDeleteMEMDESCEntryKM(psRIHandleInt);
511 /* Allocated space should be equal to the last updated offset */
512 PVR_ASSERT(ui32BufferSize == ui32NextOffset);
514 #if defined(INTEGRITY_OS)
517 if(!bHaveEnoughSpace && pArrayArgsBuffer)
519 OSFreeMemNoStats(pArrayArgsBuffer);
527 PVRSRVBridgeRIUpdateMEMDESCAddr(IMG_UINT32 ui32DispatchTableEntry,
528 PVRSRV_BRIDGE_IN_RIUPDATEMEMDESCADDR *psRIUpdateMEMDESCAddrIN,
529 PVRSRV_BRIDGE_OUT_RIUPDATEMEMDESCADDR *psRIUpdateMEMDESCAddrOUT,
530 CONNECTION_DATA *psConnection)
532 IMG_HANDLE hRIHandle = psRIUpdateMEMDESCAddrIN->hRIHandle;
533 RI_HANDLE psRIHandleInt = NULL;
541 /* Lock over handle lookup. */
549 /* Look up the address from the handle */
550 psRIUpdateMEMDESCAddrOUT->eError =
551 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
552 (void **) &psRIHandleInt,
554 PVRSRV_HANDLE_TYPE_RI_HANDLE,
556 if(psRIUpdateMEMDESCAddrOUT->eError != PVRSRV_OK)
559 goto RIUpdateMEMDESCAddr_exit;
562 /* Release now we have looked up handles. */
565 psRIUpdateMEMDESCAddrOUT->eError =
566 RIUpdateMEMDESCAddrKM(
568 psRIUpdateMEMDESCAddrIN->sAddr);
573 RIUpdateMEMDESCAddr_exit:
575 /* Lock over handle lookup cleanup. */
584 /* Unreference the previously looked up handle */
587 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
589 PVRSRV_HANDLE_TYPE_RI_HANDLE);
592 /* Release now we have cleaned up look up handles. */
601 PVRSRVBridgeRIUpdateMEMDESCPinning(IMG_UINT32 ui32DispatchTableEntry,
602 PVRSRV_BRIDGE_IN_RIUPDATEMEMDESCPINNING *psRIUpdateMEMDESCPinningIN,
603 PVRSRV_BRIDGE_OUT_RIUPDATEMEMDESCPINNING *psRIUpdateMEMDESCPinningOUT,
604 CONNECTION_DATA *psConnection)
606 IMG_HANDLE hRIHandle = psRIUpdateMEMDESCPinningIN->hRIHandle;
607 RI_HANDLE psRIHandleInt = NULL;
615 /* Lock over handle lookup. */
623 /* Look up the address from the handle */
624 psRIUpdateMEMDESCPinningOUT->eError =
625 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
626 (void **) &psRIHandleInt,
628 PVRSRV_HANDLE_TYPE_RI_HANDLE,
630 if(psRIUpdateMEMDESCPinningOUT->eError != PVRSRV_OK)
633 goto RIUpdateMEMDESCPinning_exit;
636 /* Release now we have looked up handles. */
639 psRIUpdateMEMDESCPinningOUT->eError =
640 RIUpdateMEMDESCPinningKM(
642 psRIUpdateMEMDESCPinningIN->bIsPinned);
647 RIUpdateMEMDESCPinning_exit:
649 /* Lock over handle lookup cleanup. */
658 /* Unreference the previously looked up handle */
661 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
663 PVRSRV_HANDLE_TYPE_RI_HANDLE);
666 /* Release now we have cleaned up look up handles. */
675 PVRSRVBridgeRIUpdateMEMDESCBacking(IMG_UINT32 ui32DispatchTableEntry,
676 PVRSRV_BRIDGE_IN_RIUPDATEMEMDESCBACKING *psRIUpdateMEMDESCBackingIN,
677 PVRSRV_BRIDGE_OUT_RIUPDATEMEMDESCBACKING *psRIUpdateMEMDESCBackingOUT,
678 CONNECTION_DATA *psConnection)
680 IMG_HANDLE hRIHandle = psRIUpdateMEMDESCBackingIN->hRIHandle;
681 RI_HANDLE psRIHandleInt = NULL;
689 /* Lock over handle lookup. */
697 /* Look up the address from the handle */
698 psRIUpdateMEMDESCBackingOUT->eError =
699 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
700 (void **) &psRIHandleInt,
702 PVRSRV_HANDLE_TYPE_RI_HANDLE,
704 if(psRIUpdateMEMDESCBackingOUT->eError != PVRSRV_OK)
707 goto RIUpdateMEMDESCBacking_exit;
710 /* Release now we have looked up handles. */
713 psRIUpdateMEMDESCBackingOUT->eError =
714 RIUpdateMEMDESCBackingKM(
716 psRIUpdateMEMDESCBackingIN->i32NumModified);
721 RIUpdateMEMDESCBacking_exit:
723 /* Lock over handle lookup cleanup. */
732 /* Unreference the previously looked up handle */
735 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
737 PVRSRV_HANDLE_TYPE_RI_HANDLE);
740 /* Release now we have cleaned up look up handles. */
749 PVRSRVBridgeRIDeleteMEMDESCEntry(IMG_UINT32 ui32DispatchTableEntry,
750 PVRSRV_BRIDGE_IN_RIDELETEMEMDESCENTRY *psRIDeleteMEMDESCEntryIN,
751 PVRSRV_BRIDGE_OUT_RIDELETEMEMDESCENTRY *psRIDeleteMEMDESCEntryOUT,
752 CONNECTION_DATA *psConnection)
763 /* Lock over handle destruction. */
770 psRIDeleteMEMDESCEntryOUT->eError =
771 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
772 (IMG_HANDLE) psRIDeleteMEMDESCEntryIN->hRIHandle,
773 PVRSRV_HANDLE_TYPE_RI_HANDLE);
774 if ((psRIDeleteMEMDESCEntryOUT->eError != PVRSRV_OK) &&
775 (psRIDeleteMEMDESCEntryOUT->eError != PVRSRV_ERROR_RETRY))
777 PVR_DPF((PVR_DBG_ERROR,
778 "PVRSRVBridgeRIDeleteMEMDESCEntry: %s",
779 PVRSRVGetErrorStringKM(psRIDeleteMEMDESCEntryOUT->eError)));
782 goto RIDeleteMEMDESCEntry_exit;
785 /* Release now we have destroyed handles. */
790 RIDeleteMEMDESCEntry_exit:
800 PVRSRVBridgeRIDumpList(IMG_UINT32 ui32DispatchTableEntry,
801 PVRSRV_BRIDGE_IN_RIDUMPLIST *psRIDumpListIN,
802 PVRSRV_BRIDGE_OUT_RIDUMPLIST *psRIDumpListOUT,
803 CONNECTION_DATA *psConnection)
805 IMG_HANDLE hPMRHandle = psRIDumpListIN->hPMRHandle;
806 PMR * psPMRHandleInt = NULL;
814 /* Lock over handle lookup. */
822 /* Look up the address from the handle */
823 psRIDumpListOUT->eError =
824 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
825 (void **) &psPMRHandleInt,
827 PVRSRV_HANDLE_TYPE_PHYSMEM_PMR,
829 if(psRIDumpListOUT->eError != PVRSRV_OK)
832 goto RIDumpList_exit;
835 /* Release now we have looked up handles. */
838 psRIDumpListOUT->eError =
847 /* Lock over handle lookup cleanup. */
856 /* Unreference the previously looked up handle */
859 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
861 PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
864 /* Release now we have cleaned up look up handles. */
873 PVRSRVBridgeRIDumpAll(IMG_UINT32 ui32DispatchTableEntry,
874 PVRSRV_BRIDGE_IN_RIDUMPALL *psRIDumpAllIN,
875 PVRSRV_BRIDGE_OUT_RIDUMPALL *psRIDumpAllOUT,
876 CONNECTION_DATA *psConnection)
881 PVR_UNREFERENCED_PARAMETER(psConnection);
882 PVR_UNREFERENCED_PARAMETER(psRIDumpAllIN);
888 psRIDumpAllOUT->eError =
904 PVRSRVBridgeRIDumpProcess(IMG_UINT32 ui32DispatchTableEntry,
905 PVRSRV_BRIDGE_IN_RIDUMPPROCESS *psRIDumpProcessIN,
906 PVRSRV_BRIDGE_OUT_RIDUMPPROCESS *psRIDumpProcessOUT,
907 CONNECTION_DATA *psConnection)
912 PVR_UNREFERENCED_PARAMETER(psConnection);
918 psRIDumpProcessOUT->eError =
920 psRIDumpProcessIN->ui32Pid);
935 /* ***************************************************************************
936 * Server bridge dispatch related glue
939 static IMG_BOOL bUseLock = IMG_TRUE;
941 PVRSRV_ERROR InitRIBridge(void);
942 PVRSRV_ERROR DeinitRIBridge(void);
945 * Register all RI functions with services
947 PVRSRV_ERROR InitRIBridge(void)
950 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIWRITEPMRENTRY, PVRSRVBridgeRIWritePMREntry,
953 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIWRITEMEMDESCENTRY, PVRSRVBridgeRIWriteMEMDESCEntry,
956 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIWRITEPROCLISTENTRY, PVRSRVBridgeRIWriteProcListEntry,
959 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIUPDATEMEMDESCADDR, PVRSRVBridgeRIUpdateMEMDESCAddr,
962 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIUPDATEMEMDESCPINNING, PVRSRVBridgeRIUpdateMEMDESCPinning,
965 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIUPDATEMEMDESCBACKING, PVRSRVBridgeRIUpdateMEMDESCBacking,
968 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIDELETEMEMDESCENTRY, PVRSRVBridgeRIDeleteMEMDESCEntry,
971 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIDUMPLIST, PVRSRVBridgeRIDumpList,
974 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIDUMPALL, PVRSRVBridgeRIDumpAll,
977 SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIDUMPPROCESS, PVRSRVBridgeRIDumpProcess,
985 * Unregister all ri functions with services
987 PVRSRV_ERROR DeinitRIBridge(void)