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

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

Issue 2576263002: ozone: Allocate scanout buffer according to KMS modifiers (Closed)
Patch Set: ozone: Allocate scanout buffer according to KMS modifiers Created 4 years 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 #include <utility> 10 #include <utility>
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 uint32_t z_order) const { 136 uint32_t z_order) const {
137 for (size_t i = 0; i < crtc_controllers_.size(); ++i) { 137 for (size_t i = 0; i < crtc_controllers_.size(); ++i) {
138 // Make sure all displays have overlay to support this format. 138 // Make sure all displays have overlay to support this format.
139 if (!crtc_controllers_[i]->IsFormatSupported(fourcc_format, z_order)) 139 if (!crtc_controllers_[i]->IsFormatSupported(fourcc_format, z_order))
140 return false; 140 return false;
141 } 141 }
142 142
143 return true; 143 return true;
144 } 144 }
145 145
146 std::vector<uint64_t> HardwareDisplayController::GetFormatModifiers(
147 uint32_t format) {
148 // TODO(hoegsberg): We need to intersect modifiers from different
dnicoara 2016/12/19 19:44:46 I'm wondering what are the implications of not imp
marcheu1 2016/12/20 01:25:30 I thought right now there should be none since we
dnicoara 2016/12/20 15:35:42 Yes, I believe we do software mirror for evdi and
hoegsberg1 2016/12/22 23:05:20 It looks like a HardwareDisplayController will hav
149 // controllers here.
150 for (const auto& controller : crtc_controllers_)
Daniele Castagna 2016/12/20 18:03:28 nit: maybe if (!crtc_controllers_.empty()) r
hoegsberg1 2016/12/22 23:05:20 I added the intersection code instead.
151 return controller->GetFormatModifiers(format);
152
153 return std::vector<uint64_t>();
154 }
155
146 bool HardwareDisplayController::SetCursor( 156 bool HardwareDisplayController::SetCursor(
147 const scoped_refptr<ScanoutBuffer>& buffer) { 157 const scoped_refptr<ScanoutBuffer>& buffer) {
148 bool status = true; 158 bool status = true;
149 159
150 if (is_disabled_) 160 if (is_disabled_)
151 return true; 161 return true;
152 162
153 for (const auto& controller : crtc_controllers_) 163 for (const auto& controller : crtc_controllers_)
154 status &= controller->SetCursor(buffer); 164 status &= controller->SetCursor(buffer);
155 165
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 280
271 scoped_refptr<DrmDevice> HardwareDisplayController::GetAllocationDrmDevice() 281 scoped_refptr<DrmDevice> HardwareDisplayController::GetAllocationDrmDevice()
272 const { 282 const {
273 DCHECK(!crtc_controllers_.empty()); 283 DCHECK(!crtc_controllers_.empty());
274 // TODO(dnicoara) When we support mirroring across DRM devices, figure out 284 // TODO(dnicoara) When we support mirroring across DRM devices, figure out
275 // which device should be used for allocations. 285 // which device should be used for allocations.
276 return crtc_controllers_[0]->drm(); 286 return crtc_controllers_[0]->drm();
277 } 287 }
278 288
279 } // namespace ui 289 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698