Skip to content
Commit 6d8e3c56 authored by Leandro Ribeiro's avatar Leandro Ribeiro Committed by Pekka Paalanen
Browse files

drm: drop disable_planes being false as a condition to support writeback



In 2d70bdfd "drm-backend: add support to
output capture writeback source" we've ensured that disable_planes
should be false in order to support writeback capture tasks.

But this was wrong; disable_planes is transient (it is true when
there's some sort of content recording happening), and we enable/disable
that during compositor's lifetime.

This is dangerous and may result in a crash. Imagine the following
sequence:

        1. screen recording starts, disable_planes is set to true.

        2. for whatever reason the output size changes, and we end up
        not updating capture info because we think that writeback is not
        supported by the device.

        3. screen recording stops, disable_planes is set to false.

        4. user tries to take a writeback screenshot, and the
        DRM-backend will pull a writeback capture task with
        weston_output_pull_capture_task().

        5. this function has an assert to ensure that the DRM-backend
        did not forget to update the capture info, and we hit that
        assert.

With this patch we drop disable_planes being false as a condition to
support writeback. So now we keep the capture info up-to-date even when
screen recording is happening, and we gracefully fail writeback tasks.

Signed-off-by: default avatarLeandro Ribeiro <leandro.ribeiro@collabora.com>
parent c9866dea
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment