blob: e01bf604cab40e2b504c1b05e10fde6571ec810d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#include <xf86drm.h>
#include <xf86drmMode.h>
#include "kms++.h"
using namespace std;
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);
m_name = m_priv->drm_prop->name;
}
Property::~Property()
{
drmModeFreeProperty(m_priv->drm_prop);
delete m_priv;
}
void Property::print_short() const
{
printf("Property %d, %s\n", id(), name().c_str());
}
const string& Property::name() const
{
return m_name;
}
}
|