mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 09:20:13 +01:00
egl: Fix leak of X11 pixmaps backing pbuffers in DRI3.
This is basically copied from the DRI2 destroy path. Without this,
Raspberry Pi would quickly run out of CMA during the EGL tests in the CTS
due to all the pixmaps laying around.
Fixes: f35198bade ("egl/x11: Implement dri3 support with loader's dri3 helper")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
parent
08a5c395ab
commit
b618d7ea59
1 changed files with 5 additions and 0 deletions
|
|
@ -107,12 +107,17 @@ static const struct loader_dri3_vtable egl_dri3_vtable = {
|
|||
static EGLBoolean
|
||||
dri3_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
struct dri3_egl_surface *dri3_surf = dri3_egl_surface(surf);
|
||||
xcb_drawable_t drawable = dri3_surf->loader_drawable.drawable;
|
||||
|
||||
(void) drv;
|
||||
|
||||
loader_dri3_drawable_fini(&dri3_surf->loader_drawable);
|
||||
|
||||
if (surf->Type == EGL_PBUFFER_BIT)
|
||||
xcb_free_pixmap (dri2_dpy->conn, drawable);
|
||||
|
||||
dri2_fini_surface(surf);
|
||||
free(surf);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue