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

Side by Side Diff: ui/ozone/platform/drm/gbm_surface_factory.cc

Issue 1100973002: [2/4]Allow hotplugging of primary DRM device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-hotplug
Patch Set: unittests 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 unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/drm/BUILD.gn ('k') | ui/ozone/platform/drm/gpu/drm_device.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/ozone/platform/drm/gbm_surface_factory.h" 5 #include "ui/ozone/platform/drm/gbm_surface_factory.h"
6 6
7 #include <gbm.h> 7 #include <gbm.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 GbmSurfaceFactory::~GbmSurfaceFactory() { 76 GbmSurfaceFactory::~GbmSurfaceFactory() {
77 } 77 }
78 78
79 void GbmSurfaceFactory::InitializeGpu(DrmDeviceManager* drm_device_manager, 79 void GbmSurfaceFactory::InitializeGpu(DrmDeviceManager* drm_device_manager,
80 ScreenManager* screen_manager) { 80 ScreenManager* screen_manager) {
81 drm_device_manager_ = drm_device_manager; 81 drm_device_manager_ = drm_device_manager;
82 screen_manager_ = screen_manager; 82 screen_manager_ = screen_manager;
83 } 83 }
84 84
85 intptr_t GbmSurfaceFactory::GetNativeDisplay() { 85 intptr_t GbmSurfaceFactory::GetNativeDisplay() {
86 #if defined(USE_MESA_PLATFORM_NULL)
87 return EGL_DEFAULT_DISPLAY; 86 return EGL_DEFAULT_DISPLAY;
88 #else
89 scoped_refptr<GbmDevice> gbm = GetGbmDevice(gfx::kNullAcceleratedWidget);
90 DCHECK(gbm);
91 return reinterpret_cast<intptr_t>(gbm->device());
92 #endif
93 } 87 }
94 88
95 const int32* GbmSurfaceFactory::GetEGLSurfaceProperties( 89 const int32* GbmSurfaceFactory::GetEGLSurfaceProperties(
96 const int32* desired_list) { 90 const int32* desired_list) {
97 static const int32 kConfigAttribs[] = {EGL_BUFFER_SIZE, 91 static const int32 kConfigAttribs[] = {EGL_BUFFER_SIZE,
98 32, 92 32,
99 EGL_ALPHA_SIZE, 93 EGL_ALPHA_SIZE,
100 8, 94 8,
101 EGL_BLUE_SIZE, 95 EGL_BLUE_SIZE,
102 8, 96 8,
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return false; 206 return false;
213 } 207 }
214 208
215 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( 209 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice(
216 gfx::AcceleratedWidget widget) { 210 gfx::AcceleratedWidget widget) {
217 return static_cast<GbmDevice*>( 211 return static_cast<GbmDevice*>(
218 drm_device_manager_->GetDrmDevice(widget).get()); 212 drm_device_manager_->GetDrmDevice(widget).get());
219 } 213 }
220 214
221 } // namespace ui 215 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/BUILD.gn ('k') | ui/ozone/platform/drm/gpu/drm_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698