vrend: add vrend_winsys.[ch]

Move winsys-related includes and globals to the new files.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Chia-I Wu 4 years ago
parent bea941a521
commit baea5a2cf1
  1. 2
      src/meson.build
  2. 11
      src/virglrenderer.c
  3. 15
      src/vrend_renderer.c
  4. 13
      src/vrend_renderer.h
  5. 38
      src/vrend_winsys.c
  6. 56
      src/vrend_winsys.h

@ -52,6 +52,8 @@ vrend_sources = [
'vrend_strbuf.h',
'vrend_tweaks.c',
'vrend_tweaks.h',
'vrend_winsys.c',
'vrend_winsys.h',
]
virglrenderer_sources = [

@ -35,6 +35,7 @@
#include "util/u_format.h"
#include "util/u_math.h"
#include "vrend_renderer.h"
#include "vrend_winsys.h"
#include "virglrenderer.h"
#include "virglrenderer_hw.h"
@ -42,16 +43,6 @@
#include "virgl_context.h"
#include "virgl_resource.h"
#ifdef HAVE_EPOXY_EGL_H
#include "vrend_winsys_gbm.h"
#include "vrend_winsys_egl.h"
#endif
#ifdef HAVE_EPOXY_GLX_H
#include "vrend_winsys_glx.h"
static struct virgl_glx *glx_info;
#endif
/* new API - just wrap internal API for now */
static int virgl_renderer_resource_create_internal(struct virgl_renderer_resource_create_args *args,

@ -47,6 +47,7 @@
#include "vrend_renderer.h"
#include "vrend_debug.h"
#include "vrend_winsys.h"
#include "virgl_util.h"
@ -60,15 +61,6 @@
#include <sys/eventfd.h>
#endif
#ifdef HAVE_EPOXY_EGL_H
#include "vrend_winsys_gbm.h"
#include "vrend_winsys_egl.h"
extern struct virgl_gbm *gbm;
extern struct virgl_egl *egl;
#endif
int use_context = CONTEXT_NONE;
static const uint32_t fake_occlusion_query_samples_passed_default = 1024;
struct vrend_if_cbs *vrend_clicbs;
@ -10420,11 +10412,6 @@ void vrend_print_context_name(const struct vrend_context *ctx)
vrend_printf("HOST: ");
}
#ifdef HAVE_EPOXY_EGL_H
struct virgl_egl *egl = NULL;
struct virgl_gbm *gbm = NULL;
#endif
int virgl_has_gl_colorspace(void)
{
bool egl_colorspace = false;

@ -62,19 +62,6 @@ struct vrend_context;
#define VREND_STORAGE_GL_IMMUTABLE BIT(6)
#define VREND_STORAGE_GL_MEMOBJ BIT(7)
enum {
CONTEXT_NONE,
CONTEXT_EGL,
CONTEXT_GLX
};
extern int use_context;
#ifdef HAVE_EPOXY_EGL_H
extern struct virgl_egl *egl;
extern struct virgl_gbm *gbm;
#endif
struct vrend_resource {
struct pipe_resource base;
uint32_t storage_bits;

@ -0,0 +1,38 @@
/**************************************************************************
*
* Copyright (C) 2014 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#include "vrend_winsys.h"
#include <stddef.h>
int use_context = CONTEXT_NONE;
#ifdef HAVE_EPOXY_EGL_H
struct virgl_egl *egl = NULL;
struct virgl_gbm *gbm = NULL;
#endif
#ifdef HAVE_EPOXY_GLX_H
struct virgl_glx *glx_info = NULL;
#endif

@ -0,0 +1,56 @@
/**************************************************************************
*
* Copyright (C) 2014 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef VREND_WINSYS_H
#define VREND_WINSYS_H
#include "config.h"
#ifdef HAVE_EPOXY_EGL_H
#include "vrend_winsys_gbm.h"
#include "vrend_winsys_egl.h"
#endif
#ifdef HAVE_EPOXY_GLX_H
#include "vrend_winsys_glx.h"
#endif
enum {
CONTEXT_NONE,
CONTEXT_EGL,
CONTEXT_GLX
};
extern int use_context;
#ifdef HAVE_EPOXY_EGL_H
extern struct virgl_egl *egl;
extern struct virgl_gbm *gbm;
#endif
#ifdef HAVE_EPOXY_GLX_H
extern struct virgl_glx *glx_info;
#endif
#endif /* VREND_WINSYS_H */
Loading…
Cancel
Save