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

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

Issue 1426993003: Ozone: Dont hardcode format to YUV when using Overlay Composition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_plane_manager.h" 5 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h"
6 6
7 #include <drm_fourcc.h> 7 #include <drm_fourcc.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 std::vector<uint32_t> plane_ids; 291 std::vector<uint32_t> plane_ids;
292 for (auto* hardware_plane : planes_) { 292 for (auto* hardware_plane : planes_) {
293 if (IsCompatible(hardware_plane, plane, crtc_index)) 293 if (IsCompatible(hardware_plane, plane, crtc_index))
294 plane_ids.push_back(hardware_plane->plane_id()); 294 plane_ids.push_back(hardware_plane->plane_id());
295 } 295 }
296 296
297 return plane_ids; 297 return plane_ids;
298 } 298 }
299 299
300 bool HardwareDisplayPlaneManager::IsFormatSupported(uint32_t fourcc_format,
301 uint32_t z_order,
302 uint32_t crtc_id) const {
303 int crtc_index = LookupCrtcIndex(crtc_id);
304 if (crtc_index < 0) {
305 LOG(ERROR) << "Cannot find crtc " << crtc_id;
306 return false;
307 }
308
309 // We dont have a way to query the z_order of a plane. This is a temporary
310 // solution till driver exposes z_order property.
311 uint32_t plane_z_order = 0;
312 for (auto* hardware_plane : planes_) {
313 if (plane_z_order > z_order)
314 break;
315
316 if (!hardware_plane->CanUseForCrtc(crtc_index))
317 continue;
318
319 if (plane_z_order != z_order) {
320 plane_z_order++;
321 continue;
322 }
323
324 if (hardware_plane->IsSupportedFormat(fourcc_format))
325 return true;
326 }
327
328 return false;
329 }
330
300 } // namespace ui 331 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698