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.
15 #include <string_view>
18 #include <xf86drmMode.h>
30 CDRMObject(const CDRMObject
&) = delete;
31 CDRMObject
& operator=(const CDRMObject
&) = delete;
32 virtual ~CDRMObject() = default;
34 std::string
GetTypeName() const;
35 std::string
GetPropertyName(uint32_t propertyId
) const;
37 uint32_t GetId() const { return m_id
; }
38 uint32_t GetPropertyId(const std::string
& name
) const;
39 std::optional
<uint64_t> GetPropertyValue(std::string_view name
, std::string_view valueName
) const;
41 bool SetProperty(const std::string
& name
, uint64_t value
);
42 bool SupportsProperty(const std::string
& name
);
45 explicit CDRMObject(int fd
);
47 bool GetProperties(uint32_t id
, uint32_t type
);
49 struct DrmModeObjectPropertiesDeleter
51 void operator()(drmModeObjectProperties
* p
) { drmModeFreeObjectProperties(p
); }
54 std::unique_ptr
<drmModeObjectProperties
, DrmModeObjectPropertiesDeleter
> m_props
;
56 struct DrmModePropertyResDeleter
58 void operator()(drmModePropertyRes
* p
) { drmModeFreeProperty(p
); }
61 std::vector
<std::unique_ptr
<drmModePropertyRes
, DrmModePropertyResDeleter
>> m_propsInfo
;
71 } // namespace WINDOWING