panfrost: Don't copy resources if replaced
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 2 Nov 2022 17:43:11 +0000 (13:43 -0400)
committerEric Engestrom <eric@engestrom.ch>
Wed, 9 Nov 2022 21:22:05 +0000 (21:22 +0000)
commitec5bc021fe77058ecb02a9ef2c429e0b889ce1d5
tree1e1c6d39cf26fec1520602c339a6216a0780b2e7
parent76906af371a85b6fbdfb473cf0b9969775f7c3a4
panfrost: Don't copy resources if replaced

If a synchronized transfer_map is going to overwrite an entire resource,
there's no need to memcpy in the original contents ahead-of-time. This
memcpy is particularly bad for large buffers where it's copying WC->WC,
although that could be mitigated with threaded_context's cpu_storage in
the future if needed.

Prevents a performance regression in glmark2's buffer scenes from the
next patch, hence the Cc.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19361>
(cherry picked from commit 0b26a9f773956fc00a77b0d4a7aafee5795ce935)
.pick_status.json
src/gallium/drivers/panfrost/pan_resource.c