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

Side by Side Diff: ui/ozone/platform/drm/common/drm_util.cc

Issue 2613493002: Fix namespace for src/ui/display/. (Closed)
Patch Set: Rebase. Created 3 years, 11 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
« no previous file with comments | « ui/ozone/platform/cast/ozone_platform_cast.cc ('k') | ui/ozone/platform/drm/gpu/drm_device.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/common/drm_util.h" 5 #include "ui/ozone/platform/drm/common/drm_util.h"
6 6
7 #include <drm_fourcc.h> 7 #include <drm_fourcc.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <sys/mman.h> 10 #include <sys/mman.h>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (!mode.htotal || !mode.vtotal) 75 if (!mode.htotal || !mode.vtotal)
76 return mode.vrefresh; 76 return mode.vrefresh;
77 77
78 float clock = mode.clock; 78 float clock = mode.clock;
79 float htotal = mode.htotal; 79 float htotal = mode.htotal;
80 float vtotal = mode.vtotal; 80 float vtotal = mode.vtotal;
81 81
82 return (clock * 1000.0f) / (htotal * vtotal); 82 return (clock * 1000.0f) / (htotal * vtotal);
83 } 83 }
84 84
85 DisplayConnectionType GetDisplayType(drmModeConnector* connector) { 85 display::DisplayConnectionType GetDisplayType(drmModeConnector* connector) {
86 switch (connector->connector_type) { 86 switch (connector->connector_type) {
87 case DRM_MODE_CONNECTOR_VGA: 87 case DRM_MODE_CONNECTOR_VGA:
88 return DISPLAY_CONNECTION_TYPE_VGA; 88 return display::DISPLAY_CONNECTION_TYPE_VGA;
89 case DRM_MODE_CONNECTOR_DVII: 89 case DRM_MODE_CONNECTOR_DVII:
90 case DRM_MODE_CONNECTOR_DVID: 90 case DRM_MODE_CONNECTOR_DVID:
91 case DRM_MODE_CONNECTOR_DVIA: 91 case DRM_MODE_CONNECTOR_DVIA:
92 return DISPLAY_CONNECTION_TYPE_DVI; 92 return display::DISPLAY_CONNECTION_TYPE_DVI;
93 case DRM_MODE_CONNECTOR_LVDS: 93 case DRM_MODE_CONNECTOR_LVDS:
94 case DRM_MODE_CONNECTOR_eDP: 94 case DRM_MODE_CONNECTOR_eDP:
95 case DRM_MODE_CONNECTOR_DSI: 95 case DRM_MODE_CONNECTOR_DSI:
96 return DISPLAY_CONNECTION_TYPE_INTERNAL; 96 return display::DISPLAY_CONNECTION_TYPE_INTERNAL;
97 case DRM_MODE_CONNECTOR_DisplayPort: 97 case DRM_MODE_CONNECTOR_DisplayPort:
98 return DISPLAY_CONNECTION_TYPE_DISPLAYPORT; 98 return display::DISPLAY_CONNECTION_TYPE_DISPLAYPORT;
99 case DRM_MODE_CONNECTOR_HDMIA: 99 case DRM_MODE_CONNECTOR_HDMIA:
100 case DRM_MODE_CONNECTOR_HDMIB: 100 case DRM_MODE_CONNECTOR_HDMIB:
101 return DISPLAY_CONNECTION_TYPE_HDMI; 101 return display::DISPLAY_CONNECTION_TYPE_HDMI;
102 default: 102 default:
103 return DISPLAY_CONNECTION_TYPE_UNKNOWN; 103 return display::DISPLAY_CONNECTION_TYPE_UNKNOWN;
104 } 104 }
105 } 105 }
106 106
107 int GetDrmProperty(int fd, 107 int GetDrmProperty(int fd,
108 drmModeConnector* connector, 108 drmModeConnector* connector,
109 const std::string& name, 109 const std::string& name,
110 ScopedDrmPropertyPtr* property) { 110 ScopedDrmPropertyPtr* property) {
111 for (int i = 0; i < connector->count_props; ++i) { 111 for (int i = 0; i < connector->count_props; ++i) {
112 ScopedDrmPropertyPtr tmp(drmModeGetProperty(fd, connector->props[i])); 112 ScopedDrmPropertyPtr tmp(drmModeGetProperty(fd, connector->props[i]));
113 if (!tmp) 113 if (!tmp)
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 case gfx::BufferFormat::BGR_565: 377 case gfx::BufferFormat::BGR_565:
378 return DRM_FORMAT_RGB565; 378 return DRM_FORMAT_RGB565;
379 case gfx::BufferFormat::UYVY_422: 379 case gfx::BufferFormat::UYVY_422:
380 return DRM_FORMAT_UYVY; 380 return DRM_FORMAT_UYVY;
381 default: 381 default:
382 NOTREACHED(); 382 NOTREACHED();
383 return 0; 383 return 0;
384 } 384 }
385 } 385 }
386 } // namespace ui 386 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/cast/ozone_platform_cast.cc ('k') | ui/ozone/platform/drm/gpu/drm_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698