summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhajit Paul <subhajit_paul@ti.com>2014-08-01 16:17:52 +0400
committerSubhajit Paul <subhajit_paul@ti.com>2014-08-08 20:21:57 +0400
commitbf8997b894f216261f914f64d33e6e588770da5a (patch)
tree207f7f1ba6499afddfc0c774e1fdd2b108aada97
parent4e7c4ae284f7d7720e8ac709275f797fa6aa1e55 (diff)
downloadomap5-sgx-ddk-linux-bf8997b894f216261f914f64d33e6e588770da5a.tar.xz
K3.12 mmap support for sync dataglsdk_6.10.00.02
mmap support by creating in-kernel private handles was incorporated in a previous patch. However, handles were created only for memory allocated inside the mmap function. If the mmap request is made on an existing memory, create a handle as well. Change-Id: I3a44db65700bc0f8e08ddc438d305bf2911817fb Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
-rw-r--r--eurasia_km/services4/srvkm/env/linux/mmap.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/eurasia_km/services4/srvkm/env/linux/mmap.c b/eurasia_km/services4/srvkm/env/linux/mmap.c
index 51d5a96..7e2fb34 100644
--- a/eurasia_km/services4/srvkm/env/linux/mmap.c
+++ b/eurasia_km/services4/srvkm/env/linux/mmap.c
@@ -516,6 +516,7 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
(PVRSRV_ENV_PER_PROCESS_DATA *)PVRSRVProcessPrivateData(psPerProc);
struct drm_gem_object *buf = NULL;
IMG_UINT32 uiHandle, *puiHandle;
+ IMG_UINT32 ret;
puiHandle = &uiHandle;
#endif /* SUPPORT_DRI_DRM_EXTERNAL */
@@ -562,7 +563,6 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
buf = create_gem_wrapper(psEnvPerProc->dev,
psLinuxMemArea, 0, *pui32RealByteSize);
if(buf){
- int ret;
ret = drm_gem_handle_create(psEnvPerProc->file, (struct drm_gem_object *)buf, puiHandle);
if(ret) {
/*This means we are royaly screwed up. Go home. */
@@ -579,7 +579,14 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc,
}
psLinuxMemArea->buf = buf;
- }
+ } else {
+ ret = drm_gem_handle_create(psEnvPerProc->file, (struct drm_gem_object *)buf, puiHandle);
+ if(ret) {
+ PVR_DPF((PVR_DBG_ERROR, "%s: Screw you guys, I'm going home..", __FUNCTION__));
+ eError = PVRSRV_ERROR_OUT_OF_MEMORY;
+ goto exit_unlock;
+ }
+ }
}
#endif /* SUPPORT_DRI_DRM_EXTERNAL */