1 #include <xf86drm.h>
2 #include <xf86drmMode.h>
4 #include "kms++.h"
6 using namespace std;
8 namespace kms
9 {
11 struct PropertyPriv
12 {
13 drmModePropertyPtr drm_prop;
14 };
16 Property::Property(Card& card, uint32_t id)
17 : DrmObject(card, id, DRM_MODE_OBJECT_PROPERTY)
18 {
19 m_priv = new PropertyPriv();
20 m_priv->drm_prop = drmModeGetProperty(card.fd(), id);
21 m_name = m_priv->drm_prop->name;
22 }
24 Property::~Property()
25 {
26 drmModeFreeProperty(m_priv->drm_prop);
27 delete m_priv;
28 }
30 void Property::print_short() const
31 {
32 printf("Property %d, %s\n", id(), name().c_str());
33 }
35 const string& Property::name() const
36 {
37 return m_name;
38 }
39 }