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_HARDWARE_DISPLAY_PLANE_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_
11 #include "base/basictypes.h"
12 #include "ui/ozone/ozone_export.h"
13 #include "ui/ozone/platform/drm/common/scoped_drm_types.h"
23 class OZONE_EXPORT HardwareDisplayPlane
{
25 enum Type
{ kDummy
, kPrimary
, kOverlay
, kCursor
};
27 HardwareDisplayPlane(uint32_t plane_id
, uint32_t possible_crtcs
);
29 virtual ~HardwareDisplayPlane();
31 bool Initialize(DrmDevice
* drm
,
32 const std::vector
<uint32_t>& formats
,
36 bool IsSupportedFormat(uint32_t format
);
38 bool CanUseForCrtc(uint32_t crtc_index
);
40 bool in_use() const { return in_use_
; }
41 void set_in_use(bool in_use
) { in_use_
= in_use
; }
43 uint32_t plane_id() const { return plane_id_
; }
45 Type
type() const { return type_
; }
47 void set_owning_crtc(uint32_t crtc
) { owning_crtc_
= crtc
; }
48 uint32_t owning_crtc() const { return owning_crtc_
; }
51 virtual bool InitializeProperties(
53 const ScopedDrmObjectPropertyPtr
& plane_props
);
55 uint32_t plane_id_
= 0;
56 uint32_t possible_crtcs_
= 0;
57 uint32_t owning_crtc_
= 0;
58 uint32_t last_used_format_
= 0;
60 Type type_
= kPrimary
;
61 std::vector
<uint32_t> supported_formats_
;
63 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayPlane
);
68 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_