summaryrefslogtreecommitdiffstats
path: root/ui/ozone
diff options
context:
space:
mode:
authordnicoara <dnicoara@chromium.org>2015-03-27 16:21:32 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-27 23:22:27 +0000
commit294fce9a52d66387fc9d5ddcea123778dd446f65 (patch)
tree1687f8e2f4afa3e218acea7ce4ef7d17300d1835 /ui/ozone
parent5ed4724796d73dde8d2881181fc480d7f087f6bd (diff)
downloadchromium_src-294fce9a52d66387fc9d5ddcea123778dd446f65.zip
chromium_src-294fce9a52d66387fc9d5ddcea123778dd446f65.tar.gz
chromium_src-294fce9a52d66387fc9d5ddcea123778dd446f65.tar.bz2
[Ozone-Drm] Pick pending buffer over current buffer when modesetting
Buffers are expected to be scheduled/released in FIFO order. When enabling a display we want to re-use a buffer to avoid flashes. As such we need to make sure that the buffer used for modesetting is the last buffer queued. BUG=chrome-os-partner:38267 Review URL: https://codereview.chromium.org/1041823002 Cr-Commit-Position: refs/heads/master@{#322673}
Diffstat (limited to 'ui/ozone')
-rw-r--r--ui/ozone/platform/drm/gpu/hardware_display_controller.cc9
-rw-r--r--ui/ozone/platform/drm/gpu/hardware_display_controller.h3
2 files changed, 10 insertions, 2 deletions
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
index 3f31b6e..4371963 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -56,7 +56,6 @@ bool HardwareDisplayController::Modeset(const OverlayPlane& primary,
mode_ = mode;
current_planes_ = std::vector<OverlayPlane>(1, primary);
- pending_planes_.clear();
ClearPendingRequests();
// Because a page flip is pending we need to leave some state for the
@@ -71,7 +70,13 @@ bool HardwareDisplayController::Modeset(const OverlayPlane& primary,
bool HardwareDisplayController::Enable() {
TRACE_EVENT0("drm", "HDC::Enable");
DCHECK(!current_planes_.empty());
- const OverlayPlane* primary = OverlayPlane::GetPrimaryPlane(current_planes_);
+
+ const OverlayPlane* primary = nullptr;
+ // Use the last scheduled buffer to modeset to preserve request order.
+ if (!requests_.empty())
+ primary = OverlayPlane::GetPrimaryPlane(requests_.back().planes);
+ else
+ primary = OverlayPlane::GetPrimaryPlane(current_planes_);
return Modeset(*primary, mode_);
}
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.h b/ui/ozone/platform/drm/gpu/hardware_display_controller.h
index ee1d606..52095d5 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.h
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.h
@@ -180,7 +180,10 @@ class OZONE_EXPORT HardwareDisplayController
// Buffers need to be declared first so that they are destroyed last. Needed
// since the controllers may reference the buffers.
OverlayPlaneList current_planes_;
+ // Planes currently being queued without having SchedulePageFlip() called.
OverlayPlaneList pending_planes_;
+ // Plane lists for which SchedulePageFlip() was called. They are waiting for
+ // previous page flip events to be completed before they can be serviced.
std::deque<PageFlipRequest> requests_;
scoped_refptr<ScanoutBuffer> cursor_buffer_;