| OLD | NEW |
| 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 #ifndef UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_ | 6 #define UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "ui/display/types/display_mode.h" | 15 #include "ui/display/types/display_mode.h" |
| 16 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" | 16 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" |
| 17 #include "ui/ozone/platform/drm/common/display_types.h" |
| 17 #include "ui/ozone/platform/drm/common/scoped_drm_types.h" | 18 #include "ui/ozone/platform/drm/common/scoped_drm_types.h" |
| 18 | 19 |
| 19 typedef struct _drmModeModeInfo drmModeModeInfo; | 20 typedef struct _drmModeModeInfo drmModeModeInfo; |
| 20 | 21 |
| 21 namespace display { | 22 namespace display { |
| 22 class DisplayMode; | 23 class DisplayMode; |
| 23 } // namespace display | 24 } // namespace display |
| 24 | 25 |
| 25 namespace gfx { | 26 namespace gfx { |
| 26 class Point; | 27 class Point; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 62 |
| 62 // |info| provides the DRM information related to the display, |fd| is the | 63 // |info| provides the DRM information related to the display, |fd| is the |
| 63 // connection to the DRM device. | 64 // connection to the DRM device. |
| 64 DisplaySnapshot_Params CreateDisplaySnapshotParams( | 65 DisplaySnapshot_Params CreateDisplaySnapshotParams( |
| 65 HardwareDisplayControllerInfo* info, | 66 HardwareDisplayControllerInfo* info, |
| 66 int fd, | 67 int fd, |
| 67 const base::FilePath& sys_path, | 68 const base::FilePath& sys_path, |
| 68 size_t device_index, | 69 size_t device_index, |
| 69 const gfx::Point& origin); | 70 const gfx::Point& origin); |
| 70 | 71 |
| 72 std::vector<DisplaySnapshot_Params> CreateParamsFromSnapshot( |
| 73 const MovableDisplaySnapshots& displays); |
| 74 |
| 71 int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format); | 75 int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format); |
| 72 gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format); | 76 gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format); |
| 73 | 77 |
| 74 int GetFourCCFormatForOpaqueFramebuffer(gfx::BufferFormat format); | 78 int GetFourCCFormatForOpaqueFramebuffer(gfx::BufferFormat format); |
| 75 | 79 |
| 76 gfx::Size GetMaximumCursorSize(int fd); | 80 gfx::Size GetMaximumCursorSize(int fd); |
| 77 | 81 |
| 78 DisplayMode_Params GetDisplayModeParams(const display::DisplayMode& mode); | 82 DisplayMode_Params GetDisplayModeParams(const display::DisplayMode& mode); |
| 79 | 83 |
| 80 std::unique_ptr<const display::DisplayMode> CreateDisplayModeFromParams( | 84 std::unique_ptr<const display::DisplayMode> CreateDisplayModeFromParams( |
| 81 const DisplayMode_Params& pmode); | 85 const DisplayMode_Params& pmode); |
| 82 | 86 |
| 83 bool MatchMode(const display::DisplayMode& display_mode, | 87 bool MatchMode(const display::DisplayMode& display_mode, |
| 84 const drmModeModeInfo& m); | 88 const drmModeModeInfo& m); |
| 85 | 89 |
| 86 const gfx::Size ModeSize(const drmModeModeInfo& mode); | 90 const gfx::Size ModeSize(const drmModeModeInfo& mode); |
| 87 | 91 |
| 88 float ModeRefreshRate(const drmModeModeInfo& mode); | 92 float ModeRefreshRate(const drmModeModeInfo& mode); |
| 89 | 93 |
| 90 bool ModeIsInterlaced(const drmModeModeInfo& mode); | 94 bool ModeIsInterlaced(const drmModeModeInfo& mode); |
| 91 | 95 |
| 96 MovableDisplaySnapshots CreateMovableDisplaySnapshotsFromParams( |
| 97 const std::vector<DisplaySnapshot_Params>& displays); |
| 98 |
| 92 } // namespace ui | 99 } // namespace ui |
| 93 | 100 |
| 94 #endif // UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_ | 101 #endif // UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_ |
| OLD | NEW |