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

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: 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 5f87095686efcd183a973db0edf420ecdfa05264..86ea3149de60bda7b2ce7da6a6901a7ae70ae401 100644
--- a/ui/ozone/platform/drm/gpu/drm_device.cc
+++ b/ui/ozone/platform/drm/gpu/drm_device.cc
@@ -19,6 +19,9 @@
#include "base/trace_event/trace_event.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "ui/ozone/platform/drm/gpu/drm_util.h"
+#if defined(OZONE_USE_ATOMIC)
dnicoara 2015/03/16 21:14:11 move #ifdef include block after the normal include
+#include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_atomic.h"
+#endif
#include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager_legacy.h"
namespace ui {
@@ -199,7 +202,11 @@ bool DrmDevice::Initialize() {
return false;
}
+#if defined(OZONE_USE_ATOMIC)
+ plane_manager_.reset(new HardwareDisplayPlaneManagerAtomic());
+#else
plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy());
+#endif
if (!plane_manager_->Initialize(this)) {
LOG(ERROR) << "Failed to initialize the plane manager for "
<< device_path_.value();
@@ -439,6 +446,24 @@ void DrmDevice::DestroyDumbBuffer(const SkImageInfo& info,
DrmDestroyDumbBuffer(file_.GetPlatformFile(), handle);
}
+bool DrmDevice::CommitProperties(drmModePropertySet* properties,
+ uint32_t flags,
+ const PageFlipCallback& callback) {
+#if defined(OZONE_USE_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
+}
+
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