From 800c108f9d2463066a221a0e4ff56867304551a6 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Thu, 12 Nov 2026 18:28:16 -0500 Subject: tools: fix r1780 cycle prerequisites and add SDL GLX-pbuffer shim - cycle-r1780.sh: load vfio modules one per modprobe (the multi-module form was silently treating the extra names as parameters and never loading mdev); auto-detect the vgpu mdev type and prefer the 2 GiB type used by the campaign. - sdl_cap.c: gate capture-file creation to processes that can actually read GL pixels (a child was truncating the capture), and log the capture pid/pointers. - gz_pbuf.c: LD_PRELOAD shim that gives an SDL2 GL client a GLX pbuffer context on the guest's NVIDIA X server (the proven gl_frames path), with SDL_GL_GetDrawableSize/SwapWindow interception. --- tools/guest-diag/sdl_cap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tools/guest-diag/sdl_cap.c') diff --git a/tools/guest-diag/sdl_cap.c b/tools/guest-diag/sdl_cap.c index 23c83ab..5b9c096 100644 --- a/tools/guest-diag/sdl_cap.c +++ b/tools/guest-diag/sdl_cap.c @@ -87,10 +87,12 @@ __attribute__((constructor)) static void cap_init(void) if (h) real_glReadPixels = dlsym(h, "glReadPixels"); } - fprintf(stderr, "[gzcap] init path=%s present=%p updwin=%p swap=%p read=%p gros=%p\n", - p, (void *)real_RenderPresent, (void *)real_UpdateWindowSurface, + fprintf(stderr, "[gzcap] init pid=%d path=%s present=%p updwin=%p swap=%p read=%p gros=%p\n", + (int)getpid(), p, (void *)real_RenderPresent, (void *)real_UpdateWindowSurface, (void *)real_GL_SwapWindow, (void *)real_RenderReadPixels, (void *)real_GetRendererOutputSize, (void *)real_glReadPixels); + if (!real_glReadPixels && !real_RenderReadPixels) + return; cap_fp = fopen(p, "wb"); if (!cap_fp) return; @@ -192,7 +194,9 @@ void SDL_GL_SwapWindow(SDL_Window *win) static size_t gbufsz; if (!hit++) - fprintf(stderr, "[gzcap] hook GLSwapWindow\n"); + fprintf(stderr, "[gzcap] hook GLSwapWindow pid=%d fp=%p read=%p gros=%p\n", + (int)getpid(), (void *)cap_fp, (void *)real_glReadPixels, + (void *)real_GL_GetDrawableSize); if (cap_fp && !cap_stop && real_glReadPixels && real_GL_GetDrawableSize) { int w = 0, h = 0; -- cgit v1.2.3