Backport fix for nvidia GBM
As say in the Nvidia QT patch (https://codereview.qt-project.org/c/qt/qtwayland/+/373473) Qt is unusable with nvidia GBM and do a really bad performance.
In the comment, an alternative merged by QT to this patch has been merged: https://codereview.qt-project.org/c/qt/qtwayland/+/301712
This MR backports this change. WIP because I cannot test the change, if somebody can confirm it fix the problem ?