From 3afb00d3f86d3d924f88b56fa8285d4e9db85852 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 7 Aug 2024 15:17:52 +0200 Subject: Merging upstream version 6.10.3. Signed-off-by: Daniel Baumann --- arch/x86/video/Makefile | 3 ++- arch/x86/video/fbdev.c | 44 ------------------------------------------- arch/x86/video/video-common.c | 41 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 45 deletions(-) delete mode 100644 arch/x86/video/fbdev.c create mode 100644 arch/x86/video/video-common.c (limited to 'arch/x86/video') diff --git a/arch/x86/video/Makefile b/arch/x86/video/Makefile index 5ebe48752f..dcfbe7a591 100644 --- a/arch/x86/video/Makefile +++ b/arch/x86/video/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_FB_CORE) += fbdev.o + +obj-y += video-common.o diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/fbdev.c deleted file mode 100644 index 1dd6528cc9..0000000000 --- a/arch/x86/video/fbdev.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2007 Antonino Daplas - * - * 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 -#include -#include -#include -#include - -pgprot_t pgprot_framebuffer(pgprot_t prot, - unsigned long vm_start, unsigned long vm_end, - unsigned long offset) -{ - pgprot_val(prot) &= ~_PAGE_CACHE_MASK; - if (boot_cpu_data.x86 > 3) - pgprot_val(prot) |= cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS); - - return prot; -} -EXPORT_SYMBOL(pgprot_framebuffer); - -int fb_is_primary_device(struct fb_info *info) -{ - struct device *device = info->device; - struct pci_dev *pci_dev; - - if (!device || !dev_is_pci(device)) - return 0; - - pci_dev = to_pci_dev(device); - - if (pci_dev == vga_default_device()) - return 1; - return 0; -} -EXPORT_SYMBOL(fb_is_primary_device); - -MODULE_LICENSE("GPL"); diff --git a/arch/x86/video/video-common.c b/arch/x86/video/video-common.c new file mode 100644 index 0000000000..81fc97a2a8 --- /dev/null +++ b/arch/x86/video/video-common.c @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2007 Antonino Daplas + * + * 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 +#include +#include + +#include + +pgprot_t pgprot_framebuffer(pgprot_t prot, + unsigned long vm_start, unsigned long vm_end, + unsigned long offset) +{ + pgprot_val(prot) &= ~_PAGE_CACHE_MASK; + if (boot_cpu_data.x86 > 3) + pgprot_val(prot) |= cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS); + + return prot; +} +EXPORT_SYMBOL(pgprot_framebuffer); + +bool video_is_primary_device(struct device *dev) +{ + struct pci_dev *pdev; + + if (!dev_is_pci(dev)) + return false; + + pdev = to_pci_dev(dev); + + return (pdev == vga_default_device()); +} +EXPORT_SYMBOL(video_is_primary_device); + +MODULE_LICENSE("GPL"); -- cgit v1.2.3