mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
Revert "egl: Configs w/o double buffering support have no EGL_WINDOW_BIT."
This reverts commit 075a96aa92.
This commit is contained in:
parent
9a7a92c1ec
commit
4ef2c53755
10 changed files with 7 additions and 78 deletions
|
|
@ -425,6 +425,10 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
|||
base.BindToTextureRGBA = bind_to_texture_rgba;
|
||||
}
|
||||
|
||||
if (double_buffer) {
|
||||
surface_type &= ~EGL_PIXMAP_BIT;
|
||||
}
|
||||
|
||||
/* No support for pbuffer + MSAA for now.
|
||||
*
|
||||
* XXX TODO: pbuffer + MSAA does not work and causes crashes.
|
||||
|
|
@ -434,6 +438,9 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
|||
surface_type &= ~EGL_PBUFFER_BIT;
|
||||
}
|
||||
|
||||
if (!surface_type)
|
||||
return NULL;
|
||||
|
||||
base.RenderableType = disp->ClientAPIs;
|
||||
base.Conformant = disp->ClientAPIs;
|
||||
|
||||
|
|
@ -483,56 +490,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
|||
return conf;
|
||||
}
|
||||
|
||||
/*
|
||||
* We finalize the set of `SurfaceType`s supported by a config, and only
|
||||
* reinsert it if it actually supports something.
|
||||
*/
|
||||
void
|
||||
dri2_finalize_config_surface_types(_EGLDisplay *disp)
|
||||
{
|
||||
_EGLArray *configs = _eglWipeConfigs(disp);
|
||||
|
||||
for (int i = 0; i < configs->Size; ++i)
|
||||
{
|
||||
// Since `base` is the first member of `dri2_egl_config`, `base`'s ptr
|
||||
// should equal `dri2_egl_config`'s. This is why this cast is safe.
|
||||
struct dri2_egl_config *conf
|
||||
= (struct dri2_egl_config *) configs->Elements[i];
|
||||
|
||||
const bool double_buffer = conf->dri_config[true][false]
|
||||
|| conf->dri_config[true][true];
|
||||
|
||||
const bool single_buffer = conf->dri_config[false][false]
|
||||
|| conf->dri_config[false][true];
|
||||
|
||||
/* No support for pixmaps without single buffered dri configs.
|
||||
*
|
||||
* When users pass a config to `eglCreateWindowSurface` it requests
|
||||
* double buffering, but if the config doesn't have the appropriate
|
||||
* `__DRIconfig`, `eglCreateWindowSurface` fails with a `EGL_BAD_MATCH`.
|
||||
*
|
||||
* Given that such behaviour is completely unacceptable, we drop the
|
||||
* `EGL_WINDOW_BIT` if we don't have at least one `__DRIconfig`
|
||||
* supporting double buffering.
|
||||
*/
|
||||
if (!single_buffer) {
|
||||
conf->base.SurfaceType &= ~EGL_PIXMAP_BIT;
|
||||
}
|
||||
|
||||
if (!double_buffer) {
|
||||
conf->base.SurfaceType &= ~EGL_WINDOW_BIT;
|
||||
}
|
||||
|
||||
// Dont reinsert configs without some supported surface type.
|
||||
if (!conf->base.SurfaceType) {
|
||||
free(conf);
|
||||
continue;
|
||||
}
|
||||
|
||||
_eglLinkConfig(&conf->base);
|
||||
}
|
||||
}
|
||||
|
||||
__DRIimage *
|
||||
dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -419,9 +419,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
|
|||
EGLint surface_type, const EGLint *attr_list,
|
||||
const int *rgba_shifts, const unsigned int *rgba_sizes);
|
||||
|
||||
void
|
||||
dri2_finalize_config_surface_types(_EGLDisplay *disp);
|
||||
|
||||
_EGLImage *
|
||||
dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx, EGLenum target,
|
||||
|
|
|
|||
|
|
@ -1225,8 +1225,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
has_rgba = true;
|
||||
}
|
||||
|
||||
dri2_finalize_config_surface_types(disp);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(format_count); i++) {
|
||||
if (!format_count[i]) {
|
||||
_eglLog(_EGL_DEBUG, "No DRI config supports native format 0x%x",
|
||||
|
|
|
|||
|
|
@ -216,8 +216,6 @@ device_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
}
|
||||
}
|
||||
|
||||
dri2_finalize_config_surface_types(disp);
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(format_count); i++) {
|
||||
if (!format_count[i]) {
|
||||
_eglLog(_EGL_DEBUG, "No DRI config supports native format %s",
|
||||
|
|
|
|||
|
|
@ -658,8 +658,6 @@ drm_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
}
|
||||
}
|
||||
|
||||
dri2_finalize_config_surface_types(disp);
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(format_count); i++) {
|
||||
if (!format_count[i]) {
|
||||
struct gbm_format_name_desc desc;
|
||||
|
|
|
|||
|
|
@ -212,8 +212,6 @@ surfaceless_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
}
|
||||
}
|
||||
|
||||
dri2_finalize_config_surface_types(disp);
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(format_count); i++) {
|
||||
if (!format_count[i]) {
|
||||
_eglLog(_EGL_DEBUG, "No DRI config supports native format %s",
|
||||
|
|
|
|||
|
|
@ -1445,8 +1445,6 @@ dri2_wl_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
}
|
||||
}
|
||||
|
||||
dri2_finalize_config_surface_types(disp);
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(format_count); i++) {
|
||||
if (!format_count[i]) {
|
||||
_eglLog(_EGL_DEBUG, "No DRI config supports native format %s",
|
||||
|
|
|
|||
|
|
@ -848,8 +848,6 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
|
|||
xcb_depth_next(&d);
|
||||
}
|
||||
|
||||
dri2_finalize_config_surface_types(disp);
|
||||
|
||||
if (!config_count) {
|
||||
_eglLog(_EGL_WARNING, "DRI2: failed to create any config");
|
||||
return EGL_FALSE;
|
||||
|
|
|
|||
|
|
@ -71,16 +71,6 @@ _eglInitConfig(_EGLConfig *conf, _EGLDisplay *disp, EGLint id)
|
|||
conf->ComponentType = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
|
||||
}
|
||||
|
||||
/*
|
||||
* Wipe the configs list and return the old list
|
||||
*/
|
||||
_EGLArray *
|
||||
_eglWipeConfigs(_EGLDisplay *disp)
|
||||
{
|
||||
_EGLArray *configs = disp->Configs;
|
||||
disp->Configs = NULL;
|
||||
return configs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link a config to its display and return the handle of the link.
|
||||
|
|
|
|||
|
|
@ -179,9 +179,6 @@ _eglGetConfigKey(const _EGLConfig *conf, EGLint key)
|
|||
extern void
|
||||
_eglInitConfig(_EGLConfig *config, _EGLDisplay *disp, EGLint id);
|
||||
|
||||
extern _EGLArray *
|
||||
_eglWipeConfigs(_EGLDisplay *disp);
|
||||
|
||||
|
||||
extern EGLConfig
|
||||
_eglLinkConfig(_EGLConfig *conf);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue