compositor-drm: Don't set linear modifier when not supported

This will cause gbm_surface_create_with_modifiers to fail on drivers
where modifiers are not yet supported (e.g. amdgpu). We need to make
sure we only end up using gbm_surface_create in this case.

This fixes the remoting plugin on these drivers.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
dev
Scott Anderson 6 years ago
parent be57857af6
commit 99553750db
  1. 2
      libweston/compositor-drm.c

@ -4555,7 +4555,7 @@ drm_virtual_plane_create(struct drm_backend *b, struct drm_output *output)
plane->state_cur->complete = true;
plane->formats[0].format = output->gbm_format;
plane->count_formats = 1;
if (output->gbm_bo_flags & GBM_BO_USE_LINEAR) {
if ((output->gbm_bo_flags & GBM_BO_USE_LINEAR) && b->fb_modifiers) {
uint64_t *modifiers = zalloc(sizeof *modifiers);
if (modifiers) {
*modifiers = DRM_FORMAT_MOD_LINEAR;

Loading…
Cancel
Save