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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_thread.h

Issue 1311043016: Switch DRM platform to using a separate thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mv-drm-calls-on-thread2
Patch Set: Created 5 years, 3 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/threading/thread.h"
10 #include "ui/gfx/native_widget_types.h"
11
12 namespace ui {
13
14 class DrmDeviceManager;
15 class DrmGpuPlatformSupport;
16 class DrmGpuPlatformSupportProxy;
17 class DrmWindowProxy;
18 class ScanoutBufferGenerator;
19 class ScreenManager;
20
21 // Holds all the DRM related state and performs all DRM related operations with
22 // the exception of buffer allocations which happen on the threads requiring the
23 // allocations.
24 //
25 // The DRM thread is used to insulate DRM operations from potential blocking
26 // behaviour on the GPU main thread in order to reduce the potential for jank
27 // (for example jank in the cursor if the GPU main thread is performing heavy
28 // operations). The inverse is also true as blocking operations on the DRM
29 // thread (such as modesetting) no longer block the GPU main thread.
30 class DrmThread : public base::Thread {
31 public:
32 DrmThread();
33 ~DrmThread() override;
34
35 void Start();
36
37 // Safe to use from any thread. Access to the device manager is direct since
38 // the device manager performs its own locking since buffer allocations need
39 // to happen on the main GPU thread and on the IO GPU thread without waiting.
40 DrmDeviceManager* device_manager() const { return device_manager_.get(); }
41
42 // Safe to use from any thread.
43 scoped_ptr<DrmWindowProxy> CreateWindowProxy(
44 gfx::AcceleratedWidget widget) const;
45
46 // Safe to use from any thread.
47 scoped_ptr<DrmGpuPlatformSupportProxy> CreateGpuPlatformSupportProxy() const;
48
49 // base::Thread:
50 void Init() override;
51
52 protected:
53 scoped_ptr<DrmDeviceManager> device_manager_;
54 scoped_ptr<ScanoutBufferGenerator> buffer_generator_;
55 scoped_ptr<ScreenManager> screen_manager_;
56 scoped_ptr<DrmGpuPlatformSupport> gpu_platform_support_;
57
58 private:
59 void CreateWindowProxyOnThread(gfx::AcceleratedWidget widget,
60 scoped_ptr<DrmWindowProxy>* proxy) const;
61
62 void CreateGpuPlatformSupportProxyOnThread(
63 scoped_ptr<DrmGpuPlatformSupportProxy>* proxy) const;
64
65 DISALLOW_COPY_AND_ASSIGN(DrmThread);
66 };
67
68 } // namespace ui
69
70 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698