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

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

?? pxafb.c

?? LINUX下PXA的LCD驅動程序原代碼,值得一看,
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* *  linux/drivers/video/pxafb.c * *  Copyright (C) 1999 Eric A. Thomas *   Based on acornfb.c Copyright (C) Russell King. * * 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. * *	        Intel PXA250/210 LCD Controller Frame Buffer Driver * * Please direct your questions and comments on this driver to the following * email address: * *	linux-arm-kernel@lists.arm.linux.org.uk * * Clean patches should be sent to the ARM Linux Patch System.  Please see the * following web page for more information: * *	http://www.arm.linux.org.uk/developer/patches/info.shtml * * Thank you. * * * Code Status: * 1999/04/01: *	- Driver appears to be working for Brutus 320x200x8bpp mode.  Other *	  resolutions are working, but only the 8bpp mode is supported. *	  Changes need to be made to the palette encode and decode routines *	  to support 4 and 16 bpp modes.   *	  Driver is not designed to be a module.  The FrameBuffer is statically *	  allocated since dynamic allocation of a 300k buffer cannot be  *	  guaranteed.  * * 1999/06/17: *	- FrameBuffer memory is now allocated at run-time when the *	  driver is initialized.     * * 2000/04/10: Nicolas Pitre <nico@cam.org> *	- Big cleanup for dynamic selection of machine type at run time. * * 2000/07/19: Jamey Hicks <jamey@crl.dec.com> *	- Support for Bitsy aka Compaq iPAQ H3600 added. * * 2000/08/07: Tak-Shing Chan <tchan.rd@idthk.com> *	       Jeff Sutherland <jsutherland@accelent.com> *	- Resolved an issue caused by a change made to the Assabet's PLD  *	  earlier this year which broke the framebuffer driver for newer  *	  Phase 4 Assabets.  Some other parameters were changed to optimize *	  for the Sharp display. * * 2000/08/09: Cliff Brake <cbrake@accelent.com> *      - modified for Accelent *  * 2000/08/09: Kunihiko IMAI <imai@vasara.co.jp> *	- XP860 support added * * 2000/08/19: Mark Huang <mhuang@livetoy.com> *	- Allows standard options to be passed on the kernel command line *	  for most common passive displays. * * 2000/08/29: *	- s/save_flags_cli/local_irq_save/ *	- remove unneeded extra save_flags_cli in sa1100fb_enable_lcd_controller * * 2000/10/10: Erik Mouw <J.A.K.Mouw@its.tudelft.nl> *	- Updated LART stuff. Fixed some minor bugs. * * 2000/10/30: Murphy Chen <murphy@mail.dialogue.com.tw> *	- Pangolin support added * * 2000/10/31: Roman Jordan <jor@hoeft-wessel.de> *	- Huw Webpanel support added * * 2000/11/23: Eric Peng <ericpeng@coventive.com> *	- Freebird add * * 2001/02/07: Jamey Hicks <jamey.hicks@compaq.com>  *	       Cliff Brake <cbrake@accelent.com> *	- Added PM callback * * 2001/05/26: <rmk@arm.linux.org.uk> *	- Fix 16bpp so that (a) we use the right colours rather than some *	  totally random colour depending on what was in page 0, and (b) *	  we don't de-reference a NULL pointer. *	- remove duplicated implementation of consistent_alloc() *	- convert dma address types to dma_addr_t *	- remove unused 'montype' stuff *	- remove redundant zero inits of init_var after the initial *	  memzero. *	- remove allow_modeset (acornfb idea does not belong here) * * 2001/05/28: <rmk@arm.linux.org.uk> *	- massive cleanup - move machine dependent data into structures *	- I've left various #warnings in - if you see one, and know *	  the hardware concerned, please get in contact with me. * * 2001/05/31: <rmk@arm.linux.org.uk> *	- Fix LCCR1 HSW value, fix all machine type specifications to *	  keep values in line.  (Please check your machine type specs) * * 2001/06/10: <rmk@arm.linux.org.uk> *	- Fiddle with the LCD controller from task context only; mainly *	  so that we can run with interrupts on, and sleep. *	- Convert #warnings into #errors.  No pain, no gain. ;) * * 2001/06/14: <rmk@arm.linux.org.uk> *	- Make the palette BPS value for 12bpp come out correctly. *	- Take notice of "greyscale" on any colour depth. *	- Make truecolor visuals use the RGB channel encoding information. * * 2001/07/02: <rmk@arm.linux.org.uk> *	- Fix colourmap problems. * * 2001/08/03: <cbrake@accelent.com> *      - Ported from SA1100 to PXA250 */#include <linux/config.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/sched.h>#include <linux/errno.h>#include <linux/string.h>#include <linux/interrupt.h>#include <linux/slab.h>#include <linux/fb.h>#include <linux/delay.h>#include <linux/pm.h>#include <linux/init.h>#include <linux/cpufreq.h>#include <asm/hardware.h>#include <asm/io.h>#include <asm/irq.h>#include <asm/mach-types.h>#include <asm/uaccess.h>#include <video/fbcon.h>#include <video/fbcon-mfb.h>#include <video/fbcon-cfb4.h>#include <video/fbcon-cfb8.h>#include <video/fbcon-cfb16.h>/* * debugging? */#define DEBUG 1/* * Complain if VAR is out of range. */#define DEBUG_VAR 1#undef ASSABET_PAL_VIDEO#include "pxafb.h"void (*pxafb_blank_helper)(int blank);EXPORT_SYMBOL(pxafb_blank_helper);/* * IMHO this looks wrong.  In 8BPP, length should be 8. */static struct pxafb_rgb rgb_8 = {	red:	{ offset: 8,  length: 4, },	green:	{ offset: 4,  length: 4, },	blue:	{ offset: 0,  length: 4, },	transp:	{ offset: 0,  length: 0, },};static struct pxafb_rgb def_rgb_16 = {	red:	{ offset: 11, length: 5, },	green:	{ offset: 5,  length: 6, },	blue:	{ offset: 0,  length: 5, },	transp:	{ offset: 0,  length: 0, },};static struct pxafb_mach_info pxa_fb_info __initdata = {	pixclock:	LCD_PIXCLOCK,	/* clock period in ps */	bpp:		LCD_BPP,	xres:		LCD_XRES,	yres:		LCD_YRES,	hsync_len:	LCD_HORIZONTAL_SYNC_PULSE_WIDTH,	vsync_len:	LCD_VERTICAL_SYNC_PULSE_WIDTH,	left_margin:	LCD_BEGIN_OF_LINE_WAIT_COUNT,	upper_margin:	LCD_BEGIN_FRAME_WAIT_COUNT,	right_margin:	LCD_END_OF_LINE_WAIT_COUNT,	lower_margin:	LCD_END_OF_FRAME_WAIT_COUNT,	sync:		LCD_SYNC,	lccr0:		LCD_LCCR0,	lccr3:		LCD_LCCR3};static struct pxafb_mach_info * __initpxafb_get_machine_info(struct pxafb_info *fbi){	return &pxa_fb_info;}static int pxafb_activate_var(struct fb_var_screeninfo *var, struct pxafb_info *);static void set_ctrlr_state(struct pxafb_info *fbi, u_int state);static inline void pxafb_schedule_task(struct pxafb_info *fbi, u_int state){	unsigned long flags;	local_irq_save(flags);	/*	 * We need to handle two requests being made at the same time.	 * There are two important cases:	 *  1. When we are changing VT (C_REENABLE) while unblanking (C_ENABLE)	 *     We must perform the unblanking, which will do our REENABLE for us.	 *  2. When we are blanking, but immediately unblank before we have	 *     blanked.  We do the "REENABLE" thing here as well, just to be sure.	 */	if (fbi->task_state == C_ENABLE && state == C_REENABLE)		state = (u_int) -1;	if (fbi->task_state == C_DISABLE && state == C_ENABLE)		state = C_REENABLE;	if (state != (u_int)-1) {		fbi->task_state = state;		schedule_task(&fbi->task);	}	local_irq_restore(flags);}/* * Get the VAR structure pointer for the specified console */static inline struct fb_var_screeninfo *get_con_var(struct fb_info *info, int con){	struct pxafb_info *fbi = (struct pxafb_info *)info;	return (con == fbi->currcon || con == -1) ? &fbi->fb.var : &fb_display[con].var;}/* * Get the DISPLAY structure pointer for the specified console */static inline struct display *get_con_display(struct fb_info *info, int con){	struct pxafb_info *fbi = (struct pxafb_info *)info;	return (con < 0) ? fbi->fb.disp : &fb_display[con];}/* * Get the CMAP pointer for the specified console */static inline struct fb_cmap *get_con_cmap(struct fb_info *info, int con){	struct pxafb_info *fbi = (struct pxafb_info *)info;	return (con == fbi->currcon || con == -1) ? &fbi->fb.cmap : &fb_display[con].cmap;}static inline u_intchan_to_field(u_int chan, struct fb_bitfield *bf){	chan &= 0xffff;	chan >>= 16 - bf->length;	return chan << bf->offset;}static intpxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue,		       u_int trans, struct fb_info *info){	struct pxafb_info *fbi = (struct pxafb_info *)info;	u_int val, ret = 1;	if (regno < fbi->palette_size) {		val = ((red >> 0) & 0xf800);		val |= ((green >> 5) & 0x07e0);		val |= ((blue >> 11) & 0x001f);		fbi->palette_cpu[regno] = val;		ret = 0;	}	return ret;}static intpxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,		   u_int trans, struct fb_info *info){	struct pxafb_info *fbi = (struct pxafb_info *)info;	u_int val;	int ret = 1;	/*	 * If greyscale is true, then we convert the RGB value	 * to greyscale no mater what visual we are using.	 */	if (fbi->fb.var.grayscale)		red = green = blue = (19595 * red + 38470 * green +					7471 * blue) >> 16;	switch (fbi->fb.disp->visual) {	case FB_VISUAL_TRUECOLOR:		/*		 * 12 or 16-bit True Colour.  We encode the RGB value		 * according to the RGB bitfield information.		 */		if (regno < 16) {			u16 *pal = fbi->fb.pseudo_palette;			val  = chan_to_field(red, &fbi->fb.var.red);			val |= chan_to_field(green, &fbi->fb.var.green);			val |= chan_to_field(blue, &fbi->fb.var.blue);			pal[regno] = val;			ret = 0;		}		break;	case FB_VISUAL_PSEUDOCOLOR:		ret = pxafb_setpalettereg(regno, red, green, blue, trans, info);		break;	}	return ret;}/* *  pxafb_decode_var(): *    Get the video params out of 'var'. If a value doesn't fit, round it up, *    if it's too big, return -EINVAL. * *    Suggestion: Round up in the following order: bits_per_pixel, xres, *    yres, xres_virtual, yres_virtual, xoffset, yoffset, grayscale, *    bitfields, horizontal timing, vertical timing. */static int pxafb_validate_var(struct fb_var_screeninfo *var,				 struct pxafb_info *fbi){	int ret = -EINVAL;	if (var->xres < MIN_XRES)		var->xres = MIN_XRES;	if (var->yres < MIN_YRES)		var->yres = MIN_YRES;	if (var->xres > fbi->max_xres)		var->xres = fbi->max_xres;	if (var->yres > fbi->max_yres)		var->yres = fbi->max_yres;	var->xres_virtual =	    var->xres_virtual < var->xres ? var->xres : var->xres_virtual;	var->yres_virtual =	    var->yres_virtual < var->yres ? var->yres : var->yres_virtual;	DPRINTK("var->bits_per_pixel=%d\n", var->bits_per_pixel);	switch (var->bits_per_pixel) {#ifdef FBCON_HAS_CFB4	case 4:  ret = 0; break;#endif#ifdef FBCON_HAS_CFB8	case 8:  ret = 0; break;#endif#ifdef FBCON_HAS_CFB16	case 12:		/* make sure we are in passive mode */		if (!(fbi->lccr0 & LCCR0_PAS))			ret = 0;		break;	case 16:		/* cerf pda 16 bits works fine in passive mode, so don't complain */		if (machine_is_xhyper255()) {			ret = 0;		} else			/* make sure we are in active mode */			if ((fbi->lccr0 & LCCR0_PAS))				ret = 0;		break;#endif	default:		break;	}	return ret;}static inline void pxafb_set_truecolor(u_int is_true_color){	DPRINTK("true_color = %d\n", is_true_color);#ifdef CONFIG_SA1100_ASSABET	if (machine_is_assabet()) {#if 1		// phase 4 or newer Assabet's		if (is_true_color)			BCR_set(BCR_LCD_12RGB);		else			BCR_clear(BCR_LCD_12RGB);#else		// older Assabet's		if (is_true_color)			BCR_clear(BCR_LCD_12RGB);		else			BCR_set(BCR_LCD_12RGB);#endif	}#endif}static voidpxafb_hw_set_var(struct fb_var_screeninfo *var, struct pxafb_info *fbi){	fb_set_cmap(&fbi->fb.cmap, 1, pxafb_setcolreg, &fbi->fb);	/* Set board control register to handle new color depth */	pxafb_set_truecolor(var->bits_per_pixel >= 16);	pxafb_activate_var(var, fbi);}/* * pxafb_set_var(): *	Set the user defined part of the display for the specified console */static intpxafb_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info){	struct pxafb_info *fbi = (struct pxafb_info *)info;	struct fb_var_screeninfo *dvar = get_con_var(&fbi->fb, con);	struct display *display = get_con_display(&fbi->fb, con);	int err, chgvar = 0, rgbidx;	DPRINTK("set_var\n");	/*	 * Decode var contents into a par structure, adjusting any	 * out of range values.	 */	err = pxafb_validate_var(var, fbi);	if (err)		return err;	if (var->activate & FB_ACTIVATE_TEST)		return 0;	if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_NOW)		return -EINVAL;	if (dvar->xres != var->xres)		chgvar = 1;	if (dvar->yres != var->yres)		chgvar = 1;	if (dvar->xres_virtual != var->xres_virtual)		chgvar = 1;	if (dvar->yres_virtual != var->yres_virtual)		chgvar = 1;	if (dvar->bits_per_pixel != var->bits_per_pixel)		chgvar = 1;	if (con < 0)		chgvar = 0;	switch (var->bits_per_pixel) {#ifdef FBCON_HAS_CFB4	case 4:		if (fbi->cmap_static)			display->visual	= FB_VISUAL_STATIC_PSEUDOCOLOR;		else			display->visual	= FB_VISUAL_PSEUDOCOLOR;		display->line_length	= var->xres / 2;		display->dispsw		= &fbcon_cfb4;		rgbidx			= RGB_8;		break;#endif#ifdef FBCON_HAS_CFB8	case 8:		if (fbi->cmap_static)			display->visual	= FB_VISUAL_STATIC_PSEUDOCOLOR;		else			display->visual	= FB_VISUAL_PSEUDOCOLOR;		display->line_length	= var->xres;		display->dispsw		= &fbcon_cfb8;		rgbidx			= RGB_8;		break;#endif#ifdef FBCON_HAS_CFB16	case 12:	case 16:		display->visual		= FB_VISUAL_TRUECOLOR;		display->line_length	= var->xres * 2;		display->dispsw		= &fbcon_cfb16;		display->dispsw_data	= fbi->fb.pseudo_palette;		rgbidx			= RGB_16;		break;#endif	default:		rgbidx = 0;		display->dispsw = &fbcon_dummy;		break;	}	display->screen_base	= fbi->screen_cpu;	display->next_line	= display->line_length;	display->type		= fbi->fb.fix.type;	display->type_aux	= fbi->fb.fix.type_aux;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲图片欧美色图| 91美女福利视频| 97久久超碰国产精品| 3d成人动漫网站| 亚洲天堂精品在线观看| 国产一区二区久久| 欧美偷拍一区二区| 国产精品日日摸夜夜摸av| 日本网站在线观看一区二区三区| 成人美女视频在线看| 日韩欧美二区三区| 无吗不卡中文字幕| 91激情五月电影| 国产精品欧美经典| 国产精品亚洲第一区在线暖暖韩国| 欧美色精品在线视频| 国产精品乱码一区二三区小蝌蚪| 久久国产精品区| 欧美日韩一区视频| 亚洲午夜av在线| www.激情成人| 中文av字幕一区| 国产高清视频一区| 久久精品人人爽人人爽| 日本v片在线高清不卡在线观看| 色爱区综合激月婷婷| 中文字幕在线观看一区| 成人精品高清在线| 久久人人爽爽爽人久久久| 久久爱另类一区二区小说| 欧美疯狂性受xxxxx喷水图片| 亚洲小说欧美激情另类| 在线亚洲人成电影网站色www| 18欧美乱大交hd1984| 成人精品小蝌蚪| 国产欧美日韩一区二区三区在线观看| 免费成人在线观看| 日韩美女在线视频| 久久精品国产99国产| 欧美成人aa大片| 久久国产精品免费| 久久精品无码一区二区三区| 紧缚奴在线一区二区三区| 精品成人在线观看| 国产精品一区二区黑丝| 国产欧美日韩三级| 97精品国产97久久久久久久久久久久 | 国产成人精品网址| 国产精品伦理在线| 色香蕉成人二区免费| 亚洲在线中文字幕| 91精品国产高清一区二区三区| 亚洲一区二区三区国产| 欧美剧情片在线观看| 蜜桃av噜噜一区| 国产午夜精品久久久久久久 | 久久aⅴ国产欧美74aaa| 久久久久久久久久久久久久久99| 国产精品夜夜嗨| 亚洲视频一区二区在线观看| 欧美三级韩国三级日本三斤| 蜜桃91丨九色丨蝌蚪91桃色| 久久女同性恋中文字幕| 91福利在线观看| 免费人成在线不卡| 国产精品网站导航| 欧美日本一区二区三区四区| 韩国在线一区二区| 一区二区三区精品在线| 日韩欧美国产1| 99久久精品一区二区| 天堂影院一区二区| 中文字幕av一区二区三区高| 欧美日韩一卡二卡| 国产成人av资源| 日韩中文字幕区一区有砖一区 | 国产精品毛片无遮挡高清| 欧美美女一区二区三区| 成人午夜电影网站| 人人精品人人爱| 亚洲欧洲中文日韩久久av乱码| 欧美一激情一区二区三区| 不卡大黄网站免费看| 国内精品在线播放| 亚洲小说欧美激情另类| 国产精品你懂的在线| 日韩一区二区三区av| 色综合久久中文综合久久牛| 欧美96一区二区免费视频| 亚洲日本在线视频观看| 久久伊人蜜桃av一区二区| 欧美美女黄视频| 色婷婷久久99综合精品jk白丝| 国产福利一区二区三区视频在线 | 亚洲美女区一区| 国产欧美日韩另类视频免费观看| 欧美美女黄视频| 91精品福利视频| 91小视频免费观看| 国产成人激情av| 国产乱子轮精品视频| 亚洲gay无套男同| 亚洲精品成a人| 国产精品美女一区二区| 久久亚区不卡日本| 精品三级av在线| 91精品国产综合久久久久久漫画 | 亚洲成人第一页| 一区二区三区久久| 一区二区在线观看视频在线观看| 国产欧美综合在线观看第十页| 2021国产精品久久精品 | 色婷婷av一区二区三区gif| 丰满放荡岳乱妇91ww| 国产成人在线色| 处破女av一区二区| www..com久久爱| av午夜精品一区二区三区| www.亚洲色图.com| www.综合网.com| 91免费观看在线| 91成人在线观看喷潮| 欧美性大战xxxxx久久久| 欧美曰成人黄网| 精品视频在线免费看| 欧美日韩成人高清| 91精品国产一区二区三区蜜臀 | 日韩精品色哟哟| 日韩电影一区二区三区| 日本欧美在线观看| 久久电影网电视剧免费观看| 国产麻豆精品在线| 国产suv一区二区三区88区| 成人av集中营| 欧美伊人久久久久久久久影院 | 色综合久久久久网| 欧美日韩综合不卡| 欧美大白屁股肥臀xxxxxx| 久久众筹精品私拍模特| 国产精品久久久久毛片软件| 亚洲老妇xxxxxx| 日韩高清在线一区| 国产成人免费9x9x人网站视频| 91丨porny丨国产入口| 在线播放中文字幕一区| 久久奇米777| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲高清在线精品| 精品综合久久久久久8888| 成人激情黄色小说| 91麻豆精品国产| 中文一区二区在线观看| 亚洲一区二区三区自拍| 紧缚奴在线一区二区三区| 99国产精品久久久久久久久久| 欧美日韩的一区二区| 国产日韩三级在线| 五月天久久比比资源色| 盗摄精品av一区二区三区| 欧美日韩精品一区二区| 欧美国产日本韩| 日韩福利电影在线观看| k8久久久一区二区三区| 日韩精品一区二区三区swag| 亚洲天堂2016| 国产在线视频一区二区三区| 欧美专区在线观看一区| 国产偷国产偷精品高清尤物| 视频在线在亚洲| 99re热视频这里只精品| 亚洲精品一区在线观看| 亚洲国产日日夜夜| 波多野洁衣一区| 久久众筹精品私拍模特| 青娱乐精品视频在线| 在线观看欧美日本| 国产精品色在线| 国产精一区二区三区| 91精品视频网| 亚洲黄色在线视频| 99国产精品国产精品久久| 26uuu色噜噜精品一区| 日韩vs国产vs欧美| 在线观看视频91| 亚洲你懂的在线视频| av综合在线播放| 国产欧美一区二区三区鸳鸯浴| 久久国产精品无码网站| 这里只有精品99re| 婷婷激情综合网| 欧美影视一区二区三区| 一卡二卡欧美日韩| 日本精品裸体写真集在线观看 | 精品1区2区在线观看| 免费人成精品欧美精品| 欧美四级电影网| 亚洲一区av在线| 欧美亚洲丝袜传媒另类| 日韩久久一区二区| 97久久精品人人做人人爽|