1.6.16.4117/4.04.00.02
authorImagination Technologies/TI <imgtec>
Mon, 11 Feb 2013 00:20:46 +0000 (02:20 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Mon, 11 Feb 2013 00:20:46 +0000 (02:20 +0200)
services4/3rdparty/dc_ti81xx_linux/Kbuild
services4/3rdparty/dc_ti81xx_linux/omaplfb_linux.c
services4/system/ti81xx/sysutils_linux_wqueue_compat.c

index 921e403..8ac212e 100644 (file)
@@ -9,7 +9,6 @@ SYS_CFLAGS.$(SUPPORT_TI_DSS_FW)                         += -DSUPPORT_TI_DSS_FW
 SYS_CFLAGS.$(PVR_LINUX_USING_WORKQUEUES)             += -DPVR_LINUX_USING_WORKQUEUES
 SYS_CFLAGS += -DDISPLAY_CONTROLLER=omaplfb
 
-
 EXTRA_CFLAGS = -DLINUX \
                -DCONFIG_OMAP2_DSS \
                -I$(PVR_BUILD_DIR)/include4 \
index 27cb1db..619624c 100644 (file)
 #include <linux/workqueue.h>
 #include <linux/fb.h>
 #include <linux/console.h>
-//#include <linux/omapfb.h>
-#include <linux/ti81xxfb.h>
+// #include <linux/omapfb.h>
 #include <linux/mutex.h>
 
+# include <plat/ti81xx-vpss.h>
+# include <plat/vrfb.h>
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
 #define PVR_OMAPFB3_NEEDS_PLAT_VRFB_H
 #endif
@@ -66,7 +67,6 @@
 #undef DEBUG
 #endif
 //#include <omapfb/omapfb.h>
-#include <../drivers/video/ti81xx/ti81xxfb/fbpriv.h>
 #if defined(DEBUG)
 #undef DEBUG
 #endif
@@ -99,20 +99,12 @@ MODULE_SUPPORTED_DEVICE(DEVNAME);
 #define OMAP_DSS_MANAGER(man, dev) struct omap_overlay_manager *man = (dev) != NULL ? (dev)->manager : NULL
 #define        WAIT_FOR_VSYNC(man)     ((man)->wait_for_vsync)
 #else
-#define OMAP_DSS_DRIVER(drv, dev) struct ti81xxfb_device  *drv = (dev)
-#define OMAP_DSS_MANAGER(man, dev) struct ti81xxfb_device *man = (dev)
+#define OMAP_DSS_DRIVER(drv, dev) struct omap_dss_device *drv = (dev)
+#define OMAP_DSS_MANAGER(man, dev) struct omap_dss_device *man = (dev)
 #define        WAIT_FOR_VSYNC(man)     ((man)->wait_vsync)
 #endif
 #endif
 
-
-#define OMAP_DSS_DRIVER(drv, dev) struct ti81xxfb_device  *drv = (dev)
-#define OMAP_DSS_MANAGER(man, dev) struct ti81xxfb_device *man = (dev)
-#define WAIT_FOR_VSYNC(man)     ((man)->wait_vsync)
-
-
-
-
 void *OMAPLFBAllocKernelMem(unsigned long ulSize)
 {
        return kmalloc(ulSize, GFP_KERNEL);
@@ -217,11 +209,11 @@ static void WorkQueueHandler(struct work_struct *psWork)
 }
 
 OMAPLFB_ERROR OMAPLFBCreateSwapQueue(OMAPLFB_SWAPCHAIN *psSwapChain)
-{      
+{
 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34))
         psSwapChain->psWorkQueue = __create_workqueue(DEVNAME, 1, 1, 1);
-#else
-psSwapChain->psWorkQueue = create_workqueue(DEVNAME);
+#else  
+       psSwapChain->psWorkQueue = create_workqueue(DEVNAME);
 #endif
        if (psSwapChain->psWorkQueue == NULL)
        {
@@ -277,6 +269,7 @@ void OMAPLFBFlip(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_BUFFER *psBuffer)
                res = fb_pan_display(psDevInfo->psLINFBInfo, &sFBVar);
                if (res != 0)
                {
+                        printk (" fb_pan api failed \n");
                        printk(KERN_INFO DRIVER_PREFIX ": %s: Device %u: fb_pan_display failed (Y Offset: %lu, Error: %d)\n", __FUNCTION__, psDevInfo->uiFBDevID, psBuffer->ulYOffset, res);
                }
        }
@@ -286,13 +279,8 @@ void OMAPLFBFlip(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_BUFFER *psBuffer)
 
 OMAPLFB_UPDATE_MODE OMAPLFBGetUpdateMode(OMAPLFB_DEVINFO *psDevInfo)
 {
-
 #if 0
-
- //    struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo);
-       
-        struct ti81xxfb_device *psDSSDev = FB2TFB(psDevInfo->psLINFBInfo);
-
+       struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo);
        OMAP_DSS_DRIVER(psDSSDrv, psDSSDev);
 
        enum omap_dss_update_mode eMode;
@@ -319,19 +307,14 @@ OMAPLFB_UPDATE_MODE OMAPLFBGetUpdateMode(OMAPLFB_DEVINFO *psDevInfo)
 
        return OMAPLFB_UPDATE_MODE_UNDEFINED;
 #endif
-
-return OMAPLFB_UPDATE_MODE_AUTO;
+        return OMAPLFB_UPDATE_MODE_AUTO;
 }
 
 OMAPLFB_BOOL OMAPLFBSetUpdateMode(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_UPDATE_MODE eMode)
 {
-
 #if 0
-//     struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo);
-
-        struct ti81xxfb_device *psDSSDev = FB2TFB(psDevInfo->psLINFBInfo);
-       
-        OMAP_DSS_DRIVER(psDSSDrv, psDSSDev);
+       struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo);
+       OMAP_DSS_DRIVER(psDSSDrv, psDSSDev);
        enum omap_dss_update_mode eDSSMode;
        int res;
 
@@ -365,17 +348,14 @@ OMAPLFB_BOOL OMAPLFBSetUpdateMode(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_UPDATE_MOD
 
        return (res == 0);
 #endif
-return 1;
+        return 1;
 }
 
 OMAPLFB_BOOL OMAPLFBWaitForVSync(OMAPLFB_DEVINFO *psDevInfo)
 {
-#if 0
-
-//     struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo);
-
-        struct ti81xxfb_device *psDSSDev = FB2TFB(psDevInfo->psLINFBInfo);
 
+#if 0
+       struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo);
        OMAP_DSS_MANAGER(psDSSMan, psDSSDev);
 
        if (psDSSMan != NULL && WAIT_FOR_VSYNC(psDSSMan) != NULL)
@@ -387,26 +367,47 @@ OMAPLFB_BOOL OMAPLFBWaitForVSync(OMAPLFB_DEVINFO *psDevInfo)
                        return OMAPLFB_FALSE;
                }
        }
-
 #endif
-
+#if 0
         struct vps_grpx_ctrl *gctrl;
-        int r = 0;
-        struct ti81xxfb_info *ofbi;
-
-        ofbi = FB2TFB(psDevInfo->psLINFBInfo);
-
-        gctrl = ofbi->gctrl;
-        r = gctrl->wait_for_vsync(gctrl); 
-
-       return OMAPLFB_TRUE;
+        int r;
+        gctrl = vps_grpx_get_ctrl(psDevInfo->uiFBDevID); 
+        printk (" BVSYNC \n");
+        r = gctrl->wait_for_vsync(gctrl);
+        printk (" AVSYNC: %d\n", vsync_num++);
+        return OMAPLFB_TRUE;
+#endif
+//    unsigned long timeout = msecs_to_jiffies(500);
+
+#if FBDEV_PRESENT
+      int r;
+
+      void grpx_irq_wait_handler(void *data)
+      {
+          complete((struct completion *)data);
+      }
+      DECLARE_COMPLETION_ONSTACK(completion);
+
+      if (vps_grpx_register_isr ((vsync_callback_t)grpx_irq_wait_handler, &completion, psDevInfo->uiFBDevID) != 0)
+      {
+          printk (KERN_WARNING DRIVER_PREFIX ": Failed to register for vsync call back\n");
+          return OMAPLFB_FALSE;
+      }
+//    timeout = wait_for_completion_interruptible_timeout(&completion, timeout);
+      r = wait_for_completion_interruptible(&completion);
+      if (vps_grpx_unregister_isr((vsync_callback_t)grpx_irq_wait_handler , &completion, psDevInfo->uiFBDevID) != 0)
+      {
+          printk (KERN_WARNING DRIVER_PREFIX ": Failed to un-register for vsync call back\n");
+          return OMAPLFB_FALSE;
+      }
+#endif
+      return OMAPLFB_TRUE;
 }
 
 OMAPLFB_BOOL OMAPLFBManualSync(OMAPLFB_DEVINFO *psDevInfo)
 {
 #if 0
-//     struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo);
-        struct ti81xxfb_device *psDSSDev = FB2TFB(psDevInfo->psLINFBInfo);
+       struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo);
        OMAP_DSS_DRIVER(psDSSDrv, psDSSDev);
 
        if (psDSSDrv != NULL && psDSSDrv->sync != NULL)
@@ -418,7 +419,6 @@ OMAPLFB_BOOL OMAPLFBManualSync(OMAPLFB_DEVINFO *psDevInfo)
                        return OMAPLFB_FALSE;
                }
        }
-printk (" OMAPLFBManualSync Not Supported \n");
 #endif
 
        return OMAPLFB_TRUE;
@@ -489,7 +489,6 @@ OMAPLFB_ERROR OMAPLFBUnblankDisplay(OMAPLFB_DEVINFO *psDevInfo)
 {
        int res;
 #ifdef FBDEV_PRESENT
-
        acquire_console_sem();
        res = fb_blank(psDevInfo->psLINFBInfo, 0);
        release_console_sem();
@@ -499,8 +498,8 @@ OMAPLFB_ERROR OMAPLFBUnblankDisplay(OMAPLFB_DEVINFO *psDevInfo)
                        ": %s: Device %u: fb_blank failed (%d)\n", __FUNCTION__, psDevInfo->uiFBDevID, res);
                return (OMAPLFB_ERROR_GENERIC);
        }
-
 #endif
+
        return (OMAPLFB_OK);
 }
 
@@ -633,7 +632,7 @@ static OMAPLFB_DEVINFO *OMAPLFBPVRDevIDToDevInfo(unsigned uiPVRDevID)
        return NULL;
 }
 
-int PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Ioctl)(struct drm_device unref__ *dev, void *arg, struct drm_file unref__ *pFile)
+int PVR_DRM_MAKENAME(omaplfb, _Ioctl)(struct drm_device unref__ *dev, void *arg, struct drm_file unref__ *pFile)
 {
        uint32_t *puiArgs;
        uint32_t uiCmd;
@@ -761,7 +760,7 @@ int PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Ioctl)(struct drm_device unref__ *dev,
 #endif
 
 #if defined(SUPPORT_DRI_DRM)
-int PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Init)(struct drm_device unref__ *dev)
+int PVR_DRM_MAKENAME(omaplfb, _Init)(struct drm_device unref__ *dev)
 #else
 static int __init OMAPLFB_Init(void)
 #endif
@@ -778,7 +777,7 @@ static int __init OMAPLFB_Init(void)
 }
 
 #if defined(SUPPORT_DRI_DRM)
-void PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Cleanup)(struct drm_device unref__ *dev)
+void PVR_DRM_MAKENAME(omaplfb, _Cleanup)(struct drm_device unref__ *dev)
 #else
 static void __exit OMAPLFB_Cleanup(void)
 #endif
index f6c3849..9fe7dfe 100644 (file)
@@ -272,7 +272,7 @@ PVRSRV_ERROR EnableSystemClocks(SYS_DATA *psSysData)
        SYS_SPECIFIC_DATA *psSysSpecData = (SYS_SPECIFIC_DATA *) psSysData->pvSysSpecificData;
        struct clk *psCLK;
 //     IMG_INT res;
-        IMG_BOOL bPowerLock;
+//      IMG_BOOL bPowerLock;
        PVRSRV_ERROR eError;
 
 #if defined(DEBUG) || defined(TIMING)