Skip to content

Commit d5550cc

Browse files
committed
enhance(main/mesa): Lucas Fryzek and xMeM's freedreno kgsl for mesa 26.2.0-devel
- Based on Robert Kirkman's PR (termux#24840), rebased to `mesa` 26.2.0-devel. The reason it is opened as a draft PR is to make it easier for people in need to download, and there is no need to merge. - For convenience and some potentially needed latest features, I directly specified the source code as [a branch](https://github.com/lfdevs/mesa-for-android-container/tree/dev/adreno-main) of my repository. This branch has already applied patches such as `0013-detect-sve-sve2-support.patch`, `0016-unofficial_support_adreno_710_720_722.patch`, `0017-preserve-egl-support-in-zink.patch`, `0018-disable-general-layout-in-zink-for-turnip.patch`, etc., so the already applied patches are not repeatedly used here. - The original inventor of this code is Lucas Fryzek. The Termux:X11 port of this code was created by xMeM. - Requires specifying the environment variable `MESA_LOADER_DRIVER_OVERRIDE=kgsl` when used.
1 parent a4385d4 commit d5550cc

10 files changed

Lines changed: 26 additions & 505 deletions

packages/mesa/0003-fix-for-anon-file.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ Fallback to `@TERMUX_PREFIX@/tmp` if env `XDG_RUNTIME_DIR` is not set.
22

33
--- a/src/util/anon_file.c
44
+++ b/src/util/anon_file.c
5-
@@ -122,7 +122,7 @@ get_or_create_user_temp_dir(char* buf, size_t len) {
5+
@@ -125,7 +125,7 @@ get_or_create_user_temp_dir(void) {
66
return buf;
77
}
88

9-
- snprintf(buf, len, "/tmp/xdg-runtime-mesa-%ld", (long)getuid());
10-
+ snprintf(buf, len, "@TERMUX_PREFIX@/tmp/xdg-runtime-mesa-%ld", (long)getuid());
9+
- n = asprintf(&buf, "/tmp/xdg-runtime-mesa-%ld", (long)getuid());
10+
+ n = asprintf(&buf, "@TERMUX_PREFIX@/tmp/xdg-runtime-mesa-%ld", (long)getuid());
11+
if (n < 0)
12+
return NULL;
1113
mesa_logd("%s: XDG_RUNTIME_DIR not set; falling back to temp dir %s",
12-
__func__, buf);
13-
if (stat(buf, &st) == 0) {
Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/src/freedreno/vulkan/tu_shader.cc
22
+++ b/src/freedreno/vulkan/tu_shader.cc
3-
@@ -1980,10 +1980,10 @@
3+
@@ -2694,10 +2694,10 @@ tu_upload_shader(struct tu_device *dev,
44
size += vpc_size;
55
}
66

@@ -13,7 +13,7 @@
1313

1414
if (result != VK_SUCCESS)
1515
return result;
16-
@@ -2013,9 +2013,9 @@
16+
@@ -2727,9 +2727,9 @@ tu_upload_shader(struct tu_device *dev,
1717

1818
result = tu_setup_pvtmem(dev, shader, &pvtmem_config, pvtmem_size, per_wave);
1919
if (result != VK_SUCCESS) {
@@ -25,7 +25,7 @@
2525
return result;
2626
}
2727

28-
@@ -2419,10 +2419,10 @@
28+
@@ -3531,10 +3531,10 @@ tu_empty_shader_create(struct tu_device *dev,
2929
if (!shader)
3030
return VK_ERROR_OUT_OF_HOST_MEMORY;
3131

@@ -38,9 +38,9 @@
3838

3939
if (result != VK_SUCCESS) {
4040
vk_free(&dev->vk.alloc, shader);
41-
@@ -2528,9 +2528,9 @@
42-
{
41+
@@ -3645,9 +3645,9 @@ tu_shader_destroy(struct tu_device *dev,
4342
tu_cs_finish(&shader->cs);
43+
TU_RMV(resource_destroy, dev, &shader->bo);
4444

4545
- pthread_mutex_lock(&dev->pipeline_mutex);
4646
+ mtx_lock(&dev->pipeline_mutex);
@@ -50,20 +50,3 @@
5050

5151
if (shader->pvtmem_bo)
5252
tu_bo_finish(dev, shader->pvtmem_bo);
53-
--- a/src/vulkan/wsi/wsi_common_wayland.c
54-
+++ b/src/vulkan/wsi/wsi_common_wayland.c
55-
@@ -2648,12 +2648,12 @@ wsi_wl_swapchain_wait_for_present2(struct wsi_swapchain *wsi_chain,
56-
return result;
57-
58-
while (1) {
59-
- err = pthread_mutex_lock(&chain->present_ids.lock);
60-
+ err = mtx_lock(&chain->present_ids.lock);
61-
if (err != 0)
62-
return VK_ERROR_OUT_OF_DATE_KHR;
63-
64-
bool completed = chain->present_ids.max_completed >= present_id;
65-
- pthread_mutex_unlock(&chain->present_ids.lock);
66-
+ mtx_unlock(&chain->present_ids.lock);
67-
68-
if (completed)
69-
return VK_SUCCESS;

packages/mesa/0013-detect-sve-sve2-support.patch

Lines changed: 0 additions & 59 deletions
This file was deleted.

packages/mesa/0016-unofficial_support_adreno_710_720_722.patch

Lines changed: 0 additions & 74 deletions
This file was deleted.

packages/mesa/0017-preserve-egl-support-in-zink.patch

Lines changed: 0 additions & 40 deletions
This file was deleted.

packages/mesa/0018-disable-general-layout-in-zink-for-turnip.patch

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/mesa/0019-UBWC_5-and-UBWC_6-support.patch

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/mesa/0020-unofficial-support-adreno-830.patch

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)