Skip to content

Commit

Permalink
video: s3c-fb: fix virtual resolution checking
Browse files Browse the repository at this point in the history
This patch fixes mishandling in virtual resolution checking.
Previously, virtual resolution is changed to virtual_x and virtual_y
which mean the size for buffer allocation, when s3c_fb_check_var is
called by fb_check_var. However, it is meaningless, since virtual_x
and virtual_y are fixed and user cannot change virtual resolution.
Therefore, virtual resolution should be more than resolution
such as xres and yres.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Jingoo Han authored and Paul Mundt committed Jun 9, 2011
1 parent 72ba4cb commit 13e6af8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/video/s3c-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,12 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
struct fb_info *info)
{
struct s3c_fb_win *win = info->par;
struct s3c_fb_pd_win *windata = win->windata;
struct s3c_fb *sfb = win->parent;

dev_dbg(sfb->dev, "checking parameters\n");

var->xres_virtual = max((unsigned int)windata->virtual_x, var->xres);
var->yres_virtual = max((unsigned int)windata->virtual_y, var->yres);
var->xres_virtual = max(var->xres_virtual, var->xres);
var->yres_virtual = max(var->yres_virtual, var->yres);

if (!s3c_fb_validate_win_bpp(win, var->bits_per_pixel)) {
dev_dbg(sfb->dev, "win %d: unsupported bpp %d\n",
Expand Down

0 comments on commit 13e6af8

Please sign in to comment.