1
0
Fork 0

android: add apex makefile for vulkan

* Based on cuttlefish implementation [1].
* Unfortunately EGL drivers can't be packaged into APEX as the loader [2]
  doesn't support it unlike the vulkan loader [3] that does.

[1]: https://android.googlesource.com/device/google/cuttlefish/+/refs/tags/android-16.0.0_r1/guest/hals/vulkan/
[2]: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-16.0.0_r1/opengl/libs/EGL/Loader.cpp
[3]: https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-16.0.0_r1/vulkan/libvulkan/driver.cpp
This commit is contained in:
dvab-sarma 2025-11-28 20:16:36 -06:00
parent 7ee499de35
commit 30bbf52f82
6 changed files with 57 additions and 2 deletions

View file

@ -1795,8 +1795,7 @@ cc_library_shared {
}
cc_library_shared {
name: "vulkan_panfrost",
stem: "vulkan.panfrost",
name: "vulkan.panfrost",
srcs: [
"src/panfrost/vulkan/panvk_android.c",
"src/panfrost/vulkan/panvk_buffer.c",
@ -1922,6 +1921,7 @@ cc_library_shared {
"meson_generated/src/vulkan/util",
"meson_generated/src/vulkan/wsi",
],
soc_specific: true,
relative_install_path: "hw",
afdo: true,
defaults: ["mesa3d-desktop-panvk-defaults"],

36
apex/Android.bp Normal file
View file

@ -0,0 +1,36 @@
//
// Copyright (C) 2025 Venkata Atchuta Bheemeswara Sarma Darbha
// Copyright (C) 2025 KonstaKANG
//
// SPDX-License-Identifier: Apache-2.0
//
linker_config {
name: "android.hardware.vulkan.panfrost-linker-config",
src: "apex_linkerconfig.json",
installable: false,
}
prebuilt_etc {
name: "android.hardware.vulkan.panfrost.rc",
src: "android.hardware.vulkan.panfrost.rc",
installable: false,
}
apex {
name: "com.android.hardware.vulkan.panfrost",
manifest: "apex_manifest.json",
file_contexts: "apex_file_contexts",
key: "com.android.hardware.key",
certificate: ":com.android.hardware.certificate",
updatable: false,
vendor: true,
prebuilts: [
"android.hardware.vulkan.panfrost-linker-config",
"android.hardware.vulkan.panfrost.rc",
],
native_shared_libs: [
"vulkan.panfrost",
],
}

View file

@ -0,0 +1,6 @@
# `on init` is normally not available for .rc files in vendor apexes
# But the vulkan apex is okay because it's bootstrap APEX.
# For bootstrap APEXes, `on init` is the earliest available trigger.
on init
setprop ro.hardware.vulkan panfrost
setprop ro.vulkan.apex com.android.hardware.vulkan.panfrost

4
apex/apex_file_contexts Normal file
View file

@ -0,0 +1,4 @@
(/.*)? u:object_r:vendor_file:s0
/etc(/.*)? u:object_r:vendor_configs_file:s0
/etc/linker.config.pb u:object_r:linkerconfig_file:s0
/lib64(/.*)? u:object_r:same_process_hal_file:s0

View file

@ -0,0 +1,4 @@
{
// visible so that vulkan loader can see
"visible": true
}

5
apex/apex_manifest.json Normal file
View file

@ -0,0 +1,5 @@
{
"name": "com.android.hardware.vulkan.panfrost",
"version": 1,
"vendorBootstrap": true
}