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.
4 
5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_MANAGER_LEGACY_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_MANAGER_LEGACY_H_
7 
8 #include <stdint.h>
9 #include <memory>
10 
11 #include "base/macros.h"
12 #include "ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h"
13 
14 namespace ui {
15 
16 class HardwareDisplayPlaneManagerLegacy : public HardwareDisplayPlaneManager {
17  public:
18   explicit HardwareDisplayPlaneManagerLegacy(DrmDevice* device);
19   ~HardwareDisplayPlaneManagerLegacy() override;
20 
21   // HardwareDisplayPlaneManager:
22   bool Commit(CommitRequest commit_request, uint32_t flags) override;
23 
24   bool Commit(HardwareDisplayPlaneList* plane_list,
25               scoped_refptr<PageFlipRequest> page_flip_request,
26               std::unique_ptr<gfx::GpuFence>* out_fence) override;
27   bool DisableOverlayPlanes(HardwareDisplayPlaneList* plane_list) override;
28 
29   bool SetColorCorrectionOnAllCrtcPlanes(
30       uint32_t crtc_id,
31       ScopedDrmColorCtmPtr ctm_blob_data) override;
32 
33   bool ValidatePrimarySize(const DrmOverlayPlane& primary,
34                            const drmModeModeInfo& mode) override;
35 
36   void RequestPlanesReadyCallback(
37       DrmOverlayPlaneList planes,
38       base::OnceCallback<void(DrmOverlayPlaneList)> callback) override;
39 
40  protected:
41   bool InitializePlanes() override;
42   bool SetPlaneData(HardwareDisplayPlaneList* plane_list,
43                     HardwareDisplayPlane* hw_plane,
44                     const DrmOverlayPlane& overlay,
45                     uint32_t crtc_id,
46                     const gfx::Rect& src_rect) override;
47   bool IsCompatible(HardwareDisplayPlane* plane,
48                     const DrmOverlayPlane& overlay,
49                     uint32_t crtc_index) const override;
50   bool CommitColorMatrix(const CrtcProperties& crtc_props) override;
51   bool CommitGammaCorrection(const CrtcProperties& crtc_props) override;
52 
53  private:
54   DISALLOW_COPY_AND_ASSIGN(HardwareDisplayPlaneManagerLegacy);
55 };
56 
57 }  // namespace ui
58 
59 #endif  // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_MANAGER_LEGACY_H_
60