[android-sdk/device-ti-proprietary-open.git] / jacinto6 / sgx_src / eurasia_km / services4 / srvkm / env / linux / module.c
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c
index 6d50cdbccc86592a3e78f332a82fc90c866adbbe..a86de684c0a172647ebd46e7b3f62444710300e4 100644 (file)
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/fs.h>
-#include <linux/proc_fs.h>
#ifdef CONFIG_OF
#include <linux/of.h>
#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"
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)
/*
#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;
}
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)
@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
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;
struct device *psDev;
#endif
+
+
#if !defined(SUPPORT_DRI_DRM)
/*
* Must come before attempting to print anything via Services.
}
LinuxBridgeInit();
+
PVRMMapInit();
#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)
unregister_device:
unregister_chrdev((IMG_UINT)AssignedMajorNumber, DEVNAME);
#endif
+#endif
+#if !defined(SUPPORT_DRI_DRM)
sys_deinit:
#endif
#if defined(PVR_LDM_MODULE)
LinuxBridgeDeInit();
PVROSFuncDeInit();
RemoveProcEntries();
-
return error;
} /*PVRCore_Init*/
SysAcquireData(&psSysData);
#endif
+#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC)
+ PVRSyncDeviceDeInit();
+#endif
+
#if !defined(SUPPORT_DRI_DRM)
#if defined(PVR_LDM_DEVICE_CLASS)
RemoveProcEntries();
+#if defined(SUPPORT_PVRSRV_ANDROID_SYSTRACE)
+ SystraceDestroyFS();
+#endif
+
PVR_TRACE(("PVRCore_Cleanup: unloading"));
}