From 6e35a1f166e677a55f465ec420d9d546e10f3fd7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg=20Kristensen?= Date: Thu, 3 Sep 2015 12:04:03 -0700 Subject: [PATCH] vk: Remove various hacks/scaffolding code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since we switched away from calling brwCreateContext() there's a bit of hacky support we can now delete. This reduces our diff to upstream master. Signed-off-by: Kristian Høgsberg Kristensen --- configure.ac | 4 -- src/mesa/drivers/dri/common/dri_test.c | 9 +-- src/mesa/drivers/dri/i965/brw_context.c | 4 -- src/mesa/drivers/dri/i965/brw_context.h | 6 -- src/mesa/drivers/dri/i965/brw_state_cache.c | 3 - src/mesa/drivers/dri/i965/intel_debug.c | 2 +- src/mesa/drivers/dri/i965/intel_screen.c | 72 --------------------- 7 files changed, 4 insertions(+), 96 deletions(-) diff --git a/configure.ac b/configure.ac index 5828885e92a..e8919caa74b 100644 --- a/configure.ac +++ b/configure.ac @@ -1162,10 +1162,6 @@ AC_ARG_ENABLE([driglx-direct], [driglx_direct="$enableval"], [driglx_direct="yes"]) -# Check for libcaca -PKG_CHECK_EXISTS([caca], [have_libcaca=yes], [have_libcaca=no]) -AM_CONDITIONAL([HAVE_LIBCACA], [test x$have_libcaca = xyes]) - dnl dnl libGL configuration per driver dnl diff --git a/src/mesa/drivers/dri/common/dri_test.c b/src/mesa/drivers/dri/common/dri_test.c index 310e7617e2f..57bfa5b9394 100644 --- a/src/mesa/drivers/dri/common/dri_test.c +++ b/src/mesa/drivers/dri/common/dri_test.c @@ -1,4 +1,3 @@ -#include #include "main/glheader.h" #include "main/compiler.h" #include "glapi/glapi.h" @@ -34,14 +33,12 @@ _glapi_check_multithread(void) PUBLIC void _glapi_set_context(void *context) -{ - _glapi_Context = context; -} +{} PUBLIC void * _glapi_get_context(void) { - return _glapi_Context; + return 0; } PUBLIC void @@ -87,7 +84,7 @@ _glapi_set_nop_handler(_glapi_nop_handler_proc func) PUBLIC struct _glapi_table * _glapi_new_nop_table(unsigned num_entries) { - return malloc(16); + return NULL; } #ifndef NO_MAIN diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 0ee5ab2bdee..020df05b2a8 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -815,7 +815,6 @@ brwCreateContext(gl_api api, intel_batchbuffer_init(brw); -#if 0 if (brw->gen >= 6) { /* Create a new hardware context. Using a hardware context means that * our GPU state will be saved/restored on context switch, allowing us @@ -840,7 +839,6 @@ brwCreateContext(gl_api api, } brw_init_state(brw); -#endif intelInitExtensions(ctx); @@ -908,10 +906,8 @@ brwCreateContext(gl_api api, _mesa_compute_version(ctx); -#if 0 _mesa_initialize_dispatch_tables(ctx); _mesa_initialize_vbo_vtxfmt(ctx); -#endif if (ctx->Extensions.AMD_performance_monitor) { brw_init_performance_monitors(brw); diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 1267a6f5a97..54813c51d50 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -2075,12 +2075,6 @@ gen6_upload_push_constants(struct brw_context *brw, struct brw_stage_state *stage_state, enum aub_state_struct_type type); -struct intel_screen *intel_screen_create(int fd); -void intel_screen_destroy(struct intel_screen *screen); - -struct brw_context *intel_context_create(struct intel_screen *screen); -void intel_context_destroy(struct brw_context *brw); - void brw_initialize_context_constants(struct brw_context *brw); diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index e817ecfb8cc..fbc041920f4 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -416,9 +416,6 @@ brw_destroy_cache(struct brw_context *brw, struct brw_cache *cache) DBG("%s\n", __func__); - if (cache->bo == NULL) - return; - if (brw->has_llc) drm_intel_bo_unmap(cache->bo); drm_intel_bo_unreference(cache->bo); diff --git a/src/mesa/drivers/dri/i965/intel_debug.c b/src/mesa/drivers/dri/i965/intel_debug.c index 6bd55d395b2..b3b3c21f491 100644 --- a/src/mesa/drivers/dri/i965/intel_debug.c +++ b/src/mesa/drivers/dri/i965/intel_debug.c @@ -60,7 +60,7 @@ static const struct dri_debug_control debug_control[] = { { "urb", DEBUG_URB }, { "vs", DEBUG_VS }, { "clip", DEBUG_CLIP }, - { "foob", DEBUG_AUB }, /* disable aub dumbing in the dri driver */ + { "aub", DEBUG_AUB }, { "shader_time", DEBUG_SHADER_TIME }, { "no16", DEBUG_NO16 }, { "blorp", DEBUG_BLORP }, diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 5911b444454..85863a0827e 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -1486,78 +1486,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) return (const __DRIconfig**) intel_screen_make_configs(psp); } -struct intel_screen * -intel_screen_create(int fd) -{ - __DRIscreen *psp; - __DRIconfig **configs; - int i; - - psp = malloc(sizeof(*psp)); - if (psp == NULL) - return NULL; - - psp->image.loader = (void *) 1; /* Don't complain about this being NULL */ - psp->fd = fd; - psp->dri2.useInvalidate = (void *) 1; - - configs = (__DRIconfig **) intelInitScreen2(psp); - for (i = 0; configs[i]; i++) - free(configs[i]); - free(configs); - - return psp->driverPrivate; -} - -void -intel_screen_destroy(struct intel_screen *screen) -{ - __DRIscreen *psp; - - psp = screen->driScrnPriv; - intelDestroyScreen(screen->driScrnPriv); - free(psp); -} - - -struct brw_context * -intel_context_create(struct intel_screen *screen) -{ - __DRIcontext *driContextPriv; - struct brw_context *brw; - unsigned error; - - driContextPriv = malloc(sizeof(*driContextPriv)); - if (driContextPriv == NULL) - return NULL; - - driContextPriv->driScreenPriv = screen->driScrnPriv; - - brwCreateContext(API_OPENGL_CORE, - NULL, /* visual */ - driContextPriv, - 3, 0, - 0, /* flags */ - false, /* notify_reset */ - &error, - NULL); - - brw = driContextPriv->driverPrivate; - brw->ctx.FirstTimeCurrent = false; - - return driContextPriv->driverPrivate; -} - -void -intel_context_destroy(struct brw_context *brw) -{ - __DRIcontext *driContextPriv; - - driContextPriv = brw->driContext; - intelDestroyContext(driContextPriv); - free(driContextPriv); -} - struct intel_buffer { __DRIbuffer base; drm_intel_bo *bo; -- 2.30.2