diff options
Diffstat (limited to 'drivers/gpu/pvr/module.c')
-rw-r--r-- | drivers/gpu/pvr/module.c | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/drivers/gpu/pvr/module.c b/drivers/gpu/pvr/module.c index d0c6eb14e3d..c9fc0cf44e5 100644 --- a/drivers/gpu/pvr/module.c +++ b/drivers/gpu/pvr/module.c | |||
@@ -47,8 +47,6 @@ | |||
47 | #include <linux/version.h> | 47 | #include <linux/version.h> |
48 | #include <linux/fs.h> | 48 | #include <linux/fs.h> |
49 | #include <linux/proc_fs.h> | 49 | #include <linux/proc_fs.h> |
50 | #include <linux/pm_runtime.h> | ||
51 | #include <plat/gpu.h> | ||
52 | 50 | ||
53 | #if defined(SUPPORT_DRI_DRM) | 51 | #if defined(SUPPORT_DRI_DRM) |
54 | #include <drm/drmP.h> | 52 | #include <drm/drmP.h> |
@@ -127,11 +125,11 @@ static int PVRSRVRelease(struct inode* pInode, struct file* pFile); | |||
127 | 125 | ||
128 | static struct file_operations pvrsrv_fops = | 126 | static struct file_operations pvrsrv_fops = |
129 | { | 127 | { |
130 | .owner = THIS_MODULE, | 128 | .owner=THIS_MODULE, |
131 | .unlocked_ioctl = PVRSRV_BridgeDispatchKM, | 129 | .unlocked_ioctl = PVRSRV_BridgeDispatchKM, |
132 | .open = PVRSRVOpen, | 130 | .open=PVRSRVOpen, |
133 | .release = PVRSRVRelease, | 131 | .release=PVRSRVRelease, |
134 | .mmap = PVRMMap, | 132 | .mmap=PVRMMap, |
135 | }; | 133 | }; |
136 | #endif | 134 | #endif |
137 | 135 | ||
@@ -201,9 +199,24 @@ static LDM_DRV powervr_driver = { | |||
201 | .shutdown = PVRSRVDriverShutdown, | 199 | .shutdown = PVRSRVDriverShutdown, |
202 | }; | 200 | }; |
203 | 201 | ||
204 | struct gpu_platform_data *gpsSgxPlatformData; | ||
205 | LDM_DEV *gpsPVRLDMDev; | 202 | LDM_DEV *gpsPVRLDMDev; |
206 | 203 | ||
204 | #if defined(MODULE) && defined(PVR_LDM_PLATFORM_MODULE) | ||
205 | |||
206 | static IMG_VOID PVRSRVDeviceRelease(struct device unref__ *pDevice) | ||
207 | { | ||
208 | } | ||
209 | |||
210 | static struct platform_device powervr_device = { | ||
211 | .name = DEVNAME, | ||
212 | .id = -1, | ||
213 | .dev = { | ||
214 | .release = PVRSRVDeviceRelease | ||
215 | } | ||
216 | }; | ||
217 | |||
218 | #endif | ||
219 | |||
207 | #if defined(PVR_LDM_PLATFORM_MODULE) | 220 | #if defined(PVR_LDM_PLATFORM_MODULE) |
208 | static int PVRSRVDriverProbe(LDM_DEV *pDevice) | 221 | static int PVRSRVDriverProbe(LDM_DEV *pDevice) |
209 | #endif | 222 | #endif |
@@ -221,16 +234,8 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device | |||
221 | { | 234 | { |
222 | return -EINVAL; | 235 | return -EINVAL; |
223 | } | 236 | } |
224 | #endif | 237 | #endif |
225 | |||
226 | gpsSgxPlatformData = pDevice->dev.platform_data; | ||
227 | if(!gpsSgxPlatformData) | ||
228 | { | ||
229 | PVR_TRACE(("No SGX platform device data.")); | ||
230 | } | ||
231 | 238 | ||
232 | pm_runtime_enable(&pDevice->dev); | ||
233 | |||
234 | psSysData = SysAcquireDataNoCheck(); | 239 | psSysData = SysAcquireDataNoCheck(); |
235 | if ( psSysData == IMG_NULL) | 240 | if ( psSysData == IMG_NULL) |
236 | { | 241 | { |
@@ -269,8 +274,6 @@ static void __devexit PVRSRVDriverRemove(LDM_DEV *pDevice) | |||
269 | } | 274 | } |
270 | #endif | 275 | #endif |
271 | (IMG_VOID)SysDeinitialise(psSysData); | 276 | (IMG_VOID)SysDeinitialise(psSysData); |
272 | |||
273 | pm_runtime_disable(&pDevice->dev); | ||
274 | 277 | ||
275 | gpsPVRLDMDev = IMG_NULL; | 278 | gpsPVRLDMDev = IMG_NULL; |
276 | 279 | ||
@@ -425,7 +428,9 @@ static int PVRSRVOpen(struct inode unref__ * pInode, struct file *pFile) | |||
425 | if(eError != PVRSRV_OK) | 428 | if(eError != PVRSRV_OK) |
426 | goto err_unlock; | 429 | goto err_unlock; |
427 | 430 | ||
428 | #if defined(PVR_SECURE_FD_EXPORT) | 431 | #if defined (SUPPORT_SID_INTERFACE) |
432 | psPrivateData->hKernelMemInfo = 0; | ||
433 | #else | ||
429 | psPrivateData->hKernelMemInfo = NULL; | 434 | psPrivateData->hKernelMemInfo = NULL; |
430 | #endif | 435 | #endif |
431 | #if defined(SUPPORT_DRI_DRM) && defined(PVR_SECURE_DRM_AUTH_EXPORT) | 436 | #if defined(SUPPORT_DRI_DRM) && defined(PVR_SECURE_DRM_AUTH_EXPORT) |
@@ -464,7 +469,7 @@ static int PVRSRVRelease(struct inode unref__ * pInode, struct file *pFile) | |||
464 | list_del(&psPrivateData->sDRMAuthListItem); | 469 | list_del(&psPrivateData->sDRMAuthListItem); |
465 | #endif | 470 | #endif |
466 | 471 | ||
467 | 472 | ||
468 | gui32ReleasePID = psPrivateData->ui32OpenPID; | 473 | gui32ReleasePID = psPrivateData->ui32OpenPID; |
469 | PVRSRVProcessDisconnect(psPrivateData->ui32OpenPID); | 474 | PVRSRVProcessDisconnect(psPrivateData->ui32OpenPID); |
470 | gui32ReleasePID = 0; | 475 | gui32ReleasePID = 0; |
@@ -474,7 +479,7 @@ static int PVRSRVRelease(struct inode unref__ * pInode, struct file *pFile) | |||
474 | psPrivateData, psPrivateData->hBlockAlloc); | 479 | psPrivateData, psPrivateData->hBlockAlloc); |
475 | 480 | ||
476 | #if !defined(SUPPORT_DRI_DRM) | 481 | #if !defined(SUPPORT_DRI_DRM) |
477 | PRIVATE_DATA(pFile) = IMG_NULL; | 482 | PRIVATE_DATA(pFile) = IMG_NULL; |
478 | #endif | 483 | #endif |
479 | } | 484 | } |
480 | 485 | ||
@@ -541,6 +546,16 @@ static int __init PVRCore_Init(IMG_VOID) | |||
541 | goto init_failed; | 546 | goto init_failed; |
542 | } | 547 | } |
543 | 548 | ||
549 | #if defined(MODULE) | ||
550 | if ((error = platform_device_register(&powervr_device)) != 0) | ||
551 | { | ||
552 | platform_driver_unregister(&powervr_driver); | ||
553 | |||
554 | PVR_DPF((PVR_DBG_ERROR, "PVRCore_Init: unable to register platform device (%d)", error)); | ||
555 | |||
556 | goto init_failed; | ||
557 | } | ||
558 | #endif | ||
544 | #endif | 559 | #endif |
545 | 560 | ||
546 | #if defined(PVR_LDM_PCI_MODULE) | 561 | #if defined(PVR_LDM_PCI_MODULE) |
@@ -623,6 +638,9 @@ sys_deinit: | |||
623 | #endif | 638 | #endif |
624 | 639 | ||
625 | #if defined (PVR_LDM_PLATFORM_MODULE) | 640 | #if defined (PVR_LDM_PLATFORM_MODULE) |
641 | #if defined (MODULE) | ||
642 | platform_device_unregister(&powervr_device); | ||
643 | #endif | ||
626 | platform_driver_unregister(&powervr_driver); | 644 | platform_driver_unregister(&powervr_driver); |
627 | #endif | 645 | #endif |
628 | 646 | ||
@@ -689,6 +707,9 @@ static void __exit PVRCore_Cleanup(void) | |||
689 | #endif | 707 | #endif |
690 | 708 | ||
691 | #if defined (PVR_LDM_PLATFORM_MODULE) | 709 | #if defined (PVR_LDM_PLATFORM_MODULE) |
710 | #if defined (MODULE) | ||
711 | platform_device_unregister(&powervr_device); | ||
712 | #endif | ||
692 | platform_driver_unregister(&powervr_driver); | 713 | platform_driver_unregister(&powervr_driver); |
693 | #endif | 714 | #endif |
694 | 715 | ||