From 81228a36a5d05181fff990c852a9abdf03c75593 Mon Sep 17 00:00:00 2001 From: Florian Tobias Schandinat Date: Tue, 22 Sep 2009 16:47:13 -0700 Subject: viafb: merge viafb_update_viafb_par in viafb_update_fix Shrink and merge viafb_update_viafb_par. This removes a lot of duplicated data in viafb_par. Use the relevant data of fb_info instead. On the way it removes an inconsistency in handling a second framebuffer which only worked because viafbinfo1->par is modified to point to the same viafb_par as viafbinfo->par. Code cleanup only, no runtime change expected. Signed-off-by: Florian Tobias Schandinat Cc: Scott Fang Cc: Joseph Chan Cc: Harald Welte Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/via/accel.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'drivers/video/via/accel.c') diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c index 45c54bfe99bb..b3e7e8246326 100644 --- a/drivers/video/via/accel.c +++ b/drivers/video/via/accel.c @@ -34,7 +34,7 @@ void viafb_init_accel(void) void viafb_init_2d_engine(void) { - u32 dwVQStartAddr, dwVQEndAddr; + u32 dwVQStartAddr, dwVQEndAddr, linesize; u32 dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; /* init 2D engine regs to reset 2D engine */ @@ -191,17 +191,14 @@ void viafb_init_2d_engine(void) } } - viafb_set_2d_color_depth(viaparinfo->bpp); + viafb_set_2d_color_depth(viafbinfo->var.bits_per_pixel); writel(0x0, viaparinfo->io_virt + VIA_REG_SRCBASE); writel(0x0, viaparinfo->io_virt + VIA_REG_DSTBASE); - writel(VIA_PITCH_ENABLE | - (((viaparinfo->hres * - viaparinfo->bpp >> 3) >> 3) | (((viaparinfo->hres * - viaparinfo-> - bpp >> 3) >> 3) << 16)), - viaparinfo->io_virt + VIA_REG_PITCH); + linesize = viafbinfo->var.xres * viafbinfo->var.bits_per_pixel >> 3; + writel(VIA_PITCH_ENABLE | (linesize >> 3) | ((linesize >> 3) << 16), + viaparinfo->io_virt + VIA_REG_PITCH); } void viafb_set_2d_color_depth(int bpp) -- cgit v1.2.3-70-g09d2