Skip to content

Commit

Permalink
Add 'mesa-virgl', VirGL on Upstream Mesa is Broken, Then use a old co…
Browse files Browse the repository at this point in the history
…mmit until fix
  • Loading branch information
KreitinnSoftware committed Aug 19, 2024
1 parent ddd05ae commit 47182df
Show file tree
Hide file tree
Showing 31 changed files with 76 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/56-mesa/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
GIT_URL=https://gitlab.freedesktop.org/mesa/mesa
LDFLAGS="-L$PREFIX/lib -landroid-shmem"

getVulkanDrivers() {
if [ "$ARCHITECTURE" == "aarch64" ]; then
Expand All @@ -9,4 +8,4 @@ getVulkanDrivers() {
fi
}

MESON_ARGS="--cross-file=../../../meson-cross-file-$ARCHITECTURE -Dgallium-drivers=zink,virgl $(getVulkanDrivers) -Dglvnd=enabled -Dglx=dri -Ddri3=enabled -Dplatforms=x11 -Dxmlconfig=disabled -Dllvm=disabled -Dopengl=true -Degl=enabled -Dzstd=enabled"
MESON_ARGS="--cross-file=../../../meson-cross-file-$ARCHITECTURE -Dgallium-drivers=zink $(getVulkanDrivers) -Dglvnd=enabled -Dglx=dri -Ddri3=enabled -Dplatforms=x11 -Dxmlconfig=disabled -Dllvm=disabled -Dopengl=true -Degl=enabled -Dzstd=enabled"
5 changes: 5 additions & 0 deletions packages/57-mesa-virgl/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GIT_URL=https://gitlab.freedesktop.org/mesa/mesa
GIT_COMMIT=0a3784ae33bbdcd50b2a6d8de5d52779276bb36c
LDFLAGS="-L$PREFIX/lib -landroid-shmem"
OVERRIDE_PREFIX=$PREFIX/mesa-virgl
MESON_ARGS="--cross-file=../../../meson-cross-file-$ARCHITECTURE -Dgallium-drivers=virgl -Dvulkan-drivers= -Dglvnd=enabled -Dglx=dri -Ddri3=enabled -Dplatforms=x11 -Dxmlconfig=disabled -Dllvm=disabled -Dopengl=true -Degl=enabled -Dzstd=enabled"
25 changes: 25 additions & 0 deletions packages/57-mesa-virgl/disable-memfd-create-getrandom.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/meson.build b/meson.build
index ae0daeeebeb..c977c6240df 100644
--- a/meson.build
+++ b/meson.build
@@ -1393,7 +1393,7 @@ if not ['linux'].contains(host_machine.system())
endif
endif

-foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'sys/shm.h',
+foreach h : ['linux/futex.h', 'endian.h', 'dlfcn.h', 'sys/shm.h',
'cet.h', 'pthread_np.h', 'sys/inotify.h', 'linux/udmabuf.h']
if cc.check_header(h)
pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
@@ -1403,11 +1403,9 @@ endforeach
functions_to_detect = {
'strtof': '',
'mkostemp': '',
- 'memfd_create': '',
'random_r': '',
'flock': '',
'strtok_r': '',
- 'getrandom': '',
'qsort_s': '',
'posix_fallocate': '',
'secure_getenv': '',
24 changes: 24 additions & 0 deletions packages/57-mesa-virgl/force-linux-like-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/include/vulkan/vk_android_native_buffer.h b/include/vulkan/vk_android_native_buffer.h
index 80e5d26c8ee..cf17acd99db 100644
--- a/include/vulkan/vk_android_native_buffer.h
+++ b/include/vulkan/vk_android_native_buffer.h
@@ -1,5 +1,5 @@
/* MESA: A hack to avoid #ifdefs in driver code. */
-#ifdef __ANDROID__
+#if 0 //defined(__ANDROID__) || !defined(__MICEWINE__)

#include <cutils/native_handle.h>
#if ANDROID_API_LEVEL < 28
diff --git a/src/util/detect_os.h b/src/util/detect_os.h
index 86286dfbe70..49195b3398c 100644
--- a/src/util/detect_os.h
+++ b/src/util/detect_os.h
@@ -25,7 +25,7 @@
* also be defined.
*/
#if defined(__ANDROID__)
-#define DETECT_OS_ANDROID 1
+#define DETECT_OS_ANDROID 0
#endif

#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
21 changes: 21 additions & 0 deletions packages/57-mesa-virgl/install-drivers-without-hardlinks.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index 60ee4576c60..71e2a07e70c 100644
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -24,7 +24,16 @@

import argparse
import os
+import shutil

+def link(src, dest):
+ shutil.copyfile(src, dest)
+
+def unlink(src):
+ os.remove(src)
+
+os.link = link
+os.unlink = unlink

def main():
parser = argparse.ArgumentParser()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 47182df

Please sign in to comment.