[RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-06 Thread Jesse Barnes
This patch adds a sanity check to drmWaitVBlank to prevent hangs. Since the server interrupts syscalls pretty frequently with SIGALM, we tend to restart syscalls when EINTR is returned. That means when a vblank timeout happens, we probably won't catch it (it happens after 3s, and SIGALM happens e

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-06 Thread Keith Packard
On Tue, 2009-01-06 at 10:41 -0800, Jesse Barnes wrote: > This patch adds a sanity check to drmWaitVBlank to prevent hangs. Since the > server interrupts syscalls pretty frequently with SIGALM, we tend to restart > syscalls when EINTR is returned. That means when a vblank timeout happens, > we pro

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-07 Thread Michel Dänzer
On Tue, 2009-01-06 at 10:41 -0800, Jesse Barnes wrote: > This patch adds a sanity check to drmWaitVBlank to prevent hangs. Since the > server interrupts syscalls pretty frequently with SIGALM, we tend to restart > syscalls when EINTR is returned. That means when a vblank timeout happens, > we pro

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-07 Thread Michel Dänzer
On Tue, 2009-01-06 at 22:49 -0800, Keith Packard wrote: > On Tue, 2009-01-06 at 10:41 -0800, Jesse Barnes wrote: > > This patch adds a sanity check to drmWaitVBlank to prevent hangs. Since the > > server interrupts syscalls pretty frequently with SIGALM, we tend to restart > > syscalls when EINTR

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-07 Thread Michel Dänzer
On Wed, 2009-01-07 at 10:15 -0800, Jesse Barnes wrote: > On Wednesday, January 7, 2009 9:49 am Michel Dänzer wrote: > > On Tue, 2009-01-06 at 22:49 -0800, Keith Packard wrote: > > > On Tue, 2009-01-06 at 10:41 -0800, Jesse Barnes wrote: > > > > This patch adds a sanity check to drmWaitVBlank to pre

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-07 Thread Jesse Barnes
On Wednesday, January 7, 2009 10:36 am Michel Dänzer wrote: > On Wed, 2009-01-07 at 10:15 -0800, Jesse Barnes wrote: > > On Wednesday, January 7, 2009 9:49 am Michel Dänzer wrote: > > > On Tue, 2009-01-06 at 22:49 -0800, Keith Packard wrote: > > > > On Tue, 2009-01-06 at 10:41 -0800, Jesse Barnes w

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-07 Thread Jesse Barnes
On Wednesday, January 7, 2009 9:49 am Michel Dänzer wrote: > On Tue, 2009-01-06 at 22:49 -0800, Keith Packard wrote: > > On Tue, 2009-01-06 at 10:41 -0800, Jesse Barnes wrote: > > > This patch adds a sanity check to drmWaitVBlank to prevent hangs. > > > Since the server interrupts syscalls pretty

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-07 Thread Keith Packard
On Wed, 2009-01-07 at 10:15 -0800, Jesse Barnes wrote: > Ok; I messed with drmIoctl because I thought I remembered you saying we > shouldn't put the retry code there but rather in the individual ioctls that > needed it. We should probably do that separately anyway though if we ever > decide to

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-07 Thread Jesse Barnes
On Wednesday, January 7, 2009 10:54 am Keith Packard wrote: > On Wed, 2009-01-07 at 10:15 -0800, Jesse Barnes wrote: > > Ok; I messed with drmIoctl because I thought I remembered you saying we > > shouldn't put the retry code there but rather in the individual ioctls > > that needed it. We should

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-07 Thread Eric Anholt
On Wed, 2009-01-07 at 11:11 -0800, Jesse Barnes wrote: > On Wednesday, January 7, 2009 10:54 am Keith Packard wrote: > > On Wed, 2009-01-07 at 10:15 -0800, Jesse Barnes wrote: > > > Ok; I messed with drmIoctl because I thought I remembered you saying we > > > shouldn't put the retry code there but

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-07 Thread Jesse Barnes
On Wednesday, January 7, 2009 11:34 am Eric Anholt wrote: > On Wed, 2009-01-07 at 11:11 -0800, Jesse Barnes wrote: > > On Wednesday, January 7, 2009 10:54 am Keith Packard wrote: > > > On Wed, 2009-01-07 at 10:15 -0800, Jesse Barnes wrote: > > > > Ok; I messed with drmIoctl because I thought I reme

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-08 Thread Daniel Stone
On Wed, Jan 07, 2009 at 11:34:42AM -0800, Eric Anholt wrote: > On Wed, 2009-01-07 at 11:11 -0800, Jesse Barnes wrote: > > On Wednesday, January 7, 2009 10:54 am Keith Packard wrote: > > > > +libdrm_la_LIBADD = -lrt > > > > > > I fear you'll need autoconf-fu for this? > > > > > > Otherwise, it looks

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-08 Thread Jesse Barnes
On Thursday, January 8, 2009 2:13 am Daniel Stone wrote: > On Wed, Jan 07, 2009 at 11:34:42AM -0800, Eric Anholt wrote: > > On Wed, 2009-01-07 at 11:11 -0800, Jesse Barnes wrote: > > > On Wednesday, January 7, 2009 10:54 am Keith Packard wrote: > > > > > +libdrm_la_LIBADD = -lrt > > > > > > > > I f

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-09 Thread Michel Dänzer
On Thu, 2009-01-08 at 11:13 -0800, Jesse Barnes wrote: > On Thursday, January 8, 2009 2:13 am Daniel Stone wrote: > > On Wed, Jan 07, 2009 at 11:34:42AM -0800, Eric Anholt wrote: > > > On Wed, 2009-01-07 at 11:11 -0800, Jesse Barnes wrote: > > > > On Wednesday, January 7, 2009 10:54 am Keith Packar

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-09 Thread Daniel Stone
On Fri, Jan 09, 2009 at 09:27:25AM +0100, Michel Dänzer wrote: > On Thu, 2009-01-08 at 11:13 -0800, Jesse Barnes wrote: > > On Thursday, January 8, 2009 2:13 am Daniel Stone wrote: > > > You probably want to get the entire clock_gettime awesomeness, to avoid > > > the pathological worst case of rew

Re: [RFC] add timeout to drmWaitVBlank to avoid hangs

2009-01-09 Thread Jesse Barnes
On Friday, January 9, 2009 2:32 am Daniel Stone wrote: > On Fri, Jan 09, 2009 at 09:27:25AM +0100, Michel Dänzer wrote: > > On Thu, 2009-01-08 at 11:13 -0800, Jesse Barnes wrote: > > > On Thursday, January 8, 2009 2:13 am Daniel Stone wrote: > > > > You probably want to get the entire clock_gettime