gpu: pvr: remove build time ABI dependency on the EDM trace option
authorImre Deak <imre.deak@nokia.com>
Tue, 14 Dec 2010 01:00:35 +0000 (03:00 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:43:02 +0000 (21:43 +0300)
So that we can build user / kernel space independently on the EDM
tracing option being configured or not.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/bridged_sgx_bridge.c
pvr/sgx_options.h
pvr/sgxinfo.h
pvr/sgxinfokm.h
pvr/sgxinit.c

index b2dae37..dabcaa4 100644 (file)
@@ -582,6 +582,7 @@ int SGXDevInitPart2BW(u32 ui32BridgeID,
        IMG_BOOL bLookupFailed = IMG_FALSE;
        IMG_BOOL bReleaseFailed = IMG_FALSE;
        void *hDummy;
+       void **edm_mi;
        u32 i;
 
        PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SGX_DEVINITPART2);
@@ -640,13 +641,12 @@ int SGXDevInitPart2BW(u32 ui32BridgeID,
                                    PVRSRV_HANDLE_TYPE_MEM_INFO);
        bLookupFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
 
-#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
-       eError = PVRSRVLookupHandle(psPerProc->psHandleBase, &hDummy,
-                                   psSGXDevInitPart2IN->sInitInfo.
-                                           hKernelEDMStatusBufferMemInfo,
-                                   PVRSRV_HANDLE_TYPE_MEM_INFO);
-       bLookupFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
-#endif
+       edm_mi = &psSGXDevInitPart2IN->sInitInfo.hKernelEDMStatusBufferMemInfo;
+       if (*edm_mi) {
+               eError = PVRSRVLookupHandle(psPerProc->psHandleBase, &hDummy,
+                                         *edm_mi, PVRSRV_HANDLE_TYPE_MEM_INFO);
+               bLookupFailed |= eError != PVRSRV_OK;
+       }
 
        for (i = 0; i < SGX_MAX_INIT_MEM_HANDLES; i++) {
                void *hHandle =
@@ -724,15 +724,12 @@ int SGXDevInitPart2BW(u32 ui32BridgeID,
                                              PVRSRV_HANDLE_TYPE_MEM_INFO);
        bReleaseFailed |= (IMG_BOOL)(eError != PVRSRV_OK);
 
-#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
-       eError = PVRSRVLookupAndReleaseHandle(psPerProc->psHandleBase,
-                                             &psSGXDevInitPart2IN->sInitInfo.
-                                                 hKernelEDMStatusBufferMemInfo,
-                                             psSGXDevInitPart2IN->sInitInfo.
-                                                 hKernelEDMStatusBufferMemInfo,
+       if (*edm_mi) {
+               eError = PVRSRVLookupAndReleaseHandle(psPerProc->psHandleBase,
+                                             edm_mi, *edm_mi,
                                              PVRSRV_HANDLE_TYPE_MEM_INFO);
-       bReleaseFailed |= (IMG_BOOL)(eError != PVRSRV_OK);
-#endif
+               bReleaseFailed |= eError != PVRSRV_OK;
+       }
 
        for (i = 0; i < SGX_MAX_INIT_MEM_HANDLES; i++) {
                void **phHandle =
@@ -791,12 +788,10 @@ int SGXDevInitPart2BW(u32 ui32BridgeID,
                                                hKernelHWPerfCBMemInfo);
        bDissociateFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
 
-#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
-       eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt,
-                                       psSGXDevInitPart2IN->sInitInfo.
-                                               hKernelEDMStatusBufferMemInfo);
-       bDissociateFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
-#endif
+       if (*edm_mi) {
+               eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, *edm_mi);
+               bDissociateFailed |= eError != PVRSRV_OK;
+       }
 
        for (i = 0; i < SGX_MAX_INIT_MEM_HANDLES; i++) {
                void *hHandle =
index 67402fe..858c1e9 100644 (file)
 #define OPTIONS_BIT1                                   0x0
 #endif
 
-#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG) || defined(INTERNAL_TEST)
 #define PVRSRV_USSE_EDM_STATUS_DEBUG_SET_OFFSET                OPTIONS_BIT2
 #define OPTIONS_BIT2                                   (0x1 << 2)
-#else
-#define OPTIONS_BIT2                                   0x0
-#endif
 
 #define SUPPORT_HW_RECOVERY_SET_OFFSET                 OPTIONS_BIT3
 #define OPTIONS_BIT3                                   (0x1 << 3)
index 11f599f..955261a 100644 (file)
@@ -56,9 +56,7 @@ struct SGX_BRIDGE_INIT_INFO {
        u32 ui32HostKickAddress;
        u32 ui32GetMiscInfoAddress;
        void *hKernelHWPerfCBMemInfo;
-#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
        void *hKernelEDMStatusBufferMemInfo;
-#endif
 
        u32 ui32EDMTaskReg0;
        u32 ui32EDMTaskReg1;
@@ -198,10 +196,8 @@ struct SGXMKIF_HOST_CTL {
 
        u32 ui32HWPerfFlags;
 
-#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
        /* !< See SGXMK_STATUS_BUFFER */
        struct IMG_DEV_VIRTADDR sEDMStatusBuffer;
-#endif
 
        /*< to count time wraps in the Timer task */
        u32 ui32TimeWraps;
index 6db6bb3..887ebe6 100644 (file)
@@ -99,10 +99,9 @@ struct PVRSRV_SGXDEV_INFO {
        struct PVRSRV_SGXDEV_DIFF_INFO sDiffInfo;
        u32 ui32HWGroupRequested;
        u32 ui32HWReset;
-#ifdef PVRSRV_USSE_EDM_STATUS_DEBUG
+
        /*!< Meminfo for EDM status buffer */
        struct PVRSRV_KERNEL_MEM_INFO *psKernelEDMStatusBufferMemInfo;
-#endif
 
        u32 ui32ClientRefCount;
 
index be7fa0f..ace786c 100644 (file)
@@ -124,11 +124,8 @@ static enum PVRSRV_ERROR InitDevInfo(struct PVRSRV_PER_PROCESS_DATA *psPerProc,
 
        psDevInfo->psKernelHWPerfCBMemInfo =
            (struct PVRSRV_KERNEL_MEM_INFO *)psInitInfo->hKernelHWPerfCBMemInfo;
-#ifdef PVRSRV_USSE_EDM_STATUS_DEBUG
        psDevInfo->psKernelEDMStatusBufferMemInfo =
-           (struct PVRSRV_KERNEL_MEM_INFO *)psInitInfo->
-                                                 hKernelEDMStatusBufferMemInfo;
-#endif
+                                   psInitInfo->hKernelEDMStatusBufferMemInfo;
 
        eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                            sizeof(struct PVRSRV_SGX_CCB_INFO),