1
0
Fork 0

wayland/drm-lease: Hold device fd when listing leases

In multi-GPU setups, when one of the GPUs is used to render the desktop
and the other one has all of their devices available for lease,
meta_kms_impl_device_list_lessees() can be called after the device fd
has been unhold.

Make sure to hold and unhold it in this function.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4030>


(cherry picked from commit 45bf41bf94)
This commit is contained in:
José Expósito 2024-09-18 11:12:26 +02:00 committed by Bilal Elmoussaoui
parent 70c0eca6b0
commit 9890fe7375

View file

@ -440,7 +440,12 @@ meta_kms_impl_device_list_lessees (MetaKmsImplDevice *impl_device,
meta_assert_in_kms_impl (meta_kms_impl_get_kms (priv->impl));
if (!ensure_device_file (impl_device, error))
return FALSE;
meta_kms_impl_device_hold_fd (impl_device);
list = drmModeListLessees (meta_kms_impl_device_get_fd (impl_device));
meta_kms_impl_device_unhold_fd (impl_device);
if (!list)
{