crosvm/gpu_buffer
Zach Reizner e9717c4b7b gpu_buffer: fix reading and writing to GPU buffers
The original methods for reading and writing to GPU buffers naively
assumed that the mappings returned by GBM were to the first byte in the
buffer. In fact, the returned mapping is to the first pixel of the
mapped rectangle. This would lead to segaults when the copy routine
would breeze past the end of the mapping into segault territory.

This change fixes the read and write algorithms and adds lots more guard
rails in to prevent future undefined behavior (hopefully).

TEST=boot kernel with VT and VIRTIO_GPU
BUG=None

Change-Id: Ia7c968b6dd274551b6d218e2f0b255af6e55bd35
Reviewed-on: https://chromium-review.googlesource.com/1102110
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2018-07-25 00:14:24 -07:00
..
src gpu_buffer: fix reading and writing to GPU buffers 2018-07-25 00:14:24 -07:00
Cargo.toml virtwl: Add DMABuf allocation support. 2018-05-16 08:34:40 -07:00