From 877465a702adae8b320b7c6ea8c3c0f2795eb2d0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 10 Mar 2024 22:51:41 +0100 Subject: Use dri card matching current egl context --- include/egl.h | 7 +++++++ include/utils.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/egl.h b/include/egl.h index a0a44d0..1e9e0aa 100644 --- a/include/egl.h +++ b/include/egl.h @@ -68,6 +68,8 @@ typedef void(*__GLXextFuncPtr)(void); #define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 #define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 #define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 +#define EGL_DEVICE_EXT 0x322C +#define EGL_DRM_DEVICE_FILE_EXT 0x3233 #define GL_FLOAT 0x1406 #define GL_FALSE 0 @@ -127,6 +129,8 @@ typedef void (*FUNC_glXSwapIntervalEXT)(Display * dpy, GLXDrawable drawable, int typedef int (*FUNC_glXSwapIntervalMESA)(unsigned int interval); typedef int (*FUNC_glXSwapIntervalSGI)(int interval); typedef void (*GLDEBUGPROC)(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, int length, const char *message, const void *userParam); +typedef int (*FUNC_eglQueryDisplayAttribEXT)(EGLDisplay dpy, int32_t attribute, intptr_t *value); +typedef const char* (*FUNC_eglQueryDeviceStringEXT)(void *device, int32_t name); #define GSR_MAX_OUTPUTS 32 @@ -170,6 +174,7 @@ struct gsr_egl { EGLDisplay egl_display; EGLSurface egl_surface; EGLContext egl_context; + const char *dri_card_path; void *glx_context; void *glx_fb_config; @@ -200,6 +205,8 @@ struct gsr_egl { FUNC_eglExportDMABUFImageQueryMESA eglExportDMABUFImageQueryMESA; FUNC_eglExportDMABUFImageMESA eglExportDMABUFImageMESA; FUNC_glEGLImageTargetTexture2DOES glEGLImageTargetTexture2DOES; + FUNC_eglQueryDisplayAttribEXT eglQueryDisplayAttribEXT; + FUNC_eglQueryDeviceStringEXT eglQueryDeviceStringEXT; __GLXextFuncPtr (*glXGetProcAddress)(const unsigned char *procName); GLXFBConfig* (*glXChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems); diff --git a/include/utils.h b/include/utils.h index cb3bd6b..74fdd59 100644 --- a/include/utils.h +++ b/include/utils.h @@ -37,7 +37,7 @@ gsr_monitor_rotation drm_monitor_get_display_server_rotation(const gsr_egl *egl, bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info); /* |output| should be at least 128 bytes in size */ -bool gsr_get_valid_card_path(char *output); +bool gsr_get_valid_card_path(gsr_egl *egl, char *output); /* |render_path| should be at least 128 bytes in size */ bool gsr_card_path_get_render_path(const char *card_path, char *render_path); -- cgit v1.2.3