Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion x11-packages/libva/build.sh → packages/libva/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ TERMUX_PKG_SRCURL="https://github.com/intel/libva/archive/refs/tags/${TERMUX_PKG
TERMUX_PKG_SHA256=0b4a3649ee8d683b9cce2ef094df4fb039d276c0cef7e49337c43d3b297b9f42
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="libc++, libdrm, libx11, libxext, libxfixes, libwayland"
TERMUX_PKG_BUILD_DEPENDS="libglvnd, mesa, mesa-dev"
# Use GLVND directly to avoid a Mesa -> libva -> Mesa build dependency cycle.
TERMUX_PKG_BUILD_DEPENDS="libglvnd, libglvnd-dev, libwayland-cross-scanner"
termux_step_pre_configure() {
termux_setup_wayland_cross_pkg_config_wrapper

Expand Down
5 changes: 2 additions & 3 deletions packages/mesa/0000-disable-android-detection.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
--- a/src/util/detect_os.h
+++ b/src/util/detect_os.h
+++ ./src/util/detect_os.h
@@ -24,7 +24,7 @@
* Android defines __linux__, so DETECT_OS_LINUX and DETECT_OS_POSIX will
* also be defined.
Expand All @@ -8,7 +7,7 @@
+#if 0
#define DETECT_OS_ANDROID 1
#endif

--- a/include/vulkan/vk_android_native_buffer.h
+++ b/include/vulkan/vk_android_native_buffer.h
@@ -17,7 +17,7 @@
Expand Down
6 changes: 3 additions & 3 deletions packages/mesa/0001-disable-multithreading-for-llvmpipe.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ overhead when enabled.

--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -1089,6 +1089,9 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
@@ -1092,6 +1092,9 @@
screen->num_threads = debug_get_num_option("LP_NUM_THREADS",
screen->num_threads);
screen->num_threads = MIN2(screen->num_threads, LP_MAX_THREADS);
+#if defined __ANDROID__
+ screen->num_threads = 0;
+#endif

for (unsigned i = 0; i < MESA_SHADER_MESH_STAGES; i++)
screen->base.nir_options[i] = &gallivm_nir_options;
lp_build_init(); /* get lp_native_vector_width initialised */

4 changes: 2 additions & 2 deletions packages/mesa/0002-fix-for-getprogname.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/src/util/u_process.c
+++ b/src/util/u_process.c
@@ -101,7 +101,7 @@ __getProgramName()
@@ -103,7 +103,7 @@
{
return strdup(program_invocation_short_name);
}
Expand All @@ -9,7 +9,7 @@
#if defined(__NetBSD__)
# include <sys/param.h>
#endif
@@ -168,7 +168,7 @@ __getProgramName()
@@ -170,7 +170,7 @@
#endif

#if defined(GET_PROGRAM_NAME_NOT_AVAILABLE)
Expand Down
9 changes: 4 additions & 5 deletions packages/mesa/0004-do-not-check-xlocale.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
--- a/meson.build
+++ b/meson.build
@@ -1673,9 +1673,8 @@ if not ['linux'].contains(host_machine.system())
@@ -1694,9 +1694,9 @@ if not ['linux'].contains(host_machine.system())
endif
endif

-foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'sys/shm.h',
- 'cet.h', 'pthread_np.h', 'poll.h', 'sys/inotify.h',
- 'linux/udmabuf.h']
+foreach h : ['linux/futex.h', 'endian.h', 'dlfcn.h', 'sys/shm.h',
+ 'cet.h', 'pthread_np.h', 'poll.h', 'sys/inotify.h']
'cet.h', 'pthread_np.h', 'poll.h', 'sys/inotify.h',
- 'linux/udmabuf.h', 'fenv.h']
+ 'fenv.h']
if cc.check_header(h)
pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
endif
4 changes: 2 additions & 2 deletions packages/mesa/0005-virgl-socket-path.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
-#define VTEST_DEFAULT_SOCKET_NAME "/tmp/.virgl_test"
+#define VTEST_DEFAULT_SOCKET_NAME "@TERMUX_PREFIX@/tmp/.virgl_test"

#define VTEST_PROTOCOL_VERSION 4

#ifdef VIRGL_RENDERER_UNSTABLE_APIS
#define VTEST_PROTOCOL_VERSION 3
23 changes: 11 additions & 12 deletions packages/mesa/0006-wsi-no-pthread_cancel.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
--- a/src/vulkan/wsi/wsi_common_display.c
+++ b/src/vulkan/wsi/wsi_common_display.c
@@ -548,6 +548,12 @@ static uint64_t fence_sequence;
static void
_wsi_display_cleanup_state(struct wsi_display_swapchain *chain);
+++ ./src/vulkan/wsi/wsi_common_display.c
@@ -176,6 +176,12 @@

static uint64_t fence_sequence;

+#ifdef __ANDROID__
+static void thread_signal_handler (int signum) {
Expand All @@ -13,7 +12,7 @@
ICD_DEFINE_NONDISP_HANDLE_CASTS(wsi_display_mode, VkDisplayModeKHR)
ICD_DEFINE_NONDISP_HANDLE_CASTS(wsi_display_connector, VkDisplayKHR)

@@ -2127,7 +2133,9 @@ wsi_display_wait_thread(void *data)
@@ -1341,7 +1347,9 @@
.events = POLLIN
};

Expand All @@ -23,7 +22,7 @@
for (;;) {
int ret = poll(&pollfd, 1, -1);
if (ret > 0) {
@@ -2155,9 +2163,22 @@ wsi_display_start_wait_thread(struct wsi_display *wsi)
@@ -1369,9 +1377,22 @@
static void
wsi_display_stop_wait_thread(struct wsi_display *wsi)
{
Expand All @@ -46,7 +45,7 @@
pthread_join(wsi->wait_thread, NULL);
wsi->wait_thread = 0;
}
@@ -3634,7 +3655,9 @@ udev_event_listener_thread(void *data)
@@ -2215,7 +2236,9 @@

int udev_fd = udev_monitor_get_fd(mon);

Expand All @@ -56,7 +55,7 @@

for (;;) {
nfds_t nfds = 1;
@@ -3792,6 +3815,15 @@ wsi_display_finish_wsi(struct wsi_device *wsi_device,
@@ -2340,6 +2363,15 @@
struct wsi_display *wsi =
(struct wsi_display *) wsi_device->wsi[VK_ICD_WSI_PLATFORM_DISPLAY];

Expand All @@ -70,9 +69,9 @@
+#endif
+
if (wsi) {
wsi_for_each_connector(connector, wsi)
wsi_display_free_connector(wsi, connector);
@@ -3799,7 +3831,11 @@ wsi_display_finish_wsi(struct wsi_device *wsi_device,
wsi_for_each_connector(connector, wsi) {
wsi_for_each_display_mode(mode, connector) {
@@ -2351,7 +2383,11 @@
wsi_display_stop_wait_thread(wsi);

if (wsi->hotplug_thread) {
Expand Down
10 changes: 5 additions & 5 deletions packages/mesa/0007-use-mtx_t-operations-in-turnip.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- a/src/freedreno/vulkan/tu_shader.cc
+++ b/src/freedreno/vulkan/tu_shader.cc
@@ -3244,10 +3244,10 @@ tu_upload_shader(struct tu_device *dev,
size += vpc_size;
@@ -2694,10 +2694,10 @@ tu_upload_shader(struct tu_device *dev,
size += vpc_size;
}

- pthread_mutex_lock(&dev->pipeline_mutex);
Expand All @@ -13,7 +13,7 @@

if (result != VK_SUCCESS)
return result;
@@ -3283,9 +3283,9 @@ tu_upload_shader(struct tu_device *dev,
@@ -2727,9 +2727,9 @@ tu_upload_shader(struct tu_device *dev,

result = tu_setup_pvtmem(dev, shader, &pvtmem_config, pvtmem_size, per_wave);
if (result != VK_SUCCESS) {
Expand All @@ -25,7 +25,7 @@
return result;
}

@@ -4140,10 +4140,10 @@ tu_empty_shader_create(struct tu_device *dev,
@@ -3531,10 +3531,10 @@ tu_empty_shader_create(struct tu_device *dev,
if (!shader)
return VK_ERROR_OUT_OF_HOST_MEMORY;

Expand All @@ -38,7 +38,7 @@

if (result != VK_SUCCESS) {
vk_free(&dev->vk.alloc, shader);
@@ -4254,9 +4254,9 @@ tu_shader_destroy(struct tu_device *dev,
@@ -3645,9 +3645,9 @@ tu_shader_destroy(struct tu_device *dev,
tu_cs_finish(&shader->cs);
TU_RMV(resource_destroy, dev, &shader->bo);

Expand Down
20 changes: 10 additions & 10 deletions packages/mesa/0008-workaround-fortify-check.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ https://github.com/termux/termux-packages/issues/18823
# define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
--- a/src/c11/impl/threads_posix.c
+++ b/src/c11/impl/threads_posix.c
@@ -97,7 +97,11 @@ cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *abs_time)
@@ -120,7 +120,11 @@
assert(cond != NULL);
assert(abs_time != NULL);

Expand All @@ -32,7 +32,7 @@ https://github.com/termux/termux-packages/issues/18823
if (rt == ETIMEDOUT)
return thrd_timedout;
return (rt == 0) ? thrd_success : thrd_error;
@@ -109,7 +113,11 @@ cnd_wait(cnd_t *cond, mtx_t *mtx)
@@ -132,7 +136,11 @@
{
assert(mtx != NULL);
assert(cond != NULL);
Expand All @@ -44,7 +44,7 @@ https://github.com/termux/termux-packages/issues/18823
}


@@ -119,7 +127,12 @@ void
@@ -142,7 +150,12 @@
mtx_destroy(mtx_t *mtx)
{
assert(mtx != NULL);
Expand All @@ -57,7 +57,7 @@ https://github.com/termux/termux-packages/issues/18823
}

/*
@@ -160,13 +173,22 @@ mtx_init(mtx_t *mtx, int type)
@@ -183,13 +196,22 @@
return thrd_error;

if ((type & mtx_recursive) == 0) {
Expand All @@ -80,7 +80,7 @@ https://github.com/termux/termux-packages/issues/18823
pthread_mutexattr_destroy(&attr);
return thrd_success;
}
@@ -176,7 +198,11 @@ int
@@ -199,7 +221,11 @@
mtx_lock(mtx_t *mtx)
{
assert(mtx != NULL);
Expand All @@ -92,7 +92,7 @@ https://github.com/termux/termux-packages/issues/18823
}

static int
@@ -204,7 +230,11 @@ mtx_timedlock(mtx_t *mtx, const struct timespec *ts)
@@ -227,7 +253,11 @@
{
#ifdef EMULATED_THREADS_USE_NATIVE_TIMEDLOCK
int rt;
Expand All @@ -104,7 +104,7 @@ https://github.com/termux/termux-packages/issues/18823
if (rt == 0)
return thrd_success;
return (rt == ETIMEDOUT) ? thrd_timedout : thrd_error;
@@ -229,7 +259,11 @@ int
@@ -252,7 +282,11 @@
mtx_trylock(mtx_t *mtx)
{
assert(mtx != NULL);
Expand All @@ -116,7 +116,7 @@ https://github.com/termux/termux-packages/issues/18823
}

// 7.25.4.6
@@ -237,7 +271,11 @@ int
@@ -260,7 +294,11 @@
mtx_unlock(mtx_t *mtx)
{
assert(mtx != NULL);
Expand All @@ -130,7 +130,7 @@ https://github.com/termux/termux-packages/issues/18823

--- a/src/util/cnd_monotonic.c
+++ b/src/util/cnd_monotonic.c
@@ -132,7 +132,11 @@ u_cnd_monotonic_timedwait(struct u_cnd_monotonic *cond, mtx_t *mtx,
@@ -132,7 +132,11 @@
timespec_sub_saturate(&rel_time, abs_time, &now_time);
int rt = pthread_cond_timedwait_relative_np(&cond->cond, mtx, &rel_time);
#else
Expand All @@ -142,7 +142,7 @@ https://github.com/termux/termux-packages/issues/18823
#endif
if (rt == ETIMEDOUT)
return thrd_timedout;
@@ -151,6 +155,10 @@ u_cnd_monotonic_wait(struct u_cnd_monotonic *cond, mtx_t *mtx)
@@ -151,6 +155,10 @@
(PCRITICAL_SECTION)mtx, INFINITE);
return thrd_success;
#else
Expand Down
2 changes: 1 addition & 1 deletion packages/mesa/0011-lld-undefined-version.diff
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ as emulated TLS is enabled by NDK when `__ANDROID_API__` <= 28.

--- a/src/gallium/targets/dri/dri.sym.in
+++ b/src/gallium/targets/dri/dri.sym.in
@@ -6,8 +6,8 @@
@@ -8,8 +8,8 @@
_mesa_glapi_get_proc_offset;
_mesa_glapi_set_context;
_mesa_glapi_set_dispatch;
Expand Down
4 changes: 2 additions & 2 deletions packages/mesa/0012-always-use-software-for-swrast.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Fix assertion error when running `eglinfo -B`.

--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -1092,7 +1092,11 @@ platform_x11_finalize(_EGLDisplay *disp, bool force_zink)
@@ -1163,7 +1163,11 @@ platform_x11_finalize(_EGLDisplay *disp, bool force_zink)
if (!dri2_create_screen(disp))
return false;

Expand All @@ -16,7 +16,7 @@ Fix assertion error when running `eglinfo -B`.
}
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -3303,7 +3303,11 @@ dri2_initialize_wayland_swrast(_EGLDisplay *disp)
@@ -3079,7 +3079,11 @@
if (!dri2_create_screen(disp))
goto cleanup;

Expand Down
59 changes: 0 additions & 59 deletions packages/mesa/0013-detect-sve-sve2-support.patch

This file was deleted.

Loading