From: Imre Deak Date: Wed, 9 Feb 2011 23:50:49 +0000 (+0200) Subject: gpu: pvr: remove ABI compatibility hack from SGXKick IOCTL X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=031dbbdc76ed408e4a1206569ba85f79a9c98763;p=sgx.git gpu: pvr: remove ABI compatibility hack from SGXKick IOCTL By now everyone should have a recent enough kernel/user space library, so this isn't needed. This will revert the compatibility fixup parts of the following commit: 99baad807: Increase the max number of 3D TA status vals in kick reque Signed-off-by: Imre Deak --- diff --git a/pvr/bridged_sgx_bridge.c b/pvr/bridged_sgx_bridge.c index dabcaa4..f31adb6 100644 --- a/pvr/bridged_sgx_bridge.c +++ b/pvr/bridged_sgx_bridge.c @@ -129,30 +129,6 @@ int SGXGetInternalDevInfoBW(u32 ui32BridgeID, return 0; } -/* Convert the IOCTL parameter from "old" to "new" format. */ -static int kick_compat_conv(struct PVRSRV_BRIDGE_IN_DOKICK *kick, - size_t in_size) -{ - struct SGX_CCB_KICK *ccb; - size_t diff; - - ccb = &kick->sCCBKick; - - diff = sizeof(ccb->ah3DStatusSyncInfo[0]) * - (SGX_MAX_3D_STATUS_VALS - SGX_MAX_3D_STATUS_VALS_OLD); - if (sizeof(*kick) - in_size != diff) - return -EINVAL; - - /* Trailing size at the end of struct to move. */ - diff = sizeof(*kick) - offsetof(typeof(*kick), - sCCBKick.ah3DStatusSyncInfo[SGX_MAX_3D_STATUS_VALS]); - memmove(&kick->sCCBKick.ah3DStatusSyncInfo[SGX_MAX_3D_STATUS_VALS], - &kick->sCCBKick.ah3DStatusSyncInfo[SGX_MAX_3D_STATUS_VALS_OLD], - diff); - - return 0; -} - int SGXDoKickBW(u32 ui32BridgeID, struct PVRSRV_BRIDGE_IN_DOKICK *psDoKickIN, struct PVRSRV_BRIDGE_RETURN *psRetOUT, @@ -160,20 +136,10 @@ int SGXDoKickBW(u32 ui32BridgeID, struct PVRSRV_PER_PROCESS_DATA *psPerProc) { void *hDevCookieInt; - int max_3dstat_vals; u32 i; PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SGX_DOKICK); - max_3dstat_vals = SGX_MAX_3D_STATUS_VALS; - if (unlikely(in_size != sizeof(*psDoKickIN))) { - max_3dstat_vals = SGX_MAX_3D_STATUS_VALS_OLD; - if (kick_compat_conv(psDoKickIN, in_size) != 0) { - psRetOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; - return -EINVAL; - } - - } psRetOUT->eError = PVRSRVLookupHandle(psPerProc->psHandleBase, &hDevCookieInt, psDoKickIN->hDevCookie, @@ -254,7 +220,7 @@ int SGXDoKickBW(u32 ui32BridgeID, return 0; } - if (psDoKickIN->sCCBKick.ui32Num3DStatusVals > max_3dstat_vals) { + if (psDoKickIN->sCCBKick.ui32Num3DStatusVals > SGX_MAX_3D_STATUS_VALS) { psRetOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; return 0; } @@ -289,8 +255,7 @@ int SGXDoKickBW(u32 ui32BridgeID, return 0; } - psRetOUT->eError = SGXDoKickKM(hDevCookieInt, &psDoKickIN->sCCBKick, - max_3dstat_vals); + psRetOUT->eError = SGXDoKickKM(hDevCookieInt, &psDoKickIN->sCCBKick); return 0; } diff --git a/pvr/sgx_bridge_km.h b/pvr/sgx_bridge_km.h index 3389b0c..2819a7e 100644 --- a/pvr/sgx_bridge_km.h +++ b/pvr/sgx_bridge_km.h @@ -39,8 +39,8 @@ enum PVRSRV_ERROR SGXSubmitTransferKM(void *hDevHandle, struct PVRSRV_TRANSFER_SGX_KICK *psKick); -enum PVRSRV_ERROR SGXDoKickKM(void *hDevHandle, struct SGX_CCB_KICK *psCCBKick, - int max_3dstat_val); +enum PVRSRV_ERROR SGXDoKickKM(void *hDevHandle, + struct SGX_CCB_KICK *psCCBKick); enum PVRSRV_ERROR SGXGetPhysPageAddrKM(void *hDevMemHeap, struct IMG_DEV_VIRTADDR sDevVAddr, diff --git a/pvr/sgxapi_km.h b/pvr/sgxapi_km.h index 8ca76ff..88d66fa 100644 --- a/pvr/sgxapi_km.h +++ b/pvr/sgxapi_km.h @@ -50,7 +50,6 @@ #define SGX_MAX_HEAP_ID 10 #define SGX_MAX_TA_STATUS_VALS 32 -#define SGX_MAX_3D_STATUS_VALS_OLD 2 #define SGX_MAX_3D_STATUS_VALS 4 #define SGX_MAX_SRC_SYNCS 4 diff --git a/pvr/sgxinfo.h b/pvr/sgxinfo.h index 955261a..eda7f34 100644 --- a/pvr/sgxinfo.h +++ b/pvr/sgxinfo.h @@ -242,10 +242,6 @@ struct SGXMKIF_CMDTA_SHARED { struct PVRSRV_DEVICE_SYNC_OBJECT asSrcSyncs[SGX_MAX_SRC_SYNCS]; struct CTL_STATUS sCtlTAStatusInfo[SGX_MAX_TA_STATUS_VALS]; - /* - * Note that the actual size of sCtl3DStatusInfo changes based - * on the IOCTL ABI version used. - */ struct CTL_STATUS sCtl3DStatusInfo[SGX_MAX_3D_STATUS_VALS]; struct PVRSRV_DEVICE_SYNC_OBJECT sTA3DDependency; diff --git a/pvr/sgxkick.c b/pvr/sgxkick.c index 045de0f..4054988 100644 --- a/pvr/sgxkick.c +++ b/pvr/sgxkick.c @@ -37,8 +37,8 @@ #include "pvr_debug.h" #include "sgxutils.h" -enum PVRSRV_ERROR SGXDoKickKM(void *hDevHandle, struct SGX_CCB_KICK *psCCBKick, - int max_3dstat_vals) +enum PVRSRV_ERROR SGXDoKickKM(void *hDevHandle, + struct SGX_CCB_KICK *psCCBKick) { enum PVRSRV_ERROR eError; struct PVRSRV_KERNEL_SYNC_INFO *psSyncInfo; @@ -67,26 +67,12 @@ enum PVRSRV_ERROR SGXDoKickKM(void *hDevHandle, struct SGX_CCB_KICK *psCCBKick, psCCBKick, ui32CCBOffset); if (psCCBKick->hTA3DSyncInfo) { - struct PVRSRV_DEVICE_SYNC_OBJECT *ta3d_dep; - psSyncInfo = (struct PVRSRV_KERNEL_SYNC_INFO *)psCCBKick->hTA3DSyncInfo; - - ta3d_dep = &psTACmd->sTA3DDependency; - /* - * Ugly hack to account for the two possible sizes of - * struct SGXMKIF_CMDTA_SHARED which is based on the - * corresponding IOCTL ABI version used. - */ - if (max_3dstat_vals != SGX_MAX_3D_STATUS_VALS) - ta3d_dep = (struct PVRSRV_DEVICE_SYNC_OBJECT *) - ((u8 *)ta3d_dep - sizeof(struct CTL_STATUS) * - (SGX_MAX_3D_STATUS_VALS - max_3dstat_vals)); - - ta3d_dep->sWriteOpsCompleteDevVAddr = + psTACmd->sTA3DDependency.sWriteOpsCompleteDevVAddr = psSyncInfo->sWriteOpsCompleteDevVAddr; - ta3d_dep->ui32WriteOpsPendingVal = + psTACmd->sTA3DDependency.ui32WriteOpsPendingVal = psSyncInfo->psSyncData->ui32WriteOpsPending; if (psCCBKick->bTADependency)