1 // Copyright 2014 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_GPU_DRM_GPU_DISPLAY_MANAGER_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_
8 #include "base/memory/scoped_vector.h"
9 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
13 class DrmDeviceManager
;
17 struct GammaRampRGBEntry
;
19 class DrmGpuDisplayManager
{
21 DrmGpuDisplayManager(ScreenManager
* screen_manager
,
22 DrmDeviceManager
* drm_device_manager
);
23 ~DrmGpuDisplayManager();
25 // Returns a list of the connected displays. When this is called the list of
26 // displays is refreshed.
27 std::vector
<DisplaySnapshot_Params
> GetDisplays();
29 // Takes/releases the control of the DRM devices.
30 bool TakeDisplayControl();
31 void RelinquishDisplayControl();
33 bool ConfigureDisplay(int64_t id
,
34 const DisplayMode_Params
& mode
,
35 const gfx::Point
& origin
);
36 bool DisableDisplay(int64_t id
);
37 bool GetHDCPState(int64_t display_id
, HDCPState
* state
);
38 bool SetHDCPState(int64_t display_id
, HDCPState state
);
39 void SetGammaRamp(int64_t id
, const std::vector
<GammaRampRGBEntry
>& lut
);
42 DrmDisplay
* FindDisplay(int64_t display_id
);
44 // Notify ScreenManager of all the displays that were present before the
45 // update but are gone after the update.
46 void NotifyScreenManager(const std::vector
<DrmDisplay
*>& new_displays
,
47 const std::vector
<DrmDisplay
*>& old_displays
) const;
49 ScreenManager
* screen_manager_
; // Not owned.
50 DrmDeviceManager
* drm_device_manager_
; // Not owned.
52 ScopedVector
<DrmDisplay
> displays_
;
54 DISALLOW_COPY_AND_ASSIGN(DrmGpuDisplayManager
);
59 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_