X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fdri_common.c;h=854733a5bea578f7bb2bd1633e06ec8d3faff310;hb=0e1e5a2b14cb602030928431bec45af394be43e3;hp=012c8f4ec3209be9de1790c3bbf8ffd52bf2b122;hpb=f658150639c36eda351590e757247c56507f494f;p=mesa.git diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index 012c8f4ec32..854733a5bea 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -73,6 +73,10 @@ dri_message(int level, const char *f, ...) } } +#ifndef GL_LIB_NAME +#define GL_LIB_NAME "libGL.so.1" +#endif + #ifndef DEFAULT_DRIVER_DIR /* this is normally defined in Mesa/configs/default with DRI_DRIVER_SEARCH_PATH */ #define DEFAULT_DRIVER_DIR "/usr/local/lib/dri" @@ -99,7 +103,7 @@ driOpenDriver(const char *driverName) int len; /* Attempt to make sure libGL symbols will be visible to the driver */ - glhandle = dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL); + glhandle = dlopen(GL_LIB_NAME, RTLD_NOW | RTLD_GLOBAL); libPaths = NULL; if (geteuid() == getuid()) { @@ -140,7 +144,7 @@ driOpenDriver(const char *driverName) if (handle != NULL) break; else - ErrorMessageF("dlopen %s failed (%s)\n", realDriverName, dlerror()); + InfoMessageF("dlopen %s failed (%s)\n", realDriverName, dlerror()); } if (!handle) @@ -157,10 +161,9 @@ driGetDriverExtensions(void *handle, const char *driver_name) { const __DRIextension **extensions = NULL; const __DRIextension **(*get_extensions)(void); - char *get_extensions_name; + char *get_extensions_name = loader_get_extensions_name(driver_name); - if (asprintf(&get_extensions_name, "%s_%s", - __DRI_DRIVER_GET_EXTENSIONS, driver_name) != -1) { + if (get_extensions_name) { get_extensions = dlsym(handle, get_extensions_name); if (get_extensions) { free(get_extensions_name); @@ -192,9 +195,10 @@ __driGetMSCRate(__DRIdrawable *draw, } _X_HIDDEN const __DRIsystemTimeExtension systemTimeExtension = { - {__DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION}, - __glXGetUST, - __driGetMSCRate + .base = {__DRI_SYSTEM_TIME, 1 }, + + .getUST = __glXGetUST, + .getMSCRate = __driGetMSCRate }; #define __ATTRIB(attrib, field) \ @@ -252,8 +256,7 @@ __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb), static int scalarEqual(struct glx_config *mode, unsigned int attrib, unsigned int value) { - unsigned int glxValue; - int i; + unsigned glxValue, i; for (i = 0; i < ARRAY_SIZE(attribMap); i++) if (attribMap[i].attrib == attrib) { @@ -543,9 +546,18 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs, case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB: *api = __DRI_API_OPENGL; break; - case GLX_CONTEXT_ES2_PROFILE_BIT_EXT: - *api = __DRI_API_GLES2; - break; + case GLX_CONTEXT_ES_PROFILE_BIT_EXT: + if (*major_ver >= 3) + *api = __DRI_API_GLES3; + else if (*major_ver == 2 && *minor_ver == 0) + *api = __DRI_API_GLES2; + else if (*major_ver == 1 && *minor_ver < 2) + *api = __DRI_API_GLES; + else { + *error = __DRI_CTX_ERROR_BAD_API; + return false; + } + break; default: *error = __DRI_CTX_ERROR_BAD_API; return false; @@ -576,19 +588,6 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs, return false; } - /* The GLX_EXT_create_context_es2_profile spec says: - * - * "... If the version requested is 2.0, and the - * GLX_CONTEXT_ES2_PROFILE_BIT_EXT bit is set in the - * GLX_CONTEXT_PROFILE_MASK_ARB attribute (see below), then the context - * returned will implement OpenGL ES 2.0. This is the only way in which - * an implementation may request an OpenGL ES 2.0 context." - */ - if (*api == __DRI_API_GLES2 && (*major_ver != 2 || *minor_ver != 0)) { - *error = __DRI_CTX_ERROR_BAD_API; - return false; - } - *error = __DRI_CTX_ERROR_SUCCESS; return true; }