package libdrm

  1. Overview
  2. Docs

Module Kms.CrtcSource

A CRT Controller.

Typically, one CRTC is used for each monitor, although it is possible to drive two identical monitors in mirror mode with only one.

Sourcetype id = [ `Crtc ] Id.t
Sourcetype t = {
  1. crtc_id : id;
  2. fb_id : Fb.id option;
  3. x : int;
    (*

    Position on the framebuffer

    *)
  4. y : int;
  5. width : int;
  6. height : int;
  7. mode : Mode_info.t option;
  8. gamma_size : int;
    (*

    Number of gamma stops

    *)
}
Sourceval get : Device.t -> id -> t
Sourceval id : t -> id
Sourceval set : Device.t -> id -> ?fb:Fb.id -> pos:(int * int) -> connectors:[ `Connector ] Id.t list -> Mode_info.t option -> unit

The old non-atomic API.

Sourceval page_flip : ?event:nativeint -> ?async:bool -> ?target:[ `None | `Absolute of Unsigned.UInt32.t | `Relative of int ] -> Device.t -> id -> Fb.id -> unit

page_flip dev id fb asks KMS to schedule a page flip for CRTC id.

Once any pending rendering targeting fb (as of ioctl time) has completed, the CRTC will be reprogrammed to display fb after the next vertical refresh. The call returns immediately, but subsequent rendering to the current fb will block in the execbuffer ioctl until the page flip happens. If a page flip is already pending as the ioctl is called, Unix.EBUSY will be raised.

  • parameter event

    Requests that drm sends back an event when the page flip is done. The event data will be returned as the user_data field in Event.Vblank.t.

  • parameter async

    Requests that the flip happen 'as soon as possible', meaning that it not delay waiting for vblank. This may cause tearing on the screen.

  • parameter target

    If `Absolute seq, seq denotes the absolute vblank sequence when the flip should take effect. If `Relative seq, seq denotes the relative (to the current one when the ioctl is called) vblank sequence when the flip should take effect (seq must be 0 or 1). `None is the same as `Relative 1, unless async is true, in which case it behaves as `Relative 0.

?target is merely to clarify the target for when code dealing with a page flip runs during a vertical blank period.

Sourceval queue_sequence : ?next_on_miss:bool -> user_data:nativeint -> Device.t -> id -> [ `Absolute of Unsigned.UInt64.t | `Relative of int ] -> Unsigned.UInt64.t

Queue an event to be delivered at the specified sequence. The timestamp marks when the first pixel of the refresh cycle leaves the display engine for the display.

  • parameter next_on_miss

    Use next sequence if we've missed.

Sourceval set_cursor : Device.t -> id -> ?hot:(int * int) -> size:(int * int) -> Buffer.id option -> unit
Sourceval move_cursor : Device.t -> id -> (int * int) -> unit
Sourceval get_gamma : Device.t -> t -> gamma_lut * gamma_lut * gamma_lut

Get the gamma table.

Sourceval set_gamma : Device.t -> t -> (gamma_lut * gamma_lut * gamma_lut) -> unit

Set the gamma table.

Sourceval pp : t Fmt.t

Properties

Sourcetype 'a property = ([ `Crtc ], 'a) Property.t
Sourceval get_properties : Device.t -> id -> [ `Crtc ] Properties.Values.t
Sourceval active : bool property
Sourceval mode_id : Blob.id option property

Use Mode_info.get to load the blob data.

Sourceval vrr_enabled : bool property
Sourceval out_fence_ptr : Unix.file_descr option Ctypes.ptr option property

Hint: allocate a fence_ctype to hold the returned FD.

Sourceval fence_ctype : Unix.file_descr option Ctypes.typ