Fix some build failures. Move intelScreenContext to intel_context.c
authorKeith Whitwell <keith@tungstengraphics.com>
Sat, 11 Aug 2007 13:01:37 +0000 (14:01 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Sat, 11 Aug 2007 13:01:37 +0000 (14:01 +0100)
src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c
src/mesa/drivers/dri/intel_winsys/intel_context.c
src/mesa/drivers/dri/intel_winsys/intel_context.h
src/mesa/drivers/dri/intel_winsys/intel_lock.c
src/mesa/drivers/dri/intel_winsys/intel_screen.c

index 4d0759fc329f8afd0fde3a778e0a662a88953345..6fe9ecc5399e3368cfc5b82e967956bec047272c 100644 (file)
  * 
  **************************************************************************/
 
+#include <errno.h>
+#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"
 
index af5deb4dc6e6845917bf5661c81d0edc1dd05201..435d17421cf1d39b289db1bde68b41a20267254f 100644 (file)
 
 #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);
+}
+
index 924b7ca05a885f4b0937e9174e6d945147d58d79..76c900157ac9c00985448ee7b643b2b5f1dcf410 100644 (file)
@@ -109,7 +109,7 @@ extern char *__progname;
 /* ================================================================
  * Debugging:
  */
-#if DEBUG
+#ifdef DEBUG
 extern int __intel_debug;
 
 #define DEBUG_SWAP     0x1
index 34319545d907ed7c79734669f1e5cb73ad89880c..e9e4bc0645506f56c9adc70adab95bbe51f218f2 100644 (file)
 #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"
index 90a432a0413beaa93e8ff22502d1bcc486e7a62d..cf8d190d344801807e3b675b523c0fec8dca890c 100644 (file)
@@ -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);
-
-}
-