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

Unified Diff: ui/ozone/platform/drm/common/drm_util.cc

Issue 2894523007: Use display::DisplayMode in ozone/drm/gpu (Closed)
Patch Set: review nits Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/common/drm_util.h ('k') | ui/ozone/platform/drm/common/drm_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/common/drm_util.cc
diff --git a/ui/ozone/platform/drm/common/drm_util.cc b/ui/ozone/platform/drm/common/drm_util.cc
index 7d35a2a6c252fc4925ce6c3e6e0850518d80b138..48978e82a82d1a68588cf0c7bb75188137d53249 100644
--- a/ui/ozone/platform/drm/common/drm_util.cc
+++ b/ui/ozone/platform/drm/common/drm_util.cc
@@ -198,6 +198,32 @@ bool HasColorCorrectionMatrix(int fd, drmModeCrtc* crtc) {
} // namespace
+DisplayMode_Params GetDisplayModeParams(const display::DisplayMode& mode) {
+ DisplayMode_Params params;
+ params.size = mode.size();
+ params.is_interlaced = mode.is_interlaced();
+ params.refresh_rate = mode.refresh_rate();
+ return params;
+}
+
+std::unique_ptr<const display::DisplayMode> CreateDisplayModeFromParams(
+ const DisplayMode_Params& pmode) {
+ return base::MakeUnique<const display::DisplayMode>(
+ pmode.size, pmode.is_interlaced, pmode.refresh_rate);
+}
+
+const gfx::Size ModeSize(const drmModeModeInfo& mode) {
+ return gfx::Size(mode.hdisplay, mode.vdisplay);
+}
+
+float ModeRefreshRate(const drmModeModeInfo& mode) {
+ return GetRefreshRate(mode);
+}
+
+bool ModeIsInterlaced(const drmModeModeInfo& mode) {
+ return mode.flags & DRM_MODE_FLAG_INTERLACE;
+}
+
gfx::Size GetMaximumCursorSize(int fd) {
uint64_t width = 0, height = 0;
// Querying cursor dimensions is optional and is unsupported on older Chrome
« no previous file with comments | « ui/ozone/platform/drm/common/drm_util.h ('k') | ui/ozone/platform/drm/common/drm_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698