Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37242
b: refs/heads/master
c: 37bced3
h: refs/heads/master
v: v3
  • Loading branch information
Eric Hustvedt authored and Dave Airlie committed Jul 3, 2006
1 parent e7d5a94 commit 607ccc4
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7649757bd900bc900adcd95ab08903cdc28342fa
refs/heads/master: 37bced38b3d09c3de7c871790eddde81a3ce57cb
4 changes: 4 additions & 0 deletions trunk/drivers/video/intelfb/intelfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ struct intelfb_info {

#define IS_I9XX(dinfo) (((dinfo)->chipset == INTEL_915G)||(dinfo->chipset == INTEL_915GM)||((dinfo)->chipset == INTEL_945G)||(dinfo->chipset==INTEL_945GM))

#ifndef FBIO_WAITFORVSYNC
#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
#endif

/*** function prototypes ***/

extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var);
Expand Down
13 changes: 13 additions & 0 deletions trunk/drivers/video/intelfb/intelfbdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,19 @@ static int
intelfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
int retval = 0;
struct intelfb_info *dinfo = GET_DINFO(info);
u32 pipe = 0;

switch (cmd) {
case FBIO_WAITFORVSYNC:
if (get_user(pipe, (__u32 __user *)arg))
return -EFAULT;

retval = intelfbhw_wait_for_vsync(dinfo, pipe);
break;
default:
break;
}

return retval;
}
Expand Down
33 changes: 33 additions & 0 deletions trunk/drivers/video/intelfb/intelfbhw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2019,3 +2019,36 @@ intelfbhw_disable_irq(struct intelfb_info *dinfo) {
free_irq(dinfo->pdev->irq, dinfo);
}
}

int
intelfbhw_wait_for_vsync(struct intelfb_info *dinfo, u32 pipe) {
struct intelfb_vsync *vsync;
unsigned int count;
int ret;

switch (pipe) {
case 0:
vsync = &dinfo->vsync;
break;
default:
return -ENODEV;
}

ret = intelfbhw_enable_irq(dinfo, 0);
if (ret) {
return ret;
}

count = vsync->count;
ret = wait_event_interruptible_timeout(vsync->wait, count != vsync->count, HZ/10);
if (ret < 0) {
return ret;
}
if (ret == 0) {
intelfbhw_enable_irq(dinfo, 1);
DBG_MSG("wait_for_vsync timed out!\n");
return -ETIMEDOUT;
}

return 0;
}
1 change: 1 addition & 0 deletions trunk/drivers/video/intelfb/intelfbhw.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,5 +563,6 @@ extern void intelfbhw_cursor_load(struct intelfb_info *dinfo, int width,
extern void intelfbhw_cursor_reset(struct intelfb_info *dinfo);
extern int intelfbhw_enable_irq(struct intelfb_info *dinfo, int reenable);
extern void intelfbhw_disable_irq(struct intelfb_info *dinfo);
extern int intelfbhw_wait_for_vsync(struct intelfb_info *dinfo, u32 pipe);

#endif /* _INTELFBHW_H */

0 comments on commit 607ccc4

Please sign in to comment.