Skip to content

Commit 9fde680

Browse files
yann-morin-1998ardera
authored andcommitted
src/egl_gbm_render_surface: properly fallback to surface with no modifier
In 869fa7f, we added a fallback to be able to create an EGL sruface when the driver do not support modifiers, like the llvmpipe software renderer (or like some proprietary drivers, like the MALI ones), as reported in #269 [0]. However, in c653767, there was a big overhaul of renderer infrastructure. That commit lost the with-modifiers code path and only kept the without-modifiers fallback one (i.e. it only kept the call to gbm_surface_create(), not to gbm_surface_create_with_modifiers()). Then in b0d09f5, the with-modifier code path was re-instated, but in a way that made it exclusive with the without-modifiers one. That is, the without-modifiers code path was not a fallback to when the other failed. Re-instate the fallback mechanism as initially implemented. [0] #269 Signed-off-by: Yann E. MORIN <[email protected]>
1 parent 4e9b44b commit 9fde680

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/egl_gbm_render_surface.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static int egl_gbm_render_surface_init(
146146
}
147147
#endif
148148

149+
gbm_surface = NULL;
149150
if (allowed_modifiers != NULL) {
150151
gbm_surface = gbm_surface_create_with_modifiers(
151152
gbm_device,
@@ -158,9 +159,10 @@ static int egl_gbm_render_surface_init(
158159
if (gbm_surface == NULL) {
159160
ok = errno;
160161
LOG_ERROR("Couldn't create GBM surface for rendering. gbm_surface_create_with_modifiers: %s\n", strerror(ok));
161-
return ok;
162+
LOG_ERROR("Will retry without modifiers\n");
162163
}
163-
} else {
164+
}
165+
if (gbm_surface == NULL) {
164166
gbm_surface = gbm_surface_create(
165167
gbm_device,
166168
size.x,

0 commit comments

Comments
 (0)