You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(135) |
Nov
(123) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(244) |
Feb
(72) |
Mar
(221) |
Apr
(91) |
May
(104) |
Jun
(93) |
Jul
(78) |
Aug
(1) |
Sep
(1) |
Oct
(29) |
Nov
(98) |
Dec
(20) |
2003 |
Jan
|
Feb
(21) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(18) |
Sep
(18) |
Oct
(23) |
Nov
(12) |
Dec
(6) |
2004 |
Jan
(2) |
Feb
(32) |
Mar
|
Apr
(12) |
May
(11) |
Jun
(11) |
Jul
|
Aug
(9) |
Sep
|
Oct
(15) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
(2) |
Mar
(11) |
Apr
(6) |
May
(1) |
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(2) |
Mar
|
Apr
(25) |
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
|
Nov
(2) |
Dec
(2) |
2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
(10) |
May
(1) |
Jun
(6) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
From: James S. <jsi...@us...> - 2001-11-20 00:40:55
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv17724 Modified Files: aty128fb.c Log Message: More updates to new API. Index: aty128fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/aty128fb.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- aty128fb.c 2001/11/19 15:38:01 1.11 +++ aty128fb.c 2001/11/20 00:40:52 1.12 @@ -251,8 +251,6 @@ u32 v_total, v_sync_strt_wid; u32 pitch; u32 offset, offset_cntl; - u32 xoffset, yoffset; - u32 vxres, vyres; u32 bpp; }; @@ -301,35 +299,27 @@ /* * Interface used by the world */ - +int aty128fb_init(void); int aty128fb_setup(char *options); +static int aty128fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info); static int aty128fb_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info); +static int aty128fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, + u_int transp, struct fb_info *info); static int aty128fb_pan_display(struct fb_var_screeninfo *var, int con, struct fb_info *fb); - - /* - * Interface to the low level console driver - */ - -int aty128fb_init(void); -static void aty128fbcon_blank(int blank, struct fb_info *fb); +static void aty128fb_blank(int blank, struct fb_info *fb); /* * Internal routines */ static void aty128_set_dispsw(struct display *disp, struct fb_info_aty128 *info, int bpp, int accel); -static int aty128fb_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 int aty128_encode_var(struct fb_var_screeninfo *var, - const struct aty128fb_par *par, - const struct fb_info_aty128 *info); static int aty128_decode_var(struct fb_var_screeninfo *var, struct aty128fb_par *par, - const struct fb_info_aty128 *info); + struct fb_info_aty128 *info); static int aty128_pci_register(struct pci_dev *pdev, const struct aty128_chip_info *aci); static struct fb_info_aty128 *aty128_board_list_add(struct fb_info_aty128 @@ -715,7 +705,6 @@ return -EINVAL; } - /* * CRTC programming */ @@ -747,8 +736,7 @@ struct aty128_crtc *crtc, const struct fb_info_aty128 *info) { - u32 xres, yres, vxres, vyres, xoffset, yoffset, bpp; - u32 left, right, upper, lower, hslen, vslen, sync, vmode; + u32 bpp; u32 h_total, h_disp, h_sync_strt, h_sync_wid, h_sync_pol; u32 v_total, v_disp, v_sync_strt, v_sync_wid, v_sync_pol, c_sync; u32 depth, bytpp; @@ -756,37 +744,8 @@ u8 mode_bytpp[7] = { 0, 0, 1, 2, 2, 3, 4 }; /* input */ - xres = var->xres; - yres = var->yres; - vxres = var->xres_virtual; - vyres = var->yres_virtual; - xoffset = var->xoffset; - yoffset = var->yoffset; bpp = var->bits_per_pixel; - left = var->left_margin; - right = var->right_margin; - upper = var->upper_margin; - lower = var->lower_margin; - hslen = var->hsync_len; - vslen = var->vsync_len; - sync = var->sync; - vmode = var->vmode; - - /* check for mode eligibility - * accept only non interlaced modes */ - if ((vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED) - return -EINVAL; - - /* convert (and round up) and validate */ - xres = (xres + 7) & ~7; - xoffset = (xoffset + 7) & ~7; - if (vxres < xres + xoffset) - vxres = xres + xoffset; - - if (vyres < yres + yoffset) - vyres = yres + yoffset; - /* convert bpp into ATI register depth */ depth = bpp_to_depth(bpp); @@ -800,16 +759,16 @@ bytpp = mode_bytpp[depth]; /* make sure there is enough video ram for the mode */ - if ((u32)(vxres * vyres * bytpp) > info->fb_info.fix.smem_len) { + if ((u32)(var->xres_virtual * var->yres_virtual * bytpp) > info->fb_info.fix.smem_len) { printk(KERN_ERR "aty128fb: Not enough memory for mode\n"); return -EINVAL; } - h_disp = (xres >> 3) - 1; - h_total = (((xres + right + hslen + left) >> 3) - 1) & 0xFFFFL; + h_disp = (var->xres >> 3) - 1; + h_total = (((var->xres + var->right_margin + var->hsync_len + var->left_margin) >> 3) - 1) & 0xFFFFL; - v_disp = yres - 1; - v_total = (yres + upper + vslen + lower - 1) & 0xFFFFL; + v_disp = var->yres - 1; + v_total = (var->yres + var->upper_margin + var->vsync_len + var->lower_margin - 1) & 0xFFFFL; /* check to make sure h_total and v_total are in range */ if (((h_total >> 3) - 1) > 0x1ff || (v_total - 1) > 0x7FF) { @@ -817,26 +776,26 @@ return -EINVAL; } - h_sync_wid = (hslen + 7) >> 3; + h_sync_wid = (var->hsync_len + 7) >> 3; if (h_sync_wid == 0) h_sync_wid = 1; else if (h_sync_wid > 0x3f) /* 0x3f = max hwidth */ h_sync_wid = 0x3f; - h_sync_strt = h_disp + (right >> 3); + h_sync_strt = h_disp + (var->right_margin >> 3); - v_sync_wid = vslen; + v_sync_wid = var->vsync_len; if (v_sync_wid == 0) v_sync_wid = 1; else if (v_sync_wid > 0x1f) /* 0x1f = max vwidth */ v_sync_wid = 0x1f; - v_sync_strt = v_disp + lower; + v_sync_strt = v_disp + var->lower_margin; - h_sync_pol = sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1; - v_sync_pol = sync & FB_SYNC_VERT_HIGH_ACT ? 0 : 1; + h_sync_pol = var->sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1; + v_sync_pol = var->sync & FB_SYNC_VERT_HIGH_ACT ? 0 : 1; - c_sync = sync & FB_SYNC_COMP_HIGH_ACT ? (1 << 4) : 0; + c_sync = var->sync & FB_SYNC_COMP_HIGH_ACT ? (1 << 4) : 0; crtc->gen_cntl = 0x3000000L | c_sync | (depth << 8); @@ -848,138 +807,15 @@ crtc->v_sync_strt_wid = v_sync_strt | (v_sync_wid << 16) | (v_sync_pol << 23); - crtc->pitch = vxres >> 3; + crtc->pitch = var->xres_virtual >> 3; crtc->offset = 0; crtc->offset_cntl = 0; - - crtc->vxres = vxres; - crtc->vyres = vyres; - crtc->xoffset = xoffset; - crtc->yoffset = yoffset; crtc->bpp = bpp; - - return 0; -} - - -static int -aty128_bpp_to_var(int pix_width, struct fb_var_screeninfo *var) -{ - - /* fill in pixel info */ - switch (pix_width) { - case CRTC_PIX_WIDTH_8BPP: - var->bits_per_pixel = 8; - var->red.offset = 0; - var->red.length = 8; - var->green.offset = 0; - var->green.length = 8; - var->blue.offset = 0; - var->blue.length = 8; - var->transp.offset = 0; - var->transp.length = 0; - break; - case CRTC_PIX_WIDTH_15BPP: - case CRTC_PIX_WIDTH_16BPP: - var->bits_per_pixel = 16; - var->red.offset = 10; - var->red.length = 5; - var->green.offset = 5; - var->green.length = 5; - var->blue.offset = 0; - var->blue.length = 5; - var->transp.offset = 0; - var->transp.length = 0; - break; - case CRTC_PIX_WIDTH_24BPP: - var->bits_per_pixel = 24; - var->red.offset = 16; - var->red.length = 8; - var->green.offset = 8; - var->green.length = 8; - var->blue.offset = 0; - var->blue.length = 8; - var->transp.offset = 0; - var->transp.length = 0; - break; - case CRTC_PIX_WIDTH_32BPP: - var->bits_per_pixel = 32; - var->red.offset = 16; - var->red.length = 8; - var->green.offset = 8; - var->green.length = 8; - var->blue.offset = 0; - var->blue.length = 8; - var->transp.offset = 24; - var->transp.length = 8; - break; - default: - printk(KERN_ERR "aty128fb: Invalid pixel width\n"); - return -EINVAL; - } - return 0; } -static int -aty128_crtc_to_var(const struct aty128_crtc *crtc, - struct fb_var_screeninfo *var) -{ - u32 xres, yres, left, right, upper, lower, hslen, vslen, sync; - u32 h_total, h_disp, h_sync_strt, h_sync_dly, h_sync_wid, h_sync_pol; - u32 v_total, v_disp, v_sync_strt, v_sync_wid, v_sync_pol, c_sync; - u32 pix_width; - - /* fun with masking */ - h_total = crtc->h_total & 0x1ff; - h_disp = (crtc->h_total >> 16) & 0xff; - h_sync_strt = (crtc->h_sync_strt_wid >> 3) & 0x1ff; - h_sync_dly = crtc->h_sync_strt_wid & 0x7; - h_sync_wid = (crtc->h_sync_strt_wid >> 16) & 0x3f; - h_sync_pol = (crtc->h_sync_strt_wid >> 23) & 0x1; - v_total = crtc->v_total & 0x7ff; - v_disp = (crtc->v_total >> 16) & 0x7ff; - v_sync_strt = crtc->v_sync_strt_wid & 0x7ff; - v_sync_wid = (crtc->v_sync_strt_wid >> 16) & 0x1f; - v_sync_pol = (crtc->v_sync_strt_wid >> 23) & 0x1; - c_sync = crtc->gen_cntl & CRTC_CSYNC_EN ? 1 : 0; - pix_width = crtc->gen_cntl & CRTC_PIX_WIDTH_MASK; - - /* do conversions */ - xres = (h_disp + 1) << 3; - yres = v_disp + 1; - left = ((h_total - h_sync_strt - h_sync_wid) << 3) - h_sync_dly; - right = ((h_sync_strt - h_disp) << 3) + h_sync_dly; - hslen = h_sync_wid << 3; - upper = v_total - v_sync_strt - v_sync_wid; - lower = v_sync_strt - v_disp; - vslen = v_sync_wid; - sync = (h_sync_pol ? 0 : FB_SYNC_HOR_HIGH_ACT) | - (v_sync_pol ? 0 : FB_SYNC_VERT_HIGH_ACT) | - (c_sync ? FB_SYNC_COMP_HIGH_ACT : 0); - - aty128_bpp_to_var(pix_width, var); - - var->xres = xres; - var->yres = yres; - var->xres_virtual = crtc->vxres; - var->yres_virtual = crtc->vyres; - var->xoffset = crtc->xoffset; - var->yoffset = crtc->yoffset; - var->left_margin = left; - var->right_margin = right; - var->upper_margin = upper; - var->lower_margin = lower; - var->hsync_len = hslen; - var->vsync_len = vslen; - var->sync = sync; - var->vmode = FB_VMODE_NONINTERLACED; - - return 0; -} - static void aty128_set_pll(struct aty128fb_par *par, const struct fb_info_aty128 *info) { @@ -1023,7 +859,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128fb_par *par, - const struct fb_info_aty128 *info) + struct fb_info_aty128 *info) { const struct aty128_constants c = info->constants; unsigned char post_dividers[] = {1,2,4,8,3,6,12}; @@ -1056,25 +892,16 @@ pll->feedback_divider = round_div(n, d); pll->vclk = vclk; + info->fb_info.var.pixclock = 100000000 / pll->vclk; + DBG("post %d feedback %d vlck %d output %d ref_divider %d " "vclk_per: %d\n", pll->post_divider, pll->feedback_divider, vclk, output_freq, c.ref_divider, period_in_ps); - return 0; } -static int -aty128_pll_to_var(const struct aty128_pll *pll, struct fb_var_screeninfo *var, - const struct fb_info_aty128 *info) -{ - var->pixclock = 100000000 / pll->vclk; - - return 0; -} - - static void aty128_set_fifo(const struct aty128_ddafifo *dsp, const struct fb_info_aty128 *info) @@ -1141,7 +968,98 @@ return 0; } +static int +aty128fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) +{ + /* basic (in)sanity checks */ + if (!var->xres) + var->xres = 1; + if (!var->yres) + var->yres = 1; + if (var->xres > var->xres_virtual) + var->xres_virtual = var->xres; + if (var->yres > var->yres_virtual) + var->yres_virtual = var->yres; + + switch (var->bits_per_pixel) { + case 0 ... 8: + var->bits_per_pixel = 8; + var->red.offset = 0; + var->red.length = 8; + var->green.offset = 0; + var->green.length = 8; + var->blue.offset = 0; + var->blue.length = 8; + var->transp.offset = 0; + var->transp.length = 0; + break; + case 9 ... 16: + var->bits_per_pixel = 16; + var->red.offset = 10; + var->red.length = 5; + var->green.offset = 5; + var->green.length = 5; + var->blue.offset = 0; + var->blue.length = 5; + var->transp.offset = 0; + var->transp.length = 0; + break; + case 17 ... 24: + var->bits_per_pixel = 24; + var->red.offset = 16; + var->red.length = 8; + var->green.offset = 8; + var->green.length = 8; + var->blue.offset = 0; + var->blue.length = 8; + var->transp.offset = 0; + var->transp.length = 0; + break; + case 25 ... 32: + var->bits_per_pixel = 32; + var->red.offset = 16; + var->red.length = 8; + var->green.offset = 8; + var->green.length = 8; + var->blue.offset = 0; + var->blue.length = 8; + var->transp.offset = 24; + var->transp.length = 8; + break; + default: + printk(KERN_ERR "aty128fb: Invalid pixel width\n"); + return -EINVAL; + } + + /* check for mode eligibility + * accept only non interlaced modes */ + if ((var->vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED) + return -EINVAL; + + /* convert (and round up) and validate */ + var->xres = (var->xres + 7) & ~7; + var->xoffset = (var->xoffset + 7) & ~7; + + if (var->xres_virtual < var->xres + var->xoffset) + var->xres_virtual = var->xres + var->xoffset; + if (var->yres_virtual < var->yres + var->yoffset) + var->yres_virtual = var->yres + var->yoffset; + + var->red.msb_right = 0; + var->green.msb_right = 0; + var->blue.msb_right = 0; + var->transp.msb_right = 0; + + var->nonstd = 0; + var->activate = 0; + + var->height = -1; + var->width = -1; + var->accel_flags = FB_ACCELF_TEXT; + return 0; +} + /* * This actually sets the video mode. */ @@ -1199,8 +1117,7 @@ display_info.height = ((par->crtc.v_total >> 16) & 0x7ff) + 1; display_info.width = (((par->crtc.h_total >> 16) & 0xff) + 1) << 3; display_info.depth = par->crtc.bpp; - display_info.pitch = (par->crtc.vxres * par->crtc.bpp) >> 3; - aty128_encode_var(&var, par, info); + display_info.pitch = (info->fb_info.var.xres_virtual * par->crtc.bpp) >> 3; if (mac_var_to_vmode(&var, &vmode, &cmode)) display_info.mode = 0; else @@ -1220,7 +1137,7 @@ static int aty128_decode_var(struct fb_var_screeninfo *var, struct aty128fb_par *par, - const struct fb_info_aty128 *info) + struct fb_info_aty128 *info) { int err; @@ -1236,34 +1153,6 @@ return 0; } - -static int -aty128_encode_var(struct fb_var_screeninfo *var, - const struct aty128fb_par *par, - const struct fb_info_aty128 *info) -{ - int err; - - if ((err = aty128_crtc_to_var(&par->crtc, var))) - return err; - - if ((err = aty128_pll_to_var(&par->pll, var, info))) - return err; - - var->red.msb_right = 0; - var->green.msb_right = 0; - var->blue.msb_right = 0; - var->transp.msb_right = 0; - - var->nonstd = 0; - var->activate = 0; - - var->height = -1; - var->width = -1; - var->accel_flags = FB_ACCELF_TEXT; - return 0; -} - /* * Set the User Defined Part of the Display */ @@ -1279,38 +1168,11 @@ display = (con >= 0) ? &fb_display[con] : fb->disp; - /* basic (in)sanity checks */ - if (!var->xres) - var->xres = 1; - if (!var->yres) - var->yres = 1; - if (var->xres > var->xres_virtual) - var->xres_virtual = var->xres; - if (var->yres > var->yres_virtual) - var->yres_virtual = var->yres; - - switch (var->bits_per_pixel) { - case 0 ... 8: - var->bits_per_pixel = 8; - break; - case 9 ... 16: - var->bits_per_pixel = 16; - break; - case 17 ... 24: - var->bits_per_pixel = 24; - break; - case 25 ... 32: - var->bits_per_pixel = 32; - break; - default: - return -EINVAL; - } - + aty128fb_check_var(var, &info->fb_info); + if ((err = aty128_decode_var(var, &par, info))) return err; - aty128_encode_var(var, &par, info); - if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_NOW) return 0; @@ -1325,7 +1187,7 @@ oldvxres != var->xres_virtual || oldvyres != var->yres_virtual || oldbpp != var->bits_per_pixel || oldaccel != var->accel_flags) { - info->fb_info.fix.line_length = (par.crtc.vxres * par.crtc.bpp) >> 3; + info->fb_info.fix.line_length = (var->xres_virtual * par.crtc.bpp) >> 3; info->fb_info.fix.visual = par.crtc.bpp <= 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; display->screen_base = info->fb_info.screen_base; @@ -1348,6 +1210,7 @@ if (info->fb_info.changevar) (*info->fb_info.changevar)(con); + info->fb_info.par = ∥ } if (!info->fb_info.display_fg || info->fb_info.display_fg->vc_num == con) @@ -1418,13 +1281,13 @@ xoffset = (var->xoffset +7) & ~7; yoffset = var->yoffset; - if (xoffset+xres > par->crtc.vxres || yoffset+yres > par->crtc.vyres) + if (xoffset+xres > info->fb_info.var.xres_virtual || yoffset+yres > info->fb_info.var.yres_virtual) return -EINVAL; - par->crtc.xoffset = xoffset; - par->crtc.yoffset = yoffset; + info->fb_info.var.xoffset = xoffset; + info->fb_info.var.yoffset = yoffset; - offset = ((yoffset * par->crtc.vxres + xoffset) * par->crtc.bpp) >> 6; + offset = ((yoffset * info->fb_info.var.xres_virtual + xoffset) * par->crtc.bpp) >> 6; aty_st_le32(CRTC_OFFSET, offset); @@ -1529,7 +1392,7 @@ info->fb_info.changevar = NULL; info->fb_info.switch_con = &fbgen_switch; info->fb_info.updatevar = NULL; - info->fb_info.blank = &aty128fbcon_blank; + info->fb_info.blank = &aty128fb_blank; info->fb_info.flags = FBINFO_FLAG_DEFAULT; var = default_var; @@ -1932,7 +1795,7 @@ * Blank the display. */ static void -aty128fbcon_blank(int blank, struct fb_info *fb) +aty128fb_blank(int blank, struct fb_info *fb) { struct fb_info_aty128 *info = (struct fb_info_aty128 *)fb; u8 state = 0; @@ -2049,7 +1912,6 @@ return 0; } - static void do_install_cmap(int con, struct fb_info *info) { @@ -2393,7 +2255,6 @@ printk(KERN_INFO "aty128fb: Parameter NOMTRR set\n"); } #endif - aty128fb_init(); return 0; } |
From: James S. <jsi...@us...> - 2001-11-19 15:38:05
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv17708 Modified Files: aty128fb.c Log Message: More changes to new api. Still more to do. Index: aty128fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/aty128fb.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- aty128fb.c 2001/11/17 00:51:01 1.10 +++ aty128fb.c 2001/11/19 15:38:01 1.11 @@ -269,9 +269,16 @@ /* register values for a specific mode */ struct aty128fb_par { +#ifdef CONFIG_MTRR + struct { int vram; int vram_valid; } mtrr; +#endif + struct aty128_ddafifo fifo_reg; struct aty128_crtc crtc; struct aty128_pll pll; - struct aty128_ddafifo fifo_reg; +#ifdef CONFIG_PCI + struct pci_dev *pdev; +#endif + int chip_gen; }; struct fb_info_aty128 { @@ -279,14 +286,7 @@ struct fb_info_aty128 *next; struct aty128_constants constants; /* PLL and others */ void *regbase; /* remapped mmio */ - int chip_gen; const struct aty128_meminfo *mem; /* onboard mem info */ -#ifdef CONFIG_PCI - struct pci_dev *pdev; -#endif -#ifdef CONFIG_MTRR - struct { int vram; int vram_valid; } mtrr; -#endif int blitter_may_be_busy; int fifo_slots; /* free slots in FIFO (64 max) */ }; @@ -321,8 +321,6 @@ */ static void aty128_set_dispsw(struct display *disp, struct fb_info_aty128 *info, int bpp, int accel); -static int aty128_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue, - u_int *transp, struct fb_info *info); static int aty128fb_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); @@ -983,8 +981,9 @@ } static void -aty128_set_pll(struct aty128_pll *pll, const struct fb_info_aty128 *info) +aty128_set_pll(struct aty128fb_par *par, const struct fb_info_aty128 *info) { + struct aty128_pll *pll = &par->pll; u32 div3; unsigned char post_conv[] = /* register values for post dividers */ @@ -1023,11 +1022,12 @@ static int -aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, +aty128_var_to_pll(u32 period_in_ps, struct aty128fb_par *par, const struct fb_info_aty128 *info) { const struct aty128_constants c = info->constants; unsigned char post_dividers[] = {1,2,4,8,3,6,12}; + struct aty128_pll *pll = &par->pll; u32 output_freq; u32 vclk; /* in .01 MHz */ int i; @@ -1085,17 +1085,16 @@ static int -aty128_ddafifo(struct aty128_ddafifo *dsp, - const struct aty128_pll *pll, - u32 bpp, - const struct fb_info_aty128 *info) +aty128_ddafifo(struct aty128fb_par *par, const struct fb_info_aty128 *info) { const struct aty128_meminfo *m = info->mem; + struct aty128_ddafifo *dsp = &par->fifo_reg; + const struct aty128_pll *pll = &par->pll; u32 xclk = info->constants.xclk; u32 fifo_width = info->constants.fifo_width; u32 fifo_depth = info->constants.fifo_depth; s32 x, b, p, ron, roff; - u32 n, d; + u32 n, d, bpp = par->crtc.bpp; /* 15bpp is really 16bpp */ if (bpp == 15) @@ -1174,7 +1173,7 @@ aty_st_8(CRTC_EXT_CNTL + 1, 4); /* turn video off */ aty128_set_crtc(&par->crtc, info); - aty128_set_pll(&par->pll, info); + aty128_set_pll(par, info); aty128_set_fifo(&par->fifo_reg, info); config = aty_ld_le32(CONFIG_CNTL) & ~3; @@ -1228,10 +1227,10 @@ if ((err = aty128_var_to_crtc(var, &par->crtc, info))) return err; - if ((err = aty128_var_to_pll(var->pixclock, &par->pll, info))) + if ((err = aty128_var_to_pll(var->pixclock, par, info))) return err; - if ((err = aty128_ddafifo(&par->fifo_reg, &par->pll, par->crtc.bpp, info))) + if ((err = aty128_ddafifo(par, info))) return err; return 0; @@ -1495,7 +1494,7 @@ */ static int __init -aty128_init(struct fb_info_aty128 *info, const char *name) +aty128_init(struct fb_info_aty128 *info, struct pci_dev *pdev, const char *name) { struct fb_var_screeninfo var; u32 dac; @@ -1510,9 +1509,9 @@ chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F; /* put a name with the face */ - while (aci->name && info->pdev->device != aci->device) { aci++; } + while (aci->name && pdev->device != aci->device) { aci++; } video_card = (char *)aci->name; - info->chip_gen = aci->chip_gen; + default_par.chip_gen = aci->chip_gen; printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev); @@ -1588,7 +1587,7 @@ #ifdef CONFIG_PMAC_BACKLIGHT /* Could be extended to Rage128Pro LVDS output too */ - if (info->chip_gen == rage_M3) + if (default_par.chip_gen == rage_M3) register_backlight_controller(&aty128_backlight_controller, info, "ati"); #endif /* CONFIG_PMAC_BACKLIGHT */ @@ -1682,7 +1681,7 @@ memset(info, 0, sizeof(struct fb_info_aty128)); /* Copy PCI device info into info->pdev */ - info->pdev = pdev; + default_par.pdev = pdev; info->fb_info.currcon = -1; @@ -1727,14 +1726,14 @@ info->fb_info.pseudo_palette = &aty128fb_pseudo_palette; aty128_timings(info); - if (!aty128_init(info, "PCI")) + if (!aty128_init(info, pdev, "PCI")) goto err_out; #ifdef CONFIG_MTRR if (mtrr) { - info->mtrr.vram = mtrr_add(info->fb_info.fix.smem_start, + default_par.mtrr.vram = mtrr_add(info->fb_info.fix.smem_start, info->fb_info.fix.smem_len, MTRR_TYPE_WRCOMB, 1); - info->mtrr.vram_valid = 1; + default_par.mtrr.vram_valid = 1; /* let there be speed */ printk(KERN_INFO "aty128fb: Rage128 MTRR set to ON\n"); } @@ -1986,7 +1985,7 @@ if ((par->crtc.bpp > 8) && (regno == 0)) { int i; - if (info->chip_gen == rage_M3) + if (par->chip_gen == rage_M3) aty_st_le32(DAC_CNTL, aty_ld_le32(DAC_CNTL) & ~DAC_PALETTE_ACCESS_CNTL); for (i=16; i<256; i++) { @@ -1995,7 +1994,7 @@ aty_st_le32(PALETTE_DATA, col); } - if (info->chip_gen == rage_M3) { + if (par->chip_gen == rage_M3) { aty_st_le32(DAC_CNTL, aty_ld_le32(DAC_CNTL) | DAC_PALETTE_ACCESS_CNTL); for (i=16; i<256; i++) { @@ -2007,7 +2006,7 @@ } /* initialize palette */ - if (info->chip_gen == rage_M3) + if (par->chip_gen == rage_M3) aty_st_le32(DAC_CNTL, aty_ld_le32(DAC_CNTL) & ~DAC_PALETTE_ACCESS_CNTL); if (par->crtc.bpp == 16) @@ -2016,7 +2015,7 @@ aty_st_8(PALETTE_INDEX, regno); col = (red << 16) | (green << 8) | blue; aty_st_le32(PALETTE_DATA, col); - if (info->chip_gen == rage_M3) { + if (par->chip_gen == rage_M3) { aty_st_le32(DAC_CNTL, aty_ld_le32(DAC_CNTL) | DAC_PALETTE_ACCESS_CNTL); if (par->crtc.bpp == 16) aty_st_8(PALETTE_INDEX, (regno << 3)); @@ -2403,6 +2402,7 @@ cleanup_module(void) { struct fb_info_aty128 *info = board_list; + struct aty128fb_par *par = info->fb_info.par; while (board_list) { info = board_list; @@ -2410,20 +2410,19 @@ unregister_framebuffer(&info->fb_info); #ifdef CONFIG_MTRR - if (info->mtrr.vram_valid) - mtrr_del(info->mtrr.vram, info->fb_info.fix.smem_start, + if (par->mtrr.vram_valid) + mtrr_del(par->mtrr.vram, info->fb_info.fix.smem_start, info->fb_info.fix.smem_len); #endif /* CONFIG_MTRR */ iounmap(info->regbase); iounmap(info->fb_info.screen_base); - - release_mem_region(pci_resource_start(info->pdev, 0), - pci_resource_len(info->pdev, 0)); - release_mem_region(pci_resource_start(info->pdev, 1), - pci_resource_len(info->pdev, 1)); - release_mem_region(pci_resource_start(info->pdev, 2), - pci_resource_len(info->pdev, 2)); + release_mem_region(pci_resource_start(par->pdev, 0), + pci_resource_len(par->pdev, 0)); + release_mem_region(pci_resource_start(par->pdev, 1), + pci_resource_len(par->pdev, 1)); + release_mem_region(pci_resource_start(par->pdev, 2), + pci_resource_len(par->pdev, 2)); kfree(info); } } |
From: johann d. <jd...@us...> - 2001-11-17 10:43:55
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv753 Modified Files: Config.in Log Message: Removed CONFIG_INPUT_IFORCE_FF. It is not used, and the force feedback code can hardly be disabled in iforce*.c files anyway. Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/Config.in,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- Config.in 2001/11/13 23:30:29 1.57 +++ Config.in 2001/11/17 10:43:52 1.58 @@ -43,9 +43,6 @@ tristate ' SpaceTec SpaceBall 2003/3003/4000 FLX 6dof controllers' CONFIG_INPUT_SPACEBALL tristate ' Gravis Stinger gamepad' CONFIG_INPUT_STINGER tristate ' I-Force joysticks/wheels' CONFIG_INPUT_IFORCE_232 - if [ "$CONFIG_INPUT_IFORCE_232" != "n" ]; then - bool ' I-Force force feedback (EXPERIMENTAL)' CONFIG_INPUT_IFORCE_FF - fi tristate ' Gunze AHL-51S touchscreen' CONFIG_INPUT_GUNZE tristate ' Newton keyboard' CONFIG_INPUT_NEWTON if [ "$CONFIG_SA1100_BITSY" = "y" ]; then @@ -96,9 +93,6 @@ fi tristate ' Wacom Intuos/Graphire tablet' CONFIG_INPUT_WACOMUSB tristate ' I-Force joysticks/wheels' CONFIG_INPUT_IFORCE_USB - if [ "$CONFIG_INPUT_IFORCE_USB" != "n" ]; then - bool ' I-Force force feedback (EXPERIMENTAL)' CONFIG_INPUT_IFORCE_FF - fi fi if [ "$CONFIG_ADB" = "y" ]; then |
From: James S. <jsi...@us...> - 2001-11-17 00:51:04
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv25513 Modified Files: aty128fb.c Log Message: Almost complete with the sync to the new fb api. Index: aty128fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/aty128fb.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- aty128fb.c 2001/11/16 00:53:56 1.9 +++ aty128fb.c 2001/11/17 00:51:01 1.10 @@ -272,7 +272,6 @@ struct aty128_crtc crtc; struct aty128_pll pll; struct aty128_ddafifo fifo_reg; - u32 accel_flags; }; struct fb_info_aty128 { @@ -282,18 +281,6 @@ void *regbase; /* remapped mmio */ int chip_gen; const struct aty128_meminfo *mem; /* onboard mem info */ - struct { u8 red, green, blue, pad; } palette[256]; - union { -#ifdef FBCON_HAS_CFB16 - u16 cfb16[16]; -#endif -#ifdef FBCON_HAS_CFB24 - u32 cfb24[16]; -#endif -#ifdef FBCON_HAS_CFB32 - u32 cfb32[16]; -#endif - } fbcon_cmap; #ifdef CONFIG_PCI struct pci_dev *pdev; #endif @@ -305,6 +292,7 @@ }; static struct fb_info_aty128 *board_list = NULL; +static u32 aty128fb_pseudo_palette[17]; static struct display disp; static struct aty128fb_par default_par; @@ -316,27 +304,16 @@ int aty128fb_setup(char *options); -static int aty128fb_get_fix(struct fb_fix_screeninfo *fix, int con, - struct fb_info *info); -static int aty128fb_get_var(struct fb_var_screeninfo *var, int con, - struct fb_info *info); static int aty128fb_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info); -static int aty128fb_get_cmap(struct fb_cmap *cmap, int kspc, int con, - struct fb_info *info); -static int aty128fb_set_cmap(struct fb_cmap *cmap, int kspc, int con, - struct fb_info *info); static int aty128fb_pan_display(struct fb_var_screeninfo *var, int con, struct fb_info *fb); -static int aty128fb_rasterimg(struct fb_info *info, int start); - /* * Interface to the low level console driver */ int aty128fb_init(void); -static int aty128fbcon_switch(int con, struct fb_info *fb); static void aty128fbcon_blank(int blank, struct fb_info *fb); /* @@ -346,7 +323,7 @@ struct fb_info_aty128 *info, int bpp, int accel); static int aty128_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue, u_int *transp, struct fb_info *info); -static int aty128_setcolreg(u_int regno, u_int red, u_int green, u_int blue, +static int aty128fb_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 int aty128_encode_var(struct fb_var_screeninfo *var, @@ -409,13 +386,13 @@ static struct fb_ops aty128fb_ops = { owner: THIS_MODULE, - fb_get_fix: aty128fb_get_fix, - fb_get_var: aty128fb_get_var, + fb_setcolreg: aty128fb_setcolreg, + fb_get_fix: fbgen_get_fix, + fb_get_var: fbgen_get_var, fb_set_var: aty128fb_set_var, - fb_get_cmap: aty128fb_get_cmap, - fb_set_cmap: aty128fb_set_cmap, + fb_get_cmap: fbgen_get_cmap, + fb_set_cmap: fbgen_set_cmap, fb_pan_display: aty128fb_pan_display, - fb_rasterimg: aty128fb_rasterimg, }; #ifdef CONFIG_PMAC_BACKLIGHT @@ -1212,7 +1189,7 @@ aty_st_le32(CONFIG_CNTL, config); aty_st_8(CRTC_EXT_CNTL + 1, 0); /* turn the video back on */ - if (par->accel_flags & FB_ACCELF_TEXT) + if (info->fb_info.var.accel_flags & FB_ACCELF_TEXT) aty128_init_engine(par, info); #ifdef CONFIG_FB_COMPAT_XPMAC @@ -1257,11 +1234,6 @@ if ((err = aty128_ddafifo(&par->fifo_reg, &par->pll, par->crtc.bpp, info))) return err; - if (var->accel_flags & FB_ACCELF_TEXT) - par->accel_flags = FB_ACCELF_TEXT; - else - par->accel_flags = 0; - return 0; } @@ -1289,27 +1261,11 @@ var->height = -1; var->width = -1; - var->accel_flags = par->accel_flags; - + var->accel_flags = FB_ACCELF_TEXT; return 0; } - /* - * Get the User Defined Part of the Display - */ - -static int -aty128fb_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *fb) -{ - const struct fb_info_aty128 *info = (struct fb_info_aty128 *)fb; - - *var = info->fb_info.var; - return 0; -} - - - /* * Set the User Defined Part of the Display */ @@ -1365,7 +1321,7 @@ oldvyres = display->var.yres_virtual; oldbpp = display->var.bits_per_pixel; oldaccel = display->var.accel_flags; - display->var = *var; + display->var = info->fb_info.var = *var; if (oldxres != var->xres || oldyres != var->yres || oldvxres != var->xres_virtual || oldvyres != var->yres_virtual || oldbpp != var->bits_per_pixel || oldaccel != var->accel_flags) { @@ -1422,19 +1378,19 @@ case 15: case 16: disp->dispsw = accel ? &fbcon_aty128_16 : &fbcon_cfb16; - disp->dispsw_data = info->fbcon_cmap.cfb16; + disp->dispsw_data = info->fb_info.pseudo_palette; break; #endif #ifdef FBCON_HAS_CFB24 case 24: disp->dispsw = accel ? &fbcon_aty128_24 : &fbcon_cfb24; - disp->dispsw_data = info->fbcon_cmap.cfb24; + disp->dispsw_data = info->fb_info.pseudo_palette; break; #endif #ifdef FBCON_HAS_CFB32 case 32: disp->dispsw = accel ? &fbcon_aty128_32 : &fbcon_cfb32; - disp->dispsw_data = info->fbcon_cmap.cfb32; + disp->dispsw_data = info->fb_info.pseudo_palette; break; #endif default: @@ -1443,19 +1399,6 @@ } /* - * Get the Fixed Part of the Display - */ -static int -aty128fb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *fb) -{ - const struct fb_info_aty128 *info = (struct fb_info_aty128 *)fb; - - *fix = info->fb_info.fix; - return 0; -} - - - /* * Pan or Wrap the Display * * Not supported (yet!) @@ -1489,77 +1432,6 @@ return 0; } - - /* - * Get the Colormap - */ - -static int -aty128fb_get_cmap(struct fb_cmap *cmap, int kspc, int con, - struct fb_info *info) -{ -#if 1 - fb_copy_cmap(&info->cmap, cmap, kspc ? 0 : 2); -#else - struct fb_info_aty128 fb = (struct fb_info_aty128 *)info; - - if (con == fb->fb_info.currcon) /* current console? */ - return fb_get_cmap(cmap, kspc, aty128_getcolreg, info); - else 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 <= 8) ? 256 : 32; - fb_copy_cmap(fb_default_cmap(size), cmap, kspc ? 0 : 2); - } -#endif - - return 0; -} - - /* - * Set the Colormap - */ - -static int -aty128fb_set_cmap(struct fb_cmap *cmap, int kspc, int con, - struct fb_info *info) -{ - int err; - struct fb_info_aty128 *fb = (struct fb_info_aty128 *)info; - struct display *disp; - - if (con >= 0) - disp = &fb_display[con]; - else - disp = info->disp; - - if (!disp->cmap.len) { /* no colormap allocated? */ - int size = (disp->var.bits_per_pixel <= 8) ? 256 : 32; - if ((err = fb_alloc_cmap(&disp->cmap, size, 0))) - return err; - } - - if (con == fb->fb_info.currcon) /* current console? */ - return fb_set_cmap(cmap, kspc, aty128_setcolreg, info); - else - fb_copy_cmap(cmap, &disp->cmap, kspc ? 0 : 1); - - return 0; -} - - -static int -aty128fb_rasterimg(struct fb_info *info, int start) -{ - struct fb_info_aty128 *fb = (struct fb_info_aty128 *)info; - - if (fb->blitter_may_be_busy) - wait_for_idle(fb); - - return 0; -} - - int __init aty128fb_setup(char *options) { @@ -1627,7 +1499,6 @@ { struct fb_var_screeninfo var; u32 dac; - int j, k; u8 chip_rev; const struct aty128_chip_info *aci = &aty128_pci_probe_list[0]; char *video_card = "Rage128"; @@ -1657,7 +1528,7 @@ info->fb_info.disp = &disp; strcpy(info->fb_info.fontname, fontname); info->fb_info.changevar = NULL; - info->fb_info.switch_con = &aty128fbcon_switch; + info->fb_info.switch_con = &fbgen_switch; info->fb_info.updatevar = NULL; info->fb_info.blank = &aty128fbcon_blank; info->fb_info.flags = FBINFO_FLAG_DEFAULT; @@ -1698,14 +1569,6 @@ info->fb_info.par = &default_par; - /* load up the palette with default colors */ - for (j = 0; j < 16; j++) { - k = color_table[j]; - info->palette[j].red = default_red[k]; - info->palette[j].green = default_grn[k]; - info->palette[j].blue = default_blu[k]; - } - /* setup the DAC the way we like it */ dac = aty_ld_le32(DAC_CNTL); dac |= (DAC_8BIT_EN | DAC_RANGE_CNTL); @@ -1861,6 +1724,7 @@ aty128_get_pllinfo(info, bios_seg); } #endif + info->fb_info.pseudo_palette = &aty128fb_pseudo_palette; aty128_timings(info); if (!aty128_init(info, "PCI")) @@ -2065,33 +1929,6 @@ } } - -static int -aty128fbcon_switch(int con, struct fb_info *fb) -{ - struct fb_info_aty128 *info = (struct fb_info_aty128 *)fb; - struct aty128fb_par par; - - /* Do we have to save the colormap? */ - if (fb_display[info->fb_info.currcon].cmap.len) - fb_get_cmap(&fb_display[info->fb_info.currcon].cmap, 1, - aty128_getcolreg, fb); - - /* set the current console */ - info->fb_info.currcon = con; - - aty128_decode_var(&fb_display[con].var, &par, info); - aty128_set_par(&par, info); - - aty128_set_dispsw(&fb_display[con], info, par.crtc.bpp, - par.accel_flags & FB_ACCELF_TEXT); - - do_install_cmap(con, fb); - - return 1; -} - - /* * Blank the display. */ @@ -2121,35 +1958,13 @@ #endif /* CONFIG_PMAC_BACKLIGHT */ } - - /* - * Read a single color register and split it into - * colors/transparent. Return != 0 for invalid regno. - */ -static int -aty128_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue, - u_int *transp, struct fb_info *fb) -{ - struct fb_info_aty128 *info = (struct fb_info_aty128 *) fb; - - if (regno > 255) - return 1; - - *red = (info->palette[regno].red<<8) | info->palette[regno].red; - *green = (info->palette[regno].green<<8) | info->palette[regno].green; - *blue = (info->palette[regno].blue<<8) | info->palette[regno].blue; - *transp = 0; - - return 0; -} - /* * Set a single color register. The values supplied are already * rounded down to the hardware's capabilities (according to the * entries in the var structure). Return != 0 for invalid regno. */ static int -aty128_setcolreg(u_int regno, u_int red, u_int green, u_int blue, +aty128fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *fb) { struct fb_info_aty128 *info = (struct fb_info_aty128 *)fb; @@ -2162,9 +1977,6 @@ red >>= 8; green >>= 8; blue >>= 8; - info->palette[regno].red = red; - info->palette[regno].green = green; - info->palette[regno].blue = blue; /* Note: For now, on M3, we set palette on both heads, which may * be useless. Can someone with a M3 check this ? */ @@ -2195,7 +2007,6 @@ } /* initialize palette */ - if (info->chip_gen == rage_M3) aty_st_le32(DAC_CNTL, aty_ld_le32(DAC_CNTL) & ~DAC_PALETTE_ACCESS_CNTL); @@ -2218,14 +2029,12 @@ switch (par->crtc.bpp) { #ifdef FBCON_HAS_CFB16 case 9 ... 16: - info->fbcon_cmap.cfb16[regno] = (regno << 10) | (regno << 5) | - regno; + ((u16*)(info->fb_info.pseudo_palette))[regno] = (regno << 10) | (regno << 5) | regno; break; #endif #ifdef FBCON_HAS_CFB24 case 17 ... 24: - info->fbcon_cmap.cfb24[regno] = (regno << 16) | (regno << 8) | - regno; + ((u32*)(info->fb_info.pseudo_palette))[regno] = (regno << 16) | (regno << 8) | regno; break; #endif #ifdef FBCON_HAS_CFB32 @@ -2233,7 +2042,7 @@ u32 i; i = (regno << 8) | regno; - info->fbcon_cmap.cfb32[regno] = (i << 16) | i; + ((u16*)(info->fb_info.pseudo_palette))[regno] = (i << 16) | i; break; } #endif @@ -2251,10 +2060,10 @@ return; if (fb_display[con].cmap.len) - fb_set_cmap(&fb_display[con].cmap, 1, aty128_setcolreg, info); + fb_set_cmap(&fb_display[con].cmap, 1, aty128fb_setcolreg, info); else { int size = (fb_display[con].var.bits_per_pixel <= 8) ? 256 : 16; - fb_set_cmap(fb_default_cmap(size), 1, aty128_setcolreg, info); + fb_set_cmap(fb_default_cmap(size), 1, aty128fb_setcolreg, info); } } |
From: James S. <jsi...@us...> - 2001-11-16 19:11:27
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv7035 Added Files: cerf_keyb.c Log Message: Added intial port of CERF keybaord driver. Need to conver to input api. --- NEW FILE: cerf_keyb.c --- /* cerf_keyb.c: This is the end. Daniel is writing a device driver!!! */ #include <linux/config.h> #include <linux/spinlock.h> #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/tty.h> #include <linux/mm.h> #include <linux/signal.h> #include <linux/init.h> #include <linux/kbd_ll.h> #include <linux/delay.h> #include <linux/random.h> #include <linux/poll.h> #include <linux/miscdevice.h> #include <linux/slab.h> #include <linux/kbd_kern.h> #include <linux/smp_lock.h> #include <linux/timer.h> #include <asm/keyboard.h> #include <asm/bitops.h> #include <asm/uaccess.h> #include <asm/irq.h> #include <asm/system.h> #include <asm/io.h> #define KBD_REPORT_UNKN #define KBD_REPORT_ERR /* Report keyboard errors */ #define KBD_REPORT_UNKN /* Report unknown scan codes */ #define KBD_REPORT_TIMEOUTS /* Report keyboard timeouts */ #define KBD_NO_DATA (-1) /* No data */ #define KBD_REPEAT_START (0x20) #define KBD_REPEAT_CONTINUE (0x05) #define KBD_KEY_DOWN_MAX (0x10) #define UINT_LEN (20) #define SC_LIM (69) #define KBD_ROWS (5) #define KBD_COLUMNS (8) #define KBD_KEYUP (0x80) #define KBD_MODESCAN (0x7f) #define KBD_CAPSSCAN (0x3a) #define KBD_SHIFTSCAN (0x2a) #define KBD_NUMCURSCAN (0x7c) #define KBD_CTRLSCAN (0x1d) #define KBD_ALTSCAN (0x38) #define KBD_UP_OFF (0) #define KBD_UP_ON (1) #define KBD_DOWN (2) #define KBD_DOWN_HOLD (3) static unsigned char handle_kbd_event(void); static unsigned char kbd_read_input(void); static void column_set(unsigned int column); static int scancodes(unsigned char codeval[KBD_ROWS][KBD_COLUMNS]); static spinlock_t kbd_controller_lock = SPIN_LOCK_UNLOCKED; static struct timer_list kbd_timer; static short mode_ena = 0; static short numcur_ena = 0; static short shift_ena = 0; #define E0_KPENTER 96 #define E0_RCTRL 97 #define E0_KPSLASH 98 #define E0_PRSCR 99 #define E0_RALT 100 #define E0_BREAK 101 /* (control-pause) */ #define E0_HOME 102 #define E0_UP 103 #define E0_PGUP 104 #define E0_LEFT 105 #define E0_RIGHT 106 #define E0_END 107 #define E0_DOWN 108 #define E0_PGDN 109 #define E0_INS 110 #define E0_DEL 111 #define E1_PAUSE 119 #define E0_MACRO 112 #define E0_F13 113 #define E0_F14 114 #define E0_HELP 115 #define E0_DO 116 #define E0_F17 117 #define E0_KPMINPLUS 118 #define E0_OK 124 #define E0_MSLW 125 #define E0_MSRW 126 #define E0_MSTM 127 static unsigned char e0_keys[128] = { 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00-0x07 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x08-0x0f */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10-0x17 */ 0, 0, 0, 0, E0_KPENTER, E0_RCTRL, 0, 0, /* 0x18-0x1f */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20-0x27 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x28-0x2f */ 0, 0, 0, 0, 0, E0_KPSLASH, 0, E0_PRSCR, /* 0x30-0x37 */ E0_RALT, 0, 0, 0, 0, E0_F13, E0_F14, E0_HELP, /* 0x38-0x3f */ E0_DO, E0_F17, 0, 0, 0, 0, E0_BREAK, E0_HOME, /* 0x40-0x47 */ E0_UP, E0_PGUP, 0, E0_LEFT, E0_OK, E0_RIGHT, E0_KPMINPLUS, E0_END,/* 0x48-0x4f */ E0_DOWN, E0_PGDN, E0_INS, E0_DEL, 0, 0, 0, 0, /* 0x50-0x57 */ 0, 0, 0, E0_MSLW, E0_MSRW, E0_MSTM, 0, 0, /* 0x58-0x5f */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60-0x67 */ 0, 0, 0, 0, 0, 0, 0, E0_MACRO, /* 0x68-0x6f */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70-0x77 */ 0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */ }; static unsigned char cerf_normal_map[KBD_ROWS][KBD_COLUMNS] = { {KBD_ALTSCAN, KBD_MODESCAN, 0x1e, 0x30, 0x2e, 0x20, 0x00, 0x00}, {0x12, 0x21, 0x22, 0x23, 0x17, 0x24, 0x25, 0x00}, {0x26, 0x32, 0x31, 0x18, 0x19, 0x10, 0x13, 0x00}, {0x1f, 0x14, 0x16, 0x2f, 0x11, 0x2d, 0x15, 0x00}, {0x2c, KBD_SHIFTSCAN, KBD_CTRLSCAN, 0x39, KBD_NUMCURSCAN, 0x2b, 0x1c, 0x00} }; static unsigned char cerf_mode_map[KBD_ROWS][KBD_COLUMNS] = { {0x00, 0x00, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00}, {0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x00, 0x00}, // {0x0d, 0x0c, 0x37, 0x35, 0x0d, 0x48, 0x28, 0x00}, {0x01, 0x33, 0x34, 0x00, 0x4b, 0x27, 0x4d, 0x00}, // {0x0f, 0x00, KBD_CAPSSCAN, 0x0e, 0x00, 0x50, 0x00, 0x00} }; static unsigned char cerf_numcur_map[KBD_ROWS][KBD_COLUMNS] = { {0x00, 0x00, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00}, {0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x00, 0x00}, {0x0d, 0x0c, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x4d, 0x00}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00} }; static void column_set(unsigned int column) { if (column < 0) { CERF_PDA_CPLD_UnSet(CERF_PDA_CPLD_KEYPAD_A, 0xFF, 0xFF); CERF_PDA_CPLD_UnSet(CERF_PDA_CPLD_KEYPAD_B, 0xFF, 0xFF); } else { if(column < 4) { CERF_PDA_CPLD_Set(CERF_PDA_CPLD_KEYPAD_A, 1 << (column % 4), 0xFF); CERF_PDA_CPLD_UnSet(CERF_PDA_CPLD_KEYPAD_B, 0xFF, 0xFF); } else { CERF_PDA_CPLD_UnSet(CERF_PDA_CPLD_KEYPAD_A, 0xFF, 0xFF); CERF_PDA_CPLD_Set(CERF_PDA_CPLD_KEYPAD_B, 1 << (column % 4), 0xFF); } } } static int scancodes(unsigned char codeval[KBD_ROWS][KBD_COLUMNS]) { int i, j; for(i = 0; i < KBD_COLUMNS; i++) { column_set(i); udelay(50); for(j = 0; j < KBD_ROWS; j++) { if(mode_ena) codeval[j][i] = (GPLR & (1 << (20 + j)))?(cerf_mode_map[j][i]?cerf_mode_map[j][i]:cerf_normal_map[j][i]):0; else if(numcur_ena) codeval[j][i] = (GPLR & (1 << (20 + j)))?(cerf_numcur_map[j][i]?cerf_numcur_map[j][i]:cerf_normal_map[j][i]):0; else codeval[j][i] = (GPLR & (1 << (20 + j)))?cerf_normal_map[j][i]:0; } } column_set(-1); return 0; } static unsigned char kbd_read_input(void) { int i, j, k, l; unsigned char prev; static unsigned char count = 0; static unsigned char oldcodes[KBD_ROWS][KBD_COLUMNS]={{0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}}; unsigned char inputcode[KBD_ROWS][KBD_COLUMNS]; memset(inputcode, 0, sizeof(unsigned char) * (KBD_ROWS * KBD_COLUMNS)); scancodes(inputcode); for(i = 0; i < KBD_COLUMNS; i++) { for(j = 0; j < KBD_ROWS; j++) { // if(oldcodes[j][i] == 0xe0) // oldcodes[j][i] = if(oldcodes[j][i] != inputcode[j][i]) { // Value of the key before entering this function prev = oldcodes[j][i]; // KEYUP if(inputcode[j][i] == 0 && oldcodes[j][i] != 0 && !(oldcodes[j][i] & KBD_KEYUP)) { oldcodes[j][i] |= KBD_KEYUP; if(mode_ena == KBD_UP_ON) mode_ena = KBD_UP_OFF; if(prev == KBD_MODESCAN) if(mode_ena == KBD_DOWN_HOLD) mode_ena = KBD_UP_OFF; else if(mode_ena == KBD_DOWN) mode_ena = KBD_UP_ON; if(mode_ena == KBD_DOWN) mode_ena = KBD_DOWN_HOLD; } // RESET KEYUP else if(oldcodes[j][i] & KBD_KEYUP) oldcodes[j][i] = 0; // KEY DOWN else { oldcodes[j][i] = inputcode[j][i]; // Parse out mode modifiers before the keyboard interpreter can touch them if(inputcode[j][i] == KBD_MODESCAN) { if(!mode_ena) mode_ena = KBD_DOWN; continue; } if(inputcode[j][i] == KBD_NUMCURSCAN) { numcur_ena = numcur_ena?0:1; continue; } } //printk("Modified: (%#x,%#x), ipv:%#x, To: (%#.2x), From: (%#.2x), Flags:%d,%d,%d\r\n", j, i, inputcode[j][i], oldcodes[j][i], prev, mode_ena, shift_ena, numcur_ena); return oldcodes[j][i]; } } } return (unsigned char)(KBD_NO_DATA); } int cerf_kbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode) { static int prev_scancode; if (scancode == 0xe0 || scancode == 0xe1) { prev_scancode = scancode; return 0; } if (scancode == 0x00 || scancode == 0xff) { prev_scancode = 0; return 0; } scancode &= 0x7f; if (prev_scancode) { if (prev_scancode != 0xe0) { if (prev_scancode == 0xe1 && scancode == 0x1d) { prev_scancode = 0x100; return 0; } else if (prev_scancode == 0x100 && scancode == 0x45) { prev_scancode = 0; } else { #ifdef KBD_REPORT_UNKN if (!raw_mode) printk(KERN_INFO "keyboard: unknown e1 escape sequence\n"); #endif prev_scancode = 0; return 0; } } else { prev_scancode = 0; if (scancode == 0x2a || scancode == 0x36) return 0; else { #ifdef KBD_REPORT_UNKN if (!raw_mode) printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n", scancode); #endif return 0; } } } else *keycode = scancode; return 1; } static inline void handle_keyboard_event(unsigned char scancode) { if(scancode != (unsigned char)(KBD_NO_DATA)) { #ifdef CONFIG_VT handle_scancode(scancode, !(scancode & KBD_KEYUP)); #endif tasklet_schedule(&keyboard_tasklet); } } static unsigned char handle_kbd_event(void) { unsigned char scancode; scancode = kbd_read_input(); handle_keyboard_event(scancode); return 0; } /* Handle the automatic interrupts handled by the timer */ static void keyboard_interrupt(unsigned long foo) { spin_lock_irq(&kbd_controller_lock); handle_kbd_event(); spin_unlock_irq(&kbd_controller_lock); kbd_timer.expires = 8 + jiffies; kbd_timer.data = 0x00000000; kbd_timer.function = (void(*)(unsigned long))&keyboard_interrupt; add_timer(&kbd_timer); } void cerf_leds(unsigned char leds) { } char cerf_unexpected_up(unsigned char keycode) { return 0; } int cerf_getkeycode(unsigned int scancode) { return 0; } int cerf_setkeycode(unsigned int scancode, unsigned int keycode) { return 0; } void cerf_kbd_init_hw(void) { printk("Starting Cerf PDA Keyboard Driver... "); k_setkeycode = cerf_setkeycode; k_getkeycode = cerf_getkeycode; k_translate = cerf_kbd_translate; k_unexpected_up = cerf_unexpected_up; k_leds = cerf_leds; GPDR &= ~(GPIO_GPIO(20) | GPIO_GPIO(21) | GPIO_GPIO(22) | GPIO_GPIO(23) | GPIO_GPIO(24)); kbd_timer.expires = 40 + jiffies; kbd_timer.data = 0x00000000; kbd_timer.function = (void(*)(unsigned long))&keyboard_interrupt; add_timer(&kbd_timer); printk("Done\r\n"); } |
From: James S. <jsi...@us...> - 2001-11-16 00:53:59
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv27785 Modified Files: aty128fb.c Log Message: More changes to get closer to new api. Still not done. Such a touchy driver. Index: aty128fb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/aty128fb.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- aty128fb.c 2001/11/15 15:17:47 1.8 +++ aty128fb.c 2001/11/16 00:53:56 1.9 @@ -128,6 +128,12 @@ vmode: FB_VMODE_NONINTERLACED }; +static struct fb_fix_screeninfo aty128fb_fix __initdata = { + "ATY Rage128", (unsigned long) NULL, 0, FB_TYPE_PACKED_PIXELS, 0, + FB_VISUAL_PSEUDOCOLOR, 8, 1, 0, 0, (unsigned long) NULL, 0x1fff, + FB_ACCEL_ATI_RAGE128 +}; + /* struct to hold chip description information */ struct aty128_chip_info { const char *name; @@ -209,7 +215,6 @@ static const struct aty128_meminfo ddr_sgram = { 4, 4, 3, 3, 2, 3, 1, 16, 31, 16, "64-bit DDR SGRAM" }; -static const char *aty128fb_name = "ATY Rage128"; static char fontname[40] __initdata = { 0 }; static int noaccel __initdata = 0; @@ -248,6 +253,7 @@ u32 offset, offset_cntl; u32 xoffset, yoffset; u32 vxres, vyres; + u32 bpp; }; struct aty128_pll { @@ -269,21 +275,25 @@ u32 accel_flags; }; -static struct display disp; - struct fb_info_aty128 { struct fb_info fb_info; struct fb_info_aty128 *next; struct aty128_constants constants; /* PLL and others */ - unsigned long regbase_phys; /* physical mmio */ void *regbase; /* remapped mmio */ - unsigned long frame_buffer_phys; /* physical fb memory */ - void *frame_buffer; /* remaped framebuffer */ - u32 vram_size; /* onboard video ram */ int chip_gen; const struct aty128_meminfo *mem; /* onboard mem info */ - struct aty128fb_par default_par, current_par; struct { u8 red, green, blue, pad; } palette[256]; + union { +#ifdef FBCON_HAS_CFB16 + u16 cfb16[16]; +#endif +#ifdef FBCON_HAS_CFB24 + u32 cfb24[16]; +#endif +#ifdef FBCON_HAS_CFB32 + u32 cfb32[16]; +#endif + } fbcon_cmap; #ifdef CONFIG_PCI struct pci_dev *pdev; #endif @@ -295,6 +305,8 @@ }; static struct fb_info_aty128 *board_list = NULL; +static struct display disp; +static struct aty128fb_par default_par; #define round_div(n, d) ((n+(d/2))/d) @@ -330,10 +342,6 @@ /* * Internal routines */ - -static void aty128_encode_fix(struct fb_fix_screeninfo *fix, - struct aty128fb_par *par, - const struct fb_info_aty128 *info); static void aty128_set_dispsw(struct display *disp, struct fb_info_aty128 *info, int bpp, int accel); static int aty128_getcolreg(u_int regno, u_int *red, u_int *green, u_int *blue, @@ -662,7 +670,7 @@ aty128_reset_engine(info); pitch_value = par->crtc.pitch; - if (info->fb_info.var.bits_per_pixel == 24) { + if (par->crtc.bpp == 24) { pitch_value = pitch_value * 3; } @@ -683,7 +691,7 @@ GMC_SRC_CLIP_DEFAULT | GMC_DST_CLIP_DEFAULT | GMC_BRUSH_SOLIDCOLOR | - (bpp_to_depth(info->fb_info.var.bits_per_pixel) << 8) | + (bpp_to_depth(par->crtc.bpp) << 8) | GMC_SRC_DSTCOLOR | GMC_BYTE_ORDER_MSB_TO_LSB | GMC_DP_CONVERSION_TEMP_6500 | @@ -817,7 +825,7 @@ bytpp = mode_bytpp[depth]; /* make sure there is enough video ram for the mode */ - if ((u32)(vxres * vyres * bytpp) > info->vram_size) { + if ((u32)(vxres * vyres * bytpp) > info->fb_info.fix.smem_len) { printk(KERN_ERR "aty128fb: Not enough memory for mode\n"); return -EINVAL; } @@ -874,6 +882,8 @@ crtc->vyres = vyres; crtc->xoffset = xoffset; crtc->yoffset = yoffset; + crtc->bpp = bpp; + return 0; } @@ -1165,7 +1175,7 @@ { u32 config; - info->current_par = *par; + info->fb_info.par = par; if (info->blitter_may_be_busy) wait_for_idle(info); @@ -1193,9 +1203,9 @@ config = aty_ld_le32(CONFIG_CNTL) & ~3; #if defined(__BIG_ENDIAN) - if (info->fb_info.var.bits_per_pixel >= 24) + if (par->crtc.bpp >= 24) config |= 2; /* make aperture do 32 byte swapping */ - else if (info->fb_info.var.bits_per_pixel > 8) + else if (par->crtc.bpp > 8) config |= 1; /* make aperture do 16 byte swapping */ #endif @@ -1212,18 +1222,18 @@ display_info.height = ((par->crtc.v_total >> 16) & 0x7ff) + 1; display_info.width = (((par->crtc.h_total >> 16) & 0xff) + 1) << 3; - display_info.depth = info->fb_info.var.bits_per_pixel; - display_info.pitch = (par->crtc.vxres * info->fb_info.var.bits_per_pixel) >> 3; + display_info.depth = par->crtc.bpp; + display_info.pitch = (par->crtc.vxres * par->crtc.bpp) >> 3; aty128_encode_var(&var, par, info); if (mac_var_to_vmode(&var, &vmode, &cmode)) display_info.mode = 0; else display_info.mode = vmode; - strcpy(display_info.name, aty128fb_name); - display_info.fb_address = info->frame_buffer_phys; + strcpy(display_info.name, info->fb_info.fix.id); + display_info.fb_address = info->fb_info.fix.smem_start; display_info.cmap_adr_address = 0; display_info.cmap_data_address = 0; - display_info.disp_reg_address = info->regbase_phys; + display_info.disp_reg_address = info->fb_info.mmio_start; } #endif /* CONFIG_FB_COMPAT_XPMAC */ } @@ -1244,7 +1254,7 @@ if ((err = aty128_var_to_pll(var->pixclock, &par->pll, info))) return err; - if ((err = aty128_ddafifo(&par->fifo_reg, &par->pll, info->fb_info.var.bits_per_pixel, info))) + if ((err = aty128_ddafifo(&par->fifo_reg, &par->pll, par->crtc.bpp, info))) return err; if (var->accel_flags & FB_ACCELF_TEXT) @@ -1294,10 +1304,7 @@ { const struct fb_info_aty128 *info = (struct fb_info_aty128 *)fb; - if (con == -1) - aty128_encode_var(var, &info->default_par, info); - else - *var = fb_display[con].var; + *var = info->fb_info.var; return 0; } @@ -1363,21 +1370,21 @@ oldvxres != var->xres_virtual || oldvyres != var->yres_virtual || oldbpp != var->bits_per_pixel || oldaccel != var->accel_flags) { - struct fb_fix_screeninfo fix; + info->fb_info.fix.line_length = (par.crtc.vxres * par.crtc.bpp) >> 3; + info->fb_info.fix.visual = par.crtc.bpp <= 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; - aty128_encode_fix(&fix, &par, info); - display->screen_base = info->frame_buffer; - display->visual = fix.visual; - display->type = fix.type; - display->type_aux = fix.type_aux; - display->ypanstep = fix.ypanstep; - display->ywrapstep = fix.ywrapstep; - display->line_length = fix.line_length; + display->screen_base = info->fb_info.screen_base; + display->visual = info->fb_info.fix.visual; + display->type = info->fb_info.fix.type; + display->type_aux = info->fb_info.fix.type_aux; + display->ypanstep = info->fb_info.fix.ypanstep; + display->ywrapstep = info->fb_info.fix.ywrapstep; + display->line_length = info->fb_info.fix.line_length; display->can_soft_blank = 1; display->inverse = 0; accel = var->accel_flags & FB_ACCELF_TEXT; - aty128_set_dispsw(display, info, info->fb_info.var.bits_per_pixel, accel); + aty128_set_dispsw(display, info, par.crtc.bpp, accel); if (accel) display->scrollmode = SCROLL_YNOMOVE; @@ -1415,16 +1422,19 @@ case 15: case 16: disp->dispsw = accel ? &fbcon_aty128_16 : &fbcon_cfb16; + disp->dispsw_data = info->fbcon_cmap.cfb16; break; #endif #ifdef FBCON_HAS_CFB24 case 24: disp->dispsw = accel ? &fbcon_aty128_24 : &fbcon_cfb24; + disp->dispsw_data = info->fbcon_cmap.cfb24; break; #endif #ifdef FBCON_HAS_CFB32 case 32: disp->dispsw = accel ? &fbcon_aty128_32 : &fbcon_cfb32; + disp->dispsw_data = info->fbcon_cmap.cfb32; break; #endif default: @@ -1432,37 +1442,6 @@ } } - -static void -aty128_encode_fix(struct fb_fix_screeninfo *fix, - struct aty128fb_par *par, - const struct fb_info_aty128 *info) -{ - memset(fix, 0, sizeof(struct fb_fix_screeninfo)); - - strcpy(fix->id, aty128fb_name); - - fix->smem_start = (unsigned long)info->frame_buffer_phys; - fix->mmio_start = (unsigned long)info->regbase_phys; - - fix->smem_len = info->vram_size; - fix->mmio_len = 0x1fff; - - fix->type = FB_TYPE_PACKED_PIXELS; - fix->type_aux = 0; - fix->line_length = (par->crtc.vxres * info->fb_info.var.bits_per_pixel) >> 3; - fix->visual = info->fb_info.var.bits_per_pixel <= 8 ? FB_VISUAL_PSEUDOCOLOR - : FB_VISUAL_DIRECTCOLOR; - fix->ywrapstep = 0; - fix->xpanstep = 8; - fix->ypanstep = 1; - - fix->accel = FB_ACCEL_ATI_RAGE128; - - return; -} - - /* * Get the Fixed Part of the Display */ @@ -1470,15 +1449,8 @@ aty128fb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *fb) { const struct fb_info_aty128 *info = (struct fb_info_aty128 *)fb; - struct aty128fb_par par; - - if (con == -1) - par = info->default_par; - else - aty128_decode_var(&fb_display[con].var, &par, info); - - aty128_encode_fix(fix, &par, info); - + + *fix = info->fb_info.fix; return 0; } @@ -1493,7 +1465,7 @@ struct fb_info *fb) { struct fb_info_aty128 *info = (struct fb_info_aty128 *)fb; - struct aty128fb_par *par = &info->current_par; + struct aty128fb_par *par = (struct aty128fb_par *) info->fb_info.par; u32 xoffset, yoffset; u32 offset; u32 xres, yres; @@ -1510,7 +1482,7 @@ par->crtc.xoffset = xoffset; par->crtc.yoffset = yoffset; - offset = ((yoffset * par->crtc.vxres + xoffset) * info->fb_info.var.bits_per_pixel) >> 6; + offset = ((yoffset * par->crtc.vxres + xoffset) * par->crtc.bpp) >> 6; aty_st_le32(CRTC_OFFSET, offset); @@ -1596,7 +1568,7 @@ if (!options || !*options) return 0; - while (this_opt = strsep(&options, ",")) { + while ((this_opt = strsep(&options, ","))) { if (!strncmp(this_opt, "font:", 5)) { char *p; int i; @@ -1660,8 +1632,8 @@ const struct aty128_chip_info *aci = &aty128_pci_probe_list[0]; char *video_card = "Rage128"; - if (!info->vram_size) /* may have already been probed */ - info->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF; + if (!info->fb_info.fix.smem_len) /* may have already been probed */ + info->fb_info.fix.smem_len = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF; /* Get the chip revision */ chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F; @@ -1673,13 +1645,13 @@ printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev); - if (info->vram_size % (1024 * 1024) == 0) - printk("%dM %s\n", info->vram_size / (1024*1024), info->mem->name); + if (info->fb_info.fix.smem_len % (1024 * 1024) == 0) + printk("%dM %s\n", info->fb_info.fix.smem_len / (1024*1024), info->mem->name); else - printk("%dk %s\n", info->vram_size / 1024, info->mem->name); + printk("%dk %s\n", info->fb_info.fix.smem_len / 1024, info->mem->name); /* fill in info */ - strcpy(info->fb_info.modename, aty128fb_name); + strcpy(info->fb_info.modename, info->fb_info.fix.id); info->fb_info.node = -1; info->fb_info.fbops = &aty128fb_ops; info->fb_info.disp = &disp; @@ -1714,18 +1686,18 @@ var = default_var; } - info->fb_info.var = var; - if (noaccel) var.accel_flags &= ~FB_ACCELF_TEXT; else var.accel_flags |= FB_ACCELF_TEXT; - if (aty128_decode_var(&var, &info->default_par, info)) { + if (aty128_decode_var(&var, &default_par, info)) { printk(KERN_ERR "aty128fb: Cannot set default mode.\n"); return 0; } + info->fb_info.par = &default_par; + /* load up the palette with default colors */ for (j = 0; j < 16; j++) { k = color_table[j]; @@ -1744,7 +1716,7 @@ aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL) | BUS_MASTER_DIS); aty128fb_set_var(&var, -1, &info->fb_info); - aty128_init_engine(&info->default_par, info); + aty128_init_engine(&default_par, info); board_list = aty128_board_list_add(board_list, info); @@ -1758,7 +1730,7 @@ #endif /* CONFIG_PMAC_BACKLIGHT */ printk(KERN_INFO "fb%d: %s frame buffer device on %s\n", - GET_FB_IDX(info->fb_info.node), aty128fb_name, name); + GET_FB_IDX(info->fb_info.node), info->fb_info.fix.id, name); return 1; /* success! */ } @@ -1851,21 +1823,24 @@ info->fb_info.currcon = -1; + info->fb_info.fix = aty128fb_fix; + /* Virtualize mmio region */ - info->regbase_phys = reg_addr; + info->fb_info.fix.mmio_start = (unsigned long) reg_addr; + info->regbase = ioremap(reg_addr, 0x1FFF); if (!info->regbase) goto err_free_info; /* Grab memory size from the card */ - info->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF; + info->fb_info.fix.smem_len = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF; /* Virtualize the framebuffer */ - info->frame_buffer_phys = fb_addr; - info->frame_buffer = ioremap(fb_addr, info->vram_size); + info->fb_info.fix.smem_start = (unsigned long) fb_addr; + info->fb_info.screen_base = ioremap(fb_addr, info->fb_info.fix.smem_len); - if (!info->frame_buffer) { + if (!info->fb_info.screen_base) { iounmap((void *)info->regbase); goto err_free_info; } @@ -1893,8 +1868,8 @@ #ifdef CONFIG_MTRR if (mtrr) { - info->mtrr.vram = mtrr_add(info->frame_buffer_phys, - info->vram_size, MTRR_TYPE_WRCOMB, 1); + info->mtrr.vram = mtrr_add(info->fb_info.fix.smem_start, + info->fb_info.fix.smem_len, MTRR_TYPE_WRCOMB, 1); info->mtrr.vram_valid = 1; /* let there be speed */ printk(KERN_INFO "aty128fb: Rage128 MTRR set to ON\n"); @@ -1909,7 +1884,7 @@ return 0; err_out: - iounmap(info->frame_buffer); + iounmap(info->fb_info.screen_base); iounmap(info->regbase); err_free_info: kfree(info); @@ -2108,7 +2083,7 @@ aty128_decode_var(&fb_display[con].var, &par, info); aty128_set_par(&par, info); - aty128_set_dispsw(&fb_display[con], info, info->fb_info.var.bits_per_pixel, + aty128_set_dispsw(&fb_display[con], info, par.crtc.bpp, par.accel_flags & FB_ACCELF_TEXT); do_install_cmap(con, fb); @@ -2178,6 +2153,7 @@ u_int transp, struct fb_info *fb) { struct fb_info_aty128 *info = (struct fb_info_aty128 *)fb; + struct aty128fb_par *par = (struct aty128fb_par *) info->fb_info.par; u32 col; if (regno > 255) @@ -2195,7 +2171,7 @@ /* initialize gamma ramp for hi-color+ */ - if ((info->fb_info.var.bits_per_pixel > 8) && (regno == 0)) { + if ((par->crtc.bpp > 8) && (regno == 0)) { int i; if (info->chip_gen == rage_M3) @@ -2223,7 +2199,7 @@ if (info->chip_gen == rage_M3) aty_st_le32(DAC_CNTL, aty_ld_le32(DAC_CNTL) & ~DAC_PALETTE_ACCESS_CNTL); - if (info->fb_info.var.bits_per_pixel == 16) + if (par->crtc.bpp == 16) aty_st_8(PALETTE_INDEX, (regno << 3)); else aty_st_8(PALETTE_INDEX, regno); @@ -2231,7 +2207,7 @@ aty_st_le32(PALETTE_DATA, col); if (info->chip_gen == rage_M3) { aty_st_le32(DAC_CNTL, aty_ld_le32(DAC_CNTL) | DAC_PALETTE_ACCESS_CNTL); - if (info->fb_info.var.bits_per_pixel == 16) + if (par->crtc.bpp == 16) aty_st_8(PALETTE_INDEX, (regno << 3)); else aty_st_8(PALETTE_INDEX, regno); @@ -2239,15 +2215,17 @@ } if (regno < 16) - switch (info->fb_info.var.bits_per_pixel) { + switch (par->crtc.bpp) { #ifdef FBCON_HAS_CFB16 case 9 ... 16: - ((u16 *)info->fb_info.pseudo_palette)[regno] = (regno << 10) | (regno << 5) | regno; + info->fbcon_cmap.cfb16[regno] = (regno << 10) | (regno << 5) | + regno; break; #endif #ifdef FBCON_HAS_CFB24 case 17 ... 24: - ((u32 *)info->fb_info.pseudo_palette)[regno] = (regno << 16) | (regno << 8) | regno; + info->fbcon_cmap.cfb24[regno] = (regno << 16) | (regno << 8) | + regno; break; #endif #ifdef FBCON_HAS_CFB32 @@ -2255,7 +2233,7 @@ u32 i; i = (regno << 8) | regno; - ((u32 *)info->fb_info.pseudo_palette)[regno] = (i << 16) | i; + info->fbcon_cmap.cfb32[regno] = (i << 16) | i; break; } #endif @@ -2322,12 +2300,13 @@ u_int width, u_int height, struct fb_info_aty128 *info) { + struct aty128fb_par *par = (struct aty128fb_par *) info->fb_info.par; u32 save_dp_datatype, save_dp_cntl, bppval; if (!width || !height) return; - bppval = bpp_to_depth(info->fb_info.var.bits_per_pixel); + bppval = bpp_to_depth(par->crtc.bpp); if (bppval == DST_24BPP) { srcx *= 3; dstx *= 3; @@ -2623,11 +2602,11 @@ unregister_framebuffer(&info->fb_info); #ifdef CONFIG_MTRR if (info->mtrr.vram_valid) - mtrr_del(info->mtrr.vram, info->frame_buffer_phys, - info->vram_size); + mtrr_del(info->mtrr.vram, info->fb_info.fix.smem_start, + info->fb_info.fix.smem_len); #endif /* CONFIG_MTRR */ iounmap(info->regbase); - iounmap(info->frame_buffer); + iounmap(info->fb_info.screen_base); release_mem_region(pci_resource_start(info->pdev, 0), pci_resource_len(info->pdev, 0)); |
From: James S. <jsi...@us...> - 2001-11-15 15:17:50
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv24413 Added Files: aty128fb.c Log Message: Needs to be finished in converting over to new api. |
From: James S. <jsi...@us...> - 2001-11-15 15:15:13
|
Update of /cvsroot/linuxconsole/ruby/linux/include/video In directory usw-pr-cvs1:/tmp/cvs-serv23713 Modified Files: aty128.h Log Message: Synced up to the latest code Index: aty128.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/video/aty128.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- aty128.h 2000/05/29 15:12:30 1.1 +++ aty128.h 2001/11/15 15:15:10 1.2 @@ -43,6 +43,7 @@ #define OVR_CLR 0x0230 #define OVR_WID_LEFT_RIGHT 0x0234 #define OVR_WID_TOP_BOTTOM 0x0238 +#define LVDS_GEN_CNTL 0x02d0 #define DDA_CONFIG 0x02e0 #define DDA_ON_OFF 0x02e4 #define VGA_DDA_CONFIG 0x02e8 @@ -266,6 +267,9 @@ #define DAC_MASK 0xFF000000 #define DAC_BLANKING 0x00000004 #define DAC_RANGE_CNTL 0x00000003 +#define DAC_RANGE_CNTL 0x00000003 +#define DAC_PALETTE_ACCESS_CNTL 0x00000020 +#define DAC_PDWN 0x00008000 /* GEN_RESET_CNTL bit constants */ #define SOFT_RESET_GUI 0x00000001 @@ -337,5 +341,12 @@ #define DP_SRC_RECT 0x00000200 #define DP_SRC_HOST 0x00000300 #define DP_SRC_HOST_BYTEALIGN 0x00000400 + +/* LVDS_GEN_CNTL constants */ +#define LVDS_BL_MOD_LEVEL_MASK 0x0000ff00 +#define LVDS_BL_MOD_LEVEL_SHIFT 8 +#define LVDS_BL_MOD_EN 0x00010000 +#define LVDS_DIGION 0x00040000 +#define LVDS_BLON 0x00080000 #endif /* REG_RAGE128_H */ |
From: James S. <jsi...@us...> - 2001-11-14 23:32:40
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv8897 Modified Files: fbmem.c Log Message: Paul fix for the BKL in fbmem.c Index: fbmem.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fbmem.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- fbmem.c 2001/11/14 16:29:12 1.55 +++ fbmem.c 2001/11/14 23:32:37 1.56 @@ -621,8 +621,10 @@ if (off >= len) { /* memory mapped io */ off -= len; - if (info->var.accel_flags) + if (info->var.accel_flags) { + unlock_kernel(); return -EINVAL; + } start = info->fix.mmio_start; len = PAGE_ALIGN((start & ~PAGE_MASK)+info->fix.mmio_len); } |
From: James S. <jsi...@us...> - 2001-11-14 22:25:58
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv24506 Modified Files: skeletonfb.c Log Message: More info to educate people. Index: skeletonfb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/skeletonfb.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- skeletonfb.c 2001/11/14 21:53:52 1.13 +++ skeletonfb.c 2001/11/14 22:25:55 1.14 @@ -312,7 +312,13 @@ /* * We provide our own functions if we have hardware acceleration - * or non packed pixel format layouts. + * or non packed pixel format layouts. If we have no hardware + * acceleration, we use a generic unaccelerated function. If using + * a pack pixel format just use the functions in cfb*.c. Each file + * has one of the three different accel functions we support. You + * can use these functions as fallbacks if hardware unsupported + * action is requested. Also if you have non pack pixel modes and + * non accelerated cards you have to provide your own functions. */ /** @@ -490,7 +496,7 @@ #ifdef MODULE module_init(xxxfb_init); +#endif module_exit(xxxfb_cleanup); MODULE_LICENSE("GPL"); -#endif /* MODULE */ |
From: James S. <jsi...@us...> - 2001-11-14 22:01:54
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv18165 Modified Files: vfb.c Log Message: Cleanups and chages from fbdev list. Index: vfb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/vfb.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- vfb.c 2001/10/29 22:58:43 1.30 +++ vfb.c 2001/11/14 22:01:52 1.31 @@ -257,23 +257,23 @@ /* Directcolor: * var->{color}.offset contains start of bitfield * var->{color}.length contains length of bitfield - * {hardwarespecific} contains width of DAC + * {hardwarespecific} contains width of RAMDAC * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset) - * DAC[X] is programmed to (red, green, blue) + * RAMDAC[X] is programmed to (red, green, blue) * * Pseudocolor: - * uses offset = 0 && length = DAC register width. + * uses offset = 0 && length = RAMDAC register width. * var->{color}.offset is 0 * var->{color}.length contains widht of DAC * cmap is not used - * DAC[X] is programmed to (red, green, blue) + * RAMDAC[X] is programmed to (red, green, blue) * Truecolor: - * does not use DAC. + * does not use DAC. Usually 3 are present. * var->{color}.offset contains start of bitfield * var->{color}.length contains length of bitfield * cmap is programmed to (red << red.offset) | (green << green.offset) | * (blue << blue.offset) | (transp << transp.offset) - * DAC does not exist + * RAMDAC does not exist */ #define CNVT_TOHW(val,width) ((((val)<<(width))+0x7FFF-(val))>>16) switch (info->fix.visual) { @@ -304,10 +304,17 @@ (green << info->var.green.offset) | (blue << info->var.blue.offset) | (transp << info->var.transp.offset); - if (info->var.bits_per_pixel == 16) - ((u16*)(info->pseudo_palette))[regno] = v; - else - ((u32*)(info->pseudo_palette))[regno] = v; + switch (info->var.bits_per_pixel) { + case 8: + break; + case 16: + ((u16*)(info->pseudo_palette))[regno] = v; + break; + case 24: + case 32: + ((u32*)(info->pseudo_palette))[regno] = v; + break; + } return 0; } return 0; |
From: James S. <jsi...@us...> - 2001-11-14 21:53:55
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv15914 Modified Files: skeletonfb.c Log Message: Cleanups and chages from fbdev list. Index: skeletonfb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/skeletonfb.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- skeletonfb.c 2001/10/29 22:58:43 1.12 +++ skeletonfb.c 2001/11/14 21:53:52 1.13 @@ -57,6 +57,11 @@ * Even less warranty that it actually works :-) */ +/* + * If your driver supports multiple boards, you should make the + * below data types arrays, or allocate them dynamically (using kmalloc()). + */ + /* * This structure defines the hardware state of the graphics card. Normally * you place this in a header file in linux/include/video. This file usually @@ -110,7 +115,7 @@ int xxxfb_setup(char*); /** - * xxxfb_check_var - REQUIRED function. Validates a var passed in. + * xxxfb_check_var - Optional function. Validates a var passed in. * @var: frame buffer variable screen structure * @info: frame buffer structure that represents a single frame buffer * @@ -122,7 +127,8 @@ * modedb.c is a example of this. If the var passed in is slightly * off by what the hardware can support then we alter the var PASSED in * to what we can do. If the hardware doesn't support mode change - * just return a -EINVAL; + * a -EINVAL will be returned by the upper layers. You don't need to + * implement this function then. * * Returns negative errno on error, or zero on success. */ @@ -134,7 +140,7 @@ } /** - * xxxfb_set_par - NOT a required function. Alters the hardware state. + * xxxfb_set_par - Optional function. Alters the hardware state. * @info: frame buffer structure that represents a single frame buffer * * Using the fb_var_screeninfo in fb_info we set the resolution of the @@ -152,7 +158,7 @@ } /** - * xxxfb_setcolreg - REQUIRED function. Sets a color register. + * xxxfb_setcolreg - Optional function. Sets a color register. * @regno: boolean, 0 copy local, 1 get_user() function * @red: frame buffer colormap structure * @green: The green value which can be up to 16 bits wide @@ -168,7 +174,8 @@ * which we store the value in pseudo_palette in struct fb_info. For * pseudocolor mode we have a limited color palette. To deal with this * we can program what color is displayed for a particular pixel value. - * DirectColor is similar in that we can program each color field. + * DirectColor is similar in that we can program each color field. If + * we have a static colormap we don't need to implement this function. * * Returns negative errno on error, or zero on success. */ @@ -193,7 +200,7 @@ * var->{color}.length contains length of bitfield * {hardwarespecific} contains width of DAC * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset) - * DAC[X] is programmed to (red, green, blue) + * RAMDAC[X] is programmed to (red, green, blue) * * Pseudocolor: * uses offset = 0 && length = DAC register width. @@ -202,12 +209,12 @@ * cmap is not used * DAC[X] is programmed to (red, green, blue) * Truecolor: - * does not use DAC. + * does not use RAMDAC (usually has 3 of them). * var->{color}.offset contains start of bitfield * var->{color}.length contains length of bitfield * cmap is programmed to (red << red.offset) | (green << green.offset) | * (blue << blue.offset) | (transp << transp.offset) - * DAC does not exist + * RAMDAC does not exist */ #define CNVT_TOHW(val,width) ((((val)<<(width))+0x7FFF-(val))>>16) switch (info->fix.visual) { @@ -240,10 +247,20 @@ (green << info->var.green.offset) | (blue << info->var.blue.offset) | (transp << info->var.transp.offset); - if (info->var.bits_per_pixel == 16) - ((u16*)(info->pseudo_palette))[regno] = v; - else - ((u32*)(info->pseudo_palette))[regno] = v; + + switch (info->var.bits_per_pixel) { + case 8: + /* Yes some hand held devices have this. */ + ((u8*)(info->pseudo_palette))[regno] = v; + break; + case 16: + ((u16*)(info->pseudo_palette))[regno] = v; + break; + case 24: + case 32: + ((u32*)(info->pseudo_palette))[regno] = v; + break; + } return 0; } /* ... */ |
From: James S. <jsi...@us...> - 2001-11-14 17:51:38
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv8427 Modified Files: vt_ioctl.c Log Message: For now disable mk_sound. It caused problems with key repeat I believe. Index: vt_ioctl.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/vt_ioctl.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- vt_ioctl.c 2001/11/13 20:10:33 1.64 +++ vt_ioctl.c 2001/11/14 17:51:33 1.65 @@ -94,7 +94,7 @@ * is in something like msecs. Due to the various underlying * types of hardware we can't convert it to milliseconds. Sorry * but the console api sucks. - */ + input_event(handle->dev, EV_REP, REP_PERIOD, period); input_event(handle->dev, EV_REP, REP_DELAY, duration); @@ -102,6 +102,7 @@ input_event(handle->dev, EV_SND, SND_BELL, 1); else input_event(handle->dev, EV_SND, SND_BELL, 0); + */ } /* |
From: James S. <jsi...@us...> - 2001-11-14 17:25:10
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv647 Modified Files: fbgen.c Log Message: Had to comment it out for now. Need to fix. This should be done per device and we need to pass in a struct fb_info that represents that device. Index: fbgen.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fbgen.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- fbgen.c 2001/06/22 16:31:14 1.24 +++ fbgen.c 2001/11/14 17:25:07 1.25 @@ -139,15 +139,17 @@ continue; } +#if 0 if (!strncmp(this_opt, "inverse", 7)) { - fb_invert_cmaps(); + fb_invert_cmaps(info); #ifdef CONFIG_MTRR } else if (!strncmp(this_opt, "nomtrr", 6)) { - fb_disable_mtrrs(); + fb_disable_mtrrs(info); #endif } else { global_mode_option = this_opt; } +#endif } return 0; } |
From: James S. <jsi...@us...> - 2001-11-14 17:10:43
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv27637 Modified Files: fb.h Log Message: Changed fb_disable_mtrr. Index: fb.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/fb.h,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- fb.h 2001/11/14 16:29:12 1.42 +++ fb.h 2001/11/14 17:10:40 1.43 @@ -450,7 +450,7 @@ extern struct fb_info *registered_fb[FB_MAX]; #ifdef CONFIG_MTRR -extern void fb_disable_mtrrs(void); +extern void fb_disable_mtrrs(struct fb_info *fb_info); #endif /* drivers/video/fbmon.c */ |
From: James S. <jsi...@us...> - 2001-11-14 16:29:15
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv10704/drivers/video Modified Files: fbmem.c Log Message: Made enable_mtrr local to each framebuffer device. Index: fbmem.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fbmem.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- fbmem.c 2001/11/13 02:09:18 1.54 +++ fbmem.c 2001/11/14 16:29:12 1.55 @@ -760,9 +760,6 @@ }; #ifdef CONFIG_MTRR -/* Enable MTRR support by default */ -static int enable_mtrr = 1; - /** * fb_disable_mtrrs - disable MTRR usage for frame buffer device * @fb_info: frame buffer info structure @@ -774,9 +771,9 @@ * */ void -fb_disable_mtrrs(void) +fb_disable_mtrrs(struct fb_info *info) { - enable_mtrr = 0; + info->enable_mtrr = 0; } #endif @@ -883,7 +880,7 @@ /* * Enable MTRR support if desired. */ - if (enable_mtrr) { + if (fb_info->enable_mtrr) { fb_info->mtrr_handle = mtrr_add(fb_info->fix.smem_start, fb_info->fix.smem_len, MTRR_TYPE_WRCOMB, 1); @@ -919,7 +916,7 @@ /* * Disable MTRR support if it's enabled. */ - if (enable_mtrr) { + if (fb_info->enable_mtrr) { mtrr_del(fb_info->mtrr_handle, fb_info->fix.smem_start, fb_info->fix.smem_len); printk("%s: MTRR turned off\n", fb_info->fix.id); |
From: James S. <jsi...@us...> - 2001-11-14 16:29:15
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv10704/include/linux Modified Files: fb.h Log Message: Made enable_mtrr local to each framebuffer device. Index: fb.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/fb.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- fb.h 2001/10/03 16:20:24 1.41 +++ fb.h 2001/11/14 16:29:12 1.42 @@ -376,6 +376,7 @@ the cursor's color for non palette mode */ #ifdef CONFIG_MTRR + int enable_mtrr; /* Turn MTRR on */ int mtrr_handle; /* MTRR handle */ #endif /* From here on everything is device dependent */ |
From: James S. <jsi...@us...> - 2001-11-13 23:30:32
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv5288 Modified Files: Config.in Log Message: Added the ability to change the IO regions and IRQs for PS/2 devices. Some platforms need this. Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/Config.in,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- Config.in 2001/09/25 08:33:30 1.56 +++ Config.in 2001/11/13 23:30:29 1.57 @@ -10,6 +10,11 @@ bool 'PS/2 port support' CONFIG_INPUT_PS2 if [ "$CONFIG_INPUT_PS2" != "n" ]; then tristate ' i8042 aux+kbd controller' CONFIG_INPUT_I8042 + if [ "$CONFIG_INPUT_I8042" != "n" ]; then + hex ' Register Base Address' CONFIG_I8042_REG_BASE 60 + int ' PS/2 Keyboard IRQ' CONFIG_I8042_KBD_IRQ 1 + int ' PS/2 AUX IRQ' CONFIG_I8042_AUX_IRQ 12 + fi tristate ' ct82c710 aux controller' CONFIG_INPUT_CT82C710 tristate ' Q40 kbd controller' CONFIG_INPUT_Q40KBD tristate ' #Sun Ultra/AX, JavaStation 8042 kbd controller' CONFIG_INPUT_SUN8042 |
From: James S. <jsi...@us...> - 2001-11-13 22:48:05
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv25951 Modified Files: ns558.c Log Message: Bug fixes. I hope I am grabbing the right info from PCI space. Index: ns558.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/ns558.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- ns558.c 2001/09/25 10:12:07 1.39 +++ ns558.c 2001/11/13 22:48:01 1.40 @@ -171,7 +171,7 @@ #define NS558_DEVICE(a,b,c,d)\ card_vendor: ISAPNP_ANY_ID, card_device: ISAPNP_ANY_ID,\ - vendor: ISAPNP_VENDOR(a,b,c), device: ISAPNP_DEVICE(d) + vendor: ISAPNP_VENDOR(a,b,c), function: ISAPNP_DEVICE(d) static struct isapnp_device_id pnp_devids[] = { { NS558_DEVICE('@','P','@',0x0001) }, /* ALS 100 */ @@ -242,15 +242,15 @@ port->gameport.idbus = BUS_ISAPNP; port->gameport.idvendor = dev->vendor; port->gameport.idproduct = dev->device; - port->gameport.idversion = dev->version; + port->gameport.idversion = 0x100; - sprintf(port->phys, "isapnp%d.%d/gameport0", dev->number, dev->devfn); - sprintf(port->name, "%s" dev->name[0] ? dev->name : "NS558 PnP Gameport"); + sprintf(port->phys, "isapnp%d.%d/gameport0", PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); + sprintf(port->name, "%s", dev->name[0] ? dev->name : "NS558 PnP Gameport"); gameport_register_port(&port->gameport); printk(KERN_INFO "gameport: NS558 PnP at isapnp%d.%d io %#x", - dev->number, dev->devfn, port->gameport.io); + PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn), port->gameport.io); if (iolen > 1) printk(" size %d", iolen); printk(" speed %d kHz\n", port->gameport.speed); |
From: James S. <jsi...@us...> - 2001-11-13 20:30:49
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv18571 Added Files: ChangeLog Log Message: Added a changelog file. We can keep track of what has been changed. --- NEW FILE: ChangeLog --- 2001-11-13 James Simmons <jsi...@tr...> * Final port of Russell King's code. Today we are going to * start working on a better api for 2.5. |
From: James S. <jsi...@us...> - 2001-11-13 20:17:45
|
Update of /cvsroot/linuxconsole/ruby/linux/Documentation/serial In directory usw-pr-cvs1:/tmp/cvs-serv15111 Added Files: driver Log Message: Addiing info on new serial driver api. --- NEW FILE: driver --- Low Level Serial API -------------------- $Id: driver,v 1.1 2001/11/13 20:17:41 jsimmons Exp $ This document is meant as a brief overview of some aspects of the new serial driver. It is not complete, any questions you have should be directed to <rm...@ar...> The reference implementation is contained within serial_amba.c. Low Level Serial Hardware Driver -------------------------------- The low level serial hardware driver is responsible for supplying port information (defined by uart_port) and a set of control methods (defined by uart_ops) to the core serial driver. The low level driver is also responsible for handling interrupts for the port, and providing any console support. Console Support --------------- The serial core provides a few helper functions. This includes identifing the correct port structure (via uart_get_console) and decoding command line arguments (uart_parse_options). Locking ------- Generally, all locking is done by the core driver, except for the interrupt functions. It is the responsibility of the low level hardware driver to perform the necessary locking there using info->lock. (since it is running in an interrupt, you only need to use spin_lock() and spin_unlock() from the interrupt handler). uart_ops -------- The uart_ops structure is the main interface between serial_core and the hardware specific driver. It contains all the methods to control the hardware. tx_empty(port) This function tests whether the transmitter fifo and shifter for the port described by 'port' is empty. If it is empty, this function should return TIOCSER_TEMT, otherwise return 0. If the port does not support this operation, then it should return TIOCSER_TEMT. set_mctrl(port, mctrl) This function sets the modem control lines for port described by 'port' to the state described by mctrl. The relevant bits of mctrl are: - TIOCM_RTS RTS signal. - TIOCM_DTR DTR signal. - TIOCM_OUT1 OUT1 signal. - TIOCM_OUT2 OUT2 signal. If the appropriate bit is set, the signal should be driven active. If the bit is clear, the signal should be driven inactive. get_mctrl(port) Returns the current state of modem control inputs. The state of the outputs should not be returned, since the core keeps track of their state. The state information should include: - TIOCM_DCD state of DCD signal - TIOCM_CTS state of CTS signal - TIOCM_DSR state of DSR signal - TIOCM_RI state of RI signal The bit is set if the signal is currently driven active. If the port does not support CTS, DCD or DSR, the driver should indicate that the signal is permanently active. If RI is not available, the signal should not be indicated as active. stop_tx(port,from_tty) Stop transmitting characters. This might be due to the CTS line becoming inactive or the tty layer indicating we want to stop transmission. start_tx(port,nonempty,from_tty) start transmitting characters. (incidentally, nonempty will always be nonzero, and shouldn't be used - it will be dropped). stop_rx(port) Stop receiving characters; the port is in the process of being closed. enable_ms(port) Enable the modem status interrupts. break_ctl(port,ctl) Control the transmission of a break signal. If ctl is nonzero, the break signal should be transmitted. The signal should be terminated when another call is made with a zero ctl. startup(port,info) Grab any interrupt resources and initialise any low level driver state. Enable the port for reception. It should not activate RTS nor DTR; this will be done via a separate call to set_mctrl. shutdown(port,info) Disable the port, disable any break condition that may be in effect, and free any interrupt resources. It should not disable RTS nor DTR; this will have already been done via a separate call to set_mctrl. change_speed(port,cflag,iflag,quot) Change the port parameters, including word length, parity, stop bits. Update read_status_mask and ignore_status_mask to indicate the types of events we are interested in receiving. Relevant cflag bits are: CSIZE - word size CSTOPB - 2 stop bits PARENB - parity enable PARODD - odd parity (when PARENB is in force) CREAD - enable reception of characters (if not set, still receive characters from the port, but throw them away. CRTSCTS - if set, enable CTS status change reporting CLOCAL - if not set, enable modem status change reporting. Relevant iflag bits are: INPCK - enable frame and parity error events to be passed to the TTY layer. BRKINT PARMRK - both of these enable break events to be passed to the TTY layer. IGNPAR - ignore parity and framing errors IGNBRK - ignore break errors, If IGNPAR is also set, ignore overrun errors as well. The interaction of the iflag bits is as follows (parity error given as an example): Parity error INPCK IGNPAR None n/a n/a character received Yes n/a 0 character discarded Yes 0 1 character received, marked as TTY_NORMAL Yes 1 1 character received, marked as TTY_PARITY pm(port,state,oldstate) perform any power management related activities on the specified port. state indicates the new state (defined by ACPI D0-D3), oldstate indicates the previous state. Essentially, D0 means fully on, D3 means powered down. This function should not be used to grab any resources. release_port(port) Release any memory and IO region resources currently in use by the port. request_port(port) Request any memory and IO region resources required by the port. If any fail, no resources should be registered when this function returns, and it should return -EBUSY on failure. config_port(port,type) Perform any autoconfiguration steps required for the port. `type` contains a bit mask of the required configuration. UART_CONFIG_TYPE indicates that the port requires detection and identification. port->type should be set to the type found, or PORT_UNKNOWN if no port was detected. UART_CONFIG_IRQ indicates autoconfiguration of the interrupt signal, which should be probed using standard kernel autoprobing techniques. This is not necessary on platforms where ports have interrupts internally hard wired (eg, system on a chip implementations). verify_port(port,serinfo) Verify the new serial port information contained within serinfo is suitable for this port type. ioctl(port,cmd,arg) Perform any port specific IOCTLs. IOCTL commands must be defined using the standard numbering system found in <asm/ioctl.h> Other notes ----------- It is intended some day to drop the 'unused' entries from uart_port, and allow low level drivers to register their own individual uart_port's with the core. This will allow drivers to use uart_port as a pointer to a structure containing both the uart_port entry with their own extensions, thus: struct my_port { struct uart_port port; int my_stuff; }; |
From: James S. <jsi...@us...> - 2001-11-13 20:17:02
|
Update of /cvsroot/linuxconsole/ruby/linux/Documentation/serial In directory usw-pr-cvs1:/tmp/cvs-serv14939/serial Log Message: Directory /cvsroot/linuxconsole/ruby/linux/Documentation/serial added to the repository |
From: James S. <jsi...@us...> - 2001-11-13 20:10:36
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv13024 Modified Files: vt_ioctl.c Log Message: oops. Missed a } Index: vt_ioctl.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/vt_ioctl.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- vt_ioctl.c 2001/11/13 19:38:22 1.63 +++ vt_ioctl.c 2001/11/13 20:10:33 1.64 @@ -1483,20 +1483,22 @@ * is awry */ if (kill_proc(new_vc->vt_pid,new_vc->vt_mode.acqsig, 1) != 0) { - /* - * The controlling process has died, so we revert back to - * normal operation. In this case, we'll also change back - * to KD_TEXT mode. I'm not sure if this is strictly correct - * but it saves the agony when the X server dies and the screen - * remains blanked due to KD_GRAPHICS! It would be nice to do - * this outside of VT_PROCESS but there is no single process - * to account for and tracking tty count may be undesirable. - */ - if (old_vc_mode != new_vc->vc_mode) { - if (new_vc->vc_mode == KD_TEXT) - unblank_screen(new_vc->display_fg); - else - do_blank_screen(new_vc); + /* + * The controlling process has died, so we revert back + * to normal operation. In this case, we'll also change + * back to KD_TEXT mode. I'm not sure if this is + * strictly correct but it saves the agony when the X + * server dies and the screen remains blanked due to + * KD_GRAPHICS! It would be nice to do this outside of + * VT_PROCESS but there is no single process to account + * and tracking tty count may be undesirable. + */ + if (old_vc_mode != new_vc->vc_mode) { + if (new_vc->vc_mode == KD_TEXT) + unblank_screen(new_vc->display_fg); + else + do_blank_screen(new_vc); + } } } |
From: James S. <jsi...@us...> - 2001-11-13 19:51:35
|
Update of /cvsroot/linuxconsole/ruby In directory usw-pr-cvs1:/tmp/cvs-serv7945 Removed Files: AGAINST-2.4.13 Log Message: --- AGAINST-2.4.13 DELETED --- |
From: James S. <jsi...@us...> - 2001-11-13 19:51:13
|
Update of /cvsroot/linuxconsole/ruby In directory usw-pr-cvs1:/tmp/cvs-serv7850 Added Files: AGAINST-2.4.14 Log Message: --- NEW FILE: AGAINST-2.4.14 --- |