diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc index ad8f454fe582d..5d153f961543a 100644 --- a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc +++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc @@ -160,8 +160,7 @@ void GbmPixmapWayland::CreateZwpLinuxDmabuf() { for (size_t i = 0; i < plane_count; ++i) { strides.push_back(GetDmaBufPitch(i)); offsets.push_back(GetDmaBufOffset(i)); - if (modifier != DRM_FORMAT_MOD_INVALID) - modifiers.push_back(modifier); + modifiers.push_back(modifier); } base::ScopedFD fd(HANDLE_EINTR(dup(GetDmaBufFd(0)))); diff --git a/ui/ozone/platform/wayland/wayland_buffer_manager.cc b/ui/ozone/platform/wayland/wayland_buffer_manager.cc index 91b1a1e8eb010..df12dfb1cdf14 100644 --- a/ui/ozone/platform/wayland/wayland_buffer_manager.cc +++ b/ui/ozone/platform/wayland/wayland_buffer_manager.cc @@ -105,9 +105,17 @@ bool WaylandBufferManager::CreateBuffer(base::File file, uint32_t fd = file.TakePlatformFile(); for (size_t i = 0; i < planes_count; i++) { - zwp_linux_buffer_params_v1_add(params, fd, i /* plane id */, offsets[i], - strides[i], modifiers[i] >> 32, - modifiers[i] & UINT32_MAX); + if (modifiers[i] == DRM_FORMAT_MOD_INVALID) { + DCHECK_EQ(planes_count, 1u) << "Invalid modifier may be passed only in " + "case of single plane format being used"; + zwp_linux_buffer_params_v1_add(params, fd, i /* plane id */, offsets[i], + strides[i], 0, 0); + + } else { + zwp_linux_buffer_params_v1_add(params, fd, i /* plane id */, offsets[i], + strides[i], modifiers[i] >> 32, + modifiers[i] & UINT32_MAX); + } } zwp_linux_buffer_params_v1_add_listener(params, ¶ms_listener, this); zwp_linux_buffer_params_v1_create(params, width, height, format, 0);