screencast: Don't skip the last valid modifier

Since modifiers are listed in preference order, the last one is usually
the most general fallback. If we drop it, we risk winding up with no
usable modifiers.

On Apple GPUs with the Asahi driver, the received modifiers are usually
compressed, twiddled, and linear. Dropping linear means we only request
complex formats. But then gbm_bo_create_with_modifiers always requests
a scanout-capable BO which cannot support complex formats, and we wind
up with nothing. This breaks screencasting on these platforms.
master
Asahi Lina 2 years ago committed by Aleix Pol Gonzalez
parent f37acaff54
commit f5a80f0d3c

@ -151,7 +151,7 @@ void ScreenCastStream::onStreamParamChanged(void *data, uint32_t id, const struc
if (modifierProperty) {
const struct spa_pod *modifierPod = &modifierProperty->value;
uint32_t modifiersCount = SPA_POD_CHOICE_N_VALUES(modifierPod) - 1;
uint32_t modifiersCount = SPA_POD_CHOICE_N_VALUES(modifierPod);
uint64_t *modifiers = (uint64_t *)SPA_POD_CHOICE_VALUES(modifierPod);
receivedModifiers = QVector<uint64_t>(modifiers, modifiers + modifiersCount);
}

Loading…
Cancel
Save