OSDN Git Service

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 4d0759f..6fe9ecc 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 af5deb4..435d174 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 924b7ca..76c9001 100644 (file)
@@ -109,7 +109,7 @@ extern char *__progname;
 /* ================================================================
  * Debugging:
  */
-#if DEBUG
+#ifdef DEBUG
 extern int __intel_debug;
 
 #define DEBUG_SWAP     0x1
index 3431954..e9e4bc0 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 90a432a..cf8d190 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);
-
-}
-