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.
5 #include "ui/ozone/platform/dri/display_mode_dri.h"
11 float GetRefreshRate(const drmModeModeInfo
& mode
) {
12 if (!mode
.htotal
|| !mode
.vtotal
)
15 float clock
= mode
.clock
;
16 float htotal
= mode
.htotal
;
17 float vtotal
= mode
.vtotal
;
19 return (clock
* 1000.0f
) / (htotal
* vtotal
);
24 DisplayModeDri::DisplayModeDri(const drmModeModeInfo
& mode
)
25 : DisplayMode(gfx::Size(mode
.hdisplay
, mode
.vdisplay
),
26 mode
.flags
& DRM_MODE_FLAG_INTERLACE
,
27 GetRefreshRate(mode
)),
31 DisplayModeDri::~DisplayModeDri() {