aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fb.h')
-rw-r--r--include/linux/fb.h51
1 files changed, 42 insertions, 9 deletions
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 369767bd873e..f0268deca658 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -3,8 +3,9 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/i2c.h> 5#include <linux/i2c.h>
6 6#ifdef __KERNEL__
7struct dentry; 7#include <linux/kgdb.h>
8#endif /* __KERNEL__ */
8 9
9/* Definitions of frame buffers */ 10/* Definitions of frame buffers */
10 11
@@ -37,7 +38,7 @@ struct dentry;
37#define FBIOGET_HWCINFO 0x4616 38#define FBIOGET_HWCINFO 0x4616
38#define FBIOPUT_MODEINFO 0x4617 39#define FBIOPUT_MODEINFO 0x4617
39#define FBIOGET_DISPINFO 0x4618 40#define FBIOGET_DISPINFO 0x4618
40 41#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
41 42
42#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ 43#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
43#define FB_TYPE_PLANES 1 /* Non interleaved planes */ 44#define FB_TYPE_PLANES 1 /* Non interleaved planes */
@@ -403,6 +404,7 @@ struct fb_cursor {
403#include <linux/notifier.h> 404#include <linux/notifier.h>
404#include <linux/list.h> 405#include <linux/list.h>
405#include <linux/backlight.h> 406#include <linux/backlight.h>
407#include <linux/slab.h>
406#include <asm/io.h> 408#include <asm/io.h>
407 409
408struct vm_area_struct; 410struct vm_area_struct;
@@ -543,6 +545,8 @@ struct fb_cursor_user {
543#define FB_EVENT_GET_REQ 0x0D 545#define FB_EVENT_GET_REQ 0x0D
544/* Unbind from the console if possible */ 546/* Unbind from the console if possible */
545#define FB_EVENT_FB_UNBIND 0x0E 547#define FB_EVENT_FB_UNBIND 0x0E
548/* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga switcheroo */
549#define FB_EVENT_REMAP_ALL_CONSOLE 0x0F
546 550
547struct fb_event { 551struct fb_event {
548 struct fb_info *info; 552 struct fb_info *info;
@@ -606,6 +610,12 @@ struct fb_deferred_io {
606 * LOCKING NOTE: those functions must _ALL_ be called with the console 610 * LOCKING NOTE: those functions must _ALL_ be called with the console
607 * semaphore held, this is the only suitable locking mechanism we have 611 * semaphore held, this is the only suitable locking mechanism we have
608 * in 2.6. Some may be called at interrupt time at this point though. 612 * in 2.6. Some may be called at interrupt time at this point though.
613 *
614 * The exception to this is the debug related hooks. Putting the fb
615 * into a debug state (e.g. flipping to the kernel console) and restoring
616 * it must be done in a lock-free manner, so low level drivers should
617 * keep track of the initial console (if applicable) and may need to
618 * perform direct, unlocked hardware writes in these hooks.
609 */ 619 */
610 620
611struct fb_ops { 621struct fb_ops {
@@ -675,6 +685,10 @@ struct fb_ops {
675 685
676 /* teardown any resources to do with this framebuffer */ 686 /* teardown any resources to do with this framebuffer */
677 void (*fb_destroy)(struct fb_info *info); 687 void (*fb_destroy)(struct fb_info *info);
688
689 /* called at KDB enter and leave time to prepare the console */
690 int (*fb_debug_enter)(struct fb_info *info);
691 int (*fb_debug_leave)(struct fb_info *info);
678}; 692};
679 693
680#ifdef CONFIG_FB_TILEBLITTING 694#ifdef CONFIG_FB_TILEBLITTING
@@ -785,8 +799,6 @@ struct fb_tile_ops {
785#define FBINFO_MISC_USEREVENT 0x10000 /* event request 799#define FBINFO_MISC_USEREVENT 0x10000 /* event request
786 from userspace */ 800 from userspace */
787#define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */ 801#define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */
788#define FBINFO_MISC_FIRMWARE 0x40000 /* a replaceable firmware
789 inited framebuffer */
790 802
791/* A driver may set this flag to indicate that it does want a set_par to be 803/* A driver may set this flag to indicate that it does want a set_par to be
792 * called every time when fbcon_switch is executed. The advantage is that with 804 * called every time when fbcon_switch is executed. The advantage is that with
@@ -800,6 +812,8 @@ struct fb_tile_ops {
800 */ 812 */
801#define FBINFO_MISC_ALWAYS_SETPAR 0x40000 813#define FBINFO_MISC_ALWAYS_SETPAR 0x40000
802 814
815/* where the fb is a firmware driver, and can be replaced with a proper one */
816#define FBINFO_MISC_FIRMWARE 0x80000
803/* 817/*
804 * Host and GPU endianness differ. 818 * Host and GPU endianness differ.
805 */ 819 */
@@ -811,6 +825,10 @@ struct fb_tile_ops {
811 */ 825 */
812#define FBINFO_BE_MATH 0x100000 826#define FBINFO_BE_MATH 0x100000
813 827
828/* report to the VT layer that this fb driver can accept forced console
829 output like oopses */
830#define FBINFO_CAN_FORCE_OUTPUT 0x200000
831
814struct fb_info { 832struct fb_info {
815 int node; 833 int node;
816 int flags; 834 int flags;
@@ -860,10 +878,24 @@ struct fb_info {
860 /* we need the PCI or similiar aperture base/size not 878 /* we need the PCI or similiar aperture base/size not
861 smem_start/size as smem_start may just be an object 879 smem_start/size as smem_start may just be an object
862 allocated inside the aperture so may not actually overlap */ 880 allocated inside the aperture so may not actually overlap */
863 resource_size_t aperture_base; 881 struct apertures_struct {
864 resource_size_t aperture_size; 882 unsigned int count;
883 struct aperture {
884 resource_size_t base;
885 resource_size_t size;
886 } ranges[0];
887 } *apertures;
865}; 888};
866 889
890static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
891 struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct)
892 + max_num * sizeof(struct aperture), GFP_KERNEL);
893 if (!a)
894 return NULL;
895 a->count = max_num;
896 return a;
897}
898
867#ifdef MODULE 899#ifdef MODULE
868#define FBINFO_DEFAULT FBINFO_MODULE 900#define FBINFO_DEFAULT FBINFO_MODULE
869#else 901#else
@@ -956,6 +988,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
956/* drivers/video/fbmem.c */ 988/* drivers/video/fbmem.c */
957extern int register_framebuffer(struct fb_info *fb_info); 989extern int register_framebuffer(struct fb_info *fb_info);
958extern int unregister_framebuffer(struct fb_info *fb_info); 990extern int unregister_framebuffer(struct fb_info *fb_info);
991extern void remove_conflicting_framebuffers(struct apertures_struct *a,
992 const char *name, bool primary);
959extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); 993extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
960extern int fb_show_logo(struct fb_info *fb_info, int rotate); 994extern int fb_show_logo(struct fb_info *fb_info, int rotate);
961extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); 995extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
@@ -1000,8 +1034,7 @@ extern void fb_deferred_io_open(struct fb_info *info,
1000 struct inode *inode, 1034 struct inode *inode,
1001 struct file *file); 1035 struct file *file);
1002extern void fb_deferred_io_cleanup(struct fb_info *info); 1036extern void fb_deferred_io_cleanup(struct fb_info *info);
1003extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, 1037extern int fb_deferred_io_fsync(struct file *file, int datasync);
1004 int datasync);
1005 1038
1006static inline bool fb_be_math(struct fb_info *info) 1039static inline bool fb_be_math(struct fb_info *info)
1007{ 1040{