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
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
Note, current.txt change (as opposed to addition) is only allowed
because this is an unreleased interface.
Bug: 32593292
Test: builds
Change-Id: I95381d1a3a456aeadbc472e2dbbffde19cb43e6c
HALs are not expected to see YCBCR_422_888, YCBCR_444_888,
FLEX_RGB_888, and FLEX_RGBA_8888. JPEG is purely wrong.
Note, current.txt change (as opposed to addition) is only allowed
because this is an unreleased interface.
Bug: 32593292
Test: builds
Change-Id: I432e6cb75cfc347a41e8e1632ae1898eed3350c8
Make the docs more self-contained, not referring to stuff not
defined by the HIDL interfaces.
Mark JPEG, YCBCR_422_888, YCBCR_444_888, FLEX_RGB_888,
FLEX_RGBA_8888 as "MUST NOT USE". These format are never supposed
to be seen by gralloc and do not belong to the HIDL interfaces.
Note, current.txt change (as opposed to addition) is only allowed
because this is an unreleased interface.
Bug: 32593292
Test: builds
Change-Id: Ia7607cc73dd2f58dfa27e71b0004b21c7ca6904d
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
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
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
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
Bug: 33241851
Test: links
Test: try build with BOARD_VNDK_VERSION current, no errors related to
this module
Test: (sanity) YouTube
Change-Id: Ia2c3922bf8bf1ab51396a8c8c5fa8d909c442994
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
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
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)
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
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
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
Remove undeclared dependency of libhwcomposer-client on Hwc.h which
created a circular dependency.
Test: Manual
Change-Id: I74d5c4e2db5d247f8b406d1ea42fece41e76659d
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
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
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
Add libVtsHalGraphicsComposerUtils which provides a wrapper to
IComposer. Port tests to be based on
libVtsHalGraphicsComposerUtils.
Test: manual
Change-Id: I400c347b54702c3d45954e6cdc101d3dc1241efd