Commit graph

79106 commits

Author SHA1 Message Date
Yiwei Zhang
4264917141 Vulkan: remove the fallback path to load Vulkan driver
This fallback loading path was for backwards compatibility with devices
being upgraded from pre-Oreo (i.e. pre-Treble) to Oreo or later. Those
devices weren't required to follow a lot of the Treble rules, so linker
namespaces (or binaries compatible with them) couldn't be enforced. This
change removes it so that we can discover issues around loading Vulkan
driver from sphal namespace.

Bug: 156021362
Test: build, flash and boot
Change-Id: I505bdbdb40a06e1d837f1d0b75822b0c60de96c9
2020-05-07 14:05:57 -07:00
Siarhei Vishniakou
7e838c2377 Merge "Use <chrono> for input-related timeouts" into rvc-dev 2020-05-07 17:46:17 +00:00
TreeHugger Robot
bd1a5621b6 Merge "Add test to call setInputWindows twice" into rvc-dev 2020-05-07 16:47:00 +00:00
Siarhei Vishniakou
b1a1627da8 Rename ANR -> Anr
To follow the code style, rename ANR -> Anr, because we are about to add
a lot more ANR-related stuff, and we don't want to keep adding new code
that doesn't follow the code style.

Bug: 143459140
Test: build only
Change-Id: I5a97ba4dcd8baa8a34fbb790e68fb63fd3c3ca75
2020-05-07 05:55:42 +00:00
Siarhei Vishniakou
097c3db9fc Use <chrono> for input-related timeouts
There is a lot of confusion in input tests about the units used for the
timeouts. In a lot of cases, the timeouts are set too short, which
causes failures when they start getting enforced. To avoid this, use
std::chrono::duration for the timeouts.

Ideally, we should convert InputWindowInfo and InputApplicationInfo to
use std::chrono::nanoseconds, but that would be a larger change reserved
for a future release.

Bug: 143459140
Test: atest inputflinger_tests libinput_tests inputflinger_benchmarks
Change-Id: Ie7536e8a042a71b372f03314501e0d635a6ac1d4
2020-05-06 21:25:36 -07:00
Siarhei Vishniakou
fb9fcdae2f Add test to call setInputWindows twice
Currently, I'm observing some strange behaviour, where calling
setInputWindows twice results in the touchable region becoming empty.
Add this test to R to see what's going on, and potentially bisect on
this.

Bug: 143459140
Test: atest inputflinger_tests
Change-Id: Ia0acef5d4ee4acc29d20174fe44c9f94172ccd96
2020-05-06 21:25:31 -07:00
arthurhung
d352cb3827 Fix consumer closed input channel cause an error occurred (2/2)
An input channel specifies the file descriptors used to send input
events to a window in another process. And All of the file descriptors
open in the calling process shall be closed when process terminated.

The server side could receive the socket broken event when the process
terminated, we should do the unregister channel before close the file
descriptor or do it automatically without error if there is no valid
window.

Bug: 133782251
Test: open app and exit by back key or recent apps, check if any
      error log occurs.
Change-Id: I59d0084c2c771544e7ee226ce53c574f60c6b988
2020-05-07 10:22:35 +08:00
Wei Sheng Shih
7fb7a6a1a5 Merge "Makes TYPE_NOTIFICATION_SHADE as trusted overlay" into rvc-dev 2020-05-07 01:37:07 +00:00
TreeHugger Robot
2f116e22b0 Merge "CompositionEngine: base inverse transform on primary display" into rvc-dev 2020-05-06 23:38:36 +00:00
Snild Dolkow
9e217d60b6 CompositionEngine: base inverse transform on primary display
Layers with geomBufferUsesDisplayInverseTransform set (usually layers
showing a camera preview) were not being rotated correctly on external
displays with hardware composition. Forcing GPU composition avoided
the issue, since BufferLayer.prepareClientLayer() uses the *primary*
display's orientation to create the inverse transformation.

But, the HWC path used each screen's orientation, resulting in a bad
layer rotation when the primary and external displays' orientation
differed. So let's do what the GPU path does.

This, of course, only makes a difference when the primary and secondary
display rotations differ. In our case, we noticed the problem when
running the landscape-oriented CinemaPro app, while our default camera,
which runs in portrait, did not have a problem.

Co-authored-by: Mikael Magnusson <mikael.magnusson@sony.com>

Note: This is an updated version of the change with the same Change-Id
as uploaded to AOSP, as refactoring has continued, and more tests were
added since.

Bug: 155329360
Test: the new unit test fails without the patch
Test: the new unit test passes with the patch
Test: record using Cinema Pro app with an external screen
Reference: I0da22423490a93fe943fd59e6c122aa6aaf30b11
Change-Id: I8b4975a14a0ae42d10e4eeaa66385e72ff00c23d
2020-05-06 13:34:50 -07:00
TreeHugger Robot
58dc474b3d Merge "CE: Must dequeue a buffer if flipClientTarget requested" into rvc-dev 2020-05-06 19:07:04 +00:00
TreeHugger Robot
c0a8645e4e Merge "Generate a new id for each window" into rvc-dev 2020-05-06 18:11:14 +00:00
Hui Yu
ae1e9f614a Merge "Revert "Add isUidActiveOrForeground for camera/audio to use."" into rvc-dev 2020-05-06 16:59:34 +00:00
Vishnu Nair
5d3244b469 Remove unsafe cast in Client::createWithSurfaceParent am: a03e1302db am: f5d934e7ba
Change-Id: If3d0f2b2fae6093bce54cae34e92cfb40e49acc5
2020-05-06 01:52:38 +00:00
Vishnu Nair
f5d934e7ba Remove unsafe cast in Client::createWithSurfaceParent am: a03e1302db
Change-Id: I5b890ef48b214ed9702acd7a2cac52162a9c0ddb
2020-05-06 01:36:37 +00:00
Siarhei Vishniakou
540dbaee09 Generate a new id for each window
When input receives a list of windows from surfaceflinger, each window
has a unique id. But when we run tests, all ids are the same. This
causes some unexpected test failures for the cases where we have more
than 1 window per display.

To avoid this issue, mirror the surfaceflinger approach of generating
the ids by keeping a static variable that gets incremented every time we
create a new window

Bug: 143459140
Test: atest inputflinger_tests
Change-Id: I36731e78e16892b4bf48d6eba8db3e4c2684b54d
2020-05-06 01:25:56 +00:00
Jayant Chowdhary
16b0d7b6c4 Add xml file for camera2 concurrent camera feature.
Bug: 155188113

Test: atest CameraManagerTest.java on cuttlefish

Change-Id: I488f6d172a2a27b69dcbe44f79900526c2580f9d
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-05-05 15:47:23 -07:00
Lloyd Pique
e9eff9744a CE: Must dequeue a buffer if flipClientTarget requested
To match the logic that always queues a buffer if the HWC has a
flipClientTarget request for the current frame, we must also always
dequeue a buffer, even if no client composition is being performed.

This is an port of an (as yet uncommitted) AOSP change with a ChangeId of
I933cbae2f09f81eef6555b1bb1e5991d2c450930, due to the underlying code
having been refactored.

This version also adds and updates unit tests which were added as part
of the refactoring.

Bug: 151698217
Test: libcompositionengine_test
Test: libsurfaceflinger_test
Change-Id: Ia8a1470affb2596b27986cc4153417f48cf4ed1c
2020-05-05 15:19:59 -07:00
TreeHugger Robot
547bea0331 Merge "Remove unsafe cast in Client::createWithSurfaceParent" into rvc-dev 2020-05-05 17:36:09 +00:00
wilsonshih
9499a112e3 Makes TYPE_NOTIFICATION_SHADE as trusted overlay
Fix the side effect after we split notification_shade window from status
bar.

Bug: 155373298
Test: follow the steps from b/149320322
Change-Id: I3362186b22505d21ec6e0ad779d4a26304ed782c
Merged-In: I3362186b22505d21ec6e0ad779d4a26304ed782c
2020-05-05 04:44:23 +00:00
Steven Thomas
0abfdcad57 Merge "Give touch boost higher priority than idle detection" into rvc-dev 2020-05-05 01:33:55 +00:00
TreeHugger Robot
2e7d28cc8e Merge "GLESRenderEngine: validate eglQueryStringImplementationANDROID for nullptr" into rvc-dev 2020-05-05 00:19:14 +00:00
TreeHugger Robot
a2fad15aac Merge "SurfaceFlinger: add frame rate to dumpsys" into rvc-dev 2020-05-04 23:12:07 +00:00
Steven Thomas
bb37432c0f Give touch boost higher priority than idle detection
When the non-kernel idle timer is used, touch boost wasn't being applied
when the device was idle. I moved the code around to ensure touch boost
is applied when the device is idle.

Bug: 154571341

Test: - Wrote a new unit test to confirm correct idle behavior.
      - Locally modified a Pixel 4 to use the regular idle timer rather
        than the kernel idle timer, and confirmed we now apply touch
        boost correctly.

Change-Id: Id998405a4d79f7a89fc0523b6503fe1a3dea8cce
2020-05-04 15:23:15 -07:00
Ady Abraham
be23e6a1d7 SurfaceFlinger: add frame rate to dumpsys
Print frame rate if explicitly set by setFrameRate to dumpsys

Bug: 155676501
Test: adb shell dumpsys SurfaceFlinger
Change-Id: I1016f8a56921f7f465ca50298f49d05b02be585c
2020-05-04 22:12:45 +00:00
Hui Yu
94ea7ac7e0 Revert "Add isUidActiveOrForeground for camera/audio to use."
Revert submission 10829580-isUidForeground

Reason for revert: In CameraService.cpp, before this change, around "am.isUidActive", there was up to 300 ms retry. After this change, the code could move forward fast without retry, but at "mAppOpsManager->startOpNoThrow" call, for the same reason as uid is not updated fast enough, "mAppOpsManager->startOpNoThrow" could also fail.

This CL does not really fix the root cause, but it changes the timing and now the code fails at "mAppOpsManager->startOpNoThrow" call.

Also the timing change may also cause recent multiple CTS test failures.

Bug: 154570809, 155032617, 154849083


Reverted Changes:
Iffed63293:Add isUidActiveOrForeground() for camera/audio to ...
I3685e0c8d:Add isUidActiveOrForeground() for camera/audio to ...
I51ed1fe78:Add isUidActiveOrForeground for camera/audio to us...

Change-Id: I9fbeb190c5a0ac640ad5be8140fe4aaeb7cfe33d
2020-05-04 18:07:46 +00:00
Calin Juravle
e13827d3dc Merge "Handle the boot profile format when analyzing profiles" into rvc-dev 2020-05-04 17:59:43 +00:00
Michael Hoisie
49497c9af7 Merge "Update libgui to use android::base properties instead of cutils" into rvc-dev 2020-05-02 20:49:42 +00:00
Suren Baghdasaryan
6c245b42f5 Replace direct pid writes with setting task profiles
For easy transition from SchedTune to UtilClamp, direct access to these
cgroups should be abstracted by using task profiles. Replace writepid
commands with new task_profiles command.

Bug: 155419956
Test: change .rc file and confirm task profile is applied
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I3e06e25a75cf79674d8381b3356c64790fd5a597
Merged-In: I3e06e25a75cf79674d8381b3356c64790fd5a597
2020-05-02 06:20:28 +00:00
Steven Thomas
32bc62dc0e Merge "Split refresh rate range into two ranges" into rvc-dev 2020-05-02 02:12:38 +00:00
Dheeraj Shetty
5b7d7e2150 Merge "Revert^2 "libui: rewrite Region with FatVector"" into rvc-dev 2020-05-01 23:27:43 +00:00
Michael Hoisie
4e0f56bbb0 Update libEGL to use android::base properties instead of cutils
android::base properties work on host and are generally more concise
than cutils properties.

Also, add libbase to egl_libs_defaults. This does not actually add
another dependency because libbase is already a dependency via
libbacktrace.

Bug: 155436554
Test: atest libEGL_test
Test: build, flash and boot
Change-Id: Ibf66e01ce93524eaa29098ae9c57bc6452133f76
2020-05-01 18:08:58 -04:00
Michael Hoisie
53e19a76a4 Update libgui to use android::base properties instead of cutils
Clean up cutils/properties.h headers as some files were including it and
not using it.

Also update DebugEGLImageTracker to use android::base properties because
it works on host and is generally more concise.

Bug: 155436554
Test: build, flash and boot
Change-Id: I1dc7060cae9811b69aac9bb36b71b69cd6ecba93
2020-05-01 17:57:38 -04:00
Calin Juravle
c8a0442cad Handle the boot profile format when analyzing profiles
When analyzing profiles for dexopt, use the boot image profile format
if the system is configured to profile the boot image.

Test: atest installd_dexopt_test
Bug: 155423653
Change-Id: I83ff959389bafcfce291485f78e1b05d6ca42625
2020-05-01 14:05:40 -07:00
Steven Thomas
f734df4201 Split refresh rate range into two ranges
To prevent low-priority refresh rate considerations from overriding the
app frame rate as specified via the new setFrameRate() api, split the
display refresh rate range into "primary" and "app request" ranges. The
primary range includes the low priority considerations, while the app
request range removes two lower priority considerations.

In general, surface flinger will keep the display refresh rate within
the primary range, but layers with frame rate settings via the
setFrameRate() api may cause surface flinger to pick a refresh rate
outside the primary range. Surface flinger will never choose a refresh
rate outside the app request range specified by display manager.

Bug: 148978562

Test: - Added a new unit test to DisplayModeDirectorTest to verify that
        display manager strips lower priority considerations when
        deciding the app request range.

- Added a new unit test to RefreshRateConfigsTest to verify
  RefreshRateConfigs handles the primary vs app request range
  correctly.

- Manual test: Confirmed that with the "force 90Hz refresh rate" option
  turned on, we don't switch to 60Hz when playing a 60Hz video.

- Manual test: Confirmed that with the "force 90Hz refresh rate" option
  turned on, when an app calls setFrameRate(60), we stay at 60Hz.

- Manual test: Modified a Pixel 4 XL to prefer 60Hz in low brightness,
  entered low brightness, and confirmed we don't touch boost to 90Hz.

- Manual test: Confirmed that Maps stays at 60Hz on Pixel 4.

- Manual test: Turned on verbose logs in RefreshRateConfigs.cpp,
  confirmed they look good.

- Manual test: Inspected dumpsys output, confirmed the primary and
  app request refresh rate ranges are printed correctly.

Change-Id: Ib16cc9b6158efa575cdbfbb7a0ad014008a3e5af
2020-05-01 12:00:01 -07:00
TreeHugger Robot
40dbb5fb41 Merge "Vulkan: handle INVALID_OPERATION from BQ in the timeout case" into rvc-dev 2020-05-01 17:38:41 +00:00
Yiwei Zhang
c0f8a2ce8e Vulkan: handle INVALID_OPERATION from BQ in the timeout case
If app dequeues too many buffers, then dequeueBuffer will return
INVALID_OPERATION. When ANI is called with a timeout which isn't
UINT64_MAX, ANI shouldn't return VK_ERROR_SURFACE_LOST_KHR.

Bug: 146534593
Bug: 155421312
Test: dEQP-VK.wsi.android.swapchain.acquire.too_many
Test: dEQP-VK.wsi.android.swapchain.acquire.too_many_timeout
Change-Id: Ie8ad8edb4632378247b9cbb715ed6eb7134ababb
2020-05-01 17:37:59 +00:00
Jagadeesh Pakaravoor
a9a6b46b9c Revert^2 "libui: rewrite Region with FatVector"
Revert submission 10449863-revert-fatvector

Reason for revert: b/149254345

Original change (of introducing FatVector) was reverted as a stop-gap solution to fix the aforementioned bug.

The bug was caused by an ABI lock between Surface's definition (that changed with Region) and lib-imsvt prebuilt.

Enabling this change now as we have re-compiled the prebuilt with the change enabled. Doing that via a revert of the revert.

Reverted Changes:
I8ac66acb8:Revert "hwui: remove FatVector"
Ib60dbf3ef:Revert "libui: rewrite Region with FatVector"

Original changes:
I09dc2fddd:hwui: remove FatVector
I265c6c831:libui: rewrite Region with FatVector

bug: 149254345

Change-Id: I723283a952e0908f595967af0037b0dc1351671b
2020-05-01 15:57:33 +00:00
Steven Moreland
5a1f549845 Merge changes from topic "vintf-manifest-error-logs-part-ii" into rvc-dev
* changes:
  Log VINTF manifest success/failure cases.
  servicemanager: remove performance hack
2020-05-01 03:21:23 +00:00
Steven Moreland
e192a6721d Log VINTF manifest success/failure cases.
These logs are critical to understand the operation of the system, and
do not spam (1/hal start or 1/hal request). Most importantly, if a
manifest fails to be read for whatever reason, this is logged (null
manifest case).

Bug: 151696835
Test: boot, and verify logs of successful hal retrivals
Test: boot, and verify logs w/ patch which causes VINTF to fail the
  first time, and verify that this causes a single crash which gives us
  the ability to still find and detect a critical error, but allows the
  system functionality to continue to work.
Change-Id: I0a26b875947878656d6eda03ffebce97ebb6139e
Merged-In: I0a26b875947878656d6eda03ffebce97ebb6139e
2020-04-30 17:51:34 -07:00
Steven Moreland
d221c25182 servicemanager: remove performance hack
See details in TODO.

This hack is either causing a bug or may be preventing us from solving
another bug. Until the more critical bug can be fixed, avoiding
early-boot reads of VINTF manifest files.

Bug: 151696835
Test: run, boot, check manifest logs that HAL services register
Change-Id: Iba34afe451026a30e695d6728b4172007aaf7fbd
Merged-In: Iba34afe451026a30e695d6728b4172007aaf7fbd
2020-04-30 17:51:33 -07:00
Lucas Dupin
50f6c0e2d3 Merge "Apply display translation to blurred result" into rvc-dev 2020-04-30 23:04:39 +00:00
Lucas Dupin
19ce655ecf Apply display translation to blurred result
Test: on notched device, hide cutout, swipe down the shade
Fixes: 155130038
Change-Id: I216c77d2c6695c8faf8a0502f9d403a76403a2f6
2020-04-30 14:45:23 -07:00
Ady Abraham
3ef1b76f9c GLESRenderEngine: validate eglQueryStringImplementationANDROID for nullptr
Log fatal the EGL error in case eglQueryStringImplementationANDROID
returns nullptr;

Bug: 155272618
Test: boot
Change-Id: I4be7f798adfa7fdd7378dc509c847299f0539c7f
2020-04-30 17:32:02 +00:00
Rob Carr
1b8793a693 Merge "SurfaceFlinger: Only block calling thread on sync transactions." into rvc-dev 2020-04-30 17:02:11 +00:00
Michael Hoisie
11d7674745 Merge "Remove unused libhardware_headers dependency from libEGL" into rvc-dev 2020-04-30 03:56:07 +00:00
Robert Carr
238f4a2ac4 SurfaceFlinger: Only block calling thread on sync transactions.
We use synchronous transactions and synchronous input commands so that
the caller can block until after the transaction has executed. However
the current implementation blocks all other callers. This isn't required
and could create performance issues or binder exhaustion issues so
this CL modifies the code so only the calling thread will block.

Bug: 154443842
Test: Existing tests pass
Change-Id: I556497b1a48de5add753f4de09227b16ca1fc428
2020-04-29 13:32:27 -07:00
Dominik Laskowski
6650884c0e Merge "SF: Defer setDisplayBrightness to Binder thread" into rvc-dev 2020-04-29 20:10:51 +00:00
Dan Stoza
b0c9b69e5d Merge changes Iefa0e017,I79cc96c6,I14e31679,Ie490113e into rvc-dev
* changes:
  Fast path Region::orSelf when empty
  SF: Reduce present fence work
  TracedOrdinal per-frame optimizations
  SF: Extract onMessageInvalidate
2020-04-29 19:33:28 +00:00
Rob Carr
d6f449d45b Merge "DO NOT MERGE: InputDispatcher: Consider ownerPid in FLAG_OBSCURED calculations" into rvc-dev 2020-04-29 18:22:50 +00:00