Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271275
b: refs/heads/master
c: 936a3f7
h: refs/heads/master
i:
  271273: 6c38524
  271271: f85e038
v: v3
  • Loading branch information
Florian Tobias Schandinat authored and Florian Tobias Schandinat committed Jul 17, 2011
1 parent bf34d21 commit 5bb25bb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d933990c57b498c092ceef591c7c5d69dbfe9f30
refs/heads/master: 936a3f770b8de7042d793272f008ef1bb08522e9
5 changes: 5 additions & 0 deletions trunk/drivers/video/via/via_modesetting.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@

#include <linux/types.h>


#define VIA_PITCH_SIZE (1<<3)
#define VIA_PITCH_MAX 0x3FF8


void via_set_primary_address(u32 addr);
void via_set_secondary_address(u32 addr);
void via_set_primary_pitch(u32 pitch);
Expand Down
11 changes: 8 additions & 3 deletions trunk/drivers/video/via/viafbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ static void viafb_update_fix(struct fb_info *info)

info->fix.visual =
bpp == 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
info->fix.line_length = (info->var.xres_virtual * bpp / 8 + 7) & ~7;
info->fix.line_length = ALIGN(info->var.xres_virtual * bpp / 8,
VIA_PITCH_SIZE);
}

static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix,
Expand Down Expand Up @@ -238,8 +239,12 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
depth = 24;

viafb_fill_var_color_info(var, depth);
line = (var->xres_virtual * var->bits_per_pixel / 8 + 7) & ~7;
if (line * var->yres_virtual > ppar->memsize)
if (var->xres_virtual < var->xres)
var->xres_virtual = var->xres;

line = ALIGN(var->xres_virtual * var->bits_per_pixel / 8,
VIA_PITCH_SIZE);
if (line > VIA_PITCH_MAX || line * var->yres_virtual > ppar->memsize)
return -EINVAL;

/* Based on var passed in to calculate the refresh,
Expand Down

0 comments on commit 5bb25bb

Please sign in to comment.