summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHemant Hariyani2014-11-25 14:55:21 -0600
committerHemant Hariyani2014-11-25 14:55:21 -0600
commit61b0359352629226e33d2ab8ce1dc0e47508b344 (patch)
tree53273fd24fb72f220bd9c92dd6dcaccb136dea6a
parent7c6e610647e4f2ab0fff64cd68d1d7bda05a635f (diff)
downloaddevice-ti-proprietary-open-61b0359352629226e33d2ab8ce1dc0e47508b344.tar.gz
device-ti-proprietary-open-61b0359352629226e33d2ab8ce1dc0e47508b344.tar.xz
device-ti-proprietary-open-61b0359352629226e33d2ab8ce1dc0e47508b344.zip
jacinto6: sgx-bin: update sgx binaries and source for drm/gem support
Adds sgx km source and ddk binaries with gem support. Change-Id: I22f6dbec3e5ed3202a803d4cdb48e12fc2877220 Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
-rw-r--r--jacinto6/README.SGX6
-rw-r--r--jacinto6/sgx.tgzbin2696672 -> 7784011 bytes
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk3
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk2
-rw-r--r--jacinto6/sgx_src/eurasia_km/include4/services.h21
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge.h52
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge_km.h19
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/include/servicesint.h9
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.c161
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/devicemem.c430
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c21
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/refcount.c12
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/resman.c3
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Kbuild.mk5
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c4
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osperproc.c6
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_debug.c9
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/include/refcount.h36
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/include/resman.h1
19 files changed, 686 insertions, 114 deletions
diff --git a/jacinto6/README.SGX b/jacinto6/README.SGX
index 6f01818..1479e47 100644
--- a/jacinto6/README.SGX
+++ b/jacinto6/README.SGX
@@ -16,9 +16,9 @@ sgx.tgz a set of binaries built for SGX544.
16[DDK Version] 16[DDK Version]
17 1.12/2917986 17 1.12/2917986
18[DDK commit ID] 18[DDK commit ID]
19 a0d3db4 tmp: Changes for Android L 19 0c60181 android: update hal_public.h for TI formats
20[Branch] 20[Branch]
21 android/1.12/2917986_k3.14_L 21 android/1.12/2917986_k3.14_L_gem
22[Kernel modules built against] 22[Kernel modules built against]
23 Kernel Version: 3.14.y with CONFIG_MODVERSIONS=y 23 Kernel Version: 3.14.y with CONFIG_MODVERSIONS=y
24 24
@@ -33,7 +33,7 @@ Make sure kernel is built before building modules
33# export KERNELDIR=path_to_kernel 33# export KERNELDIR=path_to_kernel
34 34
35To build for OMAP5 (SGX 544 multi core): 35To build for OMAP5 (SGX 544 multi core):
36# make ARCH=arm KERNEL_CROSS_COMPILE=arm-eabi- CROSS_COMPILE=arm-eabi- TARGET_PRODUCT="jacinto6evm" PLATFORM_VERSION=4.4 BUILD=release 36# make ARCH=arm KERNEL_CROSS_COMPILE=arm-eabi- CROSS_COMPILE=arm-eabi- TARGET_PRODUCT="jacinto6evm" PLATFORM_VERSION=5.0 BUILD=debug
37 37
38Once the .ko is built, install it onto device (/system/lib/modules) 38Once the .ko is built, install it onto device (/system/lib/modules)
39 39
diff --git a/jacinto6/sgx.tgz b/jacinto6/sgx.tgz
index da131fa..087bdc9 100644
--- a/jacinto6/sgx.tgz
+++ b/jacinto6/sgx.tgz
Binary files differ
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
index 0b40526..7697f13 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
@@ -51,7 +51,8 @@ SUPPORT_MEMINFO_IDS := 1
51 51
52# Enable services ion support by default 52# Enable services ion support by default
53# 53#
54SUPPORT_ION ?= 1 54SUPPORT_ION := 0
55SUPPORT_DRM_GEM := 1
55 56
56# Need multi-process support in PDUMP 57# Need multi-process support in PDUMP
57# 58#
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
index 052c35e..1bfce01 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
@@ -578,6 +578,7 @@ $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_ASSERT,))
578$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,)) 578$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,))
579$(eval $(call TunableBothConfigC,SUPPORT_SECURE_33657_FIX,)) 579$(eval $(call TunableBothConfigC,SUPPORT_SECURE_33657_FIX,))
580$(eval $(call TunableBothConfigC,SUPPORT_ION,)) 580$(eval $(call TunableBothConfigC,SUPPORT_ION,))
581$(eval $(call TunableBothConfigC,SUPPORT_DRM_GEM,))
581$(eval $(call TunableBothConfigC,SUPPORT_HWRECOVERY_TRACE_LIMIT,)) 582$(eval $(call TunableBothConfigC,SUPPORT_HWRECOVERY_TRACE_LIMIT,))
582$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_DEVICE_CLASS,)) 583$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_DEVICE_CLASS,))
583$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER,1)) 584$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER,1))
@@ -619,6 +620,7 @@ $(eval $(call TunableKernelConfigC,SUPPORT_FORCE_SYNC_DUMP,))
619 620
620$(eval $(call TunableBothConfigMake,OPTIM,)) 621$(eval $(call TunableBothConfigMake,OPTIM,))
621$(eval $(call TunableBothConfigMake,SUPPORT_ION,)) 622$(eval $(call TunableBothConfigMake,SUPPORT_ION,))
623$(eval $(call TunableBothConfigMake,SUPPORT_DRM_GEM,))
622$(eval $(call TunableBothConfigMake,SUPPORT_PVRSRV_DEVICE_CLASS,)) 624$(eval $(call TunableBothConfigMake,SUPPORT_PVRSRV_DEVICE_CLASS,))
623 625
624 626
diff --git a/jacinto6/sgx_src/eurasia_km/include4/services.h b/jacinto6/sgx_src/eurasia_km/include4/services.h
index 8828fa9..cca0f7d 100644
--- a/jacinto6/sgx_src/eurasia_km/include4/services.h
+++ b/jacinto6/sgx_src/eurasia_km/include4/services.h
@@ -169,6 +169,8 @@ extern "C" {
169#define PVRSRV_MISC_INFO_GET_REF_COUNT_PRESENT (1U<<7) 169#define PVRSRV_MISC_INFO_GET_REF_COUNT_PRESENT (1U<<7)
170#define PVRSRV_MISC_INFO_GET_PAGE_SIZE_PRESENT (1U<<8) 170#define PVRSRV_MISC_INFO_GET_PAGE_SIZE_PRESENT (1U<<8)
171#define PVRSRV_MISC_INFO_FORCE_SWAP_TO_SYSTEM_PRESENT (1U<<9) 171#define PVRSRV_MISC_INFO_FORCE_SWAP_TO_SYSTEM_PRESENT (1U<<9)
172#define PVRSRV_MISC_INFO_GET_DRM_FD_PRESENT (1U<<10)
173#define PVRSRV_MISC_INFO_SET_DRM_FD_PRESENT (1U<<11)
172 174
173#define PVRSRV_MISC_INFO_RESET_PRESENT (1U<<31) 175#define PVRSRV_MISC_INFO_RESET_PRESENT (1U<<31)
174 176
@@ -444,6 +446,9 @@ typedef struct _PVRSRV_CLIENT_MEM_INFO_
444 IMG_UINT32 dummy2; 446 IMG_UINT32 dummy2;
445 #endif /* !defined(USE_CODE) */ 447 #endif /* !defined(USE_CODE) */
446#endif /* defined(SUPPORT_MEMINFO_IDS) */ 448#endif /* defined(SUPPORT_MEMINFO_IDS) */
449#if defined(SUPPORT_DRM_GEM)
450 IMG_SIZE_T uiDmabufBufferSize;
451#endif /* defined(SUPPORT_DRM_GEM) */
447#if defined(SUPPORT_ION) 452#if defined(SUPPORT_ION)
448 IMG_SIZE_T uiIonBufferSize; 453 IMG_SIZE_T uiIonBufferSize;
449#endif /* defined(SUPPORT_ION) */ 454#endif /* defined(SUPPORT_ION) */
@@ -577,6 +582,7 @@ typedef struct _PVRSRV_MISC_INFO_
577 } sGetRefCountCtl; 582 } sGetRefCountCtl;
578 583
579 IMG_UINT32 ui32PageSize; 584 IMG_UINT32 ui32PageSize;
585 IMG_INT32 iDrmFd;
580} PVRSRV_MISC_INFO; 586} PVRSRV_MISC_INFO;
581 587
582/*! 588/*!
@@ -778,6 +784,21 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemory2(IMG_CONST PVRSRV_DEV_DATA *psDe
778 PVRSRV_CLIENT_MEM_INFO **ppsDstMemInfo); 784 PVRSRV_CLIENT_MEM_INFO **ppsDstMemInfo);
779#endif /* defined(LINUX) */ 785#endif /* defined(LINUX) */
780 786
787#if defined(SUPPORT_DRM_GEM)
788PVRSRV_ERROR PVRSRVMapDmabuf(const PVRSRV_DEV_DATA *psDevData,
789 IMG_HANDLE hDevMemHeap,
790 IMG_UINT32 ui32NumFDs,
791 IMG_INT *paiBufferFDs,
792 IMG_UINT32 ui32ChunkCount,
793 IMG_SIZE_T *pauiOffset,
794 IMG_SIZE_T *pauiSize,
795 IMG_UINT32 ui32Attribs,
796 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
797
798PVRSRV_ERROR PVRSRVUnmapDmabuf(const PVRSRV_DEV_DATA *psDevData,
799 PVRSRV_CLIENT_MEM_INFO *psMemInfo);
800#endif /* defined (SUPPORT_DRM_GEM) */
801
781#if defined(SUPPORT_ION) 802#if defined(SUPPORT_ION)
782PVRSRV_ERROR PVRSRVMapIonHandle(const PVRSRV_DEV_DATA *psDevData, 803PVRSRV_ERROR PVRSRVMapIonHandle(const PVRSRV_DEV_DATA *psDevData,
783 IMG_HANDLE hDevMemHeap, 804 IMG_HANDLE hDevMemHeap,
diff --git a/jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge.h b/jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge.h
index cf84f76..f8e1439 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge.h
+++ b/jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge.h
@@ -121,13 +121,11 @@ extern "C" {
121#define PVRSRV_BRIDGE_CHG_DEV_MEM_ATTRIBS PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+26) 121#define PVRSRV_BRIDGE_CHG_DEV_MEM_ATTRIBS PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+26)
122#define PVRSRV_BRIDGE_MAP_DEV_MEMORY_2 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+27) 122#define PVRSRV_BRIDGE_MAP_DEV_MEMORY_2 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+27)
123#define PVRSRV_BRIDGE_EXPORT_DEVICEMEM_2 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+28) 123#define PVRSRV_BRIDGE_EXPORT_DEVICEMEM_2 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+28)
124#if defined (SUPPORT_ION) 124#define PVRSRV_BRIDGE_MAP_DMABUF PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+29)
125#define PVRSRV_BRIDGE_MAP_ION_HANDLE PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+29) 125#define PVRSRV_BRIDGE_UNMAP_DMABUF PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+30)
126#define PVRSRV_BRIDGE_UNMAP_ION_HANDLE PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+30) 126#define PVRSRV_BRIDGE_MAP_ION_HANDLE PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+31)
127#define PVRSRV_BRIDGE_CORE_CMD_LAST (PVRSRV_BRIDGE_CORE_CMD_FIRST+30) 127#define PVRSRV_BRIDGE_UNMAP_ION_HANDLE PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+32)
128#else 128#define PVRSRV_BRIDGE_CORE_CMD_LAST (PVRSRV_BRIDGE_CORE_CMD_FIRST+32)
129#define PVRSRV_BRIDGE_CORE_CMD_LAST (PVRSRV_BRIDGE_CORE_CMD_FIRST+28)
130#endif
131/* SIM */ 129/* SIM */
132#define PVRSRV_BRIDGE_SIM_CMD_FIRST (PVRSRV_BRIDGE_CORE_CMD_LAST+1) 130#define PVRSRV_BRIDGE_SIM_CMD_FIRST (PVRSRV_BRIDGE_CORE_CMD_LAST+1)
133#define PVRSRV_BRIDGE_PROCESS_SIMISR_EVENT PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+0) /*!< RTSIM pseudo ISR */ 131#define PVRSRV_BRIDGE_PROCESS_SIMISR_EVENT PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+0) /*!< RTSIM pseudo ISR */
@@ -533,6 +531,33 @@ typedef struct PVRSRV_BRIDGE_IN_EXPORTDEVICEMEM_TAG
533}PVRSRV_BRIDGE_IN_EXPORTDEVICEMEM; 531}PVRSRV_BRIDGE_IN_EXPORTDEVICEMEM;
534 532
535/****************************************************************************** 533/******************************************************************************
534 * 'bridge in' map dmabuf
535 *****************************************************************************/
536#define DMABUF_IMPORT_MAX_FDS 3
537#define DMABUF_IMPORT_MAX_CHUNK_COUNT 3
538typedef struct _PVRSRV_BRIDGE_IN_MAP_DMABUF_
539{
540 IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
541 IMG_UINT32 ui32NumFDs;
542 IMG_INT32 ai32BufferFDs[DMABUF_IMPORT_MAX_FDS];
543 IMG_UINT32 ui32Attribs;
544 IMG_UINT32 ui32ChunkCount;
545 IMG_SIZE_T auiOffset[DMABUF_IMPORT_MAX_CHUNK_COUNT];
546 IMG_SIZE_T auiSize[DMABUF_IMPORT_MAX_CHUNK_COUNT];
547 IMG_HANDLE hDevCookie;
548 IMG_HANDLE hDevMemHeap;
549} PVRSRV_BRIDGE_IN_MAP_DMABUF;
550
551/******************************************************************************
552 * 'bridge in' unmap dmabuf
553 *****************************************************************************/
554typedef struct PVRSRV_BRIDGE_IN_UNMAP_DMABUF_TAG
555{
556 IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
557 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
558}PVRSRV_BRIDGE_IN_UNMAP_DMABUF;
559
560/******************************************************************************
536 * 'bridge in' map ion handle 561 * 'bridge in' map ion handle
537 *****************************************************************************/ 562 *****************************************************************************/
538#define ION_IMPORT_MAX_FDS 3 563#define ION_IMPORT_MAX_FDS 3
@@ -1407,6 +1432,19 @@ typedef struct PVRSRV_BRIDGE_OUT_EXPORTDEVICEMEM_TAG
1407 1432
1408 1433
1409/****************************************************************************** 1434/******************************************************************************
1435 * 'bridge out' map dmabuf
1436 *****************************************************************************/
1437typedef struct _PVRSRV_BRIDGE_OUT_MAP_DMABUF_
1438{
1439 PVRSRV_ERROR eError;
1440 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
1441 PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
1442 PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
1443 IMG_SIZE_T uiDmabufBufferSize;
1444
1445} PVRSRV_BRIDGE_OUT_MAP_DMABUF;
1446
1447/******************************************************************************
1410 * 'bridge out' map ion handle 1448 * 'bridge out' map ion handle
1411 *****************************************************************************/ 1449 *****************************************************************************/
1412typedef struct _PVRSRV_BRIDGE_OUT_MAP_ION_HANDLE_ 1450typedef struct _PVRSRV_BRIDGE_OUT_MAP_ION_HANDLE_
diff --git a/jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge_km.h b/jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge_km.h
index d6f7a72..28c1268 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge_km.h
+++ b/jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge_km.h
@@ -145,6 +145,25 @@ IMG_IMPORT
145PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeDeviceMemKM(IMG_HANDLE hDevCookie, 145PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeDeviceMemKM(IMG_HANDLE hDevCookie,
146 PVRSRV_KERNEL_MEM_INFO *psMemInfo); 146 PVRSRV_KERNEL_MEM_INFO *psMemInfo);
147 147
148#if defined(SUPPORT_DRM_GEM)
149IMG_IMPORT
150PVRSRV_ERROR PVRSRVMapDmabufKM(PVRSRV_PER_PROCESS_DATA *psPerProc,
151 IMG_HANDLE hDevCookie,
152 IMG_HANDLE hDevMemHeap,
153 IMG_UINT32 ui32NumFDs,
154 IMG_INT32 *pai32BufferFDs,
155 IMG_UINT32 ui32Flags,
156 IMG_UINT32 ui32ChunkCount,
157 IMG_SIZE_T *pauiOffset,
158 IMG_SIZE_T *pauiSize,
159 IMG_SIZE_T *puiIonBufferSize,
160 PVRSRV_KERNEL_MEM_INFO **ppsKernelMemInfo,
161 IMG_UINT64 *pui64Stamp);
162
163IMG_IMPORT
164PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapDmabufKM(PVRSRV_KERNEL_MEM_INFO *psMemInfo);
165#endif /* SUPPORT_DRM_GEM */
166
148#if defined(SUPPORT_ION) 167#if defined(SUPPORT_ION)
149IMG_IMPORT 168IMG_IMPORT
150PVRSRV_ERROR PVRSRVMapIonHandleKM(PVRSRV_PER_PROCESS_DATA *psPerProc, 169PVRSRV_ERROR PVRSRVMapIonHandleKM(PVRSRV_PER_PROCESS_DATA *psPerProc,
diff --git a/jacinto6/sgx_src/eurasia_km/services4/include/servicesint.h b/jacinto6/sgx_src/eurasia_km/services4/include/servicesint.h
index 2ae1a3b..4e16475 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/include/servicesint.h
+++ b/jacinto6/sgx_src/eurasia_km/services4/include/servicesint.h
@@ -85,9 +85,10 @@ typedef enum _PVRSRV_MEMTYPE_
85 PVRSRV_MEMTYPE_DEVICECLASS = 2, 85 PVRSRV_MEMTYPE_DEVICECLASS = 2,
86 PVRSRV_MEMTYPE_WRAPPED = 3, 86 PVRSRV_MEMTYPE_WRAPPED = 3,
87 PVRSRV_MEMTYPE_MAPPED = 4, 87 PVRSRV_MEMTYPE_MAPPED = 4,
88 PVRSRV_MEMTYPE_ION = 5, 88 PVRSRV_MEMTYPE_ION = 5,
89 PVRSRV_MEMTYPE_ALLOC = 6, 89 PVRSRV_MEMTYPE_DMABUF = 6,
90 PVRSRV_MEMTYPE_FREE = 7 90 PVRSRV_MEMTYPE_ALLOC = 7,
91 PVRSRV_MEMTYPE_FREE = 8
91} PVRSRV_MEMTYPE; 92} PVRSRV_MEMTYPE;
92 93
93#if defined (MEM_TRACK_INFO_DEBUG) 94#if defined (MEM_TRACK_INFO_DEBUG)
@@ -151,7 +152,7 @@ typedef struct _PVRSRV_KERNEL_MEM_INFO_
151 /* ptr to associated kernel sync info - NULL if no sync */ 152 /* ptr to associated kernel sync info - NULL if no sync */
152 struct _PVRSRV_KERNEL_SYNC_INFO_ *psKernelSyncInfo; 153 struct _PVRSRV_KERNEL_SYNC_INFO_ *psKernelSyncInfo;
153 154
154 IMG_HANDLE hIonSyncInfo; 155 IMG_HANDLE hExternalSyncInfo;
155 156
156 PVRSRV_MEMTYPE memType; 157 PVRSRV_MEMTYPE memType;
157 158
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.c
index 2321a69..29ef9f1 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.c
@@ -1392,6 +1392,154 @@ PVRSRVUnwrapExtMemoryBW(IMG_UINT32 ui32BridgeID,
1392 return 0; 1392 return 0;
1393} 1393}
1394 1394
1395#if defined(SUPPORT_DRM_GEM)
1396static IMG_INT
1397PVRSRVMapDmabufBW(IMG_UINT32 ui32BridgeID,
1398 PVRSRV_BRIDGE_IN_MAP_DMABUF *psMapDmabufIN,
1399 PVRSRV_BRIDGE_OUT_MAP_DMABUF *psMapDmabufOUT,
1400 PVRSRV_PER_PROCESS_DATA *psPerProc)
1401{
1402 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
1403 IMG_UINT64 ui64Stamp;
1404
1405 psMapDmabufOUT->eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
1406 &psMapDmabufIN->hDevCookie,
1407 psMapDmabufIN->hDevCookie,
1408 PVRSRV_HANDLE_TYPE_DEV_NODE);
1409 if (psMapDmabufOUT->eError != PVRSRV_OK)
1410 {
1411 PVR_DPF((PVR_DBG_ERROR, "%s: Failed to lookup device node handle", __FUNCTION__));
1412 return 0;
1413 }
1414
1415 psMapDmabufOUT->eError = PVRSRVLookupHandle(psPerProc->psHandleBase,
1416 &psMapDmabufIN->hDevMemHeap,
1417 psMapDmabufIN->hDevMemHeap,
1418 PVRSRV_HANDLE_TYPE_DEV_MEM_HEAP);
1419 if (psMapDmabufOUT->eError != PVRSRV_OK)
1420 {
1421 PVR_DPF((PVR_DBG_ERROR, "%s: Failed to lookup memory context handle", __FUNCTION__));
1422 return 0;
1423 }
1424
1425 psMapDmabufOUT->eError = PVRSRVMapDmabufKM(psPerProc,
1426 psMapDmabufIN->hDevCookie,
1427 psMapDmabufIN->hDevMemHeap,
1428 psMapDmabufIN->ui32NumFDs,
1429 psMapDmabufIN->ai32BufferFDs,
1430 psMapDmabufIN->ui32Attribs,
1431 psMapDmabufIN->ui32ChunkCount,
1432 psMapDmabufIN->auiOffset,
1433 psMapDmabufIN->auiSize,
1434 &psMapDmabufOUT->uiDmabufBufferSize,
1435 &psKernelMemInfo,
1436 &ui64Stamp);
1437 if (psMapDmabufOUT->eError != PVRSRV_OK)
1438 {
1439 PVR_DPF((PVR_DBG_ERROR, "%s: Failed to map ion handle", __FUNCTION__));
1440 return 0;
1441 }
1442
1443 OSMemSet(&psMapDmabufOUT->sClientMemInfo,
1444 0,
1445 sizeof(psMapDmabufOUT->sClientMemInfo));
1446
1447 psMapDmabufOUT->sClientMemInfo.pvLinAddrKM =
1448 psKernelMemInfo->pvLinAddrKM;
1449
1450 psMapDmabufOUT->sClientMemInfo.pvLinAddr = 0;
1451 psMapDmabufOUT->sClientMemInfo.sDevVAddr = psKernelMemInfo->sDevVAddr;
1452 psMapDmabufOUT->sClientMemInfo.ui32Flags = psKernelMemInfo->ui32Flags;
1453 psMapDmabufOUT->sClientMemInfo.uAllocSize = psKernelMemInfo->uAllocSize;
1454
1455 /* No mapping info, we map through ion */
1456 psMapDmabufOUT->sClientMemInfo.hMappingInfo = IMG_NULL;
1457
1458#if defined(SUPPORT_MEMINFO_IDS)
1459 psMapDmabufOUT->sClientMemInfo.ui64Stamp = ui64Stamp;
1460#endif
1461
1462 PVRSRVAllocHandleNR(psPerProc->psHandleBase,
1463 &psMapDmabufOUT->sClientMemInfo.hKernelMemInfo,
1464 psKernelMemInfo,
1465 PVRSRV_HANDLE_TYPE_MEM_INFO,
1466 PVRSRV_HANDLE_ALLOC_FLAG_NONE);
1467
1468 if(psMapDmabufIN->ui32Attribs & PVRSRV_MEM_NO_SYNCOBJ)
1469 {
1470 /* signal no syncinfo */
1471 OSMemSet(&psMapDmabufOUT->sClientSyncInfo,
1472 0,
1473 sizeof (PVRSRV_CLIENT_SYNC_INFO));
1474 psMapDmabufOUT->sClientMemInfo.psClientSyncInfo = IMG_NULL;
1475 }
1476 else
1477 {
1478 /* and setup the sync info */
1479#if !defined(PVRSRV_DISABLE_UM_SYNCOBJ_MAPPINGS)
1480 psMapDmabufOUT->sClientSyncInfo.psSyncData =
1481 psKernelMemInfo->psKernelSyncInfo->psSyncData;
1482 psMapDmabufOUT->sClientSyncInfo.sWriteOpsCompleteDevVAddr =
1483 psKernelMemInfo->psKernelSyncInfo->sWriteOpsCompleteDevVAddr;
1484 psMapDmabufOUT->sClientSyncInfo.sReadOpsCompleteDevVAddr =
1485 psKernelMemInfo->psKernelSyncInfo->sReadOpsCompleteDevVAddr;
1486 psMapDmabufOUT->sClientSyncInfo.sReadOps2CompleteDevVAddr =
1487 psKernelMemInfo->psKernelSyncInfo->sReadOps2CompleteDevVAddr;
1488
1489 psMapDmabufOUT->sClientSyncInfo.hMappingInfo =
1490 psKernelMemInfo->psKernelSyncInfo->psSyncDataMemInfoKM->sMemBlk.hOSMemHandle;
1491#endif
1492
1493 PVRSRVAllocSubHandleNR(psPerProc->psHandleBase,
1494 &psMapDmabufOUT->sClientSyncInfo.hKernelSyncInfo,
1495 psKernelMemInfo->psKernelSyncInfo,
1496 PVRSRV_HANDLE_TYPE_SYNC_INFO,
1497 PVRSRV_HANDLE_ALLOC_FLAG_NONE,
1498 psMapDmabufOUT->sClientMemInfo.hKernelMemInfo);
1499
1500 psMapDmabufOUT->sClientMemInfo.psClientSyncInfo =
1501 &psMapDmabufOUT->sClientSyncInfo;
1502 }
1503 return 0;
1504}
1505
1506static IMG_INT
1507PVRSRVUnmapDmabufBW(IMG_UINT32 ui32BridgeID,
1508 PVRSRV_BRIDGE_IN_UNMAP_DMABUF *psUnmapDmabufIN,
1509 PVRSRV_BRIDGE_RETURN *psUnmapDmabufOUT,
1510 PVRSRV_PER_PROCESS_DATA *psPerProc)
1511{
1512 IMG_VOID *pvKernelMemInfo;
1513
1514 PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_UNMAP_DMABUF);
1515
1516 psUnmapDmabufOUT->eError =
1517 PVRSRVLookupHandle(psPerProc->psHandleBase,
1518 &pvKernelMemInfo,
1519 psUnmapDmabufIN->psKernelMemInfo,
1520 PVRSRV_HANDLE_TYPE_MEM_INFO);
1521
1522 if(psUnmapDmabufOUT->eError != PVRSRV_OK)
1523 {
1524 return 0;
1525 }
1526
1527 psUnmapDmabufOUT->eError = PVRSRVUnmapDmabufKM(pvKernelMemInfo);
1528
1529 if(psUnmapDmabufOUT->eError != PVRSRV_OK)
1530 {
1531 return 0;
1532 }
1533
1534 psUnmapDmabufOUT->eError =
1535 PVRSRVReleaseHandle(psPerProc->psHandleBase,
1536 psUnmapDmabufIN->psKernelMemInfo,
1537 PVRSRV_HANDLE_TYPE_MEM_INFO);
1538
1539 return 0;
1540}
1541#endif /* SUPPORT_ION */
1542
1395#if defined(SUPPORT_ION) 1543#if defined(SUPPORT_ION)
1396static IMG_INT 1544static IMG_INT
1397PVRSRVMapIonHandleBW(IMG_UINT32 ui32BridgeID, 1545PVRSRVMapIonHandleBW(IMG_UINT32 ui32BridgeID,
@@ -2124,6 +2272,15 @@ PVRSRVGetMiscInfoBW(IMG_UINT32 ui32BridgeID,
2124 return 0; 2272 return 0;
2125 } 2273 }
2126 2274
2275 if((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_GET_DRM_FD_PRESENT) != 0)
2276 {
2277 PVR_DPF((PVR_DBG_ERROR, "Get DRM FD BW"));
2278 }
2279 if((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_SET_DRM_FD_PRESENT) != 0)
2280 {
2281 PVR_DPF((PVR_DBG_ERROR, "Set DRM FD BW"));
2282 }
2283
2127 if (((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_MEMSTATS_PRESENT) != 0) || 2284 if (((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_MEMSTATS_PRESENT) != 0) ||
2128 ((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_DDKVERSION_PRESENT) != 0) || 2285 ((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_DDKVERSION_PRESENT) != 0) ||
2129 ((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_FREEMEM_PRESENT) != 0)) 2286 ((psGetMiscInfoIN->sMiscInfo.ui32StateRequest & PVRSRV_MISC_INFO_FREEMEM_PRESENT) != 0))
@@ -4489,6 +4646,10 @@ CommonBridgeInit(IMG_VOID)
4489 SetDispatchTableEntry(PVRSRV_BRIDGE_CHG_DEV_MEM_ATTRIBS, PVRSRVChangeDeviceMemoryAttributesBW); 4646 SetDispatchTableEntry(PVRSRV_BRIDGE_CHG_DEV_MEM_ATTRIBS, PVRSRVChangeDeviceMemoryAttributesBW);
4490 SetDispatchTableEntry(PVRSRV_BRIDGE_MAP_DEV_MEMORY_2, PVRSRVMapDeviceMemoryBW); 4647 SetDispatchTableEntry(PVRSRV_BRIDGE_MAP_DEV_MEMORY_2, PVRSRVMapDeviceMemoryBW);
4491 SetDispatchTableEntry(PVRSRV_BRIDGE_EXPORT_DEVICEMEM_2, PVRSRVExportDeviceMemBW); 4648 SetDispatchTableEntry(PVRSRV_BRIDGE_EXPORT_DEVICEMEM_2, PVRSRVExportDeviceMemBW);
4649#if defined(SUPPORT_DRM_GEM)
4650 SetDispatchTableEntry(PVRSRV_BRIDGE_MAP_DMABUF, PVRSRVMapDmabufBW);
4651 SetDispatchTableEntry(PVRSRV_BRIDGE_UNMAP_DMABUF, PVRSRVUnmapDmabufBW);
4652#endif
4492#if defined(SUPPORT_ION) 4653#if defined(SUPPORT_ION)
4493 SetDispatchTableEntry(PVRSRV_BRIDGE_MAP_ION_HANDLE, PVRSRVMapIonHandleBW); 4654 SetDispatchTableEntry(PVRSRV_BRIDGE_MAP_ION_HANDLE, PVRSRVMapIonHandleBW);
4494 SetDispatchTableEntry(PVRSRV_BRIDGE_UNMAP_ION_HANDLE, PVRSRVUnmapIonHandleBW); 4655 SetDispatchTableEntry(PVRSRV_BRIDGE_UNMAP_ION_HANDLE, PVRSRVUnmapIonHandleBW);
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/devicemem.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/devicemem.c
index ac68bcf..d28136f 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/devicemem.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/devicemem.c
@@ -49,14 +49,21 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49#include "osfunc.h" 49#include "osfunc.h"
50#include "devicemem.h" 50#include "devicemem.h"
51 51
52#if defined(SUPPORT_DRM_GEM)
53#include "dmabuf.h"
54#endif
55
52#if defined(SUPPORT_ION) 56#if defined(SUPPORT_ION)
53#include "ion.h" 57#include "ion.h"
54#include "env_perproc.h" 58#include "env_perproc.h"
55#include "ion_sync.h" 59#endif
56 60
57/* Start size of the g_IonSyncHash hash table */ 61#if defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION)
58#define ION_SYNC_HASH_SIZE 20 62#include "external_sync.h"
59HASH_TABLE *g_psIonSyncHash = IMG_NULL; 63
64/* Start size of the g_ExternalSyncHash hash table */
65#define EXTERNAL_SYNC_HASH_SIZE 20
66HASH_TABLE *g_psExternalSyncHash = IMG_NULL;
60#endif 67#endif
61 68
62#include "lists.h" 69#include "lists.h"
@@ -956,6 +963,15 @@ static IMG_VOID freeExternal(PVRSRV_KERNEL_MEM_INFO *psMemInfo)
956 OSReleasePhysPageAddr(hOSWrapMem); 963 OSReleasePhysPageAddr(hOSWrapMem);
957 } 964 }
958 } 965 }
966#if defined(SUPPORT_DRM_GEM)
967 else if (psMemInfo->memType == PVRSRV_MEMTYPE_DMABUF)
968 {
969 if (hOSWrapMem)
970 {
971 DmabufUnimportBufferAndReleasePhysAddr(hOSWrapMem);
972 }
973 }
974#endif
959#if defined(SUPPORT_ION) 975#if defined(SUPPORT_ION)
960 else if (psMemInfo->memType == PVRSRV_MEMTYPE_ION) 976 else if (psMemInfo->memType == PVRSRV_MEMTYPE_ION)
961 { 977 {
@@ -1051,17 +1067,18 @@ PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
1051 /* Fall through: Free only what we should for each memory type */ 1067 /* Fall through: Free only what we should for each memory type */
1052 case PVRSRV_MEMTYPE_WRAPPED: 1068 case PVRSRV_MEMTYPE_WRAPPED:
1053 case PVRSRV_MEMTYPE_ION: 1069 case PVRSRV_MEMTYPE_ION:
1070 case PVRSRV_MEMTYPE_DMABUF:
1054 freeExternal(psMemInfo); 1071 freeExternal(psMemInfo);
1055 case PVRSRV_MEMTYPE_DEVICE: 1072 case PVRSRV_MEMTYPE_DEVICE:
1056 case PVRSRV_MEMTYPE_DEVICECLASS: 1073 case PVRSRV_MEMTYPE_DEVICECLASS:
1057#if defined(SUPPORT_ION) 1074#if defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION)
1058 if (psMemInfo->hIonSyncInfo) 1075 if (psMemInfo->hExternalSyncInfo)
1059 { 1076 {
1060 /* 1077 /*
1061 For syncs attached to Ion imported buffers we handle 1078 For syncs attached to Ion imported buffers we handle
1062 things a little differently 1079 things a little differently
1063 */ 1080 */
1064 PVRSRVIonBufferSyncInfoDecRef(psMemInfo->hIonSyncInfo, psMemInfo); 1081 PVRSRVExternalBufferSyncInfoDecRef(psMemInfo->hExternalSyncInfo, psMemInfo);
1065 } 1082 }
1066 else 1083 else
1067#endif 1084#endif
@@ -1073,7 +1090,7 @@ PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
1073 } 1090 }
1074 break; 1091 break;
1075 default: 1092 default:
1076 PVR_DPF((PVR_DBG_ERROR, "FreeMemCallBackCommon: Unknown memType")); 1093 PVR_DPF((PVR_DBG_ERROR, "FreeMemCallBackCommon: Unknown memType: %d", psMemInfo->memType));
1077 eError = PVRSRV_ERROR_INVALID_MEMINFO; 1094 eError = PVRSRV_ERROR_INVALID_MEMINFO;
1078 } 1095 }
1079 } 1096 }
@@ -1376,35 +1393,24 @@ free_mainalloc:
1376 return eError; 1393 return eError;
1377} 1394}
1378 1395
1379#if defined(SUPPORT_ION) 1396#if defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION)
1380static PVRSRV_ERROR IonUnmapCallback(IMG_PVOID pvParam, 1397PVRSRV_ERROR PVRSRVExternalBufferSyncAcquire(IMG_HANDLE hUnique,
1381 IMG_UINT32 ui32Param,
1382 IMG_BOOL bDummy)
1383{
1384 PVRSRV_KERNEL_MEM_INFO *psMemInfo = (PVRSRV_KERNEL_MEM_INFO *)pvParam;
1385
1386 PVR_UNREFERENCED_PARAMETER(bDummy);
1387
1388 return FreeMemCallBackCommon(psMemInfo, ui32Param, PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR);
1389}
1390
1391PVRSRV_ERROR PVRSRVIonBufferSyncAcquire(IMG_HANDLE hUnique,
1392 IMG_HANDLE hDevCookie, 1398 IMG_HANDLE hDevCookie,
1393 IMG_HANDLE hDevMemContext, 1399 IMG_HANDLE hDevMemContext,
1394 PVRSRV_ION_SYNC_INFO **ppsIonSyncInfo) 1400 PVRSRV_EXTERNAL_SYNC_INFO **ppsExternalSyncInfo)
1395{ 1401{
1396 PVRSRV_ION_SYNC_INFO *psIonSyncInfo; 1402 PVRSRV_EXTERNAL_SYNC_INFO *psExternalSyncInfo;
1397 PVRSRV_ERROR eError; 1403 PVRSRV_ERROR eError;
1398 IMG_BOOL bRet; 1404 IMG_BOOL bRet;
1399 1405
1400 /* Check the hash to see if we already have a sync for this buffer */ 1406 /* Check the hash to see if we already have a sync for this buffer */
1401 psIonSyncInfo = (PVRSRV_ION_SYNC_INFO *) HASH_Retrieve(g_psIonSyncHash, (IMG_UINTPTR_T) hUnique); 1407 psExternalSyncInfo = (PVRSRV_EXTERNAL_SYNC_INFO *) HASH_Retrieve(g_psExternalSyncHash, (IMG_UINTPTR_T) hUnique);
1402 if (psIonSyncInfo == 0) 1408 if (psExternalSyncInfo == 0)
1403 { 1409 {
1404 /* This buffer is new to us, create the syncinfo for it */ 1410 /* This buffer is new to us, create the syncinfo for it */
1405 eError = OSAllocMem(PVRSRV_PAGEABLE_SELECT, 1411 eError = OSAllocMem(PVRSRV_PAGEABLE_SELECT,
1406 sizeof(PVRSRV_ION_SYNC_INFO), 1412 sizeof(PVRSRV_EXTERNAL_SYNC_INFO),
1407 (IMG_VOID **)&psIonSyncInfo, IMG_NULL, 1413 (IMG_VOID **)&psExternalSyncInfo, IMG_NULL,
1408 "Ion Synchronization Info"); 1414 "Ion Synchronization Info");
1409 if (eError != PVRSRV_OK) 1415 if (eError != PVRSRV_OK)
1410 { 1416 {
@@ -1413,64 +1419,362 @@ PVRSRV_ERROR PVRSRVIonBufferSyncAcquire(IMG_HANDLE hUnique,
1413 1419
1414 eError = PVRSRVAllocSyncInfoKM(hDevCookie, 1420 eError = PVRSRVAllocSyncInfoKM(hDevCookie,
1415 hDevMemContext, 1421 hDevMemContext,
1416 &psIonSyncInfo->psSyncInfo); 1422 &psExternalSyncInfo->psSyncInfo);
1417 if (eError != PVRSRV_OK) 1423 if (eError != PVRSRV_OK)
1418 { 1424 {
1419 OSFreeMem(PVRSRV_PAGEABLE_SELECT, 1425 OSFreeMem(PVRSRV_PAGEABLE_SELECT,
1420 sizeof(PVRSRV_ION_SYNC_INFO), 1426 sizeof(PVRSRV_EXTERNAL_SYNC_INFO),
1421 psIonSyncInfo, 1427 psExternalSyncInfo,
1422 IMG_NULL); 1428 IMG_NULL);
1423 1429
1424 return eError; 1430 return eError;
1425 } 1431 }
1426#if defined(SUPPORT_MEMINFO_IDS) 1432#if defined(SUPPORT_MEMINFO_IDS)
1427 psIonSyncInfo->ui64Stamp = ++g_ui64MemInfoID; 1433 psExternalSyncInfo->ui64Stamp = ++g_ui64MemInfoID;
1428#else 1434#else
1429 psIonSyncInfo->ui64Stamp = 0; 1435 psExternalSyncInfo->ui64Stamp = 0;
1430#endif 1436#endif
1431 bRet = HASH_Insert(g_psIonSyncHash, (IMG_UINTPTR_T) hUnique, (IMG_UINTPTR_T) psIonSyncInfo); 1437 bRet = HASH_Insert(g_psExternalSyncHash, (IMG_UINTPTR_T) hUnique, (IMG_UINTPTR_T) psExternalSyncInfo);
1432 if (!bRet) 1438 if (!bRet)
1433 { 1439 {
1434 eError = PVRSRV_ERROR_OUT_OF_MEMORY; 1440 eError = PVRSRV_ERROR_OUT_OF_MEMORY;
1435 1441
1436 PVRSRVKernelSyncInfoDecRef(psIonSyncInfo->psSyncInfo, IMG_NULL); 1442 PVRSRVKernelSyncInfoDecRef(psExternalSyncInfo->psSyncInfo, IMG_NULL);
1437 OSFreeMem(PVRSRV_PAGEABLE_SELECT, 1443 OSFreeMem(PVRSRV_PAGEABLE_SELECT,
1438 sizeof(PVRSRV_ION_SYNC_INFO), 1444 sizeof(PVRSRV_EXTERNAL_SYNC_INFO),
1439 psIonSyncInfo, 1445 psExternalSyncInfo,
1440 IMG_NULL); 1446 IMG_NULL);
1441 1447
1442 return eError; 1448 return eError;
1443 } 1449 }
1444 1450
1445 psIonSyncInfo->ui32RefCount = 0; 1451 psExternalSyncInfo->ui32RefCount = 0;
1446 psIonSyncInfo->hUnique = hUnique; 1452 psExternalSyncInfo->hUnique = hUnique;
1447 } 1453 }
1448 1454
1449 psIonSyncInfo->ui32RefCount++; 1455 psExternalSyncInfo->ui32RefCount++;
1450 *ppsIonSyncInfo = psIonSyncInfo; 1456 *ppsExternalSyncInfo = psExternalSyncInfo;
1451 return PVRSRV_OK; 1457 return PVRSRV_OK;
1452} 1458}
1453 1459
1454IMG_VOID PVRSRVIonBufferSyncRelease(PVRSRV_ION_SYNC_INFO *psIonSyncInfo) 1460IMG_VOID PVRSRVExternalBufferSyncRelease(PVRSRV_EXTERNAL_SYNC_INFO *psExternalSyncInfo)
1455{ 1461{
1456 psIonSyncInfo->ui32RefCount--; 1462 psExternalSyncInfo->ui32RefCount--;
1457 1463
1458 if (psIonSyncInfo->ui32RefCount == 0) 1464 if (psExternalSyncInfo->ui32RefCount == 0)
1459 { 1465 {
1460 PVRSRV_ION_SYNC_INFO *psLookup; 1466 PVRSRV_EXTERNAL_SYNC_INFO *psLookup;
1461 /* 1467 /*
1462 If we're holding the last reference to the syncinfo 1468 If we're holding the last reference to the syncinfo
1463 then free it 1469 then free it
1464 */ 1470 */
1465 psLookup = (PVRSRV_ION_SYNC_INFO *) HASH_Remove(g_psIonSyncHash, (IMG_UINTPTR_T) psIonSyncInfo->hUnique); 1471 psLookup = (PVRSRV_EXTERNAL_SYNC_INFO *) HASH_Remove(g_psExternalSyncHash, (IMG_UINTPTR_T) psExternalSyncInfo->hUnique);
1466 PVR_ASSERT(psLookup == psIonSyncInfo); 1472 PVR_ASSERT(psLookup == psExternalSyncInfo);
1467 PVRSRVKernelSyncInfoDecRef(psIonSyncInfo->psSyncInfo, IMG_NULL); 1473 PVRSRVKernelSyncInfoDecRef(psExternalSyncInfo->psSyncInfo, IMG_NULL);
1468 OSFreeMem(PVRSRV_PAGEABLE_SELECT, 1474 OSFreeMem(PVRSRV_PAGEABLE_SELECT,
1469 sizeof(PVRSRV_ION_SYNC_INFO), 1475 sizeof(PVRSRV_EXTERNAL_SYNC_INFO),
1470 psIonSyncInfo, 1476 psExternalSyncInfo,
1471 IMG_NULL); 1477 IMG_NULL);
1472 } 1478 }
1473} 1479}
1480#endif //defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION)
1481
1482#if defined(SUPPORT_DRM_GEM)
1483static PVRSRV_ERROR DmabufUnmapCallback(IMG_PVOID pvParam,
1484 IMG_UINT32 ui32Param,
1485 IMG_BOOL bDummy)
1486{
1487 PVRSRV_KERNEL_MEM_INFO *psMemInfo = (PVRSRV_KERNEL_MEM_INFO *)pvParam;
1488
1489 PVR_UNREFERENCED_PARAMETER(bDummy);
1490
1491 return FreeMemCallBackCommon(psMemInfo, ui32Param, PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR);
1492}
1493
1494/*!
1495******************************************************************************
1496
1497 @Function PVRSRVMapDmabufKM
1498
1499 @Description
1500
1501 Map a DMABUF buffer into the specified device memory context
1502
1503 @Input psPerProc : PerProcess data
1504 @Input hDevCookie : Device node cookie
1505 @Input hDevMemHeap : Heap dmabuf handles are mapped into
1506 @Input ui32NumBuffers : Number of dmabuf handles to map. (If one handle is being
1507 mapped, this should be 1, not 0.)
1508 @Input phDmabuf : Array of ui32NumBuffers dmabuf handles (fds)
1509 @Input ui32Flags : Mapping flags
1510 @Input ui32ChunkCount : If ui32NumBuffers is 1, this is the number of
1511 "chunks" specified to be mapped into device-virtual
1512 address space. If ui32NumBuffers > 1, it is ignored.
1513 @Input pauiOffset : Array of offsets in device-virtual address space to map
1514 "chunks" of physical from the dmabuf allocation.
1515 @Input pauiSize : Array of sizes in bytes of device-virtual address space to
1516 map "chunks" of physical from the dmabuf allocation.
1517 @Input puiDmabufBufferSize : Size in bytes of resulting device-virtual mapping.
1518 @Output ppsKernelMemInfo: Output kernel meminfo if successful
1519
1520 @Return PVRSRV_ERROR :
1521
1522******************************************************************************/
1523IMG_EXPORT
1524PVRSRV_ERROR PVRSRVMapDmabufKM(PVRSRV_PER_PROCESS_DATA *psPerProc,
1525 IMG_HANDLE hDevCookie,
1526 IMG_HANDLE hDevMemHeap,
1527 IMG_UINT32 ui32NumFDs,
1528 IMG_INT32 *pi32BufferFDs,
1529 IMG_UINT32 ui32Flags,
1530 IMG_UINT32 ui32ChunkCount,
1531 IMG_SIZE_T *pauiOffset,
1532 IMG_SIZE_T *pauiSize,
1533 IMG_SIZE_T *puiDmabufBufferSize,
1534 PVRSRV_KERNEL_MEM_INFO **ppsKernelMemInfo,
1535 IMG_UINT64 *pui64Stamp)
1536{
1537 PVRSRV_DEVICE_NODE *psDeviceNode;
1538 PVRSRV_KERNEL_MEM_INFO *psNewKernelMemInfo;
1539 IMG_SYS_PHYADDR *pasSysPhysAddr;
1540 IMG_SYS_PHYADDR *pasAdjustedSysPhysAddr;
1541 PVRSRV_MEMBLK *psMemBlock;
1542 PVRSRV_ERROR eError;
1543 IMG_HANDLE hPriv;
1544 IMG_HANDLE hUnique;
1545 BM_HANDLE hBuffer;
1546 IMG_SIZE_T uiMapSize = 0;
1547 IMG_SIZE_T uiAdjustOffset = 0;
1548 IMG_UINT32 ui32PageCount;
1549 IMG_UINT32 i;
1550 IMG_BOOL bAllocSync = (ui32Flags & PVRSRV_MEM_NO_SYNCOBJ)?IMG_FALSE:IMG_TRUE;
1551
1552 if ((hDevCookie == IMG_NULL) || (ui32ChunkCount == 0)
1553 || (hDevMemHeap == IMG_NULL) || (ppsKernelMemInfo == IMG_NULL))
1554 {
1555 PVR_DPF((PVR_DBG_ERROR, "%s: Invalid params", __FUNCTION__));
1556 return PVRSRV_ERROR_INVALID_PARAMS;
1557 }
1558
1559 for (i=0;i<ui32ChunkCount;i++)
1560 {
1561 if ((pauiOffset[i] & HOST_PAGEMASK) != 0)
1562 {
1563 PVR_DPF((PVR_DBG_ERROR,"%s: Chunk offset is not page aligned", __FUNCTION__));
1564 return PVRSRV_ERROR_INVALID_PARAMS;
1565 }
1566
1567 if ((pauiSize[i] & HOST_PAGEMASK) != 0)
1568 {
1569 PVR_DPF((PVR_DBG_ERROR,"%s: Chunk size is not page aligned", __FUNCTION__));
1570 return PVRSRV_ERROR_INVALID_PARAMS;
1571 }
1572 uiMapSize += pauiSize[i];
1573 }
1574
1575 psDeviceNode = (PVRSRV_DEVICE_NODE *)hDevCookie;
1576
1577 if(OSAllocMem(PVRSRV_PAGEABLE_SELECT,
1578 sizeof(PVRSRV_KERNEL_MEM_INFO),
1579 (IMG_VOID **)&psNewKernelMemInfo, IMG_NULL,
1580 "Kernel Memory Info") != PVRSRV_OK)
1581 {
1582 PVR_DPF((PVR_DBG_ERROR,"%s: Failed to alloc memory for block", __FUNCTION__));
1583 return PVRSRV_ERROR_OUT_OF_MEMORY;
1584 }
1585 OSMemSet(psNewKernelMemInfo, 0, sizeof(PVRSRV_KERNEL_MEM_INFO));
1586
1587 /* Import the DMABUF buffer into our dmabuf_client and DMA map it */
1588 eError = DmabufImportBufferAndAcquirePhysAddr(ui32NumFDs,
1589 pi32BufferFDs,
1590 &ui32PageCount,
1591 &pasSysPhysAddr,
1592 &psNewKernelMemInfo->pvLinAddrKM,
1593 &hPriv,
1594 &hUnique);
1595 if (eError != PVRSRV_OK)
1596 {
1597 PVR_DPF((PVR_DBG_ERROR, "%s: Failed to get dmabuf buffer/buffer phys addr", __FUNCTION__));
1598 goto exitFailedImport;
1599 }
1600
1601 /*
1602 Make sure the number of pages detected by the dmabuf import are at least
1603 the size of the total chunked region
1604 */
1605 if(ui32PageCount * PAGE_SIZE < uiMapSize)
1606 {
1607 PVR_DPF((PVR_DBG_ERROR, "%s: dmabuf allocator returned fewer page addresses "
1608 "than specified chunk size(s)", __FUNCTION__));
1609 eError = PVRSRV_ERROR_INVALID_PARAMS;
1610 goto exitFailedAdjustedAlloc;
1611 }
1612
1613 /*
1614 An Dmabuf buffer might have a number of "chunks" in it which need to be
1615 mapped virtually continuous so we need to create a new array of
1616 addresses based on this chunk data for the actual wrap
1617 */
1618 if(OSAllocMem(PVRSRV_PAGEABLE_SELECT,
1619 sizeof(IMG_SYS_PHYADDR) * (uiMapSize/HOST_PAGESIZE()),
1620 (IMG_VOID **)&pasAdjustedSysPhysAddr, IMG_NULL,
1621 "Dmabuf adjusted system address array") != PVRSRV_OK)
1622 {
1623 PVR_DPF((PVR_DBG_ERROR,"%s: Failed to alloc memory for adjusted array", __FUNCTION__));
1624 goto exitFailedAdjustedAlloc;
1625 }
1626 OSMemSet(pasAdjustedSysPhysAddr, 0, sizeof(IMG_SYS_PHYADDR) * (uiMapSize/HOST_PAGESIZE()));
1627
1628 for (i=0;i<ui32ChunkCount;i++)
1629 {
1630 OSMemCopy(&pasAdjustedSysPhysAddr[uiAdjustOffset],
1631 &pasSysPhysAddr[pauiOffset[i]/HOST_PAGESIZE()],
1632 (pauiSize[i]/HOST_PAGESIZE()) * sizeof(IMG_SYS_PHYADDR));
1633
1634 uiAdjustOffset += pauiSize[i]/HOST_PAGESIZE();
1635 }
1636
1637 /* Wrap the returned addresses into our memory context */
1638 if (!BM_Wrap(hDevMemHeap,
1639 uiMapSize,
1640 0,
1641 IMG_FALSE,
1642 pasAdjustedSysPhysAddr,
1643 IMG_NULL,
1644 &ui32Flags, /* This function clobbers our bits in ui32Flags */
1645 &hBuffer))
1646 {
1647 PVR_DPF((PVR_DBG_ERROR, "%s: Failed to wrap dmabuf buffer", __FUNCTION__));
1648 eError = PVRSRV_ERROR_OUT_OF_MEMORY;
1649 goto exitFailedWrap;
1650 }
1651
1652 /* Fill in "Implementation dependant" section of mem info */
1653 psMemBlock = &psNewKernelMemInfo->sMemBlk;
1654 psMemBlock->sDevVirtAddr = BM_HandleToDevVaddr(hBuffer);
1655 psMemBlock->hOSMemHandle = BM_HandleToOSMemHandle(hBuffer);
1656 psMemBlock->hBuffer = (IMG_HANDLE) hBuffer;
1657 psMemBlock->hOSWrapMem = hPriv; /* Saves creating a new element as we know hOSWrapMem will not be used */
1658 psMemBlock->psIntSysPAddr = pasAdjustedSysPhysAddr;
1659
1660 psNewKernelMemInfo->ui32Flags = ui32Flags;
1661 psNewKernelMemInfo->sDevVAddr = psMemBlock->sDevVirtAddr;
1662 psNewKernelMemInfo->uAllocSize = uiMapSize;
1663 psNewKernelMemInfo->memType = PVRSRV_MEMTYPE_DMABUF;
1664 PVRSRVKernelMemInfoIncRef(psNewKernelMemInfo);
1665
1666 /* Clear the Backup buffer pointer as we do not have one at this point. We only allocate this as we are going up/down */
1667 psNewKernelMemInfo->pvSysBackupBuffer = IMG_NULL;
1668
1669 if (!bAllocSync)
1670 {
1671 psNewKernelMemInfo->psKernelSyncInfo = IMG_NULL;
1672 }
1673 else
1674 {
1675 PVRSRV_EXTERNAL_SYNC_INFO *psExternalSyncInfo;
1676 BM_HEAP *psBMHeap;
1677 IMG_HANDLE hDevMemContext;
1678
1679 psBMHeap = (BM_HEAP*)hDevMemHeap;
1680 hDevMemContext = (IMG_HANDLE)psBMHeap->pBMContext;
1681
1682 eError = PVRSRVExternalBufferSyncInfoIncRef(hUnique,
1683 hDevCookie,
1684 hDevMemContext,
1685 &psExternalSyncInfo,
1686 psNewKernelMemInfo);
1687 if(eError != PVRSRV_OK)
1688 {
1689 goto exitFailedSync;
1690 }
1691 psNewKernelMemInfo->hExternalSyncInfo = psExternalSyncInfo;
1692 psNewKernelMemInfo->psKernelSyncInfo = ExternalBufferSyncGetKernelSyncInfo(psExternalSyncInfo);
1693 *pui64Stamp = ExternalBufferSyncGetStamp(psExternalSyncInfo);
1694 }
1695
1696 /* register with the resman */
1697 psNewKernelMemInfo->sMemBlk.hResItem = ResManRegisterRes(psPerProc->hResManContext,
1698 RESMAN_TYPE_DEVICEMEM_DMABUF,
1699 psNewKernelMemInfo,
1700 0,
1701 &DmabufUnmapCallback);
1702 if (psNewKernelMemInfo->sMemBlk.hResItem == IMG_NULL)
1703 {
1704 eError = PVRSRV_ERROR_OUT_OF_MEMORY;
1705 goto exitFailedResman;
1706 }
1707
1708 psNewKernelMemInfo->memType = PVRSRV_MEMTYPE_DMABUF;
1709
1710 /*
1711 As the user doesn't tell us the size, just the "chunk" information
1712 return actual size of the Dmabuf buffer so we can mmap it.
1713 */
1714 *puiDmabufBufferSize = ui32PageCount * HOST_PAGESIZE();
1715 *ppsKernelMemInfo = psNewKernelMemInfo;
1716 return PVRSRV_OK;
1717
1718exitFailedResman:
1719 if (psNewKernelMemInfo->psKernelSyncInfo)
1720 {
1721 PVRSRVExternalBufferSyncInfoDecRef(psNewKernelMemInfo->hExternalSyncInfo, psNewKernelMemInfo);
1722 }
1723exitFailedSync:
1724 BM_Free(hBuffer, ui32Flags);
1725exitFailedWrap:
1726 OSFreeMem(PVRSRV_PAGEABLE_SELECT,
1727 sizeof(IMG_SYS_PHYADDR) * uiAdjustOffset,
1728 pasAdjustedSysPhysAddr,
1729 IMG_NULL);
1730exitFailedAdjustedAlloc:
1731 DmabufUnimportBufferAndReleasePhysAddr(hPriv);
1732exitFailedImport:
1733 OSFreeMem(PVRSRV_PAGEABLE_SELECT,
1734 sizeof(PVRSRV_KERNEL_MEM_INFO),
1735 psNewKernelMemInfo,
1736 IMG_NULL);
1737
1738 return eError;
1739}
1740
1741/*!
1742******************************************************************************
1743
1744 @Function PVRSRVUnmapDmabufKM
1745
1746 @Description
1747
1748 Frees a dmabuf buffer mapped with PVRSRVMapDmabufKM, including the mem_info structure
1749
1750 @Input psMemInfo :
1751
1752 @Return PVRSRV_ERROR :
1753
1754******************************************************************************/
1755IMG_EXPORT
1756PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapDmabufKM(PVRSRV_KERNEL_MEM_INFO *psMemInfo)
1757{
1758 if (!psMemInfo)
1759 {
1760 return PVRSRV_ERROR_INVALID_PARAMS;
1761 }
1762
1763 return ResManFreeResByPtr(psMemInfo->sMemBlk.hResItem, CLEANUP_WITH_POLL);
1764}
1765#endif /* SUPPORT_DRM_GEM */
1766
1767#if defined(SUPPORT_ION)
1768static PVRSRV_ERROR IonUnmapCallback(IMG_PVOID pvParam,
1769 IMG_UINT32 ui32Param,
1770 IMG_BOOL bDummy)
1771{
1772 PVRSRV_KERNEL_MEM_INFO *psMemInfo = (PVRSRV_KERNEL_MEM_INFO *)pvParam;
1773
1774 PVR_UNREFERENCED_PARAMETER(bDummy);
1775
1776 return FreeMemCallBackCommon(psMemInfo, ui32Param, PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR);
1777}
1474 1778
1475/*! 1779/*!
1476****************************************************************************** 1780******************************************************************************
@@ -1655,25 +1959,25 @@ PVRSRV_ERROR PVRSRVMapIonHandleKM(PVRSRV_PER_PROCESS_DATA *psPerProc,
1655 } 1959 }
1656 else 1960 else
1657 { 1961 {
1658 PVRSRV_ION_SYNC_INFO *psIonSyncInfo; 1962 PVRSRV_EXTERNAL_SYNC_INFO *psExternalSyncInfo;
1659 BM_HEAP *psBMHeap; 1963 BM_HEAP *psBMHeap;
1660 IMG_HANDLE hDevMemContext; 1964 IMG_HANDLE hDevMemContext;
1661 1965
1662 psBMHeap = (BM_HEAP*)hDevMemHeap; 1966 psBMHeap = (BM_HEAP*)hDevMemHeap;
1663 hDevMemContext = (IMG_HANDLE)psBMHeap->pBMContext; 1967 hDevMemContext = (IMG_HANDLE)psBMHeap->pBMContext;
1664 1968
1665 eError = PVRSRVIonBufferSyncInfoIncRef(hUnique, 1969 eError = PVRSRVExternalBufferSyncInfoIncRef(hUnique,
1666 hDevCookie, 1970 hDevCookie,
1667 hDevMemContext, 1971 hDevMemContext,
1668 &psIonSyncInfo, 1972 &psExternalSyncInfo,
1669 psNewKernelMemInfo); 1973 psNewKernelMemInfo);
1670 if(eError != PVRSRV_OK) 1974 if(eError != PVRSRV_OK)
1671 { 1975 {
1672 goto exitFailedSync; 1976 goto exitFailedSync;
1673 } 1977 }
1674 psNewKernelMemInfo->hIonSyncInfo = psIonSyncInfo; 1978 psNewKernelMemInfo->hExternalSyncInfo = psExternalSyncInfo;
1675 psNewKernelMemInfo->psKernelSyncInfo = IonBufferSyncGetKernelSyncInfo(psIonSyncInfo); 1979 psNewKernelMemInfo->psKernelSyncInfo = ExternalBufferSyncGetKernelSyncInfo(psExternalSyncInfo);
1676 *pui64Stamp = IonBufferSyncGetStamp(psIonSyncInfo); 1980 *pui64Stamp = ExternalBufferSyncGetStamp(psExternalSyncInfo);
1677 } 1981 }
1678 1982
1679 /* register with the resman */ 1983 /* register with the resman */
@@ -1701,7 +2005,7 @@ PVRSRV_ERROR PVRSRVMapIonHandleKM(PVRSRV_PER_PROCESS_DATA *psPerProc,
1701exitFailedResman: 2005exitFailedResman:
1702 if (psNewKernelMemInfo->psKernelSyncInfo) 2006 if (psNewKernelMemInfo->psKernelSyncInfo)
1703 { 2007 {
1704 PVRSRVIonBufferSyncInfoDecRef(psNewKernelMemInfo->hIonSyncInfo, psNewKernelMemInfo); 2008 PVRSRVExternalBufferSyncInfoDecRef(psNewKernelMemInfo->hExternalSyncInfo, psNewKernelMemInfo);
1705 } 2009 }
1706exitFailedSync: 2010exitFailedSync:
1707 BM_Free(hBuffer, ui32Flags); 2011 BM_Free(hBuffer, ui32Flags);
@@ -2937,14 +3241,16 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInitDeviceMem(IMG_VOID)
2937{ 3241{
2938 PVRSRV_ERROR eError = PVRSRV_OK; 3242 PVRSRV_ERROR eError = PVRSRV_OK;
2939 3243
2940#if defined(SUPPORT_ION) 3244#if defined(SUPPORT_ION) || defined(SUPPORT_DRM_GEM)
2941 /* 3245 /*
2942 For Ion buffers we need to store which ones we know about so 3246 For Ion and GEM buffers we need to store which ones we know about so
2943 we don't give the same buffer a different sync 3247 we don't give the same buffer a different sync
2944 */ 3248 */
2945 g_psIonSyncHash = HASH_Create(ION_SYNC_HASH_SIZE); 3249 PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitDeviceMem: Creating external hash"));
2946 if (g_psIonSyncHash == IMG_NULL) 3250 g_psExternalSyncHash = HASH_Create(EXTERNAL_SYNC_HASH_SIZE);
3251 if (g_psExternalSyncHash == IMG_NULL)
2947 { 3252 {
3253 PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitDeviceMem: Creating external hash failed"));
2948 eError = PVRSRV_ERROR_OUT_OF_MEMORY; 3254 eError = PVRSRV_ERROR_OUT_OF_MEMORY;
2949 } 3255 }
2950#endif 3256#endif
@@ -2954,8 +3260,8 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInitDeviceMem(IMG_VOID)
2954 3260
2955IMG_VOID IMG_CALLCONV PVRSRVDeInitDeviceMem(IMG_VOID) 3261IMG_VOID IMG_CALLCONV PVRSRVDeInitDeviceMem(IMG_VOID)
2956{ 3262{
2957#if defined(SUPPORT_ION) 3263#if defined(SUPPORT_ION) || defined(SUPPORT_DRM_GEM)
2958 HASH_Delete(g_psIonSyncHash); 3264 HASH_Delete(g_psExternalSyncHash);
2959#endif 3265#endif
2960} 3266}
2961 3267
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c
index ac8e1e3..1ebb95e 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c
@@ -59,6 +59,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
59#include "lists.h" 59#include "lists.h"
60 60
61IMG_UINT32 g_ui32InitFlags; 61IMG_UINT32 g_ui32InitFlags;
62IMG_UINT32 g_iDrmFd = -1;
62 63
63/* mark which parts of Services were initialised */ 64/* mark which parts of Services were initialised */
64#define INIT_DATA_ENABLE_PDUMPINIT 0x1U 65#define INIT_DATA_ENABLE_PDUMPINIT 0x1U
@@ -458,7 +459,7 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVInit(PSYS_DATA psSysData)
458 g_ui32InitFlags |= INIT_DATA_ENABLE_PDUMPINIT; 459 g_ui32InitFlags |= INIT_DATA_ENABLE_PDUMPINIT;
459#endif 460#endif
460 461
461#if defined(SUPPORT_ION) 462#if defined(SUPPORT_ION) || defined(SUPPORT_DRM_GEM)
462 eError = PVRSRVInitDeviceMem(); 463 eError = PVRSRVInitDeviceMem();
463 if (eError != PVRSRV_OK) 464 if (eError != PVRSRV_OK)
464 goto Error; 465 goto Error;
@@ -502,7 +503,7 @@ IMG_VOID IMG_CALLCONV PVRSRVDeInit(PSYS_DATA psSysData)
502 PERFDEINIT(); 503 PERFDEINIT();
503 504
504 505
505#if defined(SUPPORT_ION) 506#if defined(SUPPORT_ION) || defined(SUPPORT_DRM_GEM)
506 if ((g_ui32InitFlags & INIT_DATA_ENABLE_DEVMEM) > 0) 507 if ((g_ui32InitFlags & INIT_DATA_ENABLE_DEVMEM) > 0)
507 { 508 {
508 PVRSRVDeInitDeviceMem(); 509 PVRSRVDeInitDeviceMem();
@@ -1216,7 +1217,9 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
1216 |PVRSRV_MISC_INFO_FREEMEM_PRESENT 1217 |PVRSRV_MISC_INFO_FREEMEM_PRESENT
1217 |PVRSRV_MISC_INFO_GET_REF_COUNT_PRESENT 1218 |PVRSRV_MISC_INFO_GET_REF_COUNT_PRESENT
1218 |PVRSRV_MISC_INFO_GET_PAGE_SIZE_PRESENT 1219 |PVRSRV_MISC_INFO_GET_PAGE_SIZE_PRESENT
1219 |PVRSRV_MISC_INFO_FORCE_SWAP_TO_SYSTEM_PRESENT)) 1220 |PVRSRV_MISC_INFO_FORCE_SWAP_TO_SYSTEM_PRESENT
1221 |PVRSRV_MISC_INFO_GET_DRM_FD_PRESENT
1222 |PVRSRV_MISC_INFO_SET_DRM_FD_PRESENT))
1220 { 1223 {
1221 PVR_DPF((PVR_DBG_ERROR,"PVRSRVGetMiscInfoKM: invalid state request flags")); 1224 PVR_DPF((PVR_DBG_ERROR,"PVRSRVGetMiscInfoKM: invalid state request flags"));
1222 return PVRSRV_ERROR_INVALID_PARAMS; 1225 return PVRSRV_ERROR_INVALID_PARAMS;
@@ -1477,6 +1480,18 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfoKM(PVRSRV_MISC_INFO *psMiscInfo)
1477 psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_FORCE_SWAP_TO_SYSTEM_PRESENT; 1480 psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_FORCE_SWAP_TO_SYSTEM_PRESENT;
1478 } 1481 }
1479#endif /* defined(SUPPORT_PVRSRV_DEVICE_CLASS) */ 1482#endif /* defined(SUPPORT_PVRSRV_DEVICE_CLASS) */
1483 if ((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_GET_DRM_FD_PRESENT) != 0UL)
1484 {
1485 PVR_DPF((PVR_DBG_ERROR,"PVRSRVGetMiscInfoKM: GetDrmFD: %d", g_iDrmFd));
1486 psMiscInfo->iDrmFd = g_iDrmFd;
1487 psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_GET_DRM_FD_PRESENT;
1488 }
1489 if ((psMiscInfo->ui32StateRequest & PVRSRV_MISC_INFO_SET_DRM_FD_PRESENT) != 0UL)
1490 {
1491 g_iDrmFd = psMiscInfo->iDrmFd;
1492 PVR_DPF((PVR_DBG_ERROR,"PVRSRVGetMiscInfoKM: SetDrmFD: %d", g_iDrmFd));
1493 psMiscInfo->ui32StatePresent |= PVRSRV_MISC_INFO_SET_DRM_FD_PRESENT;
1494 }
1480 1495
1481 return PVRSRV_OK; 1496 return PVRSRV_OK;
1482} 1497}
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/refcount.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/refcount.c
index a6dcb19..28f671a 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/refcount.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/refcount.c
@@ -83,7 +83,7 @@ static DEFINE_SPINLOCK(gsCCBLock);
83/*static const IMG_UINT guiDebugMask = PVRSRV_REFCOUNT_CCB_DEBUG_ALL;*/ 83/*static const IMG_UINT guiDebugMask = PVRSRV_REFCOUNT_CCB_DEBUG_ALL;*/
84static const IMG_UINT guiDebugMask = 84static const IMG_UINT guiDebugMask =
85 PVRSRV_REFCOUNT_CCB_DEBUG_SYNCINFO | 85 PVRSRV_REFCOUNT_CCB_DEBUG_SYNCINFO |
86#if defined(SUPPORT_ION) 86#if defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION)
87 PVRSRV_REFCOUNT_CCB_DEBUG_ION_SYNC | 87 PVRSRV_REFCOUNT_CCB_DEBUG_ION_SYNC |
88#endif 88#endif
89 PVRSRV_REFCOUNT_CCB_DEBUG_MMAP2; 89 PVRSRV_REFCOUNT_CCB_DEBUG_MMAP2;
@@ -588,8 +588,8 @@ skip:
588 psOffsetStruct->ui32Mapped--; 588 psOffsetStruct->ui32Mapped--;
589} 589}
590 590
591#if defined(SUPPORT_ION) 591#if defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION)
592PVRSRV_ERROR PVRSRVIonBufferSyncInfoIncRef2(const IMG_CHAR *pszFile, IMG_INT iLine, 592PVRSRV_ERROR PVRSRVExternalBufferSyncInfoIncRef2(const IMG_CHAR *pszFile, IMG_INT iLine,
593 IMG_HANDLE hUnique, 593 IMG_HANDLE hUnique,
594 IMG_HANDLE hDevCookie, 594 IMG_HANDLE hDevCookie,
595 IMG_HANDLE hDevMemContext, 595 IMG_HANDLE hDevMemContext,
@@ -601,7 +601,7 @@ PVRSRV_ERROR PVRSRVIonBufferSyncInfoIncRef2(const IMG_CHAR *pszFile, IMG_INT iLi
601 /* 601 /*
602 We have to do the call 1st as we need to Ion syninfo which it returns 602 We have to do the call 1st as we need to Ion syninfo which it returns
603 */ 603 */
604 eError = PVRSRVIonBufferSyncAcquire(hUnique, 604 eError = PVRSRVExternalBufferSyncAcquire(hUnique,
605 hDevCookie, 605 hDevCookie,
606 hDevMemContext, 606 hDevMemContext,
607 ppsIonSyncInfo); 607 ppsIonSyncInfo);
@@ -637,7 +637,7 @@ skip:
637 return eError; 637 return eError;
638} 638}
639 639
640void PVRSRVIonBufferSyncInfoDecRef2(const IMG_CHAR *pszFile, IMG_INT iLine, 640void PVRSRVExternalBufferSyncInfoDecRef2(const IMG_CHAR *pszFile, IMG_INT iLine,
641 PVRSRV_ION_SYNC_INFO *psIonSyncInfo, 641 PVRSRV_ION_SYNC_INFO *psIonSyncInfo,
642 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo) 642 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo)
643{ 643{
@@ -665,7 +665,7 @@ void PVRSRVIonBufferSyncInfoDecRef2(const IMG_CHAR *pszFile, IMG_INT iLine,
665 665
666 PVRSRV_UNLOCK_CCB(); 666 PVRSRV_UNLOCK_CCB();
667skip: 667skip:
668 PVRSRVIonBufferSyncRelease(psIonSyncInfo); 668 PVRSRVExternalBufferSyncRelease(psIonSyncInfo);
669} 669}
670 670
671#endif /* defined (SUPPORT_ION) */ 671#endif /* defined (SUPPORT_ION) */
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/resman.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/resman.c
index 1bb3ebf..302efb2 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/resman.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/resman.c
@@ -359,6 +359,9 @@ IMG_VOID PVRSRVResManDisconnect(PRESMAN_CONTEXT psResManContext,
359 FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_MAPPING, 0, 0, IMG_TRUE); 359 FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_MAPPING, 0, 0, IMG_TRUE);
360 FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_KERNEL_DEVICEMEM_ALLOCATION, 0, 0, IMG_TRUE); 360 FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_KERNEL_DEVICEMEM_ALLOCATION, 0, 0, IMG_TRUE);
361 FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_ALLOCATION, 0, 0, IMG_TRUE); 361 FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_ALLOCATION, 0, 0, IMG_TRUE);
362#if defined(SUPPORT_DRM_GEM)
363 FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_DMABUF, 0, 0, IMG_TRUE);
364#endif
362#if defined(SUPPORT_ION) 365#if defined(SUPPORT_ION)
363 FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_ION, 0, 0, IMG_TRUE); 366 FreeResourceByCriteria(psResManContext, RESMAN_CRITERIA_RESTYPE, RESMAN_TYPE_DEVICEMEM_ION, 0, 0, IMG_TRUE);
364#endif 367#endif
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Kbuild.mk b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Kbuild.mk
index 10064d6..857206e 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Kbuild.mk
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Kbuild.mk
@@ -78,6 +78,11 @@ pvrsrvkm-y += \
78 services4/srvkm/common/queue.o 78 services4/srvkm/common/queue.o
79endif 79endif
80 80
81ifeq ($(SUPPORT_DRM_GEM),1)
82pvrsrvkm-y += \
83 services4/srvkm/env/linux/dmabuf.o
84endif
85
81ifeq ($(SUPPORT_ION),1) 86ifeq ($(SUPPORT_ION),1)
82pvrsrvkm-y += \ 87pvrsrvkm-y += \
83 services4/srvkm/env/linux/ion.o 88 services4/srvkm/env/linux/ion.o
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
index 7ffb30c..369c0e1 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
@@ -4634,7 +4634,7 @@ PVRSRV_ERROR PVROSFuncInit(IMG_VOID)
4634 } 4634 }
4635#endif 4635#endif
4636 4636
4637#if defined (SUPPORT_ION) 4637#if 0//defined (SUPPORT_ION)
4638 { 4638 {
4639 PVRSRV_ERROR eError; 4639 PVRSRV_ERROR eError;
4640 4640
@@ -4654,7 +4654,7 @@ PVRSRV_ERROR PVROSFuncInit(IMG_VOID)
4654 */ 4654 */
4655IMG_VOID PVROSFuncDeInit(IMG_VOID) 4655IMG_VOID PVROSFuncDeInit(IMG_VOID)
4656{ 4656{
4657#if defined (SUPPORT_ION) 4657#if 0//defined (SUPPORT_ION)
4658 IonDeinit(); 4658 IonDeinit();
4659#endif 4659#endif
4660#if defined(PVR_LINUX_TIMERS_USING_WORKQUEUES) 4660#if defined(PVR_LINUX_TIMERS_USING_WORKQUEUES)
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osperproc.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osperproc.c
index 9b014dc..5a79f75 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osperproc.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osperproc.c
@@ -47,7 +47,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
47#if defined (SUPPORT_ION) 47#if defined (SUPPORT_ION)
48#include <linux/err.h> 48#include <linux/err.h>
49#include "ion.h" 49#include "ion.h"
50extern struct ion_device *gpsIonDev; 50//extern struct ion_device *gpsIonDev;
51#endif 51#endif
52 52
53extern IMG_UINT32 gui32ReleasePID; 53extern IMG_UINT32 gui32ReleasePID;
@@ -85,7 +85,7 @@ PVRSRV_ERROR OSPerProcessPrivateDataInit(IMG_HANDLE *phOsPrivateData)
85 INIT_LIST_HEAD(&psEnvPerProc->sDRMAuthListHead); 85 INIT_LIST_HEAD(&psEnvPerProc->sDRMAuthListHead);
86#endif 86#endif
87 87
88#if defined(SUPPORT_ION) 88#if 0//defined(SUPPORT_ION)
89 OSSNPrintf(psEnvPerProc->azIonClientName, ION_CLIENT_NAME_SIZE, "pvr_ion_client-%d", OSGetCurrentProcessIDKM()); 89 OSSNPrintf(psEnvPerProc->azIonClientName, ION_CLIENT_NAME_SIZE, "pvr_ion_client-%d", OSGetCurrentProcessIDKM());
90 psEnvPerProc->psIONClient = 90 psEnvPerProc->psIONClient =
91 ion_client_create(gpsIonDev, 91 ion_client_create(gpsIonDev,
@@ -114,7 +114,7 @@ PVRSRV_ERROR OSPerProcessPrivateDataDeInit(IMG_HANDLE hOsPrivateData)
114 114
115 psEnvPerProc = (PVRSRV_ENV_PER_PROCESS_DATA *)hOsPrivateData; 115 psEnvPerProc = (PVRSRV_ENV_PER_PROCESS_DATA *)hOsPrivateData;
116 116
117#if defined(SUPPORT_ION) 117#if 0//defined(SUPPORT_ION)
118 if (psEnvPerProc->psIONClient) 118 if (psEnvPerProc->psIONClient)
119 { 119 {
120 ion_client_destroy(psEnvPerProc->psIONClient); 120 ion_client_destroy(psEnvPerProc->psIONClient);
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_debug.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_debug.c
index df3a9b5..aece908 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_debug.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_debug.c
@@ -462,18 +462,17 @@ IMG_VOID PVRSRVDebugPrintf (
462 } 462 }
463 else 463 else
464 { 464 {
465 const IMG_CHAR *pszShortName = strrchr(pszFileName, '/') + 1;
466 if(pszShortName)
467 pszFileName = pszShortName;
465 if (ui32DebugLevel & DBGPRIV_BUFFERED) 468 if (ui32DebugLevel & DBGPRIV_BUFFERED)
466 { 469 {
467 /* We don't need the full path here */ 470 /* We don't need the full path here */
468 const IMG_CHAR *pszShortName = strrchr(pszFileName, '/') + 1;
469 if(pszShortName)
470 pszFileName = pszShortName;
471
472 AddToBufferCCB(pszFileName, ui32Line, pszBuf); 471 AddToBufferCCB(pszFileName, ui32Line, pszBuf);
473 } 472 }
474 else 473 else
475 { 474 {
476 printk(KERN_INFO "%s\n", pszBuf); 475 printk(KERN_INFO "%s (File: %s, Line: %d)\n", pszBuf, pszFileName, ui32Line);
477 } 476 }
478 } 477 }
479 478
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/include/refcount.h b/jacinto6/sgx_src/eurasia_km/services4/srvkm/include/refcount.h
index a2efd6c..0f015b5 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/include/refcount.h
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/include/refcount.h
@@ -43,9 +43,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43#define __REFCOUNT_H__ 43#define __REFCOUNT_H__
44 44
45#include "pvr_bridge_km.h" 45#include "pvr_bridge_km.h"
46#if defined(SUPPORT_ION) 46#if defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION)
47#include "ion_sync.h" 47#include "external_sync.h"
48#endif /* defined(SUPPORT_ION) */ 48#endif /* defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION) */
49 49
50#if defined(PVRSRV_REFCOUNT_DEBUG) 50#if defined(PVRSRV_REFCOUNT_DEBUG)
51 51
@@ -114,20 +114,20 @@ void PVRSRVOffsetStructIncMapped2(const IMG_CHAR *pszFile, IMG_INT iLine,
114void PVRSRVOffsetStructDecMapped2(const IMG_CHAR *pszFile, IMG_INT iLine, 114void PVRSRVOffsetStructDecMapped2(const IMG_CHAR *pszFile, IMG_INT iLine,
115 PKV_OFFSET_STRUCT psOffsetStruct); 115 PKV_OFFSET_STRUCT psOffsetStruct);
116 116
117#if defined(SUPPORT_ION) 117#if defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION)
118#define PVRSRVIonBufferSyncInfoIncRef(x...) \ 118#define PVRSRVExternalBufferSyncInfoIncRef(x...) \
119 PVRSRVIonBufferSyncInfoIncRef2(__FILE__, __LINE__, x) 119 PVRSRVExternalBufferSyncInfoIncRef2(__FILE__, __LINE__, x)
120#define PVRSRVIonBufferSyncInfoDecRef(x...) \ 120#define PVRSRVExternalBufferSyncInfoDecRef(x...) \
121 PVRSRVIonBufferSyncInfoDecRef2(__FILE__, __LINE__, x) 121 PVRSRVExternalBufferSyncInfoDecRef2(__FILE__, __LINE__, x)
122 122
123PVRSRV_ERROR PVRSRVIonBufferSyncInfoIncRef2(const IMG_CHAR *pszFile, IMG_INT iLine, 123PVRSRV_ERROR PVRSRVExternalBufferSyncInfoIncRef2(const IMG_CHAR *pszFile, IMG_INT iLine,
124 IMG_HANDLE hUnique, 124 IMG_HANDLE hUnique,
125 IMG_HANDLE hDevCookie, 125 IMG_HANDLE hDevCookie,
126 IMG_HANDLE hDevMemContext, 126 IMG_HANDLE hDevMemContext,
127 PVRSRV_ION_SYNC_INFO **ppsIonSyncInfo, 127 PVRSRV_EXTERNAL_SYNC_INFO **ppsIonSyncInfo,
128 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo); 128 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo);
129void PVRSRVIonBufferSyncInfoDecRef2(const IMG_CHAR *pszFile, IMG_INT iLine, 129void PVRSRVExternalBufferSyncInfoDecRef2(const IMG_CHAR *pszFile, IMG_INT iLine,
130 PVRSRV_ION_SYNC_INFO *psIonSyncInfo, 130 PVRSRV_EXTERNAL_SYNC_INFO *psIonSyncInfo,
131 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo); 131 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo);
132#endif /* defined (SUPPORT_ION) */ 132#endif /* defined (SUPPORT_ION) */
133 133
@@ -216,26 +216,26 @@ static INLINE void PVRSRVOffsetStructDecMapped(PKV_OFFSET_STRUCT psOffsetStruct)
216 psOffsetStruct->ui32Mapped--; 216 psOffsetStruct->ui32Mapped--;
217} 217}
218 218
219#if defined(SUPPORT_ION) 219#if defined(SUPPORT_DRM_GEM) || defined(SUPPORT_ION)
220static INLINE PVRSRV_ERROR PVRSRVIonBufferSyncInfoIncRef(IMG_HANDLE hUnique, 220static INLINE PVRSRV_ERROR PVRSRVExternalBufferSyncInfoIncRef(IMG_HANDLE hUnique,
221 IMG_HANDLE hDevCookie, 221 IMG_HANDLE hDevCookie,
222 IMG_HANDLE hDevMemContext, 222 IMG_HANDLE hDevMemContext,
223 PVRSRV_ION_SYNC_INFO **ppsIonSyncInfo, 223 PVRSRV_EXTERNAL_SYNC_INFO **ppsIonSyncInfo,
224 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo) 224 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo)
225{ 225{
226 PVR_UNREFERENCED_PARAMETER(psKernelMemInfo); 226 PVR_UNREFERENCED_PARAMETER(psKernelMemInfo);
227 227
228 return PVRSRVIonBufferSyncAcquire(hUnique, 228 return PVRSRVExternalBufferSyncAcquire(hUnique,
229 hDevCookie, 229 hDevCookie,
230 hDevMemContext, 230 hDevMemContext,
231 ppsIonSyncInfo); 231 ppsIonSyncInfo);
232} 232}
233 233
234static INLINE void PVRSRVIonBufferSyncInfoDecRef(PVRSRV_ION_SYNC_INFO *psIonSyncInfo, 234static INLINE void PVRSRVExternalBufferSyncInfoDecRef(PVRSRV_EXTERNAL_SYNC_INFO *psIonSyncInfo,
235 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo) 235 PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo)
236{ 236{
237 PVR_UNREFERENCED_PARAMETER(psKernelMemInfo); 237 PVR_UNREFERENCED_PARAMETER(psKernelMemInfo);
238 PVRSRVIonBufferSyncRelease(psIonSyncInfo); 238 PVRSRVExternalBufferSyncRelease(psIonSyncInfo);
239} 239}
240#endif /* defined (SUPPORT_ION) */ 240#endif /* defined (SUPPORT_ION) */
241 241
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/include/resman.h b/jacinto6/sgx_src/eurasia_km/services4/srvkm/include/resman.h
index 92659d9..75e09a9 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/include/resman.h
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/include/resman.h
@@ -80,6 +80,7 @@ enum {
80 RESMAN_TYPE_DEVICEMEM_WRAP, /*!< Device Memory Wrap Resource */ 80 RESMAN_TYPE_DEVICEMEM_WRAP, /*!< Device Memory Wrap Resource */
81 RESMAN_TYPE_DEVICEMEM_ALLOCATION, /*!< Device Memory Allocation Resource */ 81 RESMAN_TYPE_DEVICEMEM_ALLOCATION, /*!< Device Memory Allocation Resource */
82 RESMAN_TYPE_DEVICEMEM_ION, /*!< Device Memory Ion Resource */ 82 RESMAN_TYPE_DEVICEMEM_ION, /*!< Device Memory Ion Resource */
83 RESMAN_TYPE_DEVICEMEM_DMABUF, /*!< Device Memory Dmabuf Resource */
83 RESMAN_TYPE_EVENT_OBJECT, /*!< Event Object */ 84 RESMAN_TYPE_EVENT_OBJECT, /*!< Event Object */
84 RESMAN_TYPE_SHARED_MEM_INFO, /*!< Shared system memory meminfo */ 85 RESMAN_TYPE_SHARED_MEM_INFO, /*!< Shared system memory meminfo */
85 RESMAN_TYPE_MODIFY_SYNC_OPS, /*!< Syncobject synchronisation Resource*/ 86 RESMAN_TYPE_MODIFY_SYNC_OPS, /*!< Syncobject synchronisation Resource*/