Virtio GPU

For containers in virtualized environments, they are working on accelerated OpenGL ES 2.0 support with that being the lowest common denominator for many mobile platforms. This virtual GPU access they are pursuing is making use of Red Hat’s work on Virgil3D as the Gallium3D-based solution for graphics pass-through to the host. Then for the kernel bits are VirtIO-GPU and on the host is the Virgl Renderer with QEMU.

virtio-gpu-qemu-layer

OpenGL

OpenGL, OpenGL ES, and OpenGL ES-SC API and Extension Registry

  • OpenGL-Registry

EGL

EGL是图形渲染API(如OpenGL ES)与本地平台窗口系统的一层接口,保证了OpenGL ES的平台独立性。EGL提供了若干功能:创建rendering surface、创建graphics context、同步应用程序和本地平台渲染API、提供对显示设备的访问、提供对渲染配置的管理等。

egl是一个管理者的功能。包括管理所有的display , context, surface,config。可能有很多的display ,每个display有很多的configs,这个display上可以创建很多的context和surface

  • EGL Reference Pages
  • 1EGL 1.4 API Quick Reference Card

GLX

GLX是OpenGL Extension to the X Window System的缩写。它作为x的扩展,是x协议和X server的一部分,已经包含在X server的代码中了。GLX提供了X window system使用的OpenGL接口,允许通过x调用OpenGL库。OpenGL 在使用时,需要与一个实际的窗口系统关联起来。

GLX、EGL与OpenGL ES之间的关系??

一般EGL和OpenGL ES使用时都会先利用egl函数(egl开头)创建opengl本地环境,然后再利用opengl函数(gl开头)去画图。

EGL代替的是原先WGL/GLX那套context管理,跟图形API用的什么没关系

1
EGLBoolean eglBindAPI( 	EGLenum api);

Parameters api:
Specifies the client API to bind, one of EGL_OPENGL_API, EGL_OPENGL_ES_API, or EGL_OPENVG_API.

mesa

Gallium

  • Gallium’s documentation
  • Gallium3D Documentation doxygen

DRI

  • DRI megadrivers

Virgil

Virgil is an effort to provide 3D acceleration using Gallium3D for QEMU+KVM virtual machine guests.

  • Virgil Linux News
  • What’s new in the virtual world?(pdf)
  • GSoC 2018 - Vulkan-ize Virglrenderer
  • GSoC 2017 - 3D acceleration using VirtIOGPU

virgl_protocol

It is composed of several components:

  • a MESA driver, on the guest, which generates Virgl commands
  • a lib, on the host, which takes virgl commands and generated OpenGL calls from it.

GPU Driver

DRM

he DRM core includes two memory managers, namely Translation Table Maps (TTM) and Graphics Execution Manager (GEM).

  • Linux GPU Driver Developer’s Guide
  • DRM memory management - 最好的GEM/TTM/PRIME解释

piglit

GLSL

OpenGL着色语言(OpenGL Shading Language)是用来在OpenGL中着色编程的语言,也即开发人员写的短小的自定义程序,他们是在图形卡的GPU (Graphic Processor Unit图形处理单元)上执行的,代替了固定的渲染管线的一部分,使渲染管线中不同层次具有可编程性。

X.org

2018年X.Org开发者大会相关文档和视频(网络原因视频看不了)

  • https://www.x.org/wiki/Events/XDC2018/

graphics pipeline

graphics_pipeline

https://www.seas.upenn.edu/~cis565/LECTURES/Lecture2 New.pdf

参考

  • virtio-gpu-wddm-dod
  • OpenGL ICD for Virtio-GPU Windows driver(Github)
  • Virtual I/O Device (VIRTIO) Version 1.1
  • GSoC 2017 - 3D acceleration using VirtIOGPU
  • GSoC 2018 - Vulkan-ize Virglrenderer
  • The OpenGL vs Mesa matrix
  • Virtualizing GPU Access
  • kraxel’s news — virgl and qemu
  • VirtIO GPU基本原理