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

Unified Diff: ui/ozone/platform/dri/screen_manager_unittest.cc

Issue 838633002: [Ozone-DRI] Reuse framebuffer when re-enabling CRTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 11 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 | « ui/ozone/platform/dri/screen_manager.cc ('k') | ui/ozone/platform/dri/test/mock_dri_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/screen_manager_unittest.cc
diff --git a/ui/ozone/platform/dri/screen_manager_unittest.cc b/ui/ozone/platform/dri/screen_manager_unittest.cc
index b1c48f2f68844cba74479b37947e304cd2b56366..e27a64b77aa6a3fc3bff6bf48d8bf198e2573add 100644
--- a/ui/ozone/platform/dri/screen_manager_unittest.cc
+++ b/ui/ozone/platform/dri/screen_manager_unittest.cc
@@ -139,11 +139,16 @@ TEST_F(ScreenManagerTest, CheckDuplicateConfiguration) {
kPrimaryConnector,
GetPrimaryBounds().origin(),
kDefaultMode);
+ uint32_t framebuffer = dri_->current_framebuffer();
+
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
kDefaultMode);
+ // Should reuse existing framebuffer.
+ EXPECT_EQ(framebuffer, dri_->current_framebuffer());
+
EXPECT_TRUE(screen_manager_->GetDisplayController(GetPrimaryBounds()));
EXPECT_FALSE(screen_manager_->GetDisplayController(GetSecondaryBounds()));
}
@@ -275,3 +280,48 @@ TEST_F(ScreenManagerTest, DoNotEnterMirrorModeUnlessSameBounds) {
EXPECT_FALSE(
screen_manager_->GetDisplayController(GetPrimaryBounds())->IsMirrored());
}
+
+TEST_F(ScreenManagerTest, ReuseFramebufferIfDisabledThenReEnabled) {
+ screen_manager_->AddDisplayController(dri_.get(), kPrimaryCrtc,
+ kPrimaryConnector);
+ screen_manager_->ConfigureDisplayController(kPrimaryCrtc, kPrimaryConnector,
+ GetPrimaryBounds().origin(),
+ kDefaultMode);
+ uint32_t framebuffer = dri_->current_framebuffer();
+
+ screen_manager_->DisableDisplayController(kPrimaryCrtc);
+ EXPECT_EQ(0u, dri_->current_framebuffer());
+
+ screen_manager_->ConfigureDisplayController(kPrimaryCrtc, kPrimaryConnector,
+ GetPrimaryBounds().origin(),
+ kDefaultMode);
+
+ // Should reuse existing framebuffer.
+ EXPECT_EQ(framebuffer, dri_->current_framebuffer());
+}
+
+TEST_F(ScreenManagerTest, CheckMirrorModeAfterBeginReEnabled) {
+ screen_manager_->AddDisplayController(dri_.get(), kPrimaryCrtc,
+ kPrimaryConnector);
+ screen_manager_->ConfigureDisplayController(kPrimaryCrtc, kPrimaryConnector,
+ GetPrimaryBounds().origin(),
+ kDefaultMode);
+ screen_manager_->DisableDisplayController(kPrimaryCrtc);
+
+ screen_manager_->AddDisplayController(dri_.get(), kSecondaryCrtc,
+ kSecondaryConnector);
+ screen_manager_->ConfigureDisplayController(
+ kSecondaryCrtc, kSecondaryConnector, GetPrimaryBounds().origin(),
+ kDefaultMode);
+
+ base::WeakPtr<ui::HardwareDisplayController> controller =
+ screen_manager_->GetDisplayController(GetPrimaryBounds());
+ EXPECT_TRUE(controller);
+ EXPECT_FALSE(controller->IsMirrored());
+
+ screen_manager_->ConfigureDisplayController(kPrimaryCrtc, kPrimaryConnector,
+ GetPrimaryBounds().origin(),
+ kDefaultMode);
+ EXPECT_TRUE(controller);
+ EXPECT_TRUE(controller->IsMirrored());
+}
« no previous file with comments | « ui/ozone/platform/dri/screen_manager.cc ('k') | ui/ozone/platform/dri/test/mock_dri_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698