diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 590461f5259..01da2412094 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -732,6 +732,7 @@ dri2_setup_screen(_EGLDisplay *disp) #ifdef HAVE_ANDROID_PLATFORM dri2_dpy->has_native_fence_fd = get_screen_param(disp, PIPE_CAP_NATIVE_FENCE_FD); #endif + dri2_dpy->has_compression_modifiers = pscreen->query_compression_rates && pscreen->query_compression_modifiers; /* * EGL 1.5 specification defines the default value to 1. Moreover, @@ -3536,8 +3537,7 @@ dri2_query_supported_compression_rates(_EGLDisplay *disp, _EGLConfig *config, struct dri2_egl_config *conf = dri2_egl_config(config); enum __DRIFixedRateCompression dri_rates[rate_size]; - if (dri2_dpy->image->base.version >= 22 && - dri2_dpy->image->queryCompressionRates) { + if (dri2_dpy->has_compression_modifiers) { const __DRIconfig *dri_conf = dri2_get_dri_config(conf, EGL_WINDOW_BIT, EGL_GL_COLORSPACE_LINEAR); if (!dri2_query_compression_rates( diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index b08558e7e5e..628c329eaab 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -266,6 +266,7 @@ struct dri2_egl_display { * dri2_make_current (tracks if there are active contexts/surfaces). */ int ref_count; + bool has_compression_modifiers; bool own_device; bool invalidate_available; bool kopper; diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index ac84b3fdb14..93b3abee6db 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -952,7 +952,7 @@ get_surface_specific_modifiers(struct dri2_egl_surface *dri2_surf, !dri2_surf->wl_win) return NULL; - if (!dri2_dpy->image->queryCompressionModifiers( + if (!dri2_query_compression_modifiers( dri2_dpy->dri_screen_render_gpu, dri2_surf->format, rate, 0, NULL, modifiers_count)) return NULL; @@ -961,7 +961,7 @@ get_surface_specific_modifiers(struct dri2_egl_surface *dri2_surf, if (!modifiers) return NULL; - if (!dri2_dpy->image->queryCompressionModifiers( + if (!dri2_query_compression_modifiers( dri2_dpy->dri_screen_render_gpu, dri2_surf->format, rate, *modifiers_count, modifiers, modifiers_count)) { free(modifiers);