// Also Mip 1+ needs an element pitch of 32 bits so we do not need this workaround
// but we use this flag to skip RestoreSurfaceInfo below
- if ((elemMode == ADDR_EXPANDED) &&
- (expandX > 1))
+ if ((elemMode == ADDR_EXPANDED) && (expandX > 1))
{
- ADDR_ASSERT(localIn.tileMode == ADDR_TM_LINEAR_ALIGNED || localIn.height == 1);
+ ADDR_ASSERT(IsLinear(localIn.tileMode));
}
GetElemLib()->AdjustSurfaceInfo(elemMode,
if (returnCode == ADDR_OK)
{
+ localIn.flags.dccPipeWorkaround = localIn.flags.dccCompatible;
+
if (localIn.tileMode == ADDR_TM_UNKNOWN)
{
// HWL layer may override tile mode if necessary
if (returnCode == ADDR_OK)
{
- pOut->bpp = ComputeHtileInfo(pIn->flags,
- pIn->pitch,
- pIn->height,
- pIn->numSlices,
- pIn->isLinear,
- isWidth8,
- isHeight8,
- pIn->pTileInfo,
- &pOut->pitch,
- &pOut->height,
- &pOut->htileBytes,
- &pOut->macroWidth,
- &pOut->macroHeight,
- &pOut->sliceSize,
- &pOut->baseAlign);
-
- if (pIn->flags.tcCompatible && (pIn->numSlices > 1))
+ if (pIn->flags.tcCompatible)
{
- pOut->sliceSize = pIn->pitch * pIn->height * 4 / (8 * 8);
+ const UINT_32 sliceSize = pIn->pitch * pIn->height * 4 / (8 * 8);
+ const UINT_32 align = HwlGetPipes(pIn->pTileInfo) * pIn->pTileInfo->banks * m_pipeInterleaveBytes;
- const UINT_32 align = HwlGetPipes(pIn->pTileInfo) * pIn->pTileInfo->banks * m_pipeInterleaveBytes;
-
- if ((pOut->sliceSize % align) == 0)
+ if (pIn->numSlices > 1)
{
- pOut->sliceInterleaved = FALSE;
+ const UINT_32 surfBytes = (sliceSize * pIn->numSlices);
+
+ pOut->sliceSize = sliceSize;
+ pOut->htileBytes = pIn->flags.skipTcCompatSizeAlign ?
+ surfBytes : PowTwoAlign(surfBytes, align);
+ pOut->sliceInterleaved = ((sliceSize % align) != 0) ? TRUE : FALSE;
}
else
{
- pOut->sliceInterleaved = TRUE;
+ pOut->sliceSize = pIn->flags.skipTcCompatSizeAlign ?
+ sliceSize : PowTwoAlign(sliceSize, align);
+ pOut->htileBytes = pOut->sliceSize;
+ pOut->sliceInterleaved = FALSE;
}
+
+ pOut->nextMipLevelCompressible = ((sliceSize % align) == 0) ? TRUE : FALSE;
+
+ pOut->pitch = pIn->pitch;
+ pOut->height = pIn->height;
+ pOut->baseAlign = align;
+ pOut->macroWidth = 0;
+ pOut->macroHeight = 0;
+ pOut->bpp = 32;
+ }
+ else
+ {
+ pOut->bpp = ComputeHtileInfo(pIn->flags,
+ pIn->pitch,
+ pIn->height,
+ pIn->numSlices,
+ pIn->isLinear,
+ isWidth8,
+ isHeight8,
+ pIn->pTileInfo,
+ &pOut->pitch,
+ &pOut->height,
+ &pOut->htileBytes,
+ &pOut->macroWidth,
+ &pOut->macroHeight,
+ &pOut->sliceSize,
+ &pOut->baseAlign);
}
}
}
{
UINT_32 pipe;
UINT_32 numPipes;
+ UINT_32 numGroupBits;
+ (void)numGroupBits;
UINT_32 numPipeBits;
UINT_32 macroTilePitch;
UINT_32 macroTileHeight;
//
// Compute the number of group and pipe bits.
//
+ numGroupBits = Log2(m_pipeInterleaveBytes);
numPipeBits = Log2(numPipes);
UINT_32 groupBits = 8 * m_pipeInterleaveBytes;
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn ///< [in,out] Input structure
) const
{
+ // Check if HWL has handled
+ BOOL_32 hwlHandled = FALSE;
+ (void)hwlHandled;
+
if (ElemLib::IsBlockCompressed(pIn->format))
{
if (pIn->mipLevel == 0)
}
}
- HwlComputeMipLevel(pIn);
+ hwlHandled = HwlComputeMipLevel(pIn);
}
/**
{
tileMode = ADDR_TM_LINEAR_ALIGNED;
}
- else if (IsMacroTiled(tileMode))
+ else if (IsMacroTiled(tileMode) && (pInOut->flags.tcCompatible == FALSE))
{
if (DegradeTo1D(width, height, macroWidthAlign, macroHeightAlign))
{
* @brief
* Get quad buffer stereo information
* @return
-* TRUE if no error
+* N/A
****************************************************************************************************
*/
-BOOL_32 Lib::ComputeQbStereoInfo(
+VOID Lib::ComputeQbStereoInfo(
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [in,out] updated pOut+pStereoInfo
) const
{
- BOOL_32 success = FALSE;
-
- if (pOut->pStereoInfo)
- {
- ADDR_ASSERT(pOut->bpp >= 8);
- ADDR_ASSERT((pOut->surfSize % pOut->baseAlign) == 0);
-
- // Save original height
- pOut->pStereoInfo->eyeHeight = pOut->height;
+ ADDR_ASSERT(pOut->bpp >= 8);
+ ADDR_ASSERT((pOut->surfSize % pOut->baseAlign) == 0);
- // Right offset
- pOut->pStereoInfo->rightOffset = static_cast<UINT_32>(pOut->surfSize);
+ // Save original height
+ pOut->pStereoInfo->eyeHeight = pOut->height;
- pOut->pStereoInfo->rightSwizzle = HwlComputeQbStereoRightSwizzle(pOut);
- // Double height
- pOut->height <<= 1;
- pOut->pixelHeight <<= 1;
+ // Right offset
+ pOut->pStereoInfo->rightOffset = static_cast<UINT_32>(pOut->surfSize);
- // Double size
- pOut->surfSize <<= 1;
+ pOut->pStereoInfo->rightSwizzle = HwlComputeQbStereoRightSwizzle(pOut);
+ // Double height
+ pOut->height <<= 1;
+ pOut->pixelHeight <<= 1;
- // Right start address meets the base align since it is guaranteed by AddrLib1
+ // Double size
+ pOut->surfSize <<= 1;
- // 1D surface on SI may break this rule, but we can force it to meet by checking .qbStereo.
- success = TRUE;
- }
+ // Right start address meets the base align since it is guaranteed by AddrLib1
- return success;
+ // 1D surface on SI may break this rule, but we can force it to meet by checking .qbStereo.
}