diff --git a/quickboot-display/files/03-drm.rules b/quickboot-display/files/03-drm.rules index 64b2f1e..e40b17a 100644 --- a/quickboot-display/files/03-drm.rules +++ b/quickboot-display/files/03-drm.rules @@ -1,7 +1,20 @@ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. # SPDX-License-Identifier: BSD-3-Clause-Clear # -# Trigger Weston immediately when the primary DRM card is detected by the kernel. -# This eliminates delays waiting for generic multi-user targets. +# Trigger Weston immediately when the primary display controller's DRM card is +# detected by the kernel. This eliminates delays waiting for generic multi-user +# targets. +# +# Match on the msm_dpu display-controller driver (DRIVERS=="msm_dpu") rather than +# a fixed KERNEL=="card0". The cardN numbering is assigned in probe order and is +# not guaranteed to be the display controller when more than one DRM device is +# present (e.g. a discrete GPU or a DP/HDMI bridge exposing its own card). The +# msm_dpu driver name is stable and board-independent across the msm display +# stack. DEVTYPE=="drm_minor" + KERNEL=="card[0-9]*" restrict the match to the +# card node itself, excluding renderD* and card*- child nodes. +# +# SYSTEMD_ALIAS exposes this node as a stable device unit +# "dev-dri-msm_dpu_card.device" so weston.service can order itself against it +# (Requires=/After=) without hardcoding the unstable cardN name. -ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card0", TAG+="systemd", ENV{SYSTEMD_READY}="1", ENV{SYSTEMD_WANTS}="weston.service" +ACTION=="add", SUBSYSTEM=="drm", ENV{DEVTYPE}=="drm_minor", DRIVERS=="msm_dpu", KERNEL=="card[0-9]*", ENV{SYSTEMD_ALIAS}="/dev/dri/msm_dpu_card", TAG+="systemd", ENV{SYSTEMD_READY}="1", ENV{SYSTEMD_WANTS}="weston.service" diff --git a/quickboot-display/files/weston.service b/quickboot-display/files/weston.service index abc6318..44a360e 100644 --- a/quickboot-display/files/weston.service +++ b/quickboot-display/files/weston.service @@ -14,9 +14,12 @@ # Remove default dependenies (sysinit.target, basic.target) to enable early start DefaultDependencies=no -# Start as soon as display card appear -Requires=dev-dri-card0.device -After=dev-dri-card0.device +# Start as soon as the display card appears. Order against the stable device-unit +# alias published by 03-drm.rules (SYSTEMD_ALIAS=/dev/dri/msm_dpu_card) instead of +# a hardcoded dev-dri-card0.device -- dev-dri-msm_dpu_card.device tracks the +# msm_dpu display controller regardless of its cardN enumeration. +Requires=dev-dri-msm_dpu_card.device +After=dev-dri-msm_dpu_card.device # Since we are part of the graphical session, make sure we are started before # it is complete.