/** * From src/gallium/winsys/nouveau/drm * * gcc -shared -fPIC -I../../../../../include -I../../../../../src/gallium/include -g -std=c99 wrapper_hack.c -o libwrap.so -ldl */ #include #include "pipe/p_context.h" #include "pipe/p_state.h" #include void * (*real_screen_create) (int); void * nouveau_drm_screen_create(int fd) { if (!real_screen_create) { void *handle = dlopen ("/usr/lib/xorg/modules/dri/nouveau_dri.so", RTLD_LAZY); if (!handle) fprintf (stderr, "Error opening nouveau_dri.so\n"); real_screen_create = dlsym (handle, "nouveau_drm_screen_create"); if (!real_screen_create) fprintf (stderr, "Error grabbing real screen create\n"); } return real_screen_create (fd); }