mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
vulkan/wsi/wayland: improve same gpu detection
Some compositor like KWin do not return the render node. v2: Make sure we test if only drm_info.hasPrimary is true (Jason) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes:db42ed1e04("vulkan/wsi/wl: correctly find whether the compositor uses the same GPU") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8139 Reviewed-by: Simon Ser <contact@emersion.fr> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20914> (cherry picked from commite27d217fb1)
This commit is contained in:
parent
8f0b387d94
commit
5a2ca86429
2 changed files with 12 additions and 4 deletions
|
|
@ -238,7 +238,7 @@
|
|||
"description": "vulkan/wsi/wayland: improve same gpu detection",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "db42ed1e04cc7c9b92fb22cc2eef7f62e73aabba"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -843,10 +843,18 @@ wsi_wl_display_init(struct wsi_wayland *wsi_wl,
|
|||
/* Round-trip again to fetch dma-buf feedback */
|
||||
wl_display_roundtrip_queue(display->wl_display, display->queue);
|
||||
|
||||
if (wsi_wl->wsi->drm_info.hasRender) {
|
||||
if (wsi_wl->wsi->drm_info.hasRender ||
|
||||
wsi_wl->wsi->drm_info.hasPrimary) {
|
||||
/* Apparently some wayland compositor do not send the render
|
||||
* device node but the primary, so test against both.
|
||||
*/
|
||||
display->same_gpu =
|
||||
major(display->main_device) == wsi_wl->wsi->drm_info.renderMajor &&
|
||||
minor(display->main_device) == wsi_wl->wsi->drm_info.renderMinor;
|
||||
(wsi_wl->wsi->drm_info.hasRender &&
|
||||
major(display->main_device) == wsi_wl->wsi->drm_info.renderMajor &&
|
||||
minor(display->main_device) == wsi_wl->wsi->drm_info.renderMinor) ||
|
||||
(wsi_wl->wsi->drm_info.hasPrimary &&
|
||||
major(display->main_device) == wsi_wl->wsi->drm_info.primaryMajor &&
|
||||
minor(display->main_device) == wsi_wl->wsi->drm_info.primaryMinor);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue