Commit | Line | Data |
---|---|---|
317b3c21 | 1 | /* |
317b3c21 AD |
2 | * Copyright (C) 2007 Antonino Daplas <adaplas@gmail.com> |
3 | * | |
4 | * This file is subject to the terms and conditions of the GNU General Public | |
5 | * License. See the file COPYING in the main directory of this archive | |
6 | * for more details. | |
7 | * | |
8 | */ | |
94545f27 | 9 | |
7c52d551 | 10 | #include <linux/module.h> |
94545f27 | 11 | #include <linux/pci.h> |
88674088 | 12 | #include <linux/vgaarb.h> |
2fd001cd TZ |
13 | |
14 | #include <asm/video.h> | |
317b3c21 | 15 | |
052ddf7b TZ |
16 | pgprot_t pgprot_framebuffer(pgprot_t prot, |
17 | unsigned long vm_start, unsigned long vm_end, | |
18 | unsigned long offset) | |
94545f27 | 19 | { |
052ddf7b | 20 | pgprot_val(prot) &= ~_PAGE_CACHE_MASK; |
94545f27 | 21 | if (boot_cpu_data.x86 > 3) |
052ddf7b TZ |
22 | pgprot_val(prot) |= cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS); |
23 | ||
24 | return prot; | |
94545f27 | 25 | } |
052ddf7b | 26 | EXPORT_SYMBOL(pgprot_framebuffer); |
94545f27 | 27 | |
f178e96d | 28 | bool video_is_primary_device(struct device *dev) |
317b3c21 | 29 | { |
f178e96d | 30 | struct pci_dev *pdev; |
317b3c21 | 31 | |
f178e96d TZ |
32 | if (!dev_is_pci(dev)) |
33 | return false; | |
88674088 | 34 | |
f178e96d | 35 | pdev = to_pci_dev(dev); |
743146db | 36 | |
f178e96d | 37 | return (pdev == vga_default_device()); |
317b3c21 | 38 | } |
f178e96d | 39 | EXPORT_SYMBOL(video_is_primary_device); |
94545f27 | 40 | |
7b04fa01 | 41 | MODULE_LICENSE("GPL"); |