devices: gpu: Check /dev/dri exists before mount

GPU in 2D mode does not need this and /dev/dri may not
exist (Nvidia startup failure after forced workstation
updates?).

BUG=b:166180769
TEST=boot Cuttlefish

Change-Id: Iaf80fc0f8f031270267df18d61964f8a648920b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2381892
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Commit-Queue: Jason Macnak <natsu@google.com>
This commit is contained in:
Jason Macnak 2020-08-28 09:10:46 -07:00 committed by Commit Bot
parent ab205af96c
commit 23400524e9

View file

@ -730,8 +730,11 @@ fn create_gpu_device(
jail.mount_bind(sys_dev_char_path, sys_dev_char_path, false)?;
let sys_devices_path = Path::new("/sys/devices");
jail.mount_bind(sys_devices_path, sys_devices_path, false)?;
let drm_dri_path = Path::new("/dev/dri");
jail.mount_bind(drm_dri_path, drm_dri_path, false)?;
if drm_dri_path.exists() {
jail.mount_bind(drm_dri_path, drm_dri_path, false)?;
}
// If the ARM specific devices exist on the host, bind mount them in.
let mali0_path = Path::new("/dev/mali0");