panfrost: fix a GPU/CPU synchronization problem
Remove a premature optimization. When PIPE_MAP_DISCARD_WHOLE_RESOURCE is set we were setting create_new_bo, and then if that was set we skipped a set of tests which if passed would cause a panfrost_flush_writer. In fact we need that flush in some cases (e.g. when any batch is reading the resource). Moreover, we should sometimes copy the resource (set the copy_resource flag) and that again was being skipped if create_new_bo was initially true due to PIPE_MAP_DISCARD_WHOLE_RESOURCE being set. Cc: mesa-stable Signed-off-by:Eric R. Smith <eric.smith@collabora.com> Acked-by:
Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <mesa/mesa!28406> (cherry picked from commit e3d123b7)