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

Side by Side Diff: ui/ozone/platform/dri/hardware_display_controller_unittest.cc

Issue 641173003: [Ozone-DRI] Fix waiting for page flips in mirror mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "third_party/skia/include/core/SkCanvas.h" 6 #include "third_party/skia/include/core/SkCanvas.h"
7 #include "ui/ozone/platform/dri/crtc_controller.h" 7 #include "ui/ozone/platform/dri/crtc_controller.h"
8 #include "ui/ozone/platform/dri/dri_buffer.h" 8 #include "ui/ozone/platform/dri/dri_buffer.h"
9 #include "ui/ozone/platform/dri/dri_wrapper.h" 9 #include "ui/ozone/platform/dri/dri_wrapper.h"
10 #include "ui/ozone/platform/dri/hardware_display_controller.h" 10 #include "ui/ozone/platform/dri/hardware_display_controller.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>( 175 ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>(
176 new MockScanoutBuffer(kDefaultModeSize))); 176 new MockScanoutBuffer(kDefaultModeSize)));
177 EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode)); 177 EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode));
178 EXPECT_EQ(2, drm_->get_set_crtc_call_count()); 178 EXPECT_EQ(2, drm_->get_set_crtc_call_count());
179 179
180 ui::OverlayPlane plane2(scoped_refptr<ui::ScanoutBuffer>( 180 ui::OverlayPlane plane2(scoped_refptr<ui::ScanoutBuffer>(
181 new MockScanoutBuffer(kDefaultModeSize))); 181 new MockScanoutBuffer(kDefaultModeSize)));
182 controller_->QueueOverlayPlane(plane2); 182 controller_->QueueOverlayPlane(plane2);
183 EXPECT_TRUE(controller_->SchedulePageFlip()); 183 EXPECT_TRUE(controller_->SchedulePageFlip());
184 EXPECT_EQ(2, drm_->get_page_flip_call_count()); 184 EXPECT_EQ(2, drm_->get_page_flip_call_count());
185
186 controller_->WaitForPageFlipEvent();
187 EXPECT_EQ(2, drm_->get_handle_events_count());
185 } 188 }
189
190 TEST_F(HardwareDisplayControllerTest,
191 PageflipMirroredControllersWithInvertedCrtcOrder) {
192 scoped_ptr<ui::CrtcController> crtc1(
193 new ui::CrtcController(drm_.get(), kPrimaryCrtc, kPrimaryConnector));
194 scoped_ptr<ui::CrtcController> crtc2(
195 new ui::CrtcController(drm_.get(), kSecondaryCrtc, kSecondaryConnector));
196
197 // Make sure that if the order is reversed everything is still fine.
198 std::queue<ui::CrtcController*> crtc_queue;
199 crtc_queue.push(crtc2.get());
200 crtc_queue.push(crtc1.get());
201
202 controller_.reset(new ui::HardwareDisplayController(crtc1.Pass()));
203 controller_->AddCrtc(crtc2.Pass());
204
205 ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>(
206 new MockScanoutBuffer(kDefaultModeSize)));
207 EXPECT_TRUE(controller_->Modeset(plane1, kDefaultMode));
208 EXPECT_EQ(2, drm_->get_set_crtc_call_count());
209
210 ui::OverlayPlane plane2(scoped_refptr<ui::ScanoutBuffer>(
211 new MockScanoutBuffer(kDefaultModeSize)));
212 controller_->QueueOverlayPlane(plane2);
213 EXPECT_TRUE(controller_->SchedulePageFlip());
214 EXPECT_EQ(2, drm_->get_page_flip_call_count());
215
216 drm_->set_controllers(crtc_queue);
217 controller_->WaitForPageFlipEvent();
218 EXPECT_EQ(2, drm_->get_handle_events_count());
219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698