diff options
author | Roman Kovalivskyi <roman.kovalivskyi@globallogic.com> | 2020-09-10 12:07:37 +0300 |
---|---|---|
committer | Roman Kovalivskyi <roman.kovalivskyi@globallogic.com> | 2020-09-25 14:58:04 +0300 |
commit | 15a453aae5294567e0609f63e35f767c06773219 (patch) | |
tree | e9114841895a4447b0d34a3fb7ac8edc4c477538 | |
parent | 859b6074d795e3f43dfc43af62a019042a4a014f (diff) | |
download | drm_hwcomposer-15a453aae5294567e0609f63e35f767c06773219.tar.gz |
drm_hwcomposer: Add check for format support during plane validation
Some layers have pixel format that aren't supported by a hardware. In
such case it is better to reject plane that doesn't supports such
format, so we could handle it in future, rather than accepting it,
passing to the kernel side and failing whole composition.
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
-rw-r--r-- | platform/platform.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/platform.cpp b/platform/platform.cpp index 479e79e..a500398 100644 --- a/platform/platform.cpp +++ b/platform/platform.cpp @@ -78,6 +78,13 @@ int Planner::PlanStage::ValidatePlane(DrmPlane *plane, DrmHwcLayer *layer) { ALOGE("Expected a valid blend mode on plane %d", plane->id()); } + uint32_t format = layer->buffer->format; + if (!plane->IsFormatSupported(format)) { + ALOGE("Plane %d does not supports %c%c%c%c format", plane->id(), format, + format >> 8, format >> 16, format >> 24); + return -EINVAL; + } + return ret; } |