[igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd.

Chris Wilson chris at chris-wilson.co.uk
Thu Apr 5 21:15:58 UTC 2018


Quoting Souza, Jose (2018-04-05 22:03:46)
> On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote:
> > This will fix the PSR tests to fail slightly faster, since they wait
> > indefinitely for a CRC that never comes during open.
> > 
> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> > ---
> >  lib/igt_debugfs.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> > index 8adc02e9cc47..094df564b6f4 100644
> > --- a/lib/igt_debugfs.c
> > +++ b/lib/igt_debugfs.c
> > @@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t
> > *pipe_crc)
> >  
> >       sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
> >  
> > +     igt_set_timeout(5, "Opening crc fd, which waits for first
> > CRC.");
> >       pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-
> > >flags);
> > +     igt_reset_timeout();
> 
> Hum I was able to reproduce this one too in a KBL, I was thinking in
> add a timeout in the kernel side, if it don't get the CRC buffer filled
> it would return a error.

That would be unexpected behaviour for a read() interface. If you want a
timeout, implement poll().
-Chris


More information about the igt-dev mailing list