summaryrefslogtreecommitdiff
path: root/opengl
AgeCommit message (Collapse)Author
2024-07-29Update the Khronos EGL header files. Tom Murphy
Update the EGL header files to latest files. This is taken from commit ac494c215e8b4476dba7dc26c69514d314adf71e from the EGL-Registry git repo Bug: 354900782 Test: None Flag: NONE External header file update. Flag N/A Change-Id: Ideb3d418a2a95608e5e812d214ef285f9bbf6c6c
2024-07-01Merge "Fix race condition in extension string creation" into main am: 5959d52278 Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3147277 Change-Id: I51423de6ecbb5df462580b2a17ea74df4ea193cc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-07-01Fix race condition in extension string creation Tom Murphy
Change a17429660467548a1bc5f8d435a327500fbe972b introduced a race condition where the notfiy_all is called before the mExtensionString is set. Set mExtensionString before refCond.notify_all(); is called Bug: 345419965 Bug: 346881664 Test: Ran EGL unit tests Change-Id: Ifcb691f9b9769be494e204c97512c3f7fffec60a
2024-05-29Merge "Build egl_display extension string using temporary vector" into main ↵ Tom Murphy
am: f6b9effe00 am: cbf51bb44f Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3064662 Change-Id: I2ca8b140126bb4e1cf378c2cc9b0bc28bf0ac276 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-29Build egl_display extension string using temporary vector Tom Murphy
Currently it is very easy to forget to add a trailing space when adding to the extension string. This has already caused a major bug fixed by 0bc64a80291111ad9356377e7247acdf77325e75. Build the string using a vector instead similar to libANGLE::Context::initExtensionStrings() does it. This is much less error prone than the current code. Test: Added unit test Test: Ran atest EGL_test Test: Confirmed string output is the same with print Bug: 285606242 Change-Id: I7f837a3009f0ccfedcf44f3d7ff709a269d0034f
2024-05-01Merge "Revert "EGL/ANGLE/Vulkan: respect EGL resolved RGBX format"" into main Solti Ho
2024-05-01Revert "EGL/ANGLE/Vulkan: respect EGL resolved RGBX format" Android Culprit Assistant
This revert was created by Android Culprit Assistant. The culprit was identified in the following culprit search session (http://go/aca-get/96953fd0-49c9-4874-bc2a-cdc3b220bf45). Change-Id: Icb89f5d5b9c59e0d611191871db8d8c40106ee86
2024-04-30Merge "EGL/ANGLE/Vulkan: respect EGL resolved RGBX format" into main Treehugger Robot
2024-04-25Fix a missing case in unloading system driver Yuxin Hu
When app requests to use ANGLE on devices without an ANGLE apk installed, but the device has preloaded native GLES driver, the current should_unload_system_driver() function does not recognize that we should unload the preloaded GLES driver, and load the ANGLE driver from system parition. This CL adds this missed check in should_unload_system_driver() Bug: b/333483712 Test: atest android.angle.cts.CtsAngleDeveloperOptionHostTest Result: https://android-build.corp.google.com/abtd/run/L47700030003349338/ Change-Id: I4460eed9f05ee0e19ddb6e4d2a3375701414c458
2024-04-20EGL/ANGLE/Vulkan: respect EGL resolved RGBX format Yiwei Zhang
Platform EGL is able to resolve rgb8 config to rgbx hal format but it currently skips setting the resolved format to the surface if ANGLE is detected in use. Meanwhile, Vulkan surface and swapchain lacks info to properly resolve RGBA8 vk format to rgbx hal format like platform EGL. So we'd wire through such info from the EGL side to the surface so that EGL->ANGLE->Vulkan can end up picking up the same format. Summary: 1. allow EGL to resolve and set surface format even with angle 2. vk surface to query default format for OPAQUE advertisement 3. angle already picks up OPAQUE only without sized alpha 4. (optional) besides format, also allows to set resolved dataspace Bug: b/335925862, b/328125698 Test: encoder cts is passing, and no regression to ImageReader use cases Change-Id: I4e977a278fc0659b6c5e91cad7b5755c9da3a28c
2024-03-08Clean up ANGLE on system assumption. Peiyong Lin
Now that ANGLE on system is in fully released, clean up the assumptions in the code. Bug: b/293503000 Test: atest CtsAngleIntegrationHostTestCases Change-Id: Ifef3c45dc915c30900cd0f09a23edb382bbe1b11
2024-02-01Merge "Add another pragma to disable another bunch of warnings." into main ↵ Treehugger Robot
am: a3a0f2f3e7 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2927111 Change-Id: Idd437341266d011765ef75959d02655176ba2cba Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-29Merge Android 24Q1 Release (ab/11220357) Xin Li
Bug: 319669529 Merged-In: I264e728c49f0500f2f868c3a25b0910d0d527340 Change-Id: I0de5ae0000a29e4b9735e6c4f381f680eb0723cd
2024-01-24Add another pragma to disable another bunch of warnings. Elliott Hughes
I suspect someone intended there to be an AIOOBE check in here, but I can't understand the code well enough to be sure of that, let alone well enough to actually implement it. So just add this warning to the list of warnings we're already ignoring. Also update the generator to take into account the stuff that folks have manually added to the generated files... There's still one manual edit necessary because the generator can't cope with the fact that eglDupNativeFenceFDANDROID() has a hand-written Java wrapper, so the generated native method needs to be private and renamed. But at least we're down to one trivial manual edit (adding a line to the methods[] in android_opengl_EGLExt.cpp). Test: treehugger Change-Id: I9f80315612192d65f1e2710a53a9404757ae34bd
2023-12-29Merge "opengl: tests: Add explict android:exported flag to manifests on ↵ Treehugger Robot
GLDual.apk" into android14-tests-dev am: 82a619320e Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2863874 Change-Id: Ifefc60214d8c805f0c5bc406b1e945adf7682d31 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-08opengl: tests: Add explict android:exported flag to manifests on GLDual.apk Joseph Cheng
After Android S+, it's required to add android:exported flag on manifests if an intent filter is defined. We have added this flag on serveral apps by previous change[1]. This is a follow-up change for GLDual.apk. [1]: https://android.googlesource.com/platform/frameworks/native/+/8e8ae4222f9fb0499af755a4255cceb89a79bd78 Test: The GLDual.apk can be installed successfully on Android 14 devices. Bug: 315418422 Change-Id: Iead9ab7b5e6ebe954b6883289aef70cd6d192ad1
2023-11-17Remove EGL_KHR_image_gl_colorspace workaround for Android P Alec Mouri
The ro.vndk.version sysprop is getting removed as part of VNDK deprecation, which will break this workaround. Android P is not really supported anymore, so remvoe the workaround entirely. Bug: 311267616 Test: builds Change-Id: Ieb65da5504083d2db275a68940c1d83940219505
2023-11-15Merge changes I17b91fb6,Ibc671cec into main Cody Northrop
* changes: EGL Multifile Blobcache: Add status file EGL Multifile BlobCache: Limit entry count
2023-11-14EGL Multifile Blobcache: Add status file Cody Northrop
Add a status file that contains the cache version and platform build ID. On future startups, if those values don't match, clear the cache. This alleviates a problem on driver updates, which cause all new queries to miss, creating new entires, filling the cache. For apps with many small entries, the start up time has become a problem. Test: libEGL_test, EGL_test, ANGLE trace tests, apps Bug: b/295051628 Bug: b/310535559 Change-Id: I17b91fb6c994237fb5c2a220db4f23050d45742b
2023-11-13EGL Multifile BlobCache: Limit entry count Cody Northrop
Limit the number of entries to 4096. This is an empirical number based on app behavior. Some using many small entries are taking a long time to load the cache. Test: MultifileBlobCacheTest.CacheMaxEntrySucceeds Bug: b/295051628 Bug: b/310535559 Change-Id: Ibc671cec25dd7c9bc10b9d1ee1fb837180eb7551
2023-11-14Merge "Make gl_headers available to com.android.virt apex" into main Arve Hjønnevåg
2023-11-14Make gl_headers available to com.android.virt apex Arve Hjønnevåg
Needed to make crosvm vendor available Bug: 309149829 Test: build aosp_cf_x86_64_phone_trusty_vm-userdebug Change-Id: I1c50d40411d462a32e6b159f965be6f30317d406
2023-11-09include system ANGLE usage as ANGLE usage Solti
This CL set the system ANGLE usage as GpuStatsInfo::Driver::ANGLE. Previously it was categorized as GpuStatsInfo::Driver::GL. The reason is ANGLE will be shipped as a system driver, not as APK. We want to monitor the adoption of system ANGLE driver. Test: collect the GPU stats before and after the CL. Check the GPU stats reflects ANGLE traffic. See details in http://b/308476674#comment3 Test: run CtsAngleIntegrationHostTestCases on ABTD with the change, See details in http://b/308476674#comment2 Bug: b/308152854, b/308476674, b/308098783 Change-Id: I938b2d112f3da3ced3a1590a08fd70687da855e4 Merged-In: I9beb7c75d65b7aa2b7c5af9f262f30be9d6247d5
2023-11-04Merge "Avoid double initialization of ANGLE platform." into main Treehugger Robot
2023-11-03Avoid double initialization of ANGLE platform. Peiyong Lin
Previously when ANGLE libraries were loaded, the loader already attempted to dlsym the ANGLEGetDisplayPlatform method, but when EGLDisplay is called everytime, it will always call into open the ANGLE library again and attempt to dlsym ANGLEGetDisplayPlatform and ANGLEResetDisplayPlatform, since ANGLE is already opened, the loader should just dlsym once and bookkeep the results. Bug: b/236050939 Test: trace no longer shows duplicate display platform call Change-Id: I8ce2596c3b0968a4a2e9f7651f59d2ad67efbc64
2023-11-03Do not use default namespace to load ANGLE when in vendor partition. Peiyong Lin
Previously the loader was changed to always assume ANGLE is in system partition, but this is not true until the flag is enabled. Bug: b/309001559 Test: avd boot Change-Id: Ia973bd2cc9e3aff3693e28784c61fb8bf61adaf5
2023-11-02nullptr check on suffix. Peiyong Lin
The value of suffix could be nullptr, hence we should perform a nullptr check. Bug: b/309001559 Test: boot Change-Id: Ifd0bf521544d378cb438a8d9c3e0ad2ed5a199db
2023-11-02Merge "Make ANGLE loadable from system image." into main Peiyong Lin
2023-10-23EGL: Close Multifile Blobcache files after mapping Cody Northrop
When loading entries from disk, we don't need to keep the files open after mapping their contents. Per mmap documentation: After the mmap() call has returned, the file descriptor, fd, can be closed immediately without invalidating the mapping. https://man7.org/linux/man-pages/man2/mmap.2.html This will prevent consuming excessive file descriptors, which are a limited resource. Added new test that ensures file descriptors do not remain open. Test: libEGL_test, EGL_test, restricted_trace_perf.py Bug: b/286809755 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5f8117acd45348704629a8aa7bd2169a5ad6a547) Merged-In: I6317fdbce340a8e7cbf3020ad41386cf9915dd2d Change-Id: I6317fdbce340a8e7cbf3020ad41386cf9915dd2d
2023-10-20Make ANGLE loadable from system image. Peiyong Lin
Previously ANGLE was built as part of vendor partition, and hence when it was the default OpenGL ES driver, the loader should use sphal namespace to dlopen it. However, having ANGLE in vendor partition also means Android OS relies on updates of the vendor partition to get ANGLE. While in general ANGLE has an implicit dependency on the Vulkan driver in the vendor partition, we should be able to update it outside of the vendor parition. This patch changes the loading the ANGLE binaries with the assumption that ANGLE binaries is part of the system image. This will give Android OS the benefit to ship and update ANGLE independently from vendor partition and hence shipping ANGLE is no longer blocked by updating the vendor partition. This will also allow Android to have minimal requirements on ANGLE. Bug: b/293503000 Test: atest CtsAngleIntegrationHostTestCases -c Change-Id: If32dd9ff8b023dc975930cb7bce7b003c10618e4
2023-10-20Merge "[Cherry-pick] Make sure the correct ANGLE binary is used." into main Treehugger Robot
2023-10-20[Cherry-pick] Make sure the correct ANGLE binary is used. Peiyong Lin
Previously when eglGetDisplay is called, the code would attempt to initialize ANGLE platform methods and acquire pointers to reset the ANGLE platform. However, without this patch we continue using ro.hardware.egl to form the ANGLE binary name, which is now wrong. Not being able to correctly load the ANGLE binaries means platform methods are not initialize. This currently doesn't have known side effect except that we are observing a bunch of error messages that don't make sense that point to the native OpenGL ES driver loading failure. This patch makes sure ANGLE binary is used when initialize ANGLE platform. Bug: b/293503000 Test: atest CtsAngleIntegrationHostTestCases -c Change-Id: I5189042efc41fa7bef06d20f43ed4da3b1271dab Merged-In: I5189042efc41fa7bef06d20f43ed4da3b1271dab
2023-10-20[Cherry-pick] Clean up EGL Loader. Peiyong Lin
Removes deprecated driver loading path, clean up comments and misc. Bug: b/293503000 Test: boot Change-Id: Ibc62bf59ed7b0cb3671583d2af853c457977d1d1 Merged-In: Ibc62bf59ed7b0cb3671583d2af853c457977d1d1
2023-10-19[Cherry-pick] Revert^3 "Revert "Load native GLES driver when specified."" Peiyong Lin
Reason for revert: Revert to reland the patch. Original patch was reverted due to PcmaPhotoEditingV3 regression, see b/293486861. Original commit message: """ Load native GLES driver when specified. Since ANGLE and native GLES drivers can coexist, when native is specified, the loader must load the native GLES drivers specified in ro.hardware.egl. This patch passes this information down to the native graphics environment so that the EGL loader can properly check. Bug: b/283858001 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default """ Bug: b/283858001 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default Change-Id: Ibcf9d765ce1bd8931859d1c11e849a311adda172 Merged-In: Ibcf9d765ce1bd8931859d1c11e849a311adda172
2023-10-19[Cherry-pick] Revert^2 "Revert "Load native GLES driver when specified."" Peiyong Lin
Revert reason: PcmaPhotoEditingV3 regressed, see b/293486861. Original change id: I6a2e716d340d9be3610c31abbcbe7984bf472f9f Bug: b/283858001 Bug: b/293486861 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default Change-Id: Id08acb6e18db095c632aa8d1a7810ede0c1a1ad2 Merged-In: Id08acb6e18db095c632aa8d1a7810ede0c1a1ad2
2023-10-18[Cherry-pick] Revert "Revert "Load native GLES driver when specified."" Peiyong Lin
This reverts commit 1d6261388df9c5f6866bd4f2b296ad685c79badc. Reason for revert: Revert the revert to reland the patch. Original patch was reverted due to rss memory regression. Attempt to reland the patch with a fix, the original regression seems to be caused by usage of enum. Original commit message: """ Load native GLES driver when specified. Since ANGLE and native GLES drivers can coexist, when native is specified, the loader must load the native GLES drivers specified in ro.hardware.egl. This patch adds the support to load native GLES drivers when specified. Bug: b/283858001 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default """ Bug: b/283858001 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default Change-Id: I6a2e716d340d9be3610c31abbcbe7984bf472f9f Merged-In: I6a2e716d340d9be3610c31abbcbe7984bf472f9f
2023-10-17[Cherry-pick] Revert "Load native GLES driver when specified." Peiyong Lin
This reverts commit 0d60e80ad8162e791305dfb8844a59f1ef9840d3. Reason for revert: culprit of boot memory regression Original commit message: """ Load native GLES driver when specified. Since ANGLE and native GLES drivers can coexist, when native is specified, the loader must load the native GLES drivers specified in ro.hardware.egl. This patch adds the support to load native GLES drivers when specified. Bug: b/283858001 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default """ Bug: b/283858001 Bug: b/289956225 Test: forrest test Change-Id: I785d2d3ff8dd21a1a207ccd814b5dddb080e9b52 Merged-In: I785d2d3ff8dd21a1a207ccd814b5dddb080e9b52
2023-10-17[Cherry-pick] Load native GLES driver when specified. Peiyong Lin
Since ANGLE and native GLES drivers can coexist, when native is specified, the loader must load the native GLES drivers specified in ro.hardware.egl. This patch adds the support to load native GLES drivers when specified. Bug: b/283858001 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default Change-Id: I85840811d9586bd9f2765b47f3cd1a94c9a8580a Merged-In: I85840811d9586bd9f2765b47f3cd1a94c9a8580a
2023-10-17[Cherry-pick] Avoid unloading ANGLE. Peiyong Lin
Previously when ANGLE is the default GLES driver and preloaded, by setting an application to use ANGLE when ANGLE apk doesn't present, the system ANGLE should be used. However, the loader will unload the default driver and load ANGLE. And hence when ANGLE is the default GLES driver, it will be unloaded and then reloaded. This patch makes sure the loader skips unloading and immediately return in this case. Minor: Only unload the drivers when there are preloaded drivers. Bug: b/283858001 Test: verified with camera Test: verified by forcing GLES driver preloading Change-Id: I82b6408405ef7c507e50ab259204bdce95fda110 Merged-In: I82b6408405ef7c507e50ab259204bdce95fda110
2023-10-14Clean up ANGLE integration logic. Peiyong Lin
Rename variables to clarify the meanings, remove unused methods. Bug: b/283858001 Test: test with camera with dialog on Test: atest CtsAngleIntegrationHostTestCases Change-Id: I1db89b79879dec663f198fd3faad7501a3511698 Merged-In: I1db89b79879dec663f198fd3faad7501a3511698
2023-10-12Only use the first available suffix value when loading drivers. Peiyong Lin
Change the EGL loader to use only the first available suffix value when loading the GLES drivers. Previously the loader will continue to read values from a list of properties if it fails to load the value from the previous property. However, this silent fallback should not have happened, the value of the driver suffix properties must be set correctly or left empty if it's not intended to be used. Bug: b/277100371 Test: boot with persist.graphics.egl points to a nonexisted drivers Change-Id: Id6dd9a5aec5e737e8251f9b5f63176a9f8ebc594 Merged-In: Id6dd9a5aec5e737e8251f9b5f63176a9f8ebc594
2023-09-27EGL: Close Multifile Blobcache files after mapping Cody Northrop
When loading entries from disk, we don't need to keep the files open after mapping their contents. Per mmap documentation: After the mmap() call has returned, the file descriptor, fd, can be closed immediately without invalidating the mapping. https://man7.org/linux/man-pages/man2/mmap.2.html This will prevent consuming excessive file descriptors, which are a limited resource. Added new test that ensures file descriptors do not remain open. Test: libEGL_test, EGL_test, restricted_trace_perf.py Bug: b/286809755 Change-Id: I6317fdbce340a8e7cbf3020ad41386cf9915dd2d
2023-09-07Make sure the correct ANGLE binary is used. Peiyong Lin
Previously when eglGetDisplay is called, the code would attempt to initialize ANGLE platform methods and acquire pointers to reset the ANGLE platform. However, without this patch we continue using ro.hardware.egl to form the ANGLE binary name, which is now wrong. Not being able to correctly load the ANGLE binaries means platform methods are not initialize. This currently doesn't have known side effect except that we are observing a bunch of error messages that don't make sense that point to the native OpenGL ES driver loading failure. This patch makes sure ANGLE binary is used when initialize ANGLE platform. Bug: b/293503000 Test: atest CtsAngleIntegrationHostTestCases -c Change-Id: I5189042efc41fa7bef06d20f43ed4da3b1271dab
2023-08-25Merge Android U (ab/10368041) Xin Li
Bug: 291102124 Merged-In: I9b175092d433fc6d7b22b437a09d76d3d2e0ce14 Change-Id: If8a2897a99b111ba107f33c19537d40bcbdc802e
2023-08-21Fix bt2020 linear ext mapping issue in EGL and Vulkan. Sally Qi
- EGL_EXT_BT2020_LINEAR should be mapped to extend bt2020 linear if output format is FP16. Bug: 261485283 Test: builds Change-Id: Ifd68cc10afc0b5b38b15af2a938d02bb3bcd3764 Merged-In: Ifd68cc10afc0b5b38b15af2a938d02bb3bcd3764
2023-08-03Merge "Clean up EGL Loader." into main Peiyong Lin
2023-08-03Clean up EGL Loader. Peiyong Lin
Removes deprecated driver loading path, clean up comments and misc. Bug: b/293503000 Test: boot Change-Id: Ibc62bf59ed7b0cb3671583d2af853c457977d1d1
2023-08-01Revert^3 "Revert "Load native GLES driver when specified."" Peiyong Lin
Reason for revert: Revert to reland the patch. Original patch was reverted due to PcmaPhotoEditingV3 regression, see b/293486861. Original commit message: """ Load native GLES driver when specified. Since ANGLE and native GLES drivers can coexist, when native is specified, the loader must load the native GLES drivers specified in ro.hardware.egl. This patch passes this information down to the native graphics environment so that the EGL loader can properly check. Bug: b/283858001 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default """ Bug: b/283858001 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default Change-Id: Ibcf9d765ce1bd8931859d1c11e849a311adda172
2023-08-01Revert^2 "Revert "Load native GLES driver when specified."" Peiyong Lin
Revert reason: PcmaPhotoEditingV3 regressed, see b/293486861. Original change id: I6a2e716d340d9be3610c31abbcbe7984bf472f9f Bug: b/283858001 Bug: b/293486861 Test: atest CtsAngleDeveloperOptionHostTest -c with ANGLE being default Test: atest CtsAngleDeveloperOptionHostTest -c with native being default Change-Id: Id08acb6e18db095c632aa8d1a7810ede0c1a1ad2
2023-07-26Merge "Revert "Revert "Load native GLES driver when specified.""" into ↵ Peiyong Lin
udc-qpr-dev am: feb3d1595b am: b9bcd78850 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/24049733 Change-Id: Ib0bb0ca0e0405a60155bb9cd56ad5606bbd923f0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>