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

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

Issue 953363003: Figure out the default graphics card on the Browser process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assume-minigbm
Patch Set: Rename Created 5 years, 10 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/native_display_delegate_proxy.h ('k') | ui/ozone/platform/dri/ozone_platform_dri.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/native_display_delegate_proxy.cc
diff --git a/ui/ozone/platform/dri/native_display_delegate_proxy.cc b/ui/ozone/platform/dri/native_display_delegate_proxy.cc
index 377daf92b9a6d6738ae0c1cbb9580674bea15513..f651845a3656daebae216f6cb3e48de00ad9fc16 100644
--- a/ui/ozone/platform/dri/native_display_delegate_proxy.cc
+++ b/ui/ozone/platform/dri/native_display_delegate_proxy.cc
@@ -24,8 +24,6 @@ namespace ui {
namespace {
-const char kDefaultGraphicsCardPath[] = "/dev/dri/card0";
-
typedef base::Callback<void(const base::FilePath&, base::File)>
OnOpenDeviceReplyCallback;
@@ -71,10 +69,12 @@ class DriDisplaySnapshotProxy : public DisplaySnapshotProxy {
NativeDisplayDelegateProxy::NativeDisplayDelegateProxy(
DriGpuPlatformSupportHost* proxy,
DeviceManager* device_manager,
- DisplayManager* display_manager)
+ DisplayManager* display_manager,
+ const base::FilePath& primary_graphics_card_path)
: proxy_(proxy),
device_manager_(device_manager),
display_manager_(display_manager),
+ primary_graphics_card_path_(primary_graphics_card_path),
has_dummy_display_(false),
weak_ptr_factory_(this) {
proxy_->RegisterHandler(this);
@@ -226,9 +226,9 @@ void NativeDisplayDelegateProxy::OnDeviceEvent(const DeviceEvent& event) {
// the GPU process in order to initialize EGL. If it is opened here as
// well, it will cause a race with opening it in the GPU process and the
// GPU process may fail initialization.
- // TODO(dnicoara) Remove this when EGL_DEFAULT_DISPLAY is the only native
- // display we return in GbmSurfaceFactory.
- if (event.path().value() == kDefaultGraphicsCardPath)
+ // TODO(dnicoara) Remove this when the media stack does not require super
+ // early initialization.
+ if (event.path() == primary_graphics_card_path_)
return;
base::WorkerPool::PostTask(
@@ -246,7 +246,9 @@ void NativeDisplayDelegateProxy::OnDeviceEvent(const DeviceEvent& event) {
case DeviceEvent::REMOVE:
VLOG(1) << "Got display removed event for " << event.path().value();
// It shouldn't be possible to remove this device.
- DCHECK_NE(kDefaultGraphicsCardPath, event.path().value());
+ DCHECK(primary_graphics_card_path_ != event.path())
+ << "Got event to remove primary graphics card "
+ << event.path().value();
proxy_->Send(new OzoneGpuMsg_RemoveGraphicsDevice(event.path()));
break;
}
« no previous file with comments | « ui/ozone/platform/dri/native_display_delegate_proxy.h ('k') | ui/ozone/platform/dri/ozone_platform_dri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698