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

Side by Side Diff: ui/ozone/platform/drm/host/drm_overlay_candidates_host.h

Issue 1631073002: Relocate ozone gbm overlay config cache to manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 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 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 #ifndef UI_OZONE_PLATFORM_DRM_HOST_OVERLAY_CANDIDATES_H_ 5 #ifndef UI_OZONE_PLATFORM_DRM_HOST_OVERLAY_CANDIDATES_H_
6 #define UI_OZONE_PLATFORM_DRM_HOST_OVERLAY_CANDIDATES_H_ 6 #define UI_OZONE_PLATFORM_DRM_HOST_OVERLAY_CANDIDATES_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" 13 #include "ui/ozone/platform/drm/host/drm_overlay_candidates_host.h"
14 #include "ui/ozone/platform/drm/host/drm_overlay_candidates_host_core.h"
15 #include "ui/ozone/public/gpu_platform_support_host.h"
16 #include "ui/ozone/public/overlay_candidates_ozone.h" 14 #include "ui/ozone/public/overlay_candidates_ozone.h"
17 15
18 namespace ui { 16 namespace ui {
19 17
20 class DrmGpuPlatformSupportHost; 18 class DrmOverlayManagerCore;
21 class DrmWindowHost;
22 class DrmOverlayCandidatesHost;
23 19
24 // This is an implementation of OverlayCandidatesOzone where the driver is asked 20 // This is an implementation of OverlayCandidatesOzone where the driver is asked
25 // about overlay capabilities via IPC. We have no way of querying abstract 21 // about overlay capabilities via IPC. We have no way of querying abstract
26 // capabilities, only if a particular configuration is supported or not. 22 // capabilities, only if a particular configuration is supported or not.
27 // Each time we we are asked if a particular configuration is supported, if we 23 // Each time we we are asked if a particular configuration is supported, if we
28 // have not seen that configuration before, it is IPCed to the GPU via 24 // have not seen that configuration before, it is IPCed to the GPU via
29 // OzoneGpuMsg_CheckOverlayCapabilities; a test commit is then performed and 25 // OzoneGpuMsg_CheckOverlayCapabilities; a test commit is then performed and
30 // the result is returned in OzoneHostMsg_OverlayCapabilitiesReceived. Testing 26 // the result is returned in OzoneHostMsg_OverlayCapabilitiesReceived. Testing
31 // is asynchronous, until the reply arrives that configuration will be failed. 27 // is asynchronous, until the reply arrives that configuration will be failed.
32 // 28 //
33 // There is a many:1 relationship between this class and 29 // All OverlayCandidatesOzone objects share a single cache of tested
34 // DrmGpuPlatformSupportHost, each compositor will own one of these objects. 30 // configurations stored in the overlay manager.
35 // Each request has a unique request ID, which is assigned from a shared 31 class DrmOverlayCandidatesHost : public OverlayCandidatesOzone {
36 // sequence number so that replies can be routed to the correct object.
37 // TODO(rjkroege): Consider removing the dependency on
38 // GpuPlatformSupportHost.
39 class DrmOverlayCandidatesHost : public OverlayCandidatesOzone,
40 public GpuPlatformSupportHost {
41 public: 32 public:
42 DrmOverlayCandidatesHost(DrmGpuPlatformSupportHost* platform_support, 33 DrmOverlayCandidatesHost(DrmOverlayManagerCore* manager_core,
43 DrmWindowHost* window); 34 gfx::AcceleratedWidget widget);
44 ~DrmOverlayCandidatesHost() override; 35 ~DrmOverlayCandidatesHost() override;
45 36
46 // OverlayCandidatesOzone:
47 void CheckOverlaySupport(OverlaySurfaceCandidateList* candidates) override; 37 void CheckOverlaySupport(OverlaySurfaceCandidateList* candidates) override;
48 38
49 // GpuPlatformSupportHost:
50 void OnChannelEstablished(
51 int host_id,
52 scoped_refptr<base::SingleThreadTaskRunner> send_runner,
53 const base::Callback<void(IPC::Message*)>& sender) override;
54 void OnChannelDestroyed(int host_id) override;
55 bool OnMessageReceived(const IPC::Message& message) override;
56
57 private: 39 private:
58 class OverlayCandidatesIPC : public DrmOverlayCandidatesHostProxy { 40 DrmOverlayManagerCore* manager_core_; // Not owned.
kalyank 2016/01/25 23:43:43 overlay_manager_ perhaps ?
rjkroege 2016/01/26 01:38:40 Done.
59 public: 41 gfx::AcceleratedWidget widget_;
60 OverlayCandidatesIPC(DrmGpuPlatformSupportHost* platform_support,
61 DrmOverlayCandidatesHost* parent);
62 ~OverlayCandidatesIPC() override;
63 void RegisterHandler() override;
64 bool IsConnected() override;
65 void UnregisterHandler() override;
66 bool CheckOverlayCapabilities(
67 gfx::AcceleratedWidget widget,
68 const std::vector<OverlayCheck_Params>& new_params) override;
69
70 private:
71 DrmGpuPlatformSupportHost* platform_support_;
72 DrmOverlayCandidatesHost* parent_;
73 DISALLOW_COPY_AND_ASSIGN(OverlayCandidatesIPC);
74 };
75
76 // Entry point for incoming IPC.
77 void OnOverlayResult(bool* handled,
78 gfx::AcceleratedWidget widget,
79 const std::vector<OverlayCheck_Params>& params);
80
81 // Sends messages to the GPU thread.
82 scoped_ptr<OverlayCandidatesIPC> sender_;
83
84 // Implementation without messaging functionality.
85 scoped_ptr<DrmOverlayCandidatesHostCore> core_;
86 42
87 DISALLOW_COPY_AND_ASSIGN(DrmOverlayCandidatesHost); 43 DISALLOW_COPY_AND_ASSIGN(DrmOverlayCandidatesHost);
88 }; 44 };
89 45
90 } // namespace ui 46 } // namespace ui
91 47
92 #endif // UI_OZONE_PLATFORM_DRM_HOST_OVERLAY_CANDIDATES_H_ 48 #endif // UI_OZONE_PLATFORM_DRM_HOST_OVERLAY_CANDIDATES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698