[RFC] compositor-drm: Add hardware accelerated capture of screen using libva

Daniel Vetter daniel at ffwll.ch
Mon Sep 2 07:57:39 PDT 2013

On Fri, Aug 23, 2013 at 05:15:48PM +0300, Ander Conselvan de Oliveira wrote:
> From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
> This patch adds a feature to the DRM backend that uses libva for
> encoding the screen contents in H.264. Screen recording can be
> activated by pressing mod-shift-space q. A file named capture.h264
> will be created in the current directory, which can be muxed into
> an MP4 file with gstreamer using
> gst-launch filesrc location=capture.h264 ! h264parse ! mp4mux ! \
>            filesink location=file.mp4
> This is limitted to the DRM compositor in order to avoid a copy when
> submitting the front buffer to libva. The code in vaapi-recorder.c
> takes a dma_buf fd referencing it, does a colorspace conversion using
> the video post processing pipeline and then uses that as input to the
> encoder.
> I'm sending this now so I get comments, but this is not ready for
> prime time yet. I have a somewhat consistent GPU hang when using
> i915 with SandyBridge. Sometimes a page flip never completes. If you
> want to try this anyway and your system get stuck, you might need to
> run the following:
>   # echo 1 > /sys/kernel/debug/dri/0/i915_wedged

Does this still happen on latest drm-intel-nightly branches? In the past
few kernel releases we've massively improved hangcheck detection,
especially interactions with pageflips. Although just recently there's
been a patch to fix a deadlock (re)introduced in 3.8:


Cheers, Daniel
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

More information about the wayland-devel mailing list