summaryrefslogtreecommitdiffstats
path: root/drivers/video/via/accel.c
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2009-09-22 16:47:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 07:39:51 -0700
commit81228a36a5d05181fff990c852a9abdf03c75593 (patch)
tree9c741b06e6a6ea7548545906b6bc16c5a45dfe38 /drivers/video/via/accel.c
parent3915a927aaed8d158cba5ad6466e237ae0d84aab (diff)
downloadlinux-81228a36a5d05181fff990c852a9abdf03c75593.tar.gz
linux-81228a36a5d05181fff990c852a9abdf03c75593.tar.bz2
linux-81228a36a5d05181fff990c852a9abdf03c75593.zip
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 <FlorianSchandinat@gmx.de> Cc: Scott Fang <ScottFang@viatech.com.cn> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Harald Welte <laforge@gnumonks.org> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/via/accel.c')
-rw-r--r--drivers/video/via/accel.c13
1 files changed, 5 insertions, 8 deletions
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)