Commit bf8997b8 authored by Subhajit Paul's avatar Subhajit Paul
Browse files

K3.12 mmap support for sync data



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: default avatarSubhajit Paul <subhajit_paul@ti.com>
parent 4e7c4ae2
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment