亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? offb.c

?? linux下的VIDEO接口驅動程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* *  linux/drivers/video/offb.c -- Open Firmware based frame buffer device * *	Copyright (C) 1997 Geert Uytterhoeven * *  This driver is partly based on the PowerMac console driver: * *	Copyright (C) 1996 Paul Mackerras * *  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/config.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/errno.h>#include <linux/string.h>#include <linux/mm.h>#include <linux/tty.h>#include <linux/slab.h>#include <linux/vmalloc.h>#include <linux/delay.h>#include <linux/interrupt.h>#include <linux/fb.h>#include <linux/selection.h>#include <linux/init.h>#include <linux/ioport.h>#ifdef CONFIG_FB_COMPAT_XPMAC#include <asm/vc_ioctl.h>#endif#include <asm/io.h>#include <asm/prom.h>#ifdef CONFIG_BOOTX_TEXT#include <asm/bootx.h>#endif#include <video/fbcon.h>#include <video/fbcon-cfb8.h>#include <video/fbcon-cfb16.h>#include <video/fbcon-cfb32.h>#include <video/macmodes.h>static int currcon = 0;/* Supported palette hacks */enum {	cmap_unknown,	cmap_m64,	/* ATI Mach64 */	cmap_r128,	/* ATI Rage128 */	cmap_M3A,	/* ATI Rage Mobility M3 Head A */	cmap_M3B,	/* ATI Rage Mobility M3 Head B */	cmap_radeon,	/* ATI Radeon */	cmap_gxt2000	/* IBM GXT2000 */};struct fb_info_offb {    struct fb_info info;    struct fb_fix_screeninfo fix;    struct fb_var_screeninfo var;    struct display disp;    struct { u_char red, green, blue, pad; } palette[256];    volatile unsigned char *cmap_adr;    volatile unsigned char *cmap_data;    int cmap_type;    int blanked;    union {#ifdef FBCON_HAS_CFB16	u16 cfb16[16];#endif#ifdef FBCON_HAS_CFB32	u32 cfb32[16];#endif    } fbcon_cmap;};#ifdef __powerpc__#define mach_eieio()	eieio()#else#define mach_eieio()	do {} while (0)#endif    /*     *  Interface used by the world     */int offb_init(void);static int offb_get_fix(struct fb_fix_screeninfo *fix, int con,			struct fb_info *info);static int offb_get_var(struct fb_var_screeninfo *var, int con,			struct fb_info *info);static int offb_set_var(struct fb_var_screeninfo *var, int con,			struct fb_info *info);static int offb_get_cmap(struct fb_cmap *cmap, int kspc, int con,			struct fb_info *info);static int offb_set_cmap(struct fb_cmap *cmap, int kspc, int con,			struct fb_info *info);#ifdef CONFIG_BOOTX_TEXTextern boot_infos_t *boot_infos;#endifstatic void offb_init_nodriver(struct device_node *);static void offb_init_fb(const char *name, const char *full_name, int width,		      int height, int depth, int pitch, unsigned long address,		      struct device_node *dp);    /*     *  Interface to the low level console driver     */static int offbcon_switch(int con, struct fb_info *info);static int offbcon_updatevar(int con, struct fb_info *info);static void offbcon_blank(int blank, struct fb_info *info);    /*     *  Internal routines     */static int offb_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue,			 u_int *transp, struct fb_info *info);static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,			 u_int transp, struct fb_info *info);static void do_install_cmap(int con, struct fb_info *info);static struct fb_ops offb_ops = {	owner:		THIS_MODULE,	fb_get_fix:	offb_get_fix,	fb_get_var:	offb_get_var,	fb_set_var:	offb_set_var,	fb_get_cmap:	offb_get_cmap,	fb_set_cmap:	offb_set_cmap,};    /*     *  Get the Fixed Part of the Display     */static int offb_get_fix(struct fb_fix_screeninfo *fix, int con,			struct fb_info *info){    struct fb_info_offb *info2 = (struct fb_info_offb *)info;    memcpy(fix, &info2->fix, sizeof(struct fb_fix_screeninfo));    return 0;}    /*     *  Get the User Defined Part of the Display     */static int offb_get_var(struct fb_var_screeninfo *var, int con,			struct fb_info *info){    struct fb_info_offb *info2 = (struct fb_info_offb *)info;    memcpy(var, &info2->var, sizeof(struct fb_var_screeninfo));    return 0;}    /*     *  Set the User Defined Part of the Display     */static int offb_set_var(struct fb_var_screeninfo *var, int con,			struct fb_info *info){    struct display *display;    unsigned int oldbpp = 0;    int err;    int activate = var->activate;    struct fb_info_offb *info2 = (struct fb_info_offb *)info;    if (con >= 0)	display = &fb_display[con];    else	display = &info2->disp;	/* used during initialization */    if (var->xres > info2->var.xres || var->yres > info2->var.yres ||	var->xres_virtual > info2->var.xres_virtual ||	var->yres_virtual > info2->var.yres_virtual ||	var->bits_per_pixel > info2->var.bits_per_pixel ||	var->nonstd ||	(var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED)	return -EINVAL;    memcpy(var, &info2->var, sizeof(struct fb_var_screeninfo));    if ((activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {	oldbpp = display->var.bits_per_pixel;	display->var = *var;    }    if ((oldbpp != var->bits_per_pixel) || (display->cmap.len == 0)) {	if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))	    return err;	do_install_cmap(con, info);    }    return 0;}    /*     *  Get the Colormap     */static int offb_get_cmap(struct fb_cmap *cmap, int kspc, int con,			 struct fb_info *info){    struct fb_info_offb *info2 = (struct fb_info_offb *)info;    if (con == currcon && !info2->blanked) /* current console? */	return fb_get_cmap(cmap, kspc, offb_getcolreg, info);    if (fb_display[con].cmap.len) /* non default colormap? */	fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);    else    {	int size = fb_display[con].var.bits_per_pixel == 16 ? 32 : 256;	fb_copy_cmap(fb_default_cmap(size), cmap, kspc ? 0 : 2);    }    return 0;}    /*     *  Set the Colormap     */static int offb_set_cmap(struct fb_cmap *cmap, int kspc, int con,			 struct fb_info *info){    struct fb_info_offb *info2 = (struct fb_info_offb *)info;    int err;    if (!info2->cmap_adr)	return -ENOSYS;    if (!fb_display[con].cmap.len) {	/* no colormap allocated? */	int size = fb_display[con].var.bits_per_pixel == 16 ? 32 : 256;	if ((err = fb_alloc_cmap(&fb_display[con].cmap, size, 0)))	    return err;    }    if (con == currcon && !info2->blanked)		/* current console? */	return fb_set_cmap(cmap, kspc, offb_setcolreg, info);    else	fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);    return 0;}    /*     *  Initialisation     */int __init offb_init(void){    struct device_node *dp;    unsigned int dpy;#ifdef CONFIG_BOOTX_TEXT    struct device_node *displays = find_type_devices("display");    struct device_node *macos_display = NULL;    /* If we're booted from BootX... */    if (prom_num_displays == 0 && boot_infos != 0) {	unsigned long addr = (unsigned long) boot_infos->dispDeviceBase;	/* find the device node corresponding to the macos display */	for (dp = displays; dp != NULL; dp = dp->next) {	    int i;	    /*	     * Grrr...  It looks like the MacOS ATI driver	     * munges the assigned-addresses property (but	     * the AAPL,address value is OK).	     */	    if (strncmp(dp->name, "ATY,", 4) == 0 && dp->n_addrs == 1) {		unsigned int *ap = (unsigned int *)		    get_property(dp, "AAPL,address", NULL);		if (ap != NULL) {		    dp->addrs[0].address = *ap;		    dp->addrs[0].size = 0x01000000;		}	    }	    /*	     * The LTPro on the Lombard powerbook has no addresses	     * on the display nodes, they are on their parent.	     */	    if (dp->n_addrs == 0 && device_is_compatible(dp, "ATY,264LTPro")) {		int na;		unsigned int *ap = (unsigned int *)		    get_property(dp, "AAPL,address", &na);		if (ap != 0)		    for (na /= sizeof(unsigned int); na > 0; --na, ++ap)			if (*ap <= addr && addr < *ap + 0x1000000)			    goto foundit;	    }	    /*	     * See if the display address is in one of the address	     * ranges for this display.	     */	    for (i = 0; i < dp->n_addrs; ++i) {		if (dp->addrs[i].address <= addr		    && addr < dp->addrs[i].address + dp->addrs[i].size)		    break;	    }	    if (i < dp->n_addrs) {	    foundit:		printk(KERN_INFO "MacOS display is %s\n", dp->full_name);		macos_display = dp;		break;	    }	}	/* initialize it */	offb_init_fb(macos_display? macos_display->name: "MacOS display",		     macos_display? macos_display->full_name: "MacOS display",		     boot_infos->dispDeviceRect[2],		     boot_infos->dispDeviceRect[3],		     boot_infos->dispDeviceDepth,		     boot_infos->dispDeviceRowBytes, addr, NULL);    }#endif    for (dpy = 0; dpy < prom_num_displays; dpy++) {	if ((dp = find_path_device(prom_display_paths[dpy])))	    offb_init_nodriver(dp);    }    return 0;}static void __init offb_init_nodriver(struct device_node *dp){    int *pp, i;    unsigned int len;    int width = 640, height = 480, depth = 8, pitch;    unsigned *up, address;    if ((pp = (int *)get_property(dp, "depth", &len)) != NULL	&& len == sizeof(int))	depth = *pp;    if ((pp = (int *)get_property(dp, "width", &len)) != NULL	&& len == sizeof(int))	width = *pp;    if ((pp = (int *)get_property(dp, "height", &len)) != NULL	&& len == sizeof(int))	height = *pp;    if ((pp = (int *)get_property(dp, "linebytes", &len)) != NULL	&& len == sizeof(int)) {	pitch = *pp;	if (pitch == 1)	    pitch = 0x1000;    } else	pitch = width;    if ((up = (unsigned *)get_property(dp, "address", &len)) != NULL	&& len == sizeof(unsigned))	address = (u_long)*up;    else {	for (i = 0; i < dp->n_addrs; ++i)	    if (dp->addrs[i].size >= pitch*height*depth/8)		break;	if (i >= dp->n_addrs) {	    printk(KERN_ERR "no framebuffer address found for %s\n", dp->full_name);	    return;	}	address = (u_long)dp->addrs[i].address;	/* kludge for valkyrie */	if (strcmp(dp->name, "valkyrie") == 0) 	    address += 0x1000;    }    offb_init_fb(dp->name, dp->full_name, width, height, depth,		 pitch, address, dp);    }static void __init offb_init_fb(const char *name, const char *full_name,				    int width, int height, int depth,				    int pitch, unsigned long address,				    struct device_node *dp){    int i;    struct fb_fix_screeninfo *fix;    struct fb_var_screeninfo *var;    struct display *disp;    struct fb_info_offb *info;    unsigned long res_start = address;    unsigned long res_size = pitch*height*depth/8;    if (!request_mem_region(res_start, res_size, "offb"))	return;    printk(KERN_INFO "Using unsupported %dx%d %s at %lx, depth=%d, pitch=%d\n",	   width, height, name, address, depth, pitch);    if (depth != 8 && depth != 16 && depth != 32) {	printk(KERN_ERR "%s: can't use depth = %d\n", full_name, depth);	release_mem_region(res_start, res_size);	return;    }    info = kmalloc(sizeof(struct fb_info_offb), GFP_ATOMIC);    if (info == 0) {	release_mem_region(res_start, res_size);	return;    }    memset(info, 0, sizeof(*info));    fix = &info->fix;    var = &info->var;    disp = &info->disp;    strcpy(fix->id, "OFfb ");    strncat(fix->id, name, sizeof(fix->id));    fix->id[sizeof(fix->id)-1] = '\0';

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
看片的网站亚洲| 久久99最新地址| 久久99精品国产麻豆婷婷洗澡| 国产一区二区主播在线| 在线亚洲+欧美+日本专区| 国产无一区二区| 免费不卡在线视频| 欧美日韩国产在线播放网站| 国产精品素人一区二区| 麻豆91免费观看| 欧美日韩国产小视频在线观看| 国产午夜精品在线观看| 久久se精品一区二区| 欧美日韩免费观看一区三区| 亚洲欧美日韩国产中文在线| 国产一区二区三区国产| 日韩一区二区在线观看视频播放| 亚洲精品国产视频| 不卡高清视频专区| 久久久久久久综合狠狠综合| 日韩 欧美一区二区三区| 在线观看成人免费视频| 国产精品成人在线观看| 国产福利一区二区| 久久蜜桃av一区二区天堂| 男男gaygay亚洲| 欧美一区二区福利在线| 日日骚欧美日韩| 欧美精品日韩一区| 偷偷要91色婷婷| 欧美日韩国产中文| 日韩不卡一二三区| 日韩你懂的在线播放| 日精品一区二区| 欧美一级生活片| 日韩电影在线一区| 日韩欧美不卡一区| 国产精品自产自拍| 中国av一区二区三区| 成人黄色一级视频| 亚洲女子a中天字幕| 色综合一个色综合| 洋洋av久久久久久久一区| 色婷婷av一区二区| 亚洲va韩国va欧美va| 在线成人免费视频| 麻豆精品一区二区av白丝在线| 久久亚洲一级片| 成人免费视频免费观看| 亚洲色大成网站www久久九九| 一本到一区二区三区| 亚洲成av人片观看| 欧美成人一区二区三区| 国产福利一区二区| 亚洲欧洲制服丝袜| 91精品国产91综合久久蜜臀| 国产一区二区视频在线| 欧美韩日一区二区三区四区| 色婷婷综合久久久| 日韩av午夜在线观看| 国产欧美久久久精品影院| 91色婷婷久久久久合中文| 亚洲午夜国产一区99re久久| 欧美tk丨vk视频| 99久久婷婷国产综合精品| 亚洲成人精品一区二区| 欧美精品一区二区三区蜜臀| 91麻豆精品秘密| 免费成人你懂的| 亚洲欧美另类小说| 精品国产三级a在线观看| 成人黄色小视频在线观看| 日韩主播视频在线| 中文字幕中文在线不卡住| 6080yy午夜一二三区久久| 成人免费视频视频| 久久丁香综合五月国产三级网站| 国产精品久久久久久久久免费桃花 | 国产亚洲成aⅴ人片在线观看| av在线免费不卡| 日本不卡一区二区三区| 亚洲欧洲精品一区二区三区| 欧美一区二区三级| 色天天综合色天天久久| 国产风韵犹存在线视精品| 日韩在线观看一区二区| 自拍视频在线观看一区二区| 精品国产免费一区二区三区四区| 91黄视频在线| 成人激情黄色小说| 国产精品亚洲第一| 蜜桃久久精品一区二区| 亚洲成人av一区二区三区| 国产精品久久久久一区| 久久久久高清精品| 精品久久久影院| 日韩一级免费观看| 欧美精品第一页| 欧美视频在线播放| 一本大道久久a久久综合婷婷| 国产不卡视频在线播放| 久久电影网站中文字幕| 日韩av电影一区| 天堂一区二区在线| 午夜精品一区二区三区电影天堂| 亚洲视频一区二区在线| 国产精品国产三级国产aⅴ原创| 久久蜜桃av一区精品变态类天堂| 日韩精品中文字幕在线一区| 欧美一区永久视频免费观看| 欧美精品精品一区| 91精品国产麻豆| 91精品午夜视频| 91精品国产高清一区二区三区 | 亚洲视频你懂的| 日本一区二区成人在线| 国产亚洲欧美日韩在线一区| 久久一夜天堂av一区二区三区| 欧美mv日韩mv国产网站| 精品国产伦理网| 国产视频911| 国产精品久久久久7777按摩| 亚洲婷婷综合色高清在线| 亚洲日本va在线观看| 亚洲少妇最新在线视频| 亚洲综合视频网| 亚洲6080在线| 九色综合狠狠综合久久| 国产一区视频网站| 成人h动漫精品一区二区| 99国产精品久久久久久久久久久| 91色婷婷久久久久合中文| 欧美性色黄大片手机版| 日韩视频在线你懂得| 国产精品天天看| 久久精品一二三| 中文字幕不卡一区| 亚洲色大成网站www久久九九| 亚洲综合小说图片| 午夜精品123| 国产在线视频一区二区| thepron国产精品| 欧美日韩成人在线| 久久久99免费| 亚洲天堂成人在线观看| 视频在线观看一区二区三区| 国产乱码字幕精品高清av | 亚洲电影一级片| 久久国产生活片100| 国产**成人网毛片九色 | 日韩欧美国产精品一区| 久久久一区二区三区捆绑**| 成人免费在线播放视频| 奇米888四色在线精品| 成人av综合在线| 日韩一区二区三区观看| 国产精品无人区| 男女男精品视频网| 一本大道综合伊人精品热热| 精品久久久久一区二区国产| 亚洲精品国久久99热| 国产一区二区三区黄视频 | 欧美精品tushy高清| 亚洲国产成人一区二区三区| 日韩精彩视频在线观看| av午夜精品一区二区三区| 日韩一本二本av| 亚洲免费观看在线观看| 国产一区二区三区精品视频| 91超碰这里只有精品国产| 亚洲女同女同女同女同女同69| 国产在线精品免费| 欧美另类高清zo欧美| 亚洲三级视频在线观看| 国产精品99久久久久久久vr | gogo大胆日本视频一区| 精品sm捆绑视频| 日日夜夜精品视频天天综合网| 色婷婷久久99综合精品jk白丝| 欧美激情在线一区二区三区| 蜜桃视频一区二区| 91麻豆精品国产91久久久久久久久 | 成人精品国产福利| 久久这里都是精品| 日本在线不卡视频| 欧美日韩午夜精品| 亚洲一区中文日韩| 色综合天天综合| 中文字幕亚洲视频| 国产乱码一区二区三区| 欧美成人免费网站| 日韩电影一二三区| 91精品国产色综合久久| 天堂一区二区在线| 91精品免费在线| 日本伊人色综合网| 日韩视频在线一区二区| 久久精品国产一区二区| 精品少妇一区二区三区视频免付费| 丝袜亚洲另类欧美|