mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 01:18:06 +02:00
egl: inline DRI_IMAGE compression modifier handling
Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472>
This commit is contained in:
parent
60d81e2865
commit
fc510ca674
3 changed files with 5 additions and 4 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue