Commit graph

1331 commits

Author SHA1 Message Date
Sally Qi
784c253a05 Add cc_defaults as wrapper for graphics composer/common AIDL
interfaces.

- Add new Android.bp in graphics folder and wrap composer and common
  AIDL in to separate cc_defaults.
- remove composer3 dependency from allocator's VTS .bp file.

Bug: 243429120
Test: builds
Change-Id: Ia91e4ab87b7ac86248094317185b317d5604e654
2022-08-26 15:18:42 -07:00
JihCheng Chiu
d0dbe4ef03 fix segmentation fault of GraphicsComposerAidlCommandTest
When we run the VTS of GraphicsComposerAidlCommandTest, we always meet
segmentation fault issue in some test items. VTS test items crashed
when it deleted the layer or display from resource manager and try to
go next loop.
The problem is the test item try to delete the layer iterator or
display iterator in the loop, so the iterator become an invalid
iterator. Then it try to use the invalid iterator for going to next
iterator. This behavior caused segmentation fault. We use different
way to fix deleting layer and deleting display.
Delete layer: Test item always delete all layer for each display, so
              we always delete layer via get the first iterator until
              the resource manager is empty.
Delete display: Test item only delete virtual display, so we move the
                physical display to a temporary map. After delete all
                virtual display, we swap the temporary map and
                original map.

Bug: 243781450
Test: 1. test GraphicsComposerAidlCommandTest.SetLayerColorTransform
         for deleting layer
      2. test GraphicsComposerAidlCommandTest.SetOutputBuffer
         for deleting disply

Change-Id: Id467df658e78ed29fdfc039cabc119f8bf62d69d
2022-08-26 02:11:23 +00:00
JihCheng Chiu
10750526a6 fix segmentation fault of GraphicsComposerAidlCommandTest
When we run the VTS of GraphicsComposerAidlCommandTest, we always meet
segmentation fault issue in some test items. VTS test items crashed
when it deleted the layer or display from resource manager and try to
go next loop.
The problem is the test item try to delete the layer iterator or
display iterator in the loop, so the iterator become an invalid
iterator. Then it try to use the invalid iterator for going to next
iterator. This behavior caused segmentation fault. We use different
way to fix deleting layer and deleting display.
Delete layer: Test item always delete all layer for each display, so
              we always delete layer via get the first iterator until
              the resource manager is empty.
Delete display: Test item only delete virtual display, so we move the
                physical display to a temporary map. After delete all
                virtual display, we swap the temporary map and
                original map.

Bug: 243781450
Test: 1. test GraphicsComposerAidlCommandTest.SetLayerColorTransform
         for deleting layer
      2. test GraphicsComposerAidlCommandTest.SetOutputBuffer
         for deleting disply

Change-Id: Id467df658e78ed29fdfc039cabc119f8bf62d69d
2022-08-25 12:21:47 +00:00
Patrick Williams
dd5c696ca4 Merge "Replace RenderEngineResult with FenceResult" 2022-08-25 10:23:12 +00:00
Treehugger Robot
e9d562dac1 Merge "[Bluetooth apex] Use new apex name" am: 2412da0826 am: a326b313f7 am: 67d8a557e8 am: 606f24d35a am: 24465662af
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2192236

Change-Id: I8a35425fdecb6b17449008b7a08bf4bdc2080daf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-25 05:50:37 +00:00
Patrick Williams
af78e0ad80 Replace RenderEngineResult with FenceResult
Bug: b/232535621
Test: refactor, existing tests pass

Change-Id: I86fe498246e45d199a47008a3fb90af3030e83d6
2022-08-24 20:00:40 +00:00
William Escande
2591c3d0cf [Bluetooth apex] Use new apex name
The Bluetooth apex name is now called com.android.btservices

Bug: 243054261
Test: Build
Change-Id: Ib63646722cbef948b5198fc5f2a9b5ac2ca52ae3
2022-08-22 11:27:58 -07:00
Leon Scroggins III
6413bce9c8 Remove references to IComposer.createDisplay
This method does not exist.

Bug: NA
Test: documentation-only change
Change-Id: I3e5d138ec7cff46178212b82f982718836d479d6
2022-08-11 14:15:10 -04:00
Xin Li
035ee7b933 DO NOT MERGE - Merge TP1A.220624.013
Merged-In: I25e8f827645db8e83c8c3142f5e76a912fdf7b22
Change-Id: Iabfc2e451749cbfe858e7bca6492565bf020d878
2022-07-11 21:47:42 -07:00
Midas Chien
8c75b834f4 composer: vts: configure layer for DisplayDecoration
Some HW may not support crop function for decoration and current API
can't query this capability. Configure decoration layer to full screen
to avoid this limitation.

Bug: 225765061
Test: VtsHalGraphicsComposer3_TargetTest
--gtest_filter=*DisplayDecoration*

Change-Id: If47154adf9d48f9c1b8390b4bee090d8bf40ff3b
(cherry picked from commit 7d55d4269d)
Merged-In: If47154adf9d48f9c1b8390b4bee090d8bf40ff3b
(cherry picked from commit 308f4ac906)
Merged-In: If47154adf9d48f9c1b8390b4bee090d8bf40ff3b
2022-06-29 00:03:45 +00:00
Midas Chien
828d6c9f1a Merge "composer: vts: configure layer for DisplayDecoration" into tm-d1-dev am: 3ebbea4dc2 am: 2d56dcb7ae am: 95816049ba
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18743615

Change-Id: Ia0ef13f06b2dc813aebdbc445875c3f8faeddbbe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 10:36:23 +00:00
Midas Chien
95816049ba Merge "composer: vts: configure layer for DisplayDecoration" into tm-d1-dev am: 3ebbea4dc2 am: 2d56dcb7ae
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18743615

Change-Id: I7858508c343348dd455c1c3fe40d205824b30b48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 08:18:12 +00:00
Midas Chien
3ebbea4dc2 Merge "composer: vts: configure layer for DisplayDecoration" into tm-d1-dev 2022-06-09 07:27:42 +00:00
Ram Indani
7a6d2f9d88 Merge "[VTS] Update allocator name for AIDL allocator." into tm-dev am: 82b65f9e42 am: 588b928a12 am: a1fe4c4667
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18739824

Change-Id: Id02748ca94a67578f7f32749cfc0928a96927c6c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 18:33:53 +00:00
Ram Indani
c9e107abc0 Merge "[VTS] Update allocator name for AIDL allocator." into tm-dev am: 82b65f9e42 am: 6925ef0109
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18739824

Change-Id: I089e6ef660ee09e0544bc93fae7edd397d134cdc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 18:25:25 +00:00
Ram Indani
3171473723 Merge "[VTS] Update allocator name for AIDL allocator." into tm-dev am: 82b65f9e42
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18739824

Change-Id: I5650d21dbca7fd050c2d37d9d057566783c4c823
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 17:56:11 +00:00
ramindani
b2b747ffd4 [VTS] Update allocator name for AIDL allocator.
We used "default" value for the allocator in the test
and this value was used as is for the AIDL allocator.
This caused the test to fail because we were not able to acquire the
appropriate allocator as AIDL allocator instance is not named "default".
Update the test to use the correct instance name for AIDL allocator,
if available.

Test: atest VtsHalGraphicsComposerV2_1TargetTest
atest VtsHalGraphicsComposerV2_2TargetTest
atest VtsHalGraphicsComposerV2_3TargetTest
atest VtsHalGraphicsComposerV2_4TargetTest
atest VtsHalGraphicsComposer3_TargetTest
BUG: 234671596

test results after updates:
VTS 2.1 : http://ab/I84600010058657636
VTS 2.2 : http://ab/I51800010058498973
VTS 2.3 : http://ab/I87700010058914863
VTS 2.4 : http://ab/I88900010058592031
VTS 3.0 : http://ab/I96200010058838905

Change-Id: I04ae1a18d757cfd941d4929ad08f6bb2c8643f76
2022-06-07 23:33:12 +00:00
Midas Chien
7d55d4269d composer: vts: configure layer for DisplayDecoration
Some HW may not support crop function for decoration and current API
can't query this capability. Configure decoration layer to full screen
to avoid this limitation.

Bug: 225765061
Test: VtsHalGraphicsComposer3_TargetTest
--gtest_filter=*DisplayDecoration*

Change-Id: If47154adf9d48f9c1b8390b4bee090d8bf40ff3b
2022-06-07 02:32:28 +08:00
Ankit Goyal
0eeae418e5 Skip front buffer test if not supported am: 694e50be3b am: ae326b25e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18625486

Change-Id: I59d9a8781db0eead2373d94b34775ccc9b5e6d25
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 17:57:17 +00:00
Ankit Goyal
bfe357e278 Do not generate failed status on allocation failure am: 72415bcfa3 am: ab5a980cf8
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18625205

Change-Id: Iafd661610fe87d07c539a066a5a472aac034aeec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 17:57:15 +00:00
Ankit Goyal
8cd0e2a5cf Skip front buffer test if not supported am: 694e50be3b
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18625486

Change-Id: I13e5450ad3eb39f7297d4293a80604cfbc66329b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 17:28:54 +00:00
Ankit Goyal
7d0e96cd20 Do not generate failed status on allocation failure am: 72415bcfa3
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18625205

Change-Id: If0381068c6dd6c3197c5682251cda36627f42a7a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-27 17:28:53 +00:00
Ankit Goyal
694e50be3b Skip front buffer test if not supported
Bug: 218383959
Test: this
Change-Id: I61beba63556c1d6a32e220fffd8e4b4fdfd8bd94
2022-05-26 17:04:18 -07:00
Ankit Goyal
72415bcfa3 Do not generate failed status on allocation failure
Bug: 218383959
Test: this
Change-Id: Ibb37d9cad8004d31c3d7cb75ebfa7839f7d07ed0
2022-05-26 17:04:12 -07:00
TreeHugger Robot
18a34f56e6 Merge "Tweak IMapper 4.0 VTS to run with AIDL IAllocator" into tm-dev am: 412f907bd3 am: 95e8192c18 am: ecb0f49a2e am: aa09708235
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18418692

Change-Id: Ibff4c61b29a748a3381773fec283a98a31f9296f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 06:00:38 +00:00
TreeHugger Robot
ecb0f49a2e Merge "Tweak IMapper 4.0 VTS to run with AIDL IAllocator" into tm-dev am: 412f907bd3 am: 95e8192c18
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18418692

Change-Id: I46d49f0c59e7318c1154d891e379487e6114161d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 22:59:23 +00:00
TreeHugger Robot
0971537d4e Merge "Tweak IMapper 4.0 VTS to run with AIDL IAllocator" into tm-dev am: 412f907bd3
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18418692

Change-Id: Ic6798f01c122a09543e130027fb2ca0157cc95c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 22:39:52 +00:00
Alec Mouri
38ccfd7a29 Tweak IMapper 4.0 VTS to run with AIDL IAllocator
When there is no HIDL IAllocator installed on the device, then these
tests must still run.

Bug: 231982605
Test: VtsHalGraphicsMapperV4_0TargetTest
Change-Id: If7503d398c03086df470971cc2c10029270525f9
2022-05-23 18:38:37 +00:00
Alec Mouri
6338241c1f Merge "Update Mapper4 SetBadMetadata VTS test for optional metadata" into tm-dev am: 325d853148 am: c6f3b7c33d
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18327687

Change-Id: I1d3851336de9c81b0d65304e0a17fe4905e0e0cf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 19:22:33 +00:00
Alec Mouri
a8d0222e33 Merge "Update Mapper4 SetBadMetadata VTS test for optional metadata" into tm-dev am: 325d853148
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/18327687

Change-Id: Ie25d8a8549dcc07be8d81ac30ad9500b8bad4422
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 17:56:13 +00:00
Jason Macnak
895d411403 Update Mapper4 SetBadMetadata VTS test for optional metadata
The common decode function for optional gralloc4 metadata
`android::gralloc4::decodeOptionalMetadata()` treats an empty
input `hidl_vec<uint8_t>` as `std::nullopt` and not a bad
value. aosp/1907915 previously tried to update the encoding
and decoding of optional metadata in order to distinguish
this case but the change broke GRF. Instead, let's update the
SetBadMetadata test to use some actual incorrect data for the
optional metadata tests instead of an empty vec.

Bug: b/207388558
Test: cvd start
Test: VtsHalGraphicsMapperV4_0TargetTest
Change-Id: I87c20930cb701e87c89489bd0359cce0522cfe44
2022-05-11 22:25:28 +00:00
Alix Espino
eb5a9e90d9 Merge changes I07c0f96d,I8734474f am: 5440b3663c am: a629baedb9 am: bc8a276ddd am: c10a62aa59 am: ebe3a86f35
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2066561

Change-Id: I6dfea47741807cd375f6fdc0cb14f7f52e057715
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 03:00:27 +00:00
Alix Espino
bc8a276ddd Merge changes I07c0f96d,I8734474f am: 5440b3663c am: a629baedb9
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2066561

Change-Id: I6f6cd5818d27f6e5bca6aa6d4ebeb9e1ac3b3cfc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-10 23:51:42 +00:00
Kriti Dang
4efe8608f7 Vts test for verifying that there are no duplicates in getDisplayconfigs
Test: atest VtsHalGraphicsComposer3_TargetTest
Test: atest VtsHalGraphicsComposerV2_4TargetTest
Bug: 176086656
Change-Id: I51dd4774b3c990e6db2cb9ee71d14f74dc3effb0
2022-05-06 07:45:19 +00:00
Jiyong Park
9264d3f783 Finalize android.hardware.graphics.common-V3
For some unknown reason, the Android.bp file was not updated when
freezeing the V3 of android.hardware.graphics.common interface. Fixing
it manually.

Bug: 230660133
Test: `m nothing` with https://googleplex-android-review.git.corp.google.com/q/topic:Tiramisu-SDK-Finalization-rel
Change-Id: I4bf6548e1200864810bcf8a7c1025ba56d48747b
2022-04-28 08:07:53 +09:00
Alix
ea13312de0 Deleted clang property in Android.bp files
Deleted deprecated clang property in Android.bp files using bpmodify.

Bug: 208980553
Test: treehugger
Change-Id: I07c0f96d07ad39dfedfc7ede275b7794c58bf2d2
2022-04-25 21:00:34 +00:00
Alix
3ce97170b1 autogenerated reformatting by bpfmt
Bug: 208980553
Test: treehugger
Change-Id: I8734474f4e75bcf808701bcbc747bc53c64907cc
2022-04-25 20:58:57 +00:00
ramindani
d575109c1e Check Exception Code for Service specific error
Before checking the service specific error
we need to check that getExceptionCode returns
EX_SERVICE_SPECIFIC error code. Added a method and
used that to do the two checks together for exceptionCode
and for the service specific error code, so that we don't
repeat two lines in all the tests that need them.

EXPECT_NO_FATAL_FAILURES print the correct line number of the test
or iteration of the test when used with helper functions, and
testing guidelines recommend it too here: go/gunitadvanced#propagating-fatal-failures

Test: atest VtsHalGraphicsComposer3_TargetTest
BUG: 205152739
Change-Id: I1d3c3aa9b34dcefb14be507ff61b73b6f08a5204
2022-04-25 20:44:04 +00:00
ramindani
c7585d9dc4 Set isOpaque For BlendMode::None
Test: atest VtsHalGraphicsComposer3_TargetTest
BUG: 216205298
BUG: 219576457

Change-Id: I479d8367e5abf8893b94ac64b7149a2f0e4cf75b
2022-04-22 16:25:39 +00:00
Jiyong Park
18ba537008 Merge changes from topic "aidl_freeze_tm" into tm-dev
* changes:
  V1 is the latest version of android.media.audio.common.types
  Freeze AIDL APIs for TM
2022-04-20 15:55:20 +00:00
TreeHugger Robot
bce81ecc1e Merge "Move ComposerServiceWriter to composer3." into tm-dev 2022-04-19 21:32:21 +00:00
Jiyong Park
70f5837e1f Freeze AIDL APIs for TM
Bug: 225941299
Test: m
Change-Id: I61eb51c0334eb99489c6f1570110d7e18c350c99
2022-04-16 07:03:24 +09:00
Alec Mouri
da91f729c1 Merge "Send brightness nits to composer" into tm-dev 2022-04-11 16:28:58 +00:00
Rachel Lee
d69c54a4e1 Move ComposerServiceWriter to composer3.
It can be reused more easily.

Bug: 216204575
Test: m; flashall
Change-Id: I76b8533ba16ad1d01fcd182bf72b65982dce7c20
2022-04-08 16:09:32 -07:00
Alec Mouri
18339992dd Allow old gralloc implementations to skip P010 support.
P010 is mandated for vendor versions that are at least api level 33.
Gralloc versions below this may not support P010 due to lack of
enforcement, but tests for already-shipping devices must still pass.

Bug: 220360702
Test: VtsHalGraphicsMapperV3_0TargetTest
Change-Id: I7ba268713bada133491813aa3c9bd87fdecd2fef
2022-04-06 19:00:23 +00:00
TreeHugger Robot
486839fdef Merge "Update renderengine dependency to VTS" into tm-dev 2022-04-02 07:47:52 +00:00
Jiyong Park
7faedf81a0 Merge changes from topic "aidl_freeze_tm" into tm-dev
* changes:
  Implement getInterfaceHash/Version for SoundTrigger
  Add -Wno-missing-permission-annotation for soundtrigger3
  V3 is the latest version of keymaster HAL interface
  Freeze AIDL APIs for TM
2022-04-02 00:15:20 +00:00
John Reck
ddd4329e61 Add a few tests that FRONT_BUFFER is flushing properly
Test: this
Bug: 217776226
Change-Id: I49e32391620e005700d39539ca47da64199067a0
2022-03-31 15:50:14 -04:00
Jiyong Park
703e97920e Freeze AIDL APIs for TM
Bug: 225941299
Test: m
Change-Id: Ie41cc0797710f813f92c65c387f247c7806d8394
2022-03-31 12:01:39 +09:00
Alec Mouri
55f76ca7af Update renderengine dependency to VTS
Bug: 218954037
Test: builds
Change-Id: I31f8a8764fa66a9aec4762354c425ba1442ef351
Merged-In: I31f8a8764fa66a9aec4762354c425ba1442ef351
2022-03-31 01:16:14 +00:00
Alec Mouri
03b6daac4a Send brightness nits to composer
Bug: 220396224
Test: builds, boots
Change-Id: I6866422130776ae25d791b3cfd0d1a754d2488b9
2022-03-31 01:12:34 +00:00
Alec Mouri
d48a5a9829 Clarify documentation for the dimming stage.
Plumbing this enum to RenderEngine requires knowledge of the intended
transfer function to apply the dimming stage in. Because this is
expected to be a contrained use-case and because apis are frozen,
document that RenderEngine is allowed to assume that the resulting
dimming matrix may be gamma corrected using a 2.2 power function.

Bug: 218954037
Test: builds
Change-Id: Ie7d357f8ce79295af017d80c62a2759dbccce5d2
2022-03-24 15:54:05 +00:00
Ram Indani
4f7f81c855 Merge "[HWC3.0] Add capability BOOT_DISPLAY_CONFIG" into tm-dev 2022-03-18 19:04:40 +00:00
ramindani
476314cc54 [HWC3.0] Add capability BOOT_DISPLAY_CONFIG
This Capabiliy::BOOT_DISPLAY_CONFIG will make
the display boot display config optional on the HWC3.0

BUG: 216113429
Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I3be3383922fdd91e0bbccebd3c73e458753b749f
2022-03-16 18:43:15 +00:00
TreeHugger Robot
4e102c0854 Merge "Clear apex.go entries for bluetooth libs" into tm-dev 2022-03-15 00:58:00 +00:00
Ady Abraham
261db780b4 composer: minor documentation fix
Bug: NA
Change-Id: I167f6a1224ceed48723f3af15a07d71fbde168cc
Test: NA
2022-03-08 23:22:37 +00:00
William Escande
d9d513fd47 Clear apex.go entries for bluetooth libs
Test: Build + TH + boot phone & use bluetooth
Bug: 216433795
Change-Id: Ib1f9fee90006c73e5726a208e6cba8647967f5f4
2022-03-02 20:27:06 +01:00
ramindani
a4e7636e62 Vts BlendMode tests skip for UNSUPPORTED ColorMode
BUG: 221887749
Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I6c0a35c64883333c70451c717f50cb84d85ce994
2022-03-02 04:14:18 +00:00
ramindani
44c952f69c Vts readback status check fixes
When we query for the getReadbackBufferAttributes
we can get EX_UNSUPPORTED error when not supported
and when this happens readback should not be supported.
EXPECT_TRUE for this failure case
was causing the test to fail when we received an EX_UNSUPPORTED
 for this.
See for documentation: https://source.corp.google.com/android/hardware/interfaces/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl;rcl=e1f0950945f687ed374a45911e2d7786de724ca4;l=436

BUG: 221889462
Test: atest VtsHalGraphicsComposer3_TargetTest
Test link for the cf_x86_64_phone-userdebug  http://ab/I39800010022763398
All the other test failures are tracked else where.

Change-Id: Idf352761c5cc808540edfe2042c5ee4602b5e96b
2022-03-01 01:18:53 +00:00
Leon Scroggins III
68b9acc4fe DisplayDecoration VTS: remove expected changed composition types
If validateDisplay returns an error, changed composition types are not
propagated back to the caller. Remove the expectation that they will be.

Fixes: 221406264
Test: this
Change-Id: I3e07e40b0c12a2cf6eaa685435647aab93172bb0
2022-02-25 13:17:10 -05:00
TreeHugger Robot
a123e7688d Merge "Actually add DimmingStage to client target properties" into tm-dev 2022-02-24 22:51:17 +00:00
Leon Scroggins
5298f2c0e2 Merge "getDisplayDecorationSupport: expect IComposerClient::EX_UNSUPPORTED" into tm-dev 2022-02-24 21:27:42 +00:00
Alec Mouri
88e871b663 Actually add DimmingStage to client target properties
This change was missed while cherry-picking
I5675c16f0895f9958e3bee3ee4c85df8937ecdb7 due to merge conflicts.
So...actually merge this.

Bug: 218954037
Test: builds
Change-Id: Idb3a518f7dfd4f4fd598672ee709ccd5b1f3f06a
2022-02-24 12:18:37 -08:00
Jason Macnak
194a26f53d Merge "Minor spelling fix" into tm-dev 2022-02-24 18:16:50 +00:00
Leon Scroggins III
6455e797c6 getDisplayDecorationSupport: expect IComposerClient::EX_UNSUPPORTED
This is the error returned by cuttlefish, not EX_UNSUPPORTED_OPERATION.
This also matches other tests, e.g. SetDisplayBrightness.

Bug: 209458568
Test: this
Change-Id: I885767c4f1c42edfb11359b36852a863cbc8b0ed
2022-02-24 12:21:11 -05:00
TreeHugger Robot
b4fa6d0138 Merge "Update the test directory structure" into tm-dev 2022-02-24 04:53:07 +00:00
TreeHugger Robot
6f62c70f4f Merge "Add composer API changes in accordance to partner feedback" into tm-dev 2022-02-24 04:41:53 +00:00
Alec Mouri
ca18b9661b Merge "Remove concept of nits from the client target properties" into tm-dev 2022-02-24 01:48:53 +00:00
Alec Mouri
8ff184b518 Add composer API changes in accordance to partner feedback
* Add a DimmingStage to the client target configuration reported by HWC,
  which may be used for some vendor color modes to configure when
  dimming should occur during client composition
* Communicate the display brightness in nits, so that HWC
  implementations do not need to parse the per-display xml to map from
  display brightness to nits. Furthermore, this is more plausible for
  extensibility for external displays.

Bug: 220396224
Bug: 218954037
Test: builds
Change-Id: I5675c16f0895f9958e3bee3ee4c85df8937ecdb7
2022-02-24 01:45:41 +00:00
Chih-hung Hsieh
34593d4e2a Merge "Add timed out test files to tidy_timeout_srcs" am: ff54f73b4f am: fa83970b3a am: 581616e658
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1992232

Change-Id: I2eac13fe3b5ab0b4f15d6ceadf376e5e74124a81
2022-02-24 01:32:09 +00:00
Alec Mouri
bf0bbc2db0 Remove concept of nits from the client target properties
An earlier patch replaced white point nits with a per-layer brightness.
This patch does the same for providing the brightness space of the
client target relative to the display brightness.

Bug: 217961164
Test: builds, boots
Change-Id: I1be65f7c511fefa239305e0735637126a1cd6622
Merged-In: I1be65f7c511fefa239305e0735637126a1cd6622
2022-02-23 23:04:55 +00:00
ramindani
458e53e889 Update the test directory structure
vts is moved from aidl/android/ to aidl/vts
functional, include & composer-vts directory is removed as well.

BUG: 220171967
Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I6cafbbd99374308a1cc06e27cc590e70618f7075
2022-02-23 22:33:25 +00:00
Jason Macnak
6ee0f75051 Minor spelling fix
Change-Id: Ibcad1d80e09ff547c2935bbc362809431a4c3f14
2022-02-23 21:12:36 +00:00
TreeHugger Robot
a0fb8acaa5 Merge "getDisplayDecorationSupport test: allow errors" into tm-dev 2022-02-23 17:31:08 +00:00
Leon Scroggins III
915908797a getDisplayDecorationSupport test: allow errors
Allow getDisplayDecorationSupport to return an error, and treat that as
unsupported. This allows Cuttlefish, which, with
I91105fc3345dbd75aeb0b102f3f0138fa33120c0, returns Unsupported, to pass
the test.

Bug: 209458568
Test: this
Change-Id: I8e17d3c0ca0ac4eacb0b5e4c8ae540f271e68a23
2022-02-23 09:51:21 -05:00
Ady Abraham
89d7270dcd composer: remove IComposer.dumpDebugInfo
aidl already have a dump funciton, so there is no need to
expose a custom dumpDebugInfo from IComposer.

Bug: 220171623
Test: atest VtsHalGraphicsComposer3_TargetTest
Test: adb shell dumpsys SurfaceFlinger
Test: adb shell dumpsys android.hardware.graphics.composer3.IComposer/default
Change-Id: I5036193c06ba9fdd8aa5f79cd756541d9edc146c
2022-02-22 02:54:41 +00:00
Chih-Hung Hsieh
ad1bf31b78 Add timed out test files to tidy_timeout_srcs
* Timed out runs do not show any warning messages.
* These test files cannot finish clang-tidy runs with
  the following settings:
    TIDY_TIMEOUT=90
    WITH_TIDY=1
    CLANG_ANALYZER_CHECKS=1
* When TIDY_TIMEOUT is set, in Android continuous builds,
  tidy_timeout_srcs files will not be compiled by clang-tidy.
  When developers build locally without TIDY_TIMEOUT,
  tidy_timeout_srcs files will be compiled.
* Some of these test modules may be split into smaller ones,
  or disable some time consuming checks, and then
  enable clang-tidy to run within limited time.

Bug: 201099167
Test: make droid tidy-hardware-interfaces_subset
Change-Id: I1de28f1572fff368f67eab512fffec9f2e5c2a9b
2022-02-18 17:25:41 -08:00
TreeHugger Robot
b62a39242b Merge "Add a VTS test for DISPLAY_DECORATION" 2022-02-17 18:00:19 +00:00
TreeHugger Robot
412fd617fb Merge "Add isSupportedNoFailure and call in IsSupportedR8" 2022-02-17 15:15:17 +00:00
Leon Scroggins III
cd5e469831 Add isSupportedNoFailure and call in IsSupportedR8
The upper layers will treat this failure as a lack of support, so make
the test do the same. This allows the test to pass on flame.

Bug: 219606432
Test: atest VtsHalGraphicsMapperV4_0TargetTest
Change-Id: I57eab60de81989cae59baa8c25b53a1c94229187
2022-02-17 08:54:43 -05:00
Leon Scroggins III
de0575882c Add a VTS test for DISPLAY_DECORATION
Check for support via getDisplayDecorationSupport. If it is supported,
verify that we can allocate a buffer of the correct format and that
Composition.DISPLAY_DECORATION can be used without error. If it's not
supported, expect an error of EX_UNSUPPORTED_OPERATION.

Bug: 209458568
Fixes: 209458568
Test: atest VtsHalGraphicsComposer3_TargetTest (this)
Change-Id: I0a62a0ce3f8fd3a2d6088f94ce1ad0840d9c6faa
2022-02-17 08:36:04 -05:00
Ram Indani
2d22f84671 Merge "[VTS] Removes wait on buffer fence" 2022-02-16 19:00:35 +00:00
Ram Indani
8af9317f42 Merge "[VTS] BlendMode::Coverage test" 2022-02-16 19:00:13 +00:00
ramindani
58ced4f54e [VTS] Removes wait on buffer fence
When we have a fence created with GraphicBuffer
We don't need to wait on it in VTS tests,
the composer should be able to handle the
 fence in this case

BUG: 219589185

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I688d695bb562dd1fe86cdceb642e746cbafe8b30
2022-02-16 18:58:14 +00:00
ramindani
07e6f8499b [VTS] BlendMode::Coverage test
Enable BlendMode::Coverage test.
Test pass: BlendMode/GraphicsBlendModeCompositionTest#Premultiplied/0: PASSED (930ms)
BlendMode/GraphicsBlendModeCompositionTest#Premultiplied/1: PASSED (933ms)

BUG: 219737571

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I5f5bbf371c26933457eec0f3710d47ddadd06cdb
2022-02-16 18:58:14 +00:00
Ram Indani
170bcb8e69 Merge "Use Vector instead of unordered_map for hotplug displays" 2022-02-16 18:56:28 +00:00
Ram Indani
acd5739fd1 Merge "BlendMode VTS tests" 2022-02-16 18:56:13 +00:00
ramindani
7ce70fea34 Use Vector instead of unordered_map for hotplug displays
For multi-display order of the hotplug matters, and vector
maintains the order that we need for the multi-display.
see: ag/1921760 for partner cl on HIDL.

BUG: 210920960
BUG: 209409863

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I4f9a86413f20c860fc0bc3850a14335d62de881a
2022-02-15 15:13:02 +00:00
ramindani
b636af2820 BlendMode VTS tests
BlendMode::Coverage and BlendMode::Premultiplied test fix

HIDL only worked on SRGB for this test and
as HIDL this also passes just the Coverage and Premultiplied
with the colorMode SRGB
see: https://source.corp.google.com/android/hardware/interfaces/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp;rcl=ddbbf784a80979fd0b2d926a1e3cdb68d0a49b61;l=938

BUG: 216172840

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: Iec16fc112d3ab6ee37e55ca9f3fa760a439e52eb
2022-02-15 15:13:02 +00:00
TreeHugger Robot
690a98e945 Merge "Provide dimming ratio instead of white point nits in composer" 2022-02-15 04:58:06 +00:00
ramindani
b1144219bf ClientComposition test fix
Client composition test was broken because there was a buffer
created at the test creation and this is not how
this test works for client composition trigger.
And for the fence that was used is different from what it
needs previously fence was acquired through gralloc but now
it's internal to the Graphic Buffer and we no longer
have to  wait for the fence to signal it's taken care
by the graphicBuffer->unlock call, the unlock call waits
for us.
See for unlock https://source.corp.google.com/android/frameworks/native/libs/ui/GraphicBufferMapper.cpp;rcl=HEAD;l=139

BUG: 216170021

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I8fa25d8910a4e2b1df2f0e2270445a658e3b1a39
2022-02-14 21:34:58 +00:00
ramindani
0a2bee4eba Clean up the GraphicBuffer.
HIDL tests don't have any buffer created when test execution starts and with GraphicBuffer that wasn't the case.
We only initialize the buffer when required the way gralloc implementation did.

BUG: 199413815

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I3aeec5b00e30e636de2e58cf7e6ced5539ae19b6
2022-02-14 21:33:08 +00:00
Alec Mouri
b1f16725cc Provide dimming ratio instead of white point nits in composer
There are several reasons for limiting the notion of white point nits in
the composer interface:

1. Some KMS apis exposed by drivers only expose a notion of a per-plane
   brightness. While these are non-mobile drivers, e.g., nouveau, this
   does indicate that white point is not directly going to be understood
   by typical hardware
2. Changing the brightness without requiring a frame update introduces
   implicit state in composer. If the brightness and white point nits
   for a set of SDR layers are 200 nits, and the brightness changes to
   205 nits to respond to ambient conditions, then composer must not dim
   the layers, and in fact DisplayManager will tell SurfaceFlinger that
   the SDR white point will be 205 nits. But SurfaceFlinger will not
   tell composer that the SDR white point changed as that would
   otherwise introduce a re-composition cycle, meaning that
   HW Composer must track somehow that the layer white point changed
   without a corresponding change on the layer data structure, which is
   confusing.
3. It's poorly defined what the dimming ratio should be if
   SurfaceFlinger provides the following inputs: Layer A has a white
   point of 200 nits, Layer B has a white point of 400 nits, and display
   brightness is 300 nits. Current implementations may clamp the
   brightness of Layer B to be 300 nits and dim layer A by 2/3s, but
   there is an equally valid interpretation which is just dim Layer A to
   be 50% of Layer B's brightness.
4. The problem indicated by (2) and (3) suggests that layer white point is
   really an up-stack concept, that SurfaceFlinger can be aware of for
   properly computing the dimming ratios it can send to composer, but
   the composer hal shouldn't really be speaking in terms of nits.

Note that this patch does not yet change the interface for
ClientTargetWithNits, which may be done in a follow-up patch.

Bug: 217961164
Test: builds, boots
Change-Id: I4a1b4e8c300d22599a5683bd44b7b8afa9a29425
2022-02-10 15:14:51 -08:00
Leon Scroggins
3ea6e39979 Merge "Add a more detailed HAL for DISPLAY_DECORATION" 2022-02-10 11:56:31 +00:00
TreeHugger Robot
f3eadf62a2 Merge "Assure width and height are always initialized" 2022-02-10 08:21:27 +00:00
TreeHugger Robot
6cf6df7c4d Merge "Add explicit apex_available clauses" 2022-02-10 05:55:41 +00:00
Ray Essick
d1374e051c Add explicit apex_available clauses
add apex_available clauses to interfaces which were being allowed
by list stored within the apex toools

Bug: 215589022
Test: build
Change-Id: Iaf5d1b80e6b35f765d6b7a59ce7f28d4fa5098a4
2022-02-09 09:28:53 -08:00
Greg Kaiser
c20d70e09f Assure width and height are always initialized
In case a user fails to call setDimensions() prior to several
other methods on this class, we at least want to have consistent
behavior that's easy to debug.

Test: TreeHugger
BUG: 199413815
Change-Id: Iee7681ed855cf6ebf9e436e0d2864e0fc9cb4025
2022-02-09 07:11:33 -08:00
Ady Abraham
fac5544455 Revert "composer: adds BufferAhead for the LayerCommand.aidl"
This reverts commit d40304b574.

Reason for revert: Punting hal changes to future release

Change-Id: I0980ac2d36962998472f46ece93f88f28fac4232
2022-02-08 19:03:44 -08:00
Ram Indani
97c3ab2554 Merge changes from topic "vts-composerclient-wrapper"
* changes:
  Remove test `GetDisplayAttributeConfigsInAGroupDifferOnlyByVsyncPeriod`
  Use Wrapper in the readback tests.
  Use VtsComposerClient in Base test
  IComposerClient wrapper for VTS tests
2022-02-08 23:28:07 +00:00
ramindani
8bb4ce13a2 Remove test GetDisplayAttributeConfigsInAGroupDifferOnlyByVsyncPeriod
The test is removed from aosp so won't be required in HWC3.0

BUG: 200184776

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I21f0ccf94d1d92a730a41b579bf111fa0553f609
2022-02-08 19:44:07 +00:00
ramindani
dcecfd46a1 Use Wrapper in the readback tests.
BUG: 199413815

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I3a7e81f8c04971b178ae703a3eb83de50ae0810f
2022-02-08 19:44:06 +00:00
ramindani
431aad4a65 Use VtsComposerClient in Base test
Makes corrections to the code such as checking EXPECT_TRUE, ASSERT_TRUE in certain cases, test name corrections, consolidate layer configurations.
See comments in ag/16465080 for change refrences.

BUG: 199413815
Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I73c4621d8c525fdfbcd301d78a1ad97c142b2864
2022-02-08 19:44:06 +00:00
ramindani
edf3ef9f93 IComposerClient wrapper for VTS tests
A wrapper helps with implementation details of IComposerClient and
improves re-usability with readback and base tests.

Changes from the original wrapper (ag/16578214):

Changed the createClient to return ScopedAStatus
as it helps more with the singleton test.
And updated getDisplays to go through all the configurations
and save it in the DisplayResources as we use
the properties like width, height, vsync later
in the test and we avoid querying to the composerClient for this.

With readback tests updated setReadbackBuffer method to use
const native_handle_t* buffer instead of const native_handle* buffer

BUG: 199413815

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: Ia33c9489bf15a52edcae55a91ec56666df3726c1
2022-02-08 19:32:11 +00:00
Leon Scroggins
dd2ad3c55c Merge "Add a Java backend for android.hardware.graphics.common AIDL" 2022-02-07 19:10:17 +00:00
John Reck
09028a0872 Merge "Address ANAPIC feedback" 2022-02-07 18:18:07 +00:00
Leon Scroggins III
e5c038e9ef Add a more detailed HAL for DISPLAY_DECORATION
Different hardware may prefer different formats for DISPLAY_DECORATION
layers. Add a new struct with two enums: one for the format, and one for
how to interpret the alpha. These two properties are orthogonal.

Add IComposerClient.getDisplayDecorationSupport for retrieving the
struct. I0c2fbc78cf5e4e97cede4762699a1ecc98620919 demonstrates a sample
implementation.

Remove the DisplayCapability.DISPLAY_DECORATION, which is replaced by
this.

Bug: 216644902
Test: manual
Change-Id: I27f119f927b23052c5fd8f068cbca75338fe7b91
2022-02-07 11:41:35 -05:00
John Reck
8920d2a1a6 Merge "Add minimal IAllocator AIDL VTS test" 2022-02-04 23:33:37 +00:00
Treehugger Robot
83c90e67a2 Merge "Add a top-level OWNERs" am: 95ad078d75 am: 8cf5b0071f am: dae5db1c87 am: 6d8c580ed3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1972199

Change-Id: Ia90e92f75fa5a17c0fc55e1b4b9f7410890c89fd
2022-02-04 22:33:55 +00:00
Treehugger Robot
95ad078d75 Merge "Add a top-level OWNERs" 2022-02-04 21:38:21 +00:00
Leon Scroggins III
bab1ba54ed Add a Java backend for android.hardware.graphics.common AIDL
This will allow SysUI to access the same struct (in
I27f119f927b23052c5fd8f068cbca75338fe7b91) that HWC uses to describe
its support for DISPLAY_DECORATION.

@hide each API individually. SysUI can access hidden APIs. Otherwise
leave the AIDL files are unchanged.

Bug: 216644902
Test: make
Change-Id: Id33f76e4c55b22d007c7e2314a4dfb778562bace
2022-02-04 15:49:06 -05:00
John Reck
cd883bc17a Address ANAPIC feedback
Also adds recommended combination for FRONT_BUFFER as
that was feedback from implementers

Fixes: 217752219
Test: N/A doc only change
Change-Id: I086597d14cc7d9d1a0b620b73297aaa3e6288773
2022-02-03 21:01:03 -05:00
John Reck
d1431859b3 Add minimal IAllocator AIDL VTS test
Bug: 217776226
Test: this
Change-Id: I3cca43b435e05e3909a943991b5dad69c1e4e56e
2022-02-03 20:30:58 -05:00
John Reck
b09556a1e9 Add a top-level OWNERs
Test: N/A
Change-Id: I21cd4888b3141dd272fcc72e880402b2ca84bc50
2022-02-03 19:58:21 -05:00
TreeHugger Robot
66cb6f97d0 Merge "Revert "IComposerClient wrapper for VTS tests"" 2022-01-29 03:13:08 +00:00
Ram Indani
22884acd6a Revert "IComposerClient wrapper for VTS tests"
This reverts commit 634340d6a8.

Reason for revert: No one is using it, I will make a cl with usage of the wrapper along side this and reupload it.

Change-Id: I3ff3427fc9e81d53fd47a082ab027441f5dc8a66
2022-01-29 02:00:21 +00:00
Ram Indani
d1cbbea53f Merge "IComposerClient wrapper for VTS tests" 2022-01-29 01:52:29 +00:00
ramindani
634340d6a8 IComposerClient wrapper for VTS tests
A wrapper helps with implementation details of IComposerClient and
improves re-usability with readback and base tests.

BUG: 199413815

Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I627748d1c779eaacf92ff6fb5ccf3138a3024681
2022-01-28 23:13:18 +00:00
Ray Essick
2e47e06fd3 Merge "Add explicit apex_available clauses" 2022-01-28 12:46:59 +00:00
TreeHugger Robot
e8b2c912a2 Merge "composer3: update cursorPosition documentation" 2022-01-28 01:15:48 +00:00
Ady Abraham
ac1125cb98 composer3: update cursorPosition documentation
Remove the word asynchronous and insteam explain 
that the cursor position can be updated without a validate/present.

Change-Id: Ia01bc097bc335779dba4e06577c285ca133dfd02
Fixes: 209711877
Test: make
2022-01-27 22:57:43 +00:00
TreeHugger Robot
99684613d9 Merge "composer: adds BufferAhead for the LayerCommand.aidl" 2022-01-27 21:53:57 +00:00
ramindani
d40304b574 composer: adds BufferAhead for the LayerCommand.aidl
Adds a Capability param as BUFFER_AHEAD to check if
BufferAhead is supported.

Test: Device boots after these changes.
BUG: 198186628
Change-Id: Ic0f3e602635a2519f4e90c546dfca1af985116f9
2022-01-27 19:36:33 +00:00
Ray Essick
be6963a279 Add explicit apex_available clauses
So we can start deleting the lists embedded in the build tools

Bug: 215589022
Test: build
Change-Id: Ibea376e172d4def6d1dbb2b8e7a170afc356f59e
2022-01-26 09:50:04 -08:00
TreeHugger Robot
b20697869b Merge "composer: add API to control display idle timer" 2022-01-26 03:04:51 +00:00
TreeHugger Robot
e6db2b63f5 Merge "Clarify FRONT_BUFFER requirements" 2022-01-26 01:25:47 +00:00
John Reck
5ee4de588b Clarify FRONT_BUFFER requirements
Bug: 193558894
Test: N/A
Change-Id: I9c22df7b6a7a5facb37ab6fc37f926c484c2792b
2022-01-25 16:35:13 -05:00
TreeHugger Robot
47a1952f40 Merge "Skip expectedPresentTime_* tests when unreliable fences cap present" 2022-01-25 00:07:24 +00:00
TreeHugger Robot
9138a1382c Merge "Make retrieving SMPTE2094-10 metadata optional." 2022-01-24 23:33:39 +00:00
Treehugger Robot
08749b23ea Merge "Add OWNERS file for android/hardware/graphics/common" am: 5afd5eba36 am: 262e40b9ef am: bf1243dc01 am: b4f96158b0
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1912556

Change-Id: Id5bb6ff3a347f57606f9dd8d8a15c4ead8555b57
2022-01-24 22:56:15 +00:00
Jason Macnak
325e8235c3 Skip expectedPresentTime_* tests when unreliable fences cap present
... as these tests depends on present fence signal times.

Bug: b/193240715
Test: cvd start
Test: vts -m VtsHalGraphicsComposer3_TargetTest
Change-Id: Iad0b89daa85e01a287f045a91b1cbdb890fee05d
2022-01-24 14:51:19 -08:00
Treehugger Robot
5afd5eba36 Merge "Add OWNERS file for android/hardware/graphics/common" 2022-01-24 21:55:59 +00:00
Alec Mouri
9324749747 Make retrieving SMPTE2094-10 metadata optional.
Devices that do not support this metadata are not required to support
getting or setting it on gralloc buffers, as SMPTE2094-10 is only used
for some HDR standards that are not guaranteed to be supported.

Bug: 205245993
Test: builds
Change-Id: Ic3501230015ddce49ce977963356c0578af7c50f
2022-01-24 21:42:13 +00:00
Leon Scroggins III
38c446f3b7 Add OWNERS file for android/hardware/graphics/common
Suggested in I6f6b7f22e76609151a413ca6a6dbf55bd91911dd.

Bug: NA
Test: NA
Change-Id: Ifc55e56ee912d822adb458818da30b737a89ef5a
2022-01-24 19:58:39 +00:00
Alec Mouri
3e037cf683 Remove stride from VTS classes
Stride must be retrieved from the graphic buffer immediately prior to
CPU access. The previous code was tripped up by an error-prone situation
where stride was never initialized, causing UB.

Also this patch sneaks in a couple of const modifiers for methods that
pass-by-ref.

Bug: 213493262
Test: VtsHalGraphicsComposer3_TargetTest
Change-Id: Ic601cca128b71d36876ed25bd55140b02cb0ad0f
2022-01-24 10:58:41 -08:00
Treehugger Robot
fb7dff82ab Merge "composer: 2.4: vts: Add missing COMPOSER_OVERLAY allocation flag" am: 283a876e5a am: 0bda60d835 am: 59b38ef7b0 am: 82a2943aa3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1954544

Change-Id: I953de2c90498daeee6b381df262c41063d005b95
2022-01-23 14:53:04 +00:00
Alec Mouri
710a50ae6b Merge "Fix asserts for GetReadbackBufferFenceInactive" 2022-01-21 21:17:31 +00:00
Alec Mouri
62ae37be3c Fix asserts for GetReadbackBufferFenceInactive
If there's no readback buffer, then the status is NOT ok(), and the
returned fence must be -1.

Bug: 213493262
Test: VtsHalGraphicsComposer3_TargetTest
Change-Id: Iff1b6e04126bfcc748f0f8d173f63244bfd83be4
2022-01-21 19:42:32 +00:00
Alec Mouri
f23f502fcc Merge changes from topic "whitepoint_readback_vts"
* changes:
  Cleanup for readback buffer management:
  Readback test support for per-layer dimming
2022-01-21 19:42:16 +00:00
Jason Macnak
82374526b5 Merge changes Ibf80a618,I0a2b90bc
* changes:
  Use IComposerClient::EX_UNSUPPORTED
  Check createComposer().isOk() in test setup
2022-01-21 16:38:26 +00:00
Roman Stratiienko
bf928e775d composer: 2.4: vts: Add missing COMPOSER_OVERLAY allocation flag
Without this flag, the composer will fail to PRESENT the buffer on
the systems that do not have IOMMU support and can scanout contiguous-
only buffers.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Change-Id: I566534a2a1fb602c0ce69ef861805d4fb03d7c47
2022-01-21 10:49:47 +02:00
Midas Chien
a0b56bde11 composer: add API to control display idle timer
Add new functions to control display idle timer
- Adding an API to r configure display idle timer.
- Extend DisplayCapability to query display support idle timer.
- Adding an callback for notify client the display is idle, the refresh
  rate changed to a lower setting to preserve power and vsync cadence
  changed. The client can enable vsync callback to learn the new vsync
  cadence before sending a new frame.

Bug: 194068871
Bug: 198808492
Test: build, vts
Change-Id: I47649d222022922926a05f2d700ca798f8f48b35
2022-01-21 15:38:52 +08:00
Jason Macnak
062bc9a3a6 Use IComposerClient::EX_UNSUPPORTED
Bug: b/193240715
Test: cvd start
Test: vts -m VtsHalGraphicsComposer3_TargetTest
Change-Id: Ibf80a618dead09ffdea56d373a83a691124c7d2e
2022-01-20 15:00:09 -08:00
TreeHugger Robot
579390868a Merge "Test that R_8 can be allocated if it's supported" 2022-01-20 20:48:38 +00:00
John Reck
d126297c23 Merge "Add front buffer usage" 2022-01-20 20:21:52 +00:00
Alec Mouri
7b4d5ee452 Cleanup for readback buffer management:
* Tests exercising that a bad readback buffer is sent should actually
use a native_handle from a deallocated buffer rather than a valid
handle, since that would still work
* Creating a readback buffer should not require passing in a buffer at
construction. Instead ReadbackBuffer should always allocate its buffer
internally whenever a new buffer needs to be generated.
* Passing the readback buffer's fence to lockAsync should be a dup'd fd,
as lockAsync takes ownership of the fence

Bug: 213493262
Test: VtsHalGraphicsComposer3_TargetTest
Change-Id: I73396f982cf9a67f0dd81eaed509cf9cc7b03314
2022-01-20 12:16:45 -08:00
Jason Macnak
e531a092fc Check createComposer().isOk() in test setup
Bug: b/193240715
Test: cvd start
Test: vts -m VtsHalGraphicsComposer3_TargetTest
Change-Id: I0a2b90bcb403fbf3454046d3e46bf972a4d149f7
2022-01-20 10:15:43 -08:00
Alec Mouri
0cb31dbb0a Merge "Add VTS for setting layer white point" 2022-01-20 17:57:09 +00:00
Leon Scroggins III
5f78f65e8f Test that R_8 can be allocated if it's supported
Bug: 209458105
Test: atest VtsHalGraphicsMapperV4_0TargetTest (this)
Change-Id: I927393bf9e4186d400e8b7cc0758095ec00ef13f
2022-01-19 16:26:35 -05:00
Ady Abraham
96e2785b7e Merge "composer: add getDisplayPhysicalOrientation" 2022-01-19 04:03:48 +00:00
Ady Abraham
ae12e389fd composer: add getDisplayPhysicalOrientation
Add an API to query the physical display orientation.

Bug: 213237830
Test: VTS
Change-Id: I4ea9ee5c8655be283e19156b0ce68e35674ac321
2022-01-19 01:13:28 +00:00
Treehugger Robot
fa31414317 Merge "Add alecmouri to composer OWNERS" am: d89d96d196 am: b766496521 am: 8f8f639518 am: a44e520716
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1949687

Change-Id: Ia2074f2f0d8cdbc8546b9eda7e3ab1759ed2d578
2022-01-14 22:37:21 +00:00
Leon Scroggins
a393f66d23 Merge "Add VTS for setLayerBlockingRegion" 2022-01-14 19:25:51 +00:00
Alec Mouri
510670192a Readback test support for per-layer dimming
Dimming is only verified if setting display brightness is supported. The
test then does:
* Sets the display brightness to max, which is the same nit level that
is found in the display xml file
* Dims a layer by 10%

Bug: 213493262
Test: builds
Change-Id: I3b552682276be26fefd7ae5586ba42af0e574e31
2022-01-14 11:10:59 -08:00
Alec Mouri
95e490bf23 Add VTS for setting layer white point
No readback tests as of yet, as that will necessitate a new api to get
the max display brightness, so that we can max out the brightness -> use
well-defined dimming ratios

Bug: 213493262
Test: builds
Change-Id: I0166dc67f4c52919c02ab7abbf47701e6be3d983
2022-01-14 10:50:05 -08:00
Ady Abraham
7b957abe49 Add alecmouri to composer OWNERS
Change-Id: I01a0958e1371ba0e6a92d7f5f0d19ce0acdb7604
2022-01-14 17:10:25 +00:00
Vishnu Nair
6a265c50fc Merge "Update VTS to use ExternalTexture impl" 2022-01-14 17:04:26 +00:00
Kriti Dang
496ce11491 Merge "Composer hal changes for boot time display mode" 2022-01-14 10:39:43 +00:00
Vishnu Nair
59329712a9 Update VTS to use ExternalTexture impl
We want to expose GraphicBuffer properties via
ExternalTexture class and within, SurfaceFlinger access the
buffer via this proxy interface. This allows us to inject
and mock GraphicBuffers as needed. Specifically this will
be used to recreate layer state from transaction traces.

Test: compiles
Bug: 200284593

Change-Id: If2b6c43bb5b302fbc49dfa49d6ac1f79f92f30f7
2022-01-14 02:06:17 +00:00
John Reck
ef1d9b6f8f Add front buffer usage
Test: Builds & boots
Bug: 193558894

Change-Id: I5e6aa11b47272d9d8aa8a8bac256861f7a0629cb
2022-01-13 16:09:54 -05:00
Leon Scroggins III
0331815adb Add VTS for setLayerBlockingRegion
Fixes: 213361853
Test this

Change-Id: Iaca3be9f83420964cd3945d39665a95da50fee08
2022-01-13 13:56:43 -05:00
Kriti Dang
4c6e9ebf1e Composer hal changes for boot time display mode
Bug: 203520442
Test: m
Test: atest VtsHalGraphicsComposer3_TargetTest

Change-Id: I530d7f52acaaee8c728dbd9a95ecca017804304a
2022-01-13 14:41:03 +01:00
TreeHugger Robot
eac016a771 Merge "ASSERT error check in brightness test" 2022-01-12 21:41:54 +00:00
ramindani
b3bdf0535c ASSERT error check in brightness test
Without ASSERT the next call to take the first element will crash the instrumentation for the tests.

BUG: 210151839
Test: atest VtsHalGraphicsComposer3_TargetTest
Change-Id: I2c78b9130661e543e62138c064ab15dd79180920
2022-01-12 18:31:50 +00:00
TreeHugger Robot
d88b967144 Merge "composer: deflake Test_expectedPresentTime" 2022-01-12 18:30:28 +00:00
Ady Abraham
5429444b46 Merge changes from topic "hwc_float_color"
* changes:
  composer: Color.aidl should use floats
  composer: remove FloatColor
2022-01-12 00:48:54 +00:00
Leon Scroggins
780f1ba454 Merge "Add LayerCommand.blockingRegion" 2022-01-11 21:28:57 +00:00
Ady Abraham
1bee7abe60 composer: Color.aidl should use floats
Color is represented as a float [0.0 - 1.0] in the upper part of
the stack, so make composer3 interface consistent.

Bug: 207139550
Test: VTS
Change-Id: Ic14288b5c87ff5cccfc9a0756d2630b8715759f7
2022-01-10 18:29:17 -08:00
Ady Abraham
4596369b26 composer: remove FloatColor
Currently not used.

Bug: 207139550
Test: VTS
Change-Id: I190382a7e72bd07b84a44f22f7b4b8b39b961355
2022-01-10 18:29:16 -08:00
Ady Abraham
df084f35fc composer: deflake Test_expectedPresentTime
Test_expectedPresentTime might fail due to scheduling delays.
To avoid that, we test that the actual presentation didn't
happen too early, but we allow for a late presentation.

Bug: 198186194
Test: VTS
Change-Id: I9be4bfe5a848443e69ef7b62ffb3dae675a9b81f
2022-01-11 00:39:00 +00:00
TreeHugger Robot
e57e096206 Merge "Cleanup to composer apis for HDR:" 2022-01-11 00:36:42 +00:00
Alec Mouri
bc1c743832 Cleanup to composer apis for HDR:
1. Remove the setDisplayBrightness method, as it's been moved to a
display command
2. Rename the WhitePointNits stable stuct to Luminance, since it's a
more general descriptor.

Bug: 210151839
Test: builds
Change-Id: Ic948dce737ce718772100b0e976ec93069d5e8e1
2022-01-10 09:46:56 -08:00
Alec Mouri
2bee6043d4 Merge "Adjustments to composer apis for HDR:" 2022-01-07 22:44:50 +00:00
Leon Scroggins III
536f04e354 Add LayerCommand.blockingRegion
This hint tells the HWC that it may use a blocking feature to skip a
portion of the layer's buffer.

Bug: 212736475
Test: TODO (b/213361853)
Change-Id: Ib0fa41e56196feeff201637d5599830d2565da2b
2022-01-07 14:48:51 -05:00
Leon Scroggins
b9d017c22f Merge "Add DisplayCapability::DISPLAY_DECORATION" 2022-01-07 17:11:47 +00:00
Alec Mouri
60564e18c8 Adjustments to composer apis for HDR:
1. Add setDisplayBrightness as a display command, so that it may be
set atomically with composition updates for that display.
2. Adjust tests to set display brightness using display commands.

The setDisplayBrightness api on IComposer should be deprecated. It will
be removed in a follow-up patch.

Bug: 210151839
Test: builds

Change-Id: I2e4348e1d7f799d1744390afbb9bd206054eb933
2022-01-06 14:06:30 -08:00
Leon Scroggins III
830a0b445e Add DisplayCapability::DISPLAY_DECORATION
Bug: 193170859
Test: manual
Test: TODO (b/212697197)
Change-Id: I5e5efe671f0b3d724bafeff93e2d97007cb167ab
2021-12-30 12:47:13 -05:00
Leon Scroggins
3519a109bd Merge "Reland "Update documentation for DISPLAY_DECORATION"" 2021-12-29 13:01:54 +00:00
Ram Indani
4430c6ce25 Merge "composer: fix null pointer dereference" 2021-12-28 16:52:57 +00:00
Leon Scroggins
2efab6cd3c Reland "Update documentation for DISPLAY_DECORATION"
The first time this topic landed, it resulted in b/212402133. We avoid
running into this bug with Ib11d46439db57b90486bad07dd90f2cf0822182a.

Remove references to 8 bit alpha.

Original commit message:

After some discussion, we've decided to always set the ScreenDecorations
to DISPLAY_DECORATION. HWC can decide, based on the format, whether to
truly treat it as DISPLAY_DECORATION, or to change to DEVICE
composition.

Update the documentation to reflect this change.

See also I1da3199bacf5877e88876249c60c0a33fcd44c1e.

Bug: 193170859
Test: NA

Change-Id: Iaf5385c38f6827e07b91a9a0a8769fb7a125e847
2021-12-28 11:30:25 -05:00
Ady Abraham
435fd2fda1 composer: fix null pointer dereference
The test process was crashing on null pointer instead of exiting
successfully, so fixing the null pointer error.

Test: VTS
Change-Id: I1d6988d25ed58c159adc49d43d36e4b3f0ffa289
2021-12-23 16:23:26 -08:00
Ady Abraham
11840523cd Merge "composer: remove translate-ndk" 2021-12-23 23:58:57 +00:00
Leon Scroggins
80b5caec3e Merge "Revert "Update documentation for DISPLAY_DECORATION"" 2021-12-23 21:55:09 +00:00
Ady Abraham
f825cd7768 Merge changes from topic "b_208856704"
* changes:
  composer: cleanup CommandWriterBase and CommandReaderBase part 2
  composer: make PresentOrValidate.Result consistent with hidl
2021-12-23 21:27:08 +00:00
TreeHugger Robot
33e36ef1dc Merge "composer: rename ClockMonotonicTimestamp.timestamp" 2021-12-23 21:07:40 +00:00
Leon Scroggins
fa7e058b5e Revert "Update documentation for DISPLAY_DECORATION"
Revert "Add/plumb SurfaceControl.DISPLAY_DECORATION"

Revert "Add eLayerIsDisplayDecoration flag"

Revert submission 16511727-wm_DISPLAY_DECORATION

Reason for revert: b/211835607
Reverted Changes:
I1da3199ba:Allow changing composition from DISPLAY_DECORATION...
I1fae74b36:Update documentation for DISPLAY_DECORATION
I1da03a88f:Add eLayerIsDisplayDecoration flag
I7f22dfd03:Add/plumb SurfaceControl.DISPLAY_DECORATION

Change-Id: I7238bcc96325873ec7dbdd42894192c48e7cf92e
2021-12-23 15:28:46 +00:00
Ady Abraham
c4fd63353d composer: remove translate-ndk
- No one is using the translate functions, so removing.
 - Rename the static_assert portion to Hidl2AidlAsserts

Test: build
Change-Id: I42abc37953e1d927a3bcf5f60f56acf99fde6bf5
2021-12-22 21:59:35 -08:00
Ady Abraham
46219f5731 composer: cleanup CommandWriterBase and CommandReaderBase part 2
Bug: 208856704
Test: VTS
Change-Id: I30f4cfef66a1c833142b4645f69e8ad9fbf0de8e
2021-12-22 21:58:57 -08:00
Ady Abraham
b9b5df3ce5 composer: make PresentOrValidate.Result consistent with hidl
HIDL expects that Presented will be 1 and Validated witll be 0.
Even though we map the enum values of PresentOrValidate.Result
to the correct value, this CL makes the interface consistent with
the HIDL so that we can directly use the enum value.

Bug: 208856704
Test: VTS
Change-Id: I9fb2421e32c2288c5495422eda6764f6102337f0
2021-12-22 21:58:57 -08:00
Ady Abraham
8d65de5874 composer: rename ClockMonotonicTimestamp.timestamp
Rename ClockMonotonicTimestamp.timestamp to
ClockMonotonicTimestamp.timestampNanos to improve readability.

Fixes: 211801233
Test: build
Change-Id: Ia71525fd9ccb77d871857f60dac29ac9198c0258
2021-12-22 16:54:14 -08:00
Ady Abraham
f98cd3a9fe Merge "Remove GenericMetadata from composer3" 2021-12-23 00:28:11 +00:00
TreeHugger Robot
e00550775b Merge "composer: release fence can be null" 2021-12-23 00:17:38 +00:00
Ady Abraham
5b2858b709 Merge changes from topics "b_208879711", "hwc_present_time"
* changes:
  composer: DisplayCommand.colorTransform is just a matrix
  composer: pass expetcedPresentTime
2021-12-22 23:14:05 +00:00
Ady Abraham
dc6dd69948 composer: release fence can be null
Add @nullable to the releaseFence in IComposerClient.setReadbackBuffer
as it can be null, if the buffer is ready to be consumed.

Bug: 210166943
Test: VTS
Change-Id: Ic556ceabd22ba8acddf37ca7d9a6d14d41697c5b
2021-12-22 22:52:58 +00:00
Ady Abraham
654a3287ae Remove GenericMetadata from composer3
There are no current users for GenericMetadata, so removing
from composer 3.

Bug: 209691612
Test: VTS
Change-Id: I729a3646d9684c78454708fd15f1571aa405e9bb
2021-12-21 23:09:02 +00:00
Ady Abraham
8de9885800 composer: DisplayCommand.colorTransform is just a matrix
Remove the hint from DisplayCommand.colorTransform as currently
we only use ColorTransform::IDENTITY and ColorTransform::ARBITRARY_MATRIX,
which both can be expressed using a matrix.

Bug: 208879711
Test: VTS
Change-Id: Ibb24593e3d0af5afdc8f3f79de2fc22eeccfcea8
2021-12-21 14:04:33 -08:00
Leon Scroggins III
64803940e6 Update documentation for DISPLAY_DECORATION
After some discussion, we've decided to always set the ScreenDecorations
to DISPLAY_DECORATION. HWC can decide, based on the format, whether to
truly treat it as DISPLAY_DECORATION, or to change to DEVICE
composition.

Update the documentation to reflect this change.

See also I1da3199bacf5877e88876249c60c0a33fcd44c1e.

Bug: 193170859
Test: NA
Change-Id: I1fae74b360d1b9d79fc4afeab6f71089d4c8b7e5
2021-12-20 23:08:13 -05:00
Ady Abraham
72c5b503e5 composer: pass expetcedPresentTime
Add expectedPresentTime as an optional field to DisplayCommand.

Test: VTS
Bug: 198186194
Change-Id: I1203422b5d052508ca42a80da5d252c106efc5ee
2021-12-20 19:30:11 -08:00
Treehugger Robot
02878aa564 Merge "fix VtsHalGraphicsComposerV2_2TargetTest timeout failed" am: 81c9e603ea am: f864ffeb60 am: f5d2e9f8b8 am: 9506712ee3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1921757

Change-Id: I91028f31c1f571e31ba47695c4401738a3625b87
2021-12-16 23:33:15 +00:00
Ady Abraham
898e6d6aad Merge "composer: cleanup CommandWriterBase and CommandReaderBase" 2021-12-16 19:38:54 +00:00