[Spice-devel] [PATCH 08/18] server: remove OpenGL

Jonathon Jongsma jjongsma at redhat.com
Fri Nov 20 07:03:43 PST 2015


On Fri, 2015-11-20 at 09:02 -0600, Jonathon Jongsma wrote:
> Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
> 
> (just testing whether this format marks the patch as acked in patchwork) ;)

hey, it works!

> 
> On Fri, 2015-11-20 at 11:17 +0000, Frediano Ziglio wrote:
> > From: Marc-André Lureau <marcandre.lureau at gmail.com>
> > 
> > This is really not supported, requires X11, so better to remove it for
> > now. Some day it might be revived, using DRM, ..
> > 
> > Note for later, this could be removed too (not used by client):
> > - spice-common/common/ogl_ctx
> > ---
> >  server/Makefile.am       |  7 -----
> >  server/display-channel.h |  4 ---
> >  server/red_dispatcher.c  |  6 -----
> >  server/red_worker.c      | 69 ---------------------------------------------
> > --
> > -
> >  server/reds.c            |  4 ---
> >  server/reds.h            |  2 --
> >  server/reds_gl_canvas.c  | 26 ------------------
> >  server/reds_gl_canvas.h  | 25 ------------------
> >  8 files changed, 143 deletions(-)
> >  delete mode 100644 server/reds_gl_canvas.c
> >  delete mode 100644 server/reds_gl_canvas.h
> > 
> > diff --git a/server/Makefile.am b/server/Makefile.am
> > index 64d0e7d..db1cbc3 100644
> > --- a/server/Makefile.am
> > +++ b/server/Makefile.am
> > @@ -146,13 +146,6 @@ libspice_server_la_SOURCES =			\
> >  	dcc-encoders.h					\
> >  	$(NULL)
> >  
> > -if HAVE_GL
> > -libspice_server_la_SOURCES +=	\
> > -	reds_gl_canvas.c	\
> > -	reds_gl_canvas.h	\
> > -	$(NULL)
> > -endif
> > -
> >  if HAVE_SMARTCARD
> >  libspice_server_la_SOURCES +=	\
> >  	smartcard.c		\
> > diff --git a/server/display-channel.h b/server/display-channel.h
> > index 233c391..4a50912 100644
> > --- a/server/display-channel.h
> > +++ b/server/display-channel.h
> > @@ -25,10 +25,6 @@
> >  #include "reds_stream.h"
> >  #include "cache-item.h"
> >  #include "pixmap-cache.h"
> > -#ifdef USE_OPENGL
> > -#include "common/ogl_ctx.h"
> > -#include "reds_gl_canvas.h"
> > -#endif /* USE_OPENGL */
> >  #include "reds_sw_canvas.h"
> >  #include "stat.h"
> >  #include "reds.h"
> > diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
> > index 3845c5a..d84869a 100644
> > --- a/server/red_dispatcher.c
> > +++ b/server/red_dispatcher.c
> > @@ -33,9 +33,6 @@
> >  #include "spice.h"
> >  #include "red_worker.h"
> >  #include "reds_sw_canvas.h"
> > -#ifdef USE_OPENGL
> > -#include "reds_gl_canvas.h"
> > -#endif // USE_OPENGL
> >  #include "reds.h"
> >  #include "dispatcher.h"
> >  #include "red_parse_qxl.h"
> > @@ -1013,9 +1010,6 @@ void red_dispatcher_init(QXLInstance *qxl)
> >      if (g_once_init_enter(&initialized)) {
> >          quic_init();
> >          sw_canvas_init();
> > -#ifdef USE_OPENGL
> > -        gl_canvas_init();
> > -#endif // USE_OPENGL
> >          g_once_init_leave(&initialized, TRUE);
> >      }
> >  
> > diff --git a/server/red_worker.c b/server/red_worker.c
> > index ef27ebe..8c0758e 100644
> > --- a/server/red_worker.c
> > +++ b/server/red_worker.c
> > @@ -4161,63 +4161,6 @@ static void red_migrate_display(DisplayChannel
> > *display, RedChannelClient *rcc)
> >      }
> >  }
> >  
> > -#ifdef USE_OPENGL
> > -static SpiceCanvas *create_ogl_context_common(DisplayChannel *display,
> > OGLCtx
> > *ctx,
> > -                                              uint32_t width, uint32_t
> > height,
> > -                                              int32_t stride, uint8_t
> > depth)
> > -{
> > -    SpiceCanvas *canvas;
> > -
> > -    oglctx_make_current(ctx);
> > -    if (!(canvas = gl_canvas_create(width, height, depth, &display
> > ->image_cache.base,
> > -                                    &display->image_surfaces, NULL, NULL,
> > NULL))) {
> > -        return NULL;
> > -    }
> > -
> > -    spice_canvas_set_usr_data(canvas, ctx,
> > (spice_destroy_fn_t)oglctx_destroy);
> > -
> > -    canvas->ops->clear(canvas);
> > -
> > -    return canvas;
> > -}
> > -
> > -static SpiceCanvas *create_ogl_pbuf_context(DisplayChannel *display,
> > uint32_t
> > width,
> > -                                            uint32_t height, int32_t
> > stride,
> > uint8_t depth)
> > -{
> > -    OGLCtx *ctx;
> > -    SpiceCanvas *canvas;
> > -
> > -    if (!(ctx = pbuf_create(width, height))) {
> > -        return NULL;
> > -    }
> > -
> > -    if (!(canvas = create_ogl_context_common(display, ctx, width, height,
> > stride, depth))) {
> > -        oglctx_destroy(ctx);
> > -        return NULL;
> > -    }
> > -
> > -    return canvas;
> > -}
> > -
> > -static SpiceCanvas *create_ogl_pixmap_context(DisplayChannel *display,
> > uint32_t width,
> > -                                              uint32_t height, int32_t
> > stride, uint8_t depth)
> > -{
> > -    OGLCtx *ctx;
> > -    SpiceCanvas *canvas;
> > -
> > -    if (!(ctx = pixmap_create(width, height))) {
> > -        return NULL;
> > -    }
> > -
> > -    if (!(canvas = create_ogl_context_common(display, ctx, width, height,
> > stride, depth))) {
> > -        oglctx_destroy(ctx);
> > -        return NULL;
> > -    }
> > -
> > -    return canvas;
> > -}
> > -#endif
> > -
> >  static inline void *create_canvas_for_surface(DisplayChannel *display,
> > RedSurface *surface,
> >                                                uint32_t renderer, uint32_t
> > width, uint32_t height,
> >                                                int32_t stride, uint32_t
> > format, void *line_0)
> > @@ -4233,18 +4176,6 @@ static inline void
> > *create_canvas_for_surface(DisplayChannel *display, RedSurfac
> >          surface->context.top_down = TRUE;
> >          surface->context.canvas_draws_on_surface = TRUE;
> >          return canvas;
> > -#ifdef USE_OPENGL
> > -    case RED_RENDERER_OGL_PBUF:
> > -        canvas = create_ogl_pbuf_context(display, width, height, stride,
> > -                                         SPICE_SURFACE_FMT_DEPTH(format));
> > -        surface->context.top_down = FALSE;
> > -        return canvas;
> > -    case RED_RENDERER_OGL_PIXMAP:
> > -        canvas = create_ogl_pixmap_context(display, width, height, stride,
> > -                                          
> >  SPICE_SURFACE_FMT_DEPTH(format));
> > -        surface->context.top_down = FALSE;
> > -        return canvas;
> > -#endif
> >      default:
> >          spice_error("invalid renderer type");
> >      };
> > diff --git a/server/reds.c b/server/reds.c
> > index 9bd28df..8b3c3cb 100644
> > --- a/server/reds.c
> > +++ b/server/reds.c
> > @@ -3374,10 +3374,6 @@ typedef struct RendererInfo {
> >  
> >  static RendererInfo renderers_info[] = {
> >      {RED_RENDERER_SW, "sw"},
> > -#ifdef USE_OPENGL
> > -    {RED_RENDERER_OGL_PBUF, "oglpbuf"},
> > -    {RED_RENDERER_OGL_PIXMAP, "oglpixmap"},
> > -#endif
> >      {RED_RENDERER_INVALID, NULL},
> >  };
> >  
> > diff --git a/server/reds.h b/server/reds.h
> > index 7937d2d..fcdc5eb 100644
> > --- a/server/reds.h
> > +++ b/server/reds.h
> > @@ -62,8 +62,6 @@ void reds_handle_agent_mouse_event(const VDAgentMouseState
> > *mouse_state); // use
> >  enum {
> >      RED_RENDERER_INVALID,
> >      RED_RENDERER_SW,
> > -    RED_RENDERER_OGL_PBUF,
> > -    RED_RENDERER_OGL_PIXMAP,
> >  
> >      RED_RENDERER_LAST
> >  };
> > diff --git a/server/reds_gl_canvas.c b/server/reds_gl_canvas.c
> > deleted file mode 100644
> > index 66694e7..0000000
> > --- a/server/reds_gl_canvas.c
> > +++ /dev/null
> > @@ -1,26 +0,0 @@
> > -/*
> > -   Copyright (C) 2011 Red Hat, Inc.
> > -
> > -   This library is free software; you can redistribute it and/or
> > -   modify it under the terms of the GNU Lesser General Public
> > -   License as published by the Free Software Foundation; either
> > -   version 2.1 of the License, or (at your option) any later version.
> > -
> > -   This library is distributed in the hope that it will be useful,
> > -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > -   Lesser General Public License for more details.
> > -
> > -   You should have received a copy of the GNU Lesser General Public
> > -   License along with this library; if not, see <
> > http://www.gnu.org/licenses/
> > > .
> > -*/
> > -#ifdef HAVE_CONFIG_H
> > -#include <config.h>
> > -#endif
> > -
> > -#include "common/spice_common.h"
> > -
> > -#include "reds_gl_canvas.h"
> > -#define SW_CANVAS_IMAGE_CACHE
> > -#include "common/gl_canvas.c"
> > -#undef SW_CANVAS_IMAGE_CACHE
> > diff --git a/server/reds_gl_canvas.h b/server/reds_gl_canvas.h
> > deleted file mode 100644
> > index 5d49659..0000000
> > --- a/server/reds_gl_canvas.h
> > +++ /dev/null
> > @@ -1,25 +0,0 @@
> > -/*
> > -   Copyright (C) 2011 Red Hat, Inc.
> > -
> > -   This library is free software; you can redistribute it and/or
> > -   modify it under the terms of the GNU Lesser General Public
> > -   License as published by the Free Software Foundation; either
> > -   version 2.1 of the License, or (at your option) any later version.
> > -
> > -   This library is distributed in the hope that it will be useful,
> > -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > -   Lesser General Public License for more details.
> > -
> > -   You should have received a copy of the GNU Lesser General Public
> > -   License along with this library; if not, see <
> > http://www.gnu.org/licenses/
> > > .
> > -*/
> > -
> > -#ifndef _H_REDS_GL_CANVAS
> > -#define _H_REDS_GL_CANVAS
> > -
> > -#define SW_CANVAS_IMAGE_CACHE
> > -#include "common/gl_canvas.h"
> > -#undef SW_CANVAS_IMAGE_CACHE
> > -
> > -#endif
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list