Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/arch/x86/video/video-common.c
26424 views
1
/*
2
* Copyright (C) 2007 Antonino Daplas <[email protected]>
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
*/
9
10
#include <linux/module.h>
11
#include <linux/pci.h>
12
#include <linux/vgaarb.h>
13
14
#include <asm/video.h>
15
16
pgprot_t pgprot_framebuffer(pgprot_t prot,
17
unsigned long vm_start, unsigned long vm_end,
18
unsigned long offset)
19
{
20
pgprot_val(prot) &= ~_PAGE_CACHE_MASK;
21
if (boot_cpu_data.x86 > 3)
22
pgprot_val(prot) |= cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS);
23
24
return prot;
25
}
26
EXPORT_SYMBOL(pgprot_framebuffer);
27
28
bool video_is_primary_device(struct device *dev)
29
{
30
struct pci_dev *pdev;
31
32
if (!dev_is_pci(dev))
33
return false;
34
35
pdev = to_pci_dev(dev);
36
37
return (pdev == vga_default_device());
38
}
39
EXPORT_SYMBOL(video_is_primary_device);
40
41
MODULE_LICENSE("GPL");
42
43