If we sync/flush a full resource we can skip any level where the
target is of the same age as the source.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
/* Copy each level and each layer */
for (int level = first_level; level <= last_level; level++) {
+ /* skip levels that don't need to be flushed or are of the same age */
+ if (src == dst) {
+ if (!etna_resource_level_needs_flush(&src_priv->levels[level]))
+ continue;
+ } else {
+ if (!etna_resource_level_older(&dst_priv->levels[level], &src_priv->levels[level]))
+ continue;
+ }
+
blit.src.level = blit.dst.level = level;
blit.src.box.width = blit.dst.box.width =
MIN2(src_priv->levels[level].padded_width, dst_priv->levels[level].padded_width);