1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Mesa 3D Graphics Library
8 HOMEPAGE= https://www.mesa3d.org/
12 SITES[main]= https://mesa.freedesktop.org/archive/
13 ftp://ftp.freedesktop.org/pub/mesa/
14 DISTFILE[1]= mesa-19.2.6.tar.xz:main
16 SPKGS[standard]= complete
20 OPTIONS_AVAILABLE= X86_DRIVERS ARM_DRIVERS LLVMPIPE WAYLAND
21 OPTIONS_STANDARD= X86_DRIVERS ARM_DRIVERS LLVMPIPE
22 OPT_ON[freebsd]= LLVMPIPE//i386|x86_64
23 OPT_ON[aarch64]= ARM_DRIVERS
24 OPT_ON[linux]= LLVMPIPE//i386|x86_64
25 OPT_ON[x86_64]= X86_DRIVERS
26 OPT_ON[dragonfly]= LLVMPIPE//i386|x86_64
27 OPT_ON[i386]= X86_DRIVERS
29 BUILD_DEPENDS= autoselect-python:single:standard
30 python-Mako:single:python_used
31 libpthread-stubs:single:standard
33 libelf:single:standard
34 libvdpau:single:standard
37 BUILDRUN_DEPENDS= expat:shared:standard
39 libdrm:single:standard
40 EXRUN[drivers]= mesa:libs:standard
41 libelf:single:standard
43 USES= bison gettext-tools gmake meson pkgconfig
44 python:build shebangfix solaris-funcs
46 XORG_COMPONENTS= x11 xdamage xext xfixes xshmfence xxf86vm xv xrandr
49 LICENSE= MIT:libs CUSTOM1:libs CUSTOM2:libs
50 LICENSE_NAME= CUSTOM1:"Kronos License (MIT with modifications)"
51 CUSTOM2:"SGI Free Software License B"
52 LICENSE_FILE= MIT:{{WRKDIR}}/LICENSE_MIT
53 CUSTOM1:{{WRKDIR}}/LICENSE_KHRONOS
54 CUSTOM2:{{WRKDIR}}/LICENSE_SGI
55 LICENSE_AWK= MIT:"^$$"
57 LICENSE_SOURCE= MIT:{{WRKSRC}}/include/GL/gl.h
58 CUSTOM2:{{WRKSRC}}/src/glx/eval.c
61 FPC_EQUIVALENT= graphics/mesa-libs
62 MESON_ARGS= -Dplatforms=x11,drm{{WAYPLAT}}
64 -Ddri-drivers={{DRI_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
65 -Dgallium-drivers={{GALLIUM_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
70 -Dvulkan-drivers={{VULKAN_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
71 SHEBANG_FILES= src/gallium/*/*/*.py
72 src/gallium/tools/trace/*.py
73 src/gallium/drivers/svga/svgadump/svga_dump.py
74 src/mapi/glapi/gen/*.py
76 src/util/xmlpool/gen_xmlpool.py
77 src/mesa/main/get_*.py
78 src/util/format_srgb.py
80 src/intel/genxml/gen_pack_header.py
81 SHEBANG_OLD_PYTHON= /usr/bin/env[[:space:]]python2
83 /bin/env[[:space:]]python
84 SOL_FUNCTIONS= dirfd:src/util/disk_cache.c
85 asprintf:src/util/anon_file.c
86 asprintf:src/mesa/drivers/dri/common/megadriver_stub.c
87 asprintf:src/loader/loader.c
88 asprintf:src/egl/main/eglcurrent.c
89 asprintf:src/util/u_string.h
90 strnlen:src/util/ralloc.c
91 strnlen:src/mesa/main/errors.c
92 strndup:src/util/xmlconfig.c
93 strndup:src/loader/loader.c
94 strndup:src/egl/drivers/dri2/platform_x11.c
96 CONFIGURE_ENV= ax_cv_check_cflags___Wno_initializer_overrides=no
98 INSTALL_TARGET= install-strip
99 INSTALL_REQ_TOOLCHAIN= yes
101 VAR_OPSYS[sunos]= CPPFLAGS=-D__EXTENSIONS__=1
102 CPPFLAGS=-Wno-unused-function
103 CXXFLAGS=-Drestrict=__restrict__
104 CFLAGS=-D_POSIX_PTHREAD_SEMANTICS
105 CFLAGS=-DF_DUPFD_CLOEXEC=F_DUPFD
109 [ARM_DRIVERS].DESCRIPTION= Build drivers for aarch64 architecture
110 [ARM_DRIVERS].MAKEFILE_ON= GALLIUM_DRIVERS+=FREEDRENO
113 [X86_DRIVERS].DESCRIPTION= Build drivers for i386 and x86_64 architectures
114 [X86_DRIVERS].MAKEFILE_ON= DRI_DRIVERS+=R100
118 GALLIUM_DRIVERS+=R300
119 GALLIUM_DRIVERS+=SVGA
120 GALLIUM_DRIVERS+={{GALLIUM_LLVM_DRIVERS}}
121 VULKAN_DRIVERS+={{VULKAN_DRIVERS_X86}}
123 [WAYLAND].DESCRIPTION= Build Vulkan drivers for Wayland platform
124 [WAYLAND].BUILDRUN_DEPENDS_ON= wayland:primary:standard
125 [WAYLAND].BUILD_DEPENDS_ON= wayland-protocols:single:standard
126 python-Mako:single:python_default
127 [WAYLAND].MAKEFILE_ON= WAYPLAT=,surfaceless,wayland
128 VULKAN_DRIVERS+=INTEL
129 VULKAN_DRIVERS_X86+=RADEON
131 [LLVMPIPE].DESCRIPTION= Build LLVM-based drivers and libraries
132 [LLVMPIPE].BUILDRUN_DEPENDS_ON= llvm:single:standard
133 opencl:single:standard
134 ocl-icd:primary:standard
135 [LLVMPIPE].BUILD_DEPENDS_ON= libclc:single:standard
136 clang:compiler:standard
137 [LLVMPIPE].MAKEFILE_OFF= MESON_ARGS+=-Dgallium-opencl=disabled
138 [LLVMPIPE].MAKEFILE_ON= GALLIUM_LLVM_DRIVERS+=R600
139 GALLIUM_LLVM_DRIVERS+=RADEONSI
140 MESON_ARGS+=-Dllvm=true
141 MESON_ARGS+=-Dgallium-xvmc=true
142 MESON_ARGS+=-Dgallium-va=true
143 MESON_ARGS+=-Dgallium-opencl=icd
144 [LLVMPIPE].XORG_COMPONENTS_ON= xvmc
147 ${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
148 ${WRKSRC}/src/util/xmlconfig.c
151 ${AWK} '/Copyright/,/DEALINGS/' ${WRKSRC}/include/GL/glext.h \
152 > ${WRKDIR}/LICENSE_KHRONOS
154 [FILE:1198:descriptions/desc.libs]
155 The Mesa project began as an open-source implementation of the OpenGL
156 specification - a system for rendering interactive 3D graphics.
158 Over the years the project has grown to implement more graphics APIs,
159 including OpenGL ES (versions 1, 2, 3), OpenCL, OpenMAX, VDPAU, VA API,
162 A variety of device drivers allows the Mesa libraries to be used in many
163 different environments ranging from software emulation to complete
164 hardware acceleration for modern GPUs.
166 Mesa ties into several other open-source projects: the Direct Rendering
167 Infrastructure and X.org to provide OpenGL support on Linux, FreeBSD
168 and other operating systems.
170 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
171 These include libOSMesa, libEGL, libGL, and libglesv2 as well as utility
172 libraries libglapi and gbm. The OSMesa library is an Off-Screen version
173 of Mesa in order to do off-screen rendering in other packages like VTK.
174 Offscreen rendering is useful for a number of things, such as batch
175 processing, parallel processing, and remote processing.
177 This package also contains Mesa's libOpenCL implementation "Clover". It is
178 built upon GALLIUM and currently only supports Radeon GPUs.
181 [FILE:162:descriptions/desc.drivers]
182 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
183 These include libEGL, libGL, and libglesv2 as well as utlity libraries
188 9d7b24fa60c82db34788196450042a55ce6cb2d70c7a8d5c31401619b6907797 11460244 mesa-19.2.6.tar.xz
191 [FILE:981:manifests/plist.libs]
192 %%LLVMPIPE-ON%%etc/OpenCL/vendors/mesa.icd
196 libMesaOpenCL.so.1.0.0
197 %%LLVMPIPE-ON%%lib/gallium-pipe/
231 include/KHR/khrplatform.h
253 libxatracker.so.2.5.0
263 [FILE:762:manifests/plist.drivers]
264 %%ARM_DRIVERS-ON%%lib/dri/
268 %%LLVMPIPE-ON%%lib/libXvMCr600.so
269 %%LLVMPIPE-ON%%lib/dri/
273 radeonsi_drv_video.so
274 %%LLVMPIPE-ON%%lib/vdpau/
278 libvdpau_r600.so.1.0.0
280 libvdpau_radeonsi.so.1
281 libvdpau_radeonsi.so.1.0
282 libvdpau_radeonsi.so.1.0.0
283 %%X86_DRIVERS-ON%%lib/dri/
290 %%X86_DRIVERS-ON%%lib/vdpau/
294 libvdpau_r300.so.1.0.0
295 include/GL/internal/dri_interface.h
300 share/drirc.d/00-mesa-defaults.conf
303 [FILE:511:patches/patch-include_GL_internal_dri__interface.h]
304 GCC on 9.x doesn't allow types to be overwritten, these types are defined
305 in drm.h also, which causes build issues in xorg-server.
307 --- include/GL/internal/dri_interface.h.orig 2019-11-22 00:06:57 UTC
308 +++ include/GL/internal/dri_interface.h
310 #ifndef DRI_INTERFACE_H
311 #define DRI_INTERFACE_H
316 -typedef unsigned int drm_context_t;
317 -typedef unsigned int drm_drawable_t;
318 -typedef struct drm_clip_rect drm_clip_rect_t;
325 [FILE:629:patches/patch-src_amd_common_ac__debug.c]
326 --- src/amd/common/ac_debug.c.orig 2019-11-22 00:06:57 UTC
327 +++ src/amd/common/ac_debug.c
328 @@ -573,6 +573,10 @@ void ac_parse_ib_chunk(FILE *f, uint32_t
329 unsigned trace_id_count, enum chip_class chip_class,
330 ac_debug_addr_callback addr_callback, void *addr_callback_data)
333 + printf("\nac_parse_ib_chunk: open_memstream unsupported on solaris");
336 struct ac_ib_parser ib = {};
339 @@ -598,6 +602,7 @@ void ac_parse_ib_chunk(FILE *f, uint32_t
340 printf("\nPacket ends after the end of IB.\n");
349 [FILE:485:patches/patch-src_amd_vulkan_radv__device.c]
350 - Define CLOCK_MONOTONIC_RAW if missing
352 --- src/amd/vulkan/radv_device.c.orig 2019-11-22 00:06:57 UTC
353 +++ src/amd/vulkan/radv_device.c
355 #include "compiler/glsl_types.h"
356 #include "util/xmlpool.h"
358 +#ifndef CLOCK_MONOTONIC_RAW
359 +# ifdef CLOCK_MONOTONIC_FAST
360 +# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
362 +# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
367 radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
371 [FILE:321:patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c]
372 - Define ETIME if missing
374 --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig 2019-11-22 00:06:57 UTC
375 +++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
377 #include "radv_amdgpu_bo.h"
381 +#define ETIME ETIMEDOUT
385 VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024
388 [FILE:784:patches/patch-src_compiler_glsl_linker.cpp]
389 --- src/compiler/glsl/linker.cpp.orig 2019-11-22 00:06:57 UTC
390 +++ src/compiler/glsl/linker.cpp
392 #include "main/enums.h"
393 #include "main/mtypes.h"
396 +/* uses libbsd4sol prototypes, so can't be static */
402 +strnlen(const char *s, size_t maxlen)
405 + for (len = 0; len < maxlen; len++, s++) {
412 +strndup(const char *str, size_t n)
419 + return strdup(str);
420 + if ((copy = (char *)malloc(len + 1)) == NULL)
422 + memcpy(copy, str, len);
432 [FILE:586:patches/patch-src_egl_drivers_dri2_platform__x11.c]
433 # work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
435 --- src/egl/drivers/dri2/platform_x11.c.orig 2019-11-22 00:06:57 UTC
436 +++ src/egl/drivers/dri2/platform_x11.c
437 @@ -1539,6 +1539,9 @@ dri2_initialize_x11(_EGLDriver *drv, _EG
439 if (!disp->Options.ForceSoftware) {
441 +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)
442 + if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false))
444 if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
445 initialized = dri2_initialize_x11_dri3(drv, disp);
449 [FILE:3256:patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c]
450 Revert the following commit.
452 FreeBSD and DragonFly don't have the required render nodes.
456 From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
457 From: Emil Velikov <emil.l.velikov@gmail.com>
458 Date: Mon, 29 Jun 2015 12:36:45 +0100
459 Subject: pipe-loader: drop support for non-render node devices
461 Render nodes have been around for quite some time. Removing support via
462 the master/primary node allows us to clean up the conditional
463 compilation and simplify the build greatly.
465 For example currently we the pipe-loader, which explicitly links against
466 xcb and friends (for X auth) if found at compile-time. That
467 would cause problems as one will be forced to use X/xcb, even if it's a
468 headless system that is used for opencl.
470 v2: Clarify the linking topic in the commit message.
472 Cc: Tom Stellard <thomas.stellard@amd.com>
473 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
474 Reviewed-by: Francisco Jerez <currojerez@riseup.net>
477 --- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2019-11-22 00:06:57 UTC
478 +++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
479 @@ -241,6 +241,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa
483 +open_drm_minor(int minor)
485 + char path[PATH_MAX];
486 + snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
487 + return open(path, O_RDWR, 0);
491 open_drm_render_node_minor(int minor)
494 @@ -252,8 +260,15 @@ open_drm_render_node_minor(int minor)
496 pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
499 + int i, k, fd, num_render_node_devs;
503 + unsigned vendor_id;
505 + } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
507 + /* Look for render nodes first */
508 for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
509 i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
510 struct pipe_loader_device *dev;
511 @@ -267,6 +282,9 @@ pipe_loader_drm_probe(struct pipe_loader
515 + render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
516 + render_node_devs[j].chip_id = dev->u.pci.chip_id;
521 @@ -276,6 +294,46 @@ pipe_loader_drm_probe(struct pipe_loader
525 + num_render_node_devs = j;
527 + /* Next look for drm devices. */
528 + for (i = 0; i < DRM_MAX_MINOR; i++) {
529 + struct pipe_loader_device *dev;
530 + boolean duplicate = FALSE;
531 + fd = open_drm_minor(i);
535 + if (!pipe_loader_drm_probe_fd(&dev, fd)) {
540 + /* Check to make sure we aren't already accessing this device via
543 + for (k = 0; k < num_render_node_devs; k++) {
544 + if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
545 + dev->u.pci.chip_id == render_node_devs[k].chip_id) {
547 + dev->ops->release(&dev);
559 + dev->ops->release(&dev);
570 [FILE:271:patches/patch-src_gallium_auxiliary_rbug_rbug__texture.c]
571 --- src/gallium/auxiliary/rbug/rbug_texture.c.orig 2019-11-22 00:06:57 UTC
572 +++ src/gallium/auxiliary/rbug/rbug_texture.c
575 #include "c99_alloca.h"
581 #include "rbug_internal.h"
582 #include "rbug_texture.h"
586 [FILE:326:patches/patch-src_gallium_auxiliary_renderonly_renderonly.c]
587 --- src/gallium/auxiliary/renderonly/renderonly.c.orig 2019-11-22 00:06:57 UTC
588 +++ src/gallium/auxiliary/renderonly/renderonly.c
590 #include "util/u_inlines.h"
591 #include "util/u_memory.h"
598 renderonly_dup(const struct renderonly *ro)
602 [FILE:6358:patches/patch-src_gallium_auxiliary_util_u__format__rgtc.c]
603 --- src/gallium/auxiliary/util/u_format_rgtc.c.orig 2019-11-22 00:06:57 UTC
604 +++ src/gallium/auxiliary/util/u_format_rgtc.c
605 @@ -175,13 +175,13 @@ util_format_rgtc1_snorm_pack_rgba_float(
606 for(y = 0; y < height; y += bh) {
607 int8_t *dst = (int8_t *)dst_row;
608 for(x = 0; x < width; x += bw) {
609 - int8_t tmp[4][4]; /* [bh][bw][comps] */
610 + signed char tmp[4][4]; /* [bh][bw][comps] */
611 for(j = 0; j < bh; ++j) {
612 for(i = 0; i < bw; ++i) {
613 - tmp[j][i] = float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
614 + tmp[j][i] = (signed char)float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
617 - util_format_signed_encode_rgtc_ubyte(dst, tmp, 4, 4);
618 + util_format_signed_encode_rgtc_ubyte((signed char *)dst, tmp, 4, 4);
619 dst += bytes_per_block;
621 dst_row += dst_stride / sizeof(*dst_row);
622 @@ -194,14 +194,14 @@ util_format_rgtc1_snorm_unpack_rgba_floa
625 for(y = 0; y < height; y += 4) {
626 - const int8_t *src = (int8_t *)src_row;
627 + const signed char *src = (signed char *)src_row;
628 for(x = 0; x < width; x += 4) {
629 for(j = 0; j < 4; ++j) {
630 for(i = 0; i < 4; ++i) {
631 float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
634 util_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
635 - dst[0] = byte_to_float_tex(tmp_r);
636 + dst[0] = byte_to_float_tex((int8_t)tmp_r);
640 @@ -216,9 +216,9 @@ util_format_rgtc1_snorm_unpack_rgba_floa
642 util_format_rgtc1_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
645 - util_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 1);
646 - dst[0] = byte_to_float_tex(tmp_r);
648 + util_format_signed_fetch_texel_rgtc(0, (signed char *)src, i, j, &tmp_r, 1);
649 + dst[0] = byte_to_float_tex((int8_t)tmp_r);
653 @@ -268,16 +268,16 @@ util_format_rgtc2_unorm_pack_rgba_8unorm
654 for(y = 0; y < height; y += bh) {
655 uint8_t *dst = dst_row;
656 for(x = 0; x < width; x += bw) {
657 - uint8_t tmp_r[4][4]; /* [bh][bw] */
658 - uint8_t tmp_g[4][4]; /* [bh][bw] */
659 + unsigned char tmp_r[4][4]; /* [bh][bw] */
660 + unsigned char tmp_g[4][4]; /* [bh][bw] */
661 for(j = 0; j < bh; ++j) {
662 for(i = 0; i < bw; ++i) {
663 - tmp_r[j][i] = src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4];
664 - tmp_g[j][i] = src_row[((y + j)*src_stride/sizeof(*src_row) + (x + i)*4) + 1];
665 + tmp_r[j][i] = (unsigned char)src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4];
666 + tmp_g[j][i] = (unsigned char)src_row[((y + j)*src_stride/sizeof(*src_row) + (x + i)*4) + 1];
669 - util_format_unsigned_encode_rgtc_ubyte(dst, tmp_r, 4, 4);
670 - util_format_unsigned_encode_rgtc_ubyte(dst + 8, tmp_g, 4, 4);
671 + util_format_unsigned_encode_rgtc_ubyte((unsigned char *)dst, tmp_r, 4, 4);
672 + util_format_unsigned_encode_rgtc_ubyte((unsigned char *)(dst + 8), tmp_g, 4, 4);
673 dst += bytes_per_block;
675 dst_row += dst_stride / sizeof(*dst_row);
676 @@ -383,16 +383,16 @@ util_format_rgtc2_snorm_unpack_rgba_floa
679 for(y = 0; y < height; y += 4) {
680 - const int8_t *src = (int8_t *)src_row;
681 + const signed char *src = (signed char *)src_row;
682 for(x = 0; x < width; x += 4) {
683 for(j = 0; j < 4; ++j) {
684 for(i = 0; i < 4; ++i) {
685 float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
686 - int8_t tmp_r, tmp_g;
687 + signed char tmp_r, tmp_g;
688 util_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
689 util_format_signed_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
690 - dst[0] = byte_to_float_tex(tmp_r);
691 - dst[1] = byte_to_float_tex(tmp_g);
692 + dst[0] = byte_to_float_tex((int8_t)tmp_r);
693 + dst[1] = byte_to_float_tex((int8_t)tmp_g);
697 @@ -410,14 +410,14 @@ util_format_rxtc2_snorm_pack_rgba_float(
700 for(y = 0; y < height; y += bh) {
701 - int8_t *dst = (int8_t *)dst_row;
702 + signed char *dst = (signed char *)dst_row;
703 for(x = 0; x < width; x += bw) {
704 - int8_t tmp_r[4][4]; /* [bh][bw][comps] */
705 - int8_t tmp_g[4][4]; /* [bh][bw][comps] */
706 + signed char tmp_r[4][4]; /* [bh][bw][comps] */
707 + signed char tmp_g[4][4]; /* [bh][bw][comps] */
708 for(j = 0; j < bh; ++j) {
709 for(i = 0; i < bw; ++i) {
710 - tmp_r[j][i] = float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
711 - tmp_g[j][i] = float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4 + chan2off]);
712 + tmp_r[j][i] = (signed char)float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
713 + tmp_g[j][i] = (signed char)float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4 + chan2off]);
716 util_format_signed_encode_rgtc_ubyte(dst, tmp_r, 4, 4);
717 @@ -437,11 +437,11 @@ util_format_rgtc2_snorm_pack_rgba_float(
719 util_format_rgtc2_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
721 - int8_t tmp_r, tmp_g;
722 - util_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 2);
723 - util_format_signed_fetch_texel_rgtc(0, (int8_t *)src + 8, i, j, &tmp_g, 2);
724 - dst[0] = byte_to_float_tex(tmp_r);
725 - dst[1] = byte_to_float_tex(tmp_g);
726 + signed char tmp_r, tmp_g;
727 + util_format_signed_fetch_texel_rgtc(0, (signed char *)src, i, j, &tmp_r, 2);
728 + util_format_signed_fetch_texel_rgtc(0, (signed char *)src + 8, i, j, &tmp_g, 2);
729 + dst[0] = byte_to_float_tex((int8_t)tmp_r);
730 + dst[1] = byte_to_float_tex((int8_t)tmp_g);
736 [FILE:338:patches/patch-src_gallium_drivers_radeonsi_si__shader.c]
737 --- src/gallium/drivers/radeonsi/si_shader.c.orig 2019-11-22 00:06:57 UTC
738 +++ src/gallium/drivers/radeonsi/si_shader.c
740 * USE OR OTHER DEALINGS IN THE SOFTWARE.
744 +#include <alloca.h> /* for alloca */
747 #include "util/u_memory.h"
748 #include "util/u_string.h"
749 #include "tgsi/tgsi_build.h"
752 [FILE:511:patches/patch-src_gallium_drivers_radeonsi_si__state__shaders.c]
753 --- src/gallium/drivers/radeonsi/si_state_shaders.c.orig 2019-11-22 00:06:57 UTC
754 +++ src/gallium/drivers/radeonsi/si_state_shaders.c
755 @@ -2112,6 +2112,7 @@ static void si_build_shader_variant(stru
760 if (shader->compiler_ctx_state.is_debug_context) {
761 FILE *f = open_memstream(&shader->shader_log,
762 &shader->shader_log_size);
763 @@ -2120,6 +2121,7 @@ static void si_build_shader_variant(stru
769 si_shader_init_pm4_state(sscreen, shader);
773 [FILE:360:patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c]
774 # define ETIME as ETIMEOUT same as in intel driver
776 --- src/gallium/drivers/vc4/vc4_bufmgr.c.orig 2019-11-22 00:06:57 UTC
777 +++ src/gallium/drivers/vc4/vc4_bufmgr.c
781 #include <xf86drmMode.h>
783 +#define ETIME ETIMEDOUT
786 #include "util/u_hash_table.h"
787 #include "util/u_memory.h"
790 [FILE:1604:patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp]
791 # fix errors like the following
793 # llvm/invocation.cpp:(.text+0x1275): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::c_str()
795 # /usr/bin/ld: ../../../../src/gallium/state_trackers/clover/.libs/libclover.a(libclllvm_la-invocation.o): relocation R_X86_64_PC32 against `_ZNKSt3__112bas
796 ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when making a shared object; recompile with -fPIC
797 # /usr/bin/ld: final link failed: Bad value
799 --- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig 2019-11-22 00:06:57 UTC
800 +++ src/gallium/state_trackers/clover/llvm/invocation.cpp
801 @@ -181,6 +181,8 @@ namespace {
802 return get_lang_standard_from_version_str(device_version);
805 + const char* cstr(const std::string& str) { return str.c_str(); }
807 std::unique_ptr<clang::CompilerInstance>
808 create_compiler_instance(const device &dev,
809 const std::vector<std::string> &opts,
810 @@ -193,8 +195,8 @@ namespace {
811 // Parse the compiler options. A file name should be present at the end
812 // and must have the .cl extension in order for the CompilerInvocation
813 // class to recognize it as an OpenCL source file.
814 - const std::vector<const char *> copts =
815 - map(std::mem_fn(&std::string::c_str), opts);
816 + std::vector<const char *> copts(opts.size());
817 + std::transform(opts.begin(), opts.end(), copts.begin(), cstr);
819 const target &target = dev.ir_target();
820 const std::string &device_clc_version = dev.device_clc_version();
823 [FILE:635:patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp]
824 # Fix error: no matching constructor for initialization of 'std::vector<const ::llvm::MDNode *>'
826 --- src/gallium/state_trackers/clover/llvm/metadata.hpp.orig 2019-11-22 00:06:57 UTC
827 +++ src/gallium/state_trackers/clover/llvm/metadata.hpp
828 @@ -42,7 +42,7 @@ namespace clover {
829 get_kernel_nodes(const ::llvm::Module &mod) {
830 if (const ::llvm::NamedMDNode *n =
831 mod.getNamedMetadata("opencl.kernels"))
832 - return { n->op_begin(), n->op_end() };
833 + return { n->getOperand(0), n->getOperand(n->getNumOperands()) };
839 [FILE:1150:patches/patch-src_gallium_state__trackers_clover_util_range.hpp]
840 From b95533b981af9a6687b41418e7cc2a5652fc2bdb Mon Sep 17 00:00:00 2001
841 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= <dumbbell@FreeBSD.org>
842 Date: Fri, 7 Mar 2014 15:16:08 +0100
843 Subject: [PATCH 3/3] Work around for clang 3.4 which fails to build Clover
846 https://bugs.freedesktop.org/show_bug.cgi?id=74098#c3
847 --- src/gallium/state_trackers/clover/util/range.hpp.orig 2019-11-22 00:06:57 UTC
848 +++ src/gallium/state_trackers/clover/util/range.hpp
849 @@ -362,6 +362,12 @@ namespace clover {
854 + template<typename T>
855 + using fixup_function_type =
856 + typename std::conditional<std::is_function<T>::value, T &, T>::type;
860 /// Create a range by transforming the contents of a number of
861 /// source ranges \a rs element-wise using a provided functor \a f.
862 @@ -369,7 +375,7 @@ namespace clover {
863 /// \sa adaptor_range.
865 template<typename F, typename... Rs>
866 - adaptor_range<F, Rs...>
867 + adaptor_range<detail::fixup_function_type<F>, Rs...>
868 map(F &&f, Rs &&... rs) {
869 return { std::forward<F>(f), std::forward<Rs>(rs)... };
873 [FILE:816:patches/patch-src_gallium_targets_dri_meson.build]
874 --- src/gallium/targets/dri/meson.build.orig 2019-11-22 00:06:57 UTC
875 +++ src/gallium/targets/dri/meson.build
876 @@ -46,11 +46,12 @@ libgallium_dri = shared_library(
878 c_args : [c_vis_args],
879 cpp_args : [cpp_vis_args],
880 - link_args : [ld_args_build_id, ld_args_gc_sections, gallium_dri_ld_args],
881 + link_args : [ld_args_gc_sections, gallium_dri_ld_args],
882 link_depends : gallium_dri_link_depends,
883 + link_whole : [libdricommon, libgallium, libr300, libdri, libnir],
885 - libmesa_gallium, libdricommon, libmegadriver_stub, libdri, libgalliumvl,
886 - libgallium, libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
887 + libmesa_gallium, libmegadriver_stub, libgalliumvl,
888 + libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
894 [FILE:572:patches/patch-src_gallium_targets_osmesa_meson.build]
895 --- src/gallium/targets/osmesa/meson.build.orig 2019-11-22 00:06:57 UTC
896 +++ src/gallium/targets/osmesa/meson.build
897 @@ -43,9 +43,9 @@ libosmesa = shared_library(
900 link_depends : osmesa_link_deps,
901 - link_whole : [libosmesa_st, libglapi_static],
902 + link_whole : [libosmesa_st, libglapi_static, libsoftpipe, libgallium, libnir],
904 - libmesa_gallium, libgallium, libws_null, osmesa_link_with,
905 + libmesa_gallium, libws_null, osmesa_link_with,
908 dep_selinux, dep_thread, dep_clock, dep_unwind,
911 [FILE:613:patches/patch-src_gallium_targets_vdpau_meson.build]
912 --- src/gallium/targets/vdpau/meson.build.orig 2019-11-22 00:06:57 UTC
913 +++ src/gallium/targets/vdpau/meson.build
914 @@ -45,10 +45,10 @@ libvdpau_gallium = shared_library(
915 include_directories : [
916 inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
918 - link_whole : [libvdpau_st],
919 + link_whole : [libvdpau_st, libr300, libradeonwinsys, libpipe_loader_static],
921 libgalliumvlwinsys, libgalliumvl, libgallium,
922 - libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
923 + libws_null, libwsw, libswdri, libswkmsdri,
929 [FILE:558:patches/patch-src_gallium_targets_xa_meson.build]
930 --- src/gallium/targets/xa/meson.build.orig 2019-11-22 00:06:57 UTC
931 +++ src/gallium/targets/xa/meson.build
932 @@ -41,9 +41,9 @@ libxatracker = shared_library(
933 include_directories : [
934 inc_common, inc_util, inc_gallium_winsys, inc_gallium_drivers,
936 - link_whole : [libxa_st],
937 + link_whole : [libxa_st, libsvga, libsvgadrm, libpipe_loader_static],
939 - libgalliumvl_stub, libgallium, libpipe_loader_static,
940 + libgalliumvl_stub, libgallium,
941 libws_null, libwsw, libswdri, libswkmsdri,
943 link_depends : xa_link_depends,
946 [FILE:324:patches/patch-src_gallium_winsys_amdgpu_drm_amdgpu__cs.c]
947 --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c.orig 2019-11-22 00:06:58 UTC
948 +++ src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
951 #include "amd/common/sid.h"
957 DEBUG_GET_ONCE_BOOL_OPTION(noop, "RADEON_NOOP", false)
959 #ifndef AMDGPU_IB_FLAG_RESET_GDS_MAX_WAVE_ID
962 [FILE:426:patches/patch-src_gbm_meson.build]
963 --- src/gbm/meson.build.orig 2019-11-22 00:06:58 UTC
964 +++ src/gbm/meson.build
965 @@ -50,7 +50,7 @@ libgbm = shared_library(
966 c_args : [c_vis_args, args_gbm],
967 link_args : [ld_args_gc_sections],
968 link_with : libloader,
969 - dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil, idep_xmlconfig],
970 + dependencies : [deps_gbm, dep_dl, dep_thread, idep_xmlconfig, idep_mesautil],
976 [FILE:575:patches/patch-src_glx_glxext.c]
977 # work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
979 --- src/glx/glxext.c.orig 2019-11-22 00:06:58 UTC
981 @@ -914,6 +914,9 @@ __glXInitialize(Display * dpy)
982 #if defined(GLX_USE_DRM)
983 if (glx_direct && glx_accel) {
984 #if defined(HAVE_DRI3)
985 +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(__DRM_NEXT__)
986 + if (env_var_as_boolean("LIBGL_DRI3_ENABLE", false))
988 if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
989 dpyPriv->dri3Display = dri3_create_display(dpy);
990 #endif /* HAVE_DRI3 */
993 [FILE:318:patches/patch-src_glx_meson.build]
994 --- src/glx/meson.build.orig 2019-11-22 00:06:58 UTC
995 +++ src/glx/meson.build
996 @@ -149,7 +149,7 @@ libglx = static_library(
1000 - idep_mesautil, idep_xmlconfig,
1001 + idep_xmlconfig, idep_mesautil,
1002 dep_libdrm, dep_dri2proto, dep_glproto, dep_x11, dep_glvnd,
1007 [FILE:995:patches/patch-src_intel_compiler_brw__eu__validate.c]
1008 --- src/intel/compiler/brw_eu_validate.c.orig 2019-11-22 00:06:58 UTC
1009 +++ src/intel/compiler/brw_eu_validate.c
1015 +#include <string.h>
1018 +memmem(const void *l, size_t l_len, const void *s, size_t s_len)
1021 + const char *cl = (const char *)l;
1022 + const char *cs = (const char *)s;
1024 + /* we need something to compare */
1025 + if (l_len == 0 || s_len == 0)
1028 + /* "s" must be smaller or equal to "l" */
1029 + if (l_len < s_len)
1032 + /* special case where s_len == 1 */
1034 + return memchr(l, (int)*cs, l_len);
1036 + /* the last position where its possible to find "s" in "l" */
1037 + last = (char *)cl + l_len - s_len;
1039 + for (cur = (char *)cl; cur <= last; cur++)
1040 + if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
1047 /* We're going to do lots of string concatenation, so this should help. */
1052 [FILE:954:patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp]
1053 --- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig 2019-11-22 00:06:58 UTC
1054 +++ src/intel/compiler/brw_fs_bank_conflicts.cpp
1055 @@ -309,8 +309,13 @@ namespace {
1056 const unsigned align = MAX2(sizeof(void *), __alignof__(vector_type));
1057 const unsigned size = DIV_ROUND_UP(n, vector_width) * sizeof(vector_type);
1060 + p = memalign(align, size);
1061 + if (p == NULL) return NULL;
1063 if (posix_memalign(&p, align, size))
1067 return reinterpret_cast<vector_type *>(p);
1069 @@ -728,7 +733,7 @@ namespace {
1070 const weight_vector_type &conflicts)
1072 const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width);
1073 - vector_type s_p = {}, s_n = {};
1074 + vector_type s_p = {0}, s_n = {0};
1076 for (unsigned r = 0; r < m; r++) {
1077 s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r]));
1080 [FILE:225:patches/patch-src_intel_isl_isl.h]
1081 --- src/intel/isl/isl.h.orig 2019-11-22 00:06:58 UTC
1082 +++ src/intel/isl/isl.h
1084 #include "util/macros.h"
1088 +# define restrict __restrict__
1095 [FILE:1594:patches/patch-src_intel_perf_gen__perf.c]
1096 $NetBSD: patch-src_intel_perf_gen__perf.c,v 1.1 2019/08/24 20:11:19 nia Exp $
1098 SunOS does not have d_type in DIR structure.
1100 --- src/intel/perf/gen_perf.c.orig 2019-11-22 00:06:58 UTC
1101 +++ src/intel/perf/gen_perf.c
1102 @@ -394,6 +394,9 @@ get_sysfs_dev_dir(struct gen_perf_config
1104 struct dirent *drm_entry;
1110 perf->sysfs_dev_dir[0] = '\0';
1112 @@ -425,8 +428,14 @@ get_sysfs_dev_dir(struct gen_perf_config
1115 while ((drm_entry = readdir(drmdir))) {
1117 + stat(drm_entry->d_name, &s);
1118 + if ((s.st_mode == S_IFDIR ||
1119 + s.st_mode == S_IFLNK) &&
1121 if ((drm_entry->d_type == DT_DIR ||
1122 drm_entry->d_type == DT_LNK) &&
1124 strncmp(drm_entry->d_name, "card", 4) == 0)
1126 len = snprintf(perf->sysfs_dev_dir,
1127 @@ -527,6 +536,9 @@ enumerate_sysfs_metrics(struct gen_perf_
1128 struct dirent *metric_entry;
1135 len = snprintf(buf, sizeof(buf), "%s/metrics", perf->sysfs_dev_dir);
1136 if (len < 0 || len >= sizeof(buf)) {
1137 @@ -543,8 +555,14 @@ enumerate_sysfs_metrics(struct gen_perf_
1138 while ((metric_entry = readdir(metricsdir))) {
1139 struct hash_entry *entry;
1142 + stat(metric_entry->d_name, &s);
1143 + if ((s.st_mode != S_IFDIR &&
1144 + s.st_mode != S_IFLNK) ||
1146 if ((metric_entry->d_type != DT_DIR &&
1147 metric_entry->d_type != DT_LNK) ||
1149 metric_entry->d_name[0] == '.')
1154 [FILE:302:patches/patch-src_intel_tools_aubinator__error__decode.c]
1155 # expose getline in FreeBSD's stdio.h
1157 --- src/intel/tools/aubinator_error_decode.c.orig 2019-11-22 00:06:58 UTC
1158 +++ src/intel/tools/aubinator_error_decode.c
1164 +#define _WITH_GETLINE
1166 #include <stdbool.h>
1171 [FILE:238:patches/patch-src_intel_tools_error2aub.c]
1172 --- src/intel/tools/error2aub.c.orig 2019-11-22 00:06:58 UTC
1173 +++ src/intel/tools/error2aub.c
1179 +#define _WITH_GETLINE
1183 #include <inttypes.h>
1186 [FILE:1096:patches/patch-src_intel_vulkan_anv__device.c]
1187 - Without sysinfo() fall back to sysconf()
1188 - Define ETIME if missing
1190 --- src/intel/vulkan/anv_device.c.orig 2019-11-22 00:06:58 UTC
1191 +++ src/intel/vulkan/anv_device.c
1193 #include <stdbool.h>
1195 #include <sys/mman.h>
1197 #include <sys/sysinfo.h>
1201 #include <xf86drm.h>
1202 @@ -60,6 +62,10 @@ DRI_CONF_END;
1204 #define MAX_DEBUG_MESSAGE_LENGTH 4096
1207 +#define ETIME ETIMEDOUT
1211 compiler_debug_log(void *data, const char *fmt, ...)
1213 @@ -96,10 +102,15 @@ static uint64_t
1214 anv_compute_heap_size(int fd, uint64_t gtt_size)
1216 /* Query the total ram from the system */
1218 struct sysinfo info;
1221 uint64_t total_ram = (uint64_t)info.totalram * (uint64_t)info.mem_unit;
1223 + uint64_t total_ram = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
1227 /* We don't want to burn too much ram with the GPU. If the user has 4GiB
1228 * or less, we use at most half. If they have more than 4GiB, we use 3/4.
1231 [FILE:354:patches/patch-src_loader_loader.c]
1232 $NetBSD: patch-src_loader_loader.c,v 1.5 2019/08/29 14:12:57 nia Exp $
1234 Include limits.h for PATH_MAX.
1236 --- src/loader/loader.c.orig 2019-11-22 00:06:58 UTC
1237 +++ src/loader/loader.c
1242 +#include <limits.h>
1243 #include <sys/param.h>
1244 #ifdef MAJOR_IN_MKDEV
1245 #include <sys/mkdev.h>
1248 [FILE:944:patches/patch-src_mesa_drivers_dri_i965_brw__bufmgr.c]
1249 --- src/mesa/drivers/dri/i965/brw_bufmgr.c.orig 2019-11-22 00:06:59 UTC
1250 +++ src/mesa/drivers/dri/i965/brw_bufmgr.c
1256 +#define O_CLOEXEC 0
1259 /* VALGRIND_FREELIKE_BLOCK unfortunately does not actually undo the earlier
1260 * VALGRIND_MALLOCLIKE_BLOCK but instead leaves vg convinced the memory is
1261 * leaked. All because it does not call VG(cli_free) from its
1262 @@ -1723,8 +1727,12 @@ brw_bufmgr_init(struct gen_device_info *
1263 bufmgr->initial_kflags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
1265 /* Allocate VMA in userspace if we have softpin and full PPGTT. */
1266 +#ifdef __DragonFly__
1269 if (gem_param(fd, I915_PARAM_HAS_EXEC_SOFTPIN) > 0 &&
1270 gem_param(fd, I915_PARAM_HAS_ALIASING_PPGTT) > 1) {
1272 bufmgr->initial_kflags |= EXEC_OBJECT_PINNED;
1274 util_vma_heap_init(&bufmgr->vma_allocator[BRW_MEMZONE_LOW_4G],
1277 [FILE:710:patches/patch-src_mesa_drivers_dri_i965_brw__disk__cache.c]
1278 --- src/mesa/drivers/dri/i965/brw_disk_cache.c.orig 2019-11-22 00:06:59 UTC
1279 +++ src/mesa/drivers/dri/i965/brw_disk_cache.c
1280 @@ -394,6 +394,7 @@ brw_disk_cache_init(struct intel_screen
1281 if (INTEL_DEBUG & DEBUG_DISK_CACHE_DISABLE_MASK)
1284 +# ifdef HAVE_DL_ITERATE_PHDR
1285 /* array length: print length + null char + 1 extra to verify it is unused */
1287 ASSERTED int len = snprintf(renderer, sizeof(renderer), "i965_%04x",
1288 @@ -413,5 +414,6 @@ brw_disk_cache_init(struct intel_screen
1289 const uint64_t driver_flags =
1290 brw_get_compiler_config_value(screen->compiler);
1291 screen->disk_cache = disk_cache_create(renderer, timestamp, driver_flags);
1297 [FILE:851:patches/patch-src_mesa_drivers_dri_i965_brw__program__binary.c]
1298 --- src/mesa/drivers/dri/i965/brw_program_binary.c.orig 2019-11-22 00:06:59 UTC
1299 +++ src/mesa/drivers/dri/i965/brw_program_binary.c
1300 @@ -36,9 +36,11 @@ static uint8_t driver_sha1[20];
1302 brw_program_binary_init(unsigned device_id)
1304 +#ifdef HAVE_DL_ITERATE_PHDR
1305 const struct build_id_note *note =
1306 build_id_find_nhdr_for_addr(brw_program_binary_init);
1311 * With Mesa's megadrivers, taking the sha1 of i965_dri.so may not be
1312 @@ -52,7 +54,9 @@ brw_program_binary_init(unsigned device_
1313 int len = snprintf(renderer, sizeof(renderer), "i965_%04x", device_id);
1314 assert(len == sizeof(renderer) - 1);
1315 _mesa_sha1_update(&ctx, renderer, len);
1316 +#ifdef HAVE_DL_ITERATE_PHDR
1317 _mesa_sha1_update(&ctx, build_id_data(note), build_id_length(note));
1319 _mesa_sha1_final(&ctx, driver_sha1);
1324 [FILE:1092:patches/patch-src_mesa_drivers_dri_i965_intel__batchbuffer.c]
1325 --- src/mesa/drivers/dri/i965/intel_batchbuffer.c.orig 2019-11-22 00:06:59 UTC
1326 +++ src/mesa/drivers/dri/i965/intel_batchbuffer.c
1327 @@ -67,7 +67,11 @@ dump_validation_list(struct intel_batchb
1328 uint64_t flags = batch->validation_list[i].flags;
1329 assert(batch->validation_list[i].handle ==
1330 batch->exec_bos[i]->gem_handle);
1332 fprintf(stderr, "[%2d]: %2d %-14s %p %s%-7s @ 0x%016llx%s (%"PRIu64"B)\n",
1334 + fprintf(stderr, "[%2d]: %2d %-14s %p %s%-7s @ 0x%016lx%s (%"PRIu64"B)\n",
1337 batch->validation_list[i].handle,
1338 batch->exec_bos[i]->name,
1339 @@ -721,7 +725,11 @@ execbuffer(int fd,
1341 /* Update brw_bo::gtt_offset */
1342 if (batch->validation_list[i].offset != bo->gtt_offset) {
1344 DBG("BO %d migrated: 0x%" PRIx64 " -> 0x%llx\n",
1346 + DBG("BO %d migrated: 0x%" PRIx64 " -> 0x%lx\n",
1348 bo->gem_handle, bo->gtt_offset,
1349 batch->validation_list[i].offset);
1350 assert(!(bo->kflags & EXEC_OBJECT_PINNED));
1353 [FILE:967:patches/patch-src_mesa_drivers_dri_meson.build]
1354 --- src/mesa/drivers/dri/meson.build.orig 2019-11-22 00:06:59 UTC
1355 +++ src/mesa/drivers/dri/meson.build
1361 +_dri_drivers = [ libnir, libmesa_classic, libintel_compiler, libglcpp, libdricommon ]
1365 @@ -59,14 +59,13 @@ if _dri_drivers != []
1367 link_whole : _dri_drivers,
1369 - libmegadriver_stub, libdricommon, libglapi,
1371 + libmegadriver_stub, libglapi,
1374 dep_selinux, dep_libdrm, dep_m, dep_thread, dep_dl,
1375 - idep_nir, idep_xmlconfig, idep_mesautil,
1376 + idep_xmlconfig, idep_mesautil,
1378 - link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
1379 + link_args : [ld_args_bsymbolic, ld_args_gc_sections],
1380 # Will be deleted during installation, see install_megadrivers.py
1382 install_dir : dri_drivers_path,
1385 [FILE:406:patches/patch-src_mesa_main_compiler.h]
1386 --- src/mesa/main/compiler.h.orig 2019-11-22 00:06:59 UTC
1387 +++ src/mesa/main/compiler.h
1389 #if defined(__linux__)
1390 #include <byteswap.h>
1391 #define CPU_TO_LE32( x ) bswap_32( x )
1392 +#elif defined(__FreeBSD__)
1393 +#include <sys/endian.h>
1394 +#define CPU_TO_LE32( x ) bswap32( x )
1395 #elif defined(__APPLE__)
1396 #include <CoreFoundation/CFByteOrder.h>
1397 #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
1400 [FILE:476:patches/patch-src_mesa_main_imports.c]
1401 --- src/mesa/main/imports.c.orig 2019-11-22 00:06:59 UTC
1402 +++ src/mesa/main/imports.c
1403 @@ -83,11 +83,15 @@ void *
1404 _mesa_align_malloc(size_t bytes, unsigned long alignment)
1406 #if defined(HAVE_POSIX_MEMALIGN)
1408 + return memalign(alignment, bytes);
1411 int err = posix_memalign(& mem, alignment, bytes);
1416 #elif defined(_WIN32)
1417 return _aligned_malloc(bytes, alignment);
1421 [FILE:237:patches/patch-src_mesa_main_macros.h]
1422 --- src/mesa/main/macros.h.orig 2019-11-22 00:06:59 UTC
1423 +++ src/mesa/main/macros.h
1425 #include "util/rounding.h"
1426 #include "imports.h"
1431 * \name Integer / float conversion for colors, normals, etc.
1434 [FILE:227:patches/patch-src_mesa_main_marshal.h]
1435 --- src/mesa/main/marshal.h.orig 2019-11-22 00:06:59 UTC
1436 +++ src/mesa/main/marshal.h
1439 #include "main/glthread.h"
1440 #include "main/context.h"
1442 #include "main/macros.h"
1444 struct marshal_cmd_base
1447 [FILE:328:patches/patch-src_util_build__id.c]
1448 # Elf_ doesn't exist, use Elf32_ or Elf64_
1450 --- src/util/build_id.c.orig 2019-11-22 00:06:59 UTC
1451 +++ src/util/build_id.c
1456 -#define ElfW(type) Elf_##type
1458 +#define ElfW(type) Elf64_##type
1460 +#define ElfW(type) Elf32_##type
1464 struct build_id_note {
1467 [FILE:282:patches/patch-src_util_disk__cache.c]
1468 --- src/util/disk_cache.c.orig 2019-11-22 00:06:59 UTC
1469 +++ src/util/disk_cache.c
1472 #include "disk_cache.h"
1475 +#define O_CLOEXEC 0
1478 /* Number of bits to mask off from a cache key to get an index. */
1479 #define CACHE_INDEX_KEY_BITS 16
1483 [FILE:1482:patches/patch-src_util_futex.h]
1484 - Implement futex_wake() and futex_wait() via _umtx_op()
1486 --- src/util/futex.h.orig 2019-11-22 00:06:59 UTC
1487 +++ src/util/futex.h
1492 +#if defined(__FreeBSD__)
1494 +# if __FreeBSD__ < 11
1495 +# include <machine/atomic.h>
1497 +#include <sys/umtx.h>
1499 #include <linux/futex.h>
1500 #include <sys/syscall.h>
1502 #include <sys/time.h>
1504 +#if defined(__FreeBSD__)
1505 +static inline int futex_wake(uint32_t *addr, int count)
1507 + return _umtx_op(addr, UMTX_OP_WAKE, (uint32_t)count, NULL, NULL) == -1 ? errno : 0;
1510 +static inline int futex_wait(uint32_t *addr, int32_t value, struct timespec *timeout)
1512 + void *uaddr = NULL, *uaddr2 = NULL;
1513 + if (timeout != NULL) {
1514 + const struct _umtx_time tmo = { ._timeout = *timeout, ._flags = UMTX_ABSTIME, ._clockid = CLOCK_MONOTONIC };
1515 + uaddr = (void *)(uintptr_t)sizeof(tmo);
1516 + uaddr2 = (void *)&tmo;
1518 + return _umtx_op(addr, UMTX_OP_WAIT_UINT, (uint32_t)value, uaddr, uaddr2) == -1 ? errno : 0;
1521 static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
1523 return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
1524 @@ -50,6 +75,7 @@ static inline int futex_wait(uint32_t *a
1525 return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL,
1526 FUTEX_BITSET_MATCH_ANY);
1530 #elif defined(__FreeBSD__)
1534 [FILE:544:patches/patch-src_util_os__memory__stdc.h]
1535 --- src/util/os_memory_stdc.h.orig 2019-11-22 00:06:59 UTC
1536 +++ src/util/os_memory_stdc.h
1538 static inline void *
1539 os_malloc_aligned(size_t size, size_t alignment)
1542 + alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
1543 + return memalign(alignment, size);
1546 alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
1547 if(posix_memalign(&ptr, alignment, size) != 0)
1553 #define os_free_aligned(_ptr) free(_ptr)
1556 [FILE:430:patches/patch-src_util_u__atomic.h]
1557 --- src/util/u_atomic.h.orig 2019-11-22 00:06:59 UTC
1558 +++ src/util/u_atomic.h
1560 * locally coded assembly, compiler intrinsic or ultimately a
1561 * mutex-based implementation.
1564 -#define PIPE_ATOMIC_OS_SOLARIS
1565 -#elif defined(_MSC_VER)
1566 -#define PIPE_ATOMIC_MSVC_INTRINSIC
1567 -#elif defined(__GNUC__)
1568 +#if defined(__GNUC__)
1569 #define PIPE_ATOMIC_GCC_INTRINSIC
1571 #error "Unsupported platform"
1574 [FILE:1026:patches/patch-src_util_u__thread.h]
1575 --- src/util/u_thread.h.orig 2019-11-22 00:06:59 UTC
1576 +++ src/util/u_thread.h
1577 @@ -69,16 +69,14 @@ static inline thrd_t u_thread_create(int
1578 static inline void u_thread_setname( const char *name )
1580 #if defined(HAVE_PTHREAD)
1581 -#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS
1582 +#if DETECT_OS_LINUX || DETECT_OS_CYGWIN
1583 pthread_setname_np(pthread_self(), name);
1584 -#elif DETECT_OS_FREEBSD || DETECT_OS_OPENBSD
1585 +#elif DETECT_OS_FREEBSD || DETECT_OS_OPENBSD || DETECT_OS_DRAGONFLY
1586 pthread_set_name_np(pthread_self(), name);
1587 #elif DETECT_OS_NETBSD
1588 pthread_setname_np(pthread_self(), "%s", (void *)name);
1589 #elif DETECT_OS_APPLE
1590 pthread_setname_np(name);
1592 -#error Not sure how to call pthread_setname_np
1596 @@ -149,7 +147,7 @@ util_get_L3_for_pinned_thread(thrd_t thr
1597 static inline int64_t
1598 u_thread_get_time_nano(thrd_t thread)
1600 -#if defined(__linux__) && defined(HAVE_PTHREAD)
1601 +#if defined(HAVE_PTHREAD) && !defined(__sun)
1607 [FILE:87:files/special.mk]
1608 GALLIUM_DRIVERS+= SWRAST
1611 MESON_ARGS+= -Dshader-cache=false