Commit fc297c87 authored by Simon Ser's avatar Simon Ser Committed by Michel Dänzer

xwayland: import DMA-BUFs with GBM_BO_USE_RENDERING only

Drop GBM_BO_USE_SCANOUT from the GBM_BO_IMPORT_FD import, add
GBM_BO_USE_RENDERING to the GBM_BO_IMPORT_FD_MODIFIER import.

If the DMA-BUF cannot be scanned out, gbm_bo_import with
GBM_BO_USE_SCANOUT will fail. However Xwayland doesn't need to scan-out
the buffer and can work fine without scanout. Glamor only needs
GBM_BO_USE_RENDERING.
Signed-off-by: Simon Ser's avatarSimon Ser <contact@emersion.fr>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
(cherry picked from commit 421ce458)
parent 0430d13c
Pipeline #171254 passed with stages
in 4 minutes and 40 seconds
......@@ -501,7 +501,8 @@ glamor_pixmap_from_fds(ScreenPtr screen, CARD8 num_fds, const int *fds,
data.strides[i] = strides[i];
data.offsets[i] = offsets[i];
}
bo = gbm_bo_import(xwl_gbm->gbm, GBM_BO_IMPORT_FD_MODIFIER, &data, 0);
bo = gbm_bo_import(xwl_gbm->gbm, GBM_BO_IMPORT_FD_MODIFIER, &data,
GBM_BO_USE_RENDERING);
#endif
} else if (num_fds == 1) {
struct gbm_import_fd_data data;
......@@ -512,7 +513,7 @@ glamor_pixmap_from_fds(ScreenPtr screen, CARD8 num_fds, const int *fds,
data.stride = strides[0];
data.format = gbm_format_for_depth(depth);
bo = gbm_bo_import(xwl_gbm->gbm, GBM_BO_IMPORT_FD, &data,
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
GBM_BO_USE_RENDERING);
} else {
goto error;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment