2 * Copyright (C) 2005-2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "DRMObject.h"
15 #include <drm_fourcc.h>
24 class CDRMPlane
: public CDRMObject
27 explicit CDRMPlane(int fd
, uint32_t plane
);
28 CDRMPlane(const CDRMPlane
&) = delete;
29 CDRMPlane
& operator=(const CDRMPlane
&) = delete;
30 ~CDRMPlane() = default;
32 uint32_t GetPlaneId() const { return m_plane
->plane_id
; }
33 uint32_t GetPossibleCrtcs() const { return m_plane
->possible_crtcs
; }
37 void SetFormat(const uint32_t newFormat
) { m_format
= newFormat
; }
38 uint32_t GetFormat() const { return m_format
; }
39 std::vector
<uint64_t>& GetModifiersForFormat(uint32_t format
) { return m_modifiers_map
[format
]; }
41 bool SupportsFormat(uint32_t format
);
42 bool SupportsFormatAndModifier(uint32_t format
, uint64_t modifier
);
45 struct DrmModePlaneDeleter
47 void operator()(drmModePlane
* p
) { drmModeFreePlane(p
); }
50 std::unique_ptr
<drmModePlane
, DrmModePlaneDeleter
> m_plane
;
52 std::map
<uint32_t, std::vector
<uint64_t>> m_modifiers_map
;
53 uint32_t m_format
{DRM_FORMAT_XRGB8888
};
57 } // namespace WINDOWING