mirror of https://github.com/mpv-player/mpv
vo_gpu: vulkan: displayvk: Fix handling of unconnected planes
If a plane is not connected to any displays, we won't set an entry in the mapping of planes to displays. So ensure these unset entries are null and skip them. Fixes #8913
This commit is contained in:
parent
dbbf4a415d
commit
03b9f8e323
|
@ -93,8 +93,9 @@ static bool walk_display_properties(struct mp_log *log,
|
|||
goto done;
|
||||
}
|
||||
|
||||
// Allocate zeroed arrays so that planes with no displays have a null entry.
|
||||
VkDisplayKHR **planes_to_displays =
|
||||
talloc_array(tmp, VkDisplayKHR *, num_planes);
|
||||
talloc_zero_array(tmp, VkDisplayKHR *, num_planes);
|
||||
for (int j = 0; j < num_planes; j++) {
|
||||
int num_displays_for_plane = 0;
|
||||
vkGetDisplayPlaneSupportedDisplaysKHR(device, j,
|
||||
|
@ -177,6 +178,10 @@ static bool walk_display_properties(struct mp_log *log,
|
|||
mp_msg(log, msgl_info, " Planes:\n");
|
||||
for (int k = 0; k < num_planes; k++) {
|
||||
VkDisplayKHR *displays = planes_to_displays[k];
|
||||
if (!displays) {
|
||||
// This plane is not connected to any displays.
|
||||
continue;
|
||||
}
|
||||
for (int d = 0; displays[d]; d++) {
|
||||
if (displays[d] == display) {
|
||||
if (selector && selector->plane_idx != k)
|
||||
|
|
Loading…
Reference in New Issue