forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fbdev: detect primary display device
Add function helper, fb_is_primary_device(). Given struct fb_info, it will return a nonzero value if the device is the primary display. Currently, only the i386 is supported where the function checks for the IORESOURCE_ROM_SHADOW flag. Signed-off-by: Antonino Daplas <[email protected]> Cc: David Miller <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Showing
27 changed files
with
177 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
obj-$(CONFIG_FB) += fbdev.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* arch/i386/video/fbdev.c - i386 Framebuffer | ||
* | ||
* Copyright (C) 2007 Antonino Daplas <[email protected]> | ||
* | ||
* 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; | ||
struct pci_dev *pci_dev = NULL; | ||
struct resource *res = NULL; | ||
int retval = 0; | ||
|
||
device = info->device; | ||
|
||
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/device.h> | ||
|
||
/* Caching is off in the I/O space quadrant by design. */ | ||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/fb.h> | ||
|
||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/fb.h> | ||
|
||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/fb.h> | ||
|
||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/fb.h> | ||
|
||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/fb.h> | ||
|
||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/fb.h> | ||
|
||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/fb.h> | ||
|
||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/fb.h> | ||
|
||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#ifndef _ASM_FB_H_ | ||
#define _ASM_FB_H_ | ||
#include <linux/fb.h> | ||
|
||
#define fb_pgprotect(...) do {} while (0) | ||
|
||
static inline int fb_is_primary_device(struct fb_info *info) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* _ASM_FB_H_ */ |
Oops, something went wrong.