forked from intel/media-driver
-
Notifications
You must be signed in to change notification settings - Fork 4
media driver buffer sharing #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dylanintel
wants to merge
1
commit into
VCDP:intel-media-kbl
Choose a base branch
from
dylanintel:intel-media-kbl-final
base: intel-media-kbl
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
media_driver/agnostic/common/vp/hal/vphal_render_blitter.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| #include "vphal_render_blitter.h" | ||
| #include <unistd.h> | ||
| #include "vphal_renderer.h" | ||
| #include "vphal_debug.h" | ||
|
|
||
|
|
||
| VPHAL_BLITTER_STATE::VPHAL_BLITTER_STATE( | ||
| PMOS_INTERFACE pOsInterface, | ||
| PRENDERHAL_INTERFACE pRenderHal, | ||
| PVPHAL_RNDR_PERF_DATA pPerfData, | ||
| MOS_STATUS *peStatus | ||
| ):RenderState(pOsInterface, pRenderHal, pPerfData, peStatus) | ||
| {} | ||
|
|
||
|
|
||
| VPHAL_BLITTER_STATE::~VPHAL_BLITTER_STATE() | ||
| {} | ||
|
|
||
| int VPHAL_BLITTER_STATE::iframe=0; | ||
|
|
||
| MOS_STATUS VPHAL_BLITTER_STATE::Initialize( | ||
| const VphalSettings *pSettings, | ||
| Kdll_State *pKernelDllState) | ||
| { | ||
| MOS_STATUS eStatus; | ||
| PRENDERHAL_INTERFACE pRenderHal; | ||
| PVPHAL_BLITTER_STATE pBlitterState = this; | ||
|
|
||
| eStatus = MOS_STATUS_SUCCESS; | ||
| pRenderHal = pBlitterState->m_pRenderHal; | ||
|
|
||
| if(pRenderHal == nullptr) | ||
| { | ||
| eStatus = MOS_STATUS_UNKNOWN; | ||
| goto finish; | ||
| } | ||
|
|
||
| MOS_UNUSED(pSettings); | ||
| VPHAL_RENDER_CHK_NULL(pKernelDllState); | ||
|
|
||
| if(m_reporting == nullptr) | ||
| { | ||
| m_reporting = MOS_New(VphalFeatureReport); | ||
| } | ||
|
|
||
| pBlitterState->m_pKernelDllState = pKernelDllState; | ||
|
|
||
| finish: | ||
| return eStatus; | ||
|
|
||
| } | ||
|
|
||
| MOS_STATUS VPHAL_BLITTER_STATE::Render( | ||
| PCVPHAL_RENDER_PARAMS pcRenderParams, | ||
| RenderpassData *pRenderPassData) // RenderpassData isn't used | ||
| { | ||
| MOS_STATUS eStatus = MOS_STATUS_SUCCESS; | ||
|
|
||
| PVPHAL_SURFACE pSrcSurface; | ||
| PVPHAL_SURFACE pOutputSurface; | ||
| PMOS_INTERFACE pOsInterface; | ||
|
|
||
| pSrcSurface = pcRenderParams->pSrc[0]; | ||
| pOutputSurface = pcRenderParams->pTarget[0]; | ||
| PVPHAL_BLITTER_STATE pBlitterState = this; | ||
| pOsInterface = pBlitterState->m_pOsInterface; | ||
|
|
||
| MOS_UNUSED(pcRenderParams); | ||
| VPHAL_RENDER_ASSERT(pSrcSurface); | ||
| VPHAL_RENDER_ASSERT(pOutputSurface); | ||
|
|
||
| drm_intel_bo_switch(pSrcSurface->OsResource.bo , pOutputSurface->OsResource.bo, pSrcSurface->OsResource.pGmmResInfo->GetBaseHeight() * 3 / 2, pSrcSurface->OsResource.pGmmResInfo->GetRenderPitch()); | ||
|
|
||
| /* The first frame could get good result after waiting a period of time. This will be modified soon.*/ | ||
| if (iframe == 0) | ||
| { | ||
| usleep(10000); //sleep 10ms for the first frame | ||
| iframe++; | ||
| } | ||
|
|
||
| VpHal_RndrUpdateStatusTableAfterSubmit(pOsInterface, &m_StatusTableUpdateParams, MOS_GPU_CONTEXT_BLITTER, eStatus); | ||
| return eStatus; | ||
| } | ||
|
|
||
| MOS_STATUS VpHal_RndrRenderBlitter( | ||
| VphalRenderer *pRenderer, | ||
| PVPHAL_RENDER_PARAMS pRenderParams, | ||
| RenderpassData *pRenderPassData) | ||
| { | ||
| MOS_STATUS eStatus; | ||
| PMOS_INTERFACE pOsInterface; | ||
| RenderState *pRenderState; | ||
| VphalFeatureReport* pReport; | ||
|
|
||
|
|
||
| //------------------------------------------------------ | ||
| VPHAL_RENDER_ASSERT(pRenderer); | ||
| VPHAL_RENDER_ASSERT(pRenderParams); | ||
| //------------------------------------------------------ | ||
|
|
||
| eStatus = MOS_STATUS_SUCCESS; | ||
| pReport = pRenderer->GetReport(); | ||
| pRenderState = pRenderer->pRender[VPHAL_RENDER_ID_BLITTER]; | ||
|
|
||
|
|
||
|
|
||
| VPHAL_RENDER_CHK_NULL(pRenderState); | ||
| VPHAL_RENDER_ASSERT(pRenderState->GetRenderHalInterface()); | ||
|
|
||
| pRenderer->pRender[VPHAL_RENDER_ID_BLITTER]->SetStatusReportParams(pRenderer, pRenderParams); | ||
|
|
||
| VPHAL_RENDER_CHK_STATUS(pRenderState->Render( | ||
| pRenderParams, | ||
| pRenderPassData)); | ||
|
|
||
| pRenderState->CopyReporting(pReport); | ||
|
|
||
| finish: | ||
| VPHAL_RENDER_NORMALMESSAGE("VPOutputPipe = %d, VEFeatureInUse = %d", | ||
| pRenderer->GetReport()->OutputPipeMode, pRenderer->GetReport()->VEFeatureInUse); | ||
|
|
||
| return eStatus; | ||
|
|
||
|
|
||
| } | ||
78 changes: 78 additions & 0 deletions
78
media_driver/agnostic/common/vp/hal/vphal_render_blitter.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /*buffer sharing in hal layer for video copy*/ | ||
| //! | ||
| //! \file vphal_render_blitter.h | ||
| //! \brief Common interface and structure used in Blitter | ||
| //! \details Common interface and structure used in Blitter which are platform independent | ||
| //! | ||
|
|
||
| #ifndef __VPHAL_RENDER_BLITTER_H__ | ||
| #define __VPHAL_RENDER_BLITTER_H__ | ||
|
|
||
| #include "vphal_render_renderstate.h" | ||
| #include "vphal_common.h" | ||
| #include "hal_kerneldll.h" | ||
| #include "mos_os.h" | ||
|
|
||
|
|
||
|
|
||
|
|
||
| typedef class VPHAL_BLITTER_STATE *PVPHAL_BLITTER_STATE; | ||
|
|
||
| class VPHAL_BLITTER_STATE : public RenderState | ||
| { | ||
|
|
||
| public: | ||
|
|
||
| Kdll_State *m_pKernelDllState; //!< Kernel DLL state | ||
| static int iframe; | ||
|
|
||
| VPHAL_BLITTER_STATE( | ||
| PMOS_INTERFACE pOsInterface, | ||
| PRENDERHAL_INTERFACE pRenderHal, | ||
| PVPHAL_RNDR_PERF_DATA pPerfData, | ||
| MOS_STATUS *peStatus | ||
| ); | ||
|
|
||
| VPHAL_BLITTER_STATE( const VPHAL_BLITTER_STATE& ) = delete; | ||
| VPHAL_BLITTER_STATE& operator=(const VPHAL_BLITTER_STATE&) = delete; | ||
|
|
||
| virtual ~VPHAL_BLITTER_STATE(); | ||
|
|
||
| virtual MOS_STATUS Initialize( | ||
| const VphalSettings *pSettings, | ||
| Kdll_State *pKernelDllState); | ||
|
|
||
| virtual void Destroy() | ||
| {}; | ||
|
|
||
| virtual bool IsNeeded( | ||
| PCVPHAL_RENDER_PARAMS pcRenderParams, | ||
| RenderpassData *pRenderPassData) | ||
| { | ||
|
|
||
| return false; | ||
| }; | ||
|
|
||
|
|
||
| virtual bool IsMultipleStreamSupported() | ||
| { | ||
|
|
||
| return false; | ||
| }; | ||
|
|
||
|
|
||
| virtual MOS_STATUS Render( | ||
| PCVPHAL_RENDER_PARAMS pcRenderParams, | ||
| RenderpassData *pRenderPassData); | ||
|
|
||
| }; | ||
|
|
||
| MOS_STATUS VpHal_RndrRenderBlitter( | ||
| VphalRenderer *pRenderer, | ||
| PVPHAL_RENDER_PARAMS pRenderParams, | ||
| RenderpassData *pRenderPassData); | ||
|
|
||
|
|
||
| #endif // __VPHAL_RENDER_BLITTER_H__ | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which place to initialize the "uiCurrentChannel"? Suggest to use VPHAL_RENDER_ID_BLITTER to find the render instance.