eglglessink: Close the dispman display on RPi after usage
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 13 Feb 2013 14:20:39 +0000 (15:20 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 13 Feb 2013 14:22:37 +0000 (15:22 +0100)
ext/eglgles/video_platform_wrapper.c

index 1a95cf35514a67ca00fb320b7e40c474321a0304..d9e799fe4fb439c1ba8dc83ae6ed9cc544708f84 100644 (file)
@@ -673,6 +673,7 @@ platform_free_eglimage (EGLDisplay display, EGLContext context, GLuint tex_id,
 typedef struct
 {
   EGL_DISPMANX_WINDOW_T w;
+  DISPMANX_DISPLAY_HANDLE_T d;
 } RPIWindowData;
 
 EGLNativeWindowType
@@ -715,6 +716,7 @@ platform_create_native_window (gint width, gint height, gpointer * window_data)
       DISPMANX_PROTECTION_NONE, 0, 0, 0);
 
   *window_data = data = g_slice_new0 (RPIWindowData);
+  data->d = dispman_display;
   data->w.element = dispman_element;
   data->w.width = width;
   data->w.height = height;
@@ -731,10 +733,11 @@ platform_destroy_native_window (EGLNativeDisplayType display,
   DISPMANX_UPDATE_HANDLE_T dispman_update;
   RPIWindowData *data = *window_data;
 
-  dispman_display = vc_dispmanx_display_open (0);
+  dispman_display = data->d;
   dispman_update = vc_dispmanx_update_start (0);
   vc_dispmanx_element_remove (dispman_update, data->w.element);
   vc_dispmanx_update_submit_sync (dispman_update);
+  vc_dispmanx_display_close (dispman_display);
 
   g_slice_free (RPIWindowData, data);
   *window_data = NULL;