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.
5 #ifndef UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_H_
6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/display/types/display_constants.h"
10 #include "ui/display/types/native_display_delegate.h"
11 #include "ui/ozone/platform/drm/host/channel_observer.h"
15 struct DisplaySnapshot_Params
;
16 class DisplaySnapshot
;
17 class DrmGpuPlatformSupportHost
;
19 class DrmDisplayHost
: public ChannelObserver
{
21 DrmDisplayHost(DrmGpuPlatformSupportHost
* sender
,
22 const DisplaySnapshot_Params
& params
,
24 ~DrmDisplayHost() override
;
26 DisplaySnapshot
* snapshot() const { return snapshot_
.get(); }
28 void UpdateDisplaySnapshot(const DisplaySnapshot_Params
& params
);
29 void Configure(const DisplayMode
* mode
,
30 const gfx::Point
& origin
,
31 const ConfigureCallback
& callback
);
32 void GetHDCPState(const GetHDCPStateCallback
& callback
);
33 void SetHDCPState(HDCPState state
, const SetHDCPStateCallback
& callback
);
34 void SetGammaRamp(const std::vector
<GammaRampRGBEntry
>& lut
);
36 // Called when the IPC from the GPU process arrives to answer the above
38 void OnDisplayConfigured(bool status
);
39 void OnHDCPStateReceived(bool status
, HDCPState state
);
40 void OnHDCPStateUpdated(bool status
);
43 void OnChannelEstablished() override
;
44 void OnChannelDestroyed() override
;
47 // Calls all the callbacks with failure.
48 void ClearCallbacks();
50 DrmGpuPlatformSupportHost
* sender_
; // Not owned.
52 scoped_ptr
<DisplaySnapshot
> snapshot_
;
54 // Used during startup to signify that any display configuration should be
55 // synchronous and succeed.
58 ConfigureCallback configure_callback_
;
59 GetHDCPStateCallback get_hdcp_callback_
;
60 SetHDCPStateCallback set_hdcp_callback_
;
62 DISALLOW_COPY_AND_ASSIGN(DrmDisplayHost
);
67 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_H_