Skip to content
Snippets Groups Projects
Commit c3f3685f authored by Marek Olšák's avatar Marek Olšák
Browse files

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: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
parent 1233d32d
No related branches found
No related tags found
Loading
...@@ -1675,3 +1675,37 @@ ADDR_E_RETURNCODE ADDR_API Addr2GetPreferredSurfaceSetting( ...@@ -1675,3 +1675,37 @@ ADDR_E_RETURNCODE ADDR_API Addr2GetPreferredSurfaceSetting(
return returnCode; 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;
}
...@@ -3653,6 +3653,20 @@ ADDR_E_RETURNCODE ADDR_API Addr2GetPreferredSurfaceSetting( ...@@ -3653,6 +3653,20 @@ ADDR_E_RETURNCODE ADDR_API Addr2GetPreferredSurfaceSetting(
const ADDR2_GET_PREFERRED_SURF_SETTING_INPUT* pIn, const ADDR2_GET_PREFERRED_SURF_SETTING_INPUT* pIn,
ADDR2_GET_PREFERRED_SURF_SETTING_OUTPUT* pOut); ADDR2_GET_PREFERRED_SURF_SETTING_OUTPUT* pOut);
/**
****************************************************************************************************
* 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);
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
......
...@@ -178,6 +178,13 @@ public: ...@@ -178,6 +178,13 @@ public:
const ADDR2_GET_PREFERRED_SURF_SETTING_INPUT* pIn, const ADDR2_GET_PREFERRED_SURF_SETTING_INPUT* pIn,
ADDR2_GET_PREFERRED_SURF_SETTING_OUTPUT* pOut) const; ADDR2_GET_PREFERRED_SURF_SETTING_OUTPUT* pOut) const;
virtual BOOL_32 IsValidDisplaySwizzleMode(
const ADDR2_COMPUTE_SURFACE_INFO_INPUT* pIn) const
{
ADDR_NOT_IMPLEMENTED();
return ADDR_NOTIMPLEMENTED;
}
protected: protected:
Lib(); // Constructor is protected Lib(); // Constructor is protected
Lib(const Client* pClient); Lib(const Client* pClient);
......
...@@ -97,6 +97,9 @@ public: ...@@ -97,6 +97,9 @@ public:
return (pMem != NULL) ? new (pMem) Gfx9Lib(pClient) : NULL; return (pMem != NULL) ? new (pMem) Gfx9Lib(pClient) : NULL;
} }
virtual BOOL_32 IsValidDisplaySwizzleMode(
const ADDR2_COMPUTE_SURFACE_INFO_INPUT* pIn) const;
protected: protected:
Gfx9Lib(const Client* pClient); Gfx9Lib(const Client* pClient);
virtual ~Gfx9Lib(); virtual ~Gfx9Lib();
...@@ -405,8 +408,6 @@ private: ...@@ -405,8 +408,6 @@ private:
UINT_32 mip0Width, UINT_32 mip0Height, UINT_32 mip0Depth, UINT_32 mip0Width, UINT_32 mip0Height, UINT_32 mip0Depth,
UINT_32* pNumMetaBlkX, UINT_32* pNumMetaBlkY, UINT_32* pNumMetaBlkZ) const; UINT_32* pNumMetaBlkX, UINT_32* pNumMetaBlkY, UINT_32* pNumMetaBlkZ) const;
BOOL_32 IsValidDisplaySwizzleMode(const ADDR2_COMPUTE_SURFACE_INFO_INPUT* pIn) const;
Gfx9ChipSettings m_settings; Gfx9ChipSettings m_settings;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment