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

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

Issue 2743403005: ozone: Add an opaque fb to ScanoutBuffer for primary planes. (Closed)
Patch Set: Replace PrimaryPlane with Opaque. Created 3 years, 9 months 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/drm_overlay_validator.h" 5 #include "ui/ozone/platform/drm/gpu/drm_overlay_validator.h"
6 6
7 #include <drm_fourcc.h> 7 #include <drm_fourcc.h>
8 8
9 #include "ui/gfx/geometry/size_conversions.h" 9 #include "ui/gfx/geometry/size_conversions.h"
10 #include "ui/ozone/platform/drm/common/drm_util.h" 10 #include "ui/ozone/platform/drm/common/drm_util.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 for (const auto& plane : last_used_planes) 124 for (const auto& plane : last_used_planes)
125 reusable_buffers.push_back(plane.buffer); 125 reusable_buffers.push_back(plane.buffer);
126 126
127 for (auto& overlay : validated_params) { 127 for (auto& overlay : validated_params) {
128 if (!overlay.is_overlay_candidate) 128 if (!overlay.is_overlay_candidate)
129 continue; 129 continue;
130 130
131 gfx::Size scaled_buffer_size = GetScaledSize( 131 gfx::Size scaled_buffer_size = GetScaledSize(
132 overlay.buffer_size, overlay.display_rect, overlay.crop_rect); 132 overlay.buffer_size, overlay.display_rect, overlay.crop_rect);
133 133
134 uint32_t original_format = GetFourCCFormatForFramebuffer(overlay.format); 134 uint32_t original_format =
135 overlay.plane_z_order
136 ? GetFourCCFormatFromBufferFormat(overlay.format)
137 : GetFourCCFormatForOpaqueFramebuffer(overlay.format);
135 scoped_refptr<ScanoutBuffer> buffer = 138 scoped_refptr<ScanoutBuffer> buffer =
136 GetBufferForPageFlipTest(drm, overlay.buffer_size, original_format, 139 GetBufferForPageFlipTest(drm, overlay.buffer_size, original_format,
137 buffer_generator_, &reusable_buffers); 140 buffer_generator_, &reusable_buffers);
138 141
139 OverlayPlane plane(buffer, overlay.plane_z_order, overlay.transform, 142 OverlayPlane plane(buffer, overlay.plane_z_order, overlay.transform,
140 overlay.display_rect, overlay.crop_rect); 143 overlay.display_rect, overlay.crop_rect);
141 test_list.push_back(plane); 144 test_list.push_back(plane);
142 145
143 if (buffer && controller->TestPageFlip(test_list)) { 146 if (buffer && controller->TestPageFlip(test_list)) {
144 overlay.is_overlay_candidate = true; 147 overlay.is_overlay_candidate = true;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 264
262 // Make sure we dont hold reference to buffer when caching this plane list. 265 // Make sure we dont hold reference to buffer when caching this plane list.
263 plane.buffer = nullptr; 266 plane.buffer = nullptr;
264 } 267 }
265 268
266 DCHECK(hints_plane_list.size() == overlay_hints.size()); 269 DCHECK(hints_plane_list.size() == overlay_hints.size());
267 overlay_hints_cache_.Put(hints_plane_list, overlay_hints); 270 overlay_hints_cache_.Put(hints_plane_list, overlay_hints);
268 } 271 }
269 272
270 } // namespace ui 273 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_buffer.cc ('k') | ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698