Commit graph

210 commits

Author SHA1 Message Date
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
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