Commit 5ab9e3dc authored by dcastagna's avatar dcastagna Committed by Commit bot

ozone: Remove primary plane optimization.

Chrome browser compositor sends the primary buffer as a
normal overlay, therefore the optimization to replace the
primary plane can be done earlier in the browser compositor (crrev.com/2281033003).

This CL removes the optimization in Ozone.

BUG=b/29430506

Review-Url: https://codereview.chromium.org/2284893002
Cr-Commit-Position: refs/heads/master@{#415169}
parent 236b506a
......@@ -204,31 +204,6 @@ TEST_F(HardwareDisplayControllerTest, CheckOverlayTestMode) {
EXPECT_EQ(2, drm_->get_overlay_flip_call_count());
}
TEST_F(HardwareDisplayControllerTest, CheckOverlayFullScreenMode) {
ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>(
new ui::MockScanoutBuffer(kDefaultModeSize)));
ui::OverlayPlane plane2(scoped_refptr<ui::ScanoutBuffer>(
new ui::MockScanoutBuffer(kDefaultModeSize)),
1, gfx::OVERLAY_TRANSFORM_NONE,
gfx::Rect(kDefaultModeSize),
gfx::RectF(kDefaultModeSizeF));
EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode));
std::vector<ui::OverlayPlane> planes;
planes.push_back(plane1);
planes.push_back(plane2);
controller_->SchedulePageFlip(
planes, base::Bind(&HardwareDisplayControllerTest::PageFlipCallback,
base::Unretained(this)));
drm_->RunCallbacks();
EXPECT_EQ(gfx::SwapResult::SWAP_ACK, last_swap_result_);
EXPECT_EQ(1, page_flips_);
EXPECT_EQ(1, drm_->get_page_flip_call_count());
EXPECT_EQ(0, drm_->get_overlay_flip_call_count());
}
TEST_F(HardwareDisplayControllerTest, RejectUnderlays) {
ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>(
new ui::MockScanoutBuffer(kDefaultModeSize)));
......
......@@ -232,8 +232,6 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
}
size_t plane_idx = 0;
HardwareDisplayPlane* primary_plane = nullptr;
gfx::Rect primary_display_bounds;
for (const auto& plane : overlay_list) {
HardwareDisplayPlane* hw_plane =
FindNextUnusedPlane(&plane_idx, crtc_index, plane);
......@@ -244,7 +242,6 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
}
gfx::Rect fixed_point_rect;
uint32_t fourcc_format = plane.buffer->GetFramebufferPixelFormat();
if (hw_plane->type() != HardwareDisplayPlane::kDummy) {
const gfx::Size& size = plane.buffer->GetSize();
gfx::RectF crop_rect = plane.crop_rect;
......@@ -260,32 +257,6 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
to_fixed_point(crop_rect.height()));
}
// If Overlay completely covers primary and isn't transparent, than use
// it as primary. This reduces the no of planes which need to be read in
// display controller side.
if (primary_plane) {
// TODO(dcastagna): Check if we can move this optimization to
// GLRenderer::ScheduleOverlays.
// Note that Chromium compositor promotes buffers to overlays (ABGR
// ones too) only if blending is not needed.
// TODO(dcastagna): this should check if the format is the same as
// primary_plane->format minus alpha. Changing the format of the primary
// plane currently works on rockchip with 3.14 kernel and won't work with
// newer kernels. Remove this hack as soon as we can switch the primary
// plane format to match overlay buffers formats.
if ((fourcc_format == DRM_FORMAT_XBGR8888 ||
fourcc_format == DRM_FORMAT_ABGR8888 ||
fourcc_format == DRM_FORMAT_XRGB8888 ||
fourcc_format == DRM_FORMAT_ARGB8888) &&
primary_display_bounds == plane.display_bounds) {
ResetCurrentPlaneList(plane_list);
hw_plane = primary_plane;
}
} else {
primary_plane = hw_plane;
primary_display_bounds = plane.display_bounds;
}
if (!SetPlaneData(plane_list, hw_plane, plane, crtc_id, fixed_point_rect,
crtc)) {
ResetCurrentPlaneList(plane_list);
......
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