From: Keith Whitwell Date: Sat, 11 Aug 2007 13:01:37 +0000 (+0100) Subject: Fix some build failures. Move intelScreenContext to intel_context.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c4409690d30b5fc5c048b90351c14522119fa9c;p=mesa.git Fix some build failures. Move intelScreenContext to intel_context.c --- diff --git a/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c b/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c index 4d0759fc329..6fe9ecc5399 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c @@ -25,8 +25,11 @@ * **************************************************************************/ +#include +#include "main/imports.c" #include "intel_batchbuffer.h" -#include "intel_ioctl.h" +#include "intel_context.h" +#include "intel_screen.h" #include "intel_reg.h" #include "drm.h" diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c index af5deb4dc6e..435d17421cf 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c @@ -36,29 +36,28 @@ #include "drivers/common/driverfuncs.h" -#include "intel_screen.h" - #include "i830_dri.h" +#include "intel_screen.h" +#include "intel_context.h" #include "intel_buffers.h" #include "intel_winsys.h" -#include "intel_ioctl.h" #include "intel_batchbuffer.h" #include "state_tracker/st_public.h" #include "state_tracker/st_context.h" #include "pipe/p_defines.h" +#include "pipe/p_context.h" #include "drirenderbuffer.h" #include "vblank.h" #include "utils.h" #include "xmlpool.h" /* for symbolic values of enum-type options */ -#include "pipe/p_context.h" -#if DEBUG +#ifdef DEBUG int __intel_debug = 0; #endif @@ -145,7 +144,7 @@ const struct dri_extension card_extensions[] = { - +#ifdef DEBUG static const struct dri_debug_control debug_control[] = { {"ioctl", DEBUG_IOCTL}, {"bat", DEBUG_BATCH}, @@ -153,7 +152,7 @@ static const struct dri_debug_control debug_control[] = { {"swap", DEBUG_SWAP}, {NULL, 0} }; - +#endif static void intelInvalidateState(GLcontext * ctx, GLuint new_state) @@ -279,7 +278,7 @@ intelCreateContext(const __GLcontextModes * mesaVis, _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); } -#if DEBUG +#ifdef DEBUG __intel_debug = driParseDebugString(getenv("INTEL_DEBUG"), debug_control); #endif @@ -442,3 +441,26 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, +struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen) +{ + /* + * This should probably change to have the screen allocate a dummy + * context at screen creation. For now just use the current context. + */ + + GET_CURRENT_CONTEXT(ctx); + if (ctx == NULL) { +/* _mesa_problem(NULL, "No current context in intelScreenContext\n"); + return NULL; */ + /* need a context for the first time makecurrent is called (for hw lock + when allocating priv buffers) */ + if (intelScreen->dummyctxptr == NULL) { + _mesa_problem(NULL, "No current context in intelScreenContext\n"); + return NULL; + } + return intelScreen->dummyctxptr; + } + + return intel_context(ctx); +} + diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.h b/src/mesa/drivers/dri/intel_winsys/intel_context.h index 924b7ca05a8..76c900157ac 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.h +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.h @@ -109,7 +109,7 @@ extern char *__progname; /* ================================================================ * Debugging: */ -#if DEBUG +#ifdef DEBUG extern int __intel_debug; #define DEBUG_SWAP 0x1 diff --git a/src/mesa/drivers/dri/intel_winsys/intel_lock.c b/src/mesa/drivers/dri/intel_winsys/intel_lock.c index 34319545d90..e9e4bc06455 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_lock.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_lock.c @@ -31,11 +31,12 @@ #include "extensions.h" #include "intel_screen.h" +#include "intel_context.h" +#include "intel_batchbuffer.h" +#include "intel_buffers.h" #include "i830_dri.h" -#include "intel_ioctl.h" -#include "intel_batchbuffer.h" #include "state_tracker/st_public.h" #include "state_tracker/st_context.h" diff --git a/src/mesa/drivers/dri/intel_winsys/intel_screen.c b/src/mesa/drivers/dri/intel_winsys/intel_screen.c index 90a432a0413..cf8d190d344 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_screen.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_screen.c @@ -38,7 +38,6 @@ #include "intel_screen.h" #include "intel_batchbuffer.h" #include "intel_buffers.h" -#include "intel_ioctl.h" #include "i830_dri.h" #include "dri_bufpool.h" @@ -565,26 +564,3 @@ __driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn, return (void *) psp; } -struct intel_context *intelScreenContext(intelScreenPrivate *intelScreen) -{ - /* - * This should probably change to have the screen allocate a dummy - * context at screen creation. For now just use the current context. - */ - - GET_CURRENT_CONTEXT(ctx); - if (ctx == NULL) { -/* _mesa_problem(NULL, "No current context in intelScreenContext\n"); - return NULL; */ - /* need a context for the first time makecurrent is called (for hw lock - when allocating priv buffers) */ - if (intelScreen->dummyctxptr == NULL) { - _mesa_problem(NULL, "No current context in intelScreenContext\n"); - return NULL; - } - return intelScreen->dummyctxptr; - } - return intel_context(ctx); - -} -