Skip to content

asahi: implement support for DRM native context

Sergio Lopez requested to merge slp/mesa:asahi-native-context-v5 into main

DRM native context is a technique developed by Rob Clark for freedreno which allows a mesa driver to operate the host's DRM device from a VM, using virtio-gpu as a transport.

This commit implements support for DRM native context for the asahi driver. Since we don't want to blindly probe for the host device through virtio-gpu, enabling the asahi driver in a VM requires using the MESA_LOADER_DRIVER_OVERRIDE environment variable.

The counterpart in virglrenderer is available: virgl/virglrenderer!1274

v2:

  • Replaced implementation dependent submit_single() with a simpler agx_virtio_submit() that operates on a prepopulated agx_asahi_submit(). (thanks Alyssa).
  • Various minor code clean ups. (thanks Alyssa)
  • Rebased.

v3:

  • Import 'asahi_proto.h' from virglrenderer's MR and drop that code from agx_device_virtio.c. (thanks Alyssa)
  • Move agx_virtio_submit() and drmIoctl(DRM_IOCTL_ASAHI_SUBMIT) behind ops->submit(). (thanks Alyssa)
  • Return 'false' if we can't match 'version->name' with neither the native nor the virtualized device. (thanks Alyssa)
  • Avoid leaking in_syncs and out_syncs in agx_virtio_submit(). (thanks Alyssa)
  • More minor code clean ups. (thanks Alyssa)
Edited by Sergio Lopez

Merge request reports