Commit b5983c3f authored by Mark Yacoub's avatar Mark Yacoub Committed by Commit Bot

Ozone: Remove should_modeset flag from page flip commit.

Modeset no longer goes through HardwareDisplayPlaneManager::Commit overload
that currently handles page flip only.
Remove the should_modeset flag as it's no longer needed.

BUG=1082882
TEST=modeset is performed. HardwareDisplayPlaneManagerTest.*

Change-Id: I6804de8aa06ca382bc0800bc5c646060bba964e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2492720Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Commit-Queue: Mark Yacoub <markyacoub@google.com>
Cr-Commit-Position: refs/heads/master@{#819917}
parent 9f2455a8
......@@ -56,7 +56,6 @@ class MockHardwareDisplayPlaneManager : public HardwareDisplayPlaneManager {
return false;
}
bool Commit(HardwareDisplayPlaneList* plane_list,
bool should_modeset,
scoped_refptr<PageFlipRequest> page_flip_request,
std::unique_ptr<gfx::GpuFence>* out_fence) override {
return false;
......
......@@ -193,8 +193,7 @@ bool HardwareDisplayController::ScheduleOrTestPageFlip(
}
status &= GetDrmDevice()->plane_manager()->Commit(
&owned_hardware_planes_, /*should_modeset=*/false, page_flip_request,
out_fence);
&owned_hardware_planes_, page_flip_request, out_fence);
return status;
}
......
......@@ -151,7 +151,6 @@ class HardwareDisplayPlaneManager {
uint32_t crtc_id);
// Commit the plane states in |plane_list|.
// if |should_modeset| is set, it only modesets without page flipping.
// If |page_flip_request| is null, this tests the plane configuration without
// submitting it.
// The fence returned in |out_fence| will signal when the currently scanned
......@@ -159,7 +158,6 @@ class HardwareDisplayPlaneManager {
// |page_flip_request|. Note that the returned fence may be a nullptr
// if the system doesn't support out fences.
virtual bool Commit(HardwareDisplayPlaneList* plane_list,
bool should_modeset,
scoped_refptr<PageFlipRequest> page_flip_request,
std::unique_ptr<gfx::GpuFence>* out_fence) = 0;
......
......@@ -239,10 +239,9 @@ void HardwareDisplayPlaneManagerAtomic::SetAtomicPropsForCommit(
bool HardwareDisplayPlaneManagerAtomic::Commit(
HardwareDisplayPlaneList* plane_list,
bool should_modeset,
scoped_refptr<PageFlipRequest> page_flip_request,
std::unique_ptr<gfx::GpuFence>* out_fence) {
bool test_only = !should_modeset && !page_flip_request;
bool test_only = !page_flip_request;
std::vector<uint32_t> crtcs = GetCrtcIdsOfPlanes(*plane_list);
......@@ -268,11 +267,8 @@ bool HardwareDisplayPlaneManagerAtomic::Commit(
}
}
uint32_t flags = 0;
if (should_modeset)
flags = DRM_MODE_ATOMIC_ALLOW_MODESET;
else
flags = test_only ? DRM_MODE_ATOMIC_TEST_ONLY : DRM_MODE_ATOMIC_NONBLOCK;
uint32_t flags =
test_only ? DRM_MODE_ATOMIC_TEST_ONLY : DRM_MODE_ATOMIC_NONBLOCK;
if (!drm_->CommitProperties(plane_list->atomic_property_set.get(), flags,
crtcs.size(), page_flip_request)) {
......
......@@ -22,7 +22,6 @@ class HardwareDisplayPlaneManagerAtomic : public HardwareDisplayPlaneManager {
bool Commit(CommitRequest commit_request, uint32_t flags) override;
bool Commit(HardwareDisplayPlaneList* plane_list,
bool should_modeset,
scoped_refptr<PageFlipRequest> page_flip_request,
std::unique_ptr<gfx::GpuFence>* out_fence) override;
bool DisableOverlayPlanes(HardwareDisplayPlaneList* plane_list) override;
......
......@@ -72,13 +72,8 @@ bool HardwareDisplayPlaneManagerLegacy::Commit(CommitRequest commit_request,
bool HardwareDisplayPlaneManagerLegacy::Commit(
HardwareDisplayPlaneList* plane_list,
bool should_modeset,
scoped_refptr<PageFlipRequest> page_flip_request,
std::unique_ptr<gfx::GpuFence>* out_fence) {
// Legacy Modeset should not call Commit. Ensure the separation between both
// Atomic and Legacy and nothing trickles in.
DCHECK(!should_modeset);
bool test_only = !page_flip_request;
if (test_only) {
for (HardwareDisplayPlane* plane : plane_list->plane_list) {
......
......@@ -22,7 +22,6 @@ class HardwareDisplayPlaneManagerLegacy : public HardwareDisplayPlaneManager {
bool Commit(CommitRequest commit_request, uint32_t flags) override;
bool Commit(HardwareDisplayPlaneList* plane_list,
bool should_modeset,
scoped_refptr<PageFlipRequest> page_flip_request,
std::unique_ptr<gfx::GpuFence>* out_fence) override;
bool DisableOverlayPlanes(HardwareDisplayPlaneList* plane_list) override;
......
......@@ -227,8 +227,8 @@ void HardwareDisplayPlaneManagerTest::PerformPageFlip(
state, assigns, crtc_properties_[crtc_idx].id));
scoped_refptr<ui::PageFlipRequest> page_flip_request =
base::MakeRefCounted<ui::PageFlipRequest>(base::TimeDelta());
ASSERT_TRUE(fake_drm_->plane_manager()->Commit(
state, /*should_modeset*/ false, page_flip_request, nullptr));
ASSERT_TRUE(
fake_drm_->plane_manager()->Commit(state, page_flip_request, nullptr));
}
uint64_t HardwareDisplayPlaneManagerTest::GetObjectPropertyValue(
......@@ -654,8 +654,8 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, UnusedPlanesAreReleased) {
fake_drm_->plane_manager()->BeginFrame(&hdpl);
EXPECT_TRUE(fake_drm_->plane_manager()->AssignOverlayPlanes(
&hdpl, assigns, crtc_properties_[0].id));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(
&hdpl, /*should_modeset*/ false, page_flip_request, nullptr));
EXPECT_TRUE(
fake_drm_->plane_manager()->Commit(&hdpl, page_flip_request, nullptr));
assigns.clear();
assigns.push_back(ui::DrmOverlayPlane(primary_buffer, nullptr));
fake_drm_->plane_manager()->BeginFrame(&hdpl);
......@@ -664,8 +664,8 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, UnusedPlanesAreReleased) {
EXPECT_NE(0u, GetPlanePropertyValue(kPlaneOffset, "FB_ID"));
EXPECT_NE(0u, GetPlanePropertyValue(kPlaneOffset + 1, "FB_ID"));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(
&hdpl, /*should_modeset*/ false, page_flip_request, nullptr));
EXPECT_TRUE(
fake_drm_->plane_manager()->Commit(&hdpl, page_flip_request, nullptr));
EXPECT_NE(0u, GetPlanePropertyValue(kPlaneOffset, "FB_ID"));
EXPECT_EQ(0u, GetPlanePropertyValue(kPlaneOffset + 1, "FB_ID"));
}
......@@ -689,8 +689,8 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, AssignPlanesRestoresInUse) {
fake_drm_->plane_manager()->BeginFrame(&hdpl);
EXPECT_TRUE(fake_drm_->plane_manager()->AssignOverlayPlanes(
&hdpl, assigns, crtc_properties_[0].id));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(
&hdpl, /*should_modeset*/ false, page_flip_request, nullptr));
EXPECT_TRUE(
fake_drm_->plane_manager()->Commit(&hdpl, page_flip_request, nullptr));
EXPECT_TRUE(fake_drm_->plane_manager()->planes().front()->in_use());
assigns.push_back(ui::DrmOverlayPlane(overlay_buffer, nullptr));
......@@ -723,14 +723,13 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, PageflipTestRestoresInUse) {
fake_drm_->plane_manager()->BeginFrame(&hdpl);
EXPECT_TRUE(fake_drm_->plane_manager()->AssignOverlayPlanes(
&hdpl, assigns, crtc_properties_[0].id));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(
&hdpl, /*should_modeset*/ false, page_flip_request, nullptr));
EXPECT_TRUE(
fake_drm_->plane_manager()->Commit(&hdpl, page_flip_request, nullptr));
assigns.clear();
fake_drm_->plane_manager()->BeginFrame(&hdpl);
EXPECT_TRUE(fake_drm_->plane_manager()->AssignOverlayPlanes(
&hdpl, assigns, crtc_properties_[0].id));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(
&hdpl, /*should_modeset*/ false, nullptr, nullptr));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(&hdpl, nullptr, nullptr));
// The primary plane should still be in use since the commit was
// a pageflip test and did not change any KMS state.
EXPECT_TRUE(fake_drm_->plane_manager()->planes().front()->in_use());
......@@ -1064,8 +1063,8 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest,
base::MakeRefCounted<ui::PageFlipRequest>(base::TimeDelta());
std::unique_ptr<gfx::GpuFence> out_fence;
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(
&state_, /*should_modeset*/ false, page_flip_request, &out_fence));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(&state_, page_flip_request,
&out_fence));
EXPECT_EQ(nullptr, out_fence);
}
......@@ -1305,8 +1304,8 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, OverlaySourceCrop) {
std::unique_ptr<gfx::GpuFence> out_fence;
scoped_refptr<ui::PageFlipRequest> page_flip_request =
base::MakeRefCounted<ui::PageFlipRequest>(base::TimeDelta());
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(
&state_, /*should_modeset*/ false, page_flip_request, &out_fence));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(&state_, page_flip_request,
&out_fence));
EXPECT_EQ(2u << 16, GetPlanePropertyValue(kPlaneOffset, "SRC_W"));
EXPECT_EQ(2u << 16, GetPlanePropertyValue(kPlaneOffset, "SRC_H"));
......@@ -1326,8 +1325,8 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, OverlaySourceCrop) {
scoped_refptr<ui::PageFlipRequest> page_flip_request =
base::MakeRefCounted<ui::PageFlipRequest>(base::TimeDelta());
std::unique_ptr<gfx::GpuFence> out_fence;
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(
&state_, /*should_modeset*/ false, page_flip_request, &out_fence));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(&state_, page_flip_request,
&out_fence));
EXPECT_EQ(1u << 16, GetPlanePropertyValue(kPlaneOffset, "SRC_W"));
EXPECT_EQ(2u << 16, GetPlanePropertyValue(kPlaneOffset, "SRC_H"));
......@@ -1347,8 +1346,8 @@ TEST_P(HardwareDisplayPlaneManagerAtomicTest, OverlaySourceCrop) {
scoped_refptr<ui::PageFlipRequest> page_flip_request =
base::MakeRefCounted<ui::PageFlipRequest>(base::TimeDelta());
std::unique_ptr<gfx::GpuFence> out_fence;
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(
&state_, /*should_modeset*/ false, page_flip_request, &out_fence));
EXPECT_TRUE(fake_drm_->plane_manager()->Commit(&state_, page_flip_request,
&out_fence));
EXPECT_EQ(2u << 16, GetPlanePropertyValue(kPlaneOffset, "SRC_W"));
EXPECT_EQ(1u << 16, GetPlanePropertyValue(kPlaneOffset, "SRC_H"));
......
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