diff options
author | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-09-28 01:13:34 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-09-28 01:13:34 +0300 |
commit | 009828beac9bfe9c36d336a4de0d297f90aece52 (patch) | |
tree | 3ea6b22f2036dcc0c23c459ce53bfc2ad282e3e7 /libkms++/property.cpp |
Initial version
Diffstat (limited to 'libkms++/property.cpp')
-rw-r--r-- | libkms++/property.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libkms++/property.cpp b/libkms++/property.cpp new file mode 100644 index 0000000..af6a0ae --- /dev/null +++ b/libkms++/property.cpp @@ -0,0 +1,36 @@ +#include <xf86drm.h> +#include <xf86drmMode.h> + +#include "kms++.h" + +namespace kms +{ + +struct PropertyPriv +{ + drmModePropertyPtr drm_prop; +}; + +Property::Property(Card& card, uint32_t id) + : DrmObject(card, id, DRM_MODE_OBJECT_PROPERTY) +{ + m_priv = new PropertyPriv(); + m_priv->drm_prop = drmModeGetProperty(card.fd(), id); +} + +Property::~Property() +{ + drmModeFreeProperty(m_priv->drm_prop); + delete m_priv; +} + +void Property::print_short() const +{ + printf("Property %d, %s\n", id(), name()); +} + +const char *Property::name() const +{ + return m_priv->drm_prop->name; +} +} |