05360ec71e
Add beignet 1.1.0. Add clinfo, clblas, clfft and clrng. The major change is that all Mesa ports are now configured the same way. This fixes several problems and enables new features. The details are described in this blog post: http://blogs.freebsdish.org/graphics/2015/03/18/unifying-mesa-ports-configure/ The second important change is the OpenCL support. Mesa's implementation, Clover, is enabled as well as Beignet. Clover targets all Gallium drivers, only Radeon GPUs in our case. Beignet is for Intel GPUs starting with Ivy Bridge. Thanks to Johannes Dieterich, O. Hartman, and Koop Mast for their work on OpenCL! As a bonus, there are several OpenCL-based math ports added (clblas, clfft and clrng). For more information and known issues, please see https://wiki.freebsd.org/Graphics/OpenCL The third change is the removal of Mesa 9.1.7 which was installed on FreeBSD 9.3-RELEASE. There is now only one version of Mesa in the Ports tree (10.6.6) for all supported versions of FreeBSD. Other, smaller changes: * Include libosmesa into the Mesa framework; this changes libOSMesa shlib version. * bsd.mesalib.mk was renamed and split up in two files namely Makefile.common and Makefile.targets. So ports can overwrite variables set by Makefile.common and are used by Makefile.targets. * Some text in the pkg-descr files was wrong, clean it up. While here, update the WWW to the main mesa3d.org upstream page. * devel/clinfo was added, a glxinfo like program but for OpenCL. Non-x86 hardware reports are very welcome since we changed the framework quite a bit. Obtained from: Graphics team development repo.
68 lines
2.1 KiB
C++
68 lines
2.1 KiB
C++
--- backend/src/sys/alloc.cpp.orig 2015-07-02 09:39:05.000000000 +0200
|
|
+++ backend/src/sys/alloc.cpp 2015-08-26 11:57:00.901815000 +0200
|
|
@@ -69,7 +69,7 @@ namespace gbe
|
|
/*! Total number of allocations done */
|
|
volatile intptr_t allocNum;
|
|
/*! Sorts the file name and function name strings */
|
|
- std::tr1::unordered_map<const char*, int> staticStringMap;
|
|
+ std::unordered_map<const char*, int> staticStringMap;
|
|
/*! Each element contains the actual string */
|
|
std::vector<const char*> staticStringVector;
|
|
std::map<uintptr_t, AllocData> allocMap;
|
|
@@ -140,16 +140,17 @@ namespace gbe
|
|
static bool isMutexInitializing = true;
|
|
static size_t memDebuggerCurrSize(0u);
|
|
static size_t memDebuggerMaxSize(0u);
|
|
+ __attribute__((destructor))
|
|
static void SizeMutexDeallocate(void) { if (sizeMutex) delete sizeMutex; }
|
|
static void SizeMutexAllocate(void) {
|
|
if (sizeMutex == NULL && isMutexInitializing == false) {
|
|
isMutexInitializing = true;
|
|
sizeMutex = new MutexSys;
|
|
- atexit(SizeMutexDeallocate);
|
|
}
|
|
}
|
|
|
|
/*! Stop the memory debugger */
|
|
+ __attribute__((destructor))
|
|
static void MemDebuggerEnd(void) {
|
|
MemDebugger *_debug = memDebugger;
|
|
memDebugger = NULL;
|
|
@@ -172,7 +173,6 @@ namespace gbe
|
|
/*! Start the memory debugger */
|
|
static void MemDebuggerStart(void) {
|
|
if (memDebugger == NULL) {
|
|
- atexit(MemDebuggerEnd);
|
|
memDebugger = new MemDebugger;
|
|
}
|
|
}
|
|
@@ -291,6 +291,29 @@ namespace gbe
|
|
void alignedFree(void *ptr) { if (ptr) std::free(ptr); }
|
|
} /* namespace gbe */
|
|
|
|
+#elif defined(__FreeBSD__)
|
|
+
|
|
+#include <unistd.h>
|
|
+#include <sys/mman.h>
|
|
+#include <fcntl.h>
|
|
+#include <stdlib.h>
|
|
+#include <malloc_np.h>
|
|
+#include <iostream>
|
|
+
|
|
+namespace gbe
|
|
+{
|
|
+ void* alignedMalloc(size_t size, size_t align) {
|
|
+ void* ptr;
|
|
+ const int err = posix_memalign(&ptr,align,size);
|
|
+ FATAL_IF ((err != 0), "memory allocation failed");
|
|
+ MemDebuggerInitializeMem(ptr, size);
|
|
+ return ptr;
|
|
+ }
|
|
+
|
|
+ void alignedFree(void *ptr) { if (ptr) std::free(ptr); }
|
|
+} /* namespace gbe */
|
|
+
|
|
+
|
|
#else
|
|
#error "Unsupported platform"
|
|
#endif /* __LINUX__ */
|