- if (combo->format == format)
- return true;
-
- switch (format) {
- case DRM_FORMAT_XRGB8888:
- return combo->format == DRM_FORMAT_ARGB8888;
- case DRM_FORMAT_XBGR8888:
- return combo->format == DRM_FORMAT_ABGR8888;
- case DRM_FORMAT_RGBX8888:
- return combo->format == DRM_FORMAT_RGBA8888;
- case DRM_FORMAT_BGRX8888:
- return combo->format == DRM_FORMAT_BGRA8888;
- case DRM_FORMAT_XRGB2101010:
- return combo->format == DRM_FORMAT_ARGB2101010;
- case DRM_FORMAT_XBGR2101010:
- return combo->format == DRM_FORMAT_ABGR2101010;
- default:
- return false;
- }
-}
-
-static int i915_add_kms_item(struct driver *drv, const struct kms_item *item)
-{
- uint32_t i;
- struct combination *combo;
-
- /*
- * Older hardware can't scanout Y-tiled formats. Newer devices can, and
- * report this functionality via format modifiers.
- */
- for (i = 0; i < drv_array_size(drv->combos); i++) {
- combo = (struct combination *)drv_array_at_idx(drv->combos, i);
- if (!format_compatible(combo, item->format))
- continue;
-
- if (item->modifier == DRM_FORMAT_MOD_LINEAR &&
- combo->metadata.tiling == I915_TILING_X) {
- /*
- * FIXME: drv_query_kms() does not report the available modifiers
- * yet, but we know that all hardware can scanout from X-tiled
- * buffers, so let's add this to our combinations, except for
- * cursor, which must not be tiled.
- */
- combo->use_flags |= item->use_flags & ~BO_USE_CURSOR;
- }
-
- /* If we can scanout NV12, we support all tiling modes. */
- if (item->format == DRM_FORMAT_NV12)
- combo->use_flags |= item->use_flags;
-
- if (combo->metadata.modifier == item->modifier)
- combo->use_flags |= item->use_flags;
- }
-
- return 0;