diff options
Diffstat (limited to 'drivers/video/via')
-rw-r--r-- | drivers/video/via/accel.c | 5 | ||||
-rw-r--r-- | drivers/video/via/dvi.c | 4 | ||||
-rw-r--r-- | drivers/video/via/lcd.c | 40 | ||||
-rw-r--r-- | drivers/video/via/viafbdev.c | 17 |
4 files changed, 29 insertions, 37 deletions
diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c index 9d4f3a49ba4..d5077dfa9e0 100644 --- a/drivers/video/via/accel.c +++ b/drivers/video/via/accel.c @@ -137,7 +137,7 @@ static int hw_bitblt_1(void __iomem *engine, u8 op, u32 width, u32 height, tmp, dst_pitch); return -EINVAL; } - tmp = (tmp >> 3) | (dst_pitch << (16 - 3)); + tmp = VIA_PITCH_ENABLE | (tmp >> 3) | (dst_pitch << (16 - 3)); writel(tmp, engine + 0x38); if (op == VIA_BITBLT_FILL) @@ -352,6 +352,9 @@ int viafb_init_engine(struct fb_info *info) viapar->shared->vq_vram_addr = viapar->fbmem_free; viapar->fbmem_used += VQ_SIZE; + /* Init 2D engine reg to reset 2D engine */ + writel(0x0, engine + VIA_REG_KEYCONTROL); + /* Init AGP and VQ regs */ switch (chip_name) { case UNICHROME_K8M890: diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c index c5c32b6b6e6..67b36932212 100644 --- a/drivers/video/via/dvi.c +++ b/drivers/video/via/dvi.c @@ -467,7 +467,7 @@ static int dvi_get_panel_size_from_DDCv1(void) default: viaparinfo->tmds_setting_info->dvi_panel_size = VIA_RES_1024X768; - DEBUG_MSG(KERN_INFO "Unknow panel size max resolution = %d !\ + DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d !\ set default panel size.\n", max_h); break; } @@ -534,7 +534,7 @@ static int dvi_get_panel_size_from_DDCv2(void) default: viaparinfo->tmds_setting_info->dvi_panel_size = VIA_RES_1024X768; - DEBUG_MSG(KERN_INFO "Unknow panel size max resolution = %d!\ + DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d!\ set default panel size.\n", HSize); break; } diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c index e3e597f937a..09353e2b92f 100644 --- a/drivers/video/via/lcd.c +++ b/drivers/video/via/lcd.c @@ -1134,45 +1134,33 @@ static void integrated_lvds_enable(struct lvds_setting_information *plvds_setting_info, struct lvds_chip_information *plvds_chip_info) { - bool turn_on_first_powersequence = false; - bool turn_on_second_powersequence = false; - DEBUG_MSG(KERN_INFO "integrated_lvds_enable, out_interface:%d\n", plvds_chip_info->output_interface); if (plvds_setting_info->lcd_mode == LCD_SPWG) viafb_write_reg_mask(CRD2, VIACR, 0x00, BIT0 + BIT1); - else + else viafb_write_reg_mask(CRD2, VIACR, 0x03, BIT0 + BIT1); - if (INTERFACE_LVDS0LVDS1 == plvds_chip_info->output_interface) - turn_on_first_powersequence = true; - if (INTERFACE_LVDS0 == plvds_chip_info->output_interface) - turn_on_first_powersequence = true; - if (INTERFACE_LVDS1 == plvds_chip_info->output_interface) - turn_on_second_powersequence = true; - - if (turn_on_second_powersequence) { - /* Use second power sequence control: */ - - /* Use hardware control power sequence. */ - viafb_write_reg_mask(CRD3, VIACR, 0, BIT0); - - /* Turn on back light. */ - viafb_write_reg_mask(CRD3, VIACR, 0, BIT6 + BIT7); - /* Turn on hardware power sequence. */ - viafb_write_reg_mask(CRD4, VIACR, 0x02, BIT1); - } - if (turn_on_first_powersequence) { + switch (plvds_chip_info->output_interface) { + case INTERFACE_LVDS0LVDS1: + case INTERFACE_LVDS0: /* Use first power sequence control: */ - /* Use hardware control power sequence. */ viafb_write_reg_mask(CR91, VIACR, 0, BIT0); - /* Turn on back light. */ viafb_write_reg_mask(CR91, VIACR, 0, BIT6 + BIT7); - /* Turn on hardware power sequence. */ viafb_write_reg_mask(CR6A, VIACR, 0x08, BIT3); + break; + case INTERFACE_LVDS1: + /* Use second power sequence control: */ + /* Use hardware control power sequence. */ + viafb_write_reg_mask(CRD3, VIACR, 0, BIT0); + /* Turn on back light. */ + viafb_write_reg_mask(CRD3, VIACR, 0, BIT6 + BIT7); + /* Turn on hardware power sequence. */ + viafb_write_reg_mask(CRD4, VIACR, 0x02, BIT1); + break; } /* Turn DFP High/Low pad on. */ diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 56ec696e8af..3028e7ddc3b 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c @@ -177,16 +177,15 @@ static int viafb_set_par(struct fb_info *info) } if (vmode_index != VIA_RES_INVALID) { - viafb_setmode(vmode_index, info->var.xres, info->var.yres, - info->var.bits_per_pixel, vmode_index1, - viafb_second_xres, viafb_second_yres, viafb_bpp1); - viafb_update_fix(info); viafb_bpp = info->var.bits_per_pixel; if (info->var.accel_flags & FB_ACCELF_TEXT) info->flags &= ~FBINFO_HWACCEL_DISABLED; else info->flags |= FBINFO_HWACCEL_DISABLED; + viafb_setmode(vmode_index, info->var.xres, info->var.yres, + info->var.bits_per_pixel, vmode_index1, + viafb_second_xres, viafb_second_yres, viafb_bpp1); } return 0; @@ -680,7 +679,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) if (!viafb_gamma_table) return -ENOMEM; if (copy_from_user(viafb_gamma_table, argp, - sizeof(viafb_gamma_table))) { + 256 * sizeof(u32))) { kfree(viafb_gamma_table); return -EFAULT; } @@ -694,7 +693,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) return -ENOMEM; viafb_get_gamma_table(viafb_gamma_table); if (copy_to_user(argp, viafb_gamma_table, - sizeof(viafb_gamma_table))) { + 256 * sizeof(u32))) { kfree(viafb_gamma_table); return -EFAULT; } @@ -872,7 +871,9 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) if (info->flags & FBINFO_HWACCEL_DISABLED || info != viafbinfo) return -ENODEV; - if (chip_name == UNICHROME_CLE266 && viapar->iga_path == IGA2) + /* LCD ouput does not support hw cursors (at least on VN896) */ + if ((chip_name == UNICHROME_CLE266 && viapar->iga_path == IGA2) || + viafb_LCD_ON) return -ENODEV; viafb_show_hw_cursor(info, HW_Cursor_OFF); @@ -1797,7 +1798,7 @@ static const struct file_operations viafb_vt1636_proc_fops = { static void viafb_init_proc(struct proc_dir_entry **viafb_entry) { *viafb_entry = proc_mkdir("viafb", NULL); - if (viafb_entry) { + if (*viafb_entry) { proc_create("dvp0", 0, *viafb_entry, &viafb_dvp0_proc_fops); proc_create("dvp1", 0, *viafb_entry, &viafb_dvp1_proc_fops); proc_create("dfph", 0, *viafb_entry, &viafb_dfph_proc_fops); |