From nobody Tue Oct 7 22:43:14 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 6AA57230BC9; Sun, 6 Jul 2025 14:36:44 +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=1751812604; cv=none; b=BKZHCPPCI7Uq6oNExfPQyCHxympLlEmiCSDXGTLjp6AsqjYnSCpOAxEHBzw7YfWJIbQIWXs2YGqy5OLvZbW3/mEJXaVnCwY5RD/jAzcv4/f3QLB1Pd5JqoXXSRiqlY/AukbxTHyu0joghkB18oZbU4fghys4/OFlJS/RNW/8H34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751812604; c=relaxed/simple; bh=qucJBD1l7cekJwkkW3sSPDQAFelB6SpfdgNHX+7KrGs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e0cxjz0iGzgAdWREOEspNTpjzombqbu1+vDoVBdyY6twTkwV2fYuhPP1CfP4qkzLf24Tn0xOlFxHRio2530q4rkYop/PNOPf2kBgr7D6Z7BS7OzaHVBXXqcdznmhAnCZYRy0RxrqeN84zhz6FN2OsbrYGIm/MqWA7vtUOHOT7s8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PpbWlYDR; 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="PpbWlYDR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 341F7C4CEEF; Sun, 6 Jul 2025 14:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751812604; bh=qucJBD1l7cekJwkkW3sSPDQAFelB6SpfdgNHX+7KrGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PpbWlYDRkCuGunmFT9sTtHbxSwd/gVVaMktE59Av5bQNJlpIpRWWnBMwON8LQkbBW 6gXenJkP+sbVWehgc9Qa4LZngn4VzayvaKyP4D/gf5ASSXZlb5Nr869RaVew8OnB/6 kE61VerYy9vnazyRtGJxRv8MDOupgCzJ6JB3k+P2jlvgUjPkMUX7fXh4EBt5sp4/pE O9W0Z/s5Q9iKMr63iqMxPUUSFuSKz5F64qsgf9NdYhX1RBfEbnOplk9TaDJlRXdfRx zuNEX/u0VqDtrmTAtzX598+shxngHQGeh+kFXhAikczUIzAiLs53PC4Fj2CNbZC1nW i0MO8mX+JbXqg== From: Mario Limonciello To: David Airlie , Bjorn Helgaas Cc: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , 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 v7 8/9] fbcon: Use screen info to find primary device Date: Sun, 6 Jul 2025 09:36:12 -0500 Message-ID: <20250706143613.1972252-9-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250706143613.1972252-1-superm1@kernel.org> References: <20250706143613.1972252-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. Reviewed-by: Thomas Zimmermann 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