Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SMR0] Fixed the issue that sw codec fails to validate 10-bit type buffer #76

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion cros_gralloc/gralloc4/CrosGralloc4Mapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,20 @@ Return<Error> CrosGralloc4Mapper::validateBufferSize(void* rawHandle,
}

PixelFormat crosHandleFormat = static_cast<PixelFormat>(crosHandle->droid_format);
if (descriptor.format != crosHandleFormat &&

uint32_t descriptor_drmFormat = 0, handle_drmFormat = 0;

if (convertToDrmFormat(descriptor.format, &descriptor_drmFormat)) {
drv_log("Failed to convertToDrmFormat, descriptor.format = %d", (uint32_t)descriptor.format);
return Error::BAD_VALUE;
}

if (convertToDrmFormat(crosHandleFormat, &handle_drmFormat)) {
drv_log("Failed to convertToDrmFormat, crosHandleFormat = %d", (uint32_t)crosHandleFormat);
return Error::BAD_VALUE;
}

if (descriptor_drmFormat != handle_drmFormat &&
!flex_format_match((uint32_t)descriptor.format, (uint32_t)crosHandleFormat, descriptor.usage)) {
drv_log("Failed to validateBufferSize. Format mismatch.\n");
return Error::BAD_BUFFER;
Expand Down
Loading