⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pm3fb.c

📁 S3C44B0X下的LCD (framebuffer)驱动资料与相关代码
💻 C
📖 第 1 页 / 共 5 页
字号:
	{		"1024x768-90", {	100000, 1024, 768, 0, 96, 288, 1312, 21, 36, 77,			    845, 1024, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_LOW			    |			    PM3VideoControl_VSYNC_ACTIVE_LOW			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1024x768-100", from /etc/fb.modes *//* DISABLED, vsstart == 0	{		"1024x768-100", {	109998, 1024, 768, 0, 88, 368, 1392, 0, 8, 24, 792,			    1024, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_LOW			    |			    PM3VideoControl_VSYNC_ACTIVE_LOW			    | PM3VideoControl_PIXELSIZE_8BIT}},*//* Generated mode : "1024x768-100", from ??? */	{		"1024x768-100", {			115500, 1024, 768, 32, 224, 416, 1440, 3, 13, 34, 802, 1024, 0, 8,			PM3VideoControl_ENABLE|PM3VideoControl_HSYNC_ACTIVE_LOW|			PM3VideoControl_VSYNC_ACTIVE_LOW|PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1152x864-43-lace" *//* INTERLACED NOT SUPPORTED  {"1152x864-43-lace", {64998, 1152, 864, 72, 200, 264, 1416, 78, 87, 191, 1055, 1152, 0, 8, PM3VideoControl_ENABLE|PM3VideoControl_HSYNC_ACTIVE_HIGH|PM3VideoControl_VSYNC_ACTIVE_HIGH|PM3VideoControl_PIXELSIZE_8BIT}},    INTERLACED NOT SUPPORTED *//* Generated mode : "1152x864-47-lace" *//* INTERLACED NOT SUPPORTED  {"1152x864-47-lace", {64998, 1152, 864, 88, 216, 296, 1448, 30, 39, 83, 947, 1152, 0, 8, PM3VideoControl_ENABLE|PM3VideoControl_HSYNC_ACTIVE_HIGH|PM3VideoControl_VSYNC_ACTIVE_HIGH|PM3VideoControl_PIXELSIZE_8BIT}},    INTERLACED NOT SUPPORTED *//* Generated mode : "1152x864-60" */	{		"1152x864-60", {	80000, 1152, 864, 64, 176, 304, 1456, 6, 11, 52,			    916, 1152, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_HIGH			    |			    PM3VideoControl_VSYNC_ACTIVE_HIGH			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1152x864-70" */	{		"1152x864-70", {	100000, 1152, 864, 40, 192, 360, 1512, 13, 24, 81,			    945, 1152, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_HIGH			    |			    PM3VideoControl_VSYNC_ACTIVE_HIGH			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1152x864-75" */	{		"1152x864-75", {	109998, 1152, 864, 24, 168, 312, 1464, 45, 53, 138,			    1002, 1152, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_HIGH			    |			    PM3VideoControl_VSYNC_ACTIVE_HIGH			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1152x864-80" */	{		"1152x864-80", {	109998, 1152, 864, 16, 128, 288, 1440, 30, 37, 94,			    958, 1152, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_HIGH			    |			    PM3VideoControl_VSYNC_ACTIVE_HIGH			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1280x1024-43-lace" *//* INTERLACED NOT SUPPORTED  {"1280x1024-43-lace", {80000, 1024, 1024, 80, 160, 320, 1344, 50, 60, 125, 1149, 1024, 0, 8, PM3VideoControl_ENABLE|PM3VideoControl_HSYNC_ACTIVE_HIGH|PM3VideoControl_VSYNC_ACTIVE_HIGH|PM3VideoControl_PIXELSIZE_8BIT}},    INTERLACED NOT SUPPORTED *//* Generated mode : "1280x1024-47-lace" *//* INTERLACED NOT SUPPORTED  {"1280x1024-47-lace", {80000, 1280, 1024, 80, 160, 320, 1600, 1, 11, 29, 1053, 1280, 0, 8, PM3VideoControl_ENABLE|PM3VideoControl_HSYNC_ACTIVE_HIGH|PM3VideoControl_VSYNC_ACTIVE_HIGH|PM3VideoControl_PIXELSIZE_8BIT}},    INTERLACED NOT SUPPORTED *//* Generated mode : "1280x1024-60" */	{		"1280x1024-60", {	107991, 1280, 1024, 48, 160, 408, 1688, 1, 4, 42,			    1066, 1280, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_HIGH			    |			    PM3VideoControl_VSYNC_ACTIVE_HIGH			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1280x1024-70" */	{		"1280x1024-70", {	125992, 1280, 1024, 80, 192, 408, 1688, 1, 6, 42,			    1066, 1280, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_HIGH			    |			    PM3VideoControl_VSYNC_ACTIVE_HIGH			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1280x1024-74" */	{		"1280x1024-74", {	134989, 1280, 1024, 32, 176, 432, 1712, 0, 30, 40,			    1064, 1280, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_HIGH			    |			    PM3VideoControl_VSYNC_ACTIVE_HIGH			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1280x1024-75" */	{		"1280x1024-75", {	134989, 1280, 1024, 16, 160, 408, 1688, 1, 4, 42,			    1066, 1280, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_HIGH			    |			    PM3VideoControl_VSYNC_ACTIVE_HIGH			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1600x1200-60" */	{		"1600x1200-60", {	155981, 1600, 1200, 32, 192, 448, 2048, 10, 18, 70,			    1270, 1600, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_LOW			    |			    PM3VideoControl_VSYNC_ACTIVE_LOW			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1600x1200-66" */	{		"1600x1200-66", {	171998, 1600, 1200, 40, 176, 480, 2080, 3, 6, 53,			    1253, 1600, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_LOW			    |			    PM3VideoControl_VSYNC_ACTIVE_LOW			    | PM3VideoControl_PIXELSIZE_8BIT}},/* Generated mode : "1600x1200-76" */	{		"1600x1200-76", {	197980, 1600, 1200, 40, 176, 480, 2080, 3, 8, 50,			    1250, 1600, 0, 8,			    PM3VideoControl_ENABLE |			    PM3VideoControl_HSYNC_ACTIVE_LOW			    |			    PM3VideoControl_VSYNC_ACTIVE_LOW			    | PM3VideoControl_PIXELSIZE_8BIT}},/* ##### end of auto-generated mode */	{	"\0",}};/* more mandatory stuff (see skeletonfb.c + framebuffer driver HOWTO */static struct pm3fb_info fb_info[PM3_MAX_BOARD];static struct pm3fb_par current_par[PM3_MAX_BOARD];static int current_par_valid[PM3_MAX_BOARD];/* to allow explicit filtering of board */short bus[PM3_MAX_BOARD];short slot[PM3_MAX_BOARD];short func[PM3_MAX_BOARD];short disable[PM3_MAX_BOARD];short noaccel[PM3_MAX_BOARD];char fontn[PM3_MAX_BOARD][PM3_FONTNAME_SIZE];short depth[PM3_MAX_BOARD];short flatpanel[PM3_MAX_BOARD];static struct display disp[PM3_MAX_BOARD];static char g_options[PM3_OPTIONS_SIZE] __initdata = "pm3fb,dummy";short printtimings = 0;short forcesize[PM3_MAX_BOARD];/* ********************* *//* ***** prototype ***** *//* ********************* *//* card-specific */static void pm3fb_j2000_setup(struct pm3fb_info *l_fb_info);/* permedia3-specific */static pm3fb_timing_result pm3fb_preserve_memory_timings(struct pm3fb_info *l_fb_info);static pm3fb_timing_result pm3fb_try_memory_timings(struct pm3fb_info *l_fb_info);static void pm3fb_write_memory_timings(struct pm3fb_info *l_fb_info);static unsigned long pm3fb_read_dac_reg(struct pm3fb_info *l_fb_info,					unsigned long r);static unsigned long pm3fb_CalculateClock(struct pm3fb_info *l_fb_info, unsigned long reqclock,	/* In kHz units */					  unsigned long refclock,	/* In kHz units */					  unsigned char *prescale,	/* ClkPreScale */					  unsigned char *feedback,	/* ClkFeedBackScale */					  unsigned char *postscale					  /* ClkPostScale */ );static void pm3fb_clear_memory(struct pm3fb_info *l_fb_info, u32 cc);static void pm3fb_clear_colormap(struct pm3fb_info *l_fb_info, unsigned char r, unsigned char g, unsigned char b);static void pm3fb_common_init(struct pm3fb_info *l_fb_info);static int pm3fb_Shiftbpp(struct pm3fb_info *l_fb_info,			  unsigned long depth, int v);static int pm3fb_Unshiftbpp(struct pm3fb_info *l_fb_info,			    unsigned long depth, int v);static void pm3fb_mapIO(struct pm3fb_info *l_fb_info);static void pm3fb_unmapIO(struct pm3fb_info *l_fb_info);#if defined(PM3FB_MASTER_DEBUG) && (PM3FB_MASTER_DEBUG >= 2)static void pm3fb_show_cur_mode(struct pm3fb_info *l_fb_info);#endifstatic void pm3fb_show_cur_timing(struct pm3fb_info *l_fb_info);static void pm3fb_write_mode(struct pm3fb_info *l_fb_info);static void pm3fb_read_mode(struct pm3fb_info *l_fb_info,			    struct pm3fb_par *curpar);static unsigned long pm3fb_size_memory(struct pm3fb_info *l_fb_info);/* accelerated permedia3-specific */#ifdef PM3FB_USE_ACCELstatic void pm3fb_wait_pm3(struct pm3fb_info *l_fb_info);static void pm3fb_init_engine(struct pm3fb_info *l_fb_info);#ifdef FBCON_HAS_CFB32static void pm3fb_cfb32_clear(struct vc_data *conp,			      struct display *p,			      int sy, int sx, int height, int width);static void pm3fb_cfb32_clear_margins(struct vc_data *conp,				      struct display *p, int bottom_only);#endif /* FBCON_HAS_CFB32 */#ifdef FBCON_HAS_CFB16static void pm3fb_cfb16_clear(struct vc_data *conp,			      struct display *p,			      int sy, int sx, int height, int width);static void pm3fb_cfb16_clear_margins(struct vc_data *conp,				      struct display *p, int bottom_only);#endif /* FBCON_HAS_CFB16 */#ifdef FBCON_HAS_CFB8static void pm3fb_cfb8_clear(struct vc_data *conp,			     struct display *p,			     int sy, int sx, int height, int width);static void pm3fb_cfb8_clear_margins(struct vc_data *conp,				     struct display *p, int bottom_only);#endif /* FBCON_HAS_CFB8 */#if defined(FBCON_HAS_CFB8) || defined(FBCON_HAS_CFB16) || defined(FBCON_HAS_CFB32)static void pm3fb_cfbX_bmove(struct display *p,			     int sy, int sx,			     int dy, int dx, int height, int width);static void pm3fb_cfbX_putc(struct vc_data *conp, struct display *p,			    int c, int yy, int xx);static void pm3fb_cfbX_putcs(struct vc_data *conp, struct display *p,			     const unsigned short *s, int count, int yy,			     int xx);static void pm3fb_cfbX_revc(struct display *p, int xx, int yy);#endif /* FBCON_HAS_CFB8 || FBCON_HAS_CFB16 || FBCON_HAS_CFB32 */#endif /* PM3FB_USE_ACCEL *//* pre-init */static void pm3fb_mode_setup(char *mode, unsigned long board_num);static void pm3fb_pciid_setup(char *pciid, unsigned long board_num);static char *pm3fb_boardnum_setup(char *options, unsigned long *bn);static void pm3fb_real_setup(char *options);/* fbdev */static int pm3fb_open(struct fb_info *info, int user);static int pm3fb_release(struct fb_info *info, int user);static int pm3fb_encode_fix(struct fb_fix_screeninfo *fix,			    const void *par, struct fb_info_gen *info);static int pm3fb_decode_var(const struct fb_var_screeninfo *var,			    void *par, struct fb_info_gen *info);static void pm3fb_encode_depth(struct fb_var_screeninfo *var, long d);static int pm3fb_encode_var(struct fb_var_screeninfo *var,			    const void *par, struct fb_info_gen *info);static void pm3fb_get_par(void *par, struct fb_info_gen *info);static void pm3fb_set_par(const void *par, struct fb_info_gen *info);static void pm3fb_set_color(struct pm3fb_info *l_fb_info,			    unsigned char regno, unsigned char r,			    unsigned char g, unsigned char b);static int pm3fb_getcolreg(unsigned regno, unsigned *red, unsigned *green,			   unsigned *blue, unsigned *transp,			   struct fb_info *info);static int pm3fb_setcolreg(unsigned regno, unsigned red, unsigned green,			   unsigned blue, unsigned transp,			   struct fb_info *info);static int pm3fb_blank(int blank_mode, struct fb_info_gen *info);static void pm3fb_set_disp(const void *par, struct display *disp,			   struct fb_info_gen *info);static void pm3fb_detect(void);static int pm3fb_pan_display(const struct fb_var_screeninfo *var,			     struct fb_info_gen *info);static int pm3fb_ioctl(struct inode *inode, struct file *file,                       u_int cmd, u_long arg, int con,		       struct fb_info *info);/* the struct that hold them together */#ifdef KERNEL_2_2struct fbgen_hwswitch pm3fb_switch = {	pm3fb_detect, pm3fb_encode_fix, pm3fb_decode_var, pm3fb_encode_var,	pm3fb_get_par, pm3fb_set_par, pm3fb_getcolreg, pm3fb_setcolreg,	pm3fb_pan_display, pm3fb_blank, pm3fb_set_disp};static struct fb_ops pm3fb_ops = {	pm3fb_open, pm3fb_release,	fbgen_get_fix, fbgen_get_var, fbgen_set_var,	fbgen_get_cmap, fbgen_set_cmap, fbgen_pan_display, pm3fb_ioctl,	    NULL, NULL};#endif /* KERNEL_2_2 */#if (defined KERNEL_2_4) || (defined KERNEL_2_5)struct fbgen_hwswitch pm3fb_switch = {	pm3fb_detect, pm3fb_encode_fix, pm3fb_decode_var, pm3fb_encode_var,	pm3fb_get_par, pm3fb_set_par, pm3fb_getcolreg, pm3fb_setcolreg,	pm3fb_pan_display, pm3fb_blank, pm3fb_set_disp};static struct fb_ops pm3fb_ops = {	THIS_MODULE,	pm3fb_open, pm3fb_release,	fbgen_get_fix, fbgen_get_var, fbgen_set_var,	fbgen_get_cmap, fbgen_set_cmap, fbgen_pan_display, pm3fb_ioctl, NULL, NULL};#endif /* KERNEL_2_4 or KERNEL_2_5 */#ifdef PM3FB_USE_ACCEL#ifdef FBCON_HAS_CFB32static struct display_switch pm3fb_cfb32 = {	fbcon_cfb32_setup, pm3fb_cfbX_bmove, pm3fb_cfb32_clear,	pm3fb_cfbX_putc, pm3fb_cfbX_putcs, pm3fb_cfbX_revc,	NULL /* cursor() */ , NULL /* set_font() */ ,	pm3fb_cfb32_clear_margins,	FONTWIDTHRANGE(1, 16)	/* true only if accelerated... */};#endif /* FBCON_HAS_CFB32 */#ifdef FBCON_HAS_CFB16static struct display_switch pm3fb_cfb16 = {	fbcon_cfb16_setup, pm3fb_cfbX_bmove, pm3fb_cfb16_clear,	pm3fb_cfbX_putc, pm3fb_cfbX_putcs, pm3fb_cfbX_revc,	NULL /* cursor() */ , NULL /* set_font() */ ,	pm3fb_cfb16_clear_margins,	FONTWIDTHRANGE(1, 16)	/* true only if accelerated... */};#endif /* FBCON_HAS_CFB16 */#ifdef FBCON_HAS_CFB8static struct display_switch pm3fb_cfb8 = {	fbcon_cfb8_setup, pm3fb_cfbX_bmove, pm3fb_cfb8_clear,	pm3fb_cfbX_putc, pm3fb_cfbX_putcs, pm3fb_cfbX_revc,	NULL /* cursor() */ , NULL /* set_font() */ ,	pm3fb_cfb8_clear_margins,	FONTWIDTHRANGE(1, 16)	/* true only if accelerated... */};#endif /* FBCON_HAS_CFB8 */#endif /* PM3FB_USE_ACCEL *//* ****************************** *//* ***** card-specific data ***** *//* ****************************** */struct pm3fb_card_timings {	unsigned long memsize; /* 0 for last value (i.e. default) */	struct pm3fb_timings memt;};static struct pm3fb_card_timings t_FormacProFormance3[] = {	{ 16, { 0x02e311b8, 0x06100205, 0x08000002, 0x00000079, 0x00000000} },	{ 0, { 0x02e311b8, 0x06100205, 0x08000002, 0x00000079, 0x00000000} } /* from 16 MB PF3 */};static struct pm3fb_card_timings t_AppianJeronimo2000[] = {	{ 32, { 0x02e311B8, 0x07424905, 0x0c000003, 0x00000061, 0x00000000} },	{ 0, { 0x02e311B8, 0x07424905, 0x0c000003, 0x00000061, 0x00000000} } /* from 32MB J2000 */};static struct pm3fb_card_timings t_3DLabsOxygenVX1[] = {	{ 32, { 0x30e311b8, 0x08501204, 0x08000002, 0x0000006b, 0x00000000} },	{ 0, { 0x30e311b8, 0x08501204, 0x08000002, 0x0000006b, 0x00000000} } /* from 32MB VX1 */};static struct {		char cardname[32]; /* recognized card name */		u16 subvendor; /* subvendor of the card */		u16 subdevice; /* subdevice of the card */		u8  func; /* function of the card to which the extra init apply */		void (*specific_setup)(struct pm3fb_info *l_fb_info); /* card/func specific setup, done before _any_ FB access */	struct pm3fb_card_timings *c_memt; /* defauls timings for the boards */} cardbase[] = {	{ "Unknown Permedia3 board", 0xFFFF, 0xFFFF, 0xFF, NULL, NULL },	{ "Appian Jeronimo 2000 head 1", 0x1097, 0x3d32, 1, NULL,	  t_AppianJeronimo2000	},	{ "Appian Jeronimo 2000 head 2", 0x1097, 0x3d32, 2, pm3fb_j2000_setup,	  t_AppianJeronimo2000	},	{ "Formac ProFormance 3", PCI_VENDOR_ID_3DLABS, 0x000a, 0, NULL, /* Formac use 3DLabs ID ?!? */	  t_FormacProFormance3	},	{ "3DLabs Permedia3 Create!", PCI_VENDOR_ID_3DLABS, 0x0127, 0, NULL, NULL },	{ "3DLabs Oxygen VX1 PCI", PCI_VENDOR_ID_3DLABS, 0x0121, 0, NULL,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -