From d556f70824727e4e0e4c8b04592b8f3a23733596 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 20 Oct 2017 11:33:53 +0300 Subject: Crtc: add set_mode() which doesn't take a fb --- kms++/src/crtc.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'kms++/src') 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 = 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() }; -- cgit v1.2.3