Skip to content

xup/capture: add dma-buf transport for A2 updates - #424

Open
FlyGoat wants to merge 2 commits into
neutrinolabs:develfrom
FlyGoat:dmabuf-a2-updates
Open

xup/capture: add dma-buf transport for A2 updates#424
FlyGoat wants to merge 2 commits into
neutrinolabs:develfrom
FlyGoat:dmabuf-a2-updates

Conversation

@FlyGoat

@FlyGoat FlyGoat commented Mar 26, 2026

Copy link
Copy Markdown

This is the xorgxrdp side of the matching dma-buf transport series for neutrinolabs/xrdp#3774.

The first commit is protocol cleanup:

  • replace the remaining hard-coded xup message, order, metadata, and client-data ids in rdpClientCon.c with the shared symbolic definitions

The second commit adds dma-buf transport for A2 capture:

  • add per-monitor dma-buf-backed glamor pixmaps on the xorgxrdp side
  • enable this path only when the client advertises XUP_CAPTURE_TRANSPORT_DMABUF, the capture mode is CC_SUF_A2 or CC_GFX_A2, glamor is active, and pixmap import/export is supported
  • export the per-monitor pixmaps with glamor_shareable_fd_from_pixmap() and keep the associated width, height, stride, fourcc, and size metadata
  • refresh those exported surfaces after client-info and monitor-layout changes, and destroy them on disconnect
  • in rdpCaptureSufA2() and rdpCaptureGfxA2(), copy the dirty regions into the per-monitor dma-buf pixmaps, set XRDP_ENC_SOURCE_DMABUF, and skip the old shmfd payload
  • emit XUP_ORDER_PAINT_RECT_DMABUF and XUP_ORDER_EGFX_DMABUF with the dma-buf fd plus surface metadata instead of using only the *_SHMFD orders
  • keep accel assist disabled while dma-buf transport is active, and fall back to the existing shmfd path when dma-buf transport is not available

With the matching xrdp changes, this lets A2 updates be encoded from imported dma-buf surfaces instead of requiring a round-trip through shared system memory.

This is working for me with the matching xrdp series on Intel xe.

FlyGoat added 2 commits March 26, 2026 19:24
Replace the open-coded xup message, order, metadata, capability, and client-data IDs in rdpClientCon.c with the existing symbolic protocol definitions.

This is a mechanical cleanup with no intended behavior change, but it makes the on-wire protocol handling easier to follow and less error-prone.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
When the client advertises XUP_CAPTURE_TRANSPORT_DMABUF and glamor can export pixmaps, prepare per-monitor dma-buf-backed surfaces, capture into them, and send the fd plus buffer metadata to xrdp instead of using the shmfd path.

Hook this up for the SUF_A2 and GFX_A2 capture modes, refresh the exported surfaces after client-info and monitor-layout changes, and keep accel assist disabled while dma-buf transport is in use.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant