Chromium Code Reviews| 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); |