mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-11 04:26:38 +00:00
linux: mount all possible render nodes
Originally, we only mount 1 render node "/dev/dri/renderD128". However, the working node might not be this one. This CL mounts all the possible render nodes. BUG=b:202352463 BUG=b:201738023 TEST=tast run $(DUT) arc.Boot.vm and confirm all render nodes are bound Change-Id: I10331a1fba724ae2f75a96f59b1a9931e108e213 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3317006 Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Auto-Submit: Chih-Yu Huang <akahuang@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
This commit is contained in:
parent
4eec83452d
commit
d2c2bd1ba3
1 changed files with 12 additions and 2 deletions
14
src/linux.rs
14
src/linux.rs
|
@ -957,8 +957,18 @@ fn create_video_device(
|
|||
#[cfg(feature = "libvda")]
|
||||
// Render node for libvda.
|
||||
if backend == VideoBackendType::Libvda {
|
||||
let dev_dri_path = Path::new("/dev/dri/renderD128");
|
||||
jail.mount_bind(dev_dri_path, dev_dri_path, false)?;
|
||||
// follow the implementation at:
|
||||
// https://source.corp.google.com/chromeos_public/src/platform/minigbm/cros_gralloc/cros_gralloc_driver.cc;l=90;bpv=0;cl=c06cc9cccb3cf3c7f9d2aec706c27c34cd6162a0
|
||||
const DRM_NUM_NODES: u32 = 63;
|
||||
const DRM_RENDER_NODE_START: u32 = 128;
|
||||
for offset in 0..DRM_NUM_NODES {
|
||||
let path_str = format!("/dev/dri/renderD{}", DRM_RENDER_NODE_START + offset);
|
||||
let dev_dri_path = Path::new(&path_str);
|
||||
if !dev_dri_path.exists() {
|
||||
break;
|
||||
}
|
||||
jail.mount_bind(dev_dri_path, dev_dri_path, false)?;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||
|
|
Loading…
Reference in a new issue