From 3b89ca26c2f38fac1fd2c54f1eae006501b24681 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 15 Feb 2016 10:16:17 +0200 Subject: kmscube: fix atomic FB_ID set for crtc --- kmscube/kmscube.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'kmscube/kmscube.cpp') diff --git a/kmscube/kmscube.cpp b/kmscube/kmscube.cpp index d2125a6..b6031c2 100644 --- a/kmscube/kmscube.cpp +++ b/kmscube/kmscube.cpp @@ -445,6 +445,20 @@ public: ret = m_crtc->set_mode(m_connector, *fb, m_mode); FAIL_IF(ret, "failed to set mode"); + if (m_crtc->card().has_atomic()) { + Plane* root_plane = 0; + for (Plane* p : m_crtc->get_possible_planes()) { + if (p->crtc_id() == m_crtc->id()) { + root_plane = p; + break; + } + } + + FAIL_IF(!root_plane, "No primary plane for crtc %d", m_crtc->id()); + + m_root_plane = root_plane; + } + if (m_plane) { ret = m_crtc->set_plane(m_plane, *planefb, 0, 0, planefb->width(), planefb->height(), @@ -504,7 +518,7 @@ private: AtomicReq req(m_crtc->card()); - req.add(m_crtc, "FB_ID", fb->id()); + req.add(m_root_plane, "FB_ID", fb->id()); if (m_plane) req.add(m_plane, "FB_ID", planefb->id()); @@ -537,6 +551,7 @@ private: Crtc* m_crtc; Plane* m_plane; Videomode m_mode; + Plane* m_root_plane; unique_ptr m_surface; unique_ptr m_surface2; -- cgit v1.2.3