From nobody Wed Oct 8 21:35:06 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F1D72E9ECC; Tue, 24 Jun 2025 20:31:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750797068; cv=none; b=ewyJK6qmtVSKaoxHdyBYvdEswqdjrCaIVoPTR13Izh3oSgvXZUxvnkygcJjkrfihNDvARuWUG0fQ193WeiJbIjERAK0m31IF/nBZqulZZ0SNX/XdegwyyuGQGBpXCtV7q5EE/qqtBBh8xc/Mnq4peNlaNd3CSOg6VupvlTI04/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750797068; c=relaxed/simple; bh=29HKhswcd8px+N2nYcp6Yih2LctL4W2GlFxn1lIVTTA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uzZyyxpsYiCzkMFy8f3FrXnQibT25AyQE7wbAL2Nm2DrXVep6GTYMR7LtcbvfQXB4nHeL/IUDenJRTBcOg1+jwXiQYgXjGpuOsrXL/MO/2+P/GgZtbqh71inKCRzhNH4JrlMPxwQ4WquBtteDljlav1w3GP25ODMBnAShlp+PD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X4z7Bh7U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X4z7Bh7U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E5D8C4CEF2; Tue, 24 Jun 2025 20:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750797068; bh=29HKhswcd8px+N2nYcp6Yih2LctL4W2GlFxn1lIVTTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X4z7Bh7UvZuyb79HPoHsaTmjP2tjyVF/oofZKnyi+WWMKgjEJftheG78LSVDzRhpK g3+CJNB4mcxzM4L73y9jBQDr+Nq3HSjYQOdJ9ZbsK1k7D1n+lthvZH7h7IHjB4H8fu K1u8zY2Mob/hLE8qS1CN2nXL+oqrzWNGyr94wVHR2MR36toGK5xQPqY5AcKi9toDrD tStNIA5gYSTpGgqO/ouL+mlv8Nz4Xbhbkg940WnFLSp7YBw+Txbdv6LNF07GTktPhJ eHFI6Iu2Xih50DzjD1d4l0g971ZVfsChmJIIcBg8RxtRB8eOWodd8YW+BwDTvKiknw QZtndpO/aLrPA== From: Mario Limonciello To: Bjorn Helgaas Cc: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter , Lukas Wunner , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Woodhouse , Lu Baolu , Joerg Roedel , Will Deacon , Robin Murphy , Alex Williamson , Jaroslav Kysela , Takashi Iwai , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS), linux-kernel@vger.kernel.org (open list), iommu@lists.linux.dev (open list:INTEL IOMMU (VT-d)), linux-pci@vger.kernel.org (open list:PCI SUBSYSTEM), kvm@vger.kernel.org (open list:VFIO DRIVER), linux-sound@vger.kernel.org (open list:SOUND), Daniel Dadap , Mario Limonciello Subject: [PATCH v5 8/9] fbcon: Use screen info to find primary device Date: Tue, 24 Jun 2025 15:30:41 -0500 Message-ID: <20250624203042.1102346-9-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250624203042.1102346-1-superm1@kernel.org> References: <20250624203042.1102346-1-superm1@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mario Limonciello On systems with non VGA GPUs fbcon can't find the primary GPU because video_is_primary_device() only checks the VGA arbiter. Add a screen info check to video_is_primary_device() so that callers can get accurate data on such systems. Suggested-by: Thomas Zimmermann Signed-off-by: Mario Limonciello --- v5: * Only change video-common.c v4: * use helper --- arch/x86/video/video-common.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/x86/video/video-common.c b/arch/x86/video/video-common.c index 81fc97a2a837a..917568e4d7fb1 100644 --- a/arch/x86/video/video-common.c +++ b/arch/x86/video/video-common.c @@ -9,6 +9,7 @@ =20 #include #include +#include #include =20 #include @@ -27,6 +28,7 @@ EXPORT_SYMBOL(pgprot_framebuffer); =20 bool video_is_primary_device(struct device *dev) { + struct screen_info *si =3D &screen_info; struct pci_dev *pdev; =20 if (!dev_is_pci(dev)) @@ -34,7 +36,16 @@ bool video_is_primary_device(struct device *dev) =20 pdev =3D to_pci_dev(dev); =20 - return (pdev =3D=3D vga_default_device()); + if (!pci_is_display(pdev)) + return false; + + if (pdev =3D=3D vga_default_device()) + return true; + + if (pdev =3D=3D screen_info_pci_dev(si)) + return true; + + return false; } EXPORT_SYMBOL(video_is_primary_device); =20 --=20 2.43.0