@samitouri / QOSamiQemu / commits / 633c529416

ui/console: Remove DisplaySurface::mem_obj

Only spice uses it so move it to spice. Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20260303-gl-v1-2-d90f0a237a52@rsg.ci.i.u-tokyo.ac.jp>

Akihiko Odaki committed Mar 3, 2026 at 22:08 UTC 633c52941686444917cf1e530df32b07b03ec0a7
4 files changed +9 -8
include/ui/spice-display.h
+1
@@ -121,6 +121,7 @@ struct SimpleSpiceDisplay {
121 QEMUBH *gl_unblock_bh;
122 QEMUTimer *gl_unblock_timer;
123 QemuGLShader *gls;
124 + GLuint gl_surface_mem_obj;
125 int gl_updates;
126 bool have_scanout;
127 bool have_surface;
include/ui/surface.h
-1
@@ -22,7 +22,6 @@ typedef struct DisplaySurface {
22 GLenum glformat;
23 GLenum gltype;
24 GLuint texture;
25 - GLuint mem_obj;
25 #endif
26 qemu_pixman_shareable share_handle;
27 uint32_t share_handle_offset;
ui/console-gl.c
-6
@@ -185,12 +185,6 @@ void surface_gl_destroy_texture(QemuGLShader *gls,
185 }
186 glDeleteTextures(1, &surface->texture);
187 surface->texture = 0;
188 -#ifdef GL_EXT_memory_object_fd
189 - if (surface->mem_obj) {
190 - glDeleteMemoryObjectsEXT(1, &surface->mem_obj);
191 - surface->mem_obj = 0;
192 - }
193 -#endif
188 }
189
190 void surface_gl_setup_viewport(QemuGLShader *gls,
ui/spice-display.c
+8 -1
@@ -950,7 +950,14 @@ static bool spice_gl_replace_fd_texture(SimpleSpiceDisplay *ssd,
950 } else {
951 surface_gl_destroy_texture(ssd->gls, ssd->ds);
952 ssd->ds->texture = texture;
953 - ssd->ds->mem_obj = mem_obj;
953 +
954 +#ifdef GL_EXT_memory_object_fd
955 + if (ssd->gl_surface_mem_obj) {
956 + glDeleteMemoryObjectsEXT(1, &ssd->gl_surface_mem_obj);
957 + }
958 +
959 + ssd->gl_surface_mem_obj = mem_obj;
960 +#endif
961 }
962 return ret;
963 }