diff options
Diffstat (limited to 'drivers/gpu/pvr/module.c')
-rw-r--r-- | drivers/gpu/pvr/module.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/gpu/pvr/module.c b/drivers/gpu/pvr/module.c index cc9334b..37eb5cc 100644 --- a/drivers/gpu/pvr/module.c +++ b/drivers/gpu/pvr/module.c @@ -79,6 +79,10 @@ #include <asm/uaccess.h> #endif +#if defined(PVR_LDM_MODULE) || defined(PVR_DRI_DRM_PLATFORM_DEV) +#include <asm/atomic.h> +#endif + #include "img_defs.h" #include "services.h" #include "kerneldisplay.h" @@ -99,6 +103,7 @@ #include "private_data.h" #include "lock.h" #include "linkage.h" +#include "buffer_manager.h" #if defined(SUPPORT_DRI_DRM) #include "pvr_drm.h" @@ -347,9 +352,17 @@ void PVRSRVDriverShutdown(struct drm_device *pDevice) PVR_MOD_STATIC void PVRSRVDriverShutdown(LDM_DEV *pDevice) #endif { + static atomic_t sDriverIsShutdown = ATOMIC_INIT(1); + PVR_TRACE(("PVRSRVDriverShutdown(pDevice=%p)", pDevice)); - (void) PVRSRVSetPowerStateKM(PVRSRV_SYS_POWER_STATE_D3); + if (atomic_dec_and_test(&sDriverIsShutdown)) + { + + LinuxLockMutex(&gPVRSRVLock); + + (void) PVRSRVSetPowerStateKM(PVRSRV_SYS_POWER_STATE_D3); + } } #endif @@ -540,6 +553,12 @@ static int PVRSRVRelease(struct inode unref__ * pInode, struct file *pFile) } + if (psKernelMemInfo->sShareMemWorkaround.bInUse) + { + BM_XProcIndexRelease(psKernelMemInfo->sShareMemWorkaround.ui32ShareIndex); + } + + if(FreeMemCallBackCommon(psKernelMemInfo, 0, PVRSRV_FREE_CALLBACK_ORIGIN_EXTERNAL) != PVRSRV_OK) { |