drm/vkms: Switch to dynamic allocation for CRTC
[drm/drm-misc.git] / arch / x86 / video / video-common.c
blob81fc97a2a837a50cbf1e5aae259d784a3174b98d
1 /*
2 * Copyright (C) 2007 Antonino Daplas <adaplas@gmail.com>
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.
8 */
10 #include <linux/module.h>
11 #include <linux/pci.h>
12 #include <linux/vgaarb.h>
14 #include <asm/video.h>
16 pgprot_t pgprot_framebuffer(pgprot_t prot,
17 unsigned long vm_start, unsigned long vm_end,
18 unsigned long offset)
20 pgprot_val(prot) &= ~_PAGE_CACHE_MASK;
21 if (boot_cpu_data.x86 > 3)
22 pgprot_val(prot) |= cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS);
24 return prot;
26 EXPORT_SYMBOL(pgprot_framebuffer);
28 bool video_is_primary_device(struct device *dev)
30 struct pci_dev *pdev;
32 if (!dev_is_pci(dev))
33 return false;
35 pdev = to_pci_dev(dev);
37 return (pdev == vga_default_device());
39 EXPORT_SYMBOL(video_is_primary_device);
41 MODULE_LICENSE("GPL");