dri: Add DRI entrypoints to create a context for a given API
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 27 Apr 2010 15:04:51 +0000 (11:04 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 28 Apr 2010 18:05:21 +0000 (14:05 -0400)
src/mesa/drivers/dri/i915/i830_context.c
src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/i915/i915_context.h
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_screen.c

index ebe8b15ca735d5f6734a0b28e50d2b14ae430395..d52ea9812f7f835436bfc71e887ac75232b3a190 100644 (file)
@@ -63,7 +63,7 @@ i830CreateContext(const __GLcontextModes * mesaVis,
    i830InitVtbl(i830);
    i830InitDriverFunctions(&functions);
 
-   if (!intelInitContext(intel, mesaVis, driContextPriv,
+   if (!intelInitContext(intel, __DRI_API_OPENGL, mesaVis, driContextPriv,
                          sharedContextPrivate, &functions)) {
       FREE(i830);
       return GL_FALSE;
index 4d86aae87d9c8f20925963026d7ad5eee28fa0a7..b3fe1c05d669c4dad0a6a0705a375733b6daeb6f 100644 (file)
@@ -94,7 +94,8 @@ i915InitDriverFunctions(struct dd_function_table *functions)
 extern const struct tnl_pipeline_stage *intel_pipeline[];
 
 GLboolean
-i915CreateContext(const __GLcontextModes * mesaVis,
+i915CreateContext(int api,
+                 const __GLcontextModes * mesaVis,
                   __DRIcontext * driContextPriv,
                   void *sharedContextPrivate)
 {
@@ -114,7 +115,7 @@ i915CreateContext(const __GLcontextModes * mesaVis,
 
    i915InitDriverFunctions(&functions);
 
-   if (!intelInitContext(intel, mesaVis, driContextPriv,
+   if (!intelInitContext(intel, api, mesaVis, driContextPriv,
                          sharedContextPrivate, &functions)) {
       FREE(i915);
       return GL_FALSE;
index b5169280f6b14cd585cb71288f63e5895a09a67f..a7b9aae6f953ea1519739e74fcc6e402a0413bc8 100644 (file)
@@ -318,7 +318,8 @@ do {                                                                        \
 /*======================================================================
  * i915_context.c
  */
-extern GLboolean i915CreateContext(const __GLcontextModes * mesaVis,
+extern GLboolean i915CreateContext(int api,
+                                  const __GLcontextModes * mesaVis,
                                    __DRIcontext * driContextPriv,
                                    void *sharedContextPrivate);
 
index 360fc12621adfef2d94148bb22322f76c6c28742..523a11aea332c00017e776798d3fd1774746d07a 100644 (file)
@@ -68,7 +68,8 @@ static void brwInitDriverFunctions( struct dd_function_table *functions )
    functions->Viewport = intel_viewport;
 }
 
-GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
+GLboolean brwCreateContext( int api,
+                           const __GLcontextModes *mesaVis,
                            __DRIcontext *driContextPriv,
                            void *sharedContextPrivate)
 {
@@ -85,7 +86,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
    brwInitVtbl( brw );
    brwInitDriverFunctions( &functions );
 
-   if (!intelInitContext( intel, mesaVis, driContextPriv,
+   if (!intelInitContext( intel, api, mesaVis, driContextPriv,
                          sharedContextPrivate, &functions )) {
       printf("%s: failed to init intel context\n", __FUNCTION__);
       FREE(brw);
index 2855c93ea6662f48597884e8776d68e27a376a53..1f09651126b436518e7d4c7fb09c2d91c292d5a1 100644 (file)
@@ -687,7 +687,8 @@ void brwInitVtbl( struct brw_context *brw );
 /*======================================================================
  * brw_context.c
  */
-GLboolean brwCreateContext( const __GLcontextModes *mesaVis,
+GLboolean brwCreateContext( int api,
+                           const __GLcontextModes *mesaVis,
                            __DRIcontext *driContextPriv,
                            void *sharedContextPrivate);
 
index 2ccc12010eda4ae422bba6331305159fd79449df..8922d574c11538f3cfe081d8dcd7688cb44e83e3 100644 (file)
@@ -586,6 +586,7 @@ intelInitDriverFunctions(struct dd_function_table *functions)
 
 GLboolean
 intelInitContext(struct intel_context *intel,
+                int api,
                  const __GLcontextModes * mesaVis,
                  __DRIcontext * driContextPriv,
                  void *sharedContextPrivate,
@@ -601,8 +602,8 @@ intelInitContext(struct intel_context *intel,
    if (intelScreen->bufmgr == NULL)
       return GL_FALSE;
 
-   if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx,
-                                 functions, (void *) intel)) {
+   if (!_mesa_initialize_context_for_api(&intel->ctx, api, mesaVis, shareCtx,
+                                        functions, (void *) intel)) {
       printf("%s: failed to init mesa context\n", __FUNCTION__);
       return GL_FALSE;
    }
index 75dabc554c671c4717f2c628638a8349a02dcf17..02bb4d0d640aa46a294d99fec3646170697467b7 100644 (file)
@@ -364,6 +364,7 @@ extern int INTEL_DEBUG;
  */
 
 extern GLboolean intelInitContext(struct intel_context *intel,
+                                 int api,
                                   const __GLcontextModes * mesaVis,
                                   __DRIcontext * driContextPriv,
                                   void *sharedContextPrivate,
index b27e7a34a76d525eb97d85f000fc18bfa355b004..9b7ae73e45b5d62a279fc768d0ebe4472bd4d08f 100644 (file)
@@ -356,10 +356,12 @@ extern GLboolean i830CreateContext(const __GLcontextModes * mesaVis,
                                    __DRIcontext * driContextPriv,
                                    void *sharedContextPrivate);
 
-extern GLboolean i915CreateContext(const __GLcontextModes * mesaVis,
+extern GLboolean i915CreateContext(int api,
+                                  const __GLcontextModes * mesaVis,
                                    __DRIcontext * driContextPriv,
                                    void *sharedContextPrivate);
-extern GLboolean brwCreateContext(const __GLcontextModes * mesaVis,
+extern GLboolean brwCreateContext(int api,
+                                 const __GLcontextModes * mesaVis,
                                  __DRIcontext * driContextPriv,
                                  void *sharedContextPrivate);
 
@@ -375,7 +377,7 @@ intelCreateContext(gl_api api,
 #ifdef I915
    if (IS_9XX(intelScreen->deviceID)) {
       if (!IS_965(intelScreen->deviceID)) {
-        return i915CreateContext(mesaVis, driContextPriv,
+        return i915CreateContext(api, mesaVis, driContextPriv,
                                  sharedContextPrivate);
       }
    } else {
@@ -384,7 +386,8 @@ intelCreateContext(gl_api api,
    }
 #else
    if (IS_965(intelScreen->deviceID))
-      return brwCreateContext(mesaVis, driContextPriv, sharedContextPrivate);
+      return brwCreateContext(api, mesaVis,
+                             driContextPriv, sharedContextPrivate);
 #endif
    fprintf(stderr, "Unrecognized deviceID %x\n", intelScreen->deviceID);
    return GL_FALSE;