summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-02-15 10:16:17 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-02-15 14:15:35 +0200
commit3b89ca26c2f38fac1fd2c54f1eae006501b24681 (patch)
treeceea5a2ca3b5657f0e1c0923637a314e0dd7d959
parent142a89e4f1a7cef23c2c542f6ec167622b5b5942 (diff)
kmscube: fix atomic FB_ID set for crtc
-rw-r--r--kmscube/kmscube.cpp17
1 files changed, 16 insertions, 1 deletions
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<Surface> m_surface;
unique_ptr<Surface> m_surface2;