diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 0c2f7d1faad..63de619ee4d 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -530,11 +530,18 @@ surface_dmabuf_feedback_tranche_formats( { struct dri2_egl_surface *dri2_surf = data; struct dmabuf_feedback *feedback = &dri2_surf->pending_dmabuf_feedback; + uint32_t present_format = dri2_surf->format; uint64_t *modifier_ptr, modifier; uint32_t format; uint16_t *index; int visual_idx; + if (dri2_surf->base.PresentOpaque) { + visual_idx = dri2_wl_visual_idx_from_fourcc(present_format); + if (visual_idx != -1) + present_format = dri2_wl_visuals[visual_idx].opaque_wl_drm_format; + } + /* Compositor may advertise or not a format table. If it does, we use it. * Otherwise, we steal the most recent advertised format table. If we don't * have a most recent advertised format table, compositor did something @@ -564,7 +571,7 @@ surface_dmabuf_feedback_tranche_formats( /* Skip formats that are not the one the surface is already using. We * can't switch to another format. */ - if (format != dri2_surf->format) + if (format != present_format) continue; /* We are sure that the format is supported because of the check above. */