From: Pete P. <pp...@us...> - 2001-10-10 19:21:15
|
Update of /cvsroot/linux-mips/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv23851/drivers/video Modified Files: epson1356fb.c epson1356fb.h Log Message: Epson 1356 fb driver update from MontaVista's source tree. Index: epson1356fb.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/video/epson1356fb.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- epson1356fb.c 2001/09/12 22:23:31 1.5 +++ epson1356fb.c 2001/10/10 19:21:06 1.6 @@ -197,47 +197,6 @@ fb_mmap: e1356fb_mmap, }; - -static struct fb_videomode __initdata panel_default_mode[] = { - { - /* 640x480 @ ?? Hz */ - NULL, 60, 640, 480, -1, 32, 10, 1, 1, 22, 1, - 0, FB_VMODE_NONINTERLACED - }, { - /* 800x600 @ ?? Hz */ - NULL, 60, 800, 600, -1, 32, 10, 1, 1, 22, 1, - 0, FB_VMODE_NONINTERLACED - } -}; -static struct fb_videomode __initdata crt_default_mode[] = { - { - /* 640x480 @ ?? Hz */ - NULL, 85, 640, 480, -1, 96, 32, 23, 1, 64, 5, - 0, FB_VMODE_NONINTERLACED - }, { - /* 800x600 @ ?? Hz */ - NULL, 60, 800, 600, -1, 88, 40, 23, 1, 128, 4, - FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, - FB_VMODE_NONINTERLACED - } -}; -static struct fb_videomode __initdata ntsc_default_mode[] = { - { - /* 640x480 @ 62 Hz, requires flicker filter */ - //NULL, 62, 640, 480, 34921, 213, 57, 20, 2, 0, 0, - NULL, 62, 640, 480, 34921, 200, 70, 15, 7, 0, 0, - 0, FB_VMODE_NONINTERLACED - } -}; -static struct fb_videomode __initdata pal_default_mode[] = { - { - /* 640x480 @ 56 Hz, requires flicker filter */ - NULL, 56, 640, 480, 28194, 350, 145, 49, 23, 0, 0, - 0, FB_VMODE_NONINTERLACED - } -}; - - #define PCI_VENDOR_ID_EPSON 0x10f4 #define PCI_DEVICE_ID_EPSON_SDU1356 0x1300 @@ -291,6 +250,141 @@ return timeout; } + +static struct fb_videomode panel_modedb[] = { + { + /* 320x240 @ 109 Hz, 33.3 kHz hsync */ + NULL, 109, 320, 240, KHZ2PICOS(MAX_PIXCLOCK/3), + 16, 16, 32, 24, 48, 8, + 0, FB_VMODE_NONINTERLACED + }, { + /* 640x480 @ 84 Hz, 48.1 kHz hsync */ + NULL, 84, 640, 480, KHZ2PICOS(MAX_PIXCLOCK/1), + 96, 32, 32, 48, 64, 8, + 0, FB_VMODE_NONINTERLACED + }, { + /* 800x600 @ 76 Hz, 46.3 kHz hsync */ + NULL, 76, 800, 600, KHZ2PICOS(MAX_PIXCLOCK/1), + 32, 10, 1, 1, 22, 1, + 0, FB_VMODE_NONINTERLACED + } +}; +static struct fb_videomode crt_modedb[] = { + { + /* 320x240 @ 84 Hz, 31.25 kHz hsync */ + NULL, 84, 320, 240, KHZ2PICOS(MAX_PIXCLOCK/2), + 128, 128, 60, 60, 64, 8, + 0, FB_VMODE_NONINTERLACED + }, { + /* 320x240 @ 109 Hz, 33.3 kHz hsync */ + NULL, 109, 320, 240, KHZ2PICOS(MAX_PIXCLOCK/3), + 16, 16, 32, 24, 48, 8, + 0, FB_VMODE_NONINTERLACED + }, { + /* 512x384 @ 77 Hz, 31.25 kHz hsync */ + NULL, 77, 512, 384, KHZ2PICOS(MAX_PIXCLOCK/2), + 48, 16, 16, 1, 64, 3, + 0, FB_VMODE_NONINTERLACED + }, { + /* 640x400 @ 88 Hz, 43.1 kHz hsync */ + NULL, 88, 640, 400, KHZ2PICOS(MAX_PIXCLOCK/1), + 128, 96, 32, 48, 64, 8, + 0, FB_VMODE_NONINTERLACED + }, { + /* 640x480 @ 84 Hz, 48.1 kHz hsync */ + NULL, 84, 640, 480, KHZ2PICOS(MAX_PIXCLOCK/1), + 96, 32, 32, 48, 64, 8, + 0, FB_VMODE_NONINTERLACED + }, { + /* 768x576 @ 62 Hz, 38.5 kHz hsync */ + NULL, 62, 768, 576, KHZ2PICOS(MAX_PIXCLOCK/1), + 144, 16, 28, 6, 112, 4, + 0, FB_VMODE_NONINTERLACED + }, { + /* 800x600 @ 60 Hz, 37.9 kHz hsync */ + NULL, 60, 800, 600, KHZ2PICOS(MAX_PIXCLOCK/1), + 88, 40, 23, 1, 128, 4, + FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, + FB_VMODE_NONINTERLACED + } +}; + +static struct fb_videomode ntsc_modedb[] = { + { + /* 640x480 @ 62 Hz, requires flicker filter */ + //NULL, 62, 640, 480, 34921, 213, 57, 20, 2, 0, 0, + NULL, 62, 640, 480, KHZ2PICOS(2*NTSC_PIXCLOCK), + 200, 70, 15, 7, 0, 0, + FB_SYNC_BROADCAST, FB_VMODE_NONINTERLACED + } +}; +static struct fb_videomode pal_modedb[] = { + { + /* 640x480 @ 56 Hz, requires flicker filter */ + NULL, 56, 640, 480, KHZ2PICOS(2*PAL_PIXCLOCK), + 350, 145, 49, 23, 0, 0, + FB_SYNC_BROADCAST, FB_VMODE_NONINTERLACED + } +}; + + +static inline void +fb_videomode_to_var(struct fb_videomode* mode, + struct fb_var_screeninfo*var) +{ + var->xres = mode->xres; + var->yres = mode->yres; + var->pixclock = mode->pixclock; + var->left_margin = mode->left_margin; + var->right_margin = mode->right_margin; + var->upper_margin = mode->upper_margin; + var->lower_margin = mode->lower_margin; + var->hsync_len = mode->hsync_len; + var->vsync_len = mode->vsync_len; + var->sync = mode->sync; + var->vmode = mode->vmode; +} + + +static int +e1356fb_get_mode(const struct fb_info_e1356 *info, + int xres, + int yres, + struct fb_videomode ** modedb, + struct fb_videomode ** mode) +{ + struct fb_videomode * ret; + int i, dbsize; + + if (IS_PANEL(info->fix.disp_type)) { + ret = panel_modedb; + dbsize = sizeof(panel_modedb)/sizeof(struct fb_videomode); + } else if (info->fix.disp_type == DISP_TYPE_CRT) { + ret = crt_modedb; + dbsize = sizeof(crt_modedb)/sizeof(struct fb_videomode); + } else if (info->fix.disp_type == DISP_TYPE_NTSC) { + ret = ntsc_modedb; + dbsize = sizeof(ntsc_modedb)/sizeof(struct fb_videomode); + } else { + ret = pal_modedb; + dbsize = sizeof(pal_modedb)/sizeof(struct fb_videomode); + } + + if (modedb) + *modedb = ret; + for (i=0; i<dbsize; i++) { + if (xres == ret[i].xres && yres == ret[i].yres) { + *mode = &ret[i]; + break; + } + } + if (i == dbsize) + return -EINVAL; + return dbsize; +} + + + #ifdef E1356FB_VERBOSE_DEBUG static void dump_par(const struct e1356fb_par* par) @@ -355,9 +449,10 @@ #endif // E1356FB_VERBOSE_DEBUG + // Input: ipclk->clksrc, ipclk->pixclk_d // Output: ipclk->pixclk, ipclk->error, and ipclk->divisor -static void +static int get_nearest_pixclk_div(pixclock_info_t* ipclk, int x2) { int pixclk_d = ipclk->pixclk_d; @@ -365,17 +460,20 @@ if (x2) clksrc *= 2; - if (clksrc < ((3*pixclk_d)+1)/2) + if (clksrc < (3*pixclk_d+1)/2) ipclk->divisor = 1; - else if (clksrc < ((5*pixclk_d)+1)/2) + else if (clksrc < (5*pixclk_d+1)/2) ipclk->divisor = 2; - else if (clksrc < ((7*pixclk_d)+1)/2) + else if (clksrc < (7*pixclk_d+1)/2) ipclk->divisor = 3; - else + else if (clksrc < (9*pixclk_d+1)/2) ipclk->divisor = 4; + else + return -ENXIO; ipclk->pixclk = clksrc / ipclk->divisor; - ipclk->error = (100*abs(pixclk_d - (ipclk->pixclk))) / pixclk_d; + ipclk->error = (100*(pixclk_d - ipclk->pixclk)) / pixclk_d; + return 0; } static int @@ -390,40 +488,41 @@ test.pixclk_d = ipclk->pixclk_d; ret.error = 100; - + if (IS_TV(info->fix.disp_type) && (info->fix.tv_filt & TV_FILT_FLICKER)) flicker_mult = 0x80; test.clksrc = info->fix.busclk; - get_nearest_pixclk_div(&test, flicker_mult != 0); - if (test.error <= MAX_PCLK_PERCENT_ERROR && test.error < ret.error) { + if (get_nearest_pixclk_div(&test, flicker_mult != 0) == 0 && + abs(test.error) < abs(ret.error)) { ret = test; src_sel = 0x01; } test.clksrc = info->fix.mclk; - get_nearest_pixclk_div(&test, flicker_mult != 0); - if (test.error <= MAX_PCLK_PERCENT_ERROR && test.error < ret.error) { + if (get_nearest_pixclk_div(&test, flicker_mult != 0) == 0 && + abs(test.error) < abs(ret.error)) { ret = test; src_sel = 0x03; } test.clksrc = info->fix.clki; - get_nearest_pixclk_div(&test, flicker_mult != 0); - if (test.error <= MAX_PCLK_PERCENT_ERROR && test.error < ret.error) { + if (get_nearest_pixclk_div(&test, flicker_mult != 0) == 0 && + abs(test.error) < abs(ret.error)) { ret = test; src_sel = 0x00; } test.clksrc = info->fix.clki2; - get_nearest_pixclk_div(&test, flicker_mult != 0); - if (test.error <= MAX_PCLK_PERCENT_ERROR && test.error < ret.error) { + if (get_nearest_pixclk_div(&test, flicker_mult != 0) == 0 && + abs(test.error) < abs(ret.error)) { ret = test; src_sel = 0x02; } - if (ret.error == 100) + if (ret.error > MAX_PCLK_ERROR_LOWER || + ret.error < MAX_PCLK_ERROR_HIGHER) return -ENXIO; ret.pixclk_bits = flicker_mult | ((ret.divisor-1)<<4) | src_sel; @@ -1243,11 +1342,10 @@ u8 main_display_mode=0; u16 height, addr_offset; int disp_type = info->fix.disp_type; - int hsync = (1000 * par->ipclk.pixclk) / (par->width + par->horiz_ndp); DPRINTK("%dx%d-%dbpp @ %d Hz, %d kHz hsync\n", par->width, par->height, par->bpp, - hsync / (par->height + par->vert_ndp), (((2*hsync)/1000)+1)/2); + par->vsync_freq, (((2*par->hsync_freq)/1000)+1)/2); #ifdef E1356FB_VERBOSE_DEBUG dump_par(par); #endif @@ -1367,63 +1465,60 @@ static int -e1356fb_verify_par(struct e1356fb_par* par, - const struct fb_info_e1356* info) +e1356fb_verify_timing(struct e1356fb_par* par, + const struct fb_info_e1356* info) { int disp_type = info->fix.disp_type; - int tv_pixclk; - - if (par->bpp != 8 && par->bpp != 16) { - DPRINTK("depth not supported: %u\n", par->bpp); - return -EINVAL; - } - - if (par->width > par->width_virt) { - DPRINTK("virtual x resolution < physical x resolution not possible\n"); - return -EINVAL; - } - - if (par->height > par->height_virt) { - DPRINTK("virtual y resolution < physical y resolution not possible\n"); - return -EINVAL; - } - - if (par->width < 320 || par->width > 2048) { - DPRINTK("width not supported: %u\n", par->width); - return -EINVAL; - } - if ((disp_type == DISP_TYPE_LCD && (par->width % 16)) || - (disp_type == DISP_TYPE_TFT && (par->width % 8))) { - DPRINTK("invalid width for panel type: %u\n", par->width); + // timing boundary checks + if (par->horiz_ndp > max_hndp[disp_type]) { + DPRINTK("horiz_ndp too big: %d\n", par->horiz_ndp); return -EINVAL; } - - if (par->height < 200 || par->height > 2048) { - DPRINTK("height not supported: %u\n", par->height); + if (par->vert_ndp > max_vndp[disp_type]) { + DPRINTK("vert_ndp too big: %d\n", par->vert_ndp); return -EINVAL; } - if (par->width_virt * par->height_virt * par->Bpp > - info->fb_size) { - DPRINTK("not enough memory for virtual screen (%ux%ux%u)\n", - par->width_virt, par->height_virt, par->bpp); - return -EINVAL; + if (disp_type != DISP_TYPE_LCD) { + if (par->hsync_start > + max_hsync_start[(par->bpp==16)][disp_type]) { + DPRINTK("hsync_start too big: %d\n", + par->hsync_start); + return -EINVAL; + } + if (par->vsync_start > max_vsync_start[disp_type]) { + DPRINTK("vsync_start too big: %d\n", + par->vsync_start); + return -EINVAL; + } + if (!IS_TV(disp_type)) { + if (par->hsync_width > max_hsync_width[disp_type]) { + DPRINTK("hsync_width too big: %d\n", + par->hsync_width); + return -EINVAL; + } + if (par->vsync_width > max_vsync_width[disp_type]) { + DPRINTK("vsync_width too big: %d\n", + par->vsync_width); + return -EINVAL; + } + } } if (IS_TV(disp_type)) { - tv_pixclk = (disp_type == DISP_TYPE_NTSC) ? + int tv_pixclk = (disp_type == DISP_TYPE_NTSC) ? NTSC_PIXCLOCK : PAL_PIXCLOCK; if (info->fix.tv_filt & TV_FILT_FLICKER) tv_pixclk *= 2; - + if (par->ipclk.pixclk_d != tv_pixclk) { DPRINTK("invalid TV pixel clock %u kHz\n", par->ipclk.pixclk_d); return -EINVAL; } } - + if (e1356_calc_pixclock(info, &par->ipclk) < 0) { DPRINTK("can't set pixel clock %u kHz\n", par->ipclk.pixclk_d); @@ -1435,7 +1530,6 @@ par->ipclk.pixclk_d, par->ipclk.pixclk, par->ipclk.error); #endif - // timing checks if (disp_type != DISP_TYPE_LCD) { if (par->horiz_ndp < par->hsync_start + par->hsync_width) { DPRINTK("invalid horiz. timing\n"); @@ -1460,9 +1554,73 @@ } } + par->hsync_freq = (1000 * par->ipclk.pixclk) / + (par->width + par->horiz_ndp); + par->vsync_freq = par->hsync_freq / (par->height + par->vert_ndp); + + if (par->hsync_freq < 30000 || par->hsync_freq > 90000) { + DPRINTK("hsync freq too %s: %u Hz\n", + par->hsync_freq < 30000 ? "low" : "high", + par->hsync_freq); + return -EINVAL; + } + if (par->vsync_freq < 50 || par->vsync_freq > 110) { + DPRINTK("vsync freq too %s: %u Hz\n", + par->vsync_freq < 50 ? "low" : "high", + par->vsync_freq); + return -EINVAL; + } + return 0; } +static int +e1356fb_verify_par(struct e1356fb_par* par, + const struct fb_info_e1356* info) +{ + int disp_type = info->fix.disp_type; + + if (par->bpp != 8 && par->bpp != 16) { + DPRINTK("depth not supported: %u bpp\n", par->bpp); + return -EINVAL; + } + + if (par->width > par->width_virt) { + DPRINTK("virtual x resolution < physical x resolution not possible\n"); + return -EINVAL; + } + + if (par->height > par->height_virt) { + DPRINTK("virtual y resolution < physical y resolution not possible\n"); + return -EINVAL; + } + + if (par->width < 320 || par->width > 1024) { + DPRINTK("width not supported: %u\n", par->width); + return -EINVAL; + } + + if ((disp_type == DISP_TYPE_LCD && (par->width % 16)) || + (disp_type == DISP_TYPE_TFT && (par->width % 8))) { + DPRINTK("invalid width for panel type: %u\n", par->width); + return -EINVAL; + } + + if (par->height < 200 || par->height > 1024) { + DPRINTK("height not supported: %u\n", par->height); + return -EINVAL; + } + + if (par->width_virt * par->height_virt * par->Bpp > + info->fb_size) { + DPRINTK("not enough memory for virtual screen (%ux%ux%u)\n", + par->width_virt, par->height_virt, par->bpp); + return -EINVAL; + } + + return e1356fb_verify_timing(par, info); +} + static int e1356fb_var_to_par(const struct fb_var_screeninfo* var, @@ -1485,14 +1643,15 @@ par->ipclk.pixclk_d = PICOS2KHZ(var->pixclock); - par->horiz_ndp = var->left_margin + var->right_margin + var->hsync_len; par->hsync_start = var->right_margin; par->hsync_width = var->hsync_len; - - par->vert_ndp = var->upper_margin + var->lower_margin + var->vsync_len; + par->vsync_start = var->lower_margin; par->vsync_width = var->vsync_len; + par->horiz_ndp = var->left_margin + var->right_margin + var->hsync_len; + par->vert_ndp = var->upper_margin + var->lower_margin + var->vsync_len; + par->hsync_pol = (var->sync & FB_SYNC_HOR_HIGH_ACT) ? 1 : 0; par->vsync_pol = (var->sync & FB_SYNC_VERT_HIGH_ACT) ? 1 : 0; @@ -1677,16 +1836,35 @@ int activate = var->activate; int j,k; - //DPRINTK("\n"); - + DPRINTK("\n"); + if (con >= 0) display = &fb_display[con]; else display = fb->disp; /* used during initialization */ - - if ((err = e1356fb_var_to_par(var, &par, info))) - return err; + if ((err = e1356fb_var_to_par(var, &par, info))) { + struct fb_videomode *dm; + /* + * this mode didn't pass the tests. Try the + * corresponding mode from our own modedb. + */ + DPRINTK("req mode failed, trying SED1356 %dx%d mode\n", + var->xres, var->yres); + if (e1356fb_get_mode(info, var->xres, + var->yres, NULL, &dm) < 0) { + DPRINTK("no SED1356 %dx%d mode found, failed\n", + var->xres, var->yres); + return err; + } + fb_videomode_to_var(dm, var); + if ((err = e1356fb_var_to_par(var, &par, info))) { + DPRINTK("SED1356 %dx%d mode failed\n", + var->xres, var->yres); + return err; + } + } + if (info->fix.tv_filt & TV_FILT_FLICKER) printk("e1356fb: TV flicker filter enabled\n"); @@ -2121,19 +2299,19 @@ // Find the highest allowable MCLK epfix->mclk = mclk_cfg = 0; - if (epfix->busclk <= 40000 && epfix->busclk > epfix->mclk) { + if (epfix->busclk <= MAX_PIXCLOCK && epfix->busclk > epfix->mclk) { epfix->mclk = epfix->busclk; mclk_cfg = 0x01; } - if (epfix->clki <= 40000 && epfix->clki > epfix->mclk) { + if (epfix->clki <= MAX_PIXCLOCK && epfix->clki > epfix->mclk) { epfix->mclk = epfix->clki; mclk_cfg = 0x00; } - if (epfix->busclk/2 <= 40000 && epfix->busclk/2 > epfix->mclk) { + if (epfix->busclk/2 <= MAX_PIXCLOCK && epfix->busclk/2 > epfix->mclk) { epfix->mclk = epfix->busclk/2; mclk_cfg = 0x11; } - if (epfix->clki/2 <= 40000 && epfix->clki/2 > epfix->mclk) { + if (epfix->clki/2 <= MAX_PIXCLOCK && epfix->clki/2 > epfix->mclk) { epfix->mclk = epfix->clki/2; mclk_cfg = 0x10; } @@ -2329,24 +2507,23 @@ * fb_find_mode. */ if (epfix->mode_option) { - struct fb_videomode* dm; - if (IS_PANEL(epfix->disp_type)) { - dm = &panel_default_mode[1]; - } else if (epfix->disp_type == DISP_TYPE_CRT) { - dm = &crt_default_mode[1]; - } else if (epfix->disp_type == DISP_TYPE_NTSC) { - dm = &ntsc_default_mode[0]; - } else { - dm = &pal_default_mode[0]; - } - // throw the max pixclock at it - dm->pixclock = KHZ2PICOS(fb_info.max_pixclock); - + struct fb_videomode* modedb, *dm; + int dbsize = e1356fb_get_mode(&fb_info, 640, 480, &modedb, &dm); + + // first try the generic modedb if (!fb_find_mode(&var, &fb_info.fb_info, epfix->mode_option, - NULL, 0, dm, boot_par.bpp)) { - printk("e1356fb: mode %s and default mode failed\n", + NULL, 0, NULL, boot_par.bpp)) { + printk("e1356fb: mode %s failed, trying e1356 modedb\n", epfix->mode_option); - goto ret_enxio; + // didn't work in generic modedb, try ours + if (!fb_find_mode(&var, &fb_info.fb_info, + epfix->mode_option, + modedb, dbsize, dm, boot_par.bpp)) { + printk("e1356fb: mode %s failed e1356 modedb too, sorry\n", + epfix->mode_option); + + goto ret_enxio; + } } var.xres_virtual = boot_par.width_virt ? @@ -2795,7 +2972,6 @@ h = fb_info.cursor.h; w = fb_info.cursor.w; - DPRINTK("w=%d\n", w); u = fb_info.cursor.u; memcursor = fb_info.membase_virt + fb_info.fb_size; Index: epson1356fb.h =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/video/epson1356fb.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- epson1356fb.h 2001/09/12 22:23:31 1.4 +++ epson1356fb.h 2001/10/10 19:21:06 1.5 @@ -27,7 +27,7 @@ */ #ifdef E1356FB_DEBUG -#define DPRINTK(a,b...) printk(KERN_INFO "e1356fb: %s: " a, __FUNCTION__ , ## b) +#define DPRINTK(a,b...) printk(KERN_DEBUG "e1356fb: %s: " a, __FUNCTION__ , ## b) #else #define DPRINTK(a,b...) #endif @@ -37,14 +37,17 @@ #define PICOS2KHZ(a) (1000000000UL/(a)) #define KHZ2PICOS(a) (1000000000UL/(a)) +#define MAX_PIXCLOCK 40000 // KHz #define NTSC_PIXCLOCK 14318 // KHz #define PAL_PIXCLOCK 17734 // KHz /* - * Maximum percent error between desired pixel clock and - * supported pixel clock. + * Maximum percent errors between desired pixel clock and + * supported pixel clock. Lower-than and higher-than desired + * clock percent errors. */ -#define MAX_PCLK_PERCENT_ERROR 10 +#define MAX_PCLK_ERROR_LOWER 10 +#define MAX_PCLK_ERROR_HIGHER -1 #define fontwidth_x8(p) (((fontwidth(p) + 7) >> 3) << 3) @@ -278,6 +281,22 @@ DISP_TYPE_NTSC }; +/* + * Maximum timing values, as determined by the SED1356 register + * field sizes. All are indexed by display type, except + * max_hsync_start which is first indexed by color depth, + * then by display type. + */ +static const int max_hndp[5] = {256, 256, 512, 511, 510}; +static const int max_hsync_start[2][5] = { + {0, 252, 507, 505, 505}, // 8 bpp + {0, 254, 509, 507, 507} // 16 bpp +}; +static const int max_hsync_width[5] = {0, 128, 128, 0, 0}; +static const int max_vndp[5] = {64, 64, 128, 128, 128}; +static const int max_vsync_start[5] = {0, 64, 128, 128, 128}; +static const int max_vsync_width[5] = {0, 8, 8, 0, 0}; + #define IS_PANEL(disp_type) \ (disp_type == DISP_TYPE_LCD || disp_type == DISP_TYPE_TFT) #define IS_CRT(disp_type) (disp_type == DISP_TYPE_CRT) @@ -363,10 +382,12 @@ // FPLINE for TFT). 0=active lo, 1=active hi int hsync_start; // Horiz. Sync Start position, pixels int hsync_width; // Horiz. Sync Pulse width, pixels + int hsync_freq; // calculated horizontal sync frequency int vsync_pol; // Polarity of vert. sync signal (VRTC for CRT/TV, // FPFRAME for TFT). 0=active lo, 1=active hi int vsync_start; // Vert. Sync Start position, lines int vsync_width; // Vert. Sync Pulse width, lines + int vsync_freq; // calculated vertical sync frequency int cmap_len; // color-map length }; @@ -489,7 +510,7 @@ { // par 0, 0, 1024, 768, 8, 1, // timings will be set by modedb - {0}, 0, 0, 0, 0, 0, 0, 0, 0, + {0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256 } }, @@ -522,7 +543,7 @@ { // par 0, 0, 1024, 768, 8, 1, // timings will be set by modedb - {0}, 0, 0, 0, 0, 0, 0, 0, 0, + {0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256 } }, @@ -553,7 +574,7 @@ { // par 0, 0, 1024, 768, 16, 2, // timings will be set by modedb - {0}, 0, 0, 0, 0, 0, 0, 0, 0, + {0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 } } |