Skip to content

libdrmtap 0.6.1

Latest

Choose a tag to compare

@fxd0h fxd0h released this 28 Nov 12:37

A screen of ONE plane that is not the screen as it is came out the size of its buffer.

Fixed: one plane stretched to the screen, or smaller than it

  • With one lit non-cursor plane, drmtap_convert_packet(), drmtap_grab_mapped() and
    drmtap_grab_mapped_fast() returned the buffer of that plane at its own size,
    whatever its place on the screen. A 40x40 buffer stretched to a 1920x1080 CRTC gave a 40x40
    frame (rustdesk/rustdesk#17187 shows the same jump, 2560x1600 -> 40x40, and the consumer
    rebuilt its stream). Measured on i915 with a plane lit that way: 40x40 from all three paths,
    and from 0.5.12 too.
  • Such a plane is now composed to the CRTC size like a frame of several planes: black around
    it, scaled from its source rectangle into its destination rectangle, rotated as its plane is.
    The rotation answer for that frame is ROTATE_0, on the exporter (after
    drmtap_grab_packet()) and on the converter. Measured: 1920x1080 from the packet and mapped paths, with and without
    EGL (the CPU composes a linear RGB plane).
  • A plane that IS the screen (its destination rectangle is exactly the CRTC and it is not
    scaled) takes exactly the path it took before, also when the hardware rotates it: measured on
    amdgpu at rotate 0, 90, 180 and 270, frames identical to 0.6.0. A plane larger than the CRTC
    (hanging off an edge) is not the screen and is composed to the CRTC size; 0.6.0 returned the
    whole buffer.
  • When the plane cannot be composed, the frame is its buffer at its own size, as before, and
    the debug log says so once. The one exception is a caller buffer too small for the
    CRTC-sized frame: that is -ENOSPC, as for several planes. When the reason is the plane itself (no
    composer for its layout, an import the driver refused) composing is not tried again for 2 s
    while its shape stays the same, so the buffer is not exported twice per frame (measured: 101
    exports for 100 frames instead of 200).

Unchanged: the zero-copy calls

  • drmtap_grab() and drmtap_grab_desc() hand out one buffer (an fd) and cannot scale or
    place it: for such a plane they still return that buffer at its own size, so a zero-copy
    consumer sees no change. A consumer that needs the screen size uses drmtap_grab_mapped()
    or the packet API.