mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-19 18:24:14 +08:00
623e71b035
Allow fbcon to select the primary display adapter using the fb_is_primary_device() arch-specific helper. If a a primary adapter is detected, fbcon will unbind the old adapter from the VT layer, then rebind using the new adapter. This requires that bind_/unbind_con_driver() be made public. Because this feature may produce unexpected behavior (from the user's POV), this must be explicitly enabled in Kconfig. [akpm@linux-foundation.org: export unbind_con_driver] Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
33 lines
731 B
C
33 lines
731 B
C
/*
|
|
* arch/i386/video/fbdev.c - i386 Framebuffer
|
|
*
|
|
* Copyright (C) 2007 Antonino Daplas <adaplas@gmail.com>
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
* License. See the file COPYING in the main directory of this archive
|
|
* for more details.
|
|
*
|
|
*/
|
|
#include <linux/fb.h>
|
|
#include <linux/pci.h>
|
|
|
|
int fb_is_primary_device(struct fb_info *info)
|
|
{
|
|
struct device *device = info->device;
|
|
struct pci_dev *pci_dev = NULL;
|
|
struct resource *res = NULL;
|
|
int retval = 0;
|
|
|
|
if (device)
|
|
pci_dev = to_pci_dev(device);
|
|
|
|
if (pci_dev)
|
|
res = &pci_dev->resource[PCI_ROM_RESOURCE];
|
|
|
|
if (res && res->flags & IORESOURCE_ROM_SHADOW)
|
|
retval = 1;
|
|
|
|
return retval;
|
|
}
|
|
EXPORT_SYMBOL(fb_is_primary_device);
|