Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/xorg]: xsrc/external/mit/MesaLib/dist/src from maya:



details:   https://anonhg.NetBSD.org/xsrc/rev/804166c6a189
branches:  xorg
changeset: 10202:804166c6a189
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Mar 10 03:46:28 2019 +0000

description:
from maya:

Import mesa 18.3.4.

Mesa 18.3.4 implements the OpenGL 4.5 API.
Some drivers don't support all the features required in OpenGL 4.5.


(this time, get the subdirs called "core".)

diffstat:

 external/mit/MesaLib/dist/src/amd/addrlib/core/addrcommon.h                                          |   924 ++
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrelemlib.cpp                                       |  1843 ++++
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrelemlib.h                                         |   279 +
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrlib.cpp                                           |   644 +
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrlib.h                                             |   413 +
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrlib1.cpp                                          |  4076 ++++++++++
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrlib1.h                                            |   545 +
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrlib2.cpp                                          |  1891 ++++
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrlib2.h                                            |   793 +
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrobject.cpp                                        |   233 +
 external/mit/MesaLib/dist/src/amd/addrlib/core/addrobject.h                                          |    95 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/api.cpp                            |  1773 ++++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/api.h                              |   786 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/arena.h                            |   490 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backend.cpp                        |   410 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backend.h                          |    70 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backend_clear.cpp                  |   342 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backend_impl.h                     |  1377 +++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backend_sample.cpp                 |   464 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backend_singlesample.cpp           |   438 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_BackendPixelRate.hpp  |    61 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_BackendPixelRate0.cpp |   112 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_BackendPixelRate1.cpp |   112 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_BackendPixelRate2.cpp |   112 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_BackendPixelRate3.cpp |   112 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_rasterizer.hpp        |    62 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_rasterizer0.cpp       |   205 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_rasterizer1.cpp       |   205 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_rasterizer2.cpp       |   205 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/gen_rasterizer3.cpp       |   205 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/backends/meson.build               |    57 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/binner.cpp                         |  1957 ++++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/binner.h                           |   254 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/blend.h                            |   348 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/clip.cpp                           |   342 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/clip.h                             |  1398 +++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/conservativeRast.h                 |   229 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/context.h                          |   591 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/depthstencil.h                     |   335 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/fifo.hpp                           |   138 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/format_conversion.h                |   369 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/format_traits.h                    |  4046 +++++++++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/format_types.h                     |  1664 ++++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/format_utils.h                     |   989 ++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/frontend.cpp                       |  2367 +++++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/frontend.h                         |   438 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/knobs.h                            |   186 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/knobs_init.h                       |   108 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/multisample.h                      |   459 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/pa.h                               |  1617 +++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/pa_avx.cpp                         |  3141 +++++++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/rasterizer.cpp                     |   469 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/rasterizer.h                       |   237 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/rasterizer_impl.h                  |  1540 +++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/rdtsc_core.cpp                     |   100 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/rdtsc_core.h                       |   189 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/ringbuffer.h                       |    95 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/state.h                            |  1257 +++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/state_funcs.h                      |    67 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/tessellator.h                      |    82 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/threads.cpp                        |  1401 +++
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/threads.h                          |    81 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/tilemgr.cpp                        |   540 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/tilemgr.h                          |   353 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/tileset.h                          |   102 +
 external/mit/MesaLib/dist/src/gallium/drivers/swr/rasterizer/core/utils.h                            |   394 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/context.cpp                         |    51 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/context.hpp                         |    67 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/device.cpp                          |   282 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/device.hpp                          |   100 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/error.hpp                           |   202 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/event.cpp                           |   267 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/event.hpp                           |   164 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/format.cpp                          |   162 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/format.hpp                          |    62 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/kernel.cpp                          |   596 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/kernel.hpp                          |   244 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/memory.cpp                          |   214 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/memory.hpp                          |   159 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/module.cpp                          |   228 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/module.hpp                          |   128 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/object.hpp                          |   239 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/platform.cpp                        |    41 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/platform.hpp                        |    48 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/program.cpp                         |   139 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/program.hpp                         |    91 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/property.hpp                        |   261 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/queue.cpp                           |   102 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/queue.hpp                           |    78 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/resource.cpp                        |   231 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/resource.hpp                        |   133 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/sampler.cpp                         |    73 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/sampler.hpp                         |    58 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/timestamp.cpp                       |    64 +
 external/mit/MesaLib/dist/src/gallium/state_trackers/clover/core/timestamp.hpp                       |    74 +
 95 files changed, 51775 insertions(+), 0 deletions(-)

diffs (truncated from 52157 to 300 lines):

diff -r 65bc6cc58828 -r 804166c6a189 external/mit/MesaLib/dist/src/amd/addrlib/core/addrcommon.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/mit/MesaLib/dist/src/amd/addrlib/core/addrcommon.h       Sun Mar 10 03:46:28 2019 +0000
@@ -0,0 +1,924 @@
+/*
+ * Copyright © 2014 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+
+/**
+****************************************************************************************************
+* @file  addrcommon.h
+* @brief Contains the helper function and constants.
+****************************************************************************************************
+*/
+
+#ifndef __ADDR_COMMON_H__
+#define __ADDR_COMMON_H__
+
+#include "addrinterface.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#if !defined(DEBUG)
+#ifdef NDEBUG
+#define DEBUG 0
+#else
+#define DEBUG 1
+#endif
+#endif
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Platform specific debug break defines
+////////////////////////////////////////////////////////////////////////////////////////////////////
+#if DEBUG
+    #if defined(__GNUC__)
+        #define ADDR_DBG_BREAK()    assert(false)
+    #elif defined(__APPLE__)
+        #define ADDR_DBG_BREAK()    { IOPanic("");}
+    #else
+        #define ADDR_DBG_BREAK()    { __debugbreak(); }
+    #endif
+#else
+    #define ADDR_DBG_BREAK()
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Debug assertions used in AddrLib
+////////////////////////////////////////////////////////////////////////////////////////////////////
+#if defined(_WIN32) && (_MSC_VER >= 1400)
+    #define ADDR_ANALYSIS_ASSUME(expr) __analysis_assume(expr)
+#else
+    #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");
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Debug print macro from legacy address library
+////////////////////////////////////////////////////////////////////////////////////////////////////
+#if DEBUG
+
+#define ADDR_PRNT(a)    Object::DebugPrint a
+
+/// @brief Macro for reporting informational messages
+/// @ingroup util
+///
+/// This macro optionally prints an informational message to stdout.
+/// The first parameter is a condition -- if it is true, nothing is done.
+/// The second pararmeter MUST be a parenthesis-enclosed list of arguments,
+/// starting with a string. This is passed to printf() or an equivalent
+/// in order to format the informational message. For example,
+/// ADDR_INFO(0, ("test %d",3) ); prints out "test 3".
+///
+#define ADDR_INFO(cond, a)         \
+{ if (!(cond)) { ADDR_PRNT(a); } }
+
+
+/// @brief Macro for reporting error warning messages
+/// @ingroup util
+///
+/// This macro optionally prints an error warning message to stdout,
+/// followed by the file name and line number where the macro was called.
+/// The first parameter is a condition -- if it is true, nothing is done.
+/// The second pararmeter MUST be a parenthesis-enclosed list of arguments,
+/// starting with a string. This is passed to printf() or an equivalent
+/// in order to format the informational message. For example,
+/// ADDR_WARN(0, ("test %d",3) ); prints out "test 3" followed by
+/// a second line with the file name and line number.
+///
+#define ADDR_WARN(cond, a)         \
+{ if (!(cond))                     \
+  { ADDR_PRNT(a);                  \
+    ADDR_PRNT(("  WARNING in file %s, line %d\n", __FILE__, __LINE__)); \
+} }
+
+
+/// @brief Macro for reporting fatal error conditions
+/// @ingroup util
+///
+/// This macro optionally stops execution of the current routine
+/// after printing an error warning message to stdout,
+/// followed by the file name and line number where the macro was called.
+/// The first parameter is a condition -- if it is true, nothing is done.
+/// The second pararmeter MUST be a parenthesis-enclosed list of arguments,
+/// starting with a string. This is passed to printf() or an equivalent
+/// in order to format the informational message. For example,
+/// ADDR_EXIT(0, ("test %d",3) ); prints out "test 3" followed by
+/// a second line with the file name and line number, then stops execution.
+///
+#define ADDR_EXIT(cond, a)         \
+{ if (!(cond))                     \
+  { ADDR_PRNT(a); ADDR_DBG_BREAK();\
+} }
+
+#else // DEBUG
+
+#define ADDRDPF 1 ? (void)0 : (void)
+
+#define ADDR_PRNT(a)
+
+#define ADDR_DBG_BREAK()
+
+#define ADDR_INFO(cond, a)
+
+#define ADDR_WARN(cond, a)
+
+#define ADDR_EXIT(cond, a)
+
+#endif // DEBUG
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define ADDR_C_ASSERT(__e) typedef char __ADDR_C_ASSERT__[(__e) ? 1 : -1]
+
+namespace Addr
+{
+
+namespace V1
+{
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Common constants
+////////////////////////////////////////////////////////////////////////////////////////////////////
+static const UINT_32 MicroTileWidth      = 8;       ///< Micro tile width, for 1D and 2D tiling
+static const UINT_32 MicroTileHeight     = 8;       ///< Micro tile height, for 1D and 2D tiling
+static const UINT_32 ThickTileThickness  = 4;       ///< Micro tile thickness, for THICK modes
+static const UINT_32 XThickTileThickness = 8;       ///< Extra thick tiling thickness
+static const UINT_32 PowerSaveTileBytes  = 64;      ///< Nuber of bytes per tile for power save 64
+static const UINT_32 CmaskCacheBits      = 1024;    ///< Number of bits for CMASK cache
+static const UINT_32 CmaskElemBits       = 4;       ///< Number of bits for CMASK element
+static const UINT_32 HtileCacheBits      = 16384;   ///< Number of bits for HTILE cache 512*32
+
+static const UINT_32 MicroTilePixels     = MicroTileWidth * MicroTileHeight;
+
+static const INT_32 TileIndexInvalid        = TILEINDEX_INVALID;
+static const INT_32 TileIndexLinearGeneral  = TILEINDEX_LINEAR_GENERAL;
+static const INT_32 TileIndexNoMacroIndex   = -3;
+
+} // V1
+
+namespace V2
+{
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Common constants
+////////////////////////////////////////////////////////////////////////////////////////////////////
+static const UINT_32 MaxSurfaceHeight = 16384;
+
+} // V2
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Common macros
+////////////////////////////////////////////////////////////////////////////////////////////////////
+#define BITS_PER_BYTE 8
+#define BITS_TO_BYTES(x) ( ((x) + (BITS_PER_BYTE-1)) / BITS_PER_BYTE )
+#define BYTES_TO_BITS(x) ( (x) * BITS_PER_BYTE )
+
+/// Helper macros to select a single bit from an int (undefined later in section)
+#define _BIT(v,b)      (((v) >> (b) ) & 1)
+
+/**
+****************************************************************************************************
+* @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
+*       Neutral enums that specifies chip family.
+*
+****************************************************************************************************
+*/
+enum ChipFamily
+{
+    ADDR_CHIP_FAMILY_IVLD,    ///< Invalid family
+    ADDR_CHIP_FAMILY_R6XX,
+    ADDR_CHIP_FAMILY_R7XX,
+    ADDR_CHIP_FAMILY_R8XX,
+    ADDR_CHIP_FAMILY_NI,
+    ADDR_CHIP_FAMILY_SI,
+    ADDR_CHIP_FAMILY_CI,
+    ADDR_CHIP_FAMILY_VI,
+    ADDR_CHIP_FAMILY_AI,
+};
+
+/**
+****************************************************************************************************
+* ConfigFlags
+*
+*   @brief
+*       This structure is used to set configuration flags.
+****************************************************************************************************
+*/
+union ConfigFlags
+{
+    struct
+    {
+        /// These flags are set up internally thru AddrLib::Create() based on ADDR_CREATE_FLAGS
+        UINT_32 optimalBankSwap        : 1;    ///< New bank tiling for RV770 only
+        UINT_32 noCubeMipSlicesPad     : 1;    ///< Disables faces padding for cubemap mipmaps
+        UINT_32 fillSizeFields         : 1;    ///< If clients fill size fields in all input and
+                                               ///  output structure
+        UINT_32 ignoreTileInfo         : 1;    ///< Don't use tile info structure
+        UINT_32 useTileIndex           : 1;    ///< Make tileIndex field in input valid
+        UINT_32 useCombinedSwizzle     : 1;    ///< Use combined swizzle
+        UINT_32 checkLast2DLevel       : 1;    ///< Check the last 2D mip sub level
+        UINT_32 useHtileSliceAlign     : 1;    ///< Do htile single slice alignment
+        UINT_32 allowLargeThickTile    : 1;    ///< Allow 64*thickness*bytesPerPixel > rowSize
+        UINT_32 disableLinearOpt       : 1;    ///< Disallow tile modes to be optimized to linear
+        UINT_32 reserved               : 22;   ///< Reserved bits for future use
+    };
+
+    UINT_32 value;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Misc helper functions
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+****************************************************************************************************
+*   AddrXorReduce
+*
+*   @brief
+*       Xor the right-side numberOfBits bits of x.
+****************************************************************************************************
+*/
+static inline UINT_32 XorReduce(
+    UINT_32 x,
+    UINT_32 numberOfBits)
+{
+    UINT_32 i;
+    UINT_32 result = x & 1;
+
+    for (i=1; i<numberOfBits; i++)
+    {
+        result ^= ((x>>i) & 1);
+    }
+
+    return result;
+}
+



Home | Main Index | Thread Index | Old Index