vkkhrdisplay: Fix output selection

While this platform plugin does not have full multi-screen support,
it at least has the ability to choose the one to use via env.vars.

This currently does not work. What's more, it looks like it chooses
the last display by default, instead of the first.

Fix the display/display-mode logic. This now allows QT_VK_DISPLAY_INDEX
to work correctly, for example on a RPi4 with two screens connected.

Fixes: QTBUG-117416
Change-Id: Ia5ac8fde5827b3a2e1945e8e4f04fb8dd90704e2
Pick-to: 6.5
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
(cherry picked from commit 66be69139ce15be5df800e93a4702891fa8d6fb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Laszlo Agocs 2023-09-21 10:34:40 +02:00 committed by Qt Cherry-pick Bot
parent a2098df701
commit 0d7f2dfa1c

View File

@ -143,7 +143,7 @@ bool QVkKhrDisplayVulkanInstance::chooseDisplay()
j, (void *) mode.displayMode,
mode.parameters.visibleRegion.width, mode.parameters.visibleRegion.height,
mode.parameters.refreshRate);
if (j == wantedModeIndex) {
if (j == wantedModeIndex && i == wantedDisplayIndex) {
m_displayMode = mode.displayMode;
m_width = mode.parameters.visibleRegion.width;
m_height = mode.parameters.visibleRegion.height;