gallium: let the pipe drivers decide the supported modifiers
[mesa.git] / src / gallium / state_trackers / dri / dri2.c
index 05ebb4ef1d7198606407b5c46745523635d52287..8b4402a74aaaa2f04a55f257f0d3c672e7cdf3bd 100644 (file)
@@ -1395,15 +1395,11 @@ dri2_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
        (pscreen->is_format_supported(pscreen, format, screen->target, 0, 0,
                                      PIPE_BIND_RENDER_TARGET) ||
         pscreen->is_format_supported(pscreen, format, screen->target, 0, 0,
-                                     PIPE_BIND_SAMPLER_VIEW))) {
+                                     PIPE_BIND_SAMPLER_VIEW) ||
+        dri2_yuv_dma_buf_supported(screen, map))) {
       pscreen->query_dmabuf_modifiers(pscreen, format, max, modifiers,
                                       external_only, count);
       return true;
-   } else if (dri2_yuv_dma_buf_supported(screen, map)) {
-      *count = 1;
-      if (modifiers)
-         modifiers[0] = DRM_FORMAT_MOD_NONE;
-      return true;
    }
    return false;
 }