提交 5c60b118 编写于 作者: R Raphael Assenat 提交者: Linus Torvalds

[PATCH] mbxfb: Fix framebuffer size smaller than requested

This patch fixes a bug where we obtain a smaller resolution than requested.
(eg: in 640x480, only 639x479 usable pixels).

This was due to 1 being substracted from the xres and yres vars two times:
first in mbxfb.c and then in the macros from reg_bits.h.

This patch removes the minus ones from the mbxfb.c file. Tested and works.
Signed-off-by: NRaphael Assenat <raph@8d.com>
Signed-off-by: NAntonino Daplas <adaplas@pol.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8bc21841
...@@ -255,8 +255,8 @@ static int mbxfb_set_par(struct fb_info *info) ...@@ -255,8 +255,8 @@ static int mbxfb_set_par(struct fb_info *info)
/* setup resolution */ /* setup resolution */
gsctrl &= ~(FMsk(GSCTRL_GSWIDTH) | FMsk(GSCTRL_GSHEIGHT)); gsctrl &= ~(FMsk(GSCTRL_GSWIDTH) | FMsk(GSCTRL_GSHEIGHT));
gsctrl |= Gsctrl_Width(info->var.xres - 1) | gsctrl |= Gsctrl_Width(info->var.xres) |
Gsctrl_Height(info->var.yres - 1); Gsctrl_Height(info->var.yres);
writel(gsctrl, GSCTRL); writel(gsctrl, GSCTRL);
udelay(1000); udelay(1000);
...@@ -413,8 +413,8 @@ static void __devinit setup_graphics(struct fb_info *fbi) ...@@ -413,8 +413,8 @@ static void __devinit setup_graphics(struct fb_info *fbi)
{ {
unsigned long gsctrl; unsigned long gsctrl;
gsctrl = GSCTRL_GAMMA_EN | Gsctrl_Width(fbi->var.xres - 1) | gsctrl = GSCTRL_GAMMA_EN | Gsctrl_Width(fbi->var.xres) |
Gsctrl_Height(fbi->var.yres - 1); Gsctrl_Height(fbi->var.yres);
switch (fbi->var.bits_per_pixel) { switch (fbi->var.bits_per_pixel) {
case 16: case 16:
if (fbi->var.green.length == 5) if (fbi->var.green.length == 5)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册