display: drm: virtio-gpu-drm

 

There are a few parts to this implementation.

QEMU, virglrenderer and virtio-gpu. The way it works is by letting the guest applications speak unmodified OpenGL to the Mesa. But instead of Mesa handing commands over to the hardware it is channeled through virtio-gpu on the guest to QEMU on the host.

QEMU then receives the raw graphics stack state (Gallium state) and interprets it using virglrenderer from the raw state into an OpenGL form, which can be executed as entirely normal OpenGL on the host machine.

The host OpenGL stack does not even have to be Mesa, and could for example be the proprietary nvidia stack.

听起来这个逻辑非常的长,guest端需要把渲染命令opegl->mesa->guest_kernel->host_qemu_XXX->Opengl->mesa->host_kernel->display


static struct virtio_driver virtio_gpu_driver = {
    .feature_table = features,
    .feature_table_size = ARRAY_SIZE(features),
…
    .id_table = id_table,
    .probe = virtio_gpu_probe,
    .remove = virtio_gpu_remove,
    .config_changed = virtio_gpu_config_changed
};


DEFINE_DRM_GEM_FOPS(virtio_gpu_driver_fops);

static struct drm_driver driver = {
    .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER | DRIVER_ATOMIC,
    //作为一款drm驱动,支持的功能
    .open = virtio_gpu_dri
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值