Chromium Code Reviews| Index: ui/ozone/platform/drm/gpu/drm_thread.h |
| diff --git a/ui/ozone/platform/drm/gpu/drm_thread.h b/ui/ozone/platform/drm/gpu/drm_thread.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c4212c9905de553e1f5c1f0d299125b8446f8c0c |
| --- /dev/null |
| +++ b/ui/ozone/platform/drm/gpu/drm_thread.h |
| @@ -0,0 +1,121 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_H_ |
| +#define UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_H_ |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/threading/thread.h" |
| +#include "ui/gfx/native_widget_types.h" |
| +#include "ui/gfx/vsync_provider.h" |
| +#include "ui/ozone/common/gpu/ozone_gpu_message_params.h" |
| +#include "ui/ozone/public/surface_ozone_egl.h" |
| + |
| +namespace base { |
| +class FileDescriptor; |
| +} |
| + |
| +namespace gfx { |
| +class Point; |
| +class Rect; |
| +} |
| + |
| +namespace ui { |
| + |
| +class DrmDeviceManager; |
| +class DrmGpuDisplayManager; |
| +class DrmWindow; |
| +class DrmWindowProxy; |
| +class GbmBuffer; |
| +class ScanoutBufferGenerator; |
| +class ScreenManager; |
| + |
| +struct GammaRampRGBEntry; |
| +struct OverlayPlane; |
| + |
| +// Holds all the DRM related state and performs all DRM related operations with |
| +// the exception of buffer allocations which happen on the threads requiring the |
|
spang
2015/10/05 18:08:26
need update
dnicoara
2015/10/05 18:57:12
Done.
|
| +// allocations. |
| +// |
| +// The DRM thread is used to insulate DRM operations from potential blocking |
| +// behaviour on the GPU main thread in order to reduce the potential for jank |
| +// (for example jank in the cursor if the GPU main thread is performing heavy |
| +// operations). The inverse is also true as blocking operations on the DRM |
| +// thread (such as modesetting) no longer block the GPU main thread. |
| +class DrmThread : public base::Thread { |
| + public: |
| + DrmThread(); |
| + ~DrmThread() override; |
| + |
| + void Start(); |
| + |
| + // Must be called on the DRM thread. |
| + void CreateBuffer(gfx::AcceleratedWidget widget, |
| + const gfx::Size& size, |
| + gfx::BufferFormat format, |
| + gfx::BufferUsage usage, |
| + scoped_refptr<GbmBuffer>* buffer); |
| + |
| + void SchedulePageFlip(gfx::AcceleratedWidget widget, |
| + const std::vector<OverlayPlane>& planes, |
| + const SwapCompletionCallback& callback); |
| + void GetVSyncParameters( |
| + gfx::AcceleratedWidget widget, |
| + const gfx::VSyncProvider::UpdateVSyncCallback& callback); |
| + |
| + void CreateWindow(gfx::AcceleratedWidget widget); |
| + void DestroyWindow(gfx::AcceleratedWidget widget); |
| + void WindowBoundsChanged(gfx::AcceleratedWidget widget, |
|
spang
2015/10/05 18:08:26
SetWindowBounds
dnicoara
2015/10/05 18:57:12
Done.
|
| + const gfx::Rect& bounds); |
| + void CursorSet(gfx::AcceleratedWidget widget, |
|
spang
2015/10/05 18:08:26
SetCursor for consistency
.. unless you want to c
dnicoara
2015/10/05 18:57:12
Done.
|
| + const std::vector<SkBitmap>& bitmaps, |
| + const gfx::Point& location, |
| + int frame_delay_ms); |
| + void CursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location); |
|
spang
2015/10/05 18:08:26
MoveCursor
dnicoara
2015/10/05 18:57:12
Done.
|
| + void CheckOverlayCapabilities( |
| + gfx::AcceleratedWidget widget, |
| + const std::vector<OverlayCheck_Params>& overlays, |
| + const base::Callback<void(gfx::AcceleratedWidget, |
| + const std::vector<OverlayCheck_Params>&)>& |
| + callback); |
| + void RefreshNativeDisplays( |
| + const base::Callback<void(const std::vector<DisplaySnapshot_Params>&)>& |
| + callback); |
| + void ConfigureNativeDisplay( |
| + int64_t id, |
| + const DisplayMode_Params& mode, |
| + const gfx::Point& origin, |
| + const base::Callback<void(int64_t, bool)>& callback); |
| + void DisableNativeDisplay( |
| + int64_t id, |
| + const base::Callback<void(int64_t, bool)>& callback); |
| + void TakeDisplayControl(const base::Callback<void(bool)>& callback); |
| + void RelinquishDisplayControl(const base::Callback<void(bool)>& callback); |
| + void AddGraphicsDevice(const base::FilePath& path, |
| + const base::FileDescriptor& fd); |
| + void RemoveGraphicsDevice(const base::FilePath& path); |
| + void GetHDCPState( |
| + int64_t display_id, |
| + const base::Callback<void(int64_t, bool, HDCPState)>& callback); |
| + void SetHDCPState(int64_t display_id, |
| + HDCPState state, |
| + const base::Callback<void(int64_t, bool)>& callback); |
| + void SetGammaRamp(int64_t id, const std::vector<GammaRampRGBEntry>& lut); |
| + |
| + // base::Thread: |
| + void Init() override; |
| + |
| + private: |
| + scoped_ptr<DrmDeviceManager> device_manager_; |
| + scoped_ptr<ScanoutBufferGenerator> buffer_generator_; |
| + scoped_ptr<ScreenManager> screen_manager_; |
| + scoped_ptr<DrmGpuDisplayManager> display_manager_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DrmThread); |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_H_ |