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

Unified Diff: ui/ozone/platform/drm/gpu/drm_overlay_validator.cc

Issue 2712463002: ozone: Reject overlays when a test buffer can't be allocated. (Closed)
Patch Set: Remove DCHECK that one plane would always succeed. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/drm_overlay_validator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/drm_overlay_validator.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_overlay_validator.cc b/ui/ozone/platform/drm/gpu/drm_overlay_validator.cc
index e83d62e6070314de5812d5d556406189c9ed3ad4..af00fe3ba0eb7cac5c1dd806bbf7715988ecf695 100644
--- a/ui/ozone/platform/drm/gpu/drm_overlay_validator.cc
+++ b/ui/ozone/platform/drm/gpu/drm_overlay_validator.cc
@@ -45,7 +45,8 @@ scoped_refptr<ScanoutBuffer> GetBufferForPageFlipTest(
scoped_refptr<ScanoutBuffer> scanout_buffer =
buffer_generator->Create(drm_device, format, size);
- reusable_buffers->push_back(scanout_buffer);
+ if (scanout_buffer)
+ reusable_buffers->push_back(scanout_buffer);
return scanout_buffer;
}
@@ -132,15 +133,14 @@ std::vector<OverlayCheck_Params> DrmOverlayValidator::TestPageFlip(
uint32_t original_format = GetFourCCFormatForFramebuffer(overlay.format);
scoped_refptr<ScanoutBuffer> buffer =
- GetBufferForPageFlipTest(drm, scaled_buffer_size, original_format,
+ GetBufferForPageFlipTest(drm, overlay.buffer_size, original_format,
buffer_generator_, &reusable_buffers);
- DCHECK(buffer);
OverlayPlane plane(buffer, overlay.plane_z_order, overlay.transform,
overlay.display_rect, overlay.crop_rect);
test_list.push_back(plane);
- if (controller->TestPageFlip(test_list)) {
+ if (buffer && controller->TestPageFlip(test_list)) {
overlay.is_overlay_candidate = true;
// If size scaling is needed, find an optimal format.
@@ -180,7 +180,6 @@ std::vector<OverlayCheck_Params> DrmOverlayValidator::TestPageFlip(
// hardware resources and they might be already in use by other planes.
// For example this plane has requested scaling capabilities and all
// available scalars are already in use by other planes.
- DCHECK(test_list.size() > 1);
overlay.is_overlay_candidate = false;
test_list.pop_back();
}
« no previous file with comments | « no previous file | 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