summaryrefslogtreecommitdiff
path: root/libkms++/crtc.h
blob: 48baf1bb6a8933b1a15049954208911313c0802d (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
40
41
42
43
44
45
46
47
48
49
#pragma once

#include <vector>

#include "drmobject.h"

namespace kms
{

struct CrtcPriv;

class Crtc : public DrmObject
{
	friend class Card;
	friend class Connector;
public:
	const std::vector<Plane*>& get_possible_planes() const { return m_possible_planes; }

	int set_mode(Connector* conn, Framebuffer& fb, const Videomode& mode);

	int set_plane(Plane *plane, Framebuffer &fb,
		      int32_t dst_x, int32_t dst_y, uint32_t dst_w, uint32_t dst_h,
		      float src_x, float src_y, float src_w, float src_h);

	int disable_plane(Plane* plane);

	int page_flip(Framebuffer& fb, void *data);
	int page_flip(Framebuffer& fb, PageFlipHandlerBase* data) { return page_flip(fb, (void*)data); }

	uint32_t buffer_id() const;
	uint32_t x() const;
	uint32_t y() const;
	uint32_t width() const;
	uint32_t height() const;
	int mode_valid() const;
	Videomode mode() const;
	int gamma_size() const;
private:
	Crtc(Card& card, uint32_t id, uint32_t idx);
	~Crtc();

	void setup();
	void restore_mode(Connector *conn);

	CrtcPriv* m_priv;

	std::vector<Plane*> m_possible_planes;
};
}