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

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: Created 5 years, 8 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
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return false; 211 return false;
218 } 212 }
219 213
220 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( 214 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice(
221 gfx::AcceleratedWidget widget) { 215 gfx::AcceleratedWidget widget) {
222 return static_cast<GbmDevice*>( 216 return static_cast<GbmDevice*>(
223 drm_device_manager_->GetDrmDevice(widget).get()); 217 drm_device_manager_->GetDrmDevice(widget).get());
224 } 218 }
225 219
226 } // namespace ui 220 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/drm_device.cc » ('j') | ui/ozone/platform/drm/gpu/drm_device_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698