glx/dri2: Require the driver to support v4 of __DRI_DRI2
Mesa has supported this unconditionally since 10.1. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12456>
This commit is contained in:
+16
-40
@@ -200,11 +200,6 @@ dri2_create_context_attribs(struct glx_screen *base,
|
|||||||
uint32_t ctx_attribs[2 * 6];
|
uint32_t ctx_attribs[2 * 6];
|
||||||
unsigned num_ctx_attribs = 0;
|
unsigned num_ctx_attribs = 0;
|
||||||
|
|
||||||
if (psc->dri2->base.version < 3) {
|
|
||||||
*error = __DRI_CTX_ERROR_NO_MEMORY;
|
|
||||||
goto error_exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Remap the GLX tokens to DRI2 tokens.
|
/* Remap the GLX tokens to DRI2 tokens.
|
||||||
*/
|
*/
|
||||||
if (!dri2_convert_glx_attribs(num_attribs, attribs,
|
if (!dri2_convert_glx_attribs(num_attribs, attribs,
|
||||||
@@ -1047,6 +1042,7 @@ dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv,
|
|||||||
{
|
{
|
||||||
const struct dri2_display *const pdp = (struct dri2_display *)
|
const struct dri2_display *const pdp = (struct dri2_display *)
|
||||||
priv->dri2Display;
|
priv->dri2Display;
|
||||||
|
const unsigned mask = psc->dri2->getAPIMask(psc->driScreen);
|
||||||
const __DRIextension **extensions;
|
const __DRIextension **extensions;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -1074,21 +1070,17 @@ dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv,
|
|||||||
__glXEnableDirectExtension(&psc->base, "GLX_INTEL_swap_event");
|
__glXEnableDirectExtension(&psc->base, "GLX_INTEL_swap_event");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (psc->dri2->base.version >= 3) {
|
__glXEnableDirectExtension(&psc->base, "GLX_ARB_create_context");
|
||||||
const unsigned mask = psc->dri2->getAPIMask(psc->driScreen);
|
__glXEnableDirectExtension(&psc->base, "GLX_ARB_create_context_profile");
|
||||||
|
__glXEnableDirectExtension(&psc->base, "GLX_EXT_no_config_context");
|
||||||
|
|
||||||
__glXEnableDirectExtension(&psc->base, "GLX_ARB_create_context");
|
if ((mask & ((1 << __DRI_API_GLES) |
|
||||||
__glXEnableDirectExtension(&psc->base, "GLX_ARB_create_context_profile");
|
(1 << __DRI_API_GLES2) |
|
||||||
__glXEnableDirectExtension(&psc->base, "GLX_EXT_no_config_context");
|
(1 << __DRI_API_GLES3))) != 0) {
|
||||||
|
__glXEnableDirectExtension(&psc->base,
|
||||||
if ((mask & ((1 << __DRI_API_GLES) |
|
"GLX_EXT_create_context_es_profile");
|
||||||
(1 << __DRI_API_GLES2) |
|
__glXEnableDirectExtension(&psc->base,
|
||||||
(1 << __DRI_API_GLES3))) != 0) {
|
"GLX_EXT_create_context_es2_profile");
|
||||||
__glXEnableDirectExtension(&psc->base,
|
|
||||||
"GLX_EXT_create_context_es_profile");
|
|
||||||
__glXEnableDirectExtension(&psc->base,
|
|
||||||
"GLX_EXT_create_context_es2_profile");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; extensions[i]; i++) {
|
for (i = 0; extensions[i]; i++) {
|
||||||
@@ -1108,27 +1100,15 @@ dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv,
|
|||||||
if (((strcmp(extensions[i]->name, __DRI2_THROTTLE) == 0)))
|
if (((strcmp(extensions[i]->name, __DRI2_THROTTLE) == 0)))
|
||||||
psc->throttle = (__DRI2throttleExtension *) extensions[i];
|
psc->throttle = (__DRI2throttleExtension *) extensions[i];
|
||||||
|
|
||||||
/* DRI2 version 3 is also required because
|
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0)
|
||||||
* GLX_ARB_create_context_robustness requires GLX_ARB_create_context.
|
|
||||||
*/
|
|
||||||
if (psc->dri2->base.version >= 3
|
|
||||||
&& strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0)
|
|
||||||
__glXEnableDirectExtension(&psc->base,
|
__glXEnableDirectExtension(&psc->base,
|
||||||
"GLX_ARB_create_context_robustness");
|
"GLX_ARB_create_context_robustness");
|
||||||
|
|
||||||
/* DRI2 version 3 is also required because
|
if (strcmp(extensions[i]->name, __DRI2_NO_ERROR) == 0)
|
||||||
* GLX_ARB_create_context_no_error requires GLX_ARB_create_context.
|
|
||||||
*/
|
|
||||||
if (psc->dri2->base.version >= 3
|
|
||||||
&& strcmp(extensions[i]->name, __DRI2_NO_ERROR) == 0)
|
|
||||||
__glXEnableDirectExtension(&psc->base,
|
__glXEnableDirectExtension(&psc->base,
|
||||||
"GLX_ARB_create_context_no_error");
|
"GLX_ARB_create_context_no_error");
|
||||||
|
|
||||||
/* DRI2 version 3 is also required because GLX_MESA_query_renderer
|
if (strcmp(extensions[i]->name, __DRI2_RENDERER_QUERY) == 0) {
|
||||||
* requires GLX_ARB_create_context_profile.
|
|
||||||
*/
|
|
||||||
if (psc->dri2->base.version >= 3
|
|
||||||
&& strcmp(extensions[i]->name, __DRI2_RENDERER_QUERY) == 0) {
|
|
||||||
psc->rendererQuery = (__DRI2rendererQueryExtension *) extensions[i];
|
psc->rendererQuery = (__DRI2rendererQueryExtension *) extensions[i];
|
||||||
__glXEnableDirectExtension(&psc->base, "GLX_MESA_query_renderer");
|
__glXEnableDirectExtension(&psc->base, "GLX_MESA_query_renderer");
|
||||||
}
|
}
|
||||||
@@ -1136,11 +1116,7 @@ dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv,
|
|||||||
if (strcmp(extensions[i]->name, __DRI2_INTEROP) == 0)
|
if (strcmp(extensions[i]->name, __DRI2_INTEROP) == 0)
|
||||||
psc->interop = (__DRI2interopExtension*)extensions[i];
|
psc->interop = (__DRI2interopExtension*)extensions[i];
|
||||||
|
|
||||||
/* DRI2 version 3 is also required because
|
if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0)
|
||||||
* GLX_ARB_control_flush_control requires GLX_ARB_create_context.
|
|
||||||
*/
|
|
||||||
if (psc->dri2->base.version >= 3
|
|
||||||
&& strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0)
|
|
||||||
__glXEnableDirectExtension(&psc->base,
|
__glXEnableDirectExtension(&psc->base,
|
||||||
"GLX_ARB_context_flush_control");
|
"GLX_ARB_context_flush_control");
|
||||||
}
|
}
|
||||||
@@ -1232,7 +1208,7 @@ dri2CreateScreen(int screen, struct glx_display * priv)
|
|||||||
psc->dri2 = (__DRIdri2Extension *) extensions[i];
|
psc->dri2 = (__DRIdri2Extension *) extensions[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (psc->core == NULL || psc->dri2 == NULL) {
|
if (psc->core == NULL || psc->dri2 || psc->dri2->base.version < 3) {
|
||||||
ErrorMessageF("core dri or dri2 extension not found\n");
|
ErrorMessageF("core dri or dri2 extension not found\n");
|
||||||
goto handle_error;
|
goto handle_error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user