Module Drm.Event

Parsing events from a device.

type buffer = (char, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t
module Vblank : sig ... end
module Crtc_sequence : sig ... end
type t =
  1. | Vblank of Vblank.t
  2. | Flip_complete of Vblank.t
  3. | Crtc_sequence of Crtc_sequence.t
  4. | Unknown of Unsigned.UInt32.t * char Ctypes.CArray.t
val pp : t Fmt.t
val create_buffer : unit -> buffer

create_buffer () creates a buffer of a suitable size.

val parse : buffer -> int -> t list

parse buffer len parses the events in the first len bytes of buffer.

Hint: you can use let len = Unix.read_bigarray dev buffer 0 (Bigarray.Array1.dim buffer) to read events into the buffer. The buffer must contain only complete events, but the kernel only returns complete events when you read, so this shouldn't be a problem.