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

Unified Diff: ui/ozone/platform/drm/host/drm_display_host_manager.cc

Issue 1131813003: [2/2][Ozone-Drm] Scan for displays on browser size during startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@handle-display-init3
Patch Set: rebased Created 5 years, 7 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/drm/host/drm_device_handle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/host/drm_display_host_manager.cc
diff --git a/ui/ozone/platform/drm/host/drm_display_host_manager.cc b/ui/ozone/platform/drm/host/drm_display_host_manager.cc
index 93d43e2467de430ae2cec6ce1655f6eb33dd403d..2feb1f4bae102cf2ac87b537968f936f19efce58 100644
--- a/ui/ozone/platform/drm/host/drm_display_host_manager.cc
+++ b/ui/ozone/platform/drm/host/drm_display_host_manager.cc
@@ -13,12 +13,12 @@
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/worker_pool.h"
-#include "ui/display/types/display_snapshot.h"
#include "ui/events/ozone/device/device_event.h"
#include "ui/events/ozone/device/device_manager.h"
#include "ui/ozone/common/display_snapshot_proxy.h"
#include "ui/ozone/common/display_util.h"
#include "ui/ozone/common/gpu/ozone_gpu_messages.h"
+#include "ui/ozone/platform/drm/common/drm_util.h"
#include "ui/ozone/platform/drm/host/drm_device_handle.h"
#include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h"
#include "ui/ozone/platform/drm/host/drm_native_display_delegate.h"
@@ -122,27 +122,13 @@ DrmDisplayHostManager::DrmDisplayHostManager(DrmGpuPlatformSupportHost* proxy,
device_manager_->AddObserver(this);
proxy_->RegisterHandler(this);
- DisplaySnapshot_Params params;
- bool success = false;
- {
- // The file generated by frecon that contains EDID for the 1st display.
- const base::FilePath kEDIDFile("/tmp/display_info.bin");
-
- // Just read it on current thread as this is necessary information
- // to start. This access only tmpfs, which is fast.
- // TODO(dnicoara|oshima): crbug.com/450886.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
- success = CreateSnapshotFromEDIDFile(kEDIDFile, &params);
- }
-
- // Fallback to command line if the file doesn't exit or failed to read.
- if (success || CreateSnapshotFromCommandLine(&params)) {
- LOG_IF(ERROR, !success) << "Failed to read display_info.bin.";
- DCHECK_NE(DISPLAY_CONNECTION_TYPE_NONE, params.type);
- displays_.push_back(new DisplaySnapshotProxy(params));
- has_dummy_display_ = true;
- } else {
- LOG(ERROR) << "Failed to obtain initial display info";
+ DrmDeviceHandle* handle = drm_devices_.get(primary_graphics_card_path_);
+ ScopedVector<HardwareDisplayControllerInfo> display_infos =
+ GetAvailableDisplayControllerInfos(handle->fd());
+ has_dummy_display_ = !display_infos.empty();
+ for (size_t i = 0; i < display_infos.size(); ++i) {
+ displays_.push_back(new DisplaySnapshotProxy(CreateDisplaySnapshotParams(
+ display_infos[i], handle->fd(), i, gfx::Point())));
}
}
« no previous file with comments | « ui/ozone/platform/drm/host/drm_device_handle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698