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

Unified Diff: ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h

Issue 1661783002: Centralize all gbm ozone host IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h
diff --git a/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h b/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h
index 340c430b15e151c57ea50018e3474f23c9f943e6..1fbf20a342d194ec29a429909c84ac99606efbcd 100644
--- a/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h
+++ b/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h
@@ -9,7 +9,10 @@
#include "base/callback.h"
#include "base/observer_list.h"
+#include "ui/display/types/display_constants.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
+#include "ui/ozone/platform/drm/host/gpu_thread_adapter.h"
#include "ui/ozone/public/gpu_platform_support_host.h"
class SkBitmap;
@@ -21,22 +24,17 @@ class Point;
namespace ui {
class DrmCursor;
+class DrmDisplayHostMananger;
+class DrmOverlayManager;
class GpuThreadObserver;
class DrmGpuPlatformSupportHost : public GpuPlatformSupportHost,
+ public GpuThreadAdapter,
public IPC::Sender {
public:
DrmGpuPlatformSupportHost(DrmCursor* cursor);
~DrmGpuPlatformSupportHost() override;
- void RegisterHandler(GpuPlatformSupportHost* handler);
- void UnregisterHandler(GpuPlatformSupportHost* handler);
-
- void AddGpuThreadObserver(GpuThreadObserver* observer);
- void RemoveGpuThreadObserver(GpuThreadObserver* observer);
-
- bool IsConnected();
-
// GpuPlatformSupportHost:
void OnChannelEstablished(
int host_id,
@@ -50,13 +48,72 @@ class DrmGpuPlatformSupportHost : public GpuPlatformSupportHost,
// IPC::Sender:
bool Send(IPC::Message* message) override;
+ // GpuThreadAdapter.
+ // Core functionality.
+ void AddGpuThreadObserver(GpuThreadObserver* observer) override;
+ void RemoveGpuThreadObserver(GpuThreadObserver* observer) override;
+ bool IsConnected() override;
+
+ // Services needed for DrmDisplayHostMananger.
+ void RegisterHandlerForDrmDisplayHostManager(
+ DrmDisplayHostManager* handler) override;
+ void UnRegisterHandlerForDrmDisplayHostManager() override;
+
+ bool GpuTakeDisplayControl() override;
+ bool GpuRefreshNativeDisplays() override;
+ bool GpuRelinquishDisplayControl() override;
+ bool GpuAddGraphicsDevice(const base::FilePath& path,
+ base::FileDescriptor fd) override;
+ bool GpuRemoveGraphicsDevice(const base::FilePath& path) override;
+
+ // Methods needed for DrmOverlayManager.
+ // Methods for DrmOverlayManager.
+ void RegisterHandlerForDrmOverlayManager(DrmOverlayManager* handler) override;
+ void UnRegisterHandlerForDrmOverlayManager() override;
+
+ // Services needed by DrmOverlayManager
+ bool GpuCheckOverlayCapabilities(
+ gfx::AcceleratedWidget widget,
+ const std::vector<OverlayCheck_Params>& new_params) override;
+
+ // Services needed by DrmDisplayHost
+ bool GpuConfigureNativeDisplay(int64_t display_id,
+ ui::DisplayMode_Params display_mode,
+ gfx::Point point) override;
+ bool GpuDisableNativeDisplay(int64_t display_id) override;
+ bool GpuGetHDCPState(int64_t display_id) override;
+ bool GpuSetHDCPState(int64_t display_id, ui::HDCPState state) override;
+ bool GpuSetGammaRamp(int64_t display_id,
+ const std::vector<GammaRampRGBEntry>& lut) override;
+
+ // Services needed by DrmWindowHost
+ bool GpuDestroyWindow(gfx::AcceleratedWidget widget) override;
+ bool GpuCreateWindow(gfx::AcceleratedWidget widget) override;
+ bool GpuWindowBoundsChanged(gfx::AcceleratedWidget widget,
+ gfx::Rect bounds) override;
+
private:
+ bool OnMessageReceivedForDrmDisplayHostManager(const IPC::Message& message);
+ void OnUpdateNativeDisplays(
+ const std::vector<DisplaySnapshot_Params>& displays);
+ void OnDisplayConfigured(int64_t display_id, bool status);
+ void OnHDCPStateReceived(int64_t display_id, bool status, HDCPState state);
+ void OnHDCPStateUpdated(int64_t display_id, bool status);
+ void OnTakeDisplayControl(bool status);
+ void OnRelinquishDisplayControl(bool status);
+
+ bool OnMessageReceivedForDrmOverlayManager(const IPC::Message& message);
+ void OnOverlayResult(gfx::AcceleratedWidget widget,
+ const std::vector<OverlayCheck_Params>& params);
+
int host_id_ = -1;
scoped_refptr<base::SingleThreadTaskRunner> send_runner_;
base::Callback<void(IPC::Message*)> send_callback_;
- std::vector<GpuPlatformSupportHost*> handlers_; // Not owned.
+ DrmDisplayHostManager* display_manager_; // Not owned.
+ DrmOverlayManager* overlay_manager_; // Not owned.
+
DrmCursor* cursor_; // Not owned.
base::ObserverList<GpuThreadObserver> gpu_thread_observers_;
};

Powered by Google App Engine
This is Rietveld 408576698