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

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

Issue 1338843002: [Ozone-DRM] Use CRTC's mode when configuring it for mirror mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-scanout3
Patch Set: Removed get_mode() from HDC per dbehr@'s comment Created 5 years, 3 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 | « no previous file | ui/ozone/platform/drm/gpu/hardware_display_controller.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_vsync_provider.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc b/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc
index e3c39252569aef74b263691e2f89151e886670ae..6c0e1ca0964b12c6726c016fe4d34d48877cff9e 100644
--- a/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc
+++ b/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc
@@ -5,6 +5,7 @@
#include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h"
#include "base/time/time.h"
+#include "ui/ozone/platform/drm/gpu/crtc_controller.h"
#include "ui/ozone/platform/drm/gpu/drm_window.h"
#include "ui/ozone/platform/drm/gpu/hardware_display_controller.h"
@@ -21,9 +22,11 @@ void DrmVSyncProvider::GetVSyncParameters(const UpdateVSyncCallback& callback) {
if (!controller)
return;
+ // If we're in mirror mode the 2 CRTCs should have similar modes with the same
+ // refresh rates.
+ CrtcController* crtc = controller->crtc_controllers()[0];
// The value is invalid, so we can't update the parameters.
- if (controller->GetTimeOfLastFlip() == 0 ||
- controller->get_mode().vrefresh == 0)
+ if (controller->GetTimeOfLastFlip() == 0 || crtc->mode().vrefresh == 0)
return;
// Stores the time of the last refresh.
@@ -31,7 +34,7 @@ void DrmVSyncProvider::GetVSyncParameters(const UpdateVSyncCallback& callback) {
base::TimeTicks::FromInternalValue(controller->GetTimeOfLastFlip());
// Stores the refresh rate.
base::TimeDelta interval =
- base::TimeDelta::FromSeconds(1) / controller->get_mode().vrefresh;
+ base::TimeDelta::FromSeconds(1) / crtc->mode().vrefresh;
callback.Run(timebase, interval);
}
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/hardware_display_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698