[Help] Dma-buf local display

Charles Frey cfrey at elv.telecom-lille.fr
Wed May 9 16:00:03 UTC 2018


Hi, 
I'm trying to achieve local display of my guest dma-bufs without using a Qemu UI. My goal is to be able to directly display the framebuffers on a local display without necessiting an X server and Qemu UI such as GTK or spice. 

Following the tutorial on https://01.org/igvt-g/blogs/wangbo85/2018/sharing-guest-framebuffer-host , I'm using the drm KMS API to get a framebuffer from a dma-buf FD, but can't get any display on my screen. 

The way I'm implementing this is the following : 

from qemu/hw/vfio/display.c, function vfio_display_get_dmabuf(), I get the following dma-buf FD and send it to a Unix socket that my DRM program listens to. 
fd = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_GET_GFX_DMABUF, &plane.dmabuf_id); 

Then in my application, I get the corresponding handle with drmPrimeFDToHandle(dri_drm, fd, &device->handle), where dri_drm is the /dev/dri/card0 FD and device the struct representing it. 
No error on this and I get a handle. 

drmPrimeFDToHandle(dri_drm, fd, &device->handle); 

When I try adding a framebuffer with drmModeAddFB() though, I get an error (-22, invalid argument). 
The error is self explanatory as it is but I can't get to find which one is invalid, my height, width are correct. Is there a step I am missing? 

Thanks for your time. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20180509/78f0fc28/attachment.html>


More information about the intel-gvt-dev mailing list