glamor_egl: move glamor_egl_cleanup() further up
We'll use the function within glamor_egl_close_screen() with next patch. Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
6a55716736
commit
1b5183b26d
|
|
@ -745,6 +745,24 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back)
|
||||||
glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM);
|
glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl)
|
||||||
|
{
|
||||||
|
if (glamor_egl->display != EGL_NO_DISPLAY) {
|
||||||
|
eglMakeCurrent(glamor_egl->display,
|
||||||
|
EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||||
|
/*
|
||||||
|
* Force the next glamor_make_current call to update the context
|
||||||
|
* (on hot unplug another GPU may still be using glamor)
|
||||||
|
*/
|
||||||
|
lastGLContext = NULL;
|
||||||
|
eglTerminate(glamor_egl->display);
|
||||||
|
}
|
||||||
|
if (glamor_egl->gbm)
|
||||||
|
gbm_device_destroy(glamor_egl->gbm);
|
||||||
|
free(glamor_egl->device_path);
|
||||||
|
free(glamor_egl);
|
||||||
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
glamor_egl_close_screen(ScreenPtr screen)
|
glamor_egl_close_screen(ScreenPtr screen)
|
||||||
{
|
{
|
||||||
|
|
@ -875,24 +893,6 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl)
|
|
||||||
{
|
|
||||||
if (glamor_egl->display != EGL_NO_DISPLAY) {
|
|
||||||
eglMakeCurrent(glamor_egl->display,
|
|
||||||
EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
|
||||||
/*
|
|
||||||
* Force the next glamor_make_current call to update the context
|
|
||||||
* (on hot unplug another GPU may still be using glamor)
|
|
||||||
*/
|
|
||||||
lastGLContext = NULL;
|
|
||||||
eglTerminate(glamor_egl->display);
|
|
||||||
}
|
|
||||||
if (glamor_egl->gbm)
|
|
||||||
gbm_device_destroy(glamor_egl->gbm);
|
|
||||||
free(glamor_egl->device_path);
|
|
||||||
free(glamor_egl);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
glamor_egl_free_screen(ScrnInfoPtr scrn)
|
glamor_egl_free_screen(ScrnInfoPtr scrn)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue