From 450fe7f00c8babcfc636293f86e0775120aaf63a Mon Sep 17 00:00:00 2001 From: Cai_Jianxing Date: Fri, 1 Sep 2023 10:44:16 +0800 Subject: [PATCH] [Media Common] [VP] fix cov issue fix cov issue! --- .../Xe_M/Xe_XPM/hw/mhw_state_heap_xe_xpm.c | 240 ++++++++---------- .../common/os/mos_util_user_interface.cpp | 3 - .../common/renderhal/renderhal_dsh.cpp | 4 +- .../shared/mediacopy/media_blt_copy.cpp | 2 +- .../common/vp/hal/vphal_render_composite.cpp | 18 +- .../common/vp/hal/vphal_render_vebox_base.cpp | 6 - .../agnostic/gen12/hw/mhw_vebox_g12_X.cpp | 11 - .../mediacopy/media_blt_copy_xe_xpm_plus.cpp | 2 +- .../Xe_HPG_Base/hw/mhw_render_xe_hpg_impl.h | 5 - .../heap_manager/memory_block_manager.cpp | 6 +- .../agnostic/common/hw/mhw_render_impl.h | 4 +- .../agnostic/common/hw/mhw_state_heap.cpp | 6 +- .../agnostic/common/os/mos_gpucontext_next.h | 2 +- .../agnostic/common/renderhal/renderhal.cpp | 2 +- .../media_vdbox_sfc_render.cpp | 2 +- .../common/vp/hal/bufferMgr/vp_allocator.cpp | 2 +- .../vp/hal/bufferMgr/vp_resource_manager.cpp | 2 +- .../common/vp/hal/feature_manager/policy.cpp | 7 +- .../vp/hal/feature_manager/sw_filter_pipe.cpp | 1 + .../common/vp/hal/features/vp_hdr_filter.cpp | 2 +- .../common/vp/hal/packet/vp_packet_pipe.cpp | 1 - .../vp/hal/packet/vp_render_sfc_base.cpp | 1 - .../vp_scalability_multipipe_next.cpp | 2 +- 23 files changed, 134 insertions(+), 197 deletions(-) diff --git a/media_driver/agnostic/Xe_M/Xe_XPM/hw/mhw_state_heap_xe_xpm.c b/media_driver/agnostic/Xe_M/Xe_XPM/hw/mhw_state_heap_xe_xpm.c index cc7aaec3873..d7891b63a8f 100644 --- a/media_driver/agnostic/Xe_M/Xe_XPM/hw/mhw_state_heap_xe_xpm.c +++ b/media_driver/agnostic/Xe_M/Xe_XPM/hw/mhw_state_heap_xe_xpm.c @@ -223,153 +223,113 @@ MOS_STATUS MHW_STATE_HEAP_INTERFACE_XE_XPM::SetSurfaceStateEntry( uint32_t TileMode = (pParams->bGMMTileEnabled) ? pParams->TileModeGMM : ((pParams->bTiledSurface) ? ((pParams->bTileWalk == 0) ? 2 /*x-tile*/ : 3 /*y-tile*/) : 0); /*linear*/ - if (pParams->bUseAdvState) + + // Obtain the Pointer to the Surface state from SSH Buffer + + mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD* pSurfaceState = + (mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD*) pParams->pSurfaceState; + MHW_MI_CHK_NULL(pSurfaceState); + + // Initialize Surface State + *pSurfaceState = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD(); + + pSurfaceState->DW0.SurfaceType = pParams->SurfaceType3D; + pSurfaceState->DW0.SurfaceFormat = pParams->dwFormat; + pSurfaceState->DW0.TileMode = TileMode; + pSurfaceState->DW0.VerticalLineStride = pParams->bVerticalLineStride; + pSurfaceState->DW0.VerticalLineStrideOffset = pParams->bVerticalLineStrideOffset; + pSurfaceState->DW0.SurfaceHorizontalAlignment = 1; + pSurfaceState->DW0.SurfaceVerticalAlignment = 1; + + pSurfaceState->DW1.MemoryObjectControlState = pParams->dwCacheabilityControl; + if (pParams->SurfaceType3D == GFX3DSTATE_SURFACETYPE_BUFFER) + { // Buffer resources - use original width/height/pitch/depth + pSurfaceState->DW2.Width = pParams->dwWidth; + pSurfaceState->DW2.Height = pParams->dwHeight; + pSurfaceState->DW3.SurfacePitch = pParams->dwPitch; + pSurfaceState->DW3.Depth = pParams->dwDepth; + } + else { - // Obtain the Pointer to the Surface state from SSH Buffer - mhw_state_heap_xe_xpm::MEDIA_SURFACE_STATE_CMD* pSurfaceStateAdv = - (mhw_state_heap_xe_xpm::MEDIA_SURFACE_STATE_CMD*) pParams->pSurfaceState; - MHW_MI_CHK_NULL(pSurfaceStateAdv); - // Initialize Surface State - *pSurfaceStateAdv = mhw_state_heap_xe_xpm::MEDIA_SURFACE_STATE_CMD(); - - pSurfaceStateAdv->DW0.Rotation = pParams->RotationMode; - pSurfaceStateAdv->DW0.XOffset = pParams->iXOffset >> 2; - pSurfaceStateAdv->DW0.YOffset = pParams->iYOffset >> 2; - pSurfaceStateAdv->DW0.CompressionFormat = pParams->dwCompressionFormat; - pSurfaceStateAdv->DW1.Width = pParams->dwWidth - 1; - pSurfaceStateAdv->DW1.Height = pParams->dwHeight - 1; - pSurfaceStateAdv->DW1.CrVCbUPixelOffsetVDirection = pParams->UVPixelOffsetVDirection & 3; - pSurfaceStateAdv->DW2.CrVCbUPixelOffsetVDirectionMsb = pParams->UVPixelOffsetVDirection >> 2; - pSurfaceStateAdv->DW2.CrVCbUPixelOffsetUDirection = pParams->UVPixelOffsetUDirection; - pSurfaceStateAdv->DW2.SurfaceFormat = pParams->dwFormat; - pSurfaceStateAdv->DW2.InterleaveChroma = pParams->bInterleaveChroma; - pSurfaceStateAdv->DW2.SurfacePitch = pParams->dwPitch - 1; - pSurfaceStateAdv->DW2.HalfPitchForChroma = pParams->bHalfPitchChroma; - pSurfaceStateAdv->DW2.TileMode = TileMode; - pSurfaceStateAdv->DW2.MemoryCompressionEnable = - (pParams->MmcState == MOS_MEMCOMP_RC || pParams->MmcState == MOS_MEMCOMP_MC) ? 1 : 0; - pSurfaceStateAdv->DW2.MemoryCompressionType = - (pParams->MmcState == MOS_MEMCOMP_RC) ? 1 : 0; - pSurfaceStateAdv->DW3.XOffsetForUCb = pParams->dwXOffsetForU; - pSurfaceStateAdv->DW3.YOffsetForUCb = pParams->dwYOffsetForU; - pSurfaceStateAdv->DW4.XOffsetForVCr = pParams->dwXOffsetForV; - pSurfaceStateAdv->DW4.YOffsetForVCr = pParams->dwYOffsetForV; - pSurfaceStateAdv->DW5.VerticalLineStride = pParams->bVerticalLineStride; - pSurfaceStateAdv->DW5.VerticalLineStrideOffset = pParams->bVerticalLineStrideOffset; - pSurfaceStateAdv->DW5.SurfaceMemoryObjectControlState = pParams->dwCacheabilityControl; - - // Return offset and pointer for patching - pParams->pdwCmd = (uint32_t *)&(pSurfaceStateAdv->DW6.Value); - pParams->dwLocationInCmd = 6; + pSurfaceState->DW1.SurfaceQpitch = pParams->dwQPitch >> 2; + pSurfaceState->DW2.Width = pParams->dwWidth - 1; + pSurfaceState->DW2.Height = pParams->dwHeight - 1; + pSurfaceState->DW3.SurfacePitch = pParams->dwPitch - 1; + pSurfaceState->DW3.Depth = pParams->dwDepth - 1; } - else // not AVS + pSurfaceState->DW4.RenderTargetAndSampleUnormRotation = pParams->RotationMode; + pSurfaceState->DW5.XOffset = pParams->iXOffset >> 2; + pSurfaceState->DW5.YOffset = pParams->iYOffset >> 2; + pSurfaceState->DW6.Obj2.SeparateUvPlaneEnable = pParams->bSeperateUVPlane; + pSurfaceState->DW6.Obj2.HalfPitchForChroma = pParams->bHalfPitchChroma; + pSurfaceState->DW6.Obj2.XOffsetForUOrUvPlane = pParams->dwXOffsetForU; + pSurfaceState->DW6.Obj2.YOffsetForUOrUvPlane = pParams->dwYOffsetForU; + + // Set L1 Cache control + pSurfaceState->DW5.L1CachePolicy = pParams->L1CacheConfig; + + // R8B8G8A8 is designed to represent media AYUV format. + // But from Gen10+ 3D sampler doesn't support R8B8G8A8 format any more. + // Use R8G8B8A8 + Channel Select to fake it. + if (pParams->dwFormat == MHW_GFX3DSTATE_SURFACEFORMAT_R8B8G8A8_UNORM) { - // Obtain the Pointer to the Surface state from SSH Buffer - - mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD* pSurfaceState = - (mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD*) pParams->pSurfaceState; - MHW_MI_CHK_NULL(pSurfaceState); - - // Initialize Surface State - *pSurfaceState = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD(); - - pSurfaceState->DW0.SurfaceType = pParams->SurfaceType3D; - pSurfaceState->DW0.SurfaceFormat = pParams->dwFormat; - pSurfaceState->DW0.TileMode = TileMode; - pSurfaceState->DW0.VerticalLineStride = pParams->bVerticalLineStride; - pSurfaceState->DW0.VerticalLineStrideOffset = pParams->bVerticalLineStrideOffset; - pSurfaceState->DW0.SurfaceHorizontalAlignment = 1; - pSurfaceState->DW0.SurfaceVerticalAlignment = 1; - - pSurfaceState->DW1.MemoryObjectControlState = pParams->dwCacheabilityControl; - if (pParams->SurfaceType3D == GFX3DSTATE_SURFACETYPE_BUFFER) - { // Buffer resources - use original width/height/pitch/depth - pSurfaceState->DW2.Width = pParams->dwWidth; - pSurfaceState->DW2.Height = pParams->dwHeight; - pSurfaceState->DW3.SurfacePitch = pParams->dwPitch; - pSurfaceState->DW3.Depth = pParams->dwDepth; - } - else - { - pSurfaceState->DW1.SurfaceQpitch = pParams->dwQPitch >> 2; - pSurfaceState->DW2.Width = pParams->dwWidth - 1; - pSurfaceState->DW2.Height = pParams->dwHeight - 1; - pSurfaceState->DW3.SurfacePitch = pParams->dwPitch - 1; - pSurfaceState->DW3.Depth = pParams->dwDepth - 1; - } - pSurfaceState->DW4.RenderTargetAndSampleUnormRotation = pParams->RotationMode; - pSurfaceState->DW5.XOffset = pParams->iXOffset >> 2; - pSurfaceState->DW5.YOffset = pParams->iYOffset >> 2; - pSurfaceState->DW6.Obj2.SeparateUvPlaneEnable = pParams->bSeperateUVPlane; - pSurfaceState->DW6.Obj2.HalfPitchForChroma = pParams->bHalfPitchChroma; - pSurfaceState->DW6.Obj2.XOffsetForUOrUvPlane = pParams->dwXOffsetForU; - pSurfaceState->DW6.Obj2.YOffsetForUOrUvPlane = pParams->dwYOffsetForU; - - // Set L1 Cache control - pSurfaceState->DW5.L1CachePolicy = pParams->L1CacheConfig; - - // R8B8G8A8 is designed to represent media AYUV format. - // But from Gen10+ 3D sampler doesn't support R8B8G8A8 format any more. - // Use R8G8B8A8 + Channel Select to fake it. - if (pParams->dwFormat == MHW_GFX3DSTATE_SURFACEFORMAT_R8B8G8A8_UNORM) - { - pSurfaceState->DW0.SurfaceFormat = MHW_GFX3DSTATE_SURFACEFORMAT_R8G8B8A8_UNORM; - pSurfaceState->DW7.ShaderChannelSelectAlpha = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_ALPHA_ALPHA; - pSurfaceState->DW7.ShaderChannelSelectBlue = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_GREEN_GREEN; - pSurfaceState->DW7.ShaderChannelSelectGreen = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_BLUE_BLUE; - pSurfaceState->DW7.ShaderChannelSelectRed = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_RED_RED; - } - else - { - pSurfaceState->DW7.ShaderChannelSelectAlpha = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_ALPHA_ALPHA; - pSurfaceState->DW7.ShaderChannelSelectBlue = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_BLUE_BLUE; - pSurfaceState->DW7.ShaderChannelSelectGreen = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_GREEN_GREEN; - pSurfaceState->DW7.ShaderChannelSelectRed = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_RED_RED; - } + pSurfaceState->DW0.SurfaceFormat = MHW_GFX3DSTATE_SURFACEFORMAT_R8G8B8A8_UNORM; + pSurfaceState->DW7.ShaderChannelSelectAlpha = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_ALPHA_ALPHA; + pSurfaceState->DW7.ShaderChannelSelectBlue = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_GREEN_GREEN; + pSurfaceState->DW7.ShaderChannelSelectGreen = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_BLUE_BLUE; + pSurfaceState->DW7.ShaderChannelSelectRed = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_RED_RED; + } + else + { + pSurfaceState->DW7.ShaderChannelSelectAlpha = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_ALPHA_ALPHA; + pSurfaceState->DW7.ShaderChannelSelectBlue = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_BLUE_BLUE; + pSurfaceState->DW7.ShaderChannelSelectGreen = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_GREEN_GREEN; + pSurfaceState->DW7.ShaderChannelSelectRed = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::SHADER_CHANNEL_SELECT_RED_RED; + } - // The OGL border color mode is much simpler to support in HW as no filtering of - // missing channels is required. Software will be required to use OGL border color - // mode (enabled via Sampler State) and use Shader Channel Selects to force return - // of 1.0 on missing channels. - if (pParams->bBoardColorOGL) - { - SetMissingShaderChannels(pSurfaceState, pParams->dwFormat); - } + // The OGL border color mode is much simpler to support in HW as no filtering of + // missing channels is required. Software will be required to use OGL border color + // mode (enabled via Sampler State) and use Shader Channel Selects to force return + // of 1.0 on missing channels. + if (pParams->bBoardColorOGL) + { + SetMissingShaderChannels(pSurfaceState, pParams->dwFormat); + } - if (pParams->MmcState == MOS_MEMCOMP_MC) - { - // Media Compresseion Enable on Current surface - pSurfaceState->DW7.MemoryCompressionEnable = 1; - pSurfaceState->DW7.MemoryCompressionMode = 0; - pSurfaceState->DW4.DecompressInL3 = 1; - - pSurfaceState->DW10_11.Obj1.XOffsetForVPlane = pParams->dwXOffsetForV; - pSurfaceState->DW10_11.Obj0.YOffsetForVPlane = pParams->dwYOffsetForV; - pSurfaceState->DW12.CompressionFormat = pParams->dwCompressionFormat; - } - else if(pParams->MmcState == MOS_MEMCOMP_RC) - { - // Render Compression Enable on Current Surface - pSurfaceState->DW7.MemoryCompressionEnable = 0; - pSurfaceState->DW7.MemoryCompressionMode = 0; - pSurfaceState->DW4.DecompressInL3 = 0; - pSurfaceState->DW6.Obj0.AuxiliarySurfaceMode = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::AUXILIARY_SURFACE_MODE_AUXCCSE; - // Disable CC because MEdia didn't have FCC input usage - pSurfaceState->DW10_11.Obj0.ClearValueAddressEnable = 0; - pSurfaceState->DW12.CompressionFormat = pParams->dwCompressionFormat; - } - else - { - pSurfaceState->DW10_11.Obj1.XOffsetForVPlane = pParams->dwXOffsetForV; - pSurfaceState->DW10_11.Obj0.YOffsetForVPlane = pParams->dwYOffsetForV; - } + if (pParams->MmcState == MOS_MEMCOMP_MC) + { + // Media Compresseion Enable on Current surface + pSurfaceState->DW7.MemoryCompressionEnable = 1; + pSurfaceState->DW7.MemoryCompressionMode = 0; + pSurfaceState->DW4.DecompressInL3 = 1; + + pSurfaceState->DW10_11.Obj1.XOffsetForVPlane = pParams->dwXOffsetForV; + pSurfaceState->DW10_11.Obj0.YOffsetForVPlane = pParams->dwYOffsetForV; + pSurfaceState->DW12.CompressionFormat = pParams->dwCompressionFormat; + } + else if(pParams->MmcState == MOS_MEMCOMP_RC) + { + // Render Compression Enable on Current Surface + pSurfaceState->DW7.MemoryCompressionEnable = 0; + pSurfaceState->DW7.MemoryCompressionMode = 0; + pSurfaceState->DW4.DecompressInL3 = 0; + pSurfaceState->DW6.Obj0.AuxiliarySurfaceMode = mhw_state_heap_xe_xpm::RENDER_SURFACE_STATE_CMD::AUXILIARY_SURFACE_MODE_AUXCCSE; + // Disable CC because MEdia didn't have FCC input usage + pSurfaceState->DW10_11.Obj0.ClearValueAddressEnable = 0; + pSurfaceState->DW12.CompressionFormat = pParams->dwCompressionFormat; + } + else + { + pSurfaceState->DW10_11.Obj1.XOffsetForVPlane = pParams->dwXOffsetForV; + pSurfaceState->DW10_11.Obj0.YOffsetForVPlane = pParams->dwYOffsetForV; + } - pSurfaceState->DW8_9.SurfaceBaseAddress = 0; + pSurfaceState->DW8_9.SurfaceBaseAddress = 0; + + // Return offset and pointer for patching + pParams->pdwCmd = (uint32_t *)&(pSurfaceState->DW8_9.SurfaceBaseAddress); + pParams->dwLocationInCmd = 8; - // Return offset and pointer for patching - pParams->pdwCmd = (uint32_t *)&(pSurfaceState->DW8_9.SurfaceBaseAddress); - pParams->dwLocationInCmd = 8; - } return MOS_STATUS_SUCCESS; } diff --git a/media_driver/agnostic/common/os/mos_util_user_interface.cpp b/media_driver/agnostic/common/os/mos_util_user_interface.cpp index 479fa7cefba..82986ca0718 100644 --- a/media_driver/agnostic/common/os/mos_util_user_interface.cpp +++ b/media_driver/agnostic/common/os/mos_util_user_interface.cpp @@ -89,7 +89,4 @@ PMOS_USER_FEATURE_VALUE MosUtilUserInterface::GetValue(uint32_t keyId) m_mosMutex.Unlock(); return nullptr; } - m_mosMutex.Unlock(); - - return nullptr; } diff --git a/media_driver/agnostic/common/renderhal/renderhal_dsh.cpp b/media_driver/agnostic/common/renderhal/renderhal_dsh.cpp index fd6cabd87cf..95194910be0 100644 --- a/media_driver/agnostic/common/renderhal/renderhal_dsh.cpp +++ b/media_driver/agnostic/common/renderhal/renderhal_dsh.cpp @@ -2091,10 +2091,10 @@ PRENDERHAL_MEDIA_STATE RenderHal_DSH_AssignDynamicState( pCurrentPtr = performanceMemory; pCurrentPtr += (sizeof(uint64_t) * 2); *((RENDERHAL_COMPONENT *)pCurrentPtr) = componentID; - pDynamicState->memoryBlock.AddData( + MHW_RENDERHAL_CHK_STATUS(pDynamicState->memoryBlock.AddData( performanceMemory, pDynamicState->Performance.dwOffset, - performanceSize); + performanceSize)); finish: diff --git a/media_driver/agnostic/common/shared/mediacopy/media_blt_copy.cpp b/media_driver/agnostic/common/shared/mediacopy/media_blt_copy.cpp index 6f2c0a8f248..71a0c5f87b1 100644 --- a/media_driver/agnostic/common/shared/mediacopy/media_blt_copy.cpp +++ b/media_driver/agnostic/common/shared/mediacopy/media_blt_copy.cpp @@ -361,7 +361,7 @@ MOS_STATUS BltState::SubmitCMD( } RegisterDwParams.dwData = swctrl.DW0.Value; - m_miInterface->AddMiLoadRegisterImmCmd(&cmdBuffer, &RegisterDwParams); + BLT_CHK_STATUS_RETURN(m_miInterface->AddMiLoadRegisterImmCmd(&cmdBuffer, &RegisterDwParams)); BLT_CHK_STATUS_RETURN(m_bltInterface->AddBlockCopyBlt( &cmdBuffer, diff --git a/media_driver/agnostic/common/vp/hal/vphal_render_composite.cpp b/media_driver/agnostic/common/vp/hal/vphal_render_composite.cpp index e8f2ff74f9c..27288f71c10 100644 --- a/media_driver/agnostic/common/vp/hal/vphal_render_composite.cpp +++ b/media_driver/agnostic/common/vp/hal/vphal_render_composite.cpp @@ -5858,20 +5858,10 @@ bool CompositeState::RenderBufferMediaWalker( if (pRenderingData->pTarget[1] == nullptr) { - if (pRenderingData->bCmFcEnable && pRenderingData->iLayers > 0) - { - pWalkerStatic->DW69.DestHorizontalBlockOrigin = - (uint16_t)pRenderingData->pTarget[0]->rcDst.left; - pWalkerStatic->DW69.DestVerticalBlockOrigin = - (uint16_t)pRenderingData->pTarget[0]->rcDst.top; - } - else - { - pWalkerStatic->DW69.DestHorizontalBlockOrigin = - (uint16_t)pRenderingData->pTarget[0]->rcDst.left; - pWalkerStatic->DW69.DestVerticalBlockOrigin = - (uint16_t)pRenderingData->pTarget[0]->rcDst.top; - } + pWalkerStatic->DW69.DestHorizontalBlockOrigin = + (uint16_t)pRenderingData->pTarget[0]->rcDst.left; + pWalkerStatic->DW69.DestVerticalBlockOrigin = + (uint16_t)pRenderingData->pTarget[0]->rcDst.top; AlignedRect = pRenderingData->pTarget[0]->rcDst; } else diff --git a/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.cpp b/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.cpp index 9ca28013623..cb27bf69084 100644 --- a/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.cpp +++ b/media_driver/agnostic/common/vp/hal/vphal_render_vebox_base.cpp @@ -2212,12 +2212,6 @@ MOS_STATUS VPHAL_VEBOX_STATE::VeboxSendVeboxCmd() PVPHAL_VEBOX_STATE pVeboxState = this; PVPHAL_VEBOX_RENDER_DATA pRenderData = GetLastExecRenderData(); - if (pVeboxState == nullptr) - { - VPHAL_RENDER_ASSERTMESSAGE("pVeboxState not available."); - return MOS_STATUS_INVALID_PARAMETER; - } - pRenderHal = pVeboxState->m_pRenderHal; pOsInterface = pVeboxState->m_pOsInterface; iRemaining = 0; diff --git a/media_driver/agnostic/gen12/hw/mhw_vebox_g12_X.cpp b/media_driver/agnostic/gen12/hw/mhw_vebox_g12_X.cpp index dcec36f5202..463cc5c8d1e 100644 --- a/media_driver/agnostic/gen12/hw/mhw_vebox_g12_X.cpp +++ b/media_driver/agnostic/gen12/hw/mhw_vebox_g12_X.cpp @@ -3074,17 +3074,6 @@ MOS_STATUS MhwVeboxInterfaceG12::AddVeboxTilingConvert( } } - else - { - // In-Place Resolve - surface = inputSurface; - - if (inSurParams->CompressionMode == MOS_MMC_MC) - { - veboxOutputSurfCtrlBits.DW0.MemoryCompressionEnable = true; - veboxOutputSurfCtrlBits.DW0.CompressionType = 1; - } - } MOS_ZeroMemory(&ResourceParams, sizeof(MHW_RESOURCE_PARAMS)); InitMocsParams(ResourceParams, &cmd.DW1_2.Value[0], 1, 6); diff --git a/media_driver/media_softlet/agnostic/Xe_M/Xe_XPM_plus/shared/mediacopy/media_blt_copy_xe_xpm_plus.cpp b/media_driver/media_softlet/agnostic/Xe_M/Xe_XPM_plus/shared/mediacopy/media_blt_copy_xe_xpm_plus.cpp index afc24f9f930..f1b3115dfbf 100644 --- a/media_driver/media_softlet/agnostic/Xe_M/Xe_XPM_plus/shared/mediacopy/media_blt_copy_xe_xpm_plus.cpp +++ b/media_driver/media_softlet/agnostic/Xe_M/Xe_XPM_plus/shared/mediacopy/media_blt_copy_xe_xpm_plus.cpp @@ -547,7 +547,7 @@ MOS_STATUS BltStateXe_Xpm_Plus::SubmitCMD( } RegisterDwParams.dwData = swctrl.DW0.Value; - m_miInterface->AddMiLoadRegisterImmCmd(&cmdBuffer, &RegisterDwParams); + BLT_CHK_STATUS_RETURN(m_miInterface->AddMiLoadRegisterImmCmd(&cmdBuffer, &RegisterDwParams)); BLT_CHK_STATUS_RETURN(m_bltInterface->AddFastCopyBlt( &cmdBuffer, diff --git a/media_softlet/agnostic/Xe_R/Xe_HPG_Base/hw/mhw_render_xe_hpg_impl.h b/media_softlet/agnostic/Xe_R/Xe_HPG_Base/hw/mhw_render_xe_hpg_impl.h index 0488bad5c89..e828abe249f 100644 --- a/media_softlet/agnostic/Xe_R/Xe_HPG_Base/hw/mhw_render_xe_hpg_impl.h +++ b/media_softlet/agnostic/Xe_R/Xe_HPG_Base/hw/mhw_render_xe_hpg_impl.h @@ -76,11 +76,6 @@ class Impl : public render::Impl if (cacheSettings) { MHW_RENDER_ENGINE_L3_CACHE_SETTINGS *cacheSettingsHpg = (MHW_RENDER_ENGINE_L3_CACHE_SETTINGS*)cacheSettings; - if (cacheSettingsHpg == nullptr) - { - MHW_ASSERTMESSAGE("Hpg-Specific Params are needed."); - return MOS_STATUS_INVALID_PARAMETER; - } m_l3CacheConfig.dwL3CacheAllocReg_Setting = cacheSettingsHpg->dwAllocReg; m_l3CacheConfig.dwL3CacheTcCntlReg_Setting = cacheSettingsHpg->dwTcCntlReg; // update default settings is needed from CM HAL call diff --git a/media_softlet/agnostic/common/heap_manager/memory_block_manager.cpp b/media_softlet/agnostic/common/heap_manager/memory_block_manager.cpp index 2346ad02f16..a83cf781f1b 100644 --- a/media_softlet/agnostic/common/heap_manager/memory_block_manager.cpp +++ b/media_softlet/agnostic/common/heap_manager/memory_block_manager.cpp @@ -256,7 +256,11 @@ MOS_STATUS MemoryBlockManager::RegisterHeap(uint32_t heapId, uint32_t size , boo adjacencyListBegin = MOS_New(MemoryBlockInternal); HEAP_CHK_NULL(adjacencyListBegin); auto block = GetBlockFromPool(); - HEAP_CHK_NULL(block); + if (block == nullptr) + { + MOS_Delete(adjacencyListBegin); + return MOS_STATUS_NULL_POINTER; + } std::shared_ptr managedHeap = nullptr; managedHeap = MakeShared(); diff --git a/media_softlet/agnostic/common/hw/mhw_render_impl.h b/media_softlet/agnostic/common/hw/mhw_render_impl.h index dc4e92c4517..ac5bc069145 100644 --- a/media_softlet/agnostic/common/hw/mhw_render_impl.h +++ b/media_softlet/agnostic/common/hw/mhw_render_impl.h @@ -268,9 +268,9 @@ class Impl : public Itf, public mhw::Impl MHW_MI_CHK_NULL(cmdBuffer); MHW_MI_CHK_NULL(miItf); MHW_MI_CHK_NULL(this->m_osItf); - MHW_MI_CHK_NULL(skuTable); skuTable = this->m_osItf->pfnGetSkuTable(this->m_osItf); + MHW_MI_CHK_NULL(skuTable); if (MEDIA_IS_SKU(skuTable, FtrPerCtxtPreemptionGranularityControl)) { auto& par = miItf->MHW_GETPAR_F(MI_LOAD_REGISTER_IMM)(); @@ -421,7 +421,7 @@ class Impl : public Itf, public mhw::Impl this->m_currentCmdBuf, &resourceParams)); - if (params.mocs4DynamicState != 0) + if (params.mocs4IndirectObjectBuffer != 0) { cmd.DW8_9.IndirectObjectMemoryObjectControlState = params.mocs4IndirectObjectBuffer; } diff --git a/media_softlet/agnostic/common/hw/mhw_state_heap.cpp b/media_softlet/agnostic/common/hw/mhw_state_heap.cpp index 9c33929b53f..e42bcb13441 100644 --- a/media_softlet/agnostic/common/hw/mhw_state_heap.cpp +++ b/media_softlet/agnostic/common/hw/mhw_state_heap.cpp @@ -1995,7 +1995,11 @@ PMHW_STATE_HEAP_MEMORY_BLOCK XMHW_STATE_HEAP_INTERFACE::AllocateDynamicBlockDyn dwExtendSize = MOS_ALIGN_CEIL(dwExtendSize + pParams->dwScratchSpace, dwIncrement); dwExtendSize = MOS_MAX(dwExtendSize, dwMinSize); - ExtendStateHeap(StateHeapType, dwExtendSize); + eStatus = ExtendStateHeap(StateHeapType, dwExtendSize); + if (eStatus != MOS_STATUS_SUCCESS) + { + MHW_ASSERTMESSAGE("ExtendStateHeap failed"); + } } else { diff --git a/media_softlet/agnostic/common/os/mos_gpucontext_next.h b/media_softlet/agnostic/common/os/mos_gpucontext_next.h index 144bc19f3b3..e0ba950d671 100644 --- a/media_softlet/agnostic/common/os/mos_gpucontext_next.h +++ b/media_softlet/agnostic/common/os/mos_gpucontext_next.h @@ -233,7 +233,7 @@ class GpuContextNext protected: //! \brief Hardware node for current gpu context - MOS_GPU_NODE m_nodeOrdinal; + MOS_GPU_NODE m_nodeOrdinal = {}; //! \brief Indirect heap size (SSH area in DMA buffer) uint32_t m_IndirectHeapSize = 0; diff --git a/media_softlet/agnostic/common/renderhal/renderhal.cpp b/media_softlet/agnostic/common/renderhal/renderhal.cpp index 26c10631340..d88ab7542c9 100644 --- a/media_softlet/agnostic/common/renderhal/renderhal.cpp +++ b/media_softlet/agnostic/common/renderhal/renderhal.cpp @@ -6440,7 +6440,7 @@ MOS_STATUS RenderHal_GetSamplerOffsetAndPtr( MHW_RENDERHAL_CHK_NULL_RETURN(pSamplerParams); ElementType = pSamplerParams->ElementType; - SamplerType = (pSamplerParams) ? pSamplerParams->SamplerType : MHW_SAMPLER_TYPE_3D; + SamplerType = pSamplerParams->SamplerType; if (SamplerType == MHW_SAMPLER_TYPE_VME) { diff --git a/media_softlet/agnostic/common/shared/media_sfc_interface/media_vdbox_sfc_render.cpp b/media_softlet/agnostic/common/shared/media_sfc_interface/media_vdbox_sfc_render.cpp index f33f97b6af0..6788e518166 100644 --- a/media_softlet/agnostic/common/shared/media_sfc_interface/media_vdbox_sfc_render.cpp +++ b/media_softlet/agnostic/common/shared/media_sfc_interface/media_vdbox_sfc_render.cpp @@ -155,7 +155,7 @@ MOS_STATUS MediaVdboxSfcRender::SetScalingParams(VDBOX_SFC_PARAMS &sfcParam, VP_ } m_scalingFilter->Init(sfcParam.videoParams.codecStandard, sfcParam.videoParams.jpeg.jpegChromaType); - m_scalingFilter->SetExecuteEngineCaps(scalingParams, vpExecuteCaps); + VP_PUBLIC_CHK_STATUS_RETURN(m_scalingFilter->SetExecuteEngineCaps(scalingParams, vpExecuteCaps)); VP_PUBLIC_CHK_STATUS_RETURN(m_scalingFilter->CalculateEngineParams()); return m_sfcRender->SetScalingParams(m_scalingFilter->GetSfcParams()); diff --git a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp index fe7156bfa68..9f34416ade1 100644 --- a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp +++ b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp @@ -1428,7 +1428,7 @@ MOS_STATUS VpAllocator::SetMmcFlags(MOS_SURFACE &osSurface) osSurface.bCompressible = true; osSurface.bIsCompressed = true; - m_mmc->GetSurfaceMmcFormat(&osSurface, &mmcFormat); + VP_PUBLIC_CHK_STATUS_RETURN(m_mmc->GetSurfaceMmcFormat(&osSurface, &mmcFormat)); osSurface.CompressionFormat = mmcFormat; } else diff --git a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.cpp b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.cpp index c7fcaea9b90..9a48b47c67f 100644 --- a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.cpp +++ b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_resource_manager.cpp @@ -286,7 +286,7 @@ MOS_STATUS VpResourceManager::OnNewFrameProcessStart(SwFilterPipe &pipe) VP_SURFACE *pastSurface = pipe.GetPastSurface(0); VP_SURFACE *futureSurface = pipe.GetFutureSurface(0); - int32_t currentFrameId = inputSurface ? inputSurface->FrameID : (outputSurface ? outputSurface->FrameID : 0); + int32_t currentFrameId = inputSurface ? inputSurface->FrameID : outputSurface->FrameID; int32_t pastFrameId = pastSurface ? pastSurface->FrameID : 0; int32_t futureFrameId = futureSurface ? futureSurface->FrameID : 0; diff --git a/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp b/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp index c79acbc6cf3..72d4508de93 100644 --- a/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp +++ b/media_softlet/agnostic/common/vp/hal/feature_manager/policy.cpp @@ -1856,6 +1856,7 @@ MOS_STATUS Policy::GetHdrExecutionCaps(SwFilter *feature) VP_PUBLIC_CHK_NULL_RETURN(m_vpInterface.GetHwInterface()->m_userFeatureControl); SwFilterHdr *hdrFilter = dynamic_cast(feature); + VP_PUBLIC_CHK_NULL_RETURN(hdrFilter); FeatureParamHdr *hdrParams = &hdrFilter->GetSwFilterParams(); @@ -3381,7 +3382,11 @@ MOS_STATUS Policy::SetupFilterResource(SwFilterPipe& featurePipe, std::vectorSurfType = originInput->SurfType; featurePipe.ReplaceSurface(input, true, layerIndexes[0]); diff --git a/media_softlet/agnostic/common/vp/hal/feature_manager/sw_filter_pipe.cpp b/media_softlet/agnostic/common/vp/hal/feature_manager/sw_filter_pipe.cpp index 658462c84a0..39e3022bc07 100644 --- a/media_softlet/agnostic/common/vp/hal/feature_manager/sw_filter_pipe.cpp +++ b/media_softlet/agnostic/common/vp/hal/feature_manager/sw_filter_pipe.cpp @@ -589,6 +589,7 @@ MOS_STATUS SwFilterPipe::UpdateFeatures(bool isInputPipe, uint32_t pipeIndex, VP auto handler = m_vpInterface.GetSwFilterHandler(FeatureTypeCsc); VP_PUBLIC_CHK_NULL_RETURN(handler); SwFilterCsc* swfilter = dynamic_cast(handler->CreateSwFilter()); + VP_PUBLIC_CHK_NULL_RETURN(swfilter); swfilter->Configure(inputSurf, outputSurf, *caps); inputPipe->AddSwFilterUnordered(swfilter); } diff --git a/media_softlet/agnostic/common/vp/hal/features/vp_hdr_filter.cpp b/media_softlet/agnostic/common/vp/hal/features/vp_hdr_filter.cpp index a131cd1a549..d2083da6dda 100644 --- a/media_softlet/agnostic/common/vp/hal/features/vp_hdr_filter.cpp +++ b/media_softlet/agnostic/common/vp/hal/features/vp_hdr_filter.cpp @@ -88,7 +88,7 @@ MOS_STATUS VpHdrFilter::CalculateEngineParams( if (vpExecuteCaps.bVebox) { // create a filter Param buffer - MOS_ZeroMemory(&m_veboxHdrParams, sizeof(PVEBOX_HDR_PARAMS)); + MOS_ZeroMemory(&m_veboxHdrParams, sizeof(VEBOX_HDR_PARAMS)); m_veboxHdrParams.uiMaxDisplayLum = hdrParams.uiMaxDisplayLum; m_veboxHdrParams.uiMaxContentLevelLum = hdrParams.uiMaxContentLevelLum; m_veboxHdrParams.hdrMode = hdrParams.hdrMode; diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_packet_pipe.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_packet_pipe.cpp index 4afee2a4905..078e5ff0cc1 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_packet_pipe.cpp +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_packet_pipe.cpp @@ -220,7 +220,6 @@ MOS_STATUS PacketPipe::SetOutputPipeMode(EngineType engineType) default: m_outputPipeMode = VPHAL_OUTPUT_PIPE_MODE_INVALID; VP_PUBLIC_CHK_STATUS_RETURN(MOS_STATUS_INVALID_PARAMETER); - break; } return MOS_STATUS_SUCCESS; diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_render_sfc_base.cpp b/media_softlet/agnostic/common/vp/hal/packet/vp_render_sfc_base.cpp index 0513e87ee79..6d8b77c2b1f 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_render_sfc_base.cpp +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_render_sfc_base.cpp @@ -1528,7 +1528,6 @@ MOS_STATUS SfcRenderBase::AddSfcLock( VP_RENDER_CHK_NULL_RETURN(m_sfcItf); auto& params = m_sfcItf->MHW_GETPAR_F(SFC_LOCK)(); - params = {}; params = *sfcLockParams; // Send SFC_LOCK command to acquire SFC pipe for Vebox diff --git a/media_softlet/agnostic/common/vp/hal/shared/scalability/vp_scalability_multipipe_next.cpp b/media_softlet/agnostic/common/vp/hal/shared/scalability/vp_scalability_multipipe_next.cpp index 91a004f2c1e..aaa8a8b98ae 100644 --- a/media_softlet/agnostic/common/vp/hal/shared/scalability/vp_scalability_multipipe_next.cpp +++ b/media_softlet/agnostic/common/vp/hal/shared/scalability/vp_scalability_multipipe_next.cpp @@ -627,7 +627,7 @@ MOS_STATUS VpScalabilityMultiPipeNext::UpdateState(void *statePars) SCALABILITY_FUNCTION_ENTER; StateParams *vpStatePars = (StateParams *)statePars; - if (vpStatePars->currentPipe < 0 || vpStatePars->currentPipe >= m_pipeNum) + if (vpStatePars->currentPipe >= m_pipeNum) { SCALABILITY_ASSERTMESSAGE("UpdateState failed with invalid parameter: currentPipe %d!", vpStatePars->currentPipe);