summaryrefslogtreecommitdiff
path: root/kms++/crtc.h
diff options
context:
space:
mode:
Diffstat (limited to 'kms++/crtc.h')
-rw-r--r--kms++/crtc.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/kms++/crtc.h b/kms++/crtc.h
new file mode 100644
index 0000000..f3b525a
--- /dev/null
+++ b/kms++/crtc.h
@@ -0,0 +1,50 @@
+#pragma once
+
+#include <vector>
+
+#include "drmpropobject.h"
+
+namespace kms
+{
+
+struct CrtcPriv;
+
+class Crtc : public DrmPropObject
+{
+ 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);
+
+ Plane* get_primary_plane();
+
+ int page_flip(Framebuffer& 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;
+};
+}