summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnand Balagopalakrishnan <anandb@ti.com>2014-12-07 11:52:31 +0300
committerAnand Balagopalakrishnan <anandb@ti.com>2014-12-08 13:19:55 +0300
commiteabfbabc80a6d435ad8d36347cdbf077113d7848 (patch)
treea02eed15dcf532c55f9bbd166604bae6685868db
parent5d1da83d94dc896580cadf2f5aead391985304d0 (diff)
downloadomap5-sgx-ddk-linux-eabfbabc80a6d435ad8d36347cdbf077113d7848.tar.xz
Use omap_gem APIs for accessing private data
The current code accesses the private buffer from DRM object directly. Instead, use the APIs defined in omap_gem to access the private data. Change-Id: Ibd6c0bd9c4dfe7df4926e55ca0f28b917cbc262d Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
-rw-r--r--eurasia_km/services4/srvkm/env/linux/mmap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/eurasia_km/services4/srvkm/env/linux/mmap.c b/eurasia_km/services4/srvkm/env/linux/mmap.c
index 7e2fb34..bab4c2a 100644
--- a/eurasia_km/services4/srvkm/env/linux/mmap.c
+++ b/eurasia_km/services4/srvkm/env/linux/mmap.c
@@ -89,6 +89,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#error "The mmap code requires PVR_SECURE_HANDLES"
#endif
+#define SGX_DRM_MAPPER_ID (0)
+
/* WARNING:
* The mmap code has its own mutex, to prevent a possible deadlock,
* when using gPVRSRVLock.
@@ -1348,8 +1350,9 @@ static void
MMapVOpenExt(struct vm_area_struct* ps_vma)
{
struct drm_gem_object *obj = ps_vma->vm_private_data;
+ void *priv = omap_gem_priv(obj, SGX_DRM_MAPPER_ID);
PKV_OFFSET_STRUCT psOffsetStruct =
- FindOffsetStructByPID(obj->driver_private, OSGetCurrentProcessIDKM());
+ FindOffsetStructByPID(priv, OSGetCurrentProcessIDKM());
if (WARN_ON(!psOffsetStruct))
return;
LinuxLockMutex(&g_sMMapMutex);
@@ -1361,8 +1364,9 @@ static void
MMapVCloseExt(struct vm_area_struct* ps_vma)
{
struct drm_gem_object *obj = ps_vma->vm_private_data;
+ void *priv = omap_gem_priv(obj, SGX_DRM_MAPPER_ID);
PKV_OFFSET_STRUCT psOffsetStruct =
- FindOffsetStructByPID(obj->driver_private, OSGetCurrentProcessIDKM());
+ FindOffsetStructByPID(priv, OSGetCurrentProcessIDKM());
if (WARN_ON(!psOffsetStruct))
return;
LinuxLockMutex(&g_sMMapMutex);
@@ -1414,7 +1418,7 @@ PVRMMapExt(struct file* pFile, struct vm_area_struct* ps_vma)
psOffsetStruct->ui32UserVAddr = ps_vma->vm_start;
- obj->driver_private = psOffsetStruct->psLinuxMemArea;
+ omap_gem_set_priv(obj, SGX_DRM_MAPPER_ID, psOffsetStruct->psLinuxMemArea);
/* Compute the flush region (if necessary) inside the mmap mutex */