gfxstream: Add P210 format support#150
Open
fkyslov wants to merge 1 commit into
Open
Conversation
Add GfxstreamFormat::P210 (4:2:2 10-bit YCbCr semiplanar) format handling to host Vulkan external memory imports and virtio-gpu frontend capabilities. Map HAL_PIXEL_FORMAT_YCBCR_P210 (60) in guest EGL import validation and configure 2 bpp buffer sizing and luma/chroma plane strides. Bug: 525088727 Test: atest MctsMediaV2TestCases && atest CtsGraphicsTestCases Flag: com.google.cf.config.gralloc_p010_p210_updates TAG=agy Change-Id: If0c2db49cb5392e774b537d3d12f1efa7d57b857
jmacnak
requested changes
Jun 22, 2026
jmacnak
left a comment
Member
There was a problem hiding this comment.
Mostly LGTM, a couple minors changes requested.
| yuv[2] = texture2D(uSamplerV, uvTexCoords).r; | ||
| )"; | ||
|
|
||
| static const char kSampleP010[] = R"( |
Member
There was a problem hiding this comment.
Can we rename this kSample10BitYUV now that it is not P010 specific?
|
|
||
| if (IsYuvFormat(format)) { | ||
| uint32_t bpp = format == GfxstreamFormat::P010 ? 2 : 1; | ||
| uint32_t bpp = (format == GfxstreamFormat::P010 || format == GfxstreamFormat::P210) ? 2 : 1; |
Member
There was a problem hiding this comment.
Could you update this to a switch statement similar to below so that we error out on new formats instead of assuming a default?
|
|
||
| uint32_t uvStrideBytes = uvStridePixels * bpp; | ||
| uint32_t uvHeight = totalHeight / 2; | ||
| uint32_t uvHeight = format == GfxstreamFormat::P210 ? totalHeight : totalHeight / 2; |
Member
There was a problem hiding this comment.
Could you also update this to be a switch statement that sets a new uint32_t verticalSubsampling so that we error out on new unhandled formats?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add GfxstreamFormat::P210 (4:2:2 10-bit YCbCr semiplanar) format handling to host Vulkan external memory imports and virtio-gpu frontend capabilities. Map HAL_PIXEL_FORMAT_YCBCR_P210 (60) in guest EGL import validation and configure 2 bpp buffer sizing and luma/chroma plane strides.
Change-Id: If0c2db49cb5392e774b537d3d12f1efa7d57b857