backend-drm: Add failure reasons for failing gbm_bo_import

And add it to the list of failures triggering a resend of
dmabuf feedback scanout tranches.

Closes https://gitlab.freedesktop.org/wayland/weston/-/issues/614

Signed-off-by: Robert Mader <robert.mader@collabora.com>
dev
Robert Mader 3 years ago committed by Pekka Paalanen
parent 70353dace3
commit 29d480813a
  1. 1
      libweston/backend-drm/drm-internal.h
  2. 6
      libweston/backend-drm/fb.c
  3. 3
      libweston/backend-drm/state-propose.c

@ -245,6 +245,7 @@ enum try_view_on_plane_failure_reasons {
FAILURE_REASONS_BUFFER_TYPE = 1 << 9, FAILURE_REASONS_BUFFER_TYPE = 1 << 9,
FAILURE_REASONS_GLOBAL_ALPHA = 1 << 10, FAILURE_REASONS_GLOBAL_ALPHA = 1 << 10,
FAILURE_REASONS_NO_GBM = 1 << 11, FAILURE_REASONS_NO_GBM = 1 << 11,
FAILURE_REASONS_GBM_BO_IMPORT_FAILED = 1 << 12,
}; };
/** /**

@ -276,8 +276,12 @@ drm_fb_get_from_dmabuf(struct linux_dmabuf_buffer *dmabuf,
fb->bo = gbm_bo_import(backend->gbm, GBM_BO_IMPORT_FD_MODIFIER, fb->bo = gbm_bo_import(backend->gbm, GBM_BO_IMPORT_FD_MODIFIER,
&import_mod, GBM_BO_USE_SCANOUT); &import_mod, GBM_BO_USE_SCANOUT);
if (!fb->bo) if (!fb->bo) {
if (try_view_on_plane_failure_reasons)
*try_view_on_plane_failure_reasons |=
FAILURE_REASONS_GBM_BO_IMPORT_FAILED;
goto err_free; goto err_free;
}
fb->width = dmabuf->attributes.width; fb->width = dmabuf->attributes.width;
fb->height = dmabuf->attributes.height; fb->height = dmabuf->attributes.height;

@ -340,7 +340,8 @@ dmabuf_feedback_maybe_update(struct drm_backend *b, struct weston_view *ev,
if (try_view_on_plane_failure_reasons & if (try_view_on_plane_failure_reasons &
(FAILURE_REASONS_ADD_FB_FAILED | (FAILURE_REASONS_ADD_FB_FAILED |
FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE | FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE |
FAILURE_REASONS_DMABUF_MODIFIER_INVALID)) FAILURE_REASONS_DMABUF_MODIFIER_INVALID |
FAILURE_REASONS_GBM_BO_IMPORT_FAILED))
action_needed |= ACTION_NEEDED_ADD_SCANOUT_TRANCHE; action_needed |= ACTION_NEEDED_ADD_SCANOUT_TRANCHE;
assert(action_needed != (ACTION_NEEDED_REMOVE_SCANOUT_TRANCHE | assert(action_needed != (ACTION_NEEDED_REMOVE_SCANOUT_TRANCHE |

Loading…
Cancel
Save