Commit 849b91b4 authored by dnicoara's avatar dnicoara Committed by Commit bot

[Ozone-DRI] Fix blank screen on init

BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/556263005

Cr-Commit-Position: refs/heads/master@{#294500}
parent 2906f15f
......@@ -78,6 +78,8 @@ NativeDisplayDelegateDri::NativeDisplayDelegateDri(
: dri_(dri),
screen_manager_(screen_manager),
device_manager_(device_manager) {
// TODO(dnicoara): Remove when async display configuration is supported.
screen_manager_->ForceInitializationOfPrimaryDisplay();
}
NativeDisplayDelegateDri::~NativeDisplayDelegateDri() {
......
......@@ -117,12 +117,6 @@ base::WeakPtr<HardwareDisplayController> ScreenManager::GetDisplayController(
if (it != controllers_.end())
return (*it)->AsWeakPtr();
// If no active controllers then pick the first controller at the location.
// TODO(dnicoara): Remove once async display configuration is fully supported.
it = FindDisplayControllerByLocation(bounds);
if (it != controllers_.end())
return (*it)->AsWeakPtr();
return base::WeakPtr<HardwareDisplayController>();
}
......@@ -153,21 +147,6 @@ ScreenManager::FindActiveDisplayControllerByLocation(const gfx::Rect& bounds) {
return controllers_.end();
}
ScreenManager::HardwareDisplayControllers::iterator
ScreenManager::FindDisplayControllerByLocation(const gfx::Rect& bounds) {
for (HardwareDisplayControllers::iterator it = controllers_.begin();
it != controllers_.end();
++it) {
gfx::Rect controller_bounds((*it)->origin(), (*it)->GetModeSize());
// We don't perform a strict check since content_shell will have windows
// smaller than the display size.
if (controller_bounds.Contains(bounds))
return it;
}
return controllers_.end();
}
void ScreenManager::ForceInitializationOfPrimaryDisplay() {
LOG(WARNING) << "Forcing initialization of primary display.";
ScopedVector<HardwareDisplayControllerInfo> displays =
......
......@@ -57,6 +57,11 @@ class ScreenManager {
base::WeakPtr<HardwareDisplayController> GetDisplayController(
const gfx::Rect& bounds);
// On non CrOS builds there is no display configurator to look-up available
// displays and initialize the HDCs. In such cases this is called internally
// to initialize a display.
virtual void ForceInitializationOfPrimaryDisplay();
private:
typedef ScopedVector<HardwareDisplayController> HardwareDisplayControllers;
......@@ -69,11 +74,6 @@ class ScreenManager {
HardwareDisplayControllers::iterator FindActiveDisplayControllerByLocation(
const gfx::Rect& bounds);
// Returns an iterator to the first controller located at |origin|. The
// controller may be disabled.
HardwareDisplayControllers::iterator FindDisplayControllerByLocation(
const gfx::Rect& bounds);
// Perform modesetting in |controller| using |origin| and |mode|.
bool ModesetDisplayController(HardwareDisplayController* controller,
const gfx::Point& origin,
......@@ -87,11 +87,6 @@ class ScreenManager {
uint32_t crtc,
uint32_t connector);
// On non CrOS builds there is no display configurator to look-up available
// displays and initialize the HDCs. In such cases this is called internally
// to initialize a display.
virtual void ForceInitializationOfPrimaryDisplay();
DriWrapper* dri_; // Not owned.
ScanoutBufferGenerator* buffer_generator_; // Not owned.
// List of display controllers (active and disabled).
......
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