Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17661
b: refs/heads/master
c: c5eec03
h: refs/heads/master
i:
  17659: af0dd1f
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Jan 10, 2006
1 parent fbba452 commit 2e640b8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 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: 740f14ba5335d1e25b9f3e80643be801f653cd32
refs/heads/master: c5eec03f314e1406829d9683284673203b91b9b8
56 changes: 28 additions & 28 deletions trunk/drivers/video/i810/i810_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <linux/pci_ids.h>
#include <linux/resource.h>
#include <linux/unistd.h>
#include <linux/console.h>

#include <asm/io.h>
#include <asm/div64.h>
Expand Down Expand Up @@ -1517,35 +1518,28 @@ static int i810fb_suspend(struct pci_dev *dev, pm_message_t state)
{
struct fb_info *info = pci_get_drvdata(dev);
struct i810fb_par *par = info->par;
int blank = 0, prev_state = par->cur_state;

if (state.event == prev_state)
return 0;

par->cur_state = state.event;

switch (state.event) {
case 1:
blank = VESA_VSYNC_SUSPEND;
break;
case 2:
blank = VESA_HSYNC_SUSPEND;
break;
case 3:
blank = VESA_POWERDOWN;
break;
default:
return -EINVAL;
if (state.event == PM_EVENT_FREEZE) {
dev->dev.power.power_state = state;
return 0;
}
info->fbops->fb_blank(blank, info);

if (!prev_state) {
agp_unbind_memory(par->i810_gtt.i810_fb_memory);
agp_unbind_memory(par->i810_gtt.i810_cursor_memory);
pci_disable_device(dev);
}
acquire_console_sem();
fb_set_suspend(info, 1);

if (info->fbops->fb_sync)
info->fbops->fb_sync(info);

i810fb_blank(FB_BLANK_POWERDOWN, info);
agp_unbind_memory(par->i810_gtt.i810_fb_memory);
agp_unbind_memory(par->i810_gtt.i810_cursor_memory);

pci_save_state(dev);
pci_disable_device(dev);
pci_set_power_state(dev, pci_choose_state(dev, state));
release_console_sem();

return 0;
}
Expand All @@ -1554,22 +1548,28 @@ static int i810fb_resume(struct pci_dev *dev)
{
struct fb_info *info = pci_get_drvdata(dev);
struct i810fb_par *par = info->par;
int cur_state = par->cur_state;

par->cur_state = PM_EVENT_ON;

if (par->cur_state == 0)
if (cur_state == PM_EVENT_FREEZE) {
pci_set_power_state(dev, PCI_D0);
return 0;
}

pci_restore_state(dev);
acquire_console_sem();
pci_set_power_state(dev, PCI_D0);
pci_restore_state(dev);
pci_enable_device(dev);
pci_set_master(dev);
agp_bind_memory(par->i810_gtt.i810_fb_memory,
par->fb.offset);
agp_bind_memory(par->i810_gtt.i810_cursor_memory,
par->cursor_heap.offset);

i810fb_set_par(info);
fb_set_suspend (info, 0);
info->fbops->fb_blank(VESA_NO_BLANKING, info);

par->cur_state = 0;

release_console_sem();
return 0;
}
/***********************************************************************
Expand Down

0 comments on commit 2e640b8

Please sign in to comment.