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

Side by Side Diff: ui/ozone/platform/drm/gpu/hardware_display_controller.cc

Issue 1417423002: [Ozone-DRM] Fix double call of swap buffers callback on failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 1 month 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/gpu/hardware_display_controller.h" 5 #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h"
6 6
7 #include <drm.h> 7 #include <drm.h>
8 #include <string.h> 8 #include <string.h>
9 #include <xf86drm.h> 9 #include <xf86drm.h>
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 scoped_refptr<PageFlipRequest> page_flip_request = 89 scoped_refptr<PageFlipRequest> page_flip_request =
90 new PageFlipRequest(crtc_controllers_.size(), callback); 90 new PageFlipRequest(crtc_controllers_.size(), callback);
91 91
92 OverlayPlaneList pending_planes = plane_list; 92 OverlayPlaneList pending_planes = plane_list;
93 std::sort(pending_planes.begin(), pending_planes.end(), 93 std::sort(pending_planes.begin(), pending_planes.end(),
94 [](const OverlayPlane& l, const OverlayPlane& r) { 94 [](const OverlayPlane& l, const OverlayPlane& r) {
95 return l.z_order < r.z_order; 95 return l.z_order < r.z_order;
96 }); 96 });
97 if (pending_planes.front().z_order != 0) 97 if (pending_planes.front().z_order != 0) {
98 callback.Run(gfx::SwapResult::SWAP_FAILED);
98 return false; 99 return false;
100 }
99 101
100 for (const auto& planes : owned_hardware_planes_) 102 for (const auto& planes : owned_hardware_planes_)
101 planes.first->plane_manager()->BeginFrame(planes.second); 103 planes.first->plane_manager()->BeginFrame(planes.second);
102 104
103 bool status = true; 105 bool status = true;
104 for (size_t i = 0; i < crtc_controllers_.size(); ++i) { 106 for (size_t i = 0; i < crtc_controllers_.size(); ++i) {
105 status &= crtc_controllers_[i]->SchedulePageFlip( 107 status &= crtc_controllers_[i]->SchedulePageFlip(
106 owned_hardware_planes_.get(crtc_controllers_[i]->drm().get()), 108 owned_hardware_planes_.get(crtc_controllers_[i]->drm().get()),
107 pending_planes, test_only, page_flip_request); 109 pending_planes, test_only, page_flip_request);
108 } 110 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 262
261 scoped_refptr<DrmDevice> HardwareDisplayController::GetAllocationDrmDevice() 263 scoped_refptr<DrmDevice> HardwareDisplayController::GetAllocationDrmDevice()
262 const { 264 const {
263 DCHECK(!crtc_controllers_.empty()); 265 DCHECK(!crtc_controllers_.empty());
264 // TODO(dnicoara) When we support mirroring across DRM devices, figure out 266 // TODO(dnicoara) When we support mirroring across DRM devices, figure out
265 // which device should be used for allocations. 267 // which device should be used for allocations.
266 return crtc_controllers_[0]->drm(); 268 return crtc_controllers_[0]->drm();
267 } 269 }
268 270
269 } // namespace ui 271 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_window_unittest.cc ('k') | ui/ozone/platform/drm/gpu/hardware_display_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698