Skip to content

Commit

Permalink
[Media Common] [VP]get clear color address
Browse files Browse the repository at this point in the history
get clear color address
  • Loading branch information
gfxbot authored and intel-mediadev committed Jul 19, 2023
1 parent b361217 commit 7ab0441
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
4 changes: 4 additions & 0 deletions media_common/agnostic/common/os/mos_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,10 @@ typedef struct _MOS_INTERFACE
PMOS_INTERFACE pOsInterface,
PMOS_RESOURCE pResource);

uint64_t (*pfnGetResourceClearAddress)(
PMOS_INTERFACE pOsInterface,
PMOS_RESOURCE pResource);

MOS_STATUS (* pfnSetPatchEntry) (
PMOS_INTERFACE pOsInterface,
PMOS_PATCH_ENTRY_PARAMS pParams);
Expand Down
19 changes: 19 additions & 0 deletions media_driver/linux/common/os/mos_os_specific.c
Original file line number Diff line number Diff line change
Expand Up @@ -4271,6 +4271,24 @@ uint64_t Mos_Specific_GetResourceGfxAddress(
return pResource->bo->offset64;
}

//!
//! \brief Get Clear Color Address
//! \details The clear color address
//! \param PMOS_INTERFACE pOsInterface
//! [in] OS Interface
//! \param PMOS_RESOURCE pResource
//! [in] OS resource structure
//! \return uint64_t
//! The clear color address
//!
uint64_t Mos_Specific_GetResourceClearAddress(
PMOS_INTERFACE pOsInterface,
PMOS_RESOURCE pResource)
{
uint64_t ui64ClearColorAddress = 0;
return ui64ClearColorAddress;
}

//!
//! \brief Resizes the buffer to be used for rendering GPU commands
//! \details return true if succeeded - command buffer will be large enough to hold dwMaxSize
Expand Down Expand Up @@ -7047,6 +7065,7 @@ MOS_STATUS Mos_Specific_InitInterface(
pOsInterface->pfnResetResourceAllocationIndex = Mos_Specific_ResetResourceAllocationIndex;
pOsInterface->pfnGetResourceAllocationIndex = Mos_Specific_GetResourceAllocationIndex;
pOsInterface->pfnGetResourceGfxAddress = Mos_Specific_GetResourceGfxAddress;
pOsInterface->pfnGetResourceClearAddress = Mos_Specific_GetResourceClearAddress;
pOsInterface->pfnGetCommandBuffer = Mos_Specific_GetCommandBuffer;
pOsInterface->pfnResetCommandBuffer = Mos_Specific_ResetCommandBuffer;
pOsInterface->pfnReturnCommandBuffer = Mos_Specific_ReturnCommandBuffer;
Expand Down
12 changes: 10 additions & 2 deletions media_softlet/agnostic/common/renderhal/renderhal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6783,11 +6783,19 @@ MOS_STATUS RenderHal_SendSurfaceStateEntry(
*(pdwCmd + 11) = *(pdwCmd + 11) | (uint32_t)((auxAddress & 0x0000FFFF00000000) >> 32);
}

if (pMosResource->pGmmResInfo->GetUnifiedAuxSurfaceOffset(GMM_AUX_CC))
uint64_t clearAddress = 0;
if (pOsInterface->trinityPath != TRINITY_DISABLED)
{
clearAddress = pOsInterface->pfnGetResourceClearAddress(pOsInterface, pMosResource);
}
else if (pMosResource->pGmmResInfo->GetUnifiedAuxSurfaceOffset(GMM_AUX_CC))
{
// Set GFX address of ClearAddress
// Should use original resource address here
uint64_t clearAddress = ui64GfxAddressWithoutOffset + (uint32_t)pMosResource->pGmmResInfo->GetUnifiedAuxSurfaceOffset(GMM_AUX_CC);
clearAddress = ui64GfxAddressWithoutOffset + (uint32_t)pMosResource->pGmmResInfo->GetUnifiedAuxSurfaceOffset(GMM_AUX_CC);
}
if (clearAddress)
{
*(pdwCmd + 12) = (*(pdwCmd + 12) & 0x0000001F) | (uint32_t)(clearAddress & 0x00000000FFFFFFE0);
*(pdwCmd + 13) = *(pdwCmd + 13) | (uint32_t)((clearAddress & 0x0000FFFF00000000) >> 32);
}
Expand Down
19 changes: 19 additions & 0 deletions media_softlet/linux/common/os/private/mos_os_specific.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,24 @@ uint64_t Mos_Specific_GetResourceGfxAddress(
return MosInterface::GetResourceGfxAddress(osInterface->osStreamState, resource);
}

//!
//! \brief Get Clear Color Address
//! \details The clear color address
//! \param PMOS_INTERFACE pOsInterface
//! [in] OS Interface
//! \param PMOS_RESOURCE pResource
//! [in] OS resource structure
//! \return uint64_t
//! The clear color address
//!
uint64_t Mos_Specific_GetResourceClearAddress(
PMOS_INTERFACE pOsInterface,
PMOS_RESOURCE pResource)
{
uint64_t ui64ClearColorAddress = 0;
return ui64ClearColorAddress;
}

//!
//! \brief Resizes the buffer to be used for rendering GPU commands
//! \details return true if succeeded - command buffer will be large enough to hold dwMaxSize
Expand Down Expand Up @@ -3419,6 +3437,7 @@ MOS_STATUS Mos_Specific_LoadFunction(
osInterface->pfnResetResourceAllocationIndex = Mos_Specific_ResetResourceAllocationIndex;
osInterface->pfnGetResourceAllocationIndex = Mos_Specific_GetResourceAllocationIndex;
osInterface->pfnGetResourceGfxAddress = Mos_Specific_GetResourceGfxAddress;
osInterface->pfnGetResourceClearAddress = Mos_Specific_GetResourceClearAddress;
osInterface->pfnGetCommandBuffer = Mos_Specific_GetCommandBuffer;
osInterface->pfnResetCommandBuffer = Mos_Specific_ResetCommandBuffer;
osInterface->pfnReturnCommandBuffer = Mos_Specific_ReturnCommandBuffer;
Expand Down

0 comments on commit 7ab0441

Please sign in to comment.