Commit 0a4940fb authored by Mark Yacoub's avatar Mark Yacoub Committed by Commit Bot

Ensure Legacy Modestting doesn't go through Commit()

1. |should_modeset| should never be true when committing using legacy API.
2. Use emplace_back instead of push_back (modernize-use-emplace)

BUG=987274
TEST=enable and page flip legacy devices.

Change-Id: I78615163191a5ba537d4136702fc50452fc503d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2418617Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Mark Yacoub <markyacoub@google.com>
Cr-Commit-Position: refs/heads/master@{#809366}
parent 9b03340a
......@@ -67,6 +67,10 @@ bool HardwareDisplayPlaneManagerLegacy::Commit(
bool should_modeset,
scoped_refptr<PageFlipRequest> page_flip_request,
std::unique_ptr<gfx::GpuFence>* out_fence) {
// Legacy Modeset should not call Commit. Ensure the separation between both
// Atomic and Legacy and nothing trickles in.
DCHECK(!should_modeset);
bool test_only = !page_flip_request;
if (test_only) {
for (HardwareDisplayPlane* plane : plane_list->plane_list) {
......@@ -202,9 +206,8 @@ bool HardwareDisplayPlaneManagerLegacy::SetPlaneData(
if (plane_list->legacy_page_flips.empty() ||
plane_list->legacy_page_flips.back().crtc_id != crtc_id) {
plane_list->legacy_page_flips.push_back(
HardwareDisplayPlaneList::PageFlipInfo(
crtc_id, overlay.buffer->opaque_framebuffer_id()));
plane_list->legacy_page_flips.emplace_back(
crtc_id, overlay.buffer->opaque_framebuffer_id());
} else {
return false;
}
......
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