1.9.19.2188537/4.08.00.02
authorImagination Technologies/TI <imgtec>
Mon, 11 Feb 2013 22:40:21 +0000 (00:40 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Mon, 11 Feb 2013 22:40:21 +0000 (00:40 +0200)
18 files changed:
include4/pvrversion.h
include4/services.h
include4/sgx_options.h
services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c
services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c
services4/3rdparty/dc_ti335x_linux/omaplfb_displayclass.c
services4/3rdparty/dc_ti81xx_linux/omaplfb_displayclass.c
services4/include/servicesint.h
services4/srvkm/bridged/sgx/bridged_sgx_bridge.c
services4/srvkm/common/buffer_manager.c
services4/srvkm/common/deviceclass.c
services4/srvkm/devices/sgx/sgxkick.c
services4/srvkm/env/linux/mmap.c
services4/srvkm/env/linux/osfunc.c
services4/srvkm/include/osfunc.h
services4/srvkm/include/pdump_osfunc.h
services4/srvkm/include/perfkm.h
services4/system/ti81xx/sysutils_linux.c

index 01212ad..cc327ae 100644 (file)
@@ -53,17 +53,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define PVRVERSION_BRANCH            19
 
 #define PVRVERSION_FAMILY           "sgxddk"
-#define PVRVERSION_BRANCHNAME       "1.9.RC2"
-#define PVRVERSION_BUILD             2139099
+#define PVRVERSION_BRANCHNAME       "1.9"
+#define PVRVERSION_BUILD             2188537
 #define PVRVERSION_BSCONTROL        "SGX_DDK_Linux_CustomerTI"
 
-#define PVRVERSION_STRING           "SGX_DDK_Linux_CustomerTI sgxddk 19 1.9.RC2@" PVR_STR2(PVRVERSION_BUILD)
-#define PVRVERSION_STRING_SHORT     "1.9.RC2@" PVR_STR2(PVRVERSION_BUILD)
+#define PVRVERSION_STRING           "SGX_DDK_Linux_CustomerTI sgxddk 19 1.9@" PVR_STR2(PVRVERSION_BUILD)
+#define PVRVERSION_STRING_SHORT     "1.9@" PVR_STR2(PVRVERSION_BUILD)
 
 #define COPYRIGHT_TXT               "Copyright (c) Imagination Technologies Ltd. All Rights Reserved."
 
-#define PVRVERSION_BUILD_HI          213
-#define PVRVERSION_BUILD_LO          9099
+#define PVRVERSION_BUILD_HI          218
+#define PVRVERSION_BUILD_LO          8537
 #define PVRVERSION_STRING_NUMERIC    PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO)
 
 #endif /* _PVRVERSION_H_ */
index a0b5986..5b927a7 100644 (file)
@@ -1485,7 +1485,7 @@ IMG_IMPORT IMG_VOID  IMG_CALLCONV PVRSRVFreeUserModeMemTracking(IMG_VOID *pvMem)
 
 IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem, IMG_SIZE_T ui32NewSize, 
                                                                                                          IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber);
-#endif /* defined(DEBUG) && (defined(__linux__) || defined(_UITRON_)) */
+#endif
 
 /******************************************************************************
  * PVR Event Object API(s)
index 619e6e7..b64cd39 100644 (file)
@@ -136,13 +136,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define OPTIONS_BIT11          0x0
 
-
-#if defined(SGX_FEATURE_OVERLAPPED_SPM) || defined (INTERNAL_TEST)
-#define SGX_FEATURE_OVERLAPPED_SPM_SET_OFFSET  OPTIONS_BIT12
-#define OPTIONS_BIT12          (0x1U << 12)
-#else
 #define OPTIONS_BIT12          0x0
-#endif /* SGX_FEATURE_RENDER_TARGET_ARRAYS */
 
 
 #if defined(SGX_FEATURE_SYSTEM_CACHE) || defined (INTERNAL_TEST)
index 085b5a1..0c77e94 100644 (file)
@@ -1306,7 +1306,7 @@ static OMAPLFB_ERROR OMAPLFBInitFBDev(OMAPLFB_DEVINFO *psDevInfo)
                           __FUNCTION__, uiFBDevID, n);
 
                /* INTEGRATION_POINT: limit to MAX 3 FBs to save TILER container space */
-               if (n > 3)
+               if (n != 3)
                        n = 3;
 
                sAllocData.w *= n;
index 1184fb6..08d8277 100644 (file)
@@ -281,7 +281,12 @@ OMAPLFB_ERROR OMAPLFBCreateSwapQueue(OMAPLFB_SWAPCHAIN *psSwapChain)
         * conditions, preventing the driver from holding on to
         * resources longer than it needs to.
         */
-       psSwapChain->psWorkQueue = alloc_ordered_workqueue(DEVNAME, WQ_FREEZEABLE | WQ_MEM_RECLAIM);
+#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,37))
+        psSwapChain->psWorkQueue = alloc_ordered_workqueue(DEVNAME, WQ_FREEZEABLE | WQ_MEM_RECLAIM);
+#else
+        psSwapChain->psWorkQueue = alloc_ordered_workqueue(DEVNAME, WQ_FREEZABLE | WQ_MEM_RECLAIM);
+#endif
+
 #else
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
        psSwapChain->psWorkQueue = create_freezable_workqueue(DEVNAME);
@@ -416,7 +421,7 @@ void OMAPLFBFlip(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_BUFFER *psBuffer)
 
        OMAPLFB_CONSOLE_UNLOCK();
 }
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
 #if !defined(PVR_OMAPLFB_DRM_FB) || defined(DEBUG)
 static OMAPLFB_BOOL OMAPLFBValidateDSSUpdateMode(enum omap_dss_update_mode eMode)
 {
@@ -483,7 +488,9 @@ static enum omap_dss_update_mode OMAPLFBToDSSUpdateMode(OMAPLFB_UPDATE_MODE eMod
        return -1;
 }
 
+#endif
 #if defined(DEBUG)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
 static const char *OMAPLFBUpdateModeToString(OMAPLFB_UPDATE_MODE eMode)
 {
        switch(eMode)
@@ -512,7 +519,7 @@ static const char *OMAPLFBDSSUpdateModeToString(enum omap_dss_update_mode eMode)
 
        return OMAPLFBUpdateModeToString(OMAPLFBFromDSSUpdateMode(eMode));
 }
-
+#endif
 void OMAPLFBPrintInfo(OMAPLFB_DEVINFO *psDevInfo)
 {
 #if defined(PVR_OMAPLFB_DRM_FB)
@@ -548,7 +555,7 @@ void OMAPLFBPrintInfo(OMAPLFB_DEVINFO *psDevInfo)
 
        DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": Device %u: non-DRM framebuffer\n", psDevInfo->uiFBDevID));
 
-       DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": Device %u: %s\n", psDevInfo->uiFBDevID, OMAPLFBUpdateModeToString(eMode)));
+//     DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": Device %u: %s\n", psDevInfo->uiFBDevID, OMAPLFBUpdateModeToString(eMode)));
 #endif /* defined(PVR_OMAPLFB_DRM_FB) */
 }
 #endif /* defined(DEBUG) */
@@ -754,6 +761,7 @@ OMAPLFB_BOOL OMAPLFBWaitForVSync(OMAPLFB_DEVINFO *psDevInfo)
  */
 OMAPLFB_BOOL OMAPLFBManualSync(OMAPLFB_DEVINFO *psDevInfo)
 {
+#if 0
 #if defined(PVR_OMAPLFB_DRM_FB)
        struct drm_connector *psConnector;
 
@@ -784,6 +792,8 @@ OMAPLFB_BOOL OMAPLFBManualSync(OMAPLFB_DEVINFO *psDevInfo)
 
        return OMAPLFB_TRUE;
 #endif /* defined(PVR_OMAPLFB_DRM_FB) */
+#endif
+       return OMAPLFB_TRUE;
 }
 
 /*
index ec0b7c4..de04272 100644 (file)
@@ -1306,7 +1306,7 @@ static OMAPLFB_ERROR OMAPLFBInitFBDev(OMAPLFB_DEVINFO *psDevInfo)
                           __FUNCTION__, uiFBDevID, n);
 
                /* INTEGRATION_POINT: limit to MAX 3 FBs to save TILER container space */
-               if (n > 3)
+               if (n != 3)
                        n = 3;
 
                sAllocData.w *= n;
index ec0b7c4..de04272 100644 (file)
@@ -1306,7 +1306,7 @@ static OMAPLFB_ERROR OMAPLFBInitFBDev(OMAPLFB_DEVINFO *psDevInfo)
                           __FUNCTION__, uiFBDevID, n);
 
                /* INTEGRATION_POINT: limit to MAX 3 FBs to save TILER container space */
-               if (n > 3)
+               if (n != 3)
                        n = 3;
 
                sAllocData.w *= n;
index 32e19f9..cce0199 100644 (file)
@@ -49,7 +49,6 @@ extern "C" {
 
 #include "services.h"
 #include "sysinfo.h"
-#include "sysconfig.h"
 
 #define HWREC_DEFAULT_TIMEOUT  (500)
 
@@ -138,9 +137,7 @@ typedef struct _PVRSRV_KERNEL_MEM_INFO_
       To activate the "share mem workaround", add PVRSRV_MEM_XPROC to
       the flags for the allocation.  This will cause the "map" API to
       call use Alloc Device Mem but will share the underlying memory
-      block and sync data.  Note that this is a workaround for a bug
-      exposed by a specific use-case on a particular platform.  Do not
-      use this functionality generally.
+      block and sync data.
     */
        struct {
         /* Record whether the workaround is active for this
index d2ea7e1..bee5dc6 100644 (file)
@@ -609,7 +609,6 @@ SGXDoKickBW(IMG_UINT32 ui32BridgeID,
 
 PVRSRV_BRIDGE_SGX_DOKICK_RETURN_RESULT:
 
-//#if (!defined(_UITRON_) && !defined(UNDER_VISTA)) || defined (SUPPORT_SID_INTERFACE)
        if(phKernelSyncInfoHandles)
        {
                OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP,
@@ -3751,7 +3750,7 @@ SGXPDumpHWPerfCBBW(IMG_UINT32                                             ui32BridgeID,
        PVR_UNREFERENCED_PARAMETER(psRetOUT);
        PVR_UNREFERENCED_PARAMETER(psPerProc);
        return 0;
-#endif /* defined(LINUX) || defined(UNDER_XP) */
+#endif
 #else
        PVR_UNREFERENCED_PARAMETER(ui32BridgeID);
        PVR_UNREFERENCED_PARAMETER(psPDumpHWPerfCBIN);
index 8a459b1..1f7c444 100644 (file)
@@ -171,6 +171,12 @@ AllocMemory (BM_CONTEXT                    *pBMContext,
                                                                           ui32PrivDataLength,
                                                                           IMG_NULL);   /* We allocate VM space */
 
+                       if (!bSuccess)
+                       {
+                               PVR_DPF((PVR_DBG_ERROR, "AllocMemory: BM_ImportMemory failed"));
+                               return IMG_FALSE;
+                       }
+
                        if (puiActualSize != ui32ChunkSize * ui32NumPhysChunks)
                        {
                                /*
index 69e9deb..7d4db5b 100644 (file)
@@ -2115,6 +2115,15 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(IMG_HANDLE   hDeviceKM,
        psSwapChainRef = (PVRSRV_DC_SWAPCHAIN_REF*)hSwapChainRef;
        psSwapChain = psSwapChainRef->psSwapChain;
 
+       /*
+               If more then 1 reference to the swapchain exist then
+               ignore any request to swap to the system buffer
+       */
+       if (psSwapChain->ui32RefCount > 1)
+       {
+               return PVRSRV_OK;
+       }
+
        /* get the queue from the buffer structure */
        psQueue = psSwapChain->psQueue;
 
index a0f6fa9..584f538 100644 (file)
@@ -757,6 +757,24 @@ PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle, SGX_CCB_KICK *psCCBKick)
                }
 #endif/* SUPPORT_SGX_GENERALISED_SYNCOBJECTS */
 
+               if (psCCBKick->hTA3DSyncInfo)
+               {
+                       psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->hTA3DSyncInfo;
+                       psSyncInfo->psSyncData->ui32ReadOpsPending--;
+               }
+       
+               if (psCCBKick->hTASyncInfo)
+               {
+                       psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->hTASyncInfo;
+                       psSyncInfo->psSyncData->ui32ReadOpsPending--;
+               }
+       
+               if (psCCBKick->h3DSyncInfo)
+               {
+                       psSyncInfo = (PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->h3DSyncInfo;
+                       psSyncInfo->psSyncData->ui32ReadOpsPending--;
+               }
+
                PVR_TTRACE(PVRSRV_TRACE_GROUP_KICK, PVRSRV_TRACE_CLASS_FUNCTION_EXIT,
                                KICK_TOKEN_DOKICK);
                return eError;
index d088e06..ef725e2 100644 (file)
@@ -1005,6 +1005,7 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
     IMG_VOID *pvBase = IMG_NULL;
     int iRetVal = 0;
     IMG_UINT32 ui32ByteOffset = 0;     /* Keep compiler happy */
+    IMG_UINT32 ui32FlushSize = 0;
 
     PVR_UNREFERENCED_PARAMETER(pFile);
 
@@ -1110,16 +1111,28 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
     /* Compute the flush region (if necessary) inside the mmap mutex */
     if(psOffsetStruct->psLinuxMemArea->bNeedsCacheInvalidate)
     {
-        IMG_UINT32 ui32DummyByteSize;
+        psFlushMemArea = psOffsetStruct->psLinuxMemArea;
 
-        DetermineUsersSizeAndByteOffset(psOffsetStruct->psLinuxMemArea,
-                                        &ui32DummyByteSize,
-                                        &ui32ByteOffset);
+               /* Sparse mappings have to ask the BM for the virtual size */
+               if (psFlushMemArea->hBMHandle)
+               {
+                       pvBase = (IMG_VOID *)ps_vma->vm_start;
+                       ui32ByteOffset = 0;
+                       ui32FlushSize = BM_GetVirtualSize(psFlushMemArea->hBMHandle);
+               }
+               else
+               {
+               IMG_UINT32 ui32DummyByteSize;
 
-        pvBase = (IMG_VOID *)ps_vma->vm_start + ui32ByteOffset;
-        psFlushMemArea = psOffsetStruct->psLinuxMemArea;
+               DetermineUsersSizeAndByteOffset(psFlushMemArea,
+                                               &ui32DummyByteSize,
+                                               &ui32ByteOffset);
+       
+               pvBase = (IMG_VOID *)ps_vma->vm_start + ui32ByteOffset;
+               ui32FlushSize = psFlushMemArea->ui32ByteSize;
+               }
 
-        psOffsetStruct->psLinuxMemArea->bNeedsCacheInvalidate = IMG_FALSE;
+        psFlushMemArea->bNeedsCacheInvalidate = IMG_FALSE;
     }
 
     /* Call the open routine to increment the usage count */
@@ -1139,7 +1152,7 @@ unlock_and_return:
     if(psFlushMemArea)
     {
         OSInvalidateCPUCacheRangeKM(psFlushMemArea, ui32ByteOffset, pvBase,
-                                                                       psFlushMemArea->ui32ByteSize);
+                                                                       ui32FlushSize);
     }
 
     return iRetVal;
index 33658c1..8b9bf4f 100644 (file)
@@ -104,6 +104,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define ON_EACH_CPU(func, info, wait) on_each_cpu(func, info, 0, wait)
 #endif
 
+#if 0
 #if defined(PVR_LINUX_USING_WORKQUEUES) && !defined(CONFIG_PREEMPT)
 /* 
  * Services spins at certain points waiting for events (e.g. swap
@@ -112,7 +113,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  * Removing the need for CONFIG_PREEMPT will require adding preemption
  * points at various points in Services.
  */
-//#error "A preemptible Linux kernel is required when using workqueues"
+#error "A preemptible Linux kernel is required when using workqueues"
+#endif
 #endif
 
 #if defined(EMULATOR)
@@ -4003,7 +4005,14 @@ IMG_BOOL CheckExecuteCacheOp(IMG_HANDLE hOSMemHandle,
        psMMapOffsetStructList = &psLinuxMemArea->sMMapOffsetStructList;
        ui32AreaLength = psLinuxMemArea->ui32ByteSize;
 
-       PVR_ASSERT(ui32Length <= ui32AreaLength);
+       /*
+               Don't check the length in the case of sparse mappings as
+               we only know the physical length not the virtual
+       */
+       if (!psLinuxMemArea->hBMHandle)
+       {
+               PVR_ASSERT(ui32Length <= ui32AreaLength);
+       }
 
        if(psLinuxMemArea->eAreaType == LINUX_MEM_AREA_SUB_ALLOC)
        {
index 34d3367..b08985f 100644 (file)
@@ -62,7 +62,7 @@ extern "C" {
 
 
 /* setup conditional pageable / non-pageable select */
-       /* Non-Vista OSs only need pageable */
+       /* Other OSs only need pageable */
        #define PVRSRV_PAGEABLE_SELECT          PVRSRV_OS_PAGEABLE_HEAP
 
 /******************************************************************************
index fb5c7c3..0f2e103 100644 (file)
@@ -246,7 +246,6 @@ PVRSRV_ERROR PDumpOSBufprintf(IMG_HANDLE hBuf, IMG_UINT32 ui32ScriptSizeMax, IMG
 IMG_VOID PDumpOSDebugPrintf(IMG_CHAR* pszFormat, ...) IMG_FORMAT_PRINTF(1, 2);
 
 /*
- * FIXME: Is this function useful for Symbian?
  * Write into a IMG_CHAR* on all OSes. Can be allocated on the stack or heap.
  */
 /*!
index 715c2c4..458a29b 100644 (file)
@@ -1,5 +1,5 @@
 /*************************************************************************/ /*!
-@Title          Vista-specific Perf initialisation
+@Title          Perf initialisation
 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
 @License        Dual MIT/GPLv2
 
@@ -43,11 +43,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "img_types.h"
 
-/*
- * Note, WDDM needs to perform initialisation and deinitialisation
- * in order to support HW performance measurement.  Other platforms
- * should not need to do anything in these functions.
- */
 #define PERFINIT()
 #define PERFDEINIT()
 
index c9f0837..5d59e40 100644 (file)
@@ -189,6 +189,7 @@ PVRSRV_ERROR EnableSGXClocks(SYS_DATA *psSysData)
                 PVR_DPF((PVR_DBG_ERROR, "EnableSGXClocks: Couldn't enable SGX functional clock (%d)", res));
                 return PVRSRV_ERROR_UNABLE_TO_ENABLE_CLOCK;
         }
+#if 0
 if(cpu_is_ti816x())    
        lNewRate = clk_round_rate(psSysSpecData->psSGX_FCK, SYS_389x_SGX_CLOCK_SPEED + ONE_MHZ);
 else
@@ -210,6 +211,24 @@ else
                        return PVRSRV_ERROR_UNABLE_TO_SET_CLOCK_RATE;
                 }
         }
+#endif
+
+                if(cpu_is_ti816x())
+                    res = clk_set_rate(psSysSpecData->psSGX_FCK,SYS_389x_SGX_CLOCK_SPEED);
+                else
+                    res = clk_set_rate(psSysSpecData->psSGX_FCK,SYS_387x_SGX_CLOCK_SPEED);
+
+                if(res != 0)
+                {
+                        PVR_DPF((PVR_DBG_ERROR, "EnableSsystemClocks: Couldn't set SGX Functional Clock rate"));
+                        return PVRSRV_ERROR_UNABLE_TO_SET_CLOCK_RATE;
+                }
+                else
+                {
+                        res = clk_get_rate(psSysSpecData->psSGX_FCK);
+                        PVR_TRACE(("SGX clock rate is %dMHz", HZ_TO_MHZ(res)));
+                }
+
 
 #if defined(DEBUG)
         {