Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/NetBSD-xsrc-MesaLib]: xsrc/external/mit/MesaLib/dist/src/amd/addrlib/sr...
details: https://anonhg.NetBSD.org/xsrc/rev/bfd293320db2
branches: NetBSD-xsrc-MesaLib
changeset: 6969:bfd293320db2
user: mrg <mrg%NetBSD.org@localhost>
date: Mon May 09 01:23:25 2022 +0000
description:
initial import of mesa 21.3.7
main changes since 19.1.7 include:
- more support for Vulkan functions
- better supported for newer radeonsi (both amdgpu and radeon backends)
- various bug fixes in many drivers
- many fixes and enhancements for intel drivers
- some fixes for nvidia
- OpenGL 4.6 for some drivers (intel, radeonsi)
- intel Tigerlake and Rocketlake support
- Vulkan 1.2 for some drivers
- OpenGL 4.5, GLES 3.2, and more on llvmpipe
- working Panfrost and Midgard drivers
- fix warnings in radeonsi vs newer llvm
diffstat:
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrcommon.h | 112 +-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrelemlib.cpp | 5 +-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrelemlib.h | 2 +-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrlib.cpp | 30 +-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrlib.h | 10 +-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrlib1.cpp | 19 +-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrlib1.h | 3 +-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrlib2.cpp | 480 ++++++++-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrlib2.h | 270 ++++-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrobject.cpp | 14 +-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrobject.h | 5 +-
external/mit/MesaLib/dist/src/amd/addrlib/src/core/coord.cpp | 190 +---
external/mit/MesaLib/dist/src/amd/addrlib/src/core/coord.h | 49 +-
13 files changed, 827 insertions(+), 362 deletions(-)
diffs (truncated from 2086 to 300 lines):
diff -r 7f8822c4357d -r bfd293320db2 external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrcommon.h
--- a/external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrcommon.h Mon Jul 12 07:18:32 2021 +0000
+++ b/external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrcommon.h Mon May 09 01:23:25 2022 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright © 2007-2018 Advanced Micro Devices, Inc.
+ * Copyright © 2007-2019 Advanced Micro Devices, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
@@ -36,24 +36,31 @@
#include "addrinterface.h"
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#if !defined(DEBUG)
-#ifdef NDEBUG
-#define DEBUG 0
-#else
-#define DEBUG 1
+#if !defined(__APPLE__) || defined(HAVE_TSERVER)
+ #include <stdlib.h>
+ #include <string.h>
#endif
+
+#if defined(__GNUC__)
+ #include <assert.h>
#endif
+
////////////////////////////////////////////////////////////////////////////////////////////////////
// Platform specific debug break defines
////////////////////////////////////////////////////////////////////////////////////////////////////
+#if !defined(DEBUG)
+ #ifdef NDEBUG
+ #define DEBUG 0
+ #else
+ #define DEBUG 1
+ #endif
+#endif
+
#if DEBUG
#if defined(__GNUC__)
- #define ADDR_DBG_BREAK() assert(false)
+ #define ADDR_DBG_BREAK() { assert(false); }
#elif defined(__APPLE__)
#define ADDR_DBG_BREAK() { IOPanic("");}
#else
@@ -73,10 +80,29 @@
#define ADDR_ANALYSIS_ASSUME(expr) do { (void)(expr); } while (0)
#endif
-#define ADDR_ASSERT(__e) assert(__e)
-#define ADDR_ASSERT_ALWAYS() ADDR_DBG_BREAK()
-#define ADDR_UNHANDLED_CASE() ADDR_ASSERT(!"Unhandled case")
-#define ADDR_NOT_IMPLEMENTED() ADDR_ASSERT(!"Not implemented");
+#if DEBUG
+ #if defined( _WIN32 )
+ #define ADDR_ASSERT(__e) \
+ { \
+ ADDR_ANALYSIS_ASSUME(__e); \
+ if ( !((__e) ? TRUE : FALSE)) { ADDR_DBG_BREAK(); } \
+ }
+ #else
+ #define ADDR_ASSERT(__e) if ( !((__e) ? TRUE : FALSE)) { ADDR_DBG_BREAK(); }
+ #endif
+ #define ADDR_ASSERT_ALWAYS() ADDR_DBG_BREAK()
+ #define ADDR_UNHANDLED_CASE() ADDR_ASSERT(!"Unhandled case")
+ #define ADDR_NOT_IMPLEMENTED() ADDR_ASSERT(!"Not implemented");
+#else //DEBUG
+ #if defined( _WIN32 )
+ #define ADDR_ASSERT(__e) { ADDR_ANALYSIS_ASSUME(__e); }
+ #else
+ #define ADDR_ASSERT(__e)
+ #endif
+ #define ADDR_ASSERT_ALWAYS()
+ #define ADDR_UNHANDLED_CASE()
+ #define ADDR_NOT_IMPLEMENTED()
+#endif //DEBUG
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -99,6 +125,7 @@
#define ADDR_INFO(cond, a) \
{ if (!(cond)) { ADDR_PRNT(a); } }
+
/// @brief Macro for reporting error warning messages
/// @ingroup util
///
@@ -117,6 +144,7 @@
ADDR_PRNT((" WARNING in file %s, line %d\n", __FILE__, __LINE__)); \
} }
+
/// @brief Macro for reporting fatal error conditions
/// @ingroup util
///
@@ -152,7 +180,11 @@
#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
namespace Addr
{
@@ -200,21 +232,6 @@
/**
****************************************************************************************************
-* @brief Enums to identify AddrLib type
-****************************************************************************************************
-*/
-enum LibClass
-{
- BASE_ADDRLIB = 0x0,
- R600_ADDRLIB = 0x6,
- R800_ADDRLIB = 0x8,
- SI_ADDRLIB = 0xa,
- CI_ADDRLIB = 0xb,
- AI_ADDRLIB = 0xd,
-};
-
-/**
-****************************************************************************************************
* ChipFamily
*
* @brief
@@ -233,6 +250,7 @@
ADDR_CHIP_FAMILY_CI,
ADDR_CHIP_FAMILY_VI,
ADDR_CHIP_FAMILY_AI,
+ ADDR_CHIP_FAMILY_NAVI,
};
/**
@@ -260,7 +278,10 @@
UINT_32 allowLargeThickTile : 1; ///< Allow 64*thickness*bytesPerPixel > rowSize
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 reserved : 21; ///< Reserved bits for future use
+ UINT_32 forceDccAndTcCompat : 1; ///< Force enable DCC and TC compatibility
+ UINT_32 nonPower2MemConfig : 1; ///< Video memory bit width is not power of 2
+ UINT_32 enableAltTiling : 1; ///< Enable alt tile mode
+ UINT_32 reserved : 18; ///< Reserved bits for future use
};
UINT_32 value;
@@ -844,6 +865,7 @@
pChanSet->index = index;
}
+
/**
****************************************************************************************************
* InitChannel
@@ -916,6 +938,36 @@
return mask;
}
+/**
+****************************************************************************************************
+* ShiftCeil
+*
+* @brief
+* Apply right-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);
+}
+
+/**
+****************************************************************************************************
+* ShiftRight
+*
+* @brief
+* Return right-shift value and minimum is 1
+****************************************************************************************************
+*/
+static inline UINT_32 ShiftRight(
+ UINT_32 a, ///< [in] value to be right-shifted
+ UINT_32 b) ///< [in] number of bits to shift
+{
+ return Max(a >> b, 1u);
+}
+
} // Addr
#endif // __ADDR_COMMON_H__
diff -r 7f8822c4357d -r bfd293320db2 external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrelemlib.cpp
--- a/external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrelemlib.cpp Mon Jul 12 07:18:32 2021 +0000
+++ b/external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrelemlib.cpp Mon May 09 01:23:25 2022 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright © 2007-2018 Advanced Micro Devices, Inc.
+ * Copyright © 2007-2019 Advanced Micro Devices, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
@@ -347,6 +347,7 @@
UINT_32 elemMask=0;
UINT_32 elementXor = 0; // address xor when reading bytes from elements
+
// @@ NOTE: assert if called on a compressed format!
if (properties.byteAligned) // Components are all byte-sized
@@ -1272,7 +1273,6 @@
UINT_32 bpp;
BOOL_32 bBCnFormat = FALSE;
- (void)bBCnFormat;
ADDR_ASSERT(pBpp != NULL);
ADDR_ASSERT(pWidth != NULL && pHeight != NULL);
@@ -1745,6 +1745,7 @@
((format >= ADDR_FMT_ASTC_4x4) && (format <= ADDR_FMT_ETC2_128BPP)));
}
+
/**
****************************************************************************************************
* ElemLib::IsCompressed
diff -r 7f8822c4357d -r bfd293320db2 external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrelemlib.h
--- a/external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrelemlib.h Mon Jul 12 07:18:32 2021 +0000
+++ b/external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrelemlib.h Mon May 09 01:23:25 2022 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright © 2007-2018 Advanced Micro Devices, Inc.
+ * Copyright © 2007-2019 Advanced Micro Devices, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
diff -r 7f8822c4357d -r bfd293320db2 external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrlib.cpp
--- a/external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrlib.cpp Mon Jul 12 07:18:32 2021 +0000
+++ b/external/mit/MesaLib/dist/src/amd/addrlib/src/core/addrlib.cpp Mon May 09 01:23:25 2022 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright © 2007-2018 Advanced Micro Devices, Inc.
+ * Copyright © 2007-2019 Advanced Micro Devices, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
@@ -98,7 +98,6 @@
****************************************************************************************************
*/
Lib::Lib() :
- m_class(BASE_ADDRLIB),
m_chipFamily(ADDR_CHIP_FAMILY_IVLD),
m_chipRevision(0),
m_version(ADDRLIB_VERSION),
@@ -108,6 +107,8 @@
m_rowSize(0),
m_minPitchAlignPixels(1),
m_maxSamples(8),
+ m_maxBaseAlign(0),
+ m_maxMetaBaseAlign(0),
m_pElemLib(NULL)
{
m_configFlags.value = 0;
@@ -124,7 +125,6 @@
*/
Lib::Lib(const Client* pClient) :
Object(pClient),
- m_class(BASE_ADDRLIB),
m_chipFamily(ADDR_CHIP_FAMILY_IVLD),
m_chipRevision(0),
m_version(ADDRLIB_VERSION),
@@ -134,6 +134,8 @@
m_rowSize(0),
m_minPitchAlignPixels(1),
m_maxSamples(8),
+ m_maxBaseAlign(0),
+ m_maxMetaBaseAlign(0),
m_pElemLib(NULL)
{
m_configFlags.value = 0;
@@ -157,6 +159,7 @@
}
}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
// Initialization/Helper
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -206,7 +209,7 @@
pLib = SiHwlInit(&client);
break;
case FAMILY_VI:
Home |
Main Index |
Thread Index |
Old Index