v3dv: match render and display device for wsi present

Since the last changes for EGL_EXT_device_drm_render_node, the
can_present_on_device callback now may receive the render device.
With that, the v3dv implementation may return that this device cannot
be used for presentation.
In particular, this callback is used for x11 wsi, and when through
XWayland it does now get the render device. On x11 wsi, this makes the
swapchain operate on blit mode. The blit mode introduces additional
unneeded overhead on wsi and runs through a different path which
currently causes rendering issues (in particular also with Zink).

Allowing both devices to match in the callback returns all wsi to
operate on the native mode and fixes the issues above.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31490>
This commit is contained in:
Erico Nunes
2024-10-02 16:00:02 +02:00
committed by Marge Bot
parent 3b57a35ece
commit 6659b299e6
+9 -1
View File
@@ -41,7 +41,15 @@ v3dv_wsi_can_present_on_device(VkPhysicalDevice _pdevice, int fd)
{
V3DV_FROM_HANDLE(v3dv_physical_device, pdevice, _pdevice);
assert(pdevice->display_fd != -1);
return wsi_common_drm_devices_equal(fd, pdevice->display_fd);
assert(pdevice->render_fd != -1);
/* v3dv handles presentation by allocating wsi buffers in the display
* device, so both render and display devices can match here.
* In particular, this callback receives the render device when
* running in an XWayland environment.
*/
return wsi_common_drm_devices_equal(fd, pdevice->display_fd) ||
wsi_common_drm_devices_equal(fd, pdevice->render_fd);
}