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

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

Issue 2613493002: Fix namespace for src/ui/display/. (Closed)
Patch Set: Fix missed references. 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
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (!mode.htotal || !mode.vtotal) 95 if (!mode.htotal || !mode.vtotal)
96 return mode.vrefresh; 96 return mode.vrefresh;
97 97
98 float clock = mode.clock; 98 float clock = mode.clock;
99 float htotal = mode.htotal; 99 float htotal = mode.htotal;
100 float vtotal = mode.vtotal; 100 float vtotal = mode.vtotal;
101 101
102 return (clock * 1000.0f) / (htotal * vtotal); 102 return (clock * 1000.0f) / (htotal * vtotal);
103 } 103 }
104 104
105 DisplayConnectionType GetDisplayType(drmModeConnector* connector) { 105 display::DisplayConnectionType GetDisplayType(drmModeConnector* connector) {
106 switch (connector->connector_type) { 106 switch (connector->connector_type) {
107 case DRM_MODE_CONNECTOR_VGA: 107 case DRM_MODE_CONNECTOR_VGA:
108 return DISPLAY_CONNECTION_TYPE_VGA; 108 return display::DISPLAY_CONNECTION_TYPE_VGA;
109 case DRM_MODE_CONNECTOR_DVII: 109 case DRM_MODE_CONNECTOR_DVII:
110 case DRM_MODE_CONNECTOR_DVID: 110 case DRM_MODE_CONNECTOR_DVID:
111 case DRM_MODE_CONNECTOR_DVIA: 111 case DRM_MODE_CONNECTOR_DVIA:
112 return DISPLAY_CONNECTION_TYPE_DVI; 112 return display::DISPLAY_CONNECTION_TYPE_DVI;
113 case DRM_MODE_CONNECTOR_LVDS: 113 case DRM_MODE_CONNECTOR_LVDS:
114 case DRM_MODE_CONNECTOR_eDP: 114 case DRM_MODE_CONNECTOR_eDP:
115 case DRM_MODE_CONNECTOR_DSI: 115 case DRM_MODE_CONNECTOR_DSI:
116 return DISPLAY_CONNECTION_TYPE_INTERNAL; 116 return display::DISPLAY_CONNECTION_TYPE_INTERNAL;
117 case DRM_MODE_CONNECTOR_DisplayPort: 117 case DRM_MODE_CONNECTOR_DisplayPort:
118 return DISPLAY_CONNECTION_TYPE_DISPLAYPORT; 118 return display::DISPLAY_CONNECTION_TYPE_DISPLAYPORT;
119 case DRM_MODE_CONNECTOR_HDMIA: 119 case DRM_MODE_CONNECTOR_HDMIA:
120 case DRM_MODE_CONNECTOR_HDMIB: 120 case DRM_MODE_CONNECTOR_HDMIB:
121 return DISPLAY_CONNECTION_TYPE_HDMI; 121 return display::DISPLAY_CONNECTION_TYPE_HDMI;
122 default: 122 default:
123 return DISPLAY_CONNECTION_TYPE_UNKNOWN; 123 return display::DISPLAY_CONNECTION_TYPE_UNKNOWN;
124 } 124 }
125 } 125 }
126 126
127 int GetDrmProperty(int fd, 127 int GetDrmProperty(int fd,
128 drmModeConnector* connector, 128 drmModeConnector* connector,
129 const std::string& name, 129 const std::string& name,
130 ScopedDrmPropertyPtr* property) { 130 ScopedDrmPropertyPtr* property) {
131 for (int i = 0; i < connector->count_props; ++i) { 131 for (int i = 0; i < connector->count_props; ++i) {
132 ScopedDrmPropertyPtr tmp(drmModeGetProperty(fd, connector->props[i])); 132 ScopedDrmPropertyPtr tmp(drmModeGetProperty(fd, connector->props[i]));
133 if (!tmp) 133 if (!tmp)
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 case gfx::BufferFormat::BGR_565: 397 case gfx::BufferFormat::BGR_565:
398 return DRM_FORMAT_RGB565; 398 return DRM_FORMAT_RGB565;
399 case gfx::BufferFormat::UYVY_422: 399 case gfx::BufferFormat::UYVY_422:
400 return DRM_FORMAT_UYVY; 400 return DRM_FORMAT_UYVY;
401 default: 401 default:
402 NOTREACHED(); 402 NOTREACHED();
403 return 0; 403 return 0;
404 } 404 }
405 } 405 }
406 } // namespace ui 406 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698