OLD | NEW |
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/gpu/drm_gpu_platform_support.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
10 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" | 10 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RefreshNativeDisplays, | 207 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RefreshNativeDisplays, |
208 OnRefreshNativeDisplays) | 208 OnRefreshNativeDisplays) |
209 IPC_MESSAGE_HANDLER(OzoneGpuMsg_ConfigureNativeDisplay, | 209 IPC_MESSAGE_HANDLER(OzoneGpuMsg_ConfigureNativeDisplay, |
210 OnConfigureNativeDisplay) | 210 OnConfigureNativeDisplay) |
211 IPC_MESSAGE_HANDLER(OzoneGpuMsg_DisableNativeDisplay, OnDisableNativeDisplay) | 211 IPC_MESSAGE_HANDLER(OzoneGpuMsg_DisableNativeDisplay, OnDisableNativeDisplay) |
212 IPC_MESSAGE_HANDLER(OzoneGpuMsg_TakeDisplayControl, OnTakeDisplayControl) | 212 IPC_MESSAGE_HANDLER(OzoneGpuMsg_TakeDisplayControl, OnTakeDisplayControl) |
213 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RelinquishDisplayControl, | 213 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RelinquishDisplayControl, |
214 OnRelinquishDisplayControl) | 214 OnRelinquishDisplayControl) |
215 IPC_MESSAGE_HANDLER(OzoneGpuMsg_AddGraphicsDevice, OnAddGraphicsDevice) | 215 IPC_MESSAGE_HANDLER(OzoneGpuMsg_AddGraphicsDevice, OnAddGraphicsDevice) |
216 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RemoveGraphicsDevice, OnRemoveGraphicsDevice) | 216 IPC_MESSAGE_HANDLER(OzoneGpuMsg_RemoveGraphicsDevice, OnRemoveGraphicsDevice) |
| 217 IPC_MESSAGE_HANDLER(OzoneGpuMsg_AddVgemDevice, OnAddVgemDevice) |
217 IPC_MESSAGE_HANDLER(OzoneGpuMsg_GetHDCPState, OnGetHDCPState) | 218 IPC_MESSAGE_HANDLER(OzoneGpuMsg_GetHDCPState, OnGetHDCPState) |
218 IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetHDCPState, OnSetHDCPState) | 219 IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetHDCPState, OnSetHDCPState) |
219 IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetGammaRamp, OnSetGammaRamp); | 220 IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetGammaRamp, OnSetGammaRamp); |
220 IPC_MESSAGE_UNHANDLED(handled = false); | 221 IPC_MESSAGE_UNHANDLED(handled = false); |
221 IPC_END_MESSAGE_MAP() | 222 IPC_END_MESSAGE_MAP() |
222 | 223 |
223 if (!handled) | 224 if (!handled) |
224 for (size_t i = 0; i < handlers_.size(); ++i) | 225 for (size_t i = 0; i < handlers_.size(); ++i) |
225 if (handlers_[i]->OnMessageReceived(message)) | 226 if (handlers_[i]->OnMessageReceived(message)) |
226 return true; | 227 return true; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 void DrmGpuPlatformSupport::OnAddGraphicsDevice( | 289 void DrmGpuPlatformSupport::OnAddGraphicsDevice( |
289 const base::FilePath& path, | 290 const base::FilePath& path, |
290 const base::FileDescriptor& fd) { | 291 const base::FileDescriptor& fd) { |
291 drm_device_manager_->AddDrmDevice(path, fd); | 292 drm_device_manager_->AddDrmDevice(path, fd); |
292 } | 293 } |
293 | 294 |
294 void DrmGpuPlatformSupport::OnRemoveGraphicsDevice(const base::FilePath& path) { | 295 void DrmGpuPlatformSupport::OnRemoveGraphicsDevice(const base::FilePath& path) { |
295 drm_device_manager_->RemoveDrmDevice(path); | 296 drm_device_manager_->RemoveDrmDevice(path); |
296 } | 297 } |
297 | 298 |
| 299 void DrmGpuPlatformSupport::OnAddVgemDevice(const base::FilePath& path, |
| 300 const base::FileDescriptor& fd) { |
| 301 drm_device_manager_->AddVgemDevice(path, fd); |
| 302 } |
| 303 |
298 void DrmGpuPlatformSupport::OnSetGammaRamp( | 304 void DrmGpuPlatformSupport::OnSetGammaRamp( |
299 int64_t id, | 305 int64_t id, |
300 const std::vector<GammaRampRGBEntry>& lut) { | 306 const std::vector<GammaRampRGBEntry>& lut) { |
301 ndd_->SetGammaRamp(id, lut); | 307 ndd_->SetGammaRamp(id, lut); |
302 } | 308 } |
303 | 309 |
304 void DrmGpuPlatformSupport::RelinquishGpuResources( | 310 void DrmGpuPlatformSupport::RelinquishGpuResources( |
305 const base::Closure& callback) { | 311 const base::Closure& callback) { |
306 callback.Run(); | 312 callback.Run(); |
307 } | 313 } |
(...skipping 13 matching lines...) Expand all Loading... |
321 void DrmGpuPlatformSupport::SetIOTaskRunner( | 327 void DrmGpuPlatformSupport::SetIOTaskRunner( |
322 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) { | 328 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) { |
323 drm_device_manager_->InitializeIOTaskRunner(io_task_runner); | 329 drm_device_manager_->InitializeIOTaskRunner(io_task_runner); |
324 } | 330 } |
325 | 331 |
326 IPC::MessageFilter* DrmGpuPlatformSupport::GetMessageFilter() { | 332 IPC::MessageFilter* DrmGpuPlatformSupport::GetMessageFilter() { |
327 return filter_.get(); | 333 return filter_.get(); |
328 } | 334 } |
329 | 335 |
330 } // namespace ui | 336 } // namespace ui |
OLD | NEW |