From 046cdeba2b0eb0b54408bc2b9edfa36553afddd4 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Mon, 21 May 2012 00:46:11 +0300 Subject: [PATCH] Revert "gpu: pvr: remove build time ABI dependency on the EDM trace option" This reverts commit 07595a8ba9f04efa1ff92e5cc7f3b386a34fc510. --- pvr/bridged_sgx_bridge.c | 37 +++++++++++++++++++++---------------- pvr/sgx_options.h | 4 ++++ pvr/sgxinfo.h | 4 ++++ pvr/sgxinfokm.h | 3 ++- pvr/sgxinit.c | 5 ++++- 5 files changed, 35 insertions(+), 18 deletions(-) diff --git a/pvr/bridged_sgx_bridge.c b/pvr/bridged_sgx_bridge.c index 14f0aad..06db387 100644 --- a/pvr/bridged_sgx_bridge.c +++ b/pvr/bridged_sgx_bridge.c @@ -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 = diff --git a/pvr/sgx_options.h b/pvr/sgx_options.h index 858c1e9..67402fe 100644 --- a/pvr/sgx_options.h +++ b/pvr/sgx_options.h @@ -38,8 +38,12 @@ #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) diff --git a/pvr/sgxinfo.h b/pvr/sgxinfo.h index 8310244..3e6d0d0 100644 --- a/pvr/sgxinfo.h +++ b/pvr/sgxinfo.h @@ -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; diff --git a/pvr/sgxinfokm.h b/pvr/sgxinfokm.h index 2517e04..52efbbe 100644 --- a/pvr/sgxinfokm.h +++ b/pvr/sgxinfokm.h @@ -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; diff --git a/pvr/sgxinit.c b/pvr/sgxinit.c index 3cd70ec..7b932f5 100644 --- a/pvr/sgxinit.c +++ b/pvr/sgxinit.c @@ -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), -- 2.39.2