Normally modifiers take precendence over use flags, as they are more
explicit. But if the driver supports modifiers, but the xserver does
not, then we should fallback to the old mechanism of allocating a buffer
using 'use' flags.
Fixes: 069fdd5f9facbd72fb6a289696c7b74e3237e70f
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
free(mod_reply);
- buffer->image = draw->ext->image->createImageWithModifiers(draw->dri_screen,
- width, height,
- format,
- modifiers,
- count,
- buffer);
+ /* don't use createImageWithModifiers() if we have no
+ * modifiers, other things depend on the use flags when
+ * there are no modifiers to know that a buffer can be
+ * shared.
+ */
+ if (modifiers) {
+ buffer->image = draw->ext->image->createImageWithModifiers(draw->dri_screen,
+ width, height,
+ format,
+ modifiers,
+ count,
+ buffer);
+ }
+
free(modifiers);
}
#endif