Commit graph

6771 commits

Author SHA1 Message Date
chaviw
bf5b42355b Updated OWNERS files
Test: Nothing
Bug: None
Change-Id: Ib055cbb8884b7a3ffa24f70d1e3ed610ac5024be
2020-05-12 10:00:16 -07:00
Baldev Sahu
0560e0e8ea sf: Fix issue with dequeueBuffer when multiple display present
swapBuffers is called even for device composition when a flip client
target request is present. dequeueBuffer call is skipped
as there is no client composition. This is fine for single display
but if multiple display i.e. vds is present, this will be an issue
as current surface will not be switched and swapBuffers will fail

When flip client target request is present, make sure buffer is
dequeued before swapBuffers.

Bug: 151698217
Test: atest libsurfaceflinger_unittest
Change-Id: I933cbae2f09f81eef6555b1bb1e5991d2c450930
Merged-In: Ia8a1470affb2596b27986cc4153417f48cf4ed1c
2020-05-11 12:06:06 -07:00
Suren Baghdasaryan
7a5ff88143 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
2020-05-01 17:46:48 +00:00
Valerie Hau
af5e2e16c8 Merge "[RESTRICT AUTOMERGE] Send callbacks earlier" 2020-04-22 22:34:45 +00:00
Valerie Hau
7687b3cd32 [RESTRICT AUTOMERGE] Send callbacks earlier
Missed callbacks if connected displayDevice is not powered on

Bug: 153112115
Test: build, boot, SurfaceFlinger_test
Change-Id: Idb89eebe70535d9bf4ca7a067d8aac10037e1d67
2020-04-22 11:20:04 -07:00
Treehugger Robot
a12af50c56 Merge "Add explicit dependencies on jni_headers" 2020-04-07 21:37:16 +00:00
Treehugger Robot
f667bfa451 Merge "Use pixel format from buffer to determine opacity." 2020-04-07 17:44:47 +00:00
Orion Hodson
70e039b792 Add explicit dependencies on jni_headers
Preparation for removing implicit include paths for jni.h from soong.

Bug: 152482542
Test: m
Change-Id: I33a4c334a0b004345622c32239ce9d5da8efe09b
2020-04-07 09:28:41 +01:00
Siarhei Vishniakou
f48bb9ecf8 Properly initialize MotionClassifier
InputClassifier will now play a more active role in managing the
lifecycle of MotionClassifier.

In the previous version of the code, we had a circular reference:
MotionClassifier owned a wp<InputClassifier>, that sometimes got
promoted to sp<>.
But the InputClassifier was the official owner of MotionClassifier, and
owned a unique_ptr<MotionClassifier>.

The owner of InputClassifier in real code is InputManager, and in test
code, it's the test class. When the owner of InputClassifier destroyed
InputClassifier, this could sometimes happen at the time when the
MotionClassifier also held a reference to the InputClassifier. That
meant that the proper owner of InputClassifier was not invoking the
destructor.
Instead, the MotionClassifier was invoking the InputClassifier
destructor.

To fix the situation, we now do the following:

1. InputClassifier will never die before MotionClassifier.

2. MotionClassifier constructor is now allowed to block. It would block
for some time because calling getService takes a while. To account for
this, InputClassifier launches a new thread to create MotionClassifier.

3. When MotionClassifier is ready to process events, InputClassifier
updates mMotionClassifier, which makes it non-null.

4. We now create a separate death recipient, which is co-owned by
InputClassifier and MotionClassifier. This is done so that the refcount
of the deathrecipient does not affect the refcount of InputClassifier,
and thus enforces the ownership of InputClassifier by the InputManager.
Now, no one can call ~InputClassifier except for its real owner.

5. MotionClassifier will subscribe the death recipient to the death of the
HAL. InputClassifier will delete MotionClassifier if HAL dies.
MotionClassifier no longer holds on to the death recipient.

6. We move the loop of the MotionClassifier thread to focus only on
processing events. That thread will no longer do any initialization.

7. Remove the thread check inside MotionClassifier. It isn't really
useful, now that there's only 1 function for the entire thread.

Ownership summary: Both InputClassifier and MotionClassifier own
DeathRecipient. DeathRecipient has a reference to InputClassifier. Thus,
we must guarantee that DeathRecipient dies before InputClassifier.
InputClassifier owns MotionClassifier. This is OK, since even if
InputClassifier dies, it will first delete MotionClassifier. That will
cause MotionClassifier to release 1 refCount from DeathRecipient. That
means the only reference remaining to DeathRecipient will be inside
InputClassifier, so InputClassifier will always be alive until
DeathRecipient is dead. Similar argument applies if MotionClassifier and
DeathRecipient die in different order (as observed from
InputClassifier).

Tests:
1) Manually running inputflinger_tests on cuttlefish:
build/launch cuttlefish using go/acloud
m inputflinger_tests
adb push out/target/product/vsoc_x86/data/nativetest/inputflinger_tests/inputflinger_tests /data/nativetest/inputflinger_tests/inputflinger_tests
adb shell
/data/nativetest/inputflinger_tests # ./inputflinger_tests --gtest_filter=*InputClassifierTest* --gtest_repeat=1000 --gtest_break_on_failure
2) Boot flame and open logcat. Observe in logcat:
StartInputManagerService took to complete: 2ms
Previously, in synchronous approach ( b/130184032) it was
about 100 ms (so we did not regress).
3) Kill the HAL while system_server is running, and dumpsys input before
and after:
adb shell dumpsys input (observe that MotionClassifier is non-null on flame)
adb shell -t killall android.hardware.input.classifier@1.0-service
adb shell dumpsys input (observe that MotionCLassifier is null)

Bug: 153022912
Test: see "Tests" section above
Change-Id: Ic76b82bd5f2cd374e3b001400eb495ca36de7353
Merged-In: Ic76b82bd5f2cd374e3b001400eb495ca36de7353
(cherry picked from commit 1652397ab7)
2020-04-06 23:22:53 +00:00
wukui1
1702341eea Use pixel format from buffer to determine opacity.
The format that's passed into BufferQueueLayer creation is meant to
define what format the buffers should have that are dequeued from the
consumer. If the client submits its own buffers, they can have any
pixel format. Therefore, the format from the activeBuffer should be used
when determing opacity since that's the information about the buffer
that will be rendered.

Bug: 152162496
Test: dumpsys SurfaceFlinger
Test: LayerTypeAndRenderTypeTransactionTest#SetBufferFormat
Change-Id: Ifdaa43c28c78ef96a2e8ea4fcbb9886a6227df4d
Merged-In: I4295b837369b8ca8918d8398a29cab133a47cbf7
Signed-off-by: wukui1 <wukui1@xiaomi.com>
2020-04-02 12:21:30 +00:00
Ady Abraham
48c7bec03a SurfaceFlinger: add RootTargetPreparer to SurfaceFlinger_test
Some of SurfaceFlinger tests such as SurfaceInterceptorTest requires
root access as they use sf backdoor interface.

Test: adb unroot; atest SurfaceFlinger_test
Bug: 151830811
Bug: 147527408
Change-Id: Ie144891f1c413a18b705f560d70d23041d36772b
Merged-In: Ie144891f1c413a18b705f560d70d23041d36772b
2020-03-30 12:13:07 -07:00
Chaojiang Luo
36e28ca041 SF:Report active config to java framework
When config multi display config in display driver, the active
config in java framework is not same as SF. Without the Changed
flag the active config can not report to java framework.During
the booting, will set active config and report to java framework,
when boot finished, it may change the active config, so we should
add the Changed flag, and report java framework.

Test: make, take a photo, record a video and play video,
	run vts testRefreshRate

adyabr@ Note: This fix is not needed on master as we are not
changing the refresh rate in bootFinished. Added Merged-In to reference
the change on master.

Change-Id: I2e48640f48a14bc044884c2e834af53e9a87ef13
Merged-In: I5bb964572d93e5cb78d7b75054b900917be563b0
Signed-off-by: luochaojiang <luochaojiang@xiaomi.com>
2020-03-16 21:39:06 +00:00
Automerger Merge Worker
60e1700650 Merge "Update OWNERS" am: 0f58ab624b
Change-Id: Iccce6b80843c13807edf8ff02975154bf62ef86d
2020-02-28 21:23:19 +00:00
Marissa Wall
9668eca1fb Update OWNERS
Remove people who are no longer owners. Add new owners.

Test: Compiles
Bug: 150462113
Change-Id: Ia9c353772cb1f95b430a62155b4e499a3466861b
2020-02-28 20:45:54 +00:00
Automerger Merge Worker
4cbc5f08d8 Merge "Create libstatshidl" am: 2649732a41
Change-Id: Id899eee57e5da42118c5168c8512cdbf5491a5e5
2020-02-07 18:17:50 +00:00
Jeffrey Huang
1a4f0f207e Create libstatshidl
Test: bit VtsHalStatsV1_0TargetTest:*
Bug: 148794952
Change-Id: I7e8c7f51ed00ed152561f6883157b363494b470a
Merged-In: If704ae440246390fb15f6619048f18f14c106a01
2020-02-06 16:20:04 -08:00
Xin Li
4d1ce2a77e DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master
Bug: 146167222
Change-Id: Iaba133dfa9dd59eabf3d91a1c15a0435850d10af
2020-01-15 15:57:09 -08:00
Steven Thomas
22b59704e4 Add steventhomas to surface flinger owners file
Bug: -
Test: -
2020-01-14 11:54:21 -08:00
Valerie Hau
c65d5c036a Add vhau@ to OWNERS of SurfaceFlinger
Bug: N/A
Test: N/A
2020-01-10 12:53:12 -08:00
Automerger Merge Worker
dc1990138c Merge "SurfaceFlinger: migrate capabilities to surfaceflinger.rc" am: e03e9dd1aa am: 82072cf28e
Change-Id: I26c37a46ade0015982b0a10cfeef7c60fa8f0216
2020-01-08 22:40:54 +00:00
Ady Abraham
d596928a68 SurfaceFlinger: migrate capabilities to surfaceflinger.rc
SurfaceFlinger requires CAP_SYS_NICE which is set in
libcutils/fs_config.cpp. This is the old way of setting capabilities
and new the way is to set it directly on surfaceflnger.rc

Test: adb shell /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test
Test: adb shell stop surfaceflinger && adb shell start surfaceflinger
Bug: 147271477
Change-Id: I680509a385928a9c929d4fe4857118af219e2b13
2020-01-08 19:36:15 +00:00
Automerger Merge Worker
bb2dd8ea03 Merge "Revert "Fix drag and drop (2/3)"" into qt-qpr1-dev am: 8b19a05502
Change-Id: I67ec7ef546b5d0bdf954266687955ee8c5f94bf4
2019-12-19 10:45:29 +00:00
TreeHugger Robot
8b19a05502 Merge "Revert "Fix drag and drop (2/3)"" into qt-qpr1-dev 2019-12-19 07:49:32 +00:00
Automerger Merge Worker
2581ccb1a5 Merge "Enable deep press by default." into qt-qpr1-dev am: a785d00d11
Change-Id: I56a8506c8d3c5cae838f7970d0bd3cfea97ae10e
2019-12-11 03:46:26 +00:00
TreeHugger Robot
a785d00d11 Merge "Enable deep press by default." into qt-qpr1-dev 2019-12-11 03:32:45 +00:00
Automerger Merge Worker
63b30cc3cd Don't leak input events to dumpsys on user builds am: a70a3ff7f2 am: eabe916de6
Change-Id: If64ec8b23756e0e3250e2cbcfc379bacd37b6089
2019-12-10 23:12:02 +00:00
Automerger Merge Worker
eabe916de6 Don't leak input events to dumpsys on user builds am: a70a3ff7f2
Change-Id: Ief0bb64a99e0d602d27bb5a84b2b656f32726d3f
2019-12-10 22:55:27 +00:00
Philip Quinn
64f1c16f4e Enable deep press by default.
Bug: 140582282
Test: deep press events propagate on a clean F2 device

Change-Id: I4aa94b50d1619e614b8fa9b1d1518335007d0bc9
2019-12-09 12:10:44 -08:00
Arthur Hung
5845eafaad Revert "Fix drag and drop (2/3)"
This reverts commit fbe5d9c423.

Bug: 137819199
Test: manual
Change-Id: I7afec569519b9c69eb03225672db6db141b20241
Merged-In: I7afec569519b9c69eb03225672db6db141b20241
(cherry picked from commit 6cbb975915)
2019-12-09 09:35:18 +00:00
Ashwini Oruganti
a70a3ff7f2 Don't leak input events to dumpsys on user builds
Remove the details of KeyEvent and MotionEvent logs.
Bug: 139945049
Test: Tested on a device, the input functions work as expected and input
event logs are not leaked to dumpsys on user builds.

Change-Id: I98c9c375f18963177bf0c1d8829a217b4ad4acc6
Merged-In: I98c9c375f18963177bf0c1d8829a217b4ad4acc6
2019-12-06 18:24:12 +00:00
Ashwini Oruganti
1259252f26 Don't leak input events to dumpsys on user builds
Add a check for ro.debuggable in before adding the details of KeyEvent and MotionEvent to logs.

Bug: 139945049
Test: Tested on a device, the input functions work as expected and input
event logs are not leaked to dumpsys on user builds.

Change-Id: I98c9c375f18963177bf0c1d8829a217b4ad4acc6
Merged-In: I98c9c375f18963177bf0c1d8829a217b4ad4acc6
2019-12-05 13:58:56 -08:00
Inseob Kim
2c7032c8a9 Merge "Update SurfaceFlingerProperties scope" am: 945fa5c957
am: 4d15954900

Change-Id: Ide414d6187f75e6b37b3af15ce219a587792c370
2019-11-24 17:10:42 -08:00
Inseob Kim
4d15954900 Merge "Update SurfaceFlingerProperties scope"
am: 945fa5c957

Change-Id: I5223ee4a53b15abe13d62c6020bde4f275015e9c
2019-11-24 17:08:12 -08:00
Luca Stefani
45e529320d Update SurfaceFlingerProperties scope
System scope is deprecated

Test: manual, no build warnings
Change-Id: I2db77a7cea19b5d9e9393bc5709b60608d696023
2019-11-16 14:58:17 +01:00
Ady Abraham
6d6cfa493a SurfaceFlinger: lock mStateLock when modifying allowed configs
am: abf9106001

Change-Id: Id6ec56a597601d185324a52b5369d054bc57a151
2019-11-15 16:13:28 -08:00
Josh Gao
e83f01fef5 Merge "surfaceflinger: initialize ActiveConfigInfo fields." am: f4dca6bc7c
am: fbbbd1b3a7

Change-Id: I824261d38c69a6b9bf7d95e815a527202ff1867b
2019-11-15 14:29:30 -08:00
Josh Gao
fbbbd1b3a7 Merge "surfaceflinger: initialize ActiveConfigInfo fields."
am: f4dca6bc7c

Change-Id: Ibe6a054af026d5a4f0ec79538a7e7e28c9ce0499
2019-11-15 14:25:34 -08:00
Treehugger Robot
f4dca6bc7c Merge "surfaceflinger: initialize ActiveConfigInfo fields." 2019-11-15 22:05:28 +00:00
Ady Abraham
abf9106001 SurfaceFlinger: lock mStateLock when modifying allowed configs
mAllowedDisplayConfigs should be protected by mStateLock when changing
it from the main thread in setAllowedDisplayConfigsInternal() as it is
being read by Binder threads in getAllowedDisplayConfigs().

Test: call setAllowedDisplayConfigs() and getAllowedDisplayConfigs()
      from backdoor using different threads.
Bug: 142850581

Change-Id: I569e75968aea676c96fbc648140ac49a165ffb69
Merged-In: I569e75968aea676c96fbc648140ac49a165ffb69
2019-11-15 13:50:26 -08:00
Josh Gao
a052071b71 surfaceflinger: initialize ActiveConfigInfo fields.
Previously, the two ActiveConfigInfo fields in SurfaceFlinger are
uninitialized upon construction, and when run with debugging code that
slows down open, we reliably hit a case where setRefreshRateType is
called on an uninitialized RefreshRateType, leading to explosion.

Test: booted with libfdtrack
Change-Id: I14520775f8660fee6545d8a354a04ed3674a1597
2019-11-14 18:37:55 -08:00
Jorim Jaggi
630523fd32 Merge "[DO NOT MERGE] Log Winscope tracing with the frame composition time" am: 104972e936
am: 9d2bdf2535

Change-Id: I45264179707c527e49b9a5a00efc3ae121e055a7
2019-11-13 06:08:01 -08:00
Jorim Jaggi
9d2bdf2535 Merge "[DO NOT MERGE] Log Winscope tracing with the frame composition time"
am: 104972e936

Change-Id: I2f80936a8daffacf73363b6d338f27a16f30a3de
2019-11-13 04:09:18 -08:00
Nataniel Borges
c4def15ae3 [DO NOT MERGE] Log Winscope tracing with the frame composition time
Currently the tracing log takes the current timestamp for the log entry.
However, the tracing start after the frame is composed. On winscope
this result in the trace entry being linked to the incorrect video
frame (screenrecord). Now we obtain the frame composition time (before
the frame is send to the video recorder) and use this time for the log
entry.

Test: Log a SF trace and screen recording. Open both on winscope.
Change-Id: I81a88ef7a81a084f2ecf75bf5574a1118301a48e
2019-11-12 16:01:19 +01:00
Ady Abraham
64f8753ce9 Merge "SurfaceFlinger: prevent division by 0 in Layer::fillInputInfo" am: 19143968d7
am: 3206a42d84

Change-Id: I2a0463ee6bca3c0062b49bf808ca7cbb24349469
2019-11-06 10:27:46 -08:00
Nick Desaulniers
1b8476601f Merge "Revert "SurfaceFlinger: debug layer bounds inset"" am: bfe7d2873a
am: 6c437f1058

Change-Id: Ie6708e4907daefedfdf7e19c35555e254a2e13c6
2019-11-06 10:27:12 -08:00
Ady Abraham
3206a42d84 Merge "SurfaceFlinger: prevent division by 0 in Layer::fillInputInfo"
am: 19143968d7

Change-Id: I2744f279869623fe3c9d77972853179f13993fb5
2019-11-06 10:21:50 -08:00
Nick Desaulniers
6c437f1058 Merge "Revert "SurfaceFlinger: debug layer bounds inset""
am: bfe7d2873a

Change-Id: I2dfe076a5dcb0df4b2511a834414bd380b25ab5c
2019-11-06 10:21:24 -08:00
Ady Abraham
5b47bbc7da SurfaceFlinger: prevent division by 0 in Layer::fillInputInfo
Check if scale is 0 before trying to apply it on the window scale.

Bug: 137560795
Bug: 139945549
Test: Set Window Scale Animation to off from developer options menu
Change-Id: Id372d75de5787f62a9cce7c22699216e135bd0f6
Merged-in: I7ae84e2838b1562ff62cdd94484bedba954e1f33
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-05 15:50:19 -08:00
Ady Abraham
968fc9aa05 Revert "SurfaceFlinger: debug layer bounds inset"
Revert the debug patch as layer seems to ve valid.
Instead validate the input to avoid an overflow.

Bug: 137560795
Bug: 139945549
Test: boot

This reverts commit 38172ad8cf.
Merged-in: Ia1687bca84361dc8f665b9c0f893b8f40c5362e1
Change-Id: I07905d1e69b8c0a7dd23e620252fc7c133ed666e
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-05 15:50:03 -08:00
Xin Li
63b283ef48 DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
Bug: 142003500
Change-Id: Ib12000b6a4897169d6035cb6f41c225014524e6f
2019-10-30 11:49:17 -07:00