@@ -146,6 +146,7 @@ static int egl_gbm_render_surface_init(
146146 }
147147#endif
148148
149+ int with_modifiers_errno ;
149150 gbm_surface = NULL ;
150151 if (allowed_modifiers != NULL ) {
151152 gbm_surface = gbm_surface_create_with_modifiers (
@@ -157,11 +158,10 @@ static int egl_gbm_render_surface_init(
157158 n_allowed_modifiers
158159 );
159160 if (gbm_surface == NULL ) {
160- ok = errno ;
161- LOG_ERROR ("Couldn't create GBM surface for rendering. gbm_surface_create_with_modifiers: %s\n" , strerror (ok ));
162- LOG_ERROR ("Will retry without modifiers\n" );
161+ with_modifiers_errno = errno ;
163162 }
164163 }
164+
165165 if (gbm_surface == NULL ) {
166166 gbm_surface = gbm_surface_create (
167167 gbm_device ,
@@ -171,8 +171,17 @@ static int egl_gbm_render_surface_init(
171171 GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT
172172 );
173173 if (gbm_surface == NULL ) {
174- ok = errno ;
175- LOG_ERROR ("Couldn't create GBM surface for rendering. gbm_surface_create: %s\n" , strerror (ok ));
174+ ok = errno ? errno : EIO ;
175+ if (allowed_modifiers != NULL ) {
176+ LOG_ERROR (
177+ "Couldn't create GBM surface for rendering. gbm_surface_create_with_modifiers: %s, gbm_surface_create: %s\n" ,
178+ strerror (with_modifiers_errno ),
179+ strerror (ok )
180+ );
181+ } else {
182+ LOG_ERROR ("Couldn't create GBM surface for rendering. gbm_surface_create: %s\n" , strerror (ok ));
183+ }
184+
176185 return ok ;
177186 }
178187 }
0 commit comments