Commit graph

79 commits

Author SHA1 Message Date
Ana Krulec
aad9fe4a2e Merge "Moving composer@2.1 library away from shared" am: 762a556c11 am: f9db4a4fcd am: 6f15603c5d am: d19d0297c0
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1484877

Change-Id: I7b293f1f8c291a2253c6dd6bf4411981f3560d70
2020-11-03 19:33:35 +00:00
Ana Krulec
564eab6f01 Moving composer@2.1 library away from shared
Adding the ability for tests to add
"android.hardware.graphics.composer@2.1-resources" as
as static library.

Test: atest sffakehwc_test on cuttlefish on aosp-master
Bug: 160796914
Change-Id: I8cb80102bd836f8f211602cb36fd857757e8323c
2020-11-02 18:07:37 -08:00
Marin Shalamanov
ac6cc1f97e Clean ComposerClient cache on hotplug
On subsequent hotplug connected event for a display
SurfaceFlinger destroys the previous framebuffers and
recreates them. When the new buffers are created
ComposerClient still holds a handle to the old buffers and
they are not destroyed. This way the new framebuffers
may get allocated on non continuous memory causing garbled
screens for the user.

Bug: 160112047
Bug: 169255692
Test: 1. limit cma ion memory to 32 MB
      2. flash device
      3. plug hdmi out and in
      4. verify that the display image is not garbled
Change-Id: Idf7cdf7a070ffc83ecec34ac24c8a7d696f68aa6
2020-10-27 13:37:40 +01:00
Marin Shalamanov
5127a97bd8 Update the comment for ReplacedHandle
Test: n/a
Bug: n/a
Change-Id: I388af766fb1b5e78aabfc72c70883e71d05ce18c
2020-09-29 16:04:49 +02:00
Ady Abraham
f6820b2b44 composer: add TestCommandReader to 2.4
Add a TestCommandReader to composer 2.4 VTS to parse correctly the
new commands introduced in 2.4.

Test: adb shell /data/nativetest64/VtsHalGraphicsComposerV2_4TargetTest/VtsHalGraphicsComposerV2_4TargetTest
Bug: 149124892
Change-Id: Ide4f98fa3bfc771e4095cc672f59b87e1aa03427
2020-02-10 11:24:04 -08:00
Dan Shi
b5fd31a128 Remove reference of VtsHalHidlTargetTestBase
All grahpics composer HAL tests have been converted to parameterized
gtest.

Bug: 147894326
Test: atest VtsHalGraphicsComposerV2_1TargetTest \
  VtsHalGraphicsComposerV2_2TargetTest \
  VtsHalGraphicsComposerV2_3TargetTest \
  VtsHalGraphicsComposerV2_4TargetTest

Change-Id: I84515a5698035d7ceb299a5cc140ecd7bb28fe84
2020-02-01 13:27:55 -08:00
Peiyong Lin
bc51e08596 Add getClientTargetProperty API entry.
getClientTargetProperty will give hardware composer the ability to request some
properties of the client target that hardware composer wants. Prior to this
API, the client will does its best to produce the client target of which the
properties are pretty much fixed.

BUG: b/145968912
Test: mmma -j32 hardware/interfaces/graphics/composer/2.4/
Change-Id: I055f46b1eeba1d3e20d6a92a9d50a83e0f1ee694
2020-01-16 10:05:54 -08:00
Peiyong Lin
ad96dd9f12 [composer] Add createCommandWriter to command engine.
Command engine always uses V2.1 CommandWriterBase, change the creation of
command writer inside command engine so that we can use the right version of
command writer.

BUG: b/147365206
Test: build and boot.
Change-Id: I61fbbce19a44244725621e9a1cef750bd4c78b4d
2020-01-09 13:48:16 -08:00
Peiyong Lin
96ee56bcd8 Remove beginCommand variants with a helper template.
BUG: b/147365206
Test: boot
Change-Id: I30715fe3e1c221ba366bf521fbd531636136f0c9
2020-01-08 14:55:20 -08:00
Automerger Merge Worker
dfb544e056 Merge "graphics: hwc2on1adapter: Buffer hotplug event after display creation" am: 74033a720b am: 076f84098e am: 43eedd211e
Change-Id: Ifa0eef52e8e439bddbbb2901008f3702d08f5c5c
2019-12-12 19:13:16 +00:00
Treehugger Robot
74033a720b Merge "graphics: hwc2on1adapter: Buffer hotplug event after display creation" 2019-12-12 18:28:05 +00:00
Marissa Wall
9c5ebfc5ba gralloc: update lock and lockYCbCr
IMapper 4.0 does support lockYCbCr functionality through lock and
BufferMetadata getters. However, we will wait to add the support in
one central gralloc library. For now just stub out the call so
there aren't any compiler errors.

Bug: 141631415
Test: Compiles

Change-Id: I9d2f70c87412f8ac2114db85eb6dc01539876e2b
2019-11-21 17:43:41 -08:00
Colin Cross
3df543380c Merge "Replace -Weverything with -Wextra" am: 8c63655c3d am: 1ec7613f7f
am: fbdb441d7b

Change-Id: I7f54191688adfe167f48deb18aba0f34bd8ad292
2019-11-08 15:26:09 -08:00
Colin Cross
d180b2b83b Replace -Weverything with -Wextra
-Weverything is not recommended, use -Wextra.

Bug: 143713277
Test: mma
Change-Id: Ic5957015ebc0030b8339b263730c8d0540cf088a
2019-11-08 13:09:00 -08:00
Nick Desaulniers
daedbd7e47 [hardware][interfaces][graphics] fix -Wimplicit-int-float-conversion
IEEE 754 single precision cannot precisely represent the value of large
32b integrals. Accept the imprecision from implicit casts by making the
casts explicit.

One case is comparing the value before and after converting a float to
an int32_t and back, the other is used when printing a value.

Bug: 139945549
Test: mm
Change-Id: I23375d73cd16be0741defc6395046bd3b22d1335
Merged-in: Id30edce2cd29c0f9c24cd52ba5fb33f7c56a3100
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-05 14:54:06 -08:00
Nick Desaulniers
de2a5dcd48 [hardware][interfaces][graphics] fix -Wimplicit-int-float-conversion
IEEE 754 single precision cannot precisely represent the value of large
32b integrals. Accept the imprecision from implicit casts by making the
casts explicit.

One case is comparing the value before and after converting a float to
an int32_t and back, the other is used when printing a value.

Bug: 139945549
Test: mm
Change-Id: Id30edce2cd29c0f9c24cd52ba5fb33f7c56a3100
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-05 13:18:26 -08:00
Dan Shi
ff7462064d Convert VtsHalGraphicsComposerV2_*TargetTest to be parameterized test
Bug: 142397658
Test: atest VtsHalGraphicsComposerV2_1TargetTest
Change-Id: Idd6b0a0314be706e06f7812fbf8eb787edd078b1
2019-10-30 11:27:11 -07:00
Andrew F. Davis
272ff4a626 graphics: hwc2on1adapter: Buffer hotplug event after display creation
If the HWC2 hotplug callback has not registered we buffer this event then
return, but do so too early leading to no display being created. Buffer
the event and return only after creating the display so when the callback
is registered we have a display for this hotplug event.

Test: Hotplug a display before the HWC2 hotplug callback is registered
Change-Id: I999e3fd7cbe87d12969fb2d2d82dbd956ee8d97b
Signed-off-by: Andrew F. Davis <afd@ti.com>
2019-10-28 15:34:42 +00:00
Yi Kong
0609fa20d0 Ignore format-pedantic compiler warning am: 4321dfea63 am: e38afc37a0 am: d92d2cf6b8
am: ffcd72c442

Change-Id: Ibbfe1553eb15831fff6ec13e5cf80310b603874b
2019-09-20 16:20:56 -07:00
Yi Kong
4321dfea63 Ignore format-pedantic compiler warning
This warning was turned off globally but it is only needed for few
projects. Move the flag to the individual project blueprint files.

Test: presubmit
Change-Id: I55163067ac5038f1650ad12300bf72a48f179b8e
2019-09-20 13:25:25 -07:00
Valerie Hau
6a05e9113a Returning HWC2_CAPABILITY_SKIP_VALIDATE capability if device supports it
For reasons unknown, HWC2_CAPABILITY_SKIP_VALIDATE was never added to
the IComposer hal.  However, we would like to tell the client that the
device has this capability when it is returned during a getCapabilities
query.  We manually add it to the list of IComposer::Capability
(static_cast should be ok since the IComposer::Capability has a fixed
underlying type of int32_t, and HWC2_CAPABILITY_SKIP_VALIDATE = 4 is in
this range).  Checking that device has skip validate functionality in
relevent test as well

Bug: 140813883
Test: build, boot, VtsHalGraphicsComposerV2_1TargetTest
Change-Id: I5f28268c4e6edeb2895502c5f4e009cebb566100
2019-09-11 14:25:48 -07:00
Marissa Wall
53aff11b36 composer-vts: support gralloc 4
Add support for gralloc 4.0 to composer-vts.

Bug: 136016160
Test: Compiles and boots

Change-Id: Ibfa802023ddeb3b4d09a7b69bbc796b67c4ee62d
2019-08-20 10:07:06 -07:00
Marissa Wall
b96c2eb119 composer: support gralloc 4.0
Add support for gralloc 4.0 to composer.

Bug: 136016160
Test: Compiles and boots

Change-Id: I2609f20348f795a7c4e966d7420b36fa27daa054
2019-08-19 10:21:57 -07:00
Marissa Wall
a8c3130a34 composer: refactor ComposerResources into shared library
composer@2.x-hal is a header library. Any of the shared
libraries it depends on must also be included by anyone
who includes composer@2.x-hal. This means when we add a new
version of mapper, anyone who uses composer@2.x-hal must
also include the new version of the mapper. Vendors
that depend on composer@2.x-hal are broken every time we
add a new mapper.

This patch refactors ComposerResources into a seperate
shared library. ComposerResources contains all of the
mapper code. composer@2.x-hal will depend on the new
composer@2.x-resource hal. Everyone downstream must
also add the composer@2.x-resource file now. However,
they will not be broken again when we add a new mapper
version.

Bug: 136016160
Test: Compiles and boots

Change-Id: I208a954a941ed65938074cd3efb8a6893a2bc1eb
2019-08-16 10:48:37 -07:00
Peiyong Lin
1b5692ea05 [Cleanup] Properly export lib headers.
Properly export lib headers to avoid copying everything when upgrade composer
version. Minor: Remove VTS team as OWNERS of non-VTS directory.

BUG: 135929065
Test: build and boot
Change-Id: I4c3544490fcf043ff6bda2312a00aed015d0d5fc
2019-07-02 18:23:14 -07:00
Valerie Hau
f87dcceb86 Merge "Wait until old ComposerClient is fully destroyed before recreating" into qt-dev am: d93c9f0c2d am: 5cb7cc40a7
am: 9c2e7c1cd2

Change-Id: I6251930043fbe98efb4c34735826d00719389655
2019-06-21 15:35:48 -07:00
Valerie Hau
5cb7cc40a7 Merge "Wait until old ComposerClient is fully destroyed before recreating" into qt-dev
am: d93c9f0c2d

Change-Id: I3bda1337b6c3fdea3c555f3887aa9a88dc04620c
2019-06-21 15:20:16 -07:00
Valerie Hau
bf967c9bdb Wait until old ComposerClient is fully destroyed before recreating
Possible race condition where EventCallbacks are registered before
old implementation deregisters on destruction.  Stems from fact that
strong pointer destruction does not mean the object has completely run
its destructor method

Bug: 135210708
Test: build, boot, VtsHalGraphicsComposerV2_1TargetTest
Change-Id: I0851f1197d8341854f5bdac5fbb08553fc32b710
2019-06-21 11:10:17 -07:00
Valerie Hau
624ce4b638 Merge "Adding support for different Mapper versions in IComposer VTS tests" into qt-dev
am: 29594d2d02

Change-Id: Icd7b79a0a737c2b90a79a140168c15eaf3f50457
2019-06-20 13:14:35 -07:00
Valerie Hau
dca469c180 Adding support for different Mapper versions in IComposer VTS tests
Bug: 135139498
Test: build, boot, VtsHalGraphicsComposerV2_<1,2,3>TargetTest,
Change-Id: I05e2832c64d4c06eb4afd64c3323d7edbd19a5f4
Merged-In: I05e2832c64d4c06eb4afd64c3323d7edbd19a5f4
2019-06-19 17:14:24 -07:00
Valerie Hau
c1dc31340e Adding support for different Mapper versions in IComposer VTS tests
Bug: 135139498
Test: build, boot, VtsHalGraphicsComposerV2_<1,2,3>TargetTest,
Change-Id: I05e2832c64d4c06eb4afd64c3323d7edbd19a5f4
2019-06-19 13:56:04 -07:00
Elliott Hughes
f62cfc207f Remove -Wno-user-defined-warnings. am: 18ea3d2d5e
am: 25769c2d3d

Change-Id: I4d646381b0ba63f00d3259b20b02df0d34c68cd6
2019-06-07 12:33:28 -07:00
Elliott Hughes
18ea3d2d5e Remove -Wno-user-defined-warnings.
Doesn't seem to be necessary.

Bug: http://b/134716967
Test: treehugger
Change-Id: I9617cf82c816ef072005f7baf2fceee9628313f5
2019-06-07 08:46:26 -07:00
TreeHugger Robot
52f5328bd3 Merge "IMapper: change an error message" into qt-dev 2019-04-05 03:29:22 +00:00
Valerie Hau
7ae8af54b3 Revert "Revert "Mark layers with color transform client composition if not implemented.""
This reverts commit 6f5a48f7af.

Reason for revert: Reinstating with fix
Below is the original commit message:
SET_LAYER_COLOR_TRANSFORM is an optional API, and thus when it's not
implemented. we want to make sure we follow the spec to mark those layers as
client composition and add them into changed layers list proactively.

BUG: 115554640
Test: Verify with setting color transform manually.
Change-Id: Ia2e8634b01ee1b5c99893e86ef451f90337ef90f
2019-04-04 16:17:27 -07:00
Marissa Wall
4de153cd21 IMapper: change an error message
Change the error message that prints when IMapper 3.0 isn't present.
The old warning was causing unnecessary concerns.

Bug: 128013727
Test: compile
Change-Id: I197cd953d08a8e9f3bdee92cede973bf1b97dfe2
(cherry picked from commit ccbd24f633)
2019-04-04 23:05:51 +00:00
Andrew Chant
6f5a48f7af Revert "Mark layers with color transform client composition if not implemented."
This reverts commit c53ea9f5f8.

Reason for revert: Breaks some display output
Bug: 129945273
Bug: 115554640

Merged-In: If70a148ae6ad673b5dd03143b3f1ed73eaa1290f
Change-Id: If70a148ae6ad673b5dd03143b3f1ed73eaa1290f
2019-04-04 18:55:08 +00:00
Peiyong Lin
c53ea9f5f8 Mark layers with color transform client composition if not implemented.
SET_LAYER_COLOR_TRANSFORM is an optional API, and thus when it's not
implemented. we want to make sure we follow the spec to mark those layers as
client composition and add them into changed layers list proactively.

BUG: 115554640
Test: Verify with setting color transform manually.
Change-Id: I53b4039eb63cccd1b174e3c6da3b6336b85e0321
2019-04-03 13:32:20 -07:00
Valerie Hau
ef77263b2f Adding negative slot index check in ComposerResources
Bug: N/A
Test: build, boot
Change-Id: I8ab18ed8f7c322ee995abc534309b51e796276fe
2019-03-27 10:06:12 -07:00
TreeHugger Robot
1be67b368a Merge changes from topic "IA/IM-3.0"
* changes:
  graphics: change composer 2.1 to support allocator/mapper 3.0
  graphics: rev IAllocator and IMapper
2019-01-15 23:21:27 +00:00
Dan Albert
5ebf56d092 Fix comparator operator() definition. am: a6a529236e am: 3df110feae
am: b21cdfb866

Change-Id: Id0f1912c6b05481f5d720a490cb7044d7accfc26
2019-01-13 01:57:42 -08:00
Marissa Wall
e20b112787 graphics: change composer 2.1 to support allocator/mapper 3.0
Change composer 2.1's ComposerResources to support the new major versions
of IAllocator and IMapper.

Bug: 120493579
Test: vts
Change-Id: I888364d302ba8c7f7ad30070dcad3ed738b4c663
2019-01-12 15:40:04 -08:00
Dan Albert
a6a529236e Fix comparator operator() definition.
Comparators should be const. The libc++ update checks for this and
rejects non-const comparators.

Test: m
Bug: None
Change-Id: If2f76c020943b5bcb55803f0742990c9965afd6e
2019-01-11 14:48:55 -08:00
Marissa Wall
889c94dabc graphics: update owners am: 104ecb9e60 am: af56d35175
am: 88d9ae03c4

Change-Id: I596f312798b61afe4a6f12d293e2de95b6e2d193
2019-01-11 10:51:25 -08:00
Marissa Wall
104ecb9e60 graphics: update owners
With olv@ no longer on the graphics team we need to update the
owners file to remove him and add new owners.

For composer the new owners are: lpy@ and vhau@
For allocator/mapper the new owner is: marissaw@

Test: N/A
Change-Id: Ied297e9446d480629155e1d9a96575ee518c2135
2019-01-10 14:27:55 -08:00
Valerie Hau
c25748d22f Adding HDR10+ Dynamic Metadata Support
Bug: 118343714
Test: build, flash, boot
Test: VtsGraphicsComposerV2_3TargetTest should pass
Change-Id: Iee78818bc2704f4045b62251ea2cc75af72a0609
2018-12-20 13:15:37 -08:00
Chih-hung Hsieh
df66e3cb29 Merge "Fix performance-for-range-copy warnings" am: d01f7050ac am: 51e835ce22
am: 86fefab5e9

Change-Id: Ib139d710d47a7a51e24ba8ba582b252f5ff6e244
2018-12-17 14:09:52 -08:00
Chih-Hung Hsieh
65ab67312b Fix performance-for-range-copy warnings
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: I1b76a22eab100a31e77048626e48169fe7eeaf92
2018-12-17 19:57:21 +00:00
Chris Forbes
bdf93d0e68 HWC2OnFbAdapter: don't claim present fences work
We never produce real present fences, so indicate this to the
compositor. This will prevent GOOGLE_display_timing & friends from being
exposed in the client APIs.

Similar to previous change in HWC2On1Adapter.

Bug: b/111505197
Change-Id: I601a7f5628d4b218431fc0f1abb4807c9941ce64
(cherry picked from commit 3fac35a98a)
2018-12-11 18:31:06 -08:00
Lloyd Pique
79d6d0c1d0 graphics: Base resource classes need virtual dtor
ComposerResources allows a derived class to define specializations of
the ComposerDisplayResource and ComposerLayerResource classes, which are
returned by overrides of the createDisplayResources() and
createLayerResources() member functions. The pointers are wrapped using
a std::unique_ptr, which destroys the owned instance via the base class
destructor.

As the destructor was not virtual, this meant that only the base class
destructor functionality would be used. Any additional cleanup done by
the derived class destructor would not be run!

This impacts the composer-hal 2.2 utility code for example, which adds a
readback buffer cache as a display resource. Any readback buffers that
are imported there will not be released, effectively leaking graphic
buffer memory.

It also affected an ARC++ specialization where a similar per-layer buffer
resource cache was added, and where the leak was observable since layers
are created and destroyed much more often than displays.

Bug: 117877825
Test: No leaks for ARC++ devices
Change-Id: I6e604b415d3ed787c2e51729a77278594e41e7a9
2018-11-02 23:08:08 +00:00