Commit graph

1208 commits

Author SHA1 Message Date
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
4c0d397f1c graphics: add IAllocator service daemon
Bug: 32021161
Test: builds and boots
Change-Id: I2752559c4e168a4ea7cbd9223ef3692cdeda96f6
2016-10-19 11:57:47 +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
Chia-I Wu
0f215c5a33 graphics: add a default implementation to IMapper
The default implementatoin is built on top of conventional gralloc1.

Test: make android.hardware.graphics.mapper.hallib
Change-Id: I8647dc69dbb1637a141d36358d5769f450422ac1
2016-10-12 06:59:26 -07:00
Chia-I Wu
9af67ec5f8 graphics: add IMapper to complement IAllocator
IMapper is loaded in-process and is defined in C++ instead of HIDL.  To
guarantee binary compability, the interface is a struct of function
pointers instead of a class of pure virtual member functions.  The
functions pointed to by the function pointers must also have C-linkage and
have all of their parameters PODs.

Implementations are expected to be installed to

  /oem/lib/hw/android.hardware.graphics.mapper.hallib.so
  /vendor/lib/hw/android.hardware.graphics.mapper.hallib.so
  /system/lib/hw/android.hardware.graphics.mapper.hallib.so
  (lib64 instead of lib for 64-bit implementations)

The loader will look for the symbol "HALLIB_FETCH_Interface" and use it to
fetch the interface.

Test: make android.hardware.graphics.mapper@2.0
Change-Id: I3a2c7a6ce18a90adda6df2d89559c957a122fdf0
2016-10-12 06:59:26 -07:00
Chia-I Wu
109571a22a graphics: add a default implementation to IAllocator
The default implementatoin is built on top of conventional gralloc1.

This also adds a static library, libgralloc1-adapter.  It is intended to
ease the porting of gralloc0 to gralloc1.

Test: booted to launcher, tested with YouTube and some games.

Change-Id: Id640b1d5a1e1eea1aafabb6c134e6be6e71afff5
2016-10-12 06:59:26 -07:00
Chia-I Wu
e78aa1bd90 Add HAL definition for graphics buffer allocator
It differs from gralloc1.h in that

 - buffer descriptors are created from a struct, BufferDescriptorInfo, to
   reduce round trips
 - testAllocate is a function of its own
 - buffer allocation and export are two different steps
 - reference counting and buffer mapping are moved to gralloc-mapper
 - BAD_HANDLE is renamed to BAD_BUFFER
 - GRALLOC1_CONSUMER_USAGE_FOREIGN_BUFFERS is removed
 - CPU_{READ,WRITE}_OFTEN no longer implies CPU_{READ,WRITE}

Test: make android.hardware.graphics.allocator@2.0

Change-Id: Ibe9367d5b1701c0e1009da829f27fed0f7d98828
2016-10-12 06:59:26 -07:00