virgl: Clear the valid buffer range when possible

If we are discarding the whole resource in a synchronized way, the
resource storage is now unused, either because we have created new
resource storage, or because we have waited for the existing resource
storage to become unused. We can thus mark the storage as uninitialized,
but only if the resource is not host writable (in which case we can't
clear the valid range, since that would result in missed readbacks in
future transfers).

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
10 jobs for !1159 with virgl-invalidate-buffer in 15 minutes and 8 seconds (queued for 15 seconds)
latest detached
Status Name Job ID Coverage
  Containers Build
passed debian #387417

00:00:27

 
  Build+Test
passed meson-clang #387419

00:07:55

passed meson-clover #387423

00:09:00

passed meson-main #387422

00:06:27

passed meson-swr-glvnd #387418

00:05:39

passed meson-vulkan #387424

00:02:59

passed scons-llvm #387426

00:04:02

passed scons-nollvm #387425

00:06:29

passed scons-swr #387420

00:04:53

passed scons-win64 #387421

00:06:02