Skip to content

gfxstream: Add P210 format support#150

Open
fkyslov wants to merge 1 commit into
google:mainfrom
fkyslov:main
Open

gfxstream: Add P210 format support#150
fkyslov wants to merge 1 commit into
google:mainfrom
fkyslov:main

Conversation

@fkyslov

@fkyslov fkyslov commented Jun 22, 2026

Copy link
Copy Markdown

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

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 jmacnak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM, a couple minors changes requested.

Comment thread host/gl/yuv_converter.cpp
yuv[2] = texture2D(uSamplerV, uvTexCoords).r;
)";

static const char kSampleP010[] = R"(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants