Commit 063ce5c7 authored by Rob Clark's avatar Rob Clark

gbm: fix fallback for drivers that don't support modifiers

Gallium drivers that do not implement resource_create_with_modifiers()
will fail gbm_surface_create_with_modifiers() so fall back to the old
way.

Fixes: 4f7cec00 Use weak functions to handle lack of gbm modifiers
Signed-off-by: 's avatarRob Clark <robdclark@gmail.com>
Reviewed-by: 's avatarEmil Velikov <emil.velikov@collabora.com>
parent 98f31bfa
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment