Commit graph

150 commits

Author SHA1 Message Date
Chia-I Wu
841468ad6a graphics: reorder PixelFormat
Sort the enum values in their numerical order. There is no other
change.

Note, current.txt change (as opposed to addition) is only allowed
because this is an unreleased interface.

Bug: 32593292
Test: builds
Change-Id: I47914a7971f922f5602f982b41dd7602842e853b
2017-04-27 16:41:08 +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
Chia-I Wu
ec74596af8 graphics: clarify importBuffer and passthrough HALs
A buffer handle recieved from a HAL is by definition raw and needs
to be imported.  But because of passthrough HALs, such a raw handle
may have been imported already.  Explicitly specify that an
implementation must accept such a raw handle.

Bug: 37540361
Test: boots on angler, ryu and marlin
Change-Id: I5ecf526e59b27cc4a8f7f5d5ec27477da0946ece
2017-04-25 12:52:50 -07:00
Chia-I Wu
78b63dc6a1 graphics: keep mapper valid during process termination
GraphicBufferMapper is valid during process termination.  IMapper
must stay valid as well.  It should not rely on global/static
objects that may have been destructed.

Bug: 37480313
Test: libgui_test
Change-Id: Icb8079153306f2465c26c0f1ce812895ad83f21b
2017-04-19 11:47:25 -07:00
Andreas Huber
6fa374ad30 Changed the naming scheme for Treble java libraries (both static and dynamic)
android.hardware.foo@1.0-java => android.hardware.foo-V1.0-java

Bug: 37207894
Test: make
Change-Id: I177f4cfd42f635aaf096107af8309d1a82ed41c0
Merged-In: I8b91881dfaf507c0d852d56ebbb53ff0987e5a34
2017-04-13 15:23:46 -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
fed12441ac libgrallocmapperincludes: as header lib and vendor
Bug: 33241851
Test: links
Test: try build with BOARD_VNDK_VERSION current, no errors related to
  this module
Test: (sanity) YouTube

Change-Id: Ia2c3922bf8bf1ab51396a8c8c5fa8d909c442994
2017-04-12 09:57:32 -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
586fd648d5 Merge "graphics: revise gralloc interfaces" into oc-dev 2017-04-11 01:08:39 +00: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
Emilian Peev
cb0b46654d graphics: Update RAW16 format comments
RAW16 format could be used together with depth dataspace.
The buffer contents in this case will be phase detection
statistics data.

Bug: 36015382
Test: testPDStats
Change-Id: Ied1c179193abef62a87fcec6f0906528ed58ea2b
(cherry picked from commit 23699d6314)
2017-04-09 17:48:56 +00:00
Steven Moreland
4e7a307730 Fix transitive includes.
Files relying on transitive include of utils/Log.h (and things that it
includes) from MQDescriptor.h

Test: pass
Merged-In: Iff316b21bef556bb026378b7f89e97ded3febef4
Change-Id: Iff316b21bef556bb026378b7f89e97ded3febef4
2017-04-06 22:04:05 +00: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
TreeHugger Robot
2f44ec6c86 Merge "Use gralloc usage conversion library" into oc-dev 2017-03-28 20:55:51 +00:00
Jesse Hall
66ee1771a6 Use gralloc usage conversion library
Converting from ..graphics.allocator@2.0 usage to gralloc0 usage isn't
quite as simple as ORing and truncating, which is what the default
implementation was doing. Switch to using library functions that do it
correctly.

Test: boot bullhead
Change-Id: I40ae00e9aad92b374f281569207972b7461a3e55
2017-03-28 08:23:21 -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
TreeHugger Robot
52efd43eee Merge "Move IGraphicBufferProducer to graphics/bufferqueue." 2017-03-15 20:55:46 +00:00
Pawin Vongmasa
4a3cd13ddc Move IGraphicBufferProducer to graphics/bufferqueue.
Test: With CtsMediaTestCases.apk installed,
adb shell am instrument -e size small -w
'android.media.cts/android.support.test.runner.AndroidJUnitRunner'

Bug: 35442034
Change-Id: Ia1ef0eb069fcd97f7afcf42bf3bb16c8c6a752c4
2017-03-15 11:42:40 -07:00
Courtney Goeltzenleuchter
a3023d9b44 Update Display-P3 transfer function
Decided to use same transfer function that Apple is
using for their Display-P3 devices. Difference between
sRGB transfer function and Display-P3 is very small.
We will treat them an synonymous.

Test: make

Change-Id: Id4e52058f2b810b70c46821c5fe6830e623c5491
2017-03-15 08:11:25 -06: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
d412d7b1d2 graphics: initialize count to 0 in initCapabilities
Be more defensive against HALs that do not initialize count.

Test: manual
Change-Id: I8b70454a1a3134c01d225be504579fc2e81ca88b
2017-03-07 14:45:33 -08:00
Chia-I Wu
c2e949ec5f graphics: add a basic test for IMapper::lockFlex
Bug: 32023011
Test: manual
Change-Id: Iae143d11056f6ab169d1068fdaa62e889051b16e
2017-03-07 12:26:03 -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
Chia-I Wu
89d09ddb0a graphics: clean up mapper VTS tests
Add libVtsHalGraphicsMapperUtils which provides a wrapper to
IMapper.  Port tests to be based on libVtsHalGraphicsMapperUtils.

Test: manual
Change-Id: I0639df178fd0a94153b48733930bb13f2d0aa930
2017-03-07 12:24:26 -08:00
Chia-I Wu
69505c6842 graphics: clean up allocator VTS tests
Add libVtsHalGraphicsAllocatorUtils which provides a wrapper to
IAllocator.  Port tests to be based on
libVtsHalGraphicsAllocatorUtils.

Test: manual
Change-Id: I6d56160dc4fa6e5106cc55e75cdd923f15635317
2017-03-07 12:23:25 -08:00
Courtney Goeltzenleuchter
37606f9fe9 Add dataspace to match upstream EGL extension
EGL's EGL_EXT_gl_colorspace_bt2020_pq extension
supports a bt2020 color space with a ST2084
transfer function (Dolby Perceptual Quantizer)
Test: make

Change-Id: I3de03b91ee24880a4b2dab14c0f07185a53bf067
2017-03-02 13:50:43 -07: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