summaryrefslogtreecommitdiff
path: root/src/egl/drivers/dri2/platform_x11.c
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2019-05-16 18:01:38 +0100
committerMarek Olšák <marek.olsak@amd.com>2019-06-05 13:35:21 -0400
commit2282ec0ad6581b588f7bdde1211357123316b4b9 (patch)
tree6a616d684144153b71d1ac762352a315d2fe1423 /src/egl/drivers/dri2/platform_x11.c
parent5e0f527d609c8300b0308e4400ec41ef20ed569c (diff)
egl/dri: flesh out and use dri2_create_drawable()
Wrap the loader->createNewDrawable() dance into a helper and use it throughout the codebase. This addresses a cases like surfaceless (SL) on swrast (SL on kms_swrast is fine) where we'd attempt using the wrong driver and crash out. v2: fixup quirky GBM (Mathias) v3: fixup GBM for real (Marek) Cc: mesa-stable@lists.freedesktop.org Cc: Mathias Fröhlich <Mathias.Froehlich@web.de> Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de> (v1) Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> (v2) Signed-off-by: Marek Olšák <marek.olsak@amd.com> (v2) Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_x11.c')
-rw-r--r--src/egl/drivers/dri2/platform_x11.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 538cffd6a76..be9eb513243 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -290,21 +290,8 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
goto cleanup_pixmap;
}
- if (dri2_dpy->dri2) {
- dri2_surf->dri_drawable =
- dri2_dpy->dri2->createNewDrawable(dri2_dpy->dri_screen, config,
- dri2_surf);
- } else {
- assert(dri2_dpy->swrast);
- dri2_surf->dri_drawable =
- dri2_dpy->swrast->createNewDrawable(dri2_dpy->dri_screen, config,
- dri2_surf);
- }
-
- if (dri2_surf->dri_drawable == NULL) {
- _eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
+ if (!dri2_create_drawable(dri2_dpy, config, dri2_surf))
goto cleanup_pixmap;
- }
if (type != EGL_PBUFFER_BIT) {
cookie = xcb_get_geometry (dri2_dpy->conn, dri2_surf->drawable);