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 #include "ui/ozone/platform/dri/hardware_display_plane_manager.h" | 5 #include "ui/ozone/platform/dri/hardware_display_plane_manager.h" |
6 | 6 |
7 #include <drm.h> | 7 #include <drm.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <xf86drm.h> | 9 #include <xf86drm.h> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/ozone/platform/dri/crtc_controller.h" | 13 #include "ui/ozone/platform/dri/crtc_controller.h" |
14 #include "ui/ozone/platform/dri/dri_wrapper.h" | 14 #include "ui/ozone/platform/dri/drm_device.h" |
15 #include "ui/ozone/platform/dri/hardware_display_controller.h" | 15 #include "ui/ozone/platform/dri/hardware_display_controller.h" |
16 #include "ui/ozone/platform/dri/scanout_buffer.h" | 16 #include "ui/ozone/platform/dri/scanout_buffer.h" |
17 #include "ui/ozone/public/ozone_switches.h" | 17 #include "ui/ozone/public/ozone_switches.h" |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 namespace { | 20 namespace { |
21 | 21 |
22 const float kFixedPointScaleValue = 65536.0f; | 22 const float kFixedPointScaleValue = 65536.0f; |
23 | 23 |
24 } // namespace | 24 } // namespace |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 HardwareDisplayPlaneList::PageFlipInfo::Plane::~Plane() { | 59 HardwareDisplayPlaneList::PageFlipInfo::Plane::~Plane() { |
60 } | 60 } |
61 | 61 |
62 HardwareDisplayPlaneManager::HardwareDisplayPlaneManager() : drm_(nullptr) { | 62 HardwareDisplayPlaneManager::HardwareDisplayPlaneManager() : drm_(nullptr) { |
63 } | 63 } |
64 | 64 |
65 HardwareDisplayPlaneManager::~HardwareDisplayPlaneManager() { | 65 HardwareDisplayPlaneManager::~HardwareDisplayPlaneManager() { |
66 } | 66 } |
67 | 67 |
68 bool HardwareDisplayPlaneManager::Initialize(DriWrapper* drm) { | 68 bool HardwareDisplayPlaneManager::Initialize(DrmDevice* drm) { |
69 drm_ = drm; | 69 drm_ = drm; |
70 ScopedDrmResourcesPtr resources(drmModeGetResources(drm->get_fd())); | 70 ScopedDrmResourcesPtr resources(drmModeGetResources(drm->get_fd())); |
71 if (!resources) { | 71 if (!resources) { |
72 PLOG(ERROR) << "Failed to get resources"; | 72 PLOG(ERROR) << "Failed to get resources"; |
73 return false; | 73 return false; |
74 } | 74 } |
75 | 75 |
76 ScopedDrmPlaneResPtr plane_resources(drmModeGetPlaneResources(drm->get_fd())); | 76 ScopedDrmPlaneResPtr plane_resources(drmModeGetPlaneResources(drm->get_fd())); |
77 if (!plane_resources) { | 77 if (!plane_resources) { |
78 LOG(ERROR) << "Failed to get plane resources."; | 78 LOG(ERROR) << "Failed to get plane resources."; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (plane->owning_crtc() == crtc_id) { | 205 if (plane->owning_crtc() == crtc_id) { |
206 plane->set_owning_crtc(0); | 206 plane->set_owning_crtc(0); |
207 plane->set_in_use(false); | 207 plane->set_in_use(false); |
208 } else { | 208 } else { |
209 plane_list->old_plane_list.push_back(plane); | 209 plane_list->old_plane_list.push_back(plane); |
210 } | 210 } |
211 } | 211 } |
212 } | 212 } |
213 | 213 |
214 } // namespace ui | 214 } // namespace ui |
OLD | NEW |