Skip to content

Commit

Permalink
mesa: experimentally added the ability to change the path to pdev
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxython committed Feb 4, 2024
1 parent 3ca2e1c commit 1b964f5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
1 change: 0 additions & 1 deletion gpkg/mesa/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-D shared-glapi=enabled
-D valgrind=disabled
-D vulkan-layers=device-select,overlay
-D tools=drm-shim,lima,panfrost
"

termux_step_pre_configure() {
Expand Down
27 changes: 27 additions & 0 deletions gpkg/mesa/dynamic-pdev.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- src/src/freedreno/decode/replay.c 2024-02-01 04:00:16.000000000 +0300
+++ src/src/freedreno/decode/replay.c.patch 2024-02-04 19:57:14.079269850 +0300
@@ -617,7 +617,9 @@
{
struct device *dev = calloc(sizeof(struct device), 1);

- static const char path[] = "/dev/kgsl-3d0";
+ const char *path = getenv("MESA_TERMUX_PATH_PDEV");
+ if (! path)
+ path = "/dev/kgsl-3d0";

dev->fd = open(path, O_RDWR | O_CLOEXEC);
if (dev->fd < 0) {
--- src/src/freedreno/vulkan/tu_knl.cc 2024-02-01 04:00:16.000000000 +0300
+++ src/src/freedreno/vulkan/tu_knl.cc.patch 2024-02-04 19:59:39.429269795 +0300
@@ -135,7 +135,10 @@
struct tu_instance *instance =
container_of(vk_instance, struct tu_instance, vk);

- static const char path[] = "/dev/kgsl-3d0";
+ const char *path = getenv("MESA_TERMUX_PATH_PDEV");
+ if (! path)
+ path = "/dev/kgsl-3d0";
+
int fd;

fd = open(path, O_RDWR | O_CLOEXEC);

0 comments on commit 1b964f5

Please sign in to comment.