Commit graph

287 commits

Author SHA1 Message Date
Steven Moreland
67f5d0f838 Update VNDK version for common graphics HALs.
We are adding things to them, and in order for core libraries like libui
to use them, the newer versions need to be in the VNDK.

Bug: 170435409
Test: build
Change-Id: I4094240656f357b5ae52194befd0e10627b9fe23
Merged-In: I4094240656f357b5ae52194befd0e10627b9fe23
2020-10-19 21:04:14 +00:00
Treehugger Robot
ca31517201 Merge "Mark GraphicsMapperHidlTest as allowing not being instantiated" 2020-09-28 21:47:07 +00:00
Dan Shi
f2b950f470 Rename vts-core to vts
Bug: 151896491
Test: none
Change-Id: If74547c56b46ebc7fd728c1bf52fe9dedac65ffa
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-09-26 04:11:28 +00:00
Chris Forbes
3c9a3a0cd1 Mark GraphicsMapperHidlTest as allowing not being instantiated
Only the variant(s) actually implemented by the device will be
instantiated.

This is consistent with tests for other versioned or optional HALs.

Bug: b/167222309
Test: atest VtsHalGraphicsMapperV2_0TargetTest:GoogleTestVerification#UninstantiatedParameterizedTestSuite<GraphicsMapperHidlTest> -- --abi arm64-v8a
Change-Id: I4f1bfbad47bdbf75578ec48a3a56fb5351e7729a
2020-09-25 21:07:53 -07:00
TreeHugger Robot
1705471cc1 Merge "Add test for subsample metadata for YUV420 format" into rvc-dev am: e83c8b22e3
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/11736601

Change-Id: Ibb503d88b4656056a63195c40b4dcad0422a9016
2020-06-23 16:00:47 +00:00
TreeHugger Robot
e83c8b22e3 Merge "Add test for subsample metadata for YUV420 format" into rvc-dev 2020-06-23 15:44:49 +00:00
layog
e886f80942 Add test for subsample metadata for YUV420 format
Bug: 153704651
Test: atest VtsHalGraphicsMapperV4_0TargetTest
Change-Id: Ie7a521b19b2eb1c459327fe699253aaa50ae8257
2020-06-20 11:54:25 +08:00
TreeHugger Robot
dc2a322213 Merge "gralloc4-vts: Correct the ownership of fence fd" into rvc-dev am: 86aa285936
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/11880423

Change-Id: I4d0b921bd4a3cddb0b306d02aed5f0f1830d4831
2020-06-19 01:16:42 +00:00
Yichi Chen
448369c954 gralloc4-vts: Correct the ownership of fence fd
Gralloc::lock takes the ownership of acquireFence and closes the fence
by itself. The patch changes the behavior of fence to transfer the
ownership by unique_fd::release.

Bug: 157534008
Test: VtsHalGraphicsMapperV4_0TargetTest
Change-Id: Ie4ee9cd9c3b148cab9187fa07a4e52cbf9ad798a
2020-06-16 17:26:18 +08:00
TreeHugger Robot
e8303a537a Merge changes Ic0d7b4d2,I3441e630,Ie504e687 into rvc-dev am: 2e5dd7ab32
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/11686091

Change-Id: Ie8902039154646d934efb7bf773ca1c8ada5ff1a
2020-06-15 03:42:54 +00:00
Yichi Chen
35d97d5417 gralloc4-vts: Test metadata is consistent in cloned buffers
GetMetadataClonedHandle checks the metadata can be gotten after a native
handle is cloned. SetMetadataClonedHandle checks the metadata can be set
on a cloned native handle.

Bug: 155224585
Test: VtsHalGraphicsMapperV4_0TargetTest
Change-Id: Ic0d7b4d21a64822f2f1dbeca8d48c450711ed494
2020-06-08 16:43:55 +08:00
layog
26ddd0125c gralloc4-vts: Test layout and component info of RAW12
Bug: 157534008
Test: VtsHalGraphicsMapperV4_0TargetTest
Change-Id: I3441e630b18f3d6e0f5cbcecf8a54dc1b42faa84
2020-06-08 16:43:53 +08:00
Yichi Chen
0809466b61 gralloc4-vts: Test layout and component info of RAW10
To ensure the correctness of the plane layout and layout component on
RAW10 format, the patch creates the test case to check corresponding
data.

Bug: 157534008
Test: VtsHalGraphicsMapperV4_0TargetTest
Change-Id: Ie504e687e149ee4f4fb3f715ee0de7d7ec31952a
2020-06-08 16:42:39 +08:00
TreeHugger Robot
fe6dec9f22 Merge "gralloc4-vts: Allow getFromBufferDescriptorInfo return unsupported" into rvc-dev am: 5f0ce20538
Change-Id: If11bf8b0f2c728199c95b032785af63ef8e2134f
2020-05-25 02:49:51 +00:00
Yichi Chen
e4f244e26b gralloc4-vts: Allow getFromBufferDescriptorInfo return unsupported
According to the definition of getFromBufferDescriptorInfo, UNSUPPORTED
should be returned if the requested metadata is not defined until a
buffer has been allocated. Before we clarify the necessary metadata,
the patch allows all of them return unsupported.

Bug: 155626288
Test: VtsHalGraphicsMapperV4_0Target

Change-Id: I42a3b07b0b60ca555ebe949bbac0dd68d4e06231
2020-05-21 20:39:21 +08:00
TreeHugger Robot
0d5d5cd875 Merge changes I926887cc,I7def937e,I530f6d89,I393fc3c4 into rvc-dev am: ad17ebe23b
Change-Id: Ic0ce51c021770db45e3fde6f15fcb8c123ee5587
2020-05-13 09:17:23 +00:00
Yichi Chen
5bec8ba8a2 gralloc4-vts: Hold fence by unique_fd to avoid leakage
There was fd leakage when fence was assigned to other values without
releasing previous file descriptor. The patch introduces unique_fd to
hold the fence without leaking fd.

Bug: 150461327
Bug: 152510209
Test: VtsHalGraphicsMapperV4_0Target

Change-Id: I926887ccd2c626da2d2c1a6b9d7cd433f9d5b717
2020-05-12 08:58:16 +08:00
Yichi Chen
ad8b9ad68c gralloc4-vts: Restore Lock_YCBCR_420_888 and create Lock_YV12
The patch adds back Lock_YCBCR_420_888 and also creates Lock_YV12 to
verify planner format with the checks on subsampling, chroma step, and
CbCr offsets.

Bug: 150461327
Bug: 152510209
Test: VtsHalGraphicsMapperV4_0Target

Change-Id: I7def937e9b65e99569a3dc2230e7e929477c06eb
2020-05-12 08:58:16 +08:00
Yichi Chen
f4d374a758 gralloc4-vts: Extract YCbCr888 data operation from Lock_YCRCB_420_SP
The patch extracts the common operation on YCbCr888 data to allow a
better reuse in tests with other YCbCr color formats

Bug: 150461327
Bug: 152510209
Test: VtsHalGraphicsMapperV4_0Target

Change-Id: I530f6d895c338fb041f7705aa9a4fd36931a1588
2020-05-12 08:58:16 +08:00
Yichi Chen
c6394fffa8 gralloc4-vts: Allow YCRCB_420_SP to be unsupported in Lock_YCRCB_420_SP
Some devices may not support the legacy YCRCB_420_SP format. To allow
the test can pass through such devices, the patch adds the flexibility
when UNSUPPORTED is returned from buffer allocation.

Bug: 150461327
Bug: 152510209
Test: VtsHalGraphicsMapperV4_0Target

Change-Id: I393fc3c4a7d2421f07eeff88915041c92e8cdf05
2020-05-12 08:58:08 +08:00
Valerie Hau
33569f0bc0 Merge "Allow for failure in allocation for MapperVts" into rvc-dev am: f207cca044
Change-Id: Ifead8f280bab46900529a8883da7188077fa3eb5
2020-05-11 23:47:56 +00:00
Valerie Hau
7b4e37a989 Allow for failure in allocation for MapperVts
Bug: 155942443
Test: build, boot
Change-Id: I8698e4cf117d54a6d2ff128cc2e503308188c7e6
2020-05-11 14:18:46 -07:00
Valerie Hau
a1f7675429 Merge "Fix Mapper Protected test" into rvc-dev am: 7b25582017
Change-Id: I95dccda9c019fb3a0a71b1627d181af0896f3f7f
2020-05-08 21:51:18 +00:00
Valerie Hau
2b4caee38a Fix Mapper Protected test
Bug: 155942443
Test: build, boot
Change-Id: Ie258184981615d714878b108f2e00452fbf95358
2020-05-08 10:17:49 -07:00
TreeHugger Robot
6b4e25f652 Merge "gralloc4-vts: Correct plane layout test of RGBA_8888 and YCbCr_420" into rvc-dev am: ab60146f08
Change-Id: I8e2b9550470dbbdedf47284f710197c9bc92fc1e
2020-04-10 10:10:05 +00:00
Yichi Chen
059441bdd2 gralloc4-vts: Correct plane layout test of RGBA_8888 and YCbCr_420
The patch enhanced the plane layout tests in verifyRGBA8888 and
Lock_YCRCB_420_SP with considerations of sample increment and
subsampling.

Test: VtsHalGraphicsMapperV4_0
Bug: 150461327
Change-Id: I16fce5f29ec927de110cbaf5767e0b585d3c1919
2020-04-10 15:40:24 +08:00
Dan Shi
eb5f33e0ef Rename vts-core to vts am: ba894f81db am: 55d110bcd0
Change-Id: Ifc137320af42febc24937f09e5baa4c5a95ac1c4
2020-04-07 23:56:42 +00:00
Dan Shi
aad51fa000 Rename vts-core to vts
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL update suite name vts-core to vts as
the suite name is updated. This CL won't change test logic or behavior.

Change-Id: I562b4dc50765e953800a814a8fd84a01c1b9352b
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-04-07 16:37:40 -07:00
Dan Shi
ba894f81db Rename vts-core to vts
Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL update suite name vts-core to vts as
the suite name is updated. This CL won't change test logic or behavior.

Change-Id: I562b4dc50765e953800a814a8fd84a01c1b9352b
Merged-In: I562b4dc50765e953800a814a8fd84a01c1b9352b
2020-04-07 15:17:02 -07:00
Valerie Hau
28fcdf27e4 Merge "Relax constraints on getting PlaneLayouts" into rvc-dev 2020-03-31 22:59:27 +00:00
Valerie Hau
2229623f1f Relax constraints on getting PlaneLayouts
PlaneLayouts may only be known at allocation time.

Bug: 152806713
Test: build, boot
Change-Id: Ic878943b405469a70a685a895c04a1d4e2678686
2020-03-31 13:47:54 -07:00
TreeHugger Robot
fa8e5f931a Merge "gralloc4-vts: fix Lock_YCBCR_420_888 test" into rvc-dev 2020-03-31 03:57:42 +00:00
Marissa Wall
77b837f0ad graphics: update OWNERS
marissaw@ is leaving. jessehall@ is on a different team. Remove
them and add new owners.

Test: Compiles
Bug: 150462113
Change-Id: I922710de701d3923268591bcb48db3e12acb0500
(cherry picked from commit 88417a586b)
2020-03-26 19:31:56 +00:00
Jason Macnak
34445d98ed gralloc4-vts: fix Lock_YCBCR_420_888 test
Updates Cb and Cr plane indexing. The existing code seems to use
chromaStep as a sub-sampling factor and seems to assume that the
underlying format is tri-planar.

Updates Cb and Cr value checking. The existing code would write
values into the Cb and Cr planes using a value derived from
even-x-value and odd-y-value full-image-coordinates (e.g. (0,1))
but then check against the values in the Cb and Cr planes using
a value derived from even-x-value and even-y-value coordinates
(e.g. (0,0)).

Updates y-plane sample increment check to confirm that it is
multiple of 8. I don't see any requirements stating this needs
to be 32 bits.

Bug: b/146515640
Test: VtsHalGraphicsMapperV4_0Target
Change-Id: Ia9e496ae43b2d1ac9ea8d57a4d4fc55f0be7b2b6
2020-03-26 08:56:29 -07:00
Pierre Couillaud
49f262471d vts: VtsHalGraphicsMapperV2_1TargetTest fixup's
1) handles allocated through 'allocate' should be removed through
   'freeBuffer'.

2) make use of intended buffer handle in GetTransportSizeBadBuffer.

Bug: 146444563
Test: build, boot, VtsHalGraphicsMapperV2_1TargetTest

Cherry pick to master from android10-tests-dev

Change-Id: I6c1a67fc36dbc653ec2ada6a335d685d21e82800
Merged-In: I6c1a67fc36dbc653ec2ada6a335d685d21e82800
Signed-off-by: Pierre Couillaud <pierre.couillaud@broadcom.com>
2020-03-11 15:40:46 +00:00
TreeHugger Robot
68dbdf4a48 Merge "gralloc4-vts: fix GetLargeReservedRegion test" into rvc-dev 2020-03-10 23:05:49 +00:00
Jason Macnak
c1b5b52c70 gralloc4-vts: fix GetLargeReservedRegion test
The existing test never assigns a handle to bufferHandle so
mGralloc->getReservedRegion() will always be called with
nullptr and will always return with BAD_BUFFER.

Bug: b/146515640
Test: VtsHalGraphicsMapperV4_0Target
Change-Id: I85dac94956c6b9db5b4a19faeb16fc947f7457e1
2020-03-10 13:39:49 -07:00
Pierre Couillaud
9894812dd1 vts: VtsHalGraphicsMapperV2_1TargetTest fixup's
1) handles allocated through 'allocate' should be removed through
   'freeBuffer'.

2) make use of intended buffer handle in GetTransportSizeBadBuffer.

Bug: 146444563
Test: build, boot, VtsHalGraphicsMapperV2_1TargetTest
Change-Id: I6c1a67fc36dbc653ec2ada6a335d685d21e82800
Signed-off-by: Pierre Couillaud <pierre.couillaud@broadcom.com>
2020-03-10 08:33:01 -07:00
Marissa Wall
67829613c0 gralloc4-vts: RGBA_8888 sampleIncrementInBits should be 32
SampleIncrementInBits is the delta between samples not components.
It should be 32 for RGBA_8888.

Test: VtsHalGraphicsMapperV4_0
Bug: 150461327

Change-Id: Idf283b93cd0243fa33eabac23185c513825d83ca
2020-02-28 17:43:46 +00:00
Marissa Ikonomidis
a66c632f8f Merge "gralloc4-vts: don't wait on invalid sync fence" into rvc-dev 2020-02-26 18:05:47 +00:00
Marissa Ikonomidis
f1b3ea2398 Merge "gralloc4-vts: correctly instantiate std::optional" into rvc-dev 2020-02-26 18:05:06 +00:00
Marissa Wall
de19a7e614 gralloc4-vts: don't wait on invalid sync fence
Sync fences can be invalid if the buffer is already ready. If the
fence is invalid, we do not need to wait.

Test: VtsHalGraphicsMapperV4_0
Bug: 150213134

Change-Id: I8326d5f8b358c466ee9a686fd299daed1d4b4aa8
2020-02-25 17:44:46 +00:00
Marissa Wall
e2127863fb gralloc4-vts: correctly instantiate std::optional
std::optional defaults to containing std::nullopt_t. Using "->" or
"." on an std::optional object that does not contain a value is
undefined. Clang seems to ignore the whole line.

SetSmpte2086 and SetCta861_3 both incorrectly instantiate their
std::optional types. The std::optional types contain std::nullopt_t
when they are passed into encode. When mapper decodes the fields,
they are empty.

Update std::optionals to be instantiated correctly.

Bug: 149931805
Test: VtsHalGraphicsMapperV4_0

Change-Id: I046242f8261a5378228231b89b2eedec242667cb
2020-02-25 17:43:29 +00:00
Marissa Wall
3a7515065b gralloc4-vts: fix bad comparisions in VTS
The parameter order of a couple checks is wrong.

For example:
EXPECT_GT(val1, val2) is EXPECT_TRUE(val1 > val2)
so EXPECT_GT(0, X) can never be true.

Update the tests to be correct.

Test: VtsHalGraphicsMapperV4_0
Bug: 149739702

Change-Id: I21070a912b6014acc5feb63b6b19912b45fe8f5f
2020-02-25 17:43:21 +00:00
TreeHugger Robot
7704cfb914 Merge "gralloc4-vts: setting USAGE is always BAD_VALUE" 2020-02-20 21:15:43 +00:00
Marissa Wall
2e9bf64c5e gralloc4-vts: setting USAGE is always BAD_VALUE
Usage cannot be change after allocation. Mapper must return
BAD_VALUE. SetConstantMetadata already tests this. Remove
the tests that attempted to set USAGE and expected it could
succeed.

Test: VtsHalGraphicsMapperV4_0
Bug: 149830560

Change-Id: I730dd3f3c0c48946c436e8fb60256365e0d9ab1e
2020-02-20 10:08:31 -08:00
Automerger Merge Worker
30425b854e Merge "Fix VTS fail for GraphicsMapperHidlTest" am: eef384a88e am: a5439e227c am: 9091f86903
Change-Id: I092c9b06535a4df77440e3a798bb079bc39418db
2020-02-18 21:24:45 +00:00
mtk07406
e308ceb1e9 Fix VTS fail for GraphicsMapperHidlTest
VTS_10 testing item VtsHalGraphicsMapperV2_1Target fail due to
Gralloc0 HAL do not have return value : BAD_VALUE and BAD_BUFFER
so add Error::BAD_VALUE and Error::BAD_BUFFER as return value to
fix this VTS fail.

Bug: 146034198
Test: ran VtsHalGraphicsMapperV2_1Target 10 times and it all pass.
Change-Id: I792830ddf98cbf59de7d3a7b4dd4cf5f72269244
2020-02-14 10:25:19 +08:00
Marissa Wall
66d459ce87 gralloc4-vts: return after GTEST_SUCCEED
GTEST_SUCCEED() does not cause a GTEST to return. Insert a
return after every GTEST_SUCCEED().

Test: VtsHalGraphicsMapperV4_0
Bug: 149008032
Change-Id: I65637e7a0ac9a9ac8d69c9d8ccbb427543d82428
2020-02-13 11:44:32 -08:00
Marissa Wall
b6809a06ad gralloc4-vts: update sampleIncrementInBits
sampleIncrementInBits is per sample not per component. An RGBA sample
is 32 bits not 8.

Test: VtsHalGraphicsMapperV4_0
Bug: 149310539

Change-Id: If4bd5aac87cada7040f52ee40159a72fa72a97be
2020-02-13 11:44:20 -08:00
Marissa Wall
8d05644989 gralloc4: fix SetConstantMetadata and SetBadMetadata
SetConstantMetadata was trying to set constant metadata
with bad values. SetBadMetadata was also trying to set
constant metadata with bad values. Update SetConstantMetadata
to set constant metadata with good values. Remove constant
metadata from the SetBadMetadata test.

Bug: 149004202
Test: VtsHalGraphicsMapperV4_0

Change-Id: I6816fca64c7ac89e457628e94bc06bc1b05c916f
2020-02-10 12:37:35 -08:00
Marissa Wall
b0923641d6 gralloc4: move crop to seperate metadata type
Move crop out of PlaneLayout so it can be set and get independently
from PlaneLayout.

Bug: 141632767
Test: atest VtsHalGraphicsMapperV4_0

Change-Id: Ib685c0a065754e3e3bd697d3518b03b4c76d447e
2020-02-10 11:45:21 -08:00
Steven Moreland
926aa80f04 *common: use package as name
In order to provide a more descriptive name, and to be consistent
with HIDL, the stable AIDL package names are switching from
vintf-*common format to the package format
(android.hardware.*common).

Bug: N/A
Test: all build time
Change-Id: Ie1d92a50dddf7e3e1bd473e2a957279c6dadb865
2020-01-06 23:25:20 +00:00
Marissa Ikonomidis
69819f2e77 Merge changes I620f3cc0,I5ff86539
* changes:
  gralloc: update doc to reflect security change
  graphics.mapper@4.0: Document previously-implicit accessRegion behavior.
2019-12-19 23:26:04 +00:00
Marissa Wall
4bb9cab24c graphics.mapper@4.0: Document previously-implicit accessRegion behavior.
Existing Android framework code (and transitively, CTS test) require
that an accessRegion of (0,0,0,0) is treated the same as an
accessRegion covering the entire buffer, when calling lock() or
lockYCbCr().

Document this so that there is no confusion about this going forward,
since this requirement pre-dates the HIDL HALs.

Bug: 119440345
Test: Builds, passes CTS

Change-Id: I5ff86539ee28a72dd972255ad405db357e62536d
2019-12-19 13:49:02 -08:00
Pawin Vongmasa
8e8bbddf89 Add HDR metadata types to graphics/common
Bug: 120990898
Bug: 141632767

Test: Builds
Change-Id: Ie37b38043ec4c015bbe439978a0344d4c6bbc124
2019-12-18 15:14:55 -08:00
TreeHugger Robot
b440e65a1b Merge "Add BT709 with full range." 2019-12-18 18:32:52 +00:00
Joseph Murphy
20102da237 Revert submission
Reason for revert: Buildcop - Build breaking references to std::optional

Change-Id: I8595ca0a668bc7e3684bc7f7a1424a6905d3b547
2019-12-17 19:58:51 +00:00
Peiyong Lin
ead8b45fc8 Add BT709 with full range.
Add support for BT709 full range support with SMPTE 170M transfer function.

Minor: Remove deprecated dataspace support in aidl.

BUG: b/130737986
Test: build
Change-Id: I17b1f7d868e99396df9779bdd53d63bdcd2a06af
2019-12-16 20:59:29 -08:00
Pawin Vongmasa
f95e14d1b4 Add HDR metadata types to graphics/common
Bug: 120990898
Bug: 141632767

Test: Builds
Change-Id: I94a592d1cc0854b37622a2c85575083b59803793
2019-12-16 09:22:30 -08:00
Marissa Wall
6a2ecb424c gralloc4: remove dumpDebugInfo
dumpDebugInfo could be called by anyone. A safer
approach is for processes to dump their own buffers
via IMapper's dumpBuffers.

Bug: 137966819
Test: Compiles
Change-Id: I4c8c7a6415babfb93034ee8674ba0f40cd8c1bb8
2019-12-16 09:22:06 -08:00
TreeHugger Robot
42327230c2 Merge "gralloc: use gralloctypes helper" 2019-12-12 17:43:47 +00:00
Dan Shi
46245c59d7 Convert VtsHalGraphicsMapperV4_0TargetTest to be parameterized test
Bug: 142397658
Test: atest VtsHalGraphicsMapperV4_0TargetTest
Change-Id: I3854f9d4e601d37952e41a5c503f3b1d833c47a5
2019-12-10 16:14:11 -08:00
Marissa Wall
353357bffe gralloc: use gralloctypes helper
Use the gralloctypes helper function to determine if a
PlaneLayoutComponentType is a standard type. Also update the
lock RGBA_8888 function to ignore non-standard
PlaneLayoutComponentTypes.

Bug: 141632767
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: Ie3ea4a22b2c9ecf4b1d85932833978d2e23f77c1
2019-12-10 14:58:28 -08:00
Dan Shi
050316231e Merge "Convert VtsHalGraphicsMapperV*TargetTest to be parameterized test" am: f78d7734d1 am: 64426d0a06
am: 2b8fcf0a7e

Change-Id: I6dbfdf330d59559d5ce0de0965fa840bfe8e6e24
2019-12-09 16:30:45 -08:00
TreeHugger Robot
8566e74f15 Merge "gralloc: add flush and reread for locked buffers" 2019-12-09 22:40:14 +00:00
Marissa Wall
2c45bb16f5 gralloc: add flush and reread for locked buffers
When a buffer is locked (mapped to the CPU) by two or more clients,
there is no good way to manage a reader/writer relationship. There are
no requirements for how the writes should propagate to the readers.
Clients must unlock and relock to be sure writes are flushed.
They must unlock and relock to get the lastest copy of the buffer.

This patch adds explicit flush and reread commands to help readers
and writers synchronize without having to unmap and remap the
buffer.

Bug: 136316517
Test: TODO

Change-Id: I10d3de1b0e46c4f3b50dc34aea653701933638a9
2019-12-09 19:41:50 +00:00
Dan Shi
5a955bc176 Convert VtsHalGraphicsMapperV*TargetTest to be parameterized test
Bug: 142397658
Test: atest VtsHalGraphicsMapperV2_0TargetTest \
  VtsHalGraphicsMapperV2_1TargetTest \
  VtsHalGraphicsMapperV3_0TargetTest

Change-Id: I1d4e222f3a04882ae8d74e79201c2751d1d22ea4
2019-12-06 16:05:11 -08:00
Marissa Wall
d36e12776f gralloc: add reserved region
This patch adds a reserved region of shared memory to every gralloc
native_handle_t. The reserved region of memory will allow future
versions of Android to add new buffer features without requiring
gralloc upgrades.

Bug: 145232031
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: I1bdfec0a6ef85097096035d3d38e5c9e7fcc32f2
2019-12-02 10:47:42 -08:00
Marissa Wall
1b2c678bfc gralloc: test lock YCBCR_420_888
Gralloc 4 removes lockYCbCr but clients will still expect similar
functionality to lockYCbCr. This test case ensure that gralloc
will still behave sufficiently similarly when locking
YCBCR_420_888.

Bug: 141631415
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: I60d2c220bab858eabe89a95b225d2816ab7289cc
2019-12-02 10:47:41 -08:00
Marissa Wall
0cf075621d gralloc: add dump buffer(s)
Add functions to IMapper to dump a buffer and to dump all the
buffers in the current process. The dump includes
all gettable or settable metadata.

Bug: 141632317
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: Iaa54b899aef185867b3fd66025c0eb251a9a7bd1
2019-11-27 09:21:05 -08:00
TreeHugger Robot
83f69f0da0 Merge "gralloc: update lock and lockYCbCr" 2019-11-25 17:44:53 +00:00
Marissa Wall
78b167aa60 Merge "gralloc: list supported metadata types" 2019-11-22 19:26:20 +00:00
Marissa Wall
0129f43366 gralloc: clean up comments
Clean up code comments based on review comments in ag/9684750 and
ag/9684750.

Bug: 144551649
Test: Compiles
Change-Id: I96f5962d2c1b79352f85dcf9354689814310ecc0
2019-11-22 01:44:26 +00:00
Marissa Wall
9c5ebfc5ba gralloc: update lock and lockYCbCr
IMapper 4.0 does support lockYCbCr functionality through lock and
BufferMetadata getters. However, we will wait to add the support in
one central gralloc library. For now just stub out the call so
there aren't any compiler errors.

Bug: 141631415
Test: Compiles

Change-Id: I9d2f70c87412f8ac2114db85eb6dc01539876e2b
2019-11-21 17:43:41 -08:00
Marissa Wall
0001a5d5ba gralloc: list supported metadata types
Add function to get the metadata types supported by IMapper.
In future releases, we will add more standard types but upgrading
devices may not support those types. This function will allow the
framework to identify which metadata types the device supports.

Bug: 141632767
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: I760cf054d2b6f08a52ad70f4ae60a39a63500939
2019-11-20 15:38:42 -08:00
Marissa Wall
88d87faec9 gralloc: add get and set BufferMetadata support
Add get and set functions that allow buffer metadata to be set
on the buffer.

This patch has been reviewed by vendors on AOSP. It is a combination of the
following patches. They have been squashed (and updated) to make them easier to
review. Two of the patches are proposals by ARM that have been incorporated into
this patch.

https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1107574
https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1109946
https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1124857
https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1126861

Bug: 141632767, 141631993
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: I0e79d73a7687f2f5b51828a7454888e6d8ff9460
2019-11-19 14:49:02 -08:00
TreeHugger Robot
0b93288c77 Merge "gralloc: name buffer at allocation time" 2019-11-07 23:13:21 +00:00
Marissa Wall
bf9f6d39ed gralloc: name buffer at allocation time
Allow the client to name their buffer at allocation time.

b/141632767 will let the client(s) query the name of the
buffer later.

Bug: 144026910
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: Ib08c1909c10a1778c50b59e0a42ddf19140d8f03
2019-11-07 11:46:58 -08:00
Marissa Wall
a6a2af85d7 gralloc: clarify lock access region
Update lock to clarify that if the access region is outside the
bounds of the buffer, the lock call should fail.

Bug: 141631415
Test: VtsHalGraphicsMapperV4_0TargetTest

Change-Id: Ic9ccac9361c8cafc59660b107686d2cbb54faf2d
2019-11-07 10:24:34 -08:00
TreeHugger Robot
7dbc6e184e Merge "gralloc: require locked buffers follow format" 2019-10-16 22:33:24 +00:00
Marissa Wall
aa181aec49 gralloc: require locked buffers follow format
Clarify that buffers that are locked (mapped) to the CPU must
be in the format requested in their BufferDescriptorInfo.
The buffers should not be compressed/swizzled/tiled/etc.

Bug: 141631415
Test: This is already assumed by the tests.

Change-Id: Ie674117418aaefc3f99ac2bc89c3da4072e236ec
2019-10-16 11:10:43 -07:00
Eric Chung
7e279f1a63 Merge "Refine freeBuffer in Mapper 2.0" am: 9b2431d02a am: f6e09b2ff5 am: 3057612183
am: 13a6edaab2

Change-Id: I6a410127b4604aa8e0ef0ac5c1b04df45283eb69
2019-10-10 13:10:29 -07:00
Treehugger Robot
9b2431d02a Merge "Refine freeBuffer in Mapper 2.0" 2019-10-08 23:17:06 +00:00
Alistair Delva
fc8d43692c Merge "Make gralloc0 pass-through mapper handle layers" am: b756e23e5c am: 6982d1aec5 am: 6c3213c940
am: afc577e108

Change-Id: I54f2e01bf8ffe43dbe786a73cfd7818661230090
2019-10-03 06:48:29 -07:00
Alistair Delva
b756e23e5c Merge "Make gralloc0 pass-through mapper handle layers" 2019-10-03 13:02:13 +00:00
Jason Macnak
8b5b9fb52c Make gralloc0 pass-through mapper handle layers
Gralloc0 does not support layers. This change is needed for Cuttlefish
to pass the GraphicsMapperHidlTest.ValidateBufferSizeBadValue VTS test

Bug: b/132087346
Test: vts-tradefed run commandAndExit vts -m VtsHalGraphicsMapperV2_1Target
Change-Id: I2ed7dae209629d401ccaf2fc0fd992d766b0fa9b
2019-09-27 09:58:45 -07:00
Max Zhang
aed6aa8c2e yukawa: adapt different YCC orders am: 59b31c9b90 am: b21fd17efe am: 4a2baa9256
am: b21fd61f56

Change-Id: I2e4344503fd62cd0346c61bf745c7638f3651b3b
2019-09-25 12:00:03 -07:00
Max Zhang
59b31c9b90 yukawa: adapt different YCC orders
The order of the planes doesn't matter, therefore enable mapper
adapter to support YCbCr and YCrCb both.

test: manual
bug: 141006723
Change-Id: Iad0d5159c1b38b12bc90a07f937db002471aad1e
2019-09-24 11:38:07 -07:00
Eric Chung
a15f697353 Refine freeBuffer in Mapper 2.0
When users call Mapper:freeBuffer, Mapper will erase buffer handle from mBufferHandles.
No matter the result of free buffer handle returned from gralloc, buffer handle is removed from mBufferHandles.
This means that a buffer handle can not be freed twice, even if it fail to be freed at the first time.
Because users will receive nullptr when they call freeBuffer to free the same bufferHandle at the second time.

When freeBuffer is called, Mapper only looks for input buffer in mBufferHandles instead of erasing it from mBufferHandles.
If the result of freeBuffer returned by gralloc is NONE, then remove the buffer handle from mBufferHandles.

Test: Manual
Bug: 141145482

Change-Id: I4e27f54eb219f23a5844d6b440d7160b296c31e2
2019-09-17 01:12:06 +00:00
Steven Moreland
38c46d0b98 Merge "Remove libhwbinder/libhidltransport deps" am: 6b62c58a9a am: 8c22c3862f am: 6684ee8c36
am: 9a5ffa3196

Change-Id: I3a80895d10767fe68e90a907312a83ded976cbcc
2019-09-06 16:06:13 -07:00
Steven Moreland
b3a4d3832e Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I075670b64eebbbbd6a6ae0e84ad51bf1c6f5ba36
2019-09-06 01:07:02 +00:00
Marissa Wall
6534164fd6 graphics: rev IAllocator/IMapper to 4.0
Rev the IAllocator/IMapper HIDL interfaces to 4.0. This patch is
a copy paste from IAllocator/IMapper 3.0.

Bug: 136016160
Test: Compiles and boots

Change-Id: Ia7f159f97fe0f812b5f0e10a850715364090883c
2019-07-23 17:08:06 -07:00
Valerie Hau
624ce4b638 Merge "Adding support for different Mapper versions in IComposer VTS tests" into qt-dev
am: 29594d2d02

Change-Id: Icd7b79a0a737c2b90a79a140168c15eaf3f50457
2019-06-20 13:14:35 -07:00
Valerie Hau
dca469c180 Adding support for different Mapper versions in IComposer VTS tests
Bug: 135139498
Test: build, boot, VtsHalGraphicsComposerV2_<1,2,3>TargetTest,
Change-Id: I05e2832c64d4c06eb4afd64c3323d7edbd19a5f4
Merged-In: I05e2832c64d4c06eb4afd64c3323d7edbd19a5f4
2019-06-19 17:14:24 -07:00
Valerie Hau
c1dc31340e Adding support for different Mapper versions in IComposer VTS tests
Bug: 135139498
Test: build, boot, VtsHalGraphicsComposerV2_<1,2,3>TargetTest,
Change-Id: I05e2832c64d4c06eb4afd64c3323d7edbd19a5f4
2019-06-19 13:56:04 -07:00
Valerie Hau
86a6f6e805 Merge "Call into validateBufferSize and getTransportSize" into qt-dev
am: 85b557fd1a

Change-Id: I367da83cd2e912d623698e28a6bda09a931aa33a
2019-05-06 09:29:05 -07:00
Valerie Hau
8e3fe149e1 Call into validateBufferSize and getTransportSize
After adding validateBufferSize and getTransportSize,
call into these functions if they have been implemented

This reverts commit 5e01b1411a.
Reason for revert: Merge once targets w/ gralloc0 dependency have been updated

Bug: 130669566
Test: build, boot
Change-Id: Ic20a62c5e73f517028a358548442d59c9cf91cdf
2019-04-24 21:46:01 +00:00
Valerie Hau
c04e71b89c Merge "Revert "Call into validateBufferSize and getTransportSize"" into qt-dev
am: a7904cd342

Change-Id: Ic407f3e433505dd9b6eb1024fd85e47e508b9a42
2019-04-23 16:24:51 -07:00
Valerie Hau
5e01b1411a Revert "Call into validateBufferSize and getTransportSize"
This reverts commit 69ee26a389.

Reason for revert: Break in Elfin

Bug: 130669566
Change-Id: Ia44fd087981770676a6887aa390c674c2855f4cb
2019-04-23 22:54:59 +00:00