// ADDR_LNX_KERNEL_BUILD is for internal build
// Moved from addrinterface.h so __KERNEL__ is not needed any more
-#if !defined(__APPLE__) || defined(HAVE_TSERVER)
+#if ADDR_LNX_KERNEL_BUILD // || (defined(__GNUC__) && defined(__KERNEL__))
+ #include <string.h>
+#elif !defined(__APPLE__) || defined(HAVE_TSERVER)
#include <stdlib.h>
#include <string.h>
- #include <assert.h>
#endif
+#include <assert.h>
+#include "util/macros.h"
+
////////////////////////////////////////////////////////////////////////////////////////////////////
// Platform specific debug break defines
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif // DEBUG
////////////////////////////////////////////////////////////////////////////////////////////////////
-#if defined(static_assert)
-#define ADDR_C_ASSERT(__e) static_assert(__e, "")
-#else
-#define ADDR_C_ASSERT(__e) typedef char __ADDR_C_ASSERT__[(__e) ? 1 : -1]
-#endif
+#define ADDR_C_ASSERT(__e) STATIC_ASSERT(__e)
namespace Addr
{
ADDR_CHIP_FAMILY_CI,
ADDR_CHIP_FAMILY_VI,
ADDR_CHIP_FAMILY_AI,
+ ADDR_CHIP_FAMILY_NAVI,
};
/**
UINT_32 disableLinearOpt : 1; ///< Disallow tile modes to be optimized to linear
UINT_32 use32bppFor422Fmt : 1; ///< View 422 formats as 32 bits per pixel element
UINT_32 forceDccAndTcCompat : 1; ///< Force enable DCC and TC compatibility
- UINT_32 reserved : 20; ///< Reserved bits for future use
+ UINT_32 nonPower2MemConfig : 1; ///< Physical video memory size is not power of 2
+ UINT_32 reserved : 19; ///< Reserved bits for future use
};
UINT_32 value;
return mask;
}
+/**
+****************************************************************************************************
+* ShiftCeil
+*
+* @brief
+* Apply righ-shift with ceiling
+****************************************************************************************************
+*/
+static inline UINT_32 ShiftCeil(
+ UINT_32 a, ///< [in] value to be right-shifted
+ UINT_32 b) ///< [in] number of bits to shift
+{
+ return (a >> b) + (((a & ((1 << b) - 1)) != 0) ? 1 : 0);
+}
+
} // Addr
#endif // __ADDR_COMMON_H__