lib/igt_kms: Fix igt_display_drop_events() to work as intended

Short reads don't work, you either read the whole event or nothing
at all, so follow the recommendations in the documentation and
allocate a buffer of 4096 bytes for the event, if we capture
multiple events read them all.

Cc: Jari Tahvanainen <jari.tahvanainen@intel.com>
Reported-by: Jari Tahvanainen <jari.tahvanainen@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104538
[mlankhorst: Assign ev once in the loop, instead of 2 places. (ickle)]
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
1 file changed