diff options
author | Ricardo Salveti de Araujo <ricardo.salveti@linaro.org> | 2012-05-21 02:02:01 -0300 |
---|---|---|
committer | Ricardo Salveti de Araujo <ricardo.salveti@linaro.org> | 2012-05-21 02:02:01 -0300 |
commit | ef8614120d8db337ca9e3b736b00d0c6e33eb4a3 (patch) | |
tree | 6c83732604deb69e2e21bd2f47a12494666f9424 | |
parent | 91b38df4fb46effabdda62fd68132f4a1cdaa1b3 (diff) |
Adding km-fix-failed-mmap-s-of-non-page-aligned-buffers.patch to the SGX kernel module (fix from TI)
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | debian/dkms.conf.in | 1 | ||||
-rw-r--r-- | debian/dkms/patches/0001-km-fix-failed-mmap-s-of-non-page-aligned-buffers.patch | 52 |
3 files changed, 60 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index bfd519a..fc581fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +pvr-omap4 (1.7.15.0.1.57-1linaro2) UNRELEASED; urgency=low + + * Adding km-fix-failed-mmap-s-of-non-page-aligned-buffers.patch to the + SGX kernel module (fix from TI) + + -- Ricardo Salveti de Araujo <ricardo.salveti@linaro.org> Mon, 21 May 2012 02:01:02 -0300 + pvr-omap4 (1.7.15.0.1.57-1linaro1) precise; urgency=low * New upstream release diff --git a/debian/dkms.conf.in b/debian/dkms.conf.in index 323716f..f683333 100644 --- a/debian/dkms.conf.in +++ b/debian/dkms.conf.in @@ -6,3 +6,4 @@ BUILT_MODULE_NAME[0]="omapdrm_pvr" DEST_MODULE_LOCATION[0]="/updates" AUTOINSTALL="yes" PATCH[0]="adding-omap_drv-omap_drm-workaround.patch" +PATCH[1]="0001-km-fix-failed-mmap-s-of-non-page-aligned-buffers.patch" diff --git a/debian/dkms/patches/0001-km-fix-failed-mmap-s-of-non-page-aligned-buffers.patch b/debian/dkms/patches/0001-km-fix-failed-mmap-s-of-non-page-aligned-buffers.patch new file mode 100644 index 0000000..8b5a076 --- /dev/null +++ b/debian/dkms/patches/0001-km-fix-failed-mmap-s-of-non-page-aligned-buffers.patch @@ -0,0 +1,52 @@ +From d13f1b816d82ba4dd1d4fd13efbfb78cdf6eac6f Mon Sep 17 00:00:00 2001 +From: Rob Clark <rob@ti.com> +Date: Mon, 23 Apr 2012 16:38:37 -0500 +Subject: [PATCH] km: fix failed mmap's of non-page aligned buffers + +GEM would round up the buffer size to next page boundary, but if the +backing memory is not page aligned to begin w/ the ui32RealByteSize +could actually be rounded up to next+1 page boundary. Causing an +error to be returned from drm_gem_mmap() later when userspace attempts +to mmap() the buffer. +--- + services4/srvkm/env/linux/mmap.c | 10 +++++----- + 1 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/services4/srvkm/env/linux/mmap.c b/services4/srvkm/env/linux/mmap.c +index ca38e5d..5835594 100644 +--- a/services4/srvkm/env/linux/mmap.c ++++ b/services4/srvkm/env/linux/mmap.c +@@ -420,6 +420,10 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc, + + psLinuxMemArea = (LinuxMemArea *)hOSMemHandle; + ++ DetermineUsersSizeAndByteOffset(psLinuxMemArea, ++ pui32RealByteSize, ++ pui32ByteOffset); ++ + #if defined(SUPPORT_DRI_DRM_EXTERNAL) + /* if we are using DRM/GEM, then let GEM generate the buffer offset.. + * this is done by creating a wrapper object. +@@ -430,7 +434,7 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc, + if (!buf) + { + buf = create_gem_wrapper(psEnvPerProc->dev, +- psLinuxMemArea, 0, psLinuxMemArea->ui32ByteSize); ++ psLinuxMemArea, 0, *pui32RealByteSize); + if (!buf) + { + PVR_DPF((PVR_DBG_ERROR, "%s: Screw you guys, I'm going home..", __FUNCTION__)); +@@ -442,10 +446,6 @@ PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc, + } + #endif /* SUPPORT_DRI_DRM_EXTERNAL */ + +- DetermineUsersSizeAndByteOffset(psLinuxMemArea, +- pui32RealByteSize, +- pui32ByteOffset); +- + psOffsetStruct = FindOffsetStructByPID(psLinuxMemArea, psPerProc->ui32PID); + if (psOffsetStruct) + { +-- +1.7.4.1 + |