Commit 6ce82219 authored by Yuanyao Zhong's avatar Yuanyao Zhong Committed by Commit Bot

Fix DCHECK_LT in drm GetPanelOrientation

display::PanelOrientation::kLast is defined as the last element in enum
display::PanelOrientation and the value could be equal to last element
in enum. Therefore replace DCHECK_LT to DCHECK_LE.

Bug: b/77900197
Test: build cast_shell
Change-Id: If939e21eb91610e86897a05c7c8d6c5a0c58f532
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219584
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773166}
parent 8b4d075d
......@@ -210,7 +210,7 @@ display::PanelOrientation GetPanelOrientation(int fd,
int index = GetDrmProperty(fd, connector, "panel orientation", &property);
if (index < 0)
return display::PanelOrientation::kNormal;
DCHECK_LT(connector->prop_values[index], display::PanelOrientation::kLast);
DCHECK_LE(connector->prop_values[index], display::PanelOrientation::kLast);
return static_cast<display::PanelOrientation>(connector->prop_values[index]);
}
......
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