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

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

Issue 994503004: Preliminary atomic patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change gyp var Created 5 years, 9 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.h » ('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 03ca9aa476946456ee29001b3f2bd571cbe8b13d..fe95a622ca04eb01255310bb612255d75a3a831e 100644
--- a/ui/ozone/platform/drm/gpu/drm_device.cc
+++ b/ui/ozone/platform/drm/gpu/drm_device.cc
@@ -21,6 +21,10 @@
#include "ui/ozone/platform/drm/gpu/drm_util.h"
#include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.h"
+#if defined(USE_DRM_ATOMIC)
+#include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_atomic.h"
+#endif
+
namespace ui {
namespace {
@@ -200,7 +204,11 @@ bool DrmDevice::Initialize() {
return false;
}
+#if defined(USE_DRM_ATOMIC)
+ plane_manager_.reset(new HardwareDisplayPlaneManagerAtomic());
+#else
plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy());
+#endif // defined(USE_DRM_ATOMIC)
if (!plane_manager_->Initialize(this)) {
LOG(ERROR) << "Failed to initialize the plane manager for "
<< device_path_.value();
@@ -440,6 +448,24 @@ void DrmDevice::DestroyDumbBuffer(const SkImageInfo& info,
DrmDestroyDumbBuffer(file_.GetPlatformFile(), handle);
}
+bool DrmDevice::CommitProperties(drmModePropertySet* properties,
+ uint32_t flags,
+ const PageFlipCallback& callback) {
+#if defined(USE_DRM_ATOMIC)
+ 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());
+ return true;
+ }
+ return false;
+#else
+ return false;
+#endif // defined(USE_DRM_ATOMIC)
+}
+
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.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698