diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-11-11 17:26:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-12 10:25:56 -0500 |
commit | f5c15d0b37ab1cd3969b8ce7828ab41c79f36f77 (patch) | |
tree | a12aaef93ef8cc75eb5488294c64c5bf9d01546c /drivers | |
parent | 9d0ed60fe9cd1fbf57f755cd27a23ae9114d7210 (diff) |
fb: remove fb_save_state() and fb_restore_state operations
Remove fb_save_state() and fb_restore_state operations from frame buffer layer.
They are used only in two drivers:
1. savagefb - and cause bug #11248
2. uvesafb
Usage of these operations is misunderstood in both drivers so kill these
operations, fix the bug #11248 and avoid confusion in the future.
Tested on Savage 3D/MV card and the patch fixes the bug #11248.
The frame buffer layer uses these funtions during switch between graphics
and text mode of the console, but these drivers saves state before
switching of the frame buffer (in the fb_open) and after releasing it (in
the fb_release). This defeats the purpose of these operations.
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=11248
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Reported-by: Jochen Hein <jochen@jochen.org>
Tested-by: Jochen Hein <jochen@jochen.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michal Januszewski <spock@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/atafb.c | 6 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 5 | ||||
-rw-r--r-- | drivers/video/savage/savagefb_driver.c | 18 | ||||
-rw-r--r-- | drivers/video/uvesafb.c | 28 |
4 files changed, 1 insertions, 56 deletions
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index 8cd279be74e5..37624f74e88b 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c | |||
@@ -329,12 +329,6 @@ extern unsigned char fontdata_8x16[]; | |||
329 | * | 329 | * |
330 | * * perform fb specific mmap * | 330 | * * perform fb specific mmap * |
331 | * int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); | 331 | * int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); |
332 | * | ||
333 | * * save current hardware state * | ||
334 | * void (*fb_save_state)(struct fb_info *info); | ||
335 | * | ||
336 | * * restore saved state * | ||
337 | * void (*fb_restore_state)(struct fb_info *info); | ||
338 | * } ; | 332 | * } ; |
339 | */ | 333 | */ |
340 | 334 | ||
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 5a686cea23f4..3681c6a88212 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -2311,14 +2311,11 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) | |||
2311 | ops->graphics = 1; | 2311 | ops->graphics = 1; |
2312 | 2312 | ||
2313 | if (!blank) { | 2313 | if (!blank) { |
2314 | if (info->fbops->fb_save_state) | ||
2315 | info->fbops->fb_save_state(info); | ||
2316 | var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE; | 2314 | var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE; |
2317 | fb_set_var(info, &var); | 2315 | fb_set_var(info, &var); |
2318 | ops->graphics = 0; | 2316 | ops->graphics = 0; |
2319 | ops->var = info->var; | 2317 | ops->var = info->var; |
2320 | } else if (info->fbops->fb_restore_state) | 2318 | } |
2321 | info->fbops->fb_restore_state(info); | ||
2322 | } | 2319 | } |
2323 | 2320 | ||
2324 | if (!fbcon_is_inactive(vc, info)) { | 2321 | if (!fbcon_is_inactive(vc, info)) { |
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 37b135d5d12e..0857b3b8c495 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
@@ -1606,22 +1606,6 @@ static int savagefb_blank(int blank, struct fb_info *info) | |||
1606 | return (blank == FB_BLANK_NORMAL) ? 1 : 0; | 1606 | return (blank == FB_BLANK_NORMAL) ? 1 : 0; |
1607 | } | 1607 | } |
1608 | 1608 | ||
1609 | static void savagefb_save_state(struct fb_info *info) | ||
1610 | { | ||
1611 | struct savagefb_par *par = info->par; | ||
1612 | |||
1613 | savage_get_default_par(par, &par->save); | ||
1614 | } | ||
1615 | |||
1616 | static void savagefb_restore_state(struct fb_info *info) | ||
1617 | { | ||
1618 | struct savagefb_par *par = info->par; | ||
1619 | |||
1620 | savagefb_blank(FB_BLANK_POWERDOWN, info); | ||
1621 | savage_set_default_par(par, &par->save); | ||
1622 | savagefb_blank(FB_BLANK_UNBLANK, info); | ||
1623 | } | ||
1624 | |||
1625 | static int savagefb_open(struct fb_info *info, int user) | 1609 | static int savagefb_open(struct fb_info *info, int user) |
1626 | { | 1610 | { |
1627 | struct savagefb_par *par = info->par; | 1611 | struct savagefb_par *par = info->par; |
@@ -1667,8 +1651,6 @@ static struct fb_ops savagefb_ops = { | |||
1667 | .fb_setcolreg = savagefb_setcolreg, | 1651 | .fb_setcolreg = savagefb_setcolreg, |
1668 | .fb_pan_display = savagefb_pan_display, | 1652 | .fb_pan_display = savagefb_pan_display, |
1669 | .fb_blank = savagefb_blank, | 1653 | .fb_blank = savagefb_blank, |
1670 | .fb_save_state = savagefb_save_state, | ||
1671 | .fb_restore_state = savagefb_restore_state, | ||
1672 | #if defined(CONFIG_FB_SAVAGE_ACCEL) | 1654 | #if defined(CONFIG_FB_SAVAGE_ACCEL) |
1673 | .fb_fillrect = savagefb_fillrect, | 1655 | .fb_fillrect = savagefb_fillrect, |
1674 | .fb_copyarea = savagefb_copyarea, | 1656 | .fb_copyarea = savagefb_copyarea, |
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index e35232a18571..54fbb2995a5f 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c | |||
@@ -1411,23 +1411,6 @@ static int uvesafb_check_var(struct fb_var_screeninfo *var, | |||
1411 | return 0; | 1411 | return 0; |
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | static void uvesafb_save_state(struct fb_info *info) | ||
1415 | { | ||
1416 | struct uvesafb_par *par = info->par; | ||
1417 | |||
1418 | if (par->vbe_state_saved) | ||
1419 | kfree(par->vbe_state_saved); | ||
1420 | |||
1421 | par->vbe_state_saved = uvesafb_vbe_state_save(par); | ||
1422 | } | ||
1423 | |||
1424 | static void uvesafb_restore_state(struct fb_info *info) | ||
1425 | { | ||
1426 | struct uvesafb_par *par = info->par; | ||
1427 | |||
1428 | uvesafb_vbe_state_restore(par, par->vbe_state_saved); | ||
1429 | } | ||
1430 | |||
1431 | static struct fb_ops uvesafb_ops = { | 1414 | static struct fb_ops uvesafb_ops = { |
1432 | .owner = THIS_MODULE, | 1415 | .owner = THIS_MODULE, |
1433 | .fb_open = uvesafb_open, | 1416 | .fb_open = uvesafb_open, |
@@ -1441,8 +1424,6 @@ static struct fb_ops uvesafb_ops = { | |||
1441 | .fb_imageblit = cfb_imageblit, | 1424 | .fb_imageblit = cfb_imageblit, |
1442 | .fb_check_var = uvesafb_check_var, | 1425 | .fb_check_var = uvesafb_check_var, |
1443 | .fb_set_par = uvesafb_set_par, | 1426 | .fb_set_par = uvesafb_set_par, |
1444 | .fb_save_state = uvesafb_save_state, | ||
1445 | .fb_restore_state = uvesafb_restore_state, | ||
1446 | }; | 1427 | }; |
1447 | 1428 | ||
1448 | static void __devinit uvesafb_init_info(struct fb_info *info, | 1429 | static void __devinit uvesafb_init_info(struct fb_info *info, |
@@ -1459,15 +1440,6 @@ static void __devinit uvesafb_init_info(struct fb_info *info, | |||
1459 | info->fix.ypanstep = par->ypan ? 1 : 0; | 1440 | info->fix.ypanstep = par->ypan ? 1 : 0; |
1460 | info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0; | 1441 | info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0; |
1461 | 1442 | ||
1462 | /* | ||
1463 | * If we were unable to get the state buffer size, disable | ||
1464 | * functions for saving and restoring the hardware state. | ||
1465 | */ | ||
1466 | if (par->vbe_state_size == 0) { | ||
1467 | info->fbops->fb_save_state = NULL; | ||
1468 | info->fbops->fb_restore_state = NULL; | ||
1469 | } | ||
1470 | |||
1471 | /* Disable blanking if the user requested so. */ | 1443 | /* Disable blanking if the user requested so. */ |
1472 | if (!blank) | 1444 | if (!blank) |
1473 | info->fbops->fb_blank = NULL; | 1445 | info->fbops->fb_blank = NULL; |