aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ice4100/sgx535/common/deviceclass.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/ice4100/sgx535/common/deviceclass.c')
-rwxr-xr-xdrivers/staging/ice4100/sgx535/common/deviceclass.c58
1 files changed, 51 insertions, 7 deletions
diff --git a/drivers/staging/ice4100/sgx535/common/deviceclass.c b/drivers/staging/ice4100/sgx535/common/deviceclass.c
index 5d68d3b36ee..011ebd155b1 100755
--- a/drivers/staging/ice4100/sgx535/common/deviceclass.c
+++ b/drivers/staging/ice4100/sgx535/common/deviceclass.c
@@ -45,6 +45,11 @@ PVRSRV_ERROR FreeDeviceID(SYS_DATA * psSysData, u32 ui32DevID);
void OSVSyncMISR(void *, int);
#endif
+#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
+void PVRSRVFreeCommandCompletePacketKM(void *hCmdCookie,
+ int bScheduleMISR);
+#endif
+
typedef struct PVRSRV_DC_SRV2DISP_KMJTABLE_TAG *PPVRSRV_DC_SRV2DISP_KMJTABLE;
typedef struct PVRSRV_DC_BUFFER_TAG {
@@ -1152,6 +1157,8 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(void *hDeviceKM,
PVRSRV_QUEUE_INFO *psQueue;
DISPLAYCLASS_FLIP_COMMAND *psFlipCmd;
u32 i;
+ int bAddReferenceToLast = 1;
+ u16 ui16SwapCommandID = DC_FLIP_COMMAND;
u32 ui32NumSrcSyncs = 1;
PVRSRV_KERNEL_SYNC_INFO *apsSrcSync[2];
PVRSRV_COMMAND *psCommand;
@@ -1171,15 +1178,31 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(void *hDeviceKM,
psBuffer = (PVRSRV_DC_BUFFER *) hBuffer;
psDCInfo = DCDeviceHandleToDCInfo(hDeviceKM);
+#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
+
+ if(psDCInfo->psFuncTable->pfnQuerySwapCommandID != NULL)
+ {
+ psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice,
+ psBuffer->psSwapChain->hExtSwapChain,
+ psBuffer->sDeviceClassBuffer.hExtBuffer,
+ hPrivateTag,
+ &ui16SwapCommandID,
+ &bAddReferenceToLast);
+
+ }
+
+#endif
+
psQueue = psBuffer->psSwapChain->psQueue;
apsSrcSync[0] = psBuffer->sDeviceClassBuffer.psKernelSyncInfo;
- if (psBuffer->psSwapChain->psLastFlipBuffer &&
- psBuffer != psBuffer->psSwapChain->psLastFlipBuffer) {
+ if (bAddReferenceToLast &&
+ psBuffer->psSwapChain->psLastFlipBuffer &&
+ psBuffer != psBuffer->psSwapChain->psLastFlipBuffer) {
apsSrcSync[1] =
- psBuffer->psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.
- psKernelSyncInfo;
+ psBuffer->psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.
+ psKernelSyncInfo;
ui32NumSrcSyncs++;
}
@@ -1187,7 +1210,7 @@ PVRSRV_ERROR PVRSRVSwapToDCBufferKM(void *hDeviceKM,
eError = PVRSRVInsertCommandKM(psQueue,
&psCommand,
psDCInfo->ui32DeviceID,
- DC_FLIP_COMMAND,
+ ui16SwapCommandID,
0,
NULL,
ui32NumSrcSyncs,
@@ -1269,6 +1292,8 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(void *hDeviceKM, void *hSwapChainRef)
u32 ui32NumSrcSyncs = 1;
PVRSRV_KERNEL_SYNC_INFO *apsSrcSync[2];
PVRSRV_COMMAND *psCommand;
+ int bAddReferenceToLast = 1;
+ u16 ui16SwapCommandID = DC_FLIP_COMMAND;
if (!hDeviceKM || !hSwapChainRef) {
PVR_DPF((PVR_DBG_ERROR,
@@ -1288,10 +1313,25 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(void *hDeviceKM, void *hSwapChainRef)
psQueue = psSwapChain->psQueue;
+#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
+
+ if(psDCInfo->psFuncTable->pfnQuerySwapCommandID != NULL)
+ {
+ psDCInfo->psFuncTable->pfnQuerySwapCommandID(psDCInfo->hExtDevice,
+ psSwapChain->hExtSwapChain,
+ psDCInfo->sSystemBuffer.sDeviceClassBuffer.hExtBuffer,
+ 0,
+ &ui16SwapCommandID,
+ &bAddReferenceToLast);
+
+ }
+
+#endif
+
apsSrcSync[0] =
psDCInfo->sSystemBuffer.sDeviceClassBuffer.psKernelSyncInfo;
- if (psSwapChain->psLastFlipBuffer) {
+ if (bAddReferenceToLast && psSwapChain->psLastFlipBuffer) {
if (apsSrcSync[0] !=
psSwapChain->psLastFlipBuffer->sDeviceClassBuffer.
@@ -1307,7 +1347,7 @@ PVRSRV_ERROR PVRSRVSwapToDCSystemKM(void *hDeviceKM, void *hSwapChainRef)
eError = PVRSRVInsertCommandKM(psQueue,
&psCommand,
psDCInfo->ui32DeviceID,
- DC_FLIP_COMMAND,
+ ui16SwapCommandID,
0,
NULL,
ui32NumSrcSyncs,
@@ -1447,6 +1487,10 @@ int PVRGetDisplayClassJTable(PVRSRV_DC_DISP2SRV_KMJTABLE * psJTable)
PVRSRVRegisterSystemISRHandler;
psJTable->pfnPVRSRVRegisterPowerDevice = PVRSRVRegisterPowerDevice;
+#if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
+ psJTable->pfnPVRSRVFreeCmdCompletePacket = &PVRSRVFreeCommandCompletePacketKM;
+#endif
+
return 1;
}