From 710cfdaae91e3be56d328d784e98495c345faeb4 Mon Sep 17 00:00:00 2001 From: Brendan Szymanski Date: Sun, 12 Jul 2026 14:31:15 -0400 Subject: [PATCH] Drop DRM master after opening card node so the composer can master it Change-Id: I6e40ed8fbfec788bc8f5382338d573057f230f79 --- cros_gralloc/cros_gralloc_driver.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cros_gralloc/cros_gralloc_driver.cc b/cros_gralloc/cros_gralloc_driver.cc index b17c8c7..b88dad6 100644 --- a/cros_gralloc/cros_gralloc_driver.cc +++ b/cros_gralloc/cros_gralloc_driver.cc @@ -144,8 +144,19 @@ static struct driver *init_try_nodes() // Try card nodes... for vkms mostly. for (uint32_t i = min_card_node; i < max_card_node; i++) { drv = init_try_node(i, card_nodes_fmt); - if (drv) + if (drv) { + /* + * Opening a primary (card) node makes this process the DRM + * master as the first opener. minigbm only performs dumb-buffer + * allocation here, which does not require master, so drop it so + * the KMS composer (drm_hwcomposer) can acquire master and drive + * the display. Without this, whichever of the gralloc allocator + * and the composer opens the card node first wins master and the + * loser falls back to a headless null-display (black screen). + */ + drmDropMaster(drv_get_fd(drv)); return drv; + } } return nullptr;