Commit d8e82790 authored by Mark Yacoub's avatar Mark Yacoub Committed by Commit Bot

Revert incorrect plane in_use check

Revert to previous version (pre crrev.com/c/2039752).

|plane| is shared state between previously submitted frame and the current frame. We can't rely on that state since generating the new frame would have updated the plane state. It's existence in the |old_plane_list| is sufficient to signal that |plane| was previously used.

BUG=1045743,1053603,1053839
TEST=ozone_unittests

Change-Id: I08cdb1ae7962debf7ec35eea6f00291995454d34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062684Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Mark Yacoub <markyacoub@google.com>
Auto-Submit: Mark Yacoub <markyacoub@google.com>
Cr-Commit-Position: refs/heads/master@{#743188}
parent 60a014b7
...@@ -127,16 +127,20 @@ bool HardwareDisplayPlaneManagerAtomic::Commit( ...@@ -127,16 +127,20 @@ bool HardwareDisplayPlaneManagerAtomic::Commit(
for (HardwareDisplayPlane* plane : plane_list->old_plane_list) { for (HardwareDisplayPlane* plane : plane_list->old_plane_list) {
if (!base::Contains(plane_list->plane_list, plane)) { if (!base::Contains(plane_list->plane_list, plane)) {
if (plane->in_use()) { // |plane| is shared state between |old_plane_list| and |plane_list|.
// This plane is being released, so we need to zero it. // When we call BeginFrame(), we reset in_use since we need to be able to
plane->set_in_use(false); // allocate the planes as needed. The current frame might not need to use
HardwareDisplayPlaneAtomic* atomic_plane = // |plane|, thus |plane->in_use()| would be false even though the previous
static_cast<HardwareDisplayPlaneAtomic*>(plane); // frame used it. It's existence in |old_plane_list| is sufficient to
atomic_plane->SetPlaneData(plane_list->atomic_property_set.get(), 0, 0, // signal that |plane| was in use previously.
gfx::Rect(), gfx::Rect(), // TODO(markyacoub): Add a unittest that planes should be reset whether
gfx::OVERLAY_TRANSFORM_NONE, // they're originally in_use or not.
base::kInvalidPlatformFile); plane->set_in_use(false);
} HardwareDisplayPlaneAtomic* atomic_plane =
static_cast<HardwareDisplayPlaneAtomic*>(plane);
atomic_plane->SetPlaneData(
plane_list->atomic_property_set.get(), 0, 0, gfx::Rect(), gfx::Rect(),
gfx::OVERLAY_TRANSFORM_NONE, base::kInvalidPlatformFile);
} }
} }
......
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