summaryrefslogtreecommitdiff
path: root/kms++/inc/kms++/atomicreq.h
blob: 780cc8f84c5e7dd11b33bec3e918a1222ed93ce1 (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
#pragma once

#include <cstdint>
#include <string>
#include <map>

struct _drmModeAtomicReq;

#include "decls.h"

namespace kms
{
class AtomicReq
{
public:
	AtomicReq(Card& card);
	~AtomicReq();

	AtomicReq(const AtomicReq& other) = delete;
	AtomicReq& operator=(const AtomicReq& other) = delete;

	void add(uint32_t ob_id, uint32_t prop_id, uint64_t value);
	void add(DrmPropObject* ob, Property* prop, uint64_t value);
	void add(DrmPropObject* ob, const std::string& prop, uint64_t value);
	void add(DrmPropObject* ob, const std::map<std::string, uint64_t>& values);

	void add_display(Connector* conn, Crtc* crtc, Blob* videomode,
			 Plane* primary, Framebuffer* fb);

	int test(bool allow_modeset = false);
	int commit(void* data, bool allow_modeset = false);
	int commit_sync(bool allow_modeset = false);

private:
	Card& m_card;
	_drmModeAtomicReq* m_req;
};

} // namespace kms