xwayland: Use the new API to set scanout
If the format and modifiers are from a tranche which supports scanout, we can set the corresponding flag to gbm_bo_create_with_modifiers2() to benefit from scanout buffers where applicable. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
parent
967ad0fa1e
commit
8f7279ade2
|
@ -296,10 +296,14 @@ xwl_glamor_gbm_create_pixmap_internal(struct xwl_screen *xwl_screen,
|
||||||
if (xwl_gbm->dmabuf_capable) {
|
if (xwl_gbm->dmabuf_capable) {
|
||||||
uint32_t num_modifiers = 0;
|
uint32_t num_modifiers = 0;
|
||||||
uint64_t *modifiers = NULL;
|
uint64_t *modifiers = NULL;
|
||||||
|
Bool supports_scanout = FALSE;
|
||||||
|
|
||||||
if (drawable) {
|
if (drawable) {
|
||||||
xwl_glamor_get_drawable_modifiers(drawable, format,
|
xwl_glamor_get_drawable_modifiers_and_scanout(drawable,
|
||||||
&num_modifiers, &modifiers);
|
format,
|
||||||
|
&num_modifiers,
|
||||||
|
&modifiers,
|
||||||
|
&supports_scanout);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num_modifiers == 0) {
|
if (num_modifiers == 0) {
|
||||||
|
@ -309,9 +313,12 @@ xwl_glamor_gbm_create_pixmap_internal(struct xwl_screen *xwl_screen,
|
||||||
|
|
||||||
if (num_modifiers > 0) {
|
if (num_modifiers > 0) {
|
||||||
#ifdef GBM_BO_WITH_MODIFIERS2
|
#ifdef GBM_BO_WITH_MODIFIERS2
|
||||||
|
uint32_t usage = GBM_BO_USE_RENDERING;
|
||||||
|
if (supports_scanout)
|
||||||
|
usage |= GBM_BO_USE_SCANOUT;
|
||||||
bo = gbm_bo_create_with_modifiers2(xwl_gbm->gbm, width, height,
|
bo = gbm_bo_create_with_modifiers2(xwl_gbm->gbm, width, height,
|
||||||
format, modifiers, num_modifiers,
|
format, modifiers, num_modifiers,
|
||||||
GBM_BO_USE_RENDERING);
|
usage);
|
||||||
#else
|
#else
|
||||||
bo = gbm_bo_create_with_modifiers(xwl_gbm->gbm, width, height,
|
bo = gbm_bo_create_with_modifiers(xwl_gbm->gbm, width, height,
|
||||||
format, modifiers, num_modifiers);
|
format, modifiers, num_modifiers);
|
||||||
|
|
Loading…
Reference in New Issue