summaryrefslogtreecommitdiff
path: root/libkms++/property.cpp
blob: af6a0aea52719bdb5873a59bbf4437284437fafb (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
#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;
}
}