egl: Pull the API mask directly out of the dri_screen.

Now that we know the driver on the other side is the same version of Mesa
as our build, we can just access the screen instead of having accessor
functions.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20069>
This commit is contained in:
Emma Anholt 2022-11-29 12:15:12 -08:00 committed by Marge Bot
parent 133e2f8ac3
commit 7ab8dd13b9
2 changed files with 7 additions and 13 deletions

View file

@ -46,6 +46,7 @@
#include <GL/internal/dri_interface.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "dri_screen.h"
#ifdef HAVE_WAYLAND_PLATFORM
#include <wayland-client.h>
@ -839,7 +840,8 @@ void
dri2_setup_screen(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
unsigned int api_mask;
struct dri_screen *screen = dri_screen(dri2_dpy->dri_screen);
unsigned int api_mask = screen->api_mask;
/*
* EGL 1.5 specification defines the default value to 1. Moreover,
@ -853,18 +855,6 @@ dri2_setup_screen(_EGLDisplay *disp)
dri2_dpy->max_swap_interval = 1;
dri2_dpy->default_swap_interval = 1;
if (dri2_dpy->image_driver) {
api_mask = dri2_dpy->image_driver->getAPIMask(dri2_dpy->dri_screen);
} else if (dri2_dpy->dri2) {
api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
} else {
assert(dri2_dpy->swrast);
api_mask = 1 << __DRI_API_OPENGL |
1 << __DRI_API_GLES |
1 << __DRI_API_GLES2 |
1 << __DRI_API_GLES3;
}
disp->ClientAPIs = 0;
if ((api_mask & (1 <<__DRI_API_OPENGL)) && _eglIsApiValid(EGL_OPENGL_API))
disp->ClientAPIs |= EGL_OPENGL_BIT;

View file

@ -97,6 +97,10 @@ if with_dri2
deps_for_egl += idep_xmlconfig
link_for_egl += libloader
incs_for_egl += inc_loader
incs_for_egl += inc_gallium
incs_for_egl += inc_gallium_aux
incs_for_egl += inc_mesa
incs_for_egl += inc_st_dri
files_egl += files(
'drivers/dri2/platform_device.c',