virgl/gbm: fix gbm exported fds

Fix plane handle deduplication logic so that each handle is only
exported as an fd once.

Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
David Stevens 5 years ago committed by Gert Wollny
parent dc064827bb
commit 5ad860a3f8
  1. 3
      src/virgl_gbm.c

@ -426,7 +426,7 @@ int virgl_gbm_export_query(struct gbm_bo *bo, struct virgl_renderer_export_query
handle = gbm_bo_get_handle_for_plane(bo, plane).u32;
for (i = 0; i < query->out_num_fds; i++) {
if (handles[query->out_num_fds] == handle)
if (handles[i] == handle)
break;
}
@ -436,6 +436,7 @@ int virgl_gbm_export_query(struct gbm_bo *bo, struct virgl_renderer_export_query
if (ret)
goto err_close;
}
handles[query->out_num_fds] = handle;
query->out_num_fds++;
}
}

Loading…
Cancel
Save