Commit graph

212 commits

Author SHA1 Message Date
Steven Moreland
1ae4615d9f Update hidl makefiles for bpfmt
hidl-generated makefiles are now generated such that bpfmt(file) == file.

Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
2019-04-17 09:38:50 -07:00
Steven Moreland
a878aee9ab Update makefies: no 'types'
Bug: 123976090
Test: N/A
Change-Id: I30fb04c81889b62775e1b764b965fdb0f893de17
2019-03-04 11:27:17 -08:00
Peiyong Lin
849c980804 [composer] Remove implication.
The spec of setLayerDataspace never specifies the types of layer it should be
call on, however, the spec has the implication that this method will only work
for layers with buffer, which is mis-leading. This patch changes the wording of
setLayerDataspace spec, removes the implication. Note that this change won't
break backward compatability.

BUG: 126713799
Test: N/A
Change-Id: I97f22469897cb687dcb64a3d419bcb48a3668e5a
2019-02-28 17:00:30 -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
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
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
Treehugger Robot
001a2cc09e Merge "HWC2OnFbAdapter: don't claim present fences work" 2018-12-12 20:35:03 +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
Keun Soo YIM
68ae05dd2d pack VTS cc_test binaries as general-tests
Test: make general-tests
Bug: 120093339
Merged-In: I363450d205868f900e4925ccff1430e2a569f2a4
Change-Id: I363450d205868f900e4925ccff1430e2a569f2a4
2018-12-07 10:49:56 -08:00
Bill Yi
5989a2f631 Merge pi-dr1-dev to aosp-master
Change-Id: Ida0bc98526f4fc7a1c20f5bbd3210b2f6156d459
2018-10-19 12:20:42 -07:00
Chia-I Wu
7d49f30d3e graphics: composer@2.2 does not require mapper@2.1
am: 0eafa742c6

Change-Id: I6f045113a3c0218a4b8f2c8e794892a21c1fc306
2018-10-19 11:48:36 -07:00
Chia-I Wu
0eafa742c6 graphics: composer@2.2 does not require mapper@2.1
Fix composer@2.2 VTS to not require mapper@2.1.  We will need a
better test infra before things get too complex.

Bug: 112248843
Test: manual
Change-Id: Ia71a102742fd26f14e8edf3f43f3351786350ccd
Merged-In: Ia71a102742fd26f14e8edf3f43f3351786350ccd
2018-10-18 11:22:09 -07:00
Peiyong Lin
8a7dc8e57b Merge "[Graphics] Only validate display in PresentOrValidateDisplay."
am: 0a0fa7209e

Change-Id: I174b127b17f6e9c2198da681f8272b26b110139d
2018-09-06 23:40:55 -07:00
Peiyong Lin
5b42b97ec5 [Graphics] Only validate display in PresentOrValidateDisplay.
Previously we require display to be validated in onRefresh, however, onRefresh
can be called while validateDisplay is executing, results in next
presentDisplay being skipped. This patch makes sure we don't check validation
state when presentDisplay is called.

BUG: 80063800
Test: build, flash, boot and play Youtube videos.
Change-Id: I3d8686db3274436afb6605812641768296f1af0e
Merged-In: I3d8686db3274436afb6605812641768296f1af0e
2018-08-29 14:45:15 -07:00
Daniel Solomon
8c7038045a Revert "graphics: restart HWC when SurfaceFlinger stops"
am: a6f6fd7400

Change-Id: I5a241ea6ee77ee18b865ae150c7abe05c6a19061
2018-06-22 14:51:59 -07:00
Daniel Solomon
a6f6fd7400 Revert "graphics: restart HWC when SurfaceFlinger stops"
This reverts commit 399a5b8d60dd845b86c43cf4de55dda4d47384c6; this
change is no longer needed and is causing instability on some devices.

Bug: 74199279
Change-Id: Ia8ee7ae0958df029beac9eb1d343995c54fa8798
2018-06-22 17:57:45 +00:00
Carmen Jackson
db4740805a Merge "Add hwcomposer to the system-background cpuset for hal v2.2" into pi-dev
am: f053b3de23

Change-Id: Iab3ceb5c8d33786c851a162716fd9fffdc13f215
2018-06-19 17:14:17 -07:00
Carmen Jackson
76fa88e7a0 Add hwcomposer to the system-background cpuset for hal v2.2
This change was made for hal v2.1 but not cross-ported to 2.2.

Bug: 110167043
Test: $ adb shell ps -A | grep composer
system  630 ...  android.hardware.graphics.composer@2.2-service
$ adb shell cat /proc/630/cpuset
/system-background

Change-Id: I40b8a0386a7cf67fe64b1e0e40d81b78891faaca
2018-06-18 17:32:28 -07:00
huans
715a9092b0 Merge "SetColorMode is not available for vendor hwc less than 1.4" into pi-dev
am: 308d390720

Change-Id: I912853f863d6bf18c09f7385b099e2a7d0d7030b
2018-06-05 21:56:46 -07:00
TreeHugger Robot
308d390720 Merge "SetColorMode is not available for vendor hwc less than 1.4" into pi-dev 2018-06-06 04:48:34 +00:00
huans
f579ea47aa SetColorMode is not available for vendor hwc less than 1.4
Bug: 90510785
Test: VTS VtsHalGraphicsComposerV2_1Target SetColorMode(default) pass
Change-Id: Ia295b3ef2f0f433a7e1b5179eb230b8f7c649400
2018-06-01 14:33:30 -07:00
Chia-I Wu
479085d913 graphics: replace hidl_enum_iterator by hidl_enum_range
Change-Id: I012aa2bcbb81105ea1a1ec05a577f3bb8136b0da
Merged-In: I2180f18e8742850f728491887475f16b1cad4791
2018-05-31 08:40:24 -07:00
Chia-I Wu
dcb3ba075f Merge "graphics: COLORIMETRIC is optional for HDR modes" into pi-dev
am: 739c3177ea

Change-Id: Ida893aaf12b8750e5a96060c6edece486b4f9ad9
2018-05-30 17:09:13 -07:00
Chia-I Wu
8f5a17d1e8 graphics: COLORIMETRIC is optional for HDR modes
Bug: 80030364
Test: VTS
Change-Id: I2180f18e8742850f728491887475f16b1cad4791
Merged-In: I2180f18e8742850f728491887475f16b1cad4791
2018-05-30 11:52:57 -07:00
Chia-I Wu
d0d50652fb graphics: fix readback buffer tests
am: 09782444e3

Change-Id: I15b2eb478edcef44169005c51611e1fcb4210453
2018-05-23 13:25:57 -07:00
Chia-I Wu
09782444e3 graphics: fix readback buffer tests
Make readback buffer support optional.  Fix incorrect use of
setReadbackBuffer and getReadbackBufferFence.

Bug:  80030364
Test: VTS
Change-Id: I278a031c3c086ac38c460b7076a2952db57a91a4
Merged-In: I278a031c3c086ac38c460b7076a2952db57a91a4
2018-05-22 15:17:50 -07:00
Steven Moreland
cbc30e1f58 Merge "Update comments for doc comments." into pi-dev
am: cce4c95c1c

Change-Id: Id691cf973a214ee1d2f62297c13c8c030fc7a8bb
2018-05-18 18:43:45 -07:00
Steven Moreland
4ee4582230 Update comments for doc comments.
Doc comments look like "/** ... */" and they
can only be in certain places.

Bug: 79865343
Test: m
Change-Id: Ic15c08ff7dc6e4f9827c1dbe7f7236c11a572ec1
2018-05-18 10:10:32 -07:00
Dan Stoza
cdf9c58712 Merge "Composer 2.2: Fix readback docs" into pi-dev
am: 066288295e

Change-Id: I6721a52dbdb7141b84dde0516be6923b4016d7fa
2018-05-16 15:52:52 -07:00
Dan Stoza
e7bd22299a Composer 2.2: Fix readback docs
Fixes a couple of problems with the return codes in the readback
documentation and adds a paragraph of clarification about when
getReadbackBufferAttributes will be called.

Bug: 67048889
Test: N/A, doc fix only
Change-Id: Ic91b8db207c1b4b1f18777bd316279747506149b
2018-05-16 14:18:08 -07:00
android-build-prod (mdb)
7ba269ea79 Merge "HWC2On1Adapter: Fix fd leak in Layer::dump" am: 2e38b2c0f6
am: 28172ae62a

Change-Id: I384c44c57d05ca303fd04c9e920aae9e23c9ee45
2018-04-27 11:39:23 -07:00
Dan Stoza
9f20633e6c HWC2On1Adapter: Fix fd leak in Layer::dump
Removes the fence dump from Layer::dump, since:
  a) It was leaking (a dup() without a close())
  b) It's not that useful anyway since it wasn't displaying the actual
     fence fd

Test: Manual
Bug: 73979009
Change-Id: I8f7446a05a1bab8c3ca781610ebeb98d17fa483b
2018-04-26 12:52:35 -07:00
Chia-I Wu
c75e0f0bf9 graphics: allow re-saturation for any legacy dataspace
While our intention is to only re-saturate legacy sRGB, the
re-saturation is usually performed globally by the composer.  To
avoid GPU fallback when, for example, video plays, allow the
re-saturation to be applied on any legacy dataspace.

This also removes the clamping after applying the re-saturation
matrix, allowing the output dataspace to be scRGB.

Bug: 78303195
Bug: 78025845
Test: manual
Change-Id: Ic221401894789fbaf6bad944b49006163238237c
2018-04-25 11:35:39 -07:00
Peiyong Lin
a2acfa2219 [Graphics] Update CommandWriter APIs to common::V1_1::* enum.
Previously we introduced Dataspace V1.1 and PixelFormat V1.1, thus APIs
accepting Dataspace should also be updated to accept V1_1::Dataspace and
V1_1::PixelFormat.

BUG: 77156734
Test: adb shell /data/nativetest/VtsHalGraphicsComposerV2_2TargetTest/VtsHalGraphicsComposerV2_2TargetTest
Change-Id: I00d00749f2895b727a18a28903256128a33e8b97
2018-04-02 15:56:45 -07:00
Chia-I Wu
6c8257feca graphics: add RenderIntent and better HDR support
This adds

  ColorMode::BT2020
  ColorMode::BT2100_PQ
  ColorMode::BT2100_HLG
  Dataspace::BT2020_HLG
  Dataspace::BT2020_ITU_HLG
  RenderIntent::COLORIMETRIC
  RenderIntent::ENHANCE
  RenderIntent::TONE_MAP_COLORIMETRIC
  RenderIntent::TONE_MAP_ENHANCE

and fixes per-frame metadata to be per-layer.  It also clarifies how
the composer should treat certain dataspaces and makes the
corresponding composer changes.

Bug: 73824924
Bug: 32148660
Test: manual
Change-Id: I5d12f50190522103c2ac97ee8dc2d5f6a2dabffe
2018-04-02 13:04:33 -07:00
Chia-I Wu
34dc4ddd4b graphics: add libhwc2on{1,fb}adapter
Moved from frameworks/native.

Test: build
Change-Id: I03bf1d073306aaa2ce155aee50fb9ac056906323
Merged-In: I03bf1d073306aaa2ce155aee50fb9ac056906323
2018-03-30 11:03:15 -07:00
Lloyd Pique
56375fda7c Fix crash on hotplug disconnect
ComposerClient destroys its internal model of the display while handling
the onHotPlug event from the Hwc. Subsequently SurfaceFlinger destroys
its model of the display, and destroys all Hwc layers associated with
the display.

This fixes the code for destroying layers to not dereference an invalid
iterator if the display does not exist, allowing destruction to
continue.

It also fixes a similar issue which could occur if a HWC layer is being
created for a display at around the same time as the disconnect event.

Test: hotplug disconnect no longer crashes
Bug: 38464421
Change-Id: I0f2d28fe89fccf997b4bbb9fa6b5c0e6a6e49b93
Merged-In: I0f2d28fe89fccf997b4bbb9fa6b5c0e6a6e49b93
(cherry picked from commit 2765f9d406)
2018-03-23 22:30:46 +00:00
Daniel Solomon
399a5b8d60 graphics: restart HWC when SurfaceFlinger stops
Currently display stays on when SurfaceFlinger is stopped, since HWC
runs as a separate service. There's no reason for display to remain on
in this state, and can be confusing to developers.

Restarting HWC when SurfaceFlinger stops causes display to turn off,
matching expected behavior. HWC is then ready to service SurfaceFlinger
when SurfaceFlinger starts back up.

Bug: 74199279
Change-Id: Ic772c29b362b3e8b2d6bc674a0bd237440880492
2018-03-12 18:55:06 -07:00
Carmen Jackson
36e146d6fc Add hwcomposer to the system-background cpuset.
Little cores should be fast enough to handle hwcomposer work, so
avoiding using big cores for this is a potential opportunity to save
battery.

Bug: 73543056
Test: Verified using dumpsys gfxinfo that TouchLatency doesn't drop
frames.
Test: Took 10s systraces of TouchLatency and a Youtube VR video and saw
no frames dropped in SurfaceFlinger.

Change-Id: If96e13a2bacc9541f4d69a5736254817f20cacdd
2018-03-08 12:58:13 -08:00
Chia-I Wu
de0bd95d57 graphics: add composer 2.2 default impl
This adds

  android.hardware.graphics.composer@2.2-hal
  android.hardware.graphics.composer@2.2-passthrough
  android.hardware.graphics.composer@2.2-service

The -hal module makes it easier to write composer 2.2 HAL and is
reusable by vendors.  The -passthrough module provides a HwcHal
class that implements ComposerHal 2.2 on top of hwcomposer2, and is
also resuable by vendors.  Finally, the -service module provides a
(stub) default implementation.

Test: boots and VTS
Change-Id: I4f940a9dea656abc7d9d485bf48d852c13d2ed56
2018-02-21 12:23:41 -08:00
Chia-I Wu
be99ad6e75 graphics: convert composer default impl to a library
Convert composer default impl to a header-only library,
android.hardware.graphics.composer@2.1-passthrough.

Test: builds and VTS
Change-Id: I9251aadc28816fc4c1d9326e09e297f30e9c25fe
2018-02-21 12:23:41 -08:00
Chia-I Wu
a41e726b8b graphics: add Composer to HAL support library
Extract IComposer implementation from HwcHal and move it to the HAL
support library.  This requires removal of

  ComposerHal::removeClient
  ComposerHal::enableCallback

and addition of

  ComposerHal::dumpDebugInfo
  ComposerHal::registerEventCallback
  ComposerHal::unregisterEventCallback

since HwcHal does not own a client to send the events to anymore.

Test: boots and VTS
Change-Id: I491e3d2c31d686661d4d3a44842bcac62cc2b2dc
2018-02-21 11:03:04 -08:00
Chia-I Wu
da5fdd4494 graphics: move ComposerClient to HAL support library
libhwcomposer-client is empty and can be removed.  Note that
ComposerClient::initialize is renamed and can fail now.

Test: boots and VTS
Change-Id: Iacd3f995bc094c7dd6b7f91ae64aad0522b3f3d3
2018-02-21 11:03:04 -08:00
Chia-I Wu
78211cf7d0 graphics: add ComposerCommandEngine
Add ComposerCommandEngine to the HAL support library to replace
ComposerClient::CommandReader and ComposerClient::mWriter.

Test: boots and VTS
Change-Id: I2d1281d37180497cbd5c623ef005cee44bce377e
2018-02-21 11:03:04 -08:00
Chia-I Wu
2d894af0c7 graphics: add ComposerResources
Add ComposerResources to the HAL support library to replace
HandleImporter, DisplayData, and BufferCache in ComposerClient.
ComposerResources tracks the current displays and layers, as well as
managing buffer caches for them.

This is more than refactoring.  HandleImporter used to be a static
object, but we want ComposerResources to be self-contained rather
than depending on a static object.  This needs to be fixed.  It also
becomes obvious that we used to treat sideband streams as buffers in
BufferCacheEntry destructor incorrectly.  That needs to be fixed as
well (as a trivial consequence of making HandleImporter non-static).

Test: boots and VTS
Change-Id: I8e3014cb233e2a6d1a71cc244eff80f126c58a94
2018-02-21 11:03:04 -08:00
Chia-I Wu
bbd9545732 graphics: move ComposerBase to HAL support library
Create android.hardware.graphics.composer@2.1-hal and add
ComposerHal, which is heavily based on ComposerBase, to it.

There are two bigger TODOs.  One is to remove the concept of
"clients" from the class and the other is to remove hwcomposer2.h
dependency.

Test: boots and VTS
Change-Id: I37b4fb3ae2239bf11aa87a56d1e2ebfe0b8c6b54
2018-02-21 11:03:04 -08:00
Chia-I Wu
501cc23259 graphics: add libhwc2on{1,fb}adapter
Moved from frameworks/native.

Test: build
Change-Id: I03bf1d073306aaa2ce155aee50fb9ac056906323
2018-02-21 11:03:04 -08:00
Chia-I Wu
96a098a80d graphics: more reusable libVtsHalGraphicsComposerTestUtils
Versioned library names, versioned include paths, and others.

Test: make VtsHalGraphicsComposerV2_1TargetTest
Change-Id: Ic266763c9ef25e09bc2c97026f2e1324609f48c6
2018-02-21 11:03:04 -08:00
Chia-I Wu
8b20c5c881 graphics: clang-format composer VTS
Test: make VtsHalGraphicsComposerV2_1TargetTest
Change-Id: I8df7090dd3cebbf36257f3df76f0e8aced0c60bd
2018-02-21 11:03:04 -08:00
Chia-I Wu
5ff97474de graphics: move libVtsHalGraphicsComposerTestUtils
Move libVtsHalGraphicsComposerTestUtils from vts/functional to
utils/vts.

Test: make VtsHalGraphicsComposerV2_1TargetTest
Change-Id: Ic3042aa7f2578d099fbe79039b60892bd0e87f25
2018-02-21 11:03:04 -08:00