Preparation for removing implicit include paths for jni.h from soong.
Bug: 152482542
Test: m checkbuild
Change-Id: I7a6c702f93d37d079861dac1d1adad12a6cc4ccf
This was transitively included, but no longer is, so it must be
explicitly included.
Exempt-From-Owner-Approval: Janitorial
Test: build
Change-Id: I9c57174e4dcf5dfddb44498d8faa556531894b1e
This was transitively included, but no longer is, so it must be
explicitly included.
Exempt-From-Owner-Approval: Janitorial
Test: build
Change-Id: I369e3bdc049f811acbcea095d90960a16d5ff4e0
Fix location of UnsupportedAppUsage.java.
Update templates to match current sources.
Add set-up sanity checks to gen script.
Bug: 151443957
Test: ./gen and observe no source changes
Change-Id: I095ef85ba9b2ef6617c451221a35f3545c3933a3
Only the GL back-end requires context virtualization. So only
require it for that case and not for Vulkan back-end.
Test: dEQP with ANGLE and ANGLE build with args.gn with
angle_enable_gl=false
Bug: 150892231
(cherry picked from commit 559b4339c7)
Change-Id: I443841c2543d0c6446d0f11122bf18dc9acbf428
The APIs that are tagged with # vndk are actually for LLNDK libraries.
Although LLNDK is part of VNDK, calling those APIs 'vndk' has given
users a wrong perception that the APIs don't need to be kept stable
because that's the norm for most of the VNDK libraries that are not
LLNDK.
In order to eliminate the misunderstanding, rename the tag to 'llndk' so
that people introducing new such API will realize what they are signing
themselves up for.
Exempt-From-Owner-Approval: cherry-pick from internal gerrit
Bug: 143765505
Test: m
Merged-In: I10d40e06b1f1d6d0e190699ab6356b18d53fd2ab
(cherry picked from commit 0a0e26b17b)
Change-Id: I10d40e06b1f1d6d0e190699ab6356b18d53fd2ab
When adding support for GLES layers, we refactored
eglGetProcAddress to allow layers to intercept functions
unknown to the Loader. During the cleanup, we broke slot
tracking if an extension were looked up multiple times.
Follow up queries would use an incremented slot that
had not been initialized:
eglGetProcAddress("foo1") = fptr0:0x77e2c2abd8
eglGetProcAddress("foo2") = fptr1:0x77e2c2abf4
eglGetProcAddress("foo3") = fptr2:0x77e2c2ac10
eglGetProcAddress("foo1") = fptr3:0x77e2c2ac2c <= wrong
eglGetProcAddress("foo2") = fptr4:0x77e2c2ac2c <= repeated
eglGetProcAddress("foo3") = fptr5:0x77e2c2ac2c <= repeated
This CL tracks which slot was used for a given extension,
and when it is queried a second time, we look up the
correct slot using extensionSlotMap.
eglGetProcAddress("foo1") = fptr0:0x77e2c2abd8
eglGetProcAddress("foo2") = fptr1:0x77e2c2abf4
eglGetProcAddress("foo3") = fptr2:0x77e2c2ac10
eglGetProcAddress("foo1") = fptr3:0x77e2c2abd8 <= correct
eglGetProcAddress("foo2") = fptr4:0x77e2c2abf4 <= correct
eglGetProcAddress("foo3") = fptr5:0x77e2c2ac10 <= correct
It also refactors the code a bit to be more readable, and
fixes a typo throughout the file.
Bug: 143860847
Test: egl_api_test
Change-Id: If75c1abdb69a4d82253f28a5a80687f546e33ee0
Merged-In: If75c1abdb69a4d82253f28a5a80687f546e33ee0
IEEE754 single precision cannot precisely represent RAND_MAX.
error: implicit conversion from 'int' to 'float' changes value from
2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion]
For purposes of generating random uniforms, this does not matter. Add
explicit casts of RAND_MAX to float to fix.
Bug: 139945549
Test: mm
Change-Id: I3a609b9bbe2e62eeacf5a6853ba625a512e5bcba
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Since these were combined into libhidlbase.
Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: Iec1802ce9226570d3a02cc5242f7ca72e1370635
Previously, EGL apis call clearError() at the first place including those core
apis which initialize the driver. Calling clearError() before the driver has
been loaded is basically a no-op.
Later the driver unloading mechanism was added to support Angle and updatable
driver with EGL/GL driver still preloaded in Zygote. However, calling
clearError() on another thread races with the driver unloading process. So this
change moves the clearError() calls after the driver has been successfully
unloaded and reloaded, so that the initial core apis will be protected by the
driver loading lock in the loader.
For those non-core apis, they could still be incorrectly called before calling
any of those core apis on another thread when the driver unloading and reloading
is still on going. Since this scenario is supposed to error out anyway, so the
apps need to use EGL apis correctly by themselves.
Bug: 140072978
Test: CtsAngleDeveloperOptionHostTest
Change-Id: Ica5b19edc0dfb0a0910f56c1442eaff63f76b35a
Merged-In: Ica5b19edc0dfb0a0910f56c1442eaff63f76b35a
Both ANGLE and Game Driver originally require the GL driver to be not loaded
before the App launches. However, extra memory overhead from loading GL driver
in each process requires us to enable gl driver preloading in Zygote again.
So this CL adds the logic to unload the system driver if the App chooses to use
ANGLE or Game Driver. As long as nobody is using GL api in Zygote to create any
context, the unloading at App launch time should be safe.
eglGetDisplay will always ask the driver for the display handle after this
change, otherwise it will still use the cached display handle even we unload
the system driver and load the ANGLE or Game Driver. This means we no longer
cache it because eglGetDisplay is rarely called and trivial for the driver.
Bug: 134526352
Test: build, flash and boot. Then manually test with ANGLE and Game Driver.
Change-Id: I7c068ce9f630347a5d94823bbe6cfbac0f280e91
Bug: http://b/116873221
Bug: http://b/133874658
This is just a work around as we investigate a crash in surfaceflinger
on cuttlefish when coverage is enabled.
Test: surfaceflinger no longer crashes on cuttlefish + coverage builds.
Change-Id: Ib2ee9b159accbe7228d4b2f7661aef9f240d7512
(cherry picked from commit 5d7eb4fb1f)
Bug: http://b/116873221
Bug: http://b/133874658
This is just a work around as we investigate a crash in surfaceflinger
on cuttlefish when coverage is enabled.
Test: surfaceflinger no longer crashes on cuttlefish + coverage builds.
Change-Id: Ib2ee9b159accbe7228d4b2f7661aef9f240d7512
These mitigations are still necessary for GSI images with P vendor
partitions to pass Q CTS. This is essentially a revert of commit
30c1d90f1c adjusted to match the changes
introduced in the meantime.
Bug: 124411631
Test: Pixel XL boots, CtsVrTestCases passes on Pixel 3 GSI+P
Change-Id: I38bddfddda411337f5ed77b7e4899b922386f331
We want to shift the GL loader to load graphics library based on
ro.hardware.egl and ro.board.platform, emulator will switch to set
ro.hardware.egl based on the emulation status. This patch removes the dedicated
graphics driver loading path for emulation.
BUG: 127353494
Test: Build, boot and verify with emulator.
Change-Id: I22ac50b6340e4b1a27e20839fb53819c6337d9a7
One of the fundamental problems of the GLES loader is that we never take
ro.hardware.egl and ro.board.platform into account while we try to load the
system driver. As a result, if a device specify the naming via these two
properties, it will not work.
Checking these two properties will allow us to remove a bunch of checks as
well, eventually we want emulator and swiftshader to go through this approach
instead of having a bunch of checks.
Another issue, is that the final loading of the system graphics driver will
load from whatever that match the wildcards of libGLES_*.so or [libEGL_*.so,
libGLESv1_CM_*.so, libGLESv2_*.so]. This is bad, for example, on cuttlefish,
there could be multiple system drivers exist at the same time and cuttlefish
can set ro.hardware.egl during boot time, however, when the graphics driver
fails to load, it will silently load other graphics driver via wildcards
matching. We want to make sure that once the loader fails to load the graphics
driver using system properties, the device can't boot.
In this patch, we attempt to load the system graphics driver by appending these
two properties at the end of the graphics driver library names before we start
to load from the exact names of the graphics driver, and remove the wildcards
matching.
BUG: 127353494
Test: Boots locally, verify emulator.
Test: atest CtsAngleIntegrationHostTestCases
Change-Id: Ib38c797fd3ce5a6e84e2cd38e24c9d3ab3da8274
Previously, the order of loading the graphics driver is:
1) Try to load libGLES from ANGLE -> Driver apk -> emulation driver -> system;
2) If 1) fails, fall back to load [libEGL, libGLESv1_CM, libGLESv2] from ANGLE
-> Driver apk -> emulation driver -> system.
However, there might be multiple variants of the same library exist in the
device and they all follow the same naming convention, which makes the driver
loading choice unpredictable. This patch refactors this ordering such that, we
loop over driver choices first, and for each driver choice, we try to see if we
can load either libGLES or [libEGL, libGLESv1_CM, libGLESv2] from it, if fails,
proceed to the next driver choice.
Minor: Code clean up here and there.
BUG: 127353494
Test: Build, verified with Developer Options and emulator
Test: atest CtsAngleIntegrationHostTestCases
Change-Id: I408dc20d8e41f69eac25c943e7c79af559d3d160
We want to clean up our loader logic and eventually use properties to control
which driver should be loaded. In this patch, we extract the logic of loading
emulation driver and api initialization out as first step.
BUG: 127353494
Test: Build, flash and boot.
Change-Id: I19ce422488188892dc65ef6fdf853ecd52530eea
This change creates a separate entry list for initializing gles1 apis
from the driver. With this change, the gl driver loading time for one
particular device reduced from ~180ms to ~40ms.
Bug: b/117526831
Test: dEQP-EGL.* and systrace on multiple devices
Change-Id: Ic2f6f1b8f4cd8f17db64b6e288769e2d6a7859eb
Merged-In: Ic2f6f1b8f4cd8f17db64b6e288769e2d6a7859eb
Turns out there are some slight differences between extension
functionality and corresponding core EGL 1.5 functions. They
are not exactly the same, unfortunately and am unable to
pass EGL 1.5 dEQP tests using the cooresponding KHR extensions.
Test: adb -d shell am start -n com.drawelements.deqp/android.app.NativeActivity -e cmdLine '"deqp --deqp-case=dEQP-EGL.functional.reusable_sync* --deqp-log-filename=/sdcard/dEQP-Log.qpa"'
Bug: 129980957
Change-Id: I1ddcc3890d90c6c1a8267591182c9865315cd5cd
EGLAttrib is defined for a C / C++ interface and is
intended to be the size of a pointer. That can change
depending on which abi the code is built for but Java doesn't
have a way of dealing with such types. Java defines EGLAttrib
as a jlong, so need to convert jlong to 32bit when running on
a 32bit device.
Bug: 124382141
Test: atest --all-abi CtsGraphicsTestCases:EGL15Test
Change-Id: I3322651cdc9d9d989b4813bc85f99e4e16fda5a0
According to the EGL specification, EGL_EXT_client_extensions is
expected in the set of supported client extensions that is queried
without initializing a display.
Bug: 129370892
Test: On EGL 1.4 device
Test: CtsDeqpTestCases:include-filter:dEQP-EGL.*
If device has all the necessary extensions, EGL version will be 1.5
Change-Id: I7138dd2228bd79940c7d2dc4f3c89491e94d8d02
This extension is just an indicator of GLES layers support,
does not expose any new tokens or entrypoints.
Bug: 110883880
Test: atest CtsGpuToolsHostTestCases
Test: Connect with GLES layers using GAPID and RenderDoc
Change-Id: I898d7980826ab0fe5afaa0b2dbe7d93f29b3f88f
These have been useful while debugging layer implementations.
Bug: 110883880
Test: atest CtsGpuToolsHostTestCases
Test: Connect with GLES layers using GAPID and RenderDoc
Change-Id: I7b797fb8fd8a43c57dd3c2baac2712bf6c839ef2
Presence of the extension means libEGL will scan for layers and
enumerate their entrypoints by calling AndroidGLESLayer_Initialize
and AndroidGLESLayer_GetProcAddress.
Since tools must determine layering support before fully loading
libEGL, the following call will return extension strings without
loading vendor drivers:
eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
Bug: 110883880
Test: atest CtsGpuToolsHostTestCases
Test: Connect with GLES layers using GAPID and RenderDoc
Change-Id: Ib79193b3a0ac3dffacd51bc677b81c07ffcced93
Based on developer feedback, these names make the
purpose of the entrypoints more clear for libs used
on multiple platforms.
Bug: 110883880
Test: atest CtsGpuToolsHostTestCases
Test: Connect with GLES layers using GAPID and RenderDoc
Change-Id: I78bad4398de89a9fff7c9dedfd843f8c1c959c27
Some drivers may claim to support egl 1.5, but don't actually
expose all the APIs necessary for conformance.
Instead of erroring out when attempting to use this functionality,
which can prevent doing anything useful with the driver, proactively
check for the APIs and downgrade to egl 1.4 if they're not present.
Bug: 128446160
Test: dEQP on Marlin
Change-Id: Ief082ff018876ae38bfe86b64a23d29ff2ce0d4b
Syncs generator to accomodate manual changes to checked-in sources.
Adds note to EGL15.cpp that file is automatically generated.
Bug: 126352534
Bug: 124064285
Test: gen and diff based on generated command lines.
Change-Id: I31909de4c077679dec0323761fb06f388d128a14
Incorporate manual changes to generated Java files back into the
generator.
Bug: 126352534
Bug: 124338141
Test: ./gen and check output has no commands for java files to be run.
Change-Id: Ie5f48d704b1485316718ae19b20016a08e688916
The dependencies are replaced with *_lazy libraries which dynamically
load and links to the real libraries at runtime using dlopen and dlsym.
This allows libEGL to be used by early processes that are executed
before the activation of the runtime APEX where libnativeloader and
libnativebridge are provided.
Bug: 123403798
Test: m
Test: device boots to the UI
Change-Id: Ia54443163e1edcdcd142fcf392d830f1ae4c32bb
This change plumb the below info from GL and Vulkan loader:
1. Intended driver to use
2. Whether intended driver is loaded
3. Total driver loading time
Bug: 123529932
Test: Build, flash and boot. Verify the GpuService receiver side.
Change-Id: I967d4361bf0e04c02390c7555617575c19ecadd4