aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-12-09 10:37:32 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-09 10:37:32 +0000
commit9045022cb130078ac0b11296966d83ea7ea7d2dd (patch)
treeebfcad280813a123c14510c3f839560d31391068
parent2e270a17e0ecab878ab1c4c93eac5718a106d331 (diff)
downloadmrst-s0i3-test-9045022cb130078ac0b11296966d83ea7ea7d2dd.tar.gz
mrst-s0i3-test-9045022cb130078ac0b11296966d83ea7ea7d2dd.tar.xz
mrst-s0i3-test-9045022cb130078ac0b11296966d83ea7ea7d2dd.zip
ce4100: Fixes for 2.6.37-rc2
Keep up with the removal of the map functions. Clean up the resman mutex Signed-off-by: Alan Cox <alan@linux.intel.com>
-rwxr-xr-xdrivers/staging/ice4100/sgx535/common/resman.c68
-rwxr-xr-xdrivers/staging/ice4100/sgx535/pvr_drm.c2
2 files changed, 19 insertions, 51 deletions
diff --git a/drivers/staging/ice4100/sgx535/common/resman.c b/drivers/staging/ice4100/sgx535/common/resman.c
index ad749199b31..8bf4b3034dc 100755
--- a/drivers/staging/ice4100/sgx535/common/resman.c
+++ b/drivers/staging/ice4100/sgx535/common/resman.c
@@ -27,42 +27,12 @@
#include "services_headers.h"
#include "resman.h"
-#ifdef __linux__
-#ifndef AUTOCONF_INCLUDED
-#include <linux/config.h>
-#endif
-
#include <linux/version.h>
#include <linux/sched.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9)
#include <linux/hardirq.h>
-#else
-#include <asm/hardirq.h>
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
-#include <linux/semaphore.h>
-#else
-#include <asm/semaphore.h>
-#endif
-
-static DECLARE_MUTEX(lock);
+#include <linux/mutex.h>
-#define ACQUIRE_SYNC_OBJ do { \
- if (in_interrupt()) { \
- printk ("ISR cannot take RESMAN mutex\n"); \
- BUG(); \
- } \
- else down (&lock); \
-} while (0)
-#define RELEASE_SYNC_OBJ up (&lock)
-
-#else
-
-#define ACQUIRE_SYNC_OBJ
-#define RELEASE_SYNC_OBJ
-
-#endif
+static DEFINE_MUTEX(lock);
#define RESMAN_SIGNATURE 0x12345678
@@ -164,7 +134,8 @@ PVRSRV_ERROR PVRSRVResManConnect(void *hPerProc,
PVRSRV_ERROR eError;
PRESMAN_CONTEXT psResManContext;
- ACQUIRE_SYNC_OBJ;
+
+ mutex_lock(&lock);
VALIDATERESLIST();
@@ -177,7 +148,7 @@ PVRSRV_ERROR PVRSRVResManConnect(void *hPerProc,
VALIDATERESLIST();
- RELEASE_SYNC_OBJ;
+ mutex_unlock(&lock);
return eError;
}
@@ -191,7 +162,7 @@ PVRSRV_ERROR PVRSRVResManConnect(void *hPerProc,
VALIDATERESLIST();
- RELEASE_SYNC_OBJ;
+ mutex_unlock(&lock);
*phResManContext = psResManContext;
@@ -201,8 +172,8 @@ PVRSRV_ERROR PVRSRVResManConnect(void *hPerProc,
void PVRSRVResManDisconnect(PRESMAN_CONTEXT psResManContext, int bKernelContext)
{
- ACQUIRE_SYNC_OBJ;
-
+ mutex_lock(&lock);
+
VALIDATERESLIST();
PRINT_RESLIST(gpsResList, psResManContext, 1);
@@ -272,7 +243,7 @@ void PVRSRVResManDisconnect(PRESMAN_CONTEXT psResManContext, int bKernelContext)
PRINT_RESLIST(gpsResList, psResManContext, 0);
- RELEASE_SYNC_OBJ;
+ mutex_unlock(&lock);
}
PRESMAN_ITEM ResManRegisterRes(PRESMAN_CONTEXT psResManContext,
@@ -291,7 +262,7 @@ PRESMAN_ITEM ResManRegisterRes(PRESMAN_CONTEXT psResManContext,
return (PRESMAN_ITEM) NULL;
}
- ACQUIRE_SYNC_OBJ;
+ mutex_lock(&lock);
VALIDATERESLIST();
@@ -307,7 +278,7 @@ PRESMAN_ITEM ResManRegisterRes(PRESMAN_CONTEXT psResManContext,
PVR_DPF((PVR_DBG_ERROR, "ResManRegisterRes: "
"ERROR allocating new resource item"));
- RELEASE_SYNC_OBJ;
+ mutex_unlock(&lock);
return ((PRESMAN_ITEM) NULL);
}
@@ -325,7 +296,7 @@ PRESMAN_ITEM ResManRegisterRes(PRESMAN_CONTEXT psResManContext,
VALIDATERESLIST();
- RELEASE_SYNC_OBJ;
+ mutex_unlock(&lock);
return (psNewResItem);
}
@@ -345,7 +316,7 @@ PVRSRV_ERROR ResManFreeResByPtr(RESMAN_ITEM * psResItem)
PVR_DPF((PVR_DBG_MESSAGE,
"ResManFreeResByPtr: freeing resource at %08X", psResItem));
- ACQUIRE_SYNC_OBJ;
+ mutex_lock(&lock);
VALIDATERESLIST();
@@ -353,7 +324,7 @@ PVRSRV_ERROR ResManFreeResByPtr(RESMAN_ITEM * psResItem)
VALIDATERESLIST();
- RELEASE_SYNC_OBJ;
+ mutex_unlock(&lock);
return (eError);
}
@@ -367,7 +338,7 @@ PVRSRV_ERROR ResManFreeResByCriteria(PRESMAN_CONTEXT psResManContext,
PVR_ASSERT(psResManContext != NULL);
- ACQUIRE_SYNC_OBJ;
+ mutex_lock(&lock);
VALIDATERESLIST();
@@ -381,7 +352,7 @@ PVRSRV_ERROR ResManFreeResByCriteria(PRESMAN_CONTEXT psResManContext,
VALIDATERESLIST();
- RELEASE_SYNC_OBJ;
+ mutex_unlock(&lock);
return eError;
}
@@ -451,7 +422,6 @@ PVRSRV_ERROR ResManFindResourceByPtr(PRESMAN_CONTEXT
PVR_ASSERT(psItem->ui32Signature == RESMAN_SIGNATURE);
#endif
- ACQUIRE_SYNC_OBJ;
PVR_DPF((PVR_DBG_MESSAGE,
"FindResourceByPtr: psItem=%08X, psItem->psNext=%08X",
@@ -472,7 +442,7 @@ PVRSRV_ERROR ResManFindResourceByPtr(PRESMAN_CONTEXT
eResult = PVRSRV_ERROR_NOT_OWNER;
}
- RELEASE_SYNC_OBJ;
+ mutex_unlock(&lock);
return eResult;
}
@@ -505,7 +475,7 @@ static PVRSRV_ERROR FreeResourceByPtr(RESMAN_ITEM * psItem,
List_RESMAN_ITEM_Remove(psItem);
- RELEASE_SYNC_OBJ;
+ mutex_unlock(&lock);
if (bExecuteCallback) {
eError =
@@ -516,7 +486,7 @@ static PVRSRV_ERROR FreeResourceByPtr(RESMAN_ITEM * psItem,
}
}
- ACQUIRE_SYNC_OBJ;
+ mutex_lock(&lock);
if (OSFreeMem
(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RESMAN_ITEM), psItem,
diff --git a/drivers/staging/ice4100/sgx535/pvr_drm.c b/drivers/staging/ice4100/sgx535/pvr_drm.c
index c89ef52cb8c..9e8ddc915c6 100755
--- a/drivers/staging/ice4100/sgx535/pvr_drm.c
+++ b/drivers/staging/ice4100/sgx535/pvr_drm.c
@@ -251,8 +251,6 @@ static struct drm_driver sPVRDrmDriver = {
.postclose = PVRSRVDrmPostClose,
.suspend = PVRSRVDriverSuspend,
.resume = PVRSRVDriverResume,
- .get_map_ofs = drm_core_get_map_ofs,
- .get_reg_ofs = drm_core_get_reg_ofs,
.ioctls = sPVRDrmIoctls,
.fops = {
.owner = THIS_MODULE,