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( ...@@ -78,6 +78,8 @@ NativeDisplayDelegateDri::NativeDisplayDelegateDri(
: dri_(dri), : dri_(dri),
screen_manager_(screen_manager), screen_manager_(screen_manager),
device_manager_(device_manager) { device_manager_(device_manager) {
// TODO(dnicoara): Remove when async display configuration is supported.
screen_manager_->ForceInitializationOfPrimaryDisplay();
} }
NativeDisplayDelegateDri::~NativeDisplayDelegateDri() { NativeDisplayDelegateDri::~NativeDisplayDelegateDri() {
......
...@@ -117,12 +117,6 @@ base::WeakPtr<HardwareDisplayController> ScreenManager::GetDisplayController( ...@@ -117,12 +117,6 @@ base::WeakPtr<HardwareDisplayController> ScreenManager::GetDisplayController(
if (it != controllers_.end()) if (it != controllers_.end())
return (*it)->AsWeakPtr(); 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>(); return base::WeakPtr<HardwareDisplayController>();
} }
...@@ -153,21 +147,6 @@ ScreenManager::FindActiveDisplayControllerByLocation(const gfx::Rect& bounds) { ...@@ -153,21 +147,6 @@ ScreenManager::FindActiveDisplayControllerByLocation(const gfx::Rect& bounds) {
return controllers_.end(); 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() { void ScreenManager::ForceInitializationOfPrimaryDisplay() {
LOG(WARNING) << "Forcing initialization of primary display."; LOG(WARNING) << "Forcing initialization of primary display.";
ScopedVector<HardwareDisplayControllerInfo> displays = ScopedVector<HardwareDisplayControllerInfo> displays =
......
...@@ -57,6 +57,11 @@ class ScreenManager { ...@@ -57,6 +57,11 @@ class ScreenManager {
base::WeakPtr<HardwareDisplayController> GetDisplayController( base::WeakPtr<HardwareDisplayController> GetDisplayController(
const gfx::Rect& bounds); 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: private:
typedef ScopedVector<HardwareDisplayController> HardwareDisplayControllers; typedef ScopedVector<HardwareDisplayController> HardwareDisplayControllers;
...@@ -69,11 +74,6 @@ class ScreenManager { ...@@ -69,11 +74,6 @@ class ScreenManager {
HardwareDisplayControllers::iterator FindActiveDisplayControllerByLocation( HardwareDisplayControllers::iterator FindActiveDisplayControllerByLocation(
const gfx::Rect& bounds); 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|. // Perform modesetting in |controller| using |origin| and |mode|.
bool ModesetDisplayController(HardwareDisplayController* controller, bool ModesetDisplayController(HardwareDisplayController* controller,
const gfx::Point& origin, const gfx::Point& origin,
...@@ -87,11 +87,6 @@ class ScreenManager { ...@@ -87,11 +87,6 @@ class ScreenManager {
uint32_t crtc, uint32_t crtc,
uint32_t connector); 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. DriWrapper* dri_; // Not owned.
ScanoutBufferGenerator* buffer_generator_; // Not owned. ScanoutBufferGenerator* buffer_generator_; // Not owned.
// List of display controllers (active and disabled). // 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