Skip to content

Commit

Permalink
Revert "Fix the performance issue on APL. Perf will drop from 25fps t…
Browse files Browse the repository at this point in the history
…o 10fps for 1080p decode + vp(nv12tileY -> i420linear) if only mos_gem_bo_map_gtt(surface->bo) on AtomSOC(APL)."

This reverts commit cb0c313.

Change-Id: I3f3b10bd82de76fedab6696c64b14883df8459de
  • Loading branch information
hanlong1 authored and intel-mediadev committed Mar 17, 2020
1 parent 58627ed commit 33b1e3d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 19 deletions.
52 changes: 37 additions & 15 deletions media_driver/linux/common/ddi/media_libva_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,11 @@ void* DdiMediaUtil_LockSurface(DDI_MEDIA_SURFACE *surface, uint32_t flag)
DDI_CHK_NULL(surface->bo, "nullptr surface->bo", nullptr);
if((false == surface->bMapped) && (0 == surface->iRefCount))
{
// remove the differentiation from AtomSOC(surface->pMediaCtx->bIsAtomSOC).
// perf will drop from 25fps to 10fps for 1080p decode + vp(nv12tileY -> i420linear) if only mos_gem_bo_map_gtt(surface->bo) on AtomSOC(APL).
if (surface->pMediaCtx->bIsAtomSOC)
{
mos_gem_bo_map_gtt(surface->bo);
}
else
{
if (surface->TileType == I915_TILING_NONE)
{
Expand All @@ -765,6 +768,7 @@ void* DdiMediaUtil_LockSurface(DDI_MEDIA_SURFACE *surface, uint32_t flag)
(uint8_t *)surface->pSystemShadow,
false);
DDI_CHK_CONDITION((vaStatus != VA_STATUS_SUCCESS), "SwizzleSurface failed", nullptr);

}
else if (flag & MOS_LOCKFLAG_NO_SWIZZLE)
{
Expand Down Expand Up @@ -803,8 +807,11 @@ void DdiMediaUtil_UnlockSurface(DDI_MEDIA_SURFACE *surface)

if((true == surface->bMapped) && (1 == surface->iRefCount))
{
// remove the differentiation from AtomSOC(surface->pMediaCtx->bIsAtomSOC).
// perf will drop from 25fps to 10fps for 1080p decode + vp(nv12tileY -> i420linear) if only mos_gem_bo_map_gtt(surface->bo) on AtomSOC(APL).
if (surface->pMediaCtx->bIsAtomSOC)
{
mos_gem_bo_unmap_gtt(surface->bo);
}
else
{
if (surface->TileType == I915_TILING_NONE)
{
Expand Down Expand Up @@ -861,14 +868,22 @@ void* DdiMediaUtil_LockBuffer(DDI_MEDIA_BUFFER *buf, uint32_t flag)
}
else
{
if (buf->TileType == I915_TILING_NONE)
if (buf->pMediaCtx->bIsAtomSOC)
{
mos_bo_map(buf->bo, ((MOS_LOCKFLAG_READONLY | MOS_LOCKFLAG_WRITEONLY) & flag));
mos_gem_bo_map_gtt(buf->bo);
}
else
{
mos_gem_bo_map_gtt(buf->bo);
}
if (buf->TileType == I915_TILING_NONE)
{
mos_bo_map(buf->bo, ((MOS_LOCKFLAG_READONLY | MOS_LOCKFLAG_WRITEONLY) & flag));
}
else
{
mos_gem_bo_map_gtt(buf->bo);
}
}

buf->pData = (uint8_t*)(buf->bo->virt);
}

Expand Down Expand Up @@ -901,13 +916,20 @@ void DdiMediaUtil_UnlockBuffer(DDI_MEDIA_BUFFER *buf)
}
else
{
if (buf->TileType == I915_TILING_NONE)
{
mos_bo_unmap(buf->bo);
}
else
{
mos_gem_bo_unmap_gtt(buf->bo);
if (buf->pMediaCtx->bIsAtomSOC)
{
mos_gem_bo_unmap_gtt(buf->bo);
}
else
{
if (buf->TileType == I915_TILING_NONE)
{
mos_bo_unmap(buf->bo);
}
else
{
mos_gem_bo_unmap_gtt(buf->bo);
}
}
buf->bo->virt = nullptr;
}
Expand Down
14 changes: 10 additions & 4 deletions media_driver/linux/common/os/mos_graphicsresource_specific.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,11 @@ void* GraphicsResourceSpecific::Lock(OsContext* osContextPtr, LockParams& params

if(false == m_mapped)
{
// remove the differentiation from AtomSOC(surface->pMediaCtx->bIsAtomSOC).
// perf will drop from 25fps to 10fps for 1080p decode + vp(nv12tileY -> i420linear) if only mos_gem_bo_map_gtt(surface->bo) on AtomSOC(APL).
if (pOsContextSpecific->IsAtomSoc())
{
mos_gem_bo_map_gtt(boPtr);
}
else
{
if (m_tileType != MOS_TILE_LINEAR && !params.m_tileAsTiled)
{
Expand Down Expand Up @@ -540,8 +543,11 @@ MOS_STATUS GraphicsResourceSpecific::Unlock(OsContext* osContextPtr)
{
if (m_mapped)
{
// remove the differentiation from AtomSOC(surface->pMediaCtx->bIsAtomSOC).
// perf will drop from 25fps to 10fps for 1080p decode + vp(nv12tileY -> i420linear) if only mos_gem_bo_map_gtt(surface->bo) on AtomSOC(APL).
if (pOsContextSpecific->IsAtomSoc())
{
mos_gem_bo_unmap_gtt(boPtr);
}
else
{
if (m_systemShadow)
{
Expand Down

0 comments on commit 33b1e3d

Please sign in to comment.