backend-drm: make dma-buf feedback device specific

The scanout format for the dma-buf feedback are specific to the kms device that
is used for scanout. Therefore, we have to pass the device of the output when
retrieving the scanout formats.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
dev
Michael Tretter 3 years ago committed by Daniel Stone
parent 101c0f6b8b
commit 615a37dc88
  1. 7
      libweston/backend-drm/drm.c
  2. 6
      libweston/backend-drm/state-propose.c

@ -1711,10 +1711,9 @@ drm_output_deinit_planes(struct drm_output *output)
}
static struct weston_drm_format_array *
get_scanout_formats(struct drm_backend *b)
get_scanout_formats(struct drm_device *device)
{
struct weston_compositor *ec = b->compositor;
struct drm_device *device = b->drm;
struct weston_compositor *ec = device->backend->compositor;
const struct weston_drm_format_array *renderer_formats;
struct weston_drm_format_array *scanout_formats, union_planes_formats;
struct drm_plane *plane;
@ -3240,7 +3239,7 @@ drm_backend_create(struct weston_compositor *compositor,
* table was already created and populated with
* renderer's format/modifier pairs. So now we must
* compute the scanout formats indices in the table */
scanout_formats = get_scanout_formats(b);
scanout_formats = get_scanout_formats(b->drm);
if (!scanout_formats)
goto err_udev_monitor;
ret = weston_dmabuf_feedback_format_table_set_scanout_indices(compositor->dmabuf_feedback_format_table,

@ -326,12 +326,12 @@ drm_output_check_zpos_plane_states(struct drm_output_state *state)
}
static bool
dmabuf_feedback_maybe_update(struct drm_backend *b, struct weston_view *ev,
dmabuf_feedback_maybe_update(struct drm_device *device, struct weston_view *ev,
uint32_t try_view_on_plane_failure_reasons)
{
struct weston_dmabuf_feedback *dmabuf_feedback = ev->surface->dmabuf_feedback;
struct weston_dmabuf_feedback_tranche *scanout_tranche;
struct drm_device *device = b->drm;
struct drm_backend *b = device->backend;
dev_t scanout_dev = device->drm.devnum;
uint32_t scanout_flags = ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT;
uint32_t action_needed = ACTION_NEEDED_NONE;
@ -971,7 +971,7 @@ drm_assign_planes(struct weston_output *output_base)
/* Update dmabuf-feedback if needed */
if (ev->surface->dmabuf_feedback)
dmabuf_feedback_maybe_update(b, ev,
dmabuf_feedback_maybe_update(device, ev,
pnode->try_view_on_plane_failure_reasons);
pnode->try_view_on_plane_failure_reasons = FAILURE_REASONS_NONE;

Loading…
Cancel
Save