Commit graph

550 commits

Author SHA1 Message Date
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
513e4e1008 graphics: COLORIMETRIC is optional for HDR modes
Bug: 80030364
Test: VTS
Change-Id: I2180f18e8742850f728491887475f16b1cad4791
2018-05-30 11:52:48 -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
Chia-I Wu
76630c6567 graphics: fix readback buffer tests
Make readback buffer support optional.  Fix incorrect use of
setReadbackBuffer and getReadbackBufferFence.

Bug:  80030364
Test: VTS
Change-Id: I278a031c3c086ac38c460b7076a2952db57a91a4
2018-05-22 13:05:26 -07:00
Steven Moreland
39faf7e2ed Merge "Update comments for doc comments." into pi-dev am: cce4c95c1c
am: cbc30e1f58

Change-Id: I9f7d33cdd3c40e28c0341df2e8a8bd298ec52b79
2018-05-18 18:55: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
aaa8dfb47d Merge "Composer 2.2: Fix readback docs" into pi-dev am: 066288295e
am: cdf9c58712

Change-Id: I697e84dbd3fa257791293028e039b2ff4a261d54
2018-05-16 16:22:54 -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
Dominik Laskowski
bebc464d90 Merge "graphics: Add composer 2.3" 2018-05-02 22:24:01 +00:00
android-build-prod (mdb)
241b31ab77 Merge "HWC2On1Adapter: Fix fd leak in Layer::dump" am: 2e38b2c0f6 am: 28172ae62a
am: 7ba269ea79

Change-Id: I87530cfb3908ca158d96d9bc3ad6e4be91df1ade
2018-04-27 11:48:11 -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
825f29f755 graphics: allow re-saturation for any legacy dataspace am: c75e0f0bf9
am: 6f869050d1

Change-Id: I7199ebd515c681a8961122d2340f0be67d24b93a
2018-04-25 13:25:54 -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
Dominik Laskowski
cd2e9f587d graphics: Add composer 2.3
The 2.3 interface adds IComposerClient.getDisplayIdentificationData,
which enables display identification for generalized multi-display
support.

Bug: 74619554
Test: VtsHalGraphicsComposerV2_3TargetTest
Change-Id: I303e722ce938fe0af4fc77da812e3525d8c90251
2018-04-24 10:26:16 -07:00
Dominik Laskowski
0c41558bdf graphics: Clean up VTS boilerplate for composer
This CL makes the V2_1::vts::Composer class more reusable, and cleans up
the 2.2 boilerplate.

Bug: 74619554
Test: VtsHalGraphicsComposerV2_2TargetTest
Change-Id: Iff2905d40afe16a0b9ce735f1285d5bdc6b4cec7
2018-04-05 15:21:28 -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
Chia-I Wu
98923fccad graphics: make mapper VTS utils more reusable
Better include path (#include <mapper-vts/2.0/MapperVts.h>), better
library naming, and move GraphicsMapperHidlEnvironment to where
tests are defined.

Test: VTS
Change-Id: I9fbf6515993ac11852b11ca6b8194a58afe5579a
2018-02-02 07:29:25 +00:00
Peiyong Lin
ab505aaf90 [HWC] Add setLayerFloatColor API into HAL.
This patch:

1. Adds setLayerFloatColor API into HAL to enable setting more bits of color on
ColorLayer;
2. Adds VTS tests for setLayerFloatColor.

BUG: 69970838
Test: adb shell /data/nativetest/VtsHalGraphicsComposerV2_2TargetTest/VtsHalGraphicsComposerV2_2TargetTest
Change-Id: I439e35cb2505ee47b8e9a8dd1c19a3f3f2cf9c2f
2018-01-25 05:58:32 +00:00
Courtney Goeltzenleuchter
be92bb9fae Add new HWC HAL methods for Android P.
Add new methods to support HDR, video readback mechanism and
additional power mode.

Test: adb shell /data/nativetest/VtsHalGraphicsComposerV2_2TargetTest/VtsHalGraphicsComposerV2_2TargetTest
Bug: 71513501
Change-Id: I45596df6c5a2a726e12f524e82681aef4bcbe180
2018-01-24 17:19:55 -08:00
Courtney Goeltzenleuchter
5ecd86aa40 Update hwcomposer include paths
In preparation of new hwcomposer interface, updating
existing includes to include specific version.
Note: IComposerCommandBuffer.h was moved, renamed and clang
formated, but otherwise had no code changes.
Bug: 71513561
Test: compile

Change-Id: If34cb6f63012592a245708109590653ace7009f5
2018-01-22 11:51:38 -08:00
Lloyd Pique
2765f9d406 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
2018-01-11 13:04:50 -08:00
Chia-I Wu
e3c695c8e6 Merge "graphics: improve PRESENT_OR_VALIDATE_DISPLAY support" am: f43ab227a5 am: 8e1ec23a5d
am: a72e80eafa

Change-Id: I40e32ddcb9646f08e1cb0b7a0eaa137ea4b6b94b
2017-12-21 17:40:56 +00:00
Chia-I Wu
a72e80eafa Merge "graphics: improve PRESENT_OR_VALIDATE_DISPLAY support" am: f43ab227a5
am: 8e1ec23a5d

Change-Id: I856a4bfc708f34a331f83e1466e689a2fa5427b7
2017-12-21 07:30:24 +00:00
Chia-I Wu
cdc287ba06 graphics: improve PRESENT_OR_VALIDATE_DISPLAY support
There is no cap defined for PRESENT_OR_VALIDATE_DISPLAY in HIDL so
it must always work.  Make sure it does not call HWC2 presentDisplay
when the underlying HWC2 does not support
HWC2_CAPABILITY_SKIP_VALIDATE.

Bug: 70407085
Test: boots
Change-Id: I54a4400e09e669c5064f05739f595ed978dcc713
2017-12-12 09:37:19 -08:00
Xin Li
bb9e38fef9 Merge commit '1a06284b24f5eb7bb9c1fea0817da8898b3b1bff' from
oc-mr1-dev-plus-aosp into stage-aosp-master

Change-Id: I2a044eb8c9981d0a8198ffe2df55559afbd76341
Merged-In: I4fb9f18884f7ef21162015a0032c4431444f7025
2017-11-14 12:08:38 -08:00
Steven Moreland
c2f829a1d2 Updating makefiles for hidl_interface.
Bug: 64487114
Test: manual
Merged-In: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
Change-Id: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
2017-11-13 11:39:07 -08:00
Steven Moreland
8db261bc99 Updating makefiles for hidl_interface.
Bug: 64487114
Test: manual
Merged-In: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
Change-Id: Ie13d9e014cf2b81c18c67f551b4644fb9f0ba812
2017-11-13 10:00:18 -08:00
Steven Moreland
a1169dd600 Update makefiles for hidl_interface.
Bug: 35570956
Test: manual
Change-Id: I7a220b78ee081240e1dc30ef5672ba39e3e98375
2017-11-10 09:06:55 -08:00
Chia-I Wu
d4bb253b18 graphics: add OWNERS file to default implementations am: e3b1836d90 am: d9c63996ce
am: eb4eba96c9

Change-Id: Ieef144876dfa608ddf34de391ce40e8fd8d6c7c4
2017-11-07 19:12:52 +00:00
Chia-I Wu
eb4eba96c9 graphics: add OWNERS file to default implementations am: e3b1836d90
am: d9c63996ce

Change-Id: I3b582fba337306fe2fb32b5b480ccef7d763a97d
2017-11-07 19:00:29 +00:00
Chia-I Wu
23dbc0f5ab graphics: support FB HAL using HWC2OnFbAdapter am: 16e8ed254d am: 20b073fe6c
am: 85ade632ce

Change-Id: I6f020f5fbe0ecd04d5115e1553169b23bf3d196f
2017-11-07 18:23:51 +00:00
Chia-I Wu
85ade632ce graphics: support FB HAL using HWC2OnFbAdapter am: 16e8ed254d
am: 20b073fe6c

Change-Id: I3e50c5f00b8385a33ff1d04622102ca041cc408d
2017-11-07 18:19:19 +00:00
Chia-I Wu
e051dcef99 graphics: require validateDisplay after onRefresh am: 8101b24ca7
am: a565609b83

Change-Id: I713f68f0b789acac0ab1340f1a2de9a514a8079d
2017-11-07 18:19:13 +00:00
Chia-I Wu
e3b1836d90 graphics: add OWNERS file to default implementations
Test: none
Change-Id: I76a3c84a1fcb61dffa4641ec2120e484752bdf5b
2017-11-07 08:53:12 -08:00
Chia-I Wu
16e8ed254d graphics: support FB HAL using HWC2OnFbAdapter
FB (framebuffer) HAL has been replaced by HWC HAL for 5+ years, but
we still support the legacy path in SurfaceFlinger.  Devices using
the legacy path cannot be Treblized.

This change allows such devices to use HIDL IComposer, by adding
support for FB HAL in the default implementation.

Test: boots hikey960
Change-Id: Ie9050bbcaac0fd5b134786f4f9f0f5075f4ebd0c
2017-11-06 15:08:07 -08:00
Chia-I Wu
8101b24ca7 graphics: require validateDisplay after onRefresh
After initialization or onRefresh, we want to make sure
validateDisplay is called before presentDisplay.

Bug: 67505273
Test: manual
Change-Id: Id876d9251586aaaf552ca82c52f8f902af364251
2017-11-06 15:08:07 -08:00
Steven Thomas
bc67a6a8fb Guard against racy ComposerClient reconnection
The hardware composer service has a rule that only one client can be
connected at a time. The surface flinger process, when transitioning
composer ownership from surface flinger to vr flinger, will destroy the
current client on one thread and create a new client on another
thread. Although surface flinger ensures that these events happen in the
expected sequence (delete then create), the requests sometimes land in
the hardware composer service in inverted order, causing the creation
request to fail with an error.

Instead of failing with an error, block for a brief period (1 second)
until the existing client is removed, then proceed to initialize the new
client. This gives us enough time to ensure an inverted
creation/destruction order doesn't cause client creation to fail, while
avoiding a deadlock if the existing client is never destroyed.

Bug: 62925812

Test: - Transitioned to/from vr flinger hundreds of times, and confirmed
I no longer see sporadic composer client creation failure due to an
already existing client.

- Ran the vts graphics composer tests and confirmed they all pass.

Change-Id: I40be1fb0cb3d42ddb5a9fc159188886e9f5b6267
2017-11-06 15:08:07 -08:00
Chia-I Wu
179aa67cfc Merge "graphics: require validateDisplay after onRefresh" 2017-10-26 04:45:04 +00:00
TreeHugger Robot
8b6afd52e2 Merge "graphics: early return in CommandWriterBase::writeQueue" 2017-10-24 23:50:29 +00:00
Steven Moreland
1d7374c5e1 Update for Soong java makefiles. am: c3e80fa01e am: 0fff75dee1 am: 6c811964a1
am: 116161d94e

Change-Id: I33643636e2511de77fdf7de57777eb67edee2e52
2017-10-11 16:39:21 +00:00
Steven Moreland
116161d94e Update for Soong java makefiles. am: c3e80fa01e am: 0fff75dee1
am: 6c811964a1

Change-Id: I85ccbb4a15cd18938607f5bca4e065b9d7e0182b
2017-10-11 16:31:07 +00:00
Steven Moreland
0fff75dee1 Update for Soong java makefiles.
am: c3e80fa01e

Change-Id: Ia8835f9c95bd98a96f5fd3aff11191e7d3726fb9
2017-10-11 16:23:54 +00:00
Steven Moreland
c3e80fa01e Update for Soong java makefiles.
Test: pass
Bug: 33420795
Change-Id: Id9b1919a19b8ff682738cfb0869a479b4dbb4293
2017-10-10 23:07:20 +00:00
Chia-I Wu
1791e78820 graphics: early return in CommandWriterBase::writeQueue
When there is no data to be written, return early.

Bug: 67512553
Test: manual
Change-Id: I4e8dc72ec22293fac7a84b38c98e29d5cf7f78b6
2017-10-10 10:23:59 -07:00
Chia-I Wu
68b60c45fd graphics: require validateDisplay after onRefresh
After initialization or onRefresh, we want to make sure
validateDisplay is called before presentDisplay.

Bug: 67505273
Test: manual
Change-Id: Id876d9251586aaaf552ca82c52f8f902af364251
2017-10-06 12:40:53 -07:00
Steven Moreland
9b019ac4fe Merge "Remove useless Android.mk files." am: 75d5cf515a am: f27cfa15d7 am: 33dc30ce49
am: 0653f3b212

Change-Id: I7c2da3cf30da7b4a1eda7e5369e9caa5ebab2462
2017-10-05 21:52:50 +00:00
Steven Moreland
0653f3b212 Merge "Remove useless Android.mk files." am: 75d5cf515a am: f27cfa15d7
am: 33dc30ce49

Change-Id: Ia35d20e0fc1df6f7c46b5581537d7ed387965899
2017-10-05 21:51:13 +00:00
Steven Moreland
f27cfa15d7 Merge "Remove useless Android.mk files."
am: 75d5cf515a

Change-Id: I8c0918c4a787cc3f4c7c69f52737d3a0d9d64426
2017-10-05 21:44:26 +00:00
Treehugger Robot
75d5cf515a Merge "Remove useless Android.mk files." 2017-10-05 21:40:27 +00:00
Steven Moreland
4b60470f1a Remove useless Android.mk files.
These have been c/p'd all over the place.

Test: m -j nothing
Bug: 33420795
Change-Id: I77979866dbb2345a41a873c84ec3fccd7b127510
2017-10-04 15:52:40 -07:00
Steven Moreland
70bfb9d250 Merge "Update for hidl adapter module defaults." am: 988c977079 am: 861651985f am: b53e6ad535
am: 9a17f41f6f

Change-Id: I78d9292068b372238554fd9d35128e69f5b5f9d2
2017-10-04 21:54:11 +00:00
Steven Moreland
9a17f41f6f Merge "Update for hidl adapter module defaults." am: 988c977079 am: 861651985f
am: b53e6ad535

Change-Id: I23269fb7a9bdd352e670a80f390527d9eef31412
2017-10-04 21:51:00 +00:00
Steven Moreland
861651985f Merge "Update for hidl adapter module defaults."
am: 988c977079

Change-Id: I289818be1b30397391847ba1c532d1014fdbed27
2017-10-04 21:45:09 +00:00
Steven Moreland
527fd76a0e Update for hidl adapter module defaults.
Test: pass
Change-Id: Idc6a943149a279bf17cfcfd0f2571473e53bbbbf
2017-10-04 12:47:03 -07:00
Steven Moreland
91799c6cc7 Merge "Fix typo in update makefiles." am: 9960148420 am: f07e364ce3 am: 71a193a425
am: 9fdd241905

Change-Id: I1c852fa6600fecc44d5afd1a65a5f51c43ecf71c
2017-09-27 00:02:52 +00:00
Steven Moreland
9fdd241905 Merge "Fix typo in update makefiles." am: 9960148420 am: f07e364ce3
am: 71a193a425

Change-Id: I45ae43f07323254212532acbf0f891d11143b05f
2017-09-26 23:58:51 +00:00
Steven Moreland
f07e364ce3 Merge "Fix typo in update makefiles."
am: 9960148420

Change-Id: I949634e72f817f3a5411130e968acd8efd1d7725
2017-09-26 23:51:07 +00:00
Steven Moreland
a5299ee739 Fix typo in update makefiles.
Bug: 37518178
Test: pass
Change-Id: Ic401b3a473f15ca4c01e58b3072e19db7c31b653
2017-09-26 21:59:43 +00:00
Steven Moreland
7741c0e17b Update makefiles for hidl adapter. am: 26a0bb2762 am: 73949c1d7e am: b94d0c7290
am: 97228c0b7d

Change-Id: Ic4b459b7c1a4325453945b0b00db8f44e4e77c26
2017-09-26 13:36:09 +00:00
Steven Moreland
97228c0b7d Update makefiles for hidl adapter. am: 26a0bb2762 am: 73949c1d7e
am: b94d0c7290

Change-Id: If766cffbcc003cc0cc5eb98969b924aa918fff44
2017-09-26 12:53:13 +00:00
Steven Moreland
73949c1d7e Update makefiles for hidl adapter.
am: 26a0bb2762

Change-Id: I3a811f5cd49bd4e81e8fcd5c8e88922115812539
2017-09-25 23:14:44 +00:00
Steven Moreland
26a0bb2762 Update makefiles for hidl adapter.
Bug: 37518178
Test: manual
Change-Id: I50e999907d3c64d2b039272b823971998da64d1b
2017-09-25 18:35:56 +00:00
Jaekyun Seok
81104ae5ef Add 'vendor.' prefix to a vendor HAL service name
To prevent property name collisions between properties of system and
vendor, 'vendor.' prefix must be added to a vendor HAL service name.
You can see the details in http://go/treble-sysprop-compatibility.

Test: succeeded building and tested on a walleye device
Bug: 36796459
Change-Id: I4e8fbee791ec917a8f627a1366f4d44ec7e6febc
2017-09-12 08:01:42 +09:00
Chia-I Wu
13570aaa2f Merge "graphics: discard stale data from message queue" into oc-mr1-dev am: 710b7085f9
am: 481885c52d

Change-Id: I4b9387e553c33c4e67768f3d9dba65b092e98914
2017-09-08 22:41:55 +00:00
Chia-I Wu
48ffe289b0 graphics: discard stale data from message queue
Our use of message queues is synchronous.  If there are already data
in the queue when writeQueue is called, we know they are stale and
can be discarded.

Bug: 65449888
Test: manual
Change-Id: Ie29b8a7386c9733c183a6c3569e3572efa62cbc2
2017-09-08 11:51:57 -07:00
Zhuoyao Zhang
425e9672d5 Fix VtsHalGraphicsComposerV2_1TargetTest
Bug: 65252969
Test: make vts
Change-Id: Id4543b385ca9dce532bbf08ef206897924d66acb
2017-08-31 19:57:17 +00:00
Zhuoyao Zhang
6afb992759 Update vts test to use the updated test template.
* For registerTestService/getServiceName, no need to pass
  any hard coded string of HAL service FQName.
* Affect test: VtsHalCameraProviderV2_4TargetTest,
               VtsHalGraphicsComposerV2_1TargetTest,
               VtsHalNeuralnetworksV1_0TargetTest

Bug: 62946472
Bug: 64203181

Test: make vts
      vts-tradefed run vts -m VtsHalCameraProviderV2_4Target

Merged-In: If365ab2ed9a91eb4013d71769804b9d4bf089d66
Change-Id: Id0bddbc2949337147557f45cc60dbfaa114ce25e
(cherry picked from commit d71b654d6d)
2017-08-29 17:44:10 +00:00
Zhuoyao Zhang
a983b8fe62 Revert "Revert "Update vts test to use the updated test template.""
This reverts commit 43d7498d52.

Change-Id: If365ab2ed9a91eb4013d71769804b9d4bf089d66
2017-08-29 17:25:46 +00:00
Tony Mak
43d7498d52 Revert "Update vts test to use the updated test template."
This reverts commit d71b654d6d.

Reason for revert: It breaks some targets in master
                   Example error: https://android-build.googleplex.com/builds/submitted/4303994/sailfish-userdebug_fastbuild3_linux/latest/view/logs/build_error.log

Change-Id: I63a90318bde8869972a8fc4b9a2cc36db26037f5
2017-08-29 10:14:32 +00:00
Zhuoyao Zhang
d71b654d6d Update vts test to use the updated test template.
* For registerTestService/getServiceName, no need to pass
  any hard coded string of HAL service FQName.
* Affect test: VtsHalCameraProviderV2_4TargetTest,
               VtsHalGraphicsComposerV2_1TargetTest,
               VtsHalNeuralnetworksV1_0TargetTest

Bug: 62946472
Bug: 64203181

Test: make vts
      vts-tradefed run vts -m VtsHalCameraProviderV2_4Target

Change-Id: Id0bddbc2949337147557f45cc60dbfaa114ce25e
2017-08-28 18:45:12 +00:00
Zhuoyao Zhang
87fa1f78f0 Update VtsHalGraphicsComposerV2_1TargetTest
* Update to run against different service names.

Bug:38348289
Bug:64203181

Test: make vts
      vts-tradefed run vts -m VtsHalGraphicsComposerV2_1TargetTest

Change-Id: I7c4643935cf5f0ea63b0a97d3079559d9c4f5ec2
2017-08-16 14:37:15 -07:00
Steven Moreland
dfd8287506 Updating all makefiles.
Bug: 64487114
Test: none
Merged-In: I8608c8f636c35f21e4246a805a9eff6d14124e0a
Merged-In: I2fa89b6661c39859ec4fb62c4bb0a05a35e645f0
Merged-In: Ifdc3c17cb2b85c18b37dac2d03bb5c8935c23180
Change-Id: I170fa1c4fe39f8109b1670db58ef99bb11afc0be
2017-08-14 20:25:09 +00:00
Steven Moreland
ff308ea6ba Updating all makefiles.
Bug: 64487114
Test: none
Merged-In: I8608c8f636c35f21e4246a805a9eff6d14124e0a
Merged-In: I2fa89b6661c39859ec4fb62c4bb0a05a35e645f0
Change-Id: Ifdc3c17cb2b85c18b37dac2d03bb5c8935c23180
2017-08-11 22:58:47 +00:00
Tri Vo
70029d3378 Merge "Graphics tests statically link to HAL definition libs." into oc-mr1-dev am: 43b3865a3d
am: ed296a8217

Change-Id: Icd03586ac54fda2b01dc1158d4e3ea804be6454c
2017-08-10 03:53:00 +00:00
TreeHugger Robot
43b3865a3d Merge "Graphics tests statically link to HAL definition libs." into oc-mr1-dev 2017-08-10 03:42:37 +00:00
Tri Vo
1b7c33562f Graphics tests statically link to HAL definition libs.
These tests now statically links to HAL def libs which are
not guaranteed to be on the device.

Bug: 64040096
Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check
--skip-preconditions --module VtsHalGraphicsMapperV2_0Target
Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check
--skip-preconditions --module VtsHalGraphicsComposerV2_1Target
Change-Id: I83b68dafbd161f88394f67dbda14f9957ddf7232
2017-08-07 14:07:52 -07:00
Steven Thomas
87f47a4aa2 Merge "Guard against racy ComposerClient reconnection" into oc-mr1-dev am: 85e93f0a3b
am: bad6446522

Change-Id: I78b2627f79c9b2baa920a4552e2480df262702df
2017-08-07 18:11:07 +00:00
Steven Thomas
85e93f0a3b Merge "Guard against racy ComposerClient reconnection" into oc-mr1-dev 2017-08-07 17:53:13 +00:00
Justin Yun
723c2dbd43 Update make file for vndk enabled. am: 608d773ef8
am: d66371512c

Change-Id: I35b778c39c2349346278deb6dea56b8cd3701f7d
2017-08-05 02:17:38 +00:00
Justin Yun
608d773ef8 Update make file for vndk enabled.
Update the Android.bp generated with hidl-gen.

Test: build with and without BOARD_VNDK_VERSION=current
Bug: 63866913
Change-Id: I1a9db1df49e0f13c5790da2b118ae9ec63ba34a7
2017-08-04 14:12:23 +09:00
Chia-I Wu
58fbba63b7 Merge "graphics: ignore/reduce spurious vsync in VTS" into oc-dr1-dev
am: d1231716d3

Change-Id: I6dae4a4f7e287abd7438ece780cefca2bf19ac39
2017-08-03 17:46:34 +00:00
Tri Vo
0621d2f517 Update Android.bp HIDL makefiles am: f5d136c231
am: 7694738e26

Change-Id: I7592025d540bbe46d2e2726ae39ae34f352a1a30
2017-08-03 15:37:24 +00:00
Tri Vo
f5d136c231 Update Android.bp HIDL makefiles
Allow HAL definition libs to be static.

Bug: 32920003
Bug: 64040096
Test: update-all-google-makefiles.sh
Change-Id: I1483d572bea6799717d1614fb7d52fe225e31104
2017-08-03 00:30:01 +00:00
TreeHugger Robot
fce103b8c5 Merge "graphics: ignore/reduce spurious vsync in VTS" 2017-08-01 18:44:32 +00:00
Steven Thomas
4492a30e14 Guard against racy ComposerClient reconnection
The hardware composer service has a rule that only one client can be
connected at a time. The surface flinger process, when transitioning
composer ownership from surface flinger to vr flinger, will destroy the
current client on one thread and create a new client on another
thread. Although surface flinger ensures that these events happen in the
expected sequence (delete then create), the requests sometimes land in
the hardware composer service in inverted order, causing the creation
request to fail with an error.

Instead of failing with an error, block for a brief period (1 second)
until the existing client is removed, then proceed to initialize the new
client. This gives us enough time to ensure an inverted
creation/destruction order doesn't cause client creation to fail, while
avoiding a deadlock if the existing client is never destroyed.

Bug: 62925812

Test: - Transitioned to/from vr flinger hundreds of times, and confirmed
I no longer see sporadic composer client creation failure due to an
already existing client.

- Ran the vts graphics composer tests and confirmed they all pass.

Change-Id: I40be1fb0cb3d42ddb5a9fc159188886e9f5b6267
2017-07-31 18:38:01 -07:00
Zhuoyao Zhang
d710dd540d Add graphics test owners file.
Test: none.
Change-Id: I00c7568c8ae350edc2a442b005ab84ea6a0988e2
2017-07-28 11:25:28 -07:00
Chia-I Wu
4f49038e53 graphics: ignore/reduce spurious vsync in VTS
Bug: 62802718
Test: VTS
Change-Id: I1ed73e0b2f14414f540865a96e6bd5ac1599fbf3
2017-07-26 16:53:56 +00:00
Chia-I Wu
e0ff3e4a26 graphics: ignore/reduce spurious vsync in VTS
Bug: 62802718
Test: VTS
Change-Id: I1ed73e0b2f14414f540865a96e6bd5ac1599fbf3
2017-07-24 11:21:33 -07:00
Chia-I Wu
ae00f5c39c graphics: sideband streams are not buffers
We should call native_handle_clone instead of IMapper::importBuffer
on sideband stream handles.

Bug: 63707399
Test: manual
Change-Id: Ie07e50f6bb771f3c7a69d29e36f60b149dc6af95
2017-07-17 10:33:16 -07:00
Fabien Sanglard
47bd6b4a71 Skip Validate
am: 11ec393689

Change-Id: I47c68719ce214ee40ed0e58ec1a0ddc9c14a2b2a
2017-06-22 05:58:08 +00:00
Fabien Sanglard
a7b0e2785b Skip Validate
am: 11ec393689

Change-Id: I6e1121c116d51ad143878ea88f7d33c4af9f9e5b
2017-06-22 05:57:18 +00:00
Fabien Sanglard
11ec393689 Skip Validate
b/37474580
b/62806392

Test: marlin, ryu

Change-Id: I9d4ece40a8a093d768bcb4edd332cf0188735e66
2017-06-22 04:48:33 +00:00
Daniel Nicoara
d47f4a9d65 Move utility classes in a separate static target
Split up utility classes that can be re-used in other IComposer related
tests (such as the IVrComposerClient tests).

Changes:
 * Move GraphicsComposerCallback into separate module
 * Extract TestCommandReader in separate module
 * Extract Composer::execute() from test class

Bug: 38203529
Test: Compiled
Change-Id: I0d1193469e9dd94c477a63058f98111c162dfa99
2017-05-30 15:53:19 -04:00
Steven Moreland
f203167814 Update makefiles. (2/2)
am: 76cfb84140

Change-Id: I24d21438a5b2f447d2160929c6ff6e17b2b66820
2017-05-22 17:15:20 +00:00
Steven Moreland
76cfb84140 Update makefiles. (2/2)
Adds default configuration for all hals.

Bug: 38415912
Test: pass
Change-Id: Idd1f3a2b7b16ad956d31784a513e93a066cdd02e
2017-05-19 15:54:03 -07:00
Chia-I Wu
b8b218b88b Merge "graphics: set maxThreads to 4 for the composer" into oc-dev
am: 15e33c6d17

Change-Id: I4e5c759f467d6085e9dc1d57ca65db0273343eef
2017-05-12 19:59:18 +00:00
Chia-I Wu
ec71f00148 graphics: set maxThreads to 4 for the composer
There are implmentations that can dead lock when calling certain
functions in certain states.  It works fine before HIDL because
SurfaceFlinger calls those functions in another thread.  We allow
for 4 hwbinder threads in this commit to simulate how SurfaceFlinger
calls hwcomposer.

Bug: 38183197
Test: camera, videos, multi windows, screencap, screenrecord
Change-Id: Ie05b2ca349b8c1ed9a3ac962981434f2efee92d9
2017-05-12 08:40:48 -07:00
Steven Moreland
a32ebce372 Update makefiles for c++-sources and c++-headers. (2/2)
am: bc71124120

Change-Id: Icf36068a4d863a8520854c7a83e51f960c188e12
2017-05-11 00:48:55 +00:00
Steven Moreland
bc71124120 Update makefiles for c++-sources and c++-headers. (2/2)
Test: pass
Bug: 38174080
Change-Id: Icad451f9f9ad5f46412356a4171a8a1222f8e545
2017-05-09 19:58:43 -07:00
Steven Moreland
5c63b11f76 Remove redundant dependencies
android.hidl.base@1.0 and android.hidl.manager@1.0 are built into libhidltransport.

Test: links
Bug: 33276472
Merged-In: I08aaad80f7e2fc262aa3a8b66fe932e8133a928d
Change-Id: I08aaad80f7e2fc262aa3a8b66fe932e8133a928d
2017-05-02 15:29:30 -07:00
Steven Thomas
58da77ea4b Avoid crash when setting buffer on deleted layer
When setLayerBuffer() was called on a layer previously destroyed by
destroyLayer() the code would crash. Instead, return an error.

Bug: 37159844

Test: Ran vr flinger in a way that would trigger the crash, and
confirmed that I now get error logs instead of crashing. Unfortunately
the error code is consumed by the Composer wrapper class and not
propagated back to the caller, but that's a separate issue (b/37901601).

Change-Id: I75a5b954d47a1deac44d03851f60f347085eca89
2017-05-02 17:39:39 +00:00
Chia-I Wu
2ae85702f7 graphics: use mapper from the composer
We must use the mapper HAL instead of gralloc0/gralloc1 from the
composer.

Bug: 37540361
Test: boots on marlin, angler, and ryu
Change-Id: I5a3ff6a025bf51a3507a4f33fa77e9506a6f1ec9
2017-04-25 12:52:50 -07:00
TreeHugger Robot
cb1d509d21 Merge "libhwcomposer-client: mark as vendor_available" into oc-dev 2017-04-13 04:12:19 +00:00
Iliyan Malchev
f140afe383 composer: route binder traffic over vndbinder
b/36683636 Hwcomposer is starting binder threads

Test: sailfish

Change-Id: I28ad19b5036c6fbf514770369888ca11892bf212
Signed-off-by: Iliyan Malchev <malchev@google.com>
2017-04-13 00:25:08 +00:00
Steven Moreland
17f0c0dde7 Merge changes from topic 'hidl-vendor-available' into oc-dev
* changes:
  Update makefiles (2/2).
  Update makefiles.
2017-04-12 22:13:58 +00:00
Brian C. Anderson
21c2e11345 Merge "Add PRESENT_FENCE_IS_NOT_RELIABLE" into oc-dev 2017-04-12 21:26:24 +00:00
Brian Anderson
9af5d942a6 Add PRESENT_FENCE_IS_NOT_RELIABLE
Test: adb shell /data/nativetest/libgui_test/libgui_test
  --gtest_filter=*GetFrameTimestamps*
Bug: 36730849, 36887025

Change-Id: Ide992e4dda7840f7982237943256ea3019eda434
2017-04-12 11:28:55 -07:00
Steven Moreland
1c8bff2ccb libhwcomposer-client: mark as vendor_available
By setting vendor_available, the following may become true:

* a prebuilt library from this release may be used at runtime by
  in a later releasse (by vendor code compiled against this release).
  so this library shouldn't depend on runtime state that may change
  in the future.
* this library may be loaded twice into a single process (potentially
  an old version and a newer version). The symbols will be isolated
  using linker namespaces, but this may break assumptions about 1
  library in 1 process (your singletons will run twice).

Background:

This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.

At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.

It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:

https://android-review.googlesource.com/368372

None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.

Bug: 36426473
Bug: 36079834
Test: m -j libhwcomposer-client
Test: attempt to compile with BOARD_VNDK_VERSION := current
Change-Id: I735b861fcc25bc1048ce0ce3ad48432980248b06
2017-04-12 04:29:48 +00:00
Steven Moreland
3b36a83a2e Update makefiles (2/2).
Test: pass
Change-Id: Ic7e6289c7b69785491708ce0acbb657f4c704229
2017-04-11 09:58:03 -07:00
Chia-I Wu
79d13ff0f5 graphics: revise gralloc interfaces
Revise IAllocator and IMapper to reduce IPC and to support gralloc0
devices.

Specifically, IAllocator is trimmed down to have essentially only

    allocate(BufferDescriptor descriptor, uint32_t count)
        generates (Error error,
                   uint32_t stride,
                   vec<handle> buffers);

The ability to allocate buffers with shared backing store is
removed.  ProducerUsage and ConsumerUsage are moved to the
graphics.common package and are merged and renamed to BufferUsage.
BufferUsage's bits follow gralloc0.

IMapper gains

    typedef vec<uint32_t> BufferDescriptor;
    createDescriptor(BufferDescriptorInfo descriptorInfo)
          generates (Error error,
                     BufferDescriptor descriptor);

where BufferDescriptor is an implementation-defined blob.  lockFlex
is replaced by lockYCbCr.  All getters are removed.

Reference counting with retain/release is replaced by
importBuffer/freeBuffer.

Most if not all gralloc1 features are not used by the runtime yet.
There is also not too much test written for them.  As such, they
tend to behave differently between implementations and cannot be
used reliably.

Bug: 36481301
Test: builds and boots on Pixel
Change-Id: I1d31105120517ea2c128c7a19297acf3bfd312bb
2017-04-10 11:15:54 -07:00
Keun-young Park
a232a45b59 add components necessary for bootanim to animation class
- necessary for running shutdown animation:
 android.hardware.graphics.composer
 android.hardware.graphics.allocator
 android.hardware.configstore

bug: 36526187
Test: many reboots
Change-Id: Iba3eefddd2bd33c28152c17081a4ad13619d330d
2017-03-31 16:56:08 -07:00
Andreas Huber
40d3a9bd8c Convert all comments into "doxygen-ready" comments.
Bug: 36453077
Test: mma
Change-Id: I0b1f77dfae5d2258969e33d85ecf45401ffbdfaa
2017-03-29 08:53:58 -07:00
Steven Moreland
561b602a99 Update makefiles for hwtypes.h
Test: pass
Change-Id: I8e17eb8fec5d2f04c526476a866c8dd54ccb556c
2017-03-28 15:18:20 +00:00
Steven Moreland
c8e2b3f7c5 Remove viral readproc group dependency.
This has been copy pasted and isn't actually required.

Test: all hals manually tested to work on internal marlin (which have them binderized).
  Note: tv hals not tested (and they never have been). Filed b/36562029
  Note: for thermal hal, could only run VTS/check logs for errors.
Test: lshal outputs proper stuff
Fixes: 31928447
Change-Id: Id1be584dc0fa2d70e9189b922335146bf6d1382d
2017-03-23 19:49:37 +00:00
Fabien Sanglard
9b117a4dd2 Fix library dependency, remove undeclarate deps
Remove undeclared dependency of libhwcomposer-client on Hwc.h which
created a circular dependency.

Test: Manual
Change-Id: I74d5c4e2db5d247f8b406d1ea42fece41e76659d
2017-03-21 09:43:36 -07:00
Fabien Sanglard
0d55a21044 Add graphics composer support for HWC > HWC1.1
Test: Ryu, Marlin
Change-Id: I58a7394f427534b942d64c93b1891a756c5f510c
2017-03-20 12:24:29 -07:00
Yuexi Ma
ed2bb4e8f8 Change vts target base test class name
Test: make vts succeed, vts kernel tests and nfc hal tests passed
Change-Id: I95f10ad7a66f261c9030357edd411fe6d94150e8
2017-03-10 21:14:48 +00:00
TreeHugger Robot
88cfac9540 Merge "graphics: fix a potential use after free" 2017-03-10 20:51:48 +00:00
TreeHugger Robot
d46602235b Merge "graphics: really reset HWC2 on SF crashes" 2017-03-10 20:42:39 +00:00
Chia-I Wu
41a1c15a40 graphics: fix a potential use after free
We cannot lookup _and_ update buffer cache entry in lookupBuffer.
The old buffer is still in use by hwcomposer2.  Add updateBuffer to
do the update after the new buffer has replaced the old buffer in
hwcomposer2.

While at it, s/BufferClone/BufferCacheEntry/g.

Bug: 36064845
Test: manual
Change-Id: I59b61c0198ad528c40020fdebbe27a6cc359226f
2017-03-10 10:53:32 -08:00
Chia-I Wu
6c84f7ee8c graphics: really reset HWC2 on SF crashes
Perform a final presentDisplay to clear the screen and get HWC2 out
of any special state (e.g., some implementations put themselves in
special states between validateDisplay and presentDisplay).  Our
only portable choice really is to abort(), but that is not an option
because we have other clients such as VTS or VR.

Bug: 35872161
Test: manual
Change-Id: I9028705607d1b86d418a379c6e90e833d638b3f5
2017-03-09 09:20:11 -08:00
Steven Moreland
48c52249e4 hidl_default to all targets.
find hardware/interfaces -type f -not -path "*/.git/*" \
-exec sed -i -e '/cc_[A-Za-z_]\+/ { N; s/$/\n    defaults:
\["hidl_defaults"\],/ }' {} \;
./hardware/interfaces/update-makefiles.sh

Test: pass
Bug: 35840847
Change-Id: If10c464d2f000b85c8d698fe11a4f3fc4cfad282
2017-03-08 19:31:53 -08:00
Chia-I Wu
8cc5a15410 graphics: clean up composer VTS tests
Add libVtsHalGraphicsComposerUtils which provides a wrapper to
IComposer.  Port tests to be based on
libVtsHalGraphicsComposerUtils.

Test: manual
Change-Id: I400c347b54702c3d45954e6cdc101d3dc1241efd
2017-03-07 12:26:03 -08:00
Yuexi Ma
50d7e27b3c change all vts hidl tests to use VtsHalHidlTargetBaseTest (internal master)
Bug: 33385836
Test: mma
Change-Id: Ide3ebc4a9db76257f33bcfb0c1f13d2ee33eeaa8
2017-02-28 22:27:28 +00:00
TreeHugger Robot
2bb6dc745e Merge "hwcomposer HAL uses "default" service name" 2017-02-25 02:40:45 +00:00
Yifan Hong
69ab674dce hwcomposer HAL uses "default" service name
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.

Test: builds

Bug: 33844934
Change-Id: I0c7987ffa7b22bb7386a4a1320242b3248e434e4
2017-02-24 16:55:20 -08:00
TreeHugger Robot
2653620a61 Merge "Remove viral dependency on libhwbinder. (2/2)" 2017-02-24 23:25:26 +00:00
Steven Moreland
7e73d5b908 Remove viral dependency on libhwbinder. (2/2)
find hardware/interfaces -name Android.mk -exec sed -i -e '/libhwbinder
\\/d' {} \;
find hardware/interfaces -name Android.bp -exec sed -i -e
'/"libhwbinder"/d' {} \;
./hardware/interfaces/update-makefiles.sh

Note, automotive has some actual dependencies on libhwbinder, filed
b/35758626 for this.

Test: everything links
Test: (sanity) booted marlin on internal master with these changes
Bug: 35710429
Change-Id: I6d0726c8130d00684b978efbdd48e3ae396f12e5
2017-02-24 12:18:01 -08:00
Yifan Hong
33df4dbeb3 Merge "gralloc HAL uses "default" service name" 2017-02-24 18:21:11 +00:00
Chris Phoenix
c8e3295842 gralloc HAL uses "default" service name
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.

Test: builds

Bug: 33844934
Change-Id: Ic3859ccf21e7ee5177f47cb06e3e0c93dd572bf6
2017-02-23 11:28:54 -08:00
Yifan Hong
442b8933ea hwcomposer HAL uses "default" service name
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.

Test: builds

Bug: 33844934
Change-Id: I3d51429681d834f53dc5f6765e97675eafdceda4
2017-02-22 18:40:53 -08:00
Tri Vo
d94a7d2df9 Remove .vts spec files
Test: mmma hardware/interfaces
Change-Id: Idae97ce60a6368cfa685ae6b2d71b9ad163e8605
2017-02-22 12:53:52 -08:00
Zhuoyao Zhang
8422f6aa04 Update the test binary and source file name on master.
* To confirm with Vts naming convention.

Bug: 35273456
Test: mma
Change-Id: I845da64085253cd02480465479618308045a52ed
2017-02-21 20:47:18 -08:00
Chia-I Wu
4339871180 graphics: composer should not die with its client
Fail elegantly when any of IComposerCallback method returns an
error.

Bug: 35334576
Test: manual
Change-Id: If84a265d3bfa01178ea7316d7fe3ba7941ad127f
2017-02-17 13:24:52 -08:00
Ryan Campbell
2caf0a60f3 Remove coverage flags from tests.
Remove unnecessary coverage flags from HAL tests.

Bug: 32749731
Test: none
Change-Id: I7e4e3bce2d9d444bfa8475c140bce2ee7e3b0c0d
2017-02-14 16:50:34 -08:00
Zhuoyao Zhang
f008f8fdc4 Merge "Update .vts files on master based on the latest .hal file and hidl-gen" 2017-02-14 18:51:27 +00:00
Zhuoyao Zhang
3bef939f94 Update .vts files on master based on the latest .hal file and hidl-gen
Test: mma
Change-Id: I9558f300505db83e26f7c241c5cf729cd005a07b
2017-02-13 18:03:06 -08:00
Steven Moreland
a0da1a1c3d Move hidl shims to the vendor partition. (2/2)
We need google shims on the vendor partition because they are providing
an implementation of a vendor defined interface. They were written by
google just as a courtesy/to make the transition easier. They're
basically a set for vendors to assemble their hal implementations
from.

Bug: 34135607
Test: marlin persist.hal.binderization on/off
Change-Id: I2e2af5af39264cf290259755bb9b2eb9827a21f5
2017-02-13 15:03:41 -08:00
TreeHugger Robot
86fa244c12 Merge "Update makefiles to use filgroup syntax." 2017-02-10 23:25:52 +00:00
Tri Vo
85120c9490 Update makefiles to use filgroup syntax.
Test: mmma hardware/interfaces
Change-Id: I9f4457c78b7820c242d46359f0debe05d1b3e482
2017-02-10 12:45:19 -08:00
Chia-I Wu
4a71a73843 graphics: use FIFO scheduler in IComposer
Make IComposer default implementation use the same process scheduler
as SurfaceFlinger does.

Bug: 35210697
Test: manual
Change-Id: Ie2ebe1d3fd26505984d9f6c33d63b5db36b0b64a
2017-02-10 12:23:45 -08:00
Tri Vo
ce608bec74 Migrate driver/profiler to test/vts-testcase/hal.
Bug: 34893894
Test: mmma hardware/interfaces

Change-Id: Ic72716577a5f93700c5056986aff55a76b170b5d
2017-02-07 19:13:28 -08:00
Keun Soo Yim
7b9b6ca18f move VTS stub files and non-functional tests
Test: mma
Bug: 34976004
Change-Id: I20273bdc3a05e2986fcf921f65d2afd6d72781e4
2017-02-04 02:45:25 +00:00
Zhuoyao Zhang
e9b43bbe2d Update Andriod.bp for hals.
* Add driver/profiler build rule for all hals.

Test: mma
Change-Id: I98325f7af14fec7dd1bb64b1668de8c7c20ace92
2017-02-03 10:03:01 -08:00
Chia-I Wu
e4b6f6a70d Merge "graphics: get rid of BINDERIZED" 2017-02-02 22:49:31 +00:00
Chia-I Wu
16624b69d6 graphics: get rid of BINDERIZED
It is always on now and all buffers be cloned and registered.
Clients (SF) should make use of the buffer caching mechanism and
pass each unique buffer once, to avoid the overhead.

Test: manual
Change-Id: I74ccbf74e110c8b413a66cfc60044b71ba3f44e3
2017-02-02 09:19:49 -08:00
Chia-I Wu
b00f59df0f graphics: add composer tests to VTS
Test: vts-tradefed run vts -m HalGraphicsComposerHidlTargetTest
Change-Id: I2e695787865d3bb855076acae18fa135064036ab
2017-02-01 15:07:29 -08:00
Chia-I Wu
fed07e87ea graphics: add basic target-side tests for IComposer
Add graphics_composer_hidl_hal_test.

Test: manual execution
Change-Id: I38c2fcd5cfb27dcd0299df389cbf84fe4056de1b
2017-02-01 15:07:29 -08:00
Daniel Nicoara
0a60e4bcbe Introduce ComposerBase interface to allow custom Hwc implementations
Decouples the ComposerClient code which deals with parsing the command buffer
messages sent by SurfaceFlinger from the Hwc code that handles the
commands.

Bug: 33297270
Test: Compiled and verified on device that hwcomposer-2-1 service can
start correctly. SurfaceFlinger can connect to the service and the
system boots up. Also verified SurfaceFlinger runs correctly without
hwcomposer-2-1.
Change-Id: I43357306caea57d262735f4756c379ba9d0138cd
2017-01-26 10:32:27 -05:00
Daniel Nicoara
bd82b81935 Rename CommandWriter to CommandWriterBase
CommandWriter will be used as a base class in extensions of HWC. Renamed
for consistency.

Bug: 33297385
Test: Compiled
Change-Id: Iabe59f37157062961b916d55108cb9f4fb792619
2017-01-23 14:57:15 -05:00
TreeHugger Robot
6b058752c5 Merge "Use MQDescriptor typedefs for cleanup" 2017-01-23 15:56:44 +00:00
Hridya Valsaraju
790db1074c Use MQDescriptor typedefs for cleanup
Test: mm
Bug: 33815422

Change-Id: I41ca833231622a5a72970014cfcac400b512e44a
2017-01-23 15:56:24 +00:00
Daniel Nicoara
3d2b8d63b5 Fix log message using undeclared variable
Bug: None
Test: Compiled with LOG_FATAL() enabled
Change-Id: Iffb709d2bc923bc7428abb1ee326f0ed147c38df
2017-01-13 10:19:00 -05:00
Yifan Hong
a18049ad13 Bp/nFoo -> Bp/nHwFoo.
Test: mma
Bug: 33554989
Change-Id: I4b3f852d20fdfc49f2da671dd3c12d618ffb4140
2017-01-11 13:14:59 -08:00
Chia-I Wu
939e4018c2 graphics: rewrite libgralloc1-adapter
Rewrite libgralloc1-adapter to be based on Gralloc1On0Adapter.
Previously, the adapter targeted maximum portability and maximum
performance.  The rewritten adapter targets ease of use instead.

This also fixes a bug in the adapter's GRALLOC1_FUNCTION_RELEASE.  The
function does not imply native_handle_close/native_handle_delete.  As a
result, IMapper and IComposer are also fixed to close/delete handles.

Test: builds and boots
Change-Id: I5c071453dc950583087ae07967bca2c22866c538
2017-01-06 12:31:26 +08:00
Martijn Coenen
028223775b Remove obsolete references to IPCThreadState/ProcessState.
Threadpool can now be configured/joined if needed with
configureRpcThreadpool() / joinRpcThreadpool().

Bug: 31226656
Test: mma
Change-Id: I0d7d9924cc8c8851cc2b61ebdae906204909890e
2016-12-30 14:00:31 +01:00
Hridya Valsaraju
33351dae85 Templatize MQDescriptor and rename to fmq_sync/fmq_unsync
Bug: 33948735
Test: builds, FMQ unit tests and benchmarks pass.
Change-Id: I5c3beff2c6a69e151e0cb11af299956638cc441b
2016-12-29 14:52:16 -08:00
Chia-I Wu
e4c429ccd2 Merge "graphics: replace non-const references by pointers" 2016-12-23 02:04:27 +00:00
Chia-I Wu
e176835019 graphics: replace non-const references by pointers
Pointers are preferred for output parameters in graphics code.  While at
it, initialize local variables that are for outputs.

Test: builds and boots
Change-Id: I959706ea92949bc2f993ee9beff0c8b0c3121347
2016-12-23 07:37:50 +08:00
TreeHugger Robot
f938ff2124 Merge "Change FMQ header location" 2016-12-20 23:14:42 +00:00
Hridya Valsaraju
89b5e6b318 Change FMQ header location
Bug: 31223612 33295104
Test: make
Change-Id: Ib999317333a13fe205dfa7b198f7edbb6657734b
2016-12-20 07:34:53 -08:00
Dan Stoza
0df10c4e41 HwcClient: Fix plane alpha
Plane alpha was being sent as a float but read as unsigned, which, when
converted to a float was causing things that were supposed to be
translucent to be opaque.

Bug: 33739111
Bug: 33737738
Test: Scrim behind modal dialogs is translucent and there is no more
      glitch when rotating apps

Change-Id: I6896bdbb9928bd1aa7265b3ef25a7a96d54ee227
2016-12-19 15:22:47 -08:00
Chia-I Wu
bb61a72be7 graphics: rework IComposer
Similar to IAllocator, introduce IComposerClient to manage resources.
Rework the interface such that most state changing calls are batched in a
"command buffer" and execute together.  The goal is to reduce the number
of IPC calls needed to set up the composer.

Test: builds and boots
Change-Id: I324009243234c4d2482ca0ef2591377b11530fc9
2016-12-16 10:27:39 +08:00
Yifan Hong
501839495f Update makefiles for hidlizing IBase.
A new dependency android.hidl.base@1.0 is added for
all projects.

Test: mma

Change-Id: Ia70d0eb0d74de06475a339698386d383d491a43a
2016-12-03 01:01:14 -08:00
Steven Moreland
bbff14d4bb Merge "Update makefiles for logging." 2016-11-22 17:25:36 +00:00
Martijn Coenen
70b9a15df0 Use newly introduced hidl_handle.
Bug: 32089785
Test: builds
Change-Id: I27c7d3945e1fe390661bf322987011a00fe9b3fe
2016-11-22 09:03:11 +01:00
Steven Moreland
f8d68ec855 Update makefiles for logging.
Bug: 32943424
Test: pass
Change-Id: Ic88ce6adf04e0e36db53e4cc06ac2ec5a90c011c
2016-11-21 16:28:54 -08:00
Chia-I Wu
0b855f81c8 Merge "graphics: remove duplicated types" 2016-11-21 02:52:34 +00:00
Yifan Hong
6b920e43d3 Split libhidl into base and transport.
Bug: 32756130

Test: mma
Change-Id: Id21cf23abe2910f26bb7895511862443b93dc112
2016-11-18 00:00:54 -08:00
Chia-I Wu
1c45727b5d graphics: remove duplicated types
Remove duplicated types from allocator@2.0 and composer@2.1.  Those types
are now in common@1.0.

Bug: 32238126
Test: builds and boots
Change-Id: Ibdb907e47969f5a5a98a14a2e2b77a9c5880beff
2016-11-18 08:03:31 +08:00
Yifan Hong
c2f2779d9d Update Android.bp to reexport dependent packages.
Test: mma
Change-Id: Iaca7300c366c2c9e860a29e6a111248d315cc5b4
2016-11-09 10:28:38 -08:00
Colin Cross
b785f5b82e Support genrules with multiple tools
To allow genrules with more than one tool, rename the tool property to
tools and make it an array, replace $tool with $(location <label>),
and use $() for other variables for consistency.

Bug: 31948427
Test: compare build.ninja
Change-Id: I3d714f70a2af0dc60faeee10e09b6ed166601f1d
2016-11-04 22:49:15 -07:00
Steven Moreland
fcd74ebcdc Running update makefiles.
https://android-review.googlesource.com/#/c/298160/

Test: pass
Change-Id: I14fcde2d3aacc8f8cd9221f2d69e2feae9ae1226
2016-11-02 10:24:33 -07:00
Steven Moreland
69727778a7 Stop all these merge conflicts.
Test: mma -j64
Change-Id: I319198af32adf1fef180c5c2c22ba4b360fa7609
2016-10-26 12:04:37 +02:00
Chia-I Wu
b0b5a4de76 graphics: add IComposer service daemon
Since HALs might run binder services, we need to start thread pool for
both binder and hwbinder.

Bug: 32021609
Test: builds and boots
Change-Id: I9779e86b1e611a180b1984af36c417dafc3329bc
2016-10-19 12:04:51 +08:00
Chia-I Wu
0c6b7f42a6 graphics: fix leaks in IComposer default impl
When a layer is removed, remove its cached buffer/sidestream as well.

Test: fixed OOM
Change-Id: Ibafe18ff686ae6bcb1fc4baed30b7784d2b40529
2016-10-19 12:00:45 +08:00
Chia-I Wu
7f8d39669c graphics: add a default implementation for IComposer
The default implementatoin is built on top of conventional hwcomposer2.

Test: make
Change-Id: Ia4f13b1d682462769056679fc0aae82a75cb53d2
2016-10-13 16:40:51 -07:00
Chia-I Wu
acce69901d graphics: add HIDL definition for HW composer
This is a direct translation of hwcomposer2.h to HIDL.

Test: make
Change-Id: Id007af271b06f0d86afc8bc7c57300c588dc4081
2016-10-13 16:40:51 -07:00