Commit 4c237b12 authored by Daniel Nicoara's avatar Daniel Nicoara Committed by Commit Bot

Return empty modifier list if format is not supported on a plane

The plane may not support the specific format for scanout. This is fine
if the buffers have an opaque version (ie: XRGB and ARGB) and blending
is disabled for scanout as the opaque version is used for scanout.

BUG=1082545
TEST=Ran in cros VM

Change-Id: I1a5caac796999d778eea272eed06dcbc261ac5e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212980
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771807}
parent 408f7dba
...@@ -126,11 +126,12 @@ std::vector<uint64_t> HardwareDisplayPlane::ModifiersForFormat( ...@@ -126,11 +126,12 @@ std::vector<uint64_t> HardwareDisplayPlane::ModifiersForFormat(
uint32_t format) const { uint32_t format) const {
std::vector<uint64_t> modifiers; std::vector<uint64_t> modifiers;
uint32_t format_index = auto it =
std::find(supported_formats_.begin(), supported_formats_.end(), format) - std::find(supported_formats_.begin(), supported_formats_.end(), format);
supported_formats_.begin(); if (it == supported_formats_.end())
DCHECK_LT(format_index, supported_formats_.size()); return modifiers;
uint32_t format_index = it - supported_formats_.begin();
for (const auto& modifier : supported_format_modifiers_) { for (const auto& modifier : supported_format_modifiers_) {
// modifier.formats is a bitmask of the formats the modifier // modifier.formats is a bitmask of the formats the modifier
// applies to, starting at format modifier.offset. That is, if bit // applies to, starting at format modifier.offset. That is, if bit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment