summaryrefslogtreecommitdiff
path: root/kms++
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-10-20 11:33:53 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-10-20 11:34:31 +0300
commitd556f70824727e4e0e4c8b04592b8f3a23733596 (patch)
tree4de49103e6f649735210ecd94fa71a90f92a9c65 /kms++
parent3da8bff960177bbbd2dc86849846e3b6ec97bc79 (diff)
Crtc: add set_mode() which doesn't take a fb
Diffstat (limited to 'kms++')
-rw-r--r--kms++/inc/kms++/crtc.h1
-rw-r--r--kms++/src/crtc.cpp22
2 files changed, 23 insertions, 0 deletions
diff --git a/kms++/inc/kms++/crtc.h b/kms++/inc/kms++/crtc.h
index c86fc88..ea20ef8 100644
--- a/kms++/inc/kms++/crtc.h
+++ b/kms++/inc/kms++/crtc.h
@@ -18,6 +18,7 @@ public:
const std::vector<Plane*>& get_possible_planes() const { return m_possible_planes; }
+ int set_mode(Connector* conn, const Videomode& mode);
int set_mode(Connector* conn, Framebuffer& fb, const Videomode& mode);
int set_plane(Plane *plane, Framebuffer &fb,
diff --git a/kms++/src/crtc.cpp b/kms++/src/crtc.cpp
index c391f69..f94216f 100644
--- a/kms++/src/crtc.cpp
+++ b/kms++/src/crtc.cpp
@@ -58,6 +58,28 @@ void Crtc::restore_mode(Connector* conn)
conns, 1, &c->mode);
}
+int Crtc::set_mode(Connector* conn, const Videomode& mode)
+{
+ AtomicReq req(card());
+
+ unique_ptr<Blob> blob = mode.to_blob(card());
+
+ req.add(conn, {
+ { "CRTC_ID", this->id() },
+ });
+
+ req.add(this, {
+ { "ACTIVE", 1 },
+ { "MODE_ID", blob->id() },
+ });
+
+ int r = req.commit_sync(true);
+
+ refresh();
+
+ return r;
+}
+
int Crtc::set_mode(Connector* conn, Framebuffer& fb, const Videomode& mode)
{
uint32_t conns[] = { conn->id() };