⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interrupt.c

📁 SAMSUNG S3C6410 CPU BSP for winmobile6
💻 C
📖 第 1 页 / 共 2 页
字号:

			//EnterCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
			pCtxt->LocalPathCmdCtxt.bCmdSetWin2Enable = FALSE;
			//LeaveCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
		}
#endif

		//---------------------------
		// Processing Local Path Command
		//---------------------------

		// Command : Local Path for Win0 Disable
		if (pCtxt->LocalPathCmdCtxt.bCmdSetWin0Disable)
		{
			Disp_envid_onoff(DISP_ENVID_DIRECT_OFF);
			Post_processing_stop();
			Disp_window_onfoff(DISP_WIN0, DISP_WINDOW_OFF);
			Disp_envid_onoff(DISP_ENVID_ON);

			//EnterCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
			pCtxt->LocalPathCmdCtxt.bCmdSetWin0Disable = FALSE;
			//LeaveCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
		}

		//-----------------------------------
		// Processing Display Controller Command
		//-----------------------------------
		for (iWinNum = DISP_WIN0; iWinNum < DISP_WIN4; iWinNum++)
		{
			// Command : Set Frame Buffer
			if (pCtxt->DispCmdCtxt[iWinNum].bCmdSetBuffer)
			{
				Disp_set_framebuffer(iWinNum, pCtxt->DispCmdCtxt[iWinNum].dwBuffer);

				//EnterCriticalSection(&pCtxt->DispCmdCtxt[iWinNum].csCmd);
				pCtxt->DispCmdCtxt[iWinNum].bCmdSetBuffer = FALSE;
				//LeaveCriticalSection(&pCtxt->DispCmdCtxt[iWinNum].csCmd);
			}

			// Command : Set Position
			if (pCtxt->DispCmdCtxt[iWinNum].bCmdSetPosition)
			{
				Disp_set_window_position(iWinNum, pCtxt->DispCmdCtxt[iWinNum].dwOffsetX, pCtxt->DispCmdCtxt[iWinNum].dwOffsetY);

				//EnterCriticalSection(&pCtxt->DispCmdCtxt[iWinNum].csCmd);
				pCtxt->DispCmdCtxt[iWinNum].bCmdSetPosition = FALSE;
				//LeaveCriticalSection(&pCtxt->DispCmdCtxt[iWinNum].csCmd);
			}
		}

		// Clear Interrupt Pending
		Disp_clear_interrupt_pending();

		InterruptDone(pCtxt->dwSysIntrDisp);

		PulseEvent(pCtxt->hDispCmdDone);

#if	0	// for debugging
		if ((pCtxt->pDispConReg->VIDCON1 & (0x3<<13)) == (0x2<<13))
		{
			VDE_ERR((_T("[VDE:ERR] SVE_DisplayIntrThread() : CMD Processing finished Too Late!!!\n\r")));
		}
#endif
	}

	VDE_MSG((_T("[VDE] --SVE_DisplayIntrThread()\n\r")));

	return 0;
}

DWORD SVE_PostIntrThread(void)
{
	SVEngineContext *pCtxt;

	VDE_MSG((_T("[VDE] ++SVE_PostIntrThread()\n\r")));

	pCtxt = SVE_get_context();

	CeSetThreadPriority(pCtxt->hPostIST, SVE_IST_PRIORITY);

	while(1)
	{
		WaitForSingleObject(pCtxt->hInterruptPost, INFINITE);
#if 0 // because of System Hang problem, move to Display Interrupt Thread
		//---------------------------
		// Processing Local Path Command
		//---------------------------

		// Command : Local Path for Win0 Disable
		if (pCtxt->LocalPathCmdCtxt.bCmdSetWin0Disable)
		{
			Post_processing_stop();
			Disp_window_onfoff(DISP_WIN0, DISP_WINDOW_OFF);

			//EnterCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
			pCtxt->LocalPathCmdCtxt.bCmdSetWin0Disable = FALSE;
			//LeaveCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
		}
#endif
#if	0
		// Command : Local Path for Win1 Disable
		if (pCtxt->LocalPathCmdCtxt.bCmdSetWin1Disable)
		{
			// TODO: Camera Preview Path disable
			Disp_window_onfoff(DISP_WIN1, DISP_WINDOW_OFF);

			//EnterCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
			pCtxt->LocalPathCmdCtxt.bCmdSetWin1Disable = FALSE;
			//LeaveCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
		}

		// Command : Local Path for Win2 Disable
		if (pCtxt->LocalPathCmdCtxt.bCmdSetWin2Disable)
		{
			// TODO: Camera Codec Path disable
			Disp_window_onfoff(DISP_WIN2, DISP_WINDODISP_WINDOW_OFFW_ON);

			//EnterCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
			pCtxt->LocalPathCmdCtxt.bCmdSetWin2Disable = FALSE;
			//LeaveCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
		}
#endif

		//-----------------------------------
		// Processing Post Processor Command
		//-----------------------------------

		// Command : Set Src Buffer
		if (pCtxt->PostCmdCtxt.bCmdSetSrcBuffer)
		{
			// At this time we can not update current address from next address
			// Because current address is updated at the start of interrupt
			// So, in the IST we can change only current address to make affect

			//EnterCriticalSection(&pCtxt->PostCmdCtxt.csCmd);
			pCtxt->PostCmdCtxt.bCmdSetSrcBuffer = FALSE;
			//LeaveCriticalSection(&pCtxt->PostCmdCtxt.csCmd);
		}

		// Command : Set Dst Buffer
		if (pCtxt->PostCmdCtxt.bCmdSetDstBuffer)
		{
			// At this time we can not update current address from next address
			// Because current address is updated at the start of interrupt
			// So, in the IST we can change only current address to make affect

			//EnterCriticalSection(&pCtxt->PostCmdCtxt.csCmd);
			pCtxt->PostCmdCtxt.bCmdSetDstBuffer = FALSE;
			//LeaveCriticalSection(&pCtxt->PostCmdCtxt.csCmd);
		}

		// Clear Interrupt Pending
		Post_clear_interrupt_pending();

		InterruptDone(pCtxt->dwSysIntrPost);

		PulseEvent(pCtxt->hPostCmdDone);
	}

	VDE_MSG((_T("[VDE] --SVE_PostIntrThread()\n\r")));

	return 0;
}

DWORD SVE_RotatorIntrThread(void)
{
	SVEngineContext *pCtxt;
	BOOL bIntPending;

	VDE_MSG((_T("[VDE] ++SVE_RotatorIntrThread()\n\r")));

	pCtxt = SVE_get_context();

	CeSetThreadPriority(pCtxt->hRotatorIST, SVE_IST_PRIORITY);

	while(1)
	{
		WaitForSingleObject(pCtxt->hInterruptRotator, INFINITE);

		// Clear Interrupt Pending
		bIntPending = Rotator_clear_interrupt_pending();
		if (!bIntPending)
		{
			VDE_ERR((_T("[VDE:ERR] SVE_RotatorIntrThread() : Interrupt Occurs, But Pending Bit was not Set\n\r")));
		}

		// Image Rotator Operation Finished
		pCtxt->bRotatorBusy = FALSE;

		InterruptDone(pCtxt->dwSysIntrRotator);

		PulseEvent(pCtxt->hRotatorFinish);
	}

	VDE_MSG((_T("[VDE] --SVE_RotatorIntrThread()\n\r")));

	return 0;
}

DWORD SVE_TVScalerIntrThread(void)
{
	SVEngineContext *pCtxt;

	VDE_MSG((_T("[VDE] ++SVE_TVScalerIntrThread()\n\r")));

	pCtxt = SVE_get_context();

	CeSetThreadPriority(pCtxt->hTVScalerIST, SVE_IST_PRIORITY);

	while(1)
	{
		WaitForSingleObject(pCtxt->hInterruptTVSC, INFINITE);

#if	0	// TV Out Command
		//---------------------------
		// Processing Local Path Command
		//---------------------------

		// Command : Local Path for Win0 Disable
		if (pCtxt->LocalPathCmdCtxt.bCmdSetWin0Disable)
		{
			Post_processing_stop();
			Disp_window_onfoff(DISP_WIN0, DISP_WINDOW_OFF);

			//EnterCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
			pCtxt->LocalPathCmdCtxt.bCmdSetWin0Disable = FALSE;
			//LeaveCriticalSection(&pCtxt->LocalPathCmdCtxt.csCmd);
		}
#endif

		//-----------------------------------
		// Processing TV Scaler Command
		//-----------------------------------

		// Command : Set Src Buffer
		if (pCtxt->TVSCCmdCtxt.bCmdSetSrcBuffer)
		{
			// At this time we can not update current address from next address
			// Because current address is updated at the start of interrupt
			// So, in the IST we can change only current address to make affect

			//EnterCriticalSection(&pCtxt->TVSCCmdCtxt.csCmd);
			pCtxt->TVSCCmdCtxt.bCmdSetSrcBuffer = FALSE;
			//LeaveCriticalSection(&pCtxt->TVSCCmdCtxt.csCmd);
		}

		// Command : Set Dst Buffer
		if (pCtxt->TVSCCmdCtxt.bCmdSetDstBuffer)
		{
			// At this time we can not update current address from next address
			// Because current address is updated at the start of interrupt
			// So, in the IST we can change only current address to make affect

			//EnterCriticalSection(&pCtxt->TVSCCmdCtxt.csCmd);
			pCtxt->TVSCCmdCtxt.bCmdSetDstBuffer = FALSE;
			//LeaveCriticalSection(&pCtxt->TVSCCmdCtxt.csCmd);
		}

		// Clear Interrupt Pending
		TVSC_clear_interrupt_pending();

		InterruptDone(pCtxt->dwSysIntrTVSC);

		PulseEvent(pCtxt->hTVSCCmdDone);
	}

	VDE_MSG((_T("[VDE] --SVE_TVScalerIntrThread()\n\r")));

	return 0;
}

DWORD SVE_wait_disp_cmd_done(void)
{
	return WaitForSingleObject(SVE_get_context()->hDispCmdDone, SVE_DISP_CMD_TIMEOUT);
}

DWORD SVE_wait_post_cmd_done(void)
{
	return WaitForSingleObject(SVE_get_context()->hPostCmdDone, SVE_POST_CMD_TIMEOUT);
}

DWORD SVE_wait_tvsc_cmd_done(void)
{
	return WaitForSingleObject(SVE_get_context()->hTVSCCmdDone, SVE_TVSC_CMD_TIMEOUT);
}

DWORD SVE_wait_rotator_finish(void)
{
	return WaitForSingleObject(SVE_get_context()->hRotatorFinish, SVE_ROTATOR_FINISH_TIMEOUT);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -