summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-05-04 18:20:17 +0200
committerMichel Dänzer <michel@daenzer.net>2020-07-03 10:51:36 +0000
commitfc297c87d6755c11380a44e3510689cc76eb1ee1 (patch)
treef25898d22b9431e00bca5bd87d3ed8a88953ffe8 /hw
parent0430d13c1ed8ddbb1d5a57d7e507771f8079d9af (diff)
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 <contact@emersion.fr> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com> (cherry picked from commit 421ce458f1d295015c108eb32f9611e527649cf8)
Diffstat (limited to 'hw')
-rw-r--r--hw/xwayland/xwayland-glamor-gbm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index dce782fc3..4f590cd43 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -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;
}