mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
virtio-gpu: fix reporting of VIRTIO_F_VERSION_1
The virtio 1.0 feature flag is defined as a shift count, not a mask. While we're at it, change the virtio gpu features() function to the avail_features style used in other devices for consistency. BUG=None TEST=None Change-Id: I704d9676cfe5f13d9a2f83eb9160937e94070d1e Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1198224 Reviewed-by: Zach Reizner <zachr@chromium.org>
This commit is contained in:
parent
9c7cd86325
commit
8a4a13d48d
1 changed files with 3 additions and 2 deletions
|
@ -635,9 +635,10 @@ impl VirtioDevice for Gpu {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn features(&self, page: u32) -> u32 {
|
fn features(&self, page: u32) -> u32 {
|
||||||
|
let avail_features: u64 = 1 << VIRTIO_GPU_F_VIRGL | 1 << VIRTIO_F_VERSION_1;
|
||||||
match page {
|
match page {
|
||||||
0 => (1 << VIRTIO_GPU_F_VIRGL),
|
0 => avail_features as u32,
|
||||||
1 => VIRTIO_F_VERSION_1,
|
1 => (avail_features >> 32) as u32,
|
||||||
_ => 0,
|
_ => 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue