Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325225
b: refs/heads/master
c: a09f347
h: refs/heads/master
i:
  325223: 442dcce
v: v3
  • Loading branch information
Aaro Koskinen authored and Greg Kroah-Hartman committed Sep 12, 2012
1 parent a2d539d commit 983f37f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: f325129ae9006298cfbeffb669b30f57ba0cc3c4
refs/heads/master: a09f347c6cc0b2821557d1346c4733cc78a79ffa
11 changes: 9 additions & 2 deletions trunk/drivers/staging/xgifb/XGI_main_26.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ static int XGIfb_validate_mode(struct xgifb_video_info *xgifb_info, int myindex)
{
u16 xres, yres;
struct xgi_hw_device_info *hw_info = &xgifb_info->hw_info;
unsigned long required_mem;

if (xgifb_info->chip == XG21) {
if (xgifb_info->display2 == XGIFB_DISP_LCD) {
Expand All @@ -345,13 +346,13 @@ static int XGIfb_validate_mode(struct xgifb_video_info *xgifb_info, int myindex)
}

}
return myindex;
goto check_memory;

}

/* FIXME: for now, all is valid on XG27 */
if (xgifb_info->chip == XG27)
return myindex;
goto check_memory;

if (!(XGIbios_mode[myindex].chipset & MD_XGI315))
return -1;
Expand Down Expand Up @@ -539,6 +540,12 @@ static int XGIfb_validate_mode(struct xgifb_video_info *xgifb_info, int myindex)
case XGIFB_DISP_NONE:
break;
}

check_memory:
required_mem = XGIbios_mode[myindex].xres * XGIbios_mode[myindex].yres *
XGIbios_mode[myindex].bpp / 8;
if (required_mem > xgifb_info->video_size)
return -1;
return myindex;

}
Expand Down

0 comments on commit 983f37f

Please sign in to comment.