OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/ozone/platform/drm/gpu/drm_window.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_window.h" |
6 | 6 |
7 #include <drm_fourcc.h> | 7 #include <drm_fourcc.h> |
8 | 8 |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); | 207 return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); |
208 } | 208 } |
209 | 209 |
210 void DrmWindow::GetVSyncParameters( | 210 void DrmWindow::GetVSyncParameters( |
211 const gfx::VSyncProvider::UpdateVSyncCallback& callback) const { | 211 const gfx::VSyncProvider::UpdateVSyncCallback& callback) const { |
212 if (!controller_) | 212 if (!controller_) |
213 return; | 213 return; |
214 | 214 |
215 // If we're in mirror mode the 2 CRTCs should have similar modes with the same | 215 // If we're in mirror mode the 2 CRTCs should have similar modes with the same |
216 // refresh rates. | 216 // refresh rates. |
217 CrtcController* crtc = controller_->crtc_controllers()[0]; | 217 CrtcController* crtc = controller_->crtc_controllers()[0].get(); |
218 // The value is invalid, so we can't update the parameters. | 218 // The value is invalid, so we can't update the parameters. |
219 if (controller_->GetTimeOfLastFlip() == 0 || crtc->mode().vrefresh == 0) | 219 if (controller_->GetTimeOfLastFlip() == 0 || crtc->mode().vrefresh == 0) |
220 return; | 220 return; |
221 | 221 |
222 // Stores the time of the last refresh. | 222 // Stores the time of the last refresh. |
223 base::TimeTicks timebase = | 223 base::TimeTicks timebase = |
224 base::TimeTicks::FromInternalValue(controller_->GetTimeOfLastFlip()); | 224 base::TimeTicks::FromInternalValue(controller_->GetTimeOfLastFlip()); |
225 // Stores the refresh rate. | 225 // Stores the refresh rate. |
226 base::TimeDelta interval = | 226 base::TimeDelta interval = |
227 base::TimeDelta::FromSeconds(1) / crtc->mode().vrefresh; | 227 base::TimeDelta::FromSeconds(1) / crtc->mode().vrefresh; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (!cursor_buffers_[i]->Initialize( | 297 if (!cursor_buffers_[i]->Initialize( |
298 info, false /* should_register_framebuffer */)) { | 298 info, false /* should_register_framebuffer */)) { |
299 LOG(FATAL) << "Failed to initialize cursor buffer"; | 299 LOG(FATAL) << "Failed to initialize cursor buffer"; |
300 return; | 300 return; |
301 } | 301 } |
302 } | 302 } |
303 } | 303 } |
304 } | 304 } |
305 | 305 |
306 } // namespace ui | 306 } // namespace ui |
OLD | NEW |