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( ...@@ -234,7 +234,6 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
size_t plane_idx = 0; size_t plane_idx = 0;
HardwareDisplayPlane* primary_plane = nullptr; HardwareDisplayPlane* primary_plane = nullptr;
gfx::Rect primary_display_bounds; gfx::Rect primary_display_bounds;
uint32_t primary_format;
for (const auto& plane : overlay_list) { for (const auto& plane : overlay_list) {
HardwareDisplayPlane* hw_plane = HardwareDisplayPlane* hw_plane =
FindNextUnusedPlane(&plane_idx, crtc_index, plane); FindNextUnusedPlane(&plane_idx, crtc_index, plane);
...@@ -265,12 +264,12 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes( ...@@ -265,12 +264,12 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
// it as primary. This reduces the no of planes which need to be read in // it as primary. This reduces the no of planes which need to be read in
// display controller side. // display controller side.
if (primary_plane) { if (primary_plane) {
bool needs_blending = true; // TODO(dcastagna): Check if we can move this optimization to
if (fourcc_format == DRM_FORMAT_XRGB8888) // GLRenderer::ScheduleOverlays.
needs_blending = false; // Note that Chromium compositor promotes buffers to overlays (ARGB
// TODO(kalyank): Check if we can move this optimization to // ones too) only if blending is not needed.
// DrmOverlayCandidatesHost. if ((fourcc_format == DRM_FORMAT_XRGB8888 ||
if (!needs_blending && primary_format == fourcc_format && fourcc_format == DRM_FORMAT_ARGB8888) &&
primary_display_bounds == plane.display_bounds) { primary_display_bounds == plane.display_bounds) {
ResetCurrentPlaneList(plane_list); ResetCurrentPlaneList(plane_list);
hw_plane = primary_plane; hw_plane = primary_plane;
...@@ -278,7 +277,6 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes( ...@@ -278,7 +277,6 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
} else { } else {
primary_plane = hw_plane; primary_plane = hw_plane;
primary_display_bounds = plane.display_bounds; primary_display_bounds = plane.display_bounds;
primary_format = fourcc_format;
} }
if (!SetPlaneData(plane_list, hw_plane, plane, crtc_id, fixed_point_rect, 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