diff options
author | Marek Olšák <[email protected]> | 2017-10-09 18:31:12 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-10-12 19:03:33 +0200 |
commit | c3f3685fd655550bb189aac814126e5feb56db2b (patch) | |
tree | 25bd0a99008f30d778954fe1d99f8308bcd4159c /src/amd/addrlib/addrinterface.cpp | |
parent | 1233d32d2ac04bb9b902728d8e0a606daab862cd (diff) |
amd/addrlib: add Addr2IsValidDisplaySwizzleMode
Some "standard" (_S) swizzle modes are displayable on Raven,
even though the micro tile mode says it's not displayable.
Expose the addrlib function to the driver.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/amd/addrlib/addrinterface.cpp')
-rw-r--r-- | src/amd/addrlib/addrinterface.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/amd/addrlib/addrinterface.cpp b/src/amd/addrlib/addrinterface.cpp index 85e298ddf2d..638556bd893 100644 --- a/src/amd/addrlib/addrinterface.cpp +++ b/src/amd/addrlib/addrinterface.cpp @@ -1675,3 +1675,37 @@ ADDR_E_RETURNCODE ADDR_API Addr2GetPreferredSurfaceSetting( return returnCode; } +/** +**************************************************************************************************** +* Addr2IsValidDisplaySwizzleMode +* +* @brief +* Return whether the swizzle mode is supported by DCE / DCN. +**************************************************************************************************** +*/ +ADDR_E_RETURNCODE ADDR_API Addr2IsValidDisplaySwizzleMode( + ADDR_HANDLE hLib, + AddrSwizzleMode swizzleMode, + UINT_32 bpp, + bool *result) +{ + ADDR_E_RETURNCODE returnCode; + + V2::Lib* pLib = V2::Lib::GetLib(hLib); + + if (pLib != NULL) + { + ADDR2_COMPUTE_SURFACE_INFO_INPUT in; + in.swizzleMode = swizzleMode; + in.bpp = bpp; + + *result = pLib->IsValidDisplaySwizzleMode(&in); + returnCode = ADDR_OK; + } + else + { + returnCode = ADDR_ERROR; + } + + return returnCode; +} |