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

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

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 8 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_device.h ('k') | ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7b03b43036e61cde4942ab49d6b554791b8616e0..2e2da088877d3a757776436f00fb723d6b760034 100644
--- a/ui/ozone/platform/drm/gpu/drm_device.cc
+++ b/ui/ozone/platform/drm/gpu/drm_device.cc
@@ -498,14 +498,31 @@ 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;
+ if (!is_sync)
+ flags |= DRM_MODE_PAGE_FLIP_ASYNC;
scoped_ptr<PageFlipPayload> payload(
new PageFlipPayload(base::ThreadTaskRunnerHandle::Get(), callback));
if (!drmModePropertySetCommit(file_.GetPlatformFile(), flags, payload.get(),
properties)) {
// If successful the payload will be removed by the event
ignore_result(payload.release());
+
+ // 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());
+
+ drmEventContext event;
+ event.version = DRM_EVENT_CONTEXT_VERSION;
+ event.page_flip_handler = HandlePageFlipEventOnUI;
+ event.vblank_handler = nullptr;
+
+ drmHandleEvent(file_.GetPlatformFile(), &event);
+ }
return true;
}
return false;
@@ -514,6 +531,11 @@ bool DrmDevice::CommitProperties(drmModePropertySet* properties,
#endif // defined(USE_DRM_ATOMIC)
}
+bool DrmDevice::SetCapability(uint64_t capability, uint64_t value) {
+ DCHECK(file_.IsValid());
+ return !drmSetClientCap(file_.GetPlatformFile(), capability, value);
+}
+
bool DrmDevice::SetMaster() {
DCHECK(file_.IsValid());
return (drmSetMaster(file_.GetPlatformFile()) == 0);
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_device.h ('k') | ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698