Skip to content

Commit

Permalink
[VP] fix coverity issue2
Browse files Browse the repository at this point in the history
fix coverity issue 2
  • Loading branch information
Dylan-debug authored and intel-mediadev committed Sep 6, 2023
1 parent 390884a commit 6134904
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 39 deletions.
64 changes: 26 additions & 38 deletions media_driver/agnostic/gen12/hw/mhw_vebox_g12_X.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3038,41 +3038,37 @@ MOS_STATUS MhwVeboxInterfaceG12::AddVeboxTilingConvert(
}

// Set Output surface compression status
if (outputSurface)
// Double Buffer copy
surface = outputSurface;

if (outSurParams->CompressionMode != MOS_MMC_DISABLED)
{
// Double Buffer copy
surface = outputSurface;
veboxOutputSurfCtrlBits.DW0.MemoryCompressionEnable = true;

if (outSurParams->CompressionMode != MOS_MMC_DISABLED)
if (outSurParams->CompressionMode == MOS_MMC_RC)
{
veboxOutputSurfCtrlBits.DW0.MemoryCompressionEnable = true;

if (outSurParams->CompressionMode == MOS_MMC_RC)
{
veboxOutputSurfCtrlBits.DW0.CompressionType = 1;
}
else
{
veboxOutputSurfCtrlBits.DW0.CompressionType = 0;
}
veboxOutputSurfCtrlBits.DW0.CompressionType = 1;
}

if (surface)
else
{
switch (surface->TileType)
{
case MOS_TILE_YF:
veboxOutputSurfCtrlBits.DW0.TiledResourceModeForOutputFrameSurfaceBaseAddress = TRMODE_TILEYF;
break;
case MOS_TILE_YS:
veboxOutputSurfCtrlBits.DW0.TiledResourceModeForOutputFrameSurfaceBaseAddress = TRMODE_TILEYS;
break;
default:
veboxOutputSurfCtrlBits.DW0.TiledResourceModeForOutputFrameSurfaceBaseAddress = TRMODE_NONE;
break;
}
veboxOutputSurfCtrlBits.DW0.CompressionType = 0;
}
}

if (surface)
{
switch (surface->TileType)
{
case MOS_TILE_YF:
veboxOutputSurfCtrlBits.DW0.TiledResourceModeForOutputFrameSurfaceBaseAddress = TRMODE_TILEYF;
break;
case MOS_TILE_YS:
veboxOutputSurfCtrlBits.DW0.TiledResourceModeForOutputFrameSurfaceBaseAddress = TRMODE_TILEYS;
break;
default:
veboxOutputSurfCtrlBits.DW0.TiledResourceModeForOutputFrameSurfaceBaseAddress = TRMODE_NONE;
break;
}
}

MOS_ZeroMemory(&ResourceParams, sizeof(MHW_RESOURCE_PARAMS));
Expand All @@ -3090,23 +3086,15 @@ MOS_STATUS MhwVeboxInterfaceG12::AddVeboxTilingConvert(
MOS_ZeroMemory(&ResourceParams, sizeof(MHW_RESOURCE_PARAMS));
InitMocsParams(ResourceParams, &cmd.DW3_4.Value[0], 1, 6);

if (outputSurface)
{
ResourceParams.presResource = outputSurface;
}
else
{
ResourceParams.presResource = inputSurface;
}
ResourceParams.presResource = outputSurface;

ResourceParams.HwCommandType = MOS_VEBOX_TILING_CONVERT;

// set up DW[4:3], output graphics address
ResourceParams.dwLocationInCmd = 3;
ResourceParams.pdwCmd = &(cmd.DW3_4.Value[0]);
ResourceParams.bIsWritable = true;
ResourceParams.dwOffset =
(outputSurface != nullptr ? outSurParams->dwOffset : inSurParams->dwOffset) + veboxOutputSurfCtrlBits.DW0.Value;
ResourceParams.dwOffset = outSurParams->dwOffset + veboxOutputSurfCtrlBits.DW0.Value;
MHW_CHK_STATUS(pfnAddResourceToCmd(m_osInterface, cmdBuffer, &ResourceParams));

m_osInterface->pfnAddCommand(cmdBuffer, &cmd, cmd.byteSize);
Expand Down
2 changes: 1 addition & 1 deletion media_softlet/agnostic/common/hw/mhw_state_heap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ MOS_STATUS XMHW_STATE_HEAP_INTERFACE::InitializeInterface(
{
m_ishManager.RegisterOsInterface(m_pOsInterface);
m_ishManager.SetDefaultBehavior(StateHeapSettings.m_ishBehavior);
m_ishManager.SetInitialHeapSize(StateHeapSettings.dwIshSize);
MHW_MI_CHK_STATUS(m_ishManager.SetInitialHeapSize(StateHeapSettings.dwIshSize));
if (StateHeapSettings.m_ishBehavior == HeapManager::Behavior::extend ||
StateHeapSettings.m_ishBehavior == HeapManager::Behavior::destructiveExtend ||
StateHeapSettings.m_ishBehavior == HeapManager::Behavior::waitAndExtend)
Expand Down

0 comments on commit 6134904

Please sign in to comment.