weston/libweston/backend-drm
Leandro Ribeiro 5429302e78 backend-drm: add KMS plane's formats to per-surface dma-buf feedback
In commit "libweston: add initial dma-buf feedback implementation" we've
added initial support to dma-buf feedback, but it was not using the
feedback from DRM-backend to add useful per-surface feedback.

In this patch we add this. The scanout tranche of the per-surface
feedback is based on the union of formats/modifiers of the primary and
overlay planes available. These are intersected with the
formats/modifiers supported by the renderer device.

Also, it's important to mention that the scene can change a lot and we
can't predict much. So this patch also adds hysteresis to the dma-buf
feedback. We wait a few seconds to be sure that we reached stability
before adding or removing the scanout tranche from dma-buf feedback and
resending them. This help us to avoid spamming clients and leading to
unnecessary buffer reallocations on their end.

Here's an example of what we want to avoid:

1. We detect that a view was not placed in a plane only because its
   format is not supported by the plane, so we add the scanout tranche
   to the feedback and send the events.

2. A few milliseconds after, the view gets occluded. So now the view
   can't be placed in a plane anymore. We need to remove the scanout
   tranche and resend the feedback with formats/modifiers optimal for
   the renderer device. The client will then reallocate its buffers.

3. A few milliseconds after, the view that was causing the occlusion
   gets minimized. So we got back to the first situation, in which the
   format of the view is not compatible with the plane. Then we need to
   add a scanout tranche and resend the feedback...

This patch is based on previous work of Scott Anderson (@ascent).

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2021-11-25 11:16:52 -03:00
..
drm-gbm.c backend-drm: add DRM_FORMAT_MOD_INVALID to modifier sets when no modifiers are supported 2021-04-27 19:56:38 +00:00
drm-internal.h backend-drm: add KMS plane's formats to per-surface dma-buf feedback 2021-11-25 11:16:52 -03:00
drm-virtual.c Fix indentation all through the project 2021-07-31 15:28:20 +00:00
drm.c backend-drm: add KMS plane's formats to per-surface dma-buf feedback 2021-11-25 11:16:52 -03:00
fb.c backend-drm: keep track of the reason why promoting view to a plane failed 2021-11-25 11:16:21 -03:00
kms.c Fix TTY switching after failed failed repaint with legacy mode set. 2021-09-29 12:17:58 +00:00
libbacklight.c backend-drm: move into new subdir 2019-05-16 13:32:34 +01:00
libbacklight.h backend-drm: move into new subdir 2019-05-16 13:32:34 +01:00
meson.build libweston/backend/drm: might need EGL 2020-10-26 15:44:34 +01:00
modes.c Add weston-drm-fourcc.h 2021-02-25 14:35:03 +02:00
state-helpers.c Add weston-drm-fourcc.h 2021-02-25 14:35:03 +02:00
state-propose.c backend-drm: add KMS plane's formats to per-surface dma-buf feedback 2021-11-25 11:16:52 -03:00
vaapi-recorder.c drm/vaapi: Fix pointer-size confusion 2021-08-03 11:13:23 +00:00
vaapi-recorder.h backend-drm: move into new subdir 2019-05-16 13:32:34 +01:00