]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/device-ti-proprietary-open.git/blobdiff - jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c
jacinto6: sgx: update DDK version to 1.12/2701748
[android-sdk/device-ti-proprietary-open.git] / jacinto6 / sgx_src / eurasia_km / services4 / srvkm / env / linux / module.c
index 6d50cdbccc86592a3e78f332a82fc90c866adbbe..a86de684c0a172647ebd46e7b3f62444710300e4 100644 (file)
@@ -83,7 +83,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/fs.h>
-#include <linux/proc_fs.h>
 
 #ifdef CONFIG_OF
 #include <linux/of.h>
@@ -133,6 +132,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "lock.h"
 #include "linkage.h"
 #include "buffer_manager.h"
+#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC)
+#include "pvr_sync.h"
+#endif
+
+#if defined(SUPPORT_PVRSRV_ANDROID_SYSTRACE)
+#include "systrace.h"
+#endif
 
 #if defined(SUPPORT_DRI_DRM)
 #include "pvr_drm.h"
@@ -164,19 +170,16 @@ module_param(gPVRDebugLevel, uint, 0644);
 MODULE_PARM_DESC(gPVRDebugLevel, "Sets the level of debug output (default 0x7)");
 #endif /* defined(PVRSRV_NEED_PVR_DPF) */
 
-#if defined(CONFIG_ION_OMAP)
-#include <linux/ion.h>
-#include <linux/omap_ion.h>
-#include "ion.h"
-extern void omap_ion_register_pvr_export(void *);
-extern struct ion_device *omap_ion_device;
-struct ion_client *gpsIONClient;
-EXPORT_SYMBOL(gpsIONClient);
-#endif /* defined(CONFIG_ION_OMAP) */
+/* Newer kernels no longer support __devinitdata */
+#if !defined(__devinitdata)
+#define __devinitdata
+#endif
 
+#if defined(SUPPORT_PVRSRV_DEVICE_CLASS)
 /* PRQA S 3207 2 */ /* ignore 'not used' warning */
 EXPORT_SYMBOL(PVRGetDisplayClassJTable);
 EXPORT_SYMBOL(PVRGetBufferClassJTable);
+#endif /* defined(SUPPORT_PVRSRV_DEVICE_CLASS) */
 
 #if defined(PVR_LDM_DEVICE_CLASS) && !defined(SUPPORT_DRI_DRM)
 /*
@@ -260,11 +263,7 @@ MODULE_DEVICE_TABLE(pci, powervr_id_table);
 #endif
 
 #if defined(PVR_USE_PRE_REGISTERED_PLATFORM_DEV)
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
 static struct platform_device_id powervr_id_table[] __devinitdata = {
-#else
-static struct platform_device_id powervr_id_table[] = {
-#endif
        {SYS_SGX_DEV_NAME, 0},
        {}
 };
@@ -374,17 +373,6 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device
                }
        }
 
-#if defined(CONFIG_ION_OMAP)
-       gpsIONClient = ion_client_create(omap_ion_device,
-                       "pvr");
-       if (IS_ERR_OR_NULL(gpsIONClient))
-       {
-               PVR_DPF((PVR_DBG_ERROR, "PVRSRVDriverProbe: Couldn't create ion client"));
-               return PTR_ERR(gpsIONClient);
-       }
-       omap_ion_register_pvr_export(&PVRSRVExportFDToIONHandles);
-#endif /* defined(CONFIG_ION_OMAP) */
-
        return 0;
 }
 
@@ -419,11 +407,6 @@ static void __devexit PVRSRVDriverRemove(LDM_DEV *pDevice)
 
        PVR_TRACE(("PVRSRVDriverRemove(pDevice=%p)", pDevice));
 
-#if defined(CONFIG_ION_OMAP)
-       ion_client_destroy(gpsIONClient);
-       gpsIONClient = IMG_NULL;
-#endif
-
        SysAcquireData(&psSysData);
        
 #if defined(DEBUG) && defined(PVR_MANUAL_POWER_CONTROL)
@@ -725,10 +708,10 @@ void ProcSeqShowPowerLevel(struct seq_file *sfile,void* el)
 
  @Description
 
- Release access the PVR services node - called when a file is closed, whether
- at exit or using close(2) system call.
+ Open the PVR services node - called when the relevant device node is open()ed.
 
  @input pInode - the inode for the file being openeded
+ @input dev    - the DRM device corresponding to this driver.
 
  @input pFile - the file handle data for the actual file being opened
 
@@ -775,11 +758,7 @@ static int PVRSRVOpen(struct inode unref__ * pInode, struct file *pFile)
        if(eError != PVRSRV_OK)
                goto err_unlock;
 
-#if defined (SUPPORT_SID_INTERFACE)
-       psPrivateData->hKernelMemInfo = 0;
-#else
        psPrivateData->hKernelMemInfo = NULL;
-#endif
 #if defined(SUPPORT_DRI_DRM) && defined(PVR_SECURE_DRM_AUTH_EXPORT)
        psPrivateData->psDRMFile = pFile;
 
@@ -941,6 +920,8 @@ static int __init PVRCore_Init(void)
        struct device *psDev;
 #endif
 
+
+
 #if !defined(SUPPORT_DRI_DRM)
        /*
         * Must come before attempting to print anything via Services.
@@ -976,6 +957,7 @@ static int __init PVRCore_Init(void)
        }
 
        LinuxBridgeInit();
+       
 
        PVRMMapInit();
 
@@ -1070,6 +1052,13 @@ static int __init PVRCore_Init(void)
 #endif /* defined(PVR_LDM_DEVICE_CLASS) */
 #endif /* !defined(SUPPORT_DRI_DRM) */
 
+#if defined(SUPPORT_PVRSRV_ANDROID_SYSTRACE)
+       SystraceCreateFS();
+#endif
+
+#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC)
+       PVRSyncDeviceInit();
+#endif
        return 0;
 
 #if !defined(SUPPORT_DRI_DRM)
@@ -1079,6 +1068,8 @@ destroy_class:
 unregister_device:
        unregister_chrdev((IMG_UINT)AssignedMajorNumber, DEVNAME);
 #endif
+#endif
+#if !defined(SUPPORT_DRI_DRM)
 sys_deinit:
 #endif
 #if defined(PVR_LDM_MODULE)
@@ -1111,7 +1102,6 @@ init_failed:
        LinuxBridgeDeInit();
        PVROSFuncDeInit();
        RemoveProcEntries();
-
        return error;
 
 } /*PVRCore_Init*/
@@ -1157,6 +1147,10 @@ static void __exit PVRCore_Cleanup(void)
        SysAcquireData(&psSysData);
 #endif
 
+#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC)
+       PVRSyncDeviceDeInit();
+#endif
+
 #if !defined(SUPPORT_DRI_DRM)
 
 #if defined(PVR_LDM_DEVICE_CLASS)
@@ -1215,6 +1209,10 @@ static void __exit PVRCore_Cleanup(void)
 
        RemoveProcEntries();
 
+#if defined(SUPPORT_PVRSRV_ANDROID_SYSTRACE)
+       SystraceDestroyFS();
+#endif
+
        PVR_TRACE(("PVRCore_Cleanup: unloading"));
 }