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

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
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..1b2ca332d579cfc7830c320f32ce588b2f24670c 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)
+#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,17 @@ void DrmDevice::DestroyDumbBuffer(const SkImageInfo& info,
DrmDestroyDumbBuffer(file_.GetPlatformFile(), handle);
}
+bool DrmDevice::CommitProperties(drmModePropertySet* properties,
+ uint32_t flags,
+ void* user_ptr) {
+#if defined(OZONE_USE_ATOMIC)
+ return drmModePropertySetCommit(file_.GetPlatformFile(), flags, user_ptr,
+ properties) == 0;
+#else
+ return false;
+#endif
+}
+
bool DrmDevice::SetMaster() {
DCHECK(file_.IsValid());
return (drmSetMaster(file_.GetPlatformFile()) == 0);

Powered by Google App Engine
This is Rietveld 408576698