diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-03-21 15:04:24 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-03-21 15:04:24 +0200 |
commit | 2439ae8738ad9410441c6160f512ab64ec94333d (patch) | |
tree | fbb274db500a09fa0191f260b04659b85350154a /kms++util/src | |
parent | 9aeb121657a076a0c03ac6e7fc3c1e93e465e5d9 (diff) | |
parent | dce8d396848c509d77b7fe8f745ea29e74af9c0c (diff) |
Merge branch 'universal-planes2' of git://github.com/jsarha/kmsxx
Diffstat (limited to 'kms++util/src')
-rw-r--r-- | kms++util/src/resourcemanager.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/kms++util/src/resourcemanager.cpp b/kms++util/src/resourcemanager.cpp index 5c83ad7..23a1480 100644 --- a/kms++util/src/resourcemanager.cpp +++ b/kms++util/src/resourcemanager.cpp @@ -129,7 +129,26 @@ Crtc* ResourceManager::reserve_crtc(Connector* conn) Plane* ResourceManager::reserve_plane(Crtc* crtc, PlaneType type, PixelFormat format) { for (Plane* plane : crtc->get_possible_planes()) { - if (plane->plane_type() != type) + if (plane->plane_type() == type) + continue; + + if (format != PixelFormat::Undefined && !plane->supports_format(format)) + continue; + + if (contains(m_reserved_planes, plane)) + continue; + + m_reserved_planes.push_back(plane); + return plane; + } + + return nullptr; +} + +Plane* ResourceManager::reserve_generic_plane(Crtc* crtc, PixelFormat format) +{ + for (Plane* plane : crtc->get_possible_planes()) { + if (plane->plane_type() == PlaneType::Cursor) continue; if (format != PixelFormat::Undefined && !plane->supports_format(format)) |