Commit a3a1976d authored by dcastagna's avatar dcastagna Committed by Commit bot

ozone: Let BGRA fullscreen overlays replace primary plane.

Ozone HardwareDisplayPlaneManager has an internal optimization where
if an overlay completely covers the primary plane and it doesn't have an
alpha channel it is used to replace the primary plane.

Chrome promotes to overlays only RGBA buffers that don't use blending.

This CL relaxes the costraint that the buffer has to XBGR to use this
optimization.

BUG=b/29430506

Review-Url: https://codereview.chromium.org/2169733002
Cr-Commit-Position: refs/heads/master@{#406934}
parent c0fee27d
......@@ -234,7 +234,6 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
size_t plane_idx = 0;
HardwareDisplayPlane* primary_plane = nullptr;
gfx::Rect primary_display_bounds;
uint32_t primary_format;
for (const auto& plane : overlay_list) {
HardwareDisplayPlane* hw_plane =
FindNextUnusedPlane(&plane_idx, crtc_index, plane);
......@@ -265,12 +264,12 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
// it as primary. This reduces the no of planes which need to be read in
// display controller side.
if (primary_plane) {
bool needs_blending = true;
if (fourcc_format == DRM_FORMAT_XRGB8888)
needs_blending = false;
// TODO(kalyank): Check if we can move this optimization to
// DrmOverlayCandidatesHost.
if (!needs_blending && primary_format == fourcc_format &&
// TODO(dcastagna): Check if we can move this optimization to
// GLRenderer::ScheduleOverlays.
// Note that Chromium compositor promotes buffers to overlays (ARGB
// ones too) only if blending is not needed.
if ((fourcc_format == DRM_FORMAT_XRGB8888 ||
fourcc_format == DRM_FORMAT_ARGB8888) &&
primary_display_bounds == plane.display_bounds) {
ResetCurrentPlaneList(plane_list);
hw_plane = primary_plane;
......@@ -278,7 +277,6 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
} else {
primary_plane = hw_plane;
primary_display_bounds = plane.display_bounds;
primary_format = fourcc_format;
}
if (!SetPlaneData(plane_list, hw_plane, plane, crtc_id, fixed_point_rect,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment