diff options
Diffstat (limited to 'drivers/gpu/pvr/services4/srvkm/common/deviceclass.c')
| -rwxr-xr-x[-rw-r--r--] | drivers/gpu/pvr/services4/srvkm/common/deviceclass.c | 384 | 
1 files changed, 217 insertions, 167 deletions
diff --git a/drivers/gpu/pvr/services4/srvkm/common/deviceclass.c b/drivers/gpu/pvr/services4/srvkm/common/deviceclass.c index d047c7838b3..7a96e0ed533 100644..100755 --- a/drivers/gpu/pvr/services4/srvkm/common/deviceclass.c +++ b/drivers/gpu/pvr/services4/srvkm/common/deviceclass.c @@ -1,4 +1,5 @@  /*************************************************************************/ /*! +@File  @Title          Device class services functions  @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved  @Description    Kernel services functions for device class devices @@ -49,21 +50,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  #include "deviceid.h"  #include "lists.h" -#if defined(CONFIG_GCBV) -#include "gc_bvmapping.h" + +#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) +#include "pvr_sync.h"  #endif  PVRSRV_ERROR AllocateDeviceID(SYS_DATA *psSysData, IMG_UINT32 *pui32DevID);  PVRSRV_ERROR FreeDeviceID(SYS_DATA *psSysData, IMG_UINT32 ui32DevID); -#if defined(SUPPORT_MISR_IN_THREAD) -void OSVSyncMISR(IMG_HANDLE, IMG_BOOL); -#endif - -#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS) -IMG_VOID PVRSRVFreeCommandCompletePacketKM(IMG_HANDLE	hCmdCookie, -										   IMG_BOOL		bScheduleMISR); -#endif  /***********************************************************************  	Local Display Class Structures  ************************************************************************/ @@ -1166,6 +1160,14 @@ static PVRSRV_ERROR DestroyDCSwapChain(PVRSRV_DC_SWAPCHAIN *psSwapChain)  #if !defined(SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED)  	if (psSwapChain->ppsLastSyncInfos)  	{ +		for (i = 0; i < psSwapChain->ui32LastNumSyncInfos; i++) +		{ +			if (psSwapChain->ppsLastSyncInfos[i]) +			{ +				PVRSRVKernelSyncInfoDecRef(psSwapChain->ppsLastSyncInfos[i], IMG_NULL); +				psSwapChain->ppsLastSyncInfos[i] = IMG_NULL; +			} +		}  		OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_KERNEL_SYNC_INFO *) * psSwapChain->ui32LastNumSyncInfos,  					psSwapChain->ppsLastSyncInfos, IMG_NULL);  	} @@ -1276,7 +1278,6 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA	*psPerProc,  	IMG_UINT32 i;  	DISPLAY_INFO sDisplayInfo; -  	if(!hDeviceKM  	|| !psDstSurfAttrib  	|| !psSrcSurfAttrib @@ -1287,18 +1288,14 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA	*psPerProc,  		return PVRSRV_ERROR_INVALID_PARAMS;  	} +	OSMemSet (apsSyncData, 0, sizeof(PVRSRV_SYNC_DATA *) * PVRSRV_MAX_DC_SWAPCHAIN_BUFFERS); +  	if (ui32BufferCount > PVRSRV_MAX_DC_SWAPCHAIN_BUFFERS)  	{  		PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: Too many buffers"));  		return PVRSRV_ERROR_TOOMANYBUFFERS;  	} -	if (ui32BufferCount < 2) -	{ -		PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateDCSwapChainKM: Too few buffers")); -		return PVRSRV_ERROR_TOO_FEW_BUFFERS; -	} -  	psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);  	if( ui32Flags & PVRSRV_CREATE_SWAPCHAIN_QUERY ) @@ -1428,7 +1425,7 @@ PVRSRV_ERROR PVRSRVCreateDCSwapChainKM (PVRSRV_PER_PROCESS_DATA	*psPerProc,  	psSwapChain->ui32RefCount = 1;  	psSwapChain->ui32Flags = ui32Flags; -	/* Save pointer in DC structure if ti's shared struct */ +	/* Save pointer in DC structure if it's shared struct */  	if( ui32Flags & PVRSRV_CREATE_SWAPCHAIN_SHARED )  	{     		if(! psDCInfo->psDCSwapChainShared )  @@ -1610,32 +1607,6 @@ PVRSRV_ERROR PVRSRVGetDCBuffersKM(IMG_HANDLE	hDeviceKM,  		phBuffer[i] = (IMG_HANDLE)&psSwapChain->asBuffer[i];  	} -#if defined(SUPPORT_GET_DC_BUFFERS_SYS_PHYADDRS) -	for(i = 0; i < *pui32BufferCount; i++) -	{ -		IMG_UINT32 ui32ByteSize, ui32TilingStride; -		IMG_SYS_PHYADDR *pPhyAddr; -		IMG_BOOL bIsContiguous; -		IMG_HANDLE hOSMapInfo; -		IMG_VOID *pvVAddr; - -		eError = psDCInfo->psFuncTable->pfnGetBufferAddr(psDCInfo->hExtDevice, -														 ahExtBuffer[i], -														 &pPhyAddr, -														 &ui32ByteSize, -														 &pvVAddr, -														 &hOSMapInfo, -														 &bIsContiguous, -														 &ui32TilingStride); -		if(eError != PVRSRV_OK) -		{ -			break; -		} - -		psPhyAddr[i] = *pPhyAddr; -	} -#endif /* defined(SUPPORT_GET_DC_BUFFERS_SYS_PHYADDRS) */ -  	return eError;  } @@ -1679,21 +1650,6 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(IMG_HANDLE	hDeviceKM,  		return PVRSRV_ERROR_INVALID_SWAPINTERVAL;  	} -#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS) - -	if(psDCInfo->psFuncTable->pfnQuerySwapCommandID != IMG_NULL) -	{ -		psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice, -													 psBuffer->psSwapChain->hExtSwapChain, -													 psBuffer->sDeviceClassBuffer.hExtBuffer,  -													 hPrivateTag,  -													 &ui16SwapCommandID, -													 &bAddReferenceToLast); -		 -	} - -#endif -  	/* get the queue from the buffer structure */  	psQueue = psBuffer->psSwapChain->psQueue; @@ -1717,6 +1673,7 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(IMG_HANDLE	hDeviceKM,  									apsSrcSync,  									sizeof(DISPLAYCLASS_FLIP_COMMAND) + (sizeof(IMG_RECT) * ui32ClipRectCount),  									IMG_NULL, +									IMG_NULL,  									IMG_NULL);  	if(eError != PVRSRV_OK)  	{ @@ -1836,20 +1793,27 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE	hDeviceKM,  									 PVRSRV_KERNEL_SYNC_INFO **ppsSyncInfos,  									 IMG_UINT32	ui32NumMemSyncInfos,  									 IMG_PVOID	pvPrivData, -									 IMG_UINT32	ui32PrivDataLength) +									 IMG_UINT32	ui32PrivDataLength, +									 IMG_HANDLE	*phFence)  { +	IMG_UINT32 ui32NumSyncInfos = ui32NumMemSyncInfos; +	IMG_UINT32 ui32NumMemInfos = ui32NumMemSyncInfos;  	PVRSRV_KERNEL_SYNC_INFO **ppsCompiledSyncInfos;  	IMG_UINT32 i, ui32NumCompiledSyncInfos;  	DISPLAYCLASS_FLIP_COMMAND2 *psFlipCmd;  	PVRSRV_DISPLAYCLASS_INFO *psDCInfo;  	PVRSRV_DC_SWAPCHAIN *psSwapChain; -	PVRSRV_ERROR eError = PVRSRV_OK;  	CALLBACK_DATA *psCallbackData;  	PVRSRV_QUEUE_INFO *psQueue;  	PVRSRV_COMMAND *psCommand;  	IMG_PVOID *ppvMemInfos; +	PVRSRV_ERROR eError;  	SYS_DATA *psSysData; +#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) +	struct sync_fence *apsFence[SGX_MAX_SRC_SYNCS_TA] = {}; +#endif /* defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) */ +  	if(!hDeviceKM || !hSwapChain || !ppsMemInfos || !ppsSyncInfos || ui32NumMemSyncInfos < 1)  	{  		PVR_DPF((PVR_DBG_ERROR,"PVRSRVSwapToDCBuffer2KM: Invalid parameters")); @@ -1881,7 +1845,7 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE	hDeviceKM,  	psCallbackData->ui32PrivDataLength = ui32PrivDataLength;  	if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, -				  sizeof(IMG_VOID *) * ui32NumMemSyncInfos, +				  sizeof(IMG_VOID *) * ui32NumMemInfos,  				  (IMG_VOID **)&ppvMemInfos, IMG_NULL,  				  "Swap Command Meminfos") != PVRSRV_OK)  	{ @@ -1890,13 +1854,22 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE	hDeviceKM,  		goto Exit;  	} -	for(i = 0; i < ui32NumMemSyncInfos; i++) +	for(i = 0; i < ui32NumMemInfos; i++)  	{  		ppvMemInfos[i] = ppsMemInfos[i];  	}  	psCallbackData->ppvMemInfos = ppvMemInfos; -	psCallbackData->ui32NumMemInfos = ui32NumMemSyncInfos; +	psCallbackData->ui32NumMemInfos = ui32NumMemInfos; + +#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) +	eError = PVRSyncFencesToSyncInfos(ppsSyncInfos, &ui32NumSyncInfos, apsFence); +	if(eError != PVRSRV_OK) +	{ +		PVR_DPF((PVR_DBG_ERROR,"PVRSRVSwapToDCBuffer2KM: PVRSyncFencesToSyncInfos failed")); +		goto Exit; +	} +#endif /* defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) */  	/* get the queue from the buffer structure */  	psQueue = psSwapChain->psQueue; @@ -1905,21 +1878,35 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE	hDeviceKM,  	if(psSwapChain->ppsLastSyncInfos)  	{  		IMG_UINT32 ui32NumUniqueSyncInfos = psSwapChain->ui32LastNumSyncInfos; +		IMG_BOOL *abUnique;  		IMG_UINT32 j; +		if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, +					  sizeof(IMG_BOOL) * psSwapChain->ui32LastNumSyncInfos, +					  (IMG_VOID **)&abUnique, IMG_NULL, +					  "Unique booleans") != PVRSRV_OK) +		{ +			PVR_DPF((PVR_DBG_ERROR,"PVRSRVSwapToDCBuffer2KM: Failed to allocate space for unique booleans")); +			goto Exit; +		} +  		for(j = 0; j < psSwapChain->ui32LastNumSyncInfos; j++)  		{ -			for(i = 0; i < ui32NumMemSyncInfos; i++) +			abUnique[j] = IMG_TRUE; +			for(i = 0; i < ui32NumSyncInfos; i++)  			{ +				PVR_ASSERT(psSwapChain->ppsLastSyncInfos[j]); +				PVR_ASSERT(ppsSyncInfos[i]);  				if(psSwapChain->ppsLastSyncInfos[j] == ppsSyncInfos[i])  				{ -					psSwapChain->ppsLastSyncInfos[j] = IMG_NULL; +					abUnique[j] = IMG_FALSE;  					ui32NumUniqueSyncInfos--; +					break;  				}  			}  		} -		ui32NumCompiledSyncInfos = ui32NumMemSyncInfos + ui32NumUniqueSyncInfos; +		ui32NumCompiledSyncInfos = ui32NumSyncInfos + ui32NumUniqueSyncInfos;  		if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,  					  sizeof(PVRSRV_KERNEL_SYNC_INFO *) * ui32NumCompiledSyncInfos, @@ -1927,24 +1914,132 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE	hDeviceKM,  					  "Compiled syncinfos") != PVRSRV_OK)  		{  			PVR_DPF((PVR_DBG_ERROR,"PVRSRVSwapToDCBuffer2KM: Failed to allocate space for meminfo list")); +			OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, +					  sizeof(IMG_BOOL) * psSwapChain->ui32LastNumSyncInfos, +					  (IMG_VOID *)abUnique, IMG_NULL); +#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) +			for(i = 0; i < SGX_MAX_SRC_SYNCS_TA && apsFence[i]; i++) +				sync_fence_put(apsFence[i]); +#endif  			goto Exit;  		} -		OSMemCopy(ppsCompiledSyncInfos, ppsSyncInfos, sizeof(PVRSRV_KERNEL_SYNC_INFO *) * ui32NumMemSyncInfos); -		for(j = 0, i = ui32NumMemSyncInfos; j < psSwapChain->ui32LastNumSyncInfos; j++) +		OSMemCopy(ppsCompiledSyncInfos, ppsSyncInfos, sizeof(PVRSRV_KERNEL_SYNC_INFO *) * ui32NumSyncInfos); +		for(j = 0, i = ui32NumSyncInfos; j < psSwapChain->ui32LastNumSyncInfos; j++)  		{ -			if(psSwapChain->ppsLastSyncInfos[j]) +			if(abUnique[j])  			{  				ppsCompiledSyncInfos[i] = psSwapChain->ppsLastSyncInfos[j];  				i++;  			}  		} + +		OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, +				  sizeof(IMG_BOOL) * psSwapChain->ui32LastNumSyncInfos, +				  (IMG_VOID *)abUnique, IMG_NULL);  	}  	else  #endif /* !defined(SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED) */  	{ -		ppsCompiledSyncInfos = ppsSyncInfos; -		ui32NumCompiledSyncInfos = ui32NumMemSyncInfos; +		IMG_UINT32 j, ui32Missing = 0; + +		/* Older synchronization schemes would just pass down the syncinfos +		 * hanging off of the meminfos. So we would expect identical lists. +		 * However, newer drivers may send down additional synchronization +		 * i.e. for TQ fence operations. In such a case we need to allocate +		 * more space for the compiled syncinfos to ensure everything is +		 * ROP2 synchronized. +		 */ +		for(i = 0; i < ui32NumMemInfos; i++) +		{ +			for(j = 0; j < ui32NumSyncInfos; j++) +			{ +				if(ppsSyncInfos[j] == ppsMemInfos[i]->psKernelSyncInfo) +					break; +			} + +			if(j == ui32NumSyncInfos) +				ui32Missing++; +		} + +		if(ui32Missing) +		{ +			IMG_UINT32 k; + +			ui32NumCompiledSyncInfos = ui32NumSyncInfos + ui32Missing; + +			if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, +						  sizeof(PVRSRV_KERNEL_SYNC_INFO *) * ui32NumCompiledSyncInfos, +						  (IMG_VOID **)&ppsCompiledSyncInfos, IMG_NULL, +						  "Compiled syncinfos") != PVRSRV_OK) +			{ +				PVR_DPF((PVR_DBG_ERROR,"PVRSRVSwapToDCBuffer2KM: Failed to allocate space for meminfo list")); +#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) +				for(i = 0; i < SGX_MAX_SRC_SYNCS_TA && apsFence[i]; i++) +					sync_fence_put(apsFence[i]); +#endif +				goto Exit; +			} + +			for(i = 0; i < ui32NumSyncInfos; i++) +			{ +				ppsCompiledSyncInfos[i] = ppsSyncInfos[i]; +			} + +			k = i; +			for(i = 0; i < ui32NumMemInfos; i++) +			{ +				for(j = 0; j < ui32NumSyncInfos; j++) +				{ +					if(ppsSyncInfos[j] == ppsMemInfos[i]->psKernelSyncInfo) +						break; +				} + +				if(j == ui32NumSyncInfos) +				{ +					/* Insert the unique one */ +					PVR_ASSERT(k < ui32NumCompiledSyncInfos); +					ppsCompiledSyncInfos[k] = ppsMemInfos[i]->psKernelSyncInfo; +					k++; +				} +			} + +			PVR_ASSERT(k == ui32NumCompiledSyncInfos); + +			/* As a further complication, if we have multiple displays, we +			 * might see the same layer/meminfo submitted twice. This is +			 * valid, as the layer might be needed by two separate pipes, +			 * but we should not use the meminfo's synchronization twice +			 * because this will deadlock the queue processor. +			 * +			 * For now, work over the meminfo end of the compiled syncs +			 * list and collapse any duplicates. We can assume the fence +			 * sync part of the array has already been de-duplicated. +			 */ +			k = ui32NumSyncInfos; +			for(i = ui32NumSyncInfos; i < ui32NumCompiledSyncInfos; i++) +			{ +				/* Compare the i'th entry with all that follow */ +				for(j = i + 1; j < ui32NumCompiledSyncInfos; j++) +				{ +					if(ppsCompiledSyncInfos[i] == ppsCompiledSyncInfos[j]) +						break; +				} + +				if(j == ui32NumCompiledSyncInfos) +				{ +					/* No duplicate found. Use this entry */ +					ppsCompiledSyncInfos[k] = ppsCompiledSyncInfos[i]; +					k++; +				} +			} +			ui32NumCompiledSyncInfos = k; +		} +		else +		{ +			ppsCompiledSyncInfos = ppsSyncInfos; +			ui32NumCompiledSyncInfos = ui32NumSyncInfos; +		}  	}  	/* insert the command (header) */ @@ -1958,7 +2053,17 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE	hDeviceKM,  									ppsCompiledSyncInfos,  									sizeof(DISPLAYCLASS_FLIP_COMMAND2),  									FreePrivateData, -									psCallbackData); +									psCallbackData, +									phFence); + +#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) +	/* InsertCommand bumped the refcount on the raw sync objects, so we +	 * can put the fences now. Even if the fences are deleted, the syncs +	 * will persist. +	 */ +	for(i = 0; i < SGX_MAX_SRC_SYNCS_TA && apsFence[i]; i++) +		sync_fence_put(apsFence[i]); +#endif  	if (ppsCompiledSyncInfos != ppsSyncInfos)  	{ @@ -1990,7 +2095,7 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE	hDeviceKM,  	psFlipCmd->ui32PrivDataLength = ui32PrivDataLength;  	psFlipCmd->ppsMemInfos = (PDC_MEM_INFO *)ppvMemInfos; -	psFlipCmd->ui32NumMemInfos = ui32NumMemSyncInfos; +	psFlipCmd->ui32NumMemInfos = ui32NumMemInfos;  	/* Even though this is "unused", we have to initialize it,  	 * as the display controller might NULL-test it. @@ -2026,6 +2131,11 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE	hDeviceKM,  	if (eError != PVRSRV_OK)  	{  		PVR_DPF((PVR_DBG_ERROR,"PVRSRVSwapToDCBuffer2KM: Failed to submit command")); +#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) +		sync_fence_put(psCommand->pvCleanupFence); +		sync_fence_put(*phFence); +		*phFence = IMG_NULL; +#endif  		goto Exit;  	} @@ -2040,34 +2150,60 @@ PVRSRV_ERROR PVRSRVSwapToDCBuffer2KM(IMG_HANDLE	hDeviceKM,  	if (eError != PVRSRV_OK)  	{  		PVR_DPF((PVR_DBG_ERROR,"PVRSRVSwapToDCBuffer2KM: Failed to schedule MISR")); +#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) +		sync_fence_put(*phFence); +		*phFence = IMG_NULL; +#endif  		goto Exit;  	}  #if !defined(SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED)  	/* Reallocate the syncinfo list if it was too small */ -	if (psSwapChain->ui32LastNumSyncInfos < ui32NumMemSyncInfos) +	if (psSwapChain->ui32LastNumSyncInfos < ui32NumSyncInfos)  	{  		if (psSwapChain->ppsLastSyncInfos)  		{ +			for (i = 0; i < psSwapChain->ui32LastNumSyncInfos; i++) +			{ +				if (psSwapChain->ppsLastSyncInfos[i]) +				{ +					PVRSRVKernelSyncInfoDecRef(psSwapChain->ppsLastSyncInfos[i], IMG_NULL); +					psSwapChain->ppsLastSyncInfos[i] = IMG_NULL; +				} +			}  			OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(PVRSRV_KERNEL_SYNC_INFO *) * psSwapChain->ui32LastNumSyncInfos,  						psSwapChain->ppsLastSyncInfos, IMG_NULL);  		}  		if(OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP, -					  sizeof(PVRSRV_KERNEL_SYNC_INFO *) * ui32NumMemSyncInfos, +					  sizeof(PVRSRV_KERNEL_SYNC_INFO *) * ui32NumSyncInfos,  					  (IMG_VOID **)&psSwapChain->ppsLastSyncInfos, IMG_NULL,  					  "Last syncinfos") != PVRSRV_OK)  		{  			PVR_DPF((PVR_DBG_ERROR,"PVRSRVSwapToDCBuffer2KM: Failed to allocate space for meminfo list")); +#if defined(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC) +			sync_fence_put(*phFence); +			*phFence = IMG_NULL; +#endif  			goto Exit;  		}  	} -	psSwapChain->ui32LastNumSyncInfos = ui32NumMemSyncInfos; +	for (i = 0; i < psSwapChain->ui32LastNumSyncInfos; i++) +	{ +		if (psSwapChain->ppsLastSyncInfos[i]) +		{ +			PVRSRVKernelSyncInfoDecRef(psSwapChain->ppsLastSyncInfos[i], IMG_NULL); +			psSwapChain->ppsLastSyncInfos[i] = IMG_NULL; +		} +	} -	for(i = 0; i < ui32NumMemSyncInfos; i++) +	psSwapChain->ui32LastNumSyncInfos = ui32NumSyncInfos; + +	for(i = 0; i < ui32NumSyncInfos; i++)  	{  		psSwapChain->ppsLastSyncInfos[i] = ppsSyncInfos[i]; +		PVRSRVKernelSyncInfoIncRef(psSwapChain->ppsLastSyncInfos[i], IMG_NULL);  	}  #endif /* !defined(SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED) */ @@ -2119,7 +2255,7 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(IMG_HANDLE	hDeviceKM,  	psSwapChain = psSwapChainRef->psSwapChain;  	/* -		If more then 1 reference to the swapchain exist then +		If more than 1 reference to the swapchain exists then  		ignore any request to swap to the system buffer  	*/  	if (psSwapChain->ui32RefCount > 1) @@ -2130,21 +2266,6 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(IMG_HANDLE	hDeviceKM,  	/* get the queue from the buffer structure */  	psQueue = psSwapChain->psQueue; -#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS) - -	if(psDCInfo->psFuncTable->pfnQuerySwapCommandID != IMG_NULL) -	{ -		psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice, -													 psSwapChain->hExtSwapChain, -													 psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtBuffer,  -													 0,  -													 &ui16SwapCommandID, -													 &bAddReferenceToLast); -		 -	} - -#endif -  	/* specify the syncs */  	apsSrcSync[0] = psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo;  	if(bAddReferenceToLast && psSwapChain->psLastFlipBuffer) @@ -2168,6 +2289,7 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(IMG_HANDLE	hDeviceKM,  									apsSrcSync,  									sizeof(DISPLAYCLASS_FLIP_COMMAND),  									IMG_NULL, +									IMG_NULL,  									IMG_NULL);  	if(eError != PVRSRV_OK)  	{ @@ -2372,69 +2494,6 @@ PVRSRVDCMemInfoIsPhysContig(PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo)  	return OSMemHandleIsPhysContig(psKernelMemInfo->sMemBlk.hOSMemHandle);  } -static PVRSRV_ERROR PVRSRVDCMemInfoGetBvHandle(PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo, IMG_VOID **handle) -{ -#if !defined(CONFIG_GCBV) -	*handle = NULL; -	return PVRSRV_ERROR_NOT_SUPPORTED; -#else -	*handle = gc_meminfo_to_hndl(psKernelMemInfo); -	return PVRSRV_OK; -#endif -} - -/*! -****************************************************************************** - - @Function	PVRSRVDCMemInfoGetCpuMultiPlanePAddr - - @Description returns physical addresses of  a multi-plane buffer - - - @Input	psKernelMemInfo	- Pointer to Kernel Memory Info structure -		puPlaneByteOffsets - requested offset inside the plane. -			If the array is a NULL pointer, 0 requested offsets -			are assumed for all planes; -		pui32NumAddrOffsets	- specifying the size of the user array. -			If the array is smaller than the number of the planes -			for this buffer, the correct size will be set and an -			error returned back; - -@Output  pPlanePAddrs - array of plane physical addresses of the returned size -						in pui32NumAddrOffsets; -		 pui32NumAddrOffsets - contains the real number of planes for the buffer; - -@Return   IMG_INT32  : size of the entire buffer or negative number on ERROR - -******************************************************************************/ -static IMG_INT32 -PVRSRVDCMemInfoGetCpuMultiPlanePAddr(PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo, -		IMG_SIZE_T* puPlaneByteOffsets, IMG_CPU_PHYADDR* pPlanePAddrs, -		IMG_UINT32* pui32NumAddrOffsets) -{ -	IMG_UINT32 aui32PlaneAddressOffsets[PVRSRV_MAX_NUMBER_OF_MM_BUFFER_PLANES]; -	IMG_INT32 i32Ret; -	IMG_UINT32 i; - -	i32Ret = OSGetMemMultiPlaneInfo(psKernelMemInfo->sMemBlk.hOSMemHandle, -			aui32PlaneAddressOffsets, -			pui32NumAddrOffsets); - -	if((i32Ret < 0) || (pPlanePAddrs == IMG_NULL)) -		return i32Ret; - -	for (i = 0; i < *pui32NumAddrOffsets; i++) -	{ -		IMG_SIZE_T uiReqByteOffsets = puPlaneByteOffsets ? puPlaneByteOffsets[i] : 0; - -		uiReqByteOffsets += aui32PlaneAddressOffsets[i]; - -		pPlanePAddrs[i] = OSMemHandleToCpuPAddr(psKernelMemInfo->sMemBlk.hOSMemHandle, uiReqByteOffsets); -	} - -	return i32Ret; -} -  /*!  ****************************************************************************** @@ -2458,22 +2517,13 @@ IMG_BOOL PVRGetDisplayClassJTable(PVRSRV_DC_DISP2SRV_KMJTABLE *psJTable)  	psJTable->pfnPVRSRVOEMFunction = &SysOEMFunction;  	psJTable->pfnPVRSRVRegisterCmdProcList = &PVRSRVRegisterCmdProcListKM;  	psJTable->pfnPVRSRVRemoveCmdProcList = &PVRSRVRemoveCmdProcListKM; -#if defined(SUPPORT_MISR_IN_THREAD) -        psJTable->pfnPVRSRVCmdComplete = &OSVSyncMISR; -#else -        psJTable->pfnPVRSRVCmdComplete = &PVRSRVCommandCompleteKM; -#endif +	psJTable->pfnPVRSRVCmdComplete = &PVRSRVCommandCompleteKM;  	psJTable->pfnPVRSRVRegisterSystemISRHandler = &PVRSRVRegisterSystemISRHandler;  	psJTable->pfnPVRSRVRegisterPowerDevice = &PVRSRVRegisterPowerDevice; -#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS) -	psJTable->pfnPVRSRVFreeCmdCompletePacket = &PVRSRVFreeCommandCompletePacketKM; -#endif  	psJTable->pfnPVRSRVDCMemInfoGetCpuVAddr = &PVRSRVDCMemInfoGetCpuVAddr;  	psJTable->pfnPVRSRVDCMemInfoGetCpuPAddr = &PVRSRVDCMemInfoGetCpuPAddr;  	psJTable->pfnPVRSRVDCMemInfoGetByteSize = &PVRSRVDCMemInfoGetByteSize;  	psJTable->pfnPVRSRVDCMemInfoIsPhysContig = &PVRSRVDCMemInfoIsPhysContig; -	psJTable->pfnPVRSRVDCMemInfoGetBvHandle = &PVRSRVDCMemInfoGetBvHandle; -	psJTable->pfnPVRSRVDCMemInfoGetCpuMultiPlanePAddr = PVRSRVDCMemInfoGetCpuMultiPlanePAddr;  	return IMG_TRUE;  }  |