mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
amd/addrlib: expose CMASK address equations to drivers on GFX10+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12182>
This commit is contained in:
parent
19670129c5
commit
0926b268fc
2 changed files with 14 additions and 0 deletions
|
|
@ -3005,6 +3005,9 @@ typedef struct _ADDR2_COMPUTE_CMASK_INFO_OUTPUT
|
|||
* - rb_aligned
|
||||
*/
|
||||
struct gfx9_addr_meta_equation gfx9;
|
||||
|
||||
/* This is chip-specific, it requires 64KB_Z_X. */
|
||||
UINT_16 *gfx10_bits; /* 68 2-byte elements */
|
||||
} equation;
|
||||
} ADDR2_COMPUTE_CMASK_INFO_OUTPUT;
|
||||
|
||||
|
|
|
|||
|
|
@ -369,6 +369,17 @@ ADDR_E_RETURNCODE Gfx10Lib::HwlComputeCmaskInfo(
|
|||
|
||||
pOut->sliceSize = pOut->metaBlkNumPerSlice * metaBlkSize;
|
||||
pOut->cmaskBytes = pOut->sliceSize * pIn->numSlices;
|
||||
|
||||
// Get the CMASK address equation (copied from CmaskAddrFromCoord)
|
||||
const UINT_32 fmaskBpp = GetFmaskBpp(1, 1);
|
||||
const UINT_32 fmaskElemLog2 = Log2(fmaskBpp >> 3);
|
||||
const UINT_32 index = m_xmaskBaseIndex + fmaskElemLog2;
|
||||
const UINT_8* patIdxTable =
|
||||
(pIn->swizzleMode == ADDR_SW_VAR_Z_X) ? GFX10_CMASK_VAR_RBPLUS_PATIDX :
|
||||
(m_settings.supportRbPlus ? GFX10_CMASK_64K_RBPLUS_PATIDX : GFX10_CMASK_64K_PATIDX);
|
||||
|
||||
ADDR_C_ASSERT(sizeof(GFX10_CMASK_SW_PATTERN[patIdxTable[index]]) == 68 * 2);
|
||||
pOut->equation.gfx10_bits = (UINT_16*)GFX10_CMASK_SW_PATTERN[patIdxTable[index]];
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue