src/common/android_util.h


Log

Author Commit Date CI Message
Geoff Lang 74b7ec03 2023-09-08T14:26:18 GL: Don't use system info for Android SDK queries. It can be queried directly from the system property without fully gathering system info. System info often uses Vulkan which is known to be unstable on some older devices. Bug: chromium:1479277 Change-Id: Ic6ee1d0182b047b0a3210dd1067f6b7250e3da02 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4851775 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jason Macnak 2256c548 2022-12-15T20:44:38 Map AHARDWAREBUFFER_FORMAT_R8_UNORM to GL_R8 Bug: b/259551816 Test: cvd start --gpu_mode=guest_swiftshader Test: atest librenderengine_test Change-Id: I32a7b83494426e291cc93fe2b5f245eab6a54b0a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4112149 Commit-Queue: Jason Macnak <natsu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Jason Macnak 6fdac95a 2022-12-15T20:36:01 Mirror Android AHB formats in ANGLE owned enum The existing code seems to try to keep all AHB formats defined in android_util.cpp (potentially in an attempt to simplify format conversions?). However, trying to avoid redefinition errors when conditionally re-defining the AHB formats across builds/branches is difficult. IIUC, there are two levels at play when building for Android: 1) "target level": the level of the phone/device you are building for. 2) "build level": the level of the repository/checkout you are building from. The "target level" (__ANDROID_API__) cannot be used to guard the definitions in android_util.cpp because it is possible to build for an older device in a newer branch. For example, suppose AHARDWAREBUFFER_FORMAT_X was introduced in Android T. If ANGLE tried to redefine AHARDWAREBUFFER_FORMAT_X in android_util.cpp with the guard "if __ANDROID_API__ < T", re-definition errors would still occur when building for Android S devices ( __ANDROID_API__ set to S) from inside of an Android T branch because the format would still be defined in android/hardware_buffer.h. A failure of this type can be seen in aosp/2308065 which tried to guard AHARDWAREBUFFER_FORMAT_R8_UNORM with "if __ANDROID_API__ < 33". Additionally, Android sets __ANDROID_API__ to 10000 before releases are cut and it is supposed to be fixed at release time. However, this has been observed to not be fixed on some less maintained side branches. Detecting the "build level" seems to be quite difficult. When building from outside of Android, this is the NDK level which can be detected using __ANDROID_NDK__ and __NDK_MAJOR__. When building from inside of Android, this is the latest level available on your specific branch. I believe this can only be found by incrementally checking for the existence of the various __ANDROID_API_R__, __ANDROID_API_S__, etc defines. This alternative can be seen in https://crrev.com/c/4039066. However, this is very difficult to find and read. Instead, let's just define ANGLE's own enum which mirrors the Android enums which can be used without having to worry about the current build system or release/branch. Bug: b/259551816 Test: cvd start --gpu_mode=guest_swiftshader Test: atest librenderengine_test Test: ANGLE presubmit Test: Android presubmit on aosp/master (aosp/2360445) Test: Android presubmit on aosp/android13-gsi (aosp/2360447) Test: Android presubmit on aosp/android11-gsi (aosp/2360520) Change-Id: I62f12cb0e1cc4b3b24aab7b85f39360a2cd2e438 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4112148 Commit-Queue: Jason Macnak <natsu@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi f62405c5 2022-10-31T18:47:52 Add utilities to get the Android backtrace * Added getBacktraceInfo(), which returns the backtrace information from the ANGLE code, including the addresses and the symbols if possible * Returns the data in an instance of the new class BacktraceInfo. * In order to access this function, backtrace_utils.h has been included in vk_utils.h * New GN flag to make use of this feature: * angle_enable_unwind_backtrace_support * Current only available on Android (debug mode) * If the flag is disabled, getBacktraceInfo() returns an empty object. * Added functions in util/ (per platform) to print the BacktraceInfo data. * Example of usage: angle::printBacktraceInfo(angle::getBacktraceInfo()); * Minor edit: Moved cstdint from android_util.cpp to its header. Bug: b/258475923 Change-Id: I6115462a1a2845d40c7cafc14ce52df09ecdcf34 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3995843 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Jeff Vigil 6136620b 2021-03-25T15:43:06 Reland "EGL: GLES: Implement GL_EXT_protected_textures" This is a reland of 6210a9b34a721df2c84cf69170ad9bf7ba40e4aa This removes changes in gl backend. Original change's description: > EGL: GLES: Implement GL_EXT_protected_textures > > Implement EGL_EXT_protected_content Images > Add protected member to Images and Textures > Add error when creating objects if not supported or > does't match native buffer > When creating siblings pass protected state > Add extension caps > Add Validation > Add GetTexParameter and SetTextparameter > Add protected to Texture and state > Expand tests for images and textures > > Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest > > Bug: angleproject:3965 > Change-Id: I35a89b4e80bba6d9b6831c68e71630eef304dacb > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802852 > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: Id36d697c53afc0f0dadf92bda4565f9157f4fc2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076825 Commit-Queue: Brandon Schade <b.schade@samsung.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c408926f 2021-07-22T12:00:59 Revert "EGL: GLES: Implement GL_EXT_protected_textures" This reverts commit 6210a9b34a721df2c84cf69170ad9bf7ba40e4aa. Reason for revert: Suspected for breaking ANGLE->Chrome roller. Bug: angleproject:6204 Original change's description: > EGL: GLES: Implement GL_EXT_protected_textures > > Implement EGL_EXT_protected_content Images > Add protected member to Images and Textures > Add error when creating objects if not supported or > does't match native buffer > When creating siblings pass protected state > Add extension caps > Add Validation > Add GetTexParameter and SetTextparameter > Add protected to Texture and state > Expand tests for images and textures > > Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest > > Bug: angleproject:3965 > Change-Id: I35a89b4e80bba6d9b6831c68e71630eef304dacb > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802852 > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:3965 Change-Id: Ia3ef260a17097b474189ccad5b235a9db99ee00b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3043889 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Jeff Vigil 6210a9b3 2021-03-25T15:43:06 EGL: GLES: Implement GL_EXT_protected_textures Implement EGL_EXT_protected_content Images Add protected member to Images and Textures Add error when creating objects if not supported or does't match native buffer When creating siblings pass protected state Add extension caps Add Validation Add GetTexParameter and SetTextparameter Add protected to Texture and state Expand tests for images and textures Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: I35a89b4e80bba6d9b6831c68e71630eef304dacb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802852 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya f197ebac 2020-11-16T15:16:56 Vulkan: Add EXT_external_buffer support Addition of buffer support for external memory Also adds new end2end tests for these usecases * SubData update * map/unmap buffer * dispatch compute with external buffer Bug: angleproject:5073 Test: ExternalBufferTestES31.*Vulkan Change-Id: Ib3cccaca77b76830effe49d3731782552e7424ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2525105 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 5b419533 2020-11-03T13:33:44 GL: Implement EXT_YUV_target Add test coverage of YUV format sampling as RGB or directly as YUV and rendering as YUV using layout(yuv). Initializing YUV AHardwareBuffers requires Android API 29 so ANGLE must be compiled with: android32_ndk_api_level = 29 android64_ndk_api_level = 29 The following tests can still run with Android API 26 because they don't need to initialize the buffer: ImageTestES3.ClearYUVAHB ImageTestES3.YUVValidation Bug: angleproject:4852 Bug: b/172649538 Change-Id: I4fe9afb2a68fb827dc5a5732b213b5eb60d585ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2517562 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya c99c22bb 2020-09-15T16:53:26 EGL: Add support for EGL_ANDROID_create_native_client_buffer This EGL extension will add support for creating EGLClientBuffer backed by an Android window buffer (struct ANativeWindowBuffer) which can be later used to create an EGLImage. Bug: angleproject:5018 Tests: angle_end2end_tests --gtest_filter=ImageTest.SourceNativeClientBufferTarget* Change-Id: If78ed7b80ad09629b8c5f5b5a0eb07a548e82e6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2404320 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Mohan Maiya a3cf06ac 2020-03-12T13:15:48 EGL: populate EGL_NATIVE_VISUAL_ID values for Android When generating the default EGL configs, populate EGL_NATIVE_VISUAL_ID with AHARDWAREBUFFER formats. Bug: angleproject:4469 Change-Id: Ifde9df0497cbd4e01219ab6067acd8d97f8460e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2101577 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Geoff Lang 3fd0b2db 2018-09-20T15:59:54 Implement EGL_ANDROID_get_native_client_buffer. BUG=angleproject:2508 Change-Id: I21e6251cd1341c1f85f1ba16ba08f5876a8ff8de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1238885 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 009696c5 2019-01-31T14:47:07 Vulkan: Support EGL_ANDROID_image_native_buffer on Android. BUG=angleproject:2668 BUG=angleproject:3121 Change-Id: I0dfb2ec0737ebd963b0fadb78cf720a90874f00b Reviewed-on: https://chromium-review.googlesource.com/c/1452264 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>