Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Unified Diff: ui/ozone/platform/drm/gpu/drm_device.cc

Issue 1099713005: ozone: Add sync flag for atomic commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/drm/gpu/drm_device.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_device.cc b/ui/ozone/platform/drm/gpu/drm_device.cc
index 7b3181a2e8b8a4c0246625095e273fab83fe0795..7334cf16980a70c2ae7180dbbddfc93a05725bdb 100644
--- a/ui/ozone/platform/drm/gpu/drm_device.cc
+++ b/ui/ozone/platform/drm/gpu/drm_device.cc
@@ -559,20 +559,30 @@ bool DrmDevice::CloseBufferHandle(uint32_t handle) {
bool DrmDevice::CommitProperties(drmModePropertySet* properties,
uint32_t flags,
+ bool is_sync,
const PageFlipCallback& callback) {
#if defined(USE_DRM_ATOMIC)
+ flags |= DRM_MODE_PAGE_FLIP_EVENT;
scoped_ptr<PageFlipPayload> payload(
new PageFlipPayload(base::ThreadTaskRunnerHandle::Get(), callback));
+ uint64_t id = page_flip_manager_->GetNextId();
if (!drmModePropertySetCommit(file_.GetPlatformFile(), flags, payload.get(),
properties)) {
- // If successful the payload will be removed by the event
- ignore_result(payload.release());
+ page_flip_manager_->RegisterCallback(id, callback);
+
+ // If the flip was requested synchronous or if no watcher has been installed
+ // yet, then synchronously handle the page flip events.
+ if (is_sync || !watcher_) {
+ TRACE_EVENT1("drm", "OnDrmEvent", "socket", file_.GetPlatformFile());
+
+ ProcessDrmEvent(
+ file_.GetPlatformFile(),
+ base::Bind(&PageFlipManager::OnPageFlip, page_flip_manager_));
+ }
return true;
}
- return false;
-#else
- return false;
#endif // defined(USE_DRM_ATOMIC)
+ return false;
}
bool DrmDevice::SetMaster() {
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_device.h ('k') | ui/ozone/platform/drm/gpu/hardware_display_plane_manager_atomic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698