summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common.c b/common.c
index faecd42..931fc06 100644
--- a/common.c
+++ b/common.c
@@ -44,13 +44,16 @@ const struct gbm * init_gbm(int drm_fd, int w, int h, uint64_t modifier)
{
gbm.dev = gbm_create_device(drm_fd);
gbm.format = GBM_FORMAT_XRGB8888;
+ gbm.surface = NULL;
if (gbm_surface_create_with_modifiers) {
gbm.surface = gbm_surface_create_with_modifiers(gbm.dev, w, h,
gbm.format,
&modifier, 1);
- } else {
+ }
+
+ if (!gbm.surface) {
if (modifier != DRM_FORMAT_MOD_LINEAR) {
fprintf(stderr, "Modifiers requested but support isn't available\n");
return NULL;