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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_display_mode.cc

Issue 1129923004: [1/2][Ozone-Drm] Refactor GPU display management (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@handle-display-init2
Patch Set: . Created 5 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/ozone/platform/drm/gpu/drm_display_mode.h"
6
7 namespace ui {
8
9 namespace {
10
11 float GetRefreshRate(const drmModeModeInfo& mode) {
12 if (!mode.htotal || !mode.vtotal)
13 return mode.vrefresh;
14
15 float clock = mode.clock;
16 float htotal = mode.htotal;
17 float vtotal = mode.vtotal;
18
19 return (clock * 1000.0f) / (htotal * vtotal);
20 }
21
22 } // namespace
23
24 DrmDisplayMode::DrmDisplayMode(const drmModeModeInfo& mode)
25 : DisplayMode(gfx::Size(mode.hdisplay, mode.vdisplay),
26 mode.flags & DRM_MODE_FLAG_INTERLACE,
27 GetRefreshRate(mode)),
28 mode_info_(mode) {
29 }
30
31 DrmDisplayMode::~DrmDisplayMode() {
32 }
33
34 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_display_mode.h ('k') | ui/ozone/platform/drm/gpu/drm_display_snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698