aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-08-15 02:11:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-26 00:08:37 -0400
commitc78a7c2dd913e68ce853d43edaba14eac91b2fd1 (patch)
treefdb0d56a04bbcaa3d14327873ec7cb1a9b527e26
parentb887d2e63c8857149ef59eb6e05adfaa018b8ebf (diff)
PM: video drivers and PM_EVENT_PRETHAW
Video drivers which explicitly test for messages reporting PM_EVENT_FREEZE will now handle PM_EVENT_PRETHAW the same way. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/video/aty/radeon_pm.c15
-rw-r--r--drivers/video/i810/i810_main.c12
-rw-r--r--drivers/video/nvidia/nvidia.c13
-rw-r--r--drivers/video/savage/savagefb_driver.c14
4 files changed, 30 insertions, 24 deletions
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index e308ed2d249a..365de5dcc888 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -2621,25 +2621,28 @@ static int radeon_restore_pci_cfg(struct radeonfb_info *rinfo)
2621} 2621}
2622 2622
2623 2623
2624int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) 2624int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
2625{ 2625{
2626 struct fb_info *info = pci_get_drvdata(pdev); 2626 struct fb_info *info = pci_get_drvdata(pdev);
2627 struct radeonfb_info *rinfo = info->par; 2627 struct radeonfb_info *rinfo = info->par;
2628 int i; 2628 int i;
2629 2629
2630 if (state.event == pdev->dev.power.power_state.event) 2630 if (mesg.event == pdev->dev.power.power_state.event)
2631 return 0; 2631 return 0;
2632 2632
2633 printk(KERN_DEBUG "radeonfb (%s): suspending to state: %d...\n", 2633 printk(KERN_DEBUG "radeonfb (%s): suspending for event: %d...\n",
2634 pci_name(pdev), state.event); 2634 pci_name(pdev), mesg.event);
2635 2635
2636 /* For suspend-to-disk, we cheat here. We don't suspend anything and 2636 /* For suspend-to-disk, we cheat here. We don't suspend anything and
2637 * let fbcon continue drawing until we are all set. That shouldn't 2637 * let fbcon continue drawing until we are all set. That shouldn't
2638 * really cause any problem at this point, provided that the wakeup 2638 * really cause any problem at this point, provided that the wakeup
2639 * code knows that any state in memory may not match the HW 2639 * code knows that any state in memory may not match the HW
2640 */ 2640 */
2641 if (state.event == PM_EVENT_FREEZE) 2641 switch (mesg.event) {
2642 case PM_EVENT_FREEZE: /* about to take snapshot */
2643 case PM_EVENT_PRETHAW: /* before restoring snapshot */
2642 goto done; 2644 goto done;
2645 }
2643 2646
2644 acquire_console_sem(); 2647 acquire_console_sem();
2645 2648
@@ -2706,7 +2709,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state)
2706 release_console_sem(); 2709 release_console_sem();
2707 2710
2708 done: 2711 done:
2709 pdev->dev.power.power_state = state; 2712 pdev->dev.power.power_state = mesg;
2710 2713
2711 return 0; 2714 return 0;
2712} 2715}
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index a6ca02f2156a..d42edaccb84c 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -1554,15 +1554,17 @@ static struct fb_ops i810fb_ops __devinitdata = {
1554/*********************************************************************** 1554/***********************************************************************
1555 * Power Management * 1555 * Power Management *
1556 ***********************************************************************/ 1556 ***********************************************************************/
1557static int i810fb_suspend(struct pci_dev *dev, pm_message_t state) 1557static int i810fb_suspend(struct pci_dev *dev, pm_message_t mesg)
1558{ 1558{
1559 struct fb_info *info = pci_get_drvdata(dev); 1559 struct fb_info *info = pci_get_drvdata(dev);
1560 struct i810fb_par *par = info->par; 1560 struct i810fb_par *par = info->par;
1561 1561
1562 par->cur_state = state.event; 1562 par->cur_state = mesg.event;
1563 1563
1564 if (state.event == PM_EVENT_FREEZE) { 1564 switch (mesg.event) {
1565 dev->dev.power.power_state = state; 1565 case PM_EVENT_FREEZE:
1566 case PM_EVENT_PRETHAW:
1567 dev->dev.power.power_state = mesg;
1566 return 0; 1568 return 0;
1567 } 1569 }
1568 1570
@@ -1578,7 +1580,7 @@ static int i810fb_suspend(struct pci_dev *dev, pm_message_t state)
1578 1580
1579 pci_save_state(dev); 1581 pci_save_state(dev);
1580 pci_disable_device(dev); 1582 pci_disable_device(dev);
1581 pci_set_power_state(dev, pci_choose_state(dev, state)); 1583 pci_set_power_state(dev, pci_choose_state(dev, mesg));
1582 release_console_sem(); 1584 release_console_sem();
1583 1585
1584 return 0; 1586 return 0;
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index d4f850117874..f8cd4c519aeb 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -950,24 +950,25 @@ static struct fb_ops nvidia_fb_ops = {
950}; 950};
951 951
952#ifdef CONFIG_PM 952#ifdef CONFIG_PM
953static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t state) 953static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t mesg)
954{ 954{
955 struct fb_info *info = pci_get_drvdata(dev); 955 struct fb_info *info = pci_get_drvdata(dev);
956 struct nvidia_par *par = info->par; 956 struct nvidia_par *par = info->par;
957 957
958 if (mesg.event == PM_EVENT_PRETHAW)
959 mesg.event = PM_EVENT_FREEZE;
958 acquire_console_sem(); 960 acquire_console_sem();
959 par->pm_state = state.event; 961 par->pm_state = mesg.event;
960 962
961 if (state.event == PM_EVENT_FREEZE) { 963 if (mesg.event == PM_EVENT_SUSPEND) {
962 dev->dev.power.power_state = state;
963 } else {
964 fb_set_suspend(info, 1); 964 fb_set_suspend(info, 1);
965 nvidiafb_blank(FB_BLANK_POWERDOWN, info); 965 nvidiafb_blank(FB_BLANK_POWERDOWN, info);
966 nvidia_write_regs(par, &par->SavedReg); 966 nvidia_write_regs(par, &par->SavedReg);
967 pci_save_state(dev); 967 pci_save_state(dev);
968 pci_disable_device(dev); 968 pci_disable_device(dev);
969 pci_set_power_state(dev, pci_choose_state(dev, state)); 969 pci_set_power_state(dev, pci_choose_state(dev, mesg));
970 } 970 }
971 dev->dev.power.power_state = mesg;
971 972
972 release_console_sem(); 973 release_console_sem();
973 return 0; 974 return 0;
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 461e094e7b45..82b3deaae02d 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -2323,24 +2323,24 @@ static void __devexit savagefb_remove(struct pci_dev *dev)
2323 } 2323 }
2324} 2324}
2325 2325
2326static int savagefb_suspend(struct pci_dev* dev, pm_message_t state) 2326static int savagefb_suspend(struct pci_dev *dev, pm_message_t mesg)
2327{ 2327{
2328 struct fb_info *info = pci_get_drvdata(dev); 2328 struct fb_info *info = pci_get_drvdata(dev);
2329 struct savagefb_par *par = info->par; 2329 struct savagefb_par *par = info->par;
2330 2330
2331 DBG("savagefb_suspend"); 2331 DBG("savagefb_suspend");
2332 2332
2333 2333 if (mesg.event == PM_EVENT_PRETHAW)
2334 par->pm_state = state.event; 2334 mesg.event = PM_EVENT_FREEZE;
2335 par->pm_state = mesg.event;
2336 dev->dev.power.power_state = mesg;
2335 2337
2336 /* 2338 /*
2337 * For PM_EVENT_FREEZE, do not power down so the console 2339 * For PM_EVENT_FREEZE, do not power down so the console
2338 * can remain active. 2340 * can remain active.
2339 */ 2341 */
2340 if (state.event == PM_EVENT_FREEZE) { 2342 if (mesg.event == PM_EVENT_FREEZE)
2341 dev->dev.power.power_state = state;
2342 return 0; 2343 return 0;
2343 }
2344 2344
2345 acquire_console_sem(); 2345 acquire_console_sem();
2346 fb_set_suspend(info, 1); 2346 fb_set_suspend(info, 1);
@@ -2353,7 +2353,7 @@ static int savagefb_suspend(struct pci_dev* dev, pm_message_t state)
2353 savage_disable_mmio(par); 2353 savage_disable_mmio(par);
2354 pci_save_state(dev); 2354 pci_save_state(dev);
2355 pci_disable_device(dev); 2355 pci_disable_device(dev);
2356 pci_set_power_state(dev, pci_choose_state(dev, state)); 2356 pci_set_power_state(dev, pci_choose_state(dev, mesg));
2357 release_console_sem(); 2357 release_console_sem();
2358 2358
2359 return 0; 2359 return 0;