index 23a1480de2903ac2a07dee4196e65d069079fdf4..f751147799ececcc50f6ee8bcdd587dab3143324 100644 (file)
Connector* ResourceManager::reserve_connector(Connector* conn)
{
+ if (!conn)
+ return nullptr;
+
if (contains(m_reserved_connectors, conn))
return nullptr;
Crtc* ResourceManager::reserve_crtc(Connector* conn)
{
+ if (!conn)
+ return nullptr;
+
if (Crtc* crtc = conn->get_current_crtc()) {
m_reserved_crtcs.push_back(crtc);
return crtc;
Plane* ResourceManager::reserve_plane(Crtc* crtc, PlaneType type, PixelFormat format)
{
+ if (!crtc)
+ return nullptr;
+
for (Plane* plane : crtc->get_possible_planes()) {
if (plane->plane_type() == type)
continue;
@@ -147,6 +156,9 @@ Plane* ResourceManager::reserve_plane(Crtc* crtc, PlaneType type, PixelFormat fo
Plane* ResourceManager::reserve_generic_plane(Crtc* crtc, PixelFormat format)
{
+ if (!crtc)
+ return nullptr;
+
for (Plane* plane : crtc->get_possible_planes()) {
if (plane->plane_type() == PlaneType::Cursor)
continue;