Revert "gpu: pvr: remove build time ABI dependency on the EDM trace option"
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 21:46:11 +0000 (00:46 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Mon, 21 May 2012 00:19:32 +0000 (03:19 +0300)
This reverts commit 07595a8ba9f04efa1ff92e5cc7f3b386a34fc510.

pvr/bridged_sgx_bridge.c
pvr/sgx_options.h
pvr/sgxinfo.h
pvr/sgxinfokm.h
pvr/sgxinit.c

index 14f0aad..06db387 100644 (file)
@@ -550,7 +550,6 @@ 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);
@@ -609,12 +608,13 @@ int SGXDevInitPart2BW(u32 ui32BridgeID,
                                    PVRSRV_HANDLE_TYPE_MEM_INFO);
        bLookupFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
 
-       edm_mi = &psSGXDevInitPart2IN->sInitInfo.hKernelEDMStatusBufferMemInfo;
-       if (*edm_mi) {
-               eError = PVRSRVLookupHandle(psPerProc->psHandleBase, &hDummy,
-                                         *edm_mi, PVRSRV_HANDLE_TYPE_MEM_INFO);
-               bLookupFailed |= 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
 
        for (i = 0; i < SGX_MAX_INIT_MEM_HANDLES; i++) {
                void *hHandle =
@@ -692,12 +692,15 @@ int SGXDevInitPart2BW(u32 ui32BridgeID,
                                              PVRSRV_HANDLE_TYPE_MEM_INFO);
        bReleaseFailed |= (IMG_BOOL)(eError != PVRSRV_OK);
 
-       if (*edm_mi) {
-               eError = PVRSRVLookupAndReleaseHandle(psPerProc->psHandleBase,
-                                             edm_mi, *edm_mi,
+#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
+       eError = PVRSRVLookupAndReleaseHandle(psPerProc->psHandleBase,
+                                             &psSGXDevInitPart2IN->sInitInfo.
+                                                 hKernelEDMStatusBufferMemInfo,
+                                             psSGXDevInitPart2IN->sInitInfo.
+                                                 hKernelEDMStatusBufferMemInfo,
                                              PVRSRV_HANDLE_TYPE_MEM_INFO);
-               bReleaseFailed |= eError != PVRSRV_OK;
-       }
+       bReleaseFailed |= (IMG_BOOL)(eError != PVRSRV_OK);
+#endif
 
        for (i = 0; i < SGX_MAX_INIT_MEM_HANDLES; i++) {
                void **phHandle =
@@ -756,10 +759,12 @@ int SGXDevInitPart2BW(u32 ui32BridgeID,
                                                hKernelHWPerfCBMemInfo);
        bDissociateFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
 
-       if (*edm_mi) {
-               eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt, *edm_mi);
-               bDissociateFailed |= eError != PVRSRV_OK;
-       }
+#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
+       eError = PVRSRVDissociateDeviceMemKM(hDevCookieInt,
+                                       psSGXDevInitPart2IN->sInitInfo.
+                                               hKernelEDMStatusBufferMemInfo);
+       bDissociateFailed |= (IMG_BOOL) (eError != PVRSRV_OK);
+#endif
 
        for (i = 0; i < SGX_MAX_INIT_MEM_HANDLES; i++) {
                void *hHandle =
index 858c1e9..67402fe 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 8310244..3e6d0d0 100644 (file)
@@ -56,7 +56,9 @@ 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;
@@ -197,8 +199,10 @@ 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 2517e04..52efbbe 100644 (file)
@@ -99,9 +99,10 @@ 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 3cd70ec..7b932f5 100644 (file)
@@ -134,8 +134,11 @@ 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 =
-                                   psInitInfo->hKernelEDMStatusBufferMemInfo;
+           (struct PVRSRV_KERNEL_MEM_INFO *)psInitInfo->
+                                                 hKernelEDMStatusBufferMemInfo;
+#endif
 
        eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
                            sizeof(struct PVRSRV_SGX_CCB_INFO),