From mboxrd@z Thu Jan 1 00:00:00 1970 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 81F9428BAAB; Tue, 22 Jul 2025 14:38:22 +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=1753195102; cv=none; b=lo80X79Jx2r+HqCyFkzDTMIXH+TsBiFaPDXLP9Z+etGnNiSOcTvoA1hGbHB0DBtQEs/xPQxbAuvtrYvF/zNH3L/NWnzwWrGnGoMQxi6WrAkonirfvWrZauJFVEPvSwHtTt3+o0YxuDgpOsIDegT5l8miY174U0I/araipq12+Js= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753195102; c=relaxed/simple; bh=olKvJssCQ+xMT+WLhpu98KqvBUZv7VvUC2gcGKu9NrU=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=TczecfwlgoB3bUcVEQ7AZxfwITFXToNznxi7vbG1lRkdA5r7WuEaT2tK/diLVOzaxzn3EkJ5e8CYDgYBnRVDnljhHCKwZIvRNZFiYLAuJz8Yv/ycKUPMgY8itik1/3hZhfsvAZhhBZyrcEpEFP9yloAUjjE4/3Qwg8E+js6b4Yw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pnSdUe2v; 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="pnSdUe2v" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9018DC4CEEB; Tue, 22 Jul 2025 14:38:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753195102; bh=olKvJssCQ+xMT+WLhpu98KqvBUZv7VvUC2gcGKu9NrU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=pnSdUe2vQ84cN467eqKaYEZORO0ldOInWuIQWSIvlsXp1s2rv3UXpF53hb38nk7GP d8syRIWGle7KqN2m26+TgpxHfxHzmu8nRWzDr0OjArv5dLmBCXBsjTbw9Sd9NKY9tw f/m3VCyGuV1dRaMk6SzZRGEJugoBLOK+sh1ZeQIqfequLJn6hplDiflHhKlCeC38sr Qp8Mbu1+aen7Gwf45yX9lLMSOJkopMJor4Dpb9liiIMbhYaFYLlO6Rro9sjIP25gMI kxg1WWGdU1cWq0CsDtWdcrS6NMALjqbn06Ezz6E/MmdQhPy+vrYotuypLDYZjtGhWH 1V7RkEeUFkeRA== Date: Tue, 22 Jul 2025 09:38:17 -0500 From: Bjorn Helgaas To: Mario Limonciello Cc: David Airlie , Bjorn Helgaas , Alex Deucher , Christian =?utf-8?B?S8O2bmln?= , 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 , "open list:DRM DRIVERS" , open list , "open list:INTEL IOMMU (VT-d)" , "open list:PCI SUBSYSTEM" , "open list:VFIO DRIVER" , "open list:SOUND" , Daniel Dadap , Mario Limonciello Subject: Re: [PATCH v9 8/9] fbcon: Use screen info to find primary device Message-ID: <20250722143817.GA2783917@bhelgaas> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250717173812.3633478-9-superm1@kernel.org> On Thu, Jul 17, 2025 at 12:38:11PM -0500, Mario Limonciello wrote: > 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. This relies on screen_info, which I think is an x86 BIOS-ism. Isn't there a UEFI console path? How does that compare with this? Is that relevant or is it something completely different? > bool video_is_primary_device(struct device *dev) > { > +#ifdef CONFIG_SCREEN_INFO > + struct screen_info *si = &screen_info; > +#endif > struct pci_dev *pdev; > > if (!dev_is_pci(dev)) > @@ -34,7 +38,18 @@ bool video_is_primary_device(struct device *dev) > > pdev = to_pci_dev(dev); > > - return (pdev == vga_default_device()); > + if (!pci_is_display(pdev)) > + return false; > + > + if (pdev == vga_default_device()) > + return true; > + > +#ifdef CONFIG_SCREEN_INFO > + if (pdev == screen_info_pci_dev(si)) > + return true; > +#endif > + > + return false; > } > EXPORT_SYMBOL(video_is_primary_device); > > -- > 2.43.0 >