minigbm: virtio-gpu: bo_invalidate fixes

When invalidating a buffer, minigbm needs to ensure that the
host-to-guest transfer completes before returning from invalidate, to
prevent the host from overwriting subsequent guest changes.

However, invalidate is only necessary when the host can modify the
buffer. For now, just check for buffers the virtio gpu device can write
to (BO_USE_RENDERING). More flags can be added later for other virtio
devices.

BUG=b:142687692
TEST=manual - Launch play store and verify there is no black app window.
Change-Id: Id9475e6037ff667324f4fd95a94b1723c18ea2d2
Reviewed-on: https://chromium-review.googlesource.com/1875897
Tested-by: David Stevens <stevensd@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
1 file changed