xserver: Branch 'input-hotplug' - 10 commits

Daniel Stone daniels at kemper.freedesktop.org
Tue Aug 29 05:18:48 PDT 2006


 GL/glx/Makefile.am                    |    2 
 GL/glx/glxscreens.c                   |   21 ++++
 GL/glx/indirect_dispatch.c            |    8 +
 GL/glx/indirect_dispatch.h            |    6 -
 GL/glx/indirect_dispatch_swap.c       |    8 +
 GL/glx/indirect_program.c             |  163 ++++++++++++++++++++++++++++++++++
 GL/glx/indirect_size_get.c            |    1 
 GL/glx/indirect_table.c               |    4 
 GL/glx/indirect_texture_compression.c |  133 +++++++++++++++++++++++++++
 GL/glx/single2.c                      |   10 --
 GL/glx/single2swap.c                  |   10 --
 GL/glx/singlepix.c                    |    5 -
 GL/glx/singlepixswap.c                |    5 -
 dix/events.c                          |    2 
 hw/kdrive/linux/keyboard.c            |   11 ++
 hw/xfree86/common/xf86DoScanPci.c     |    4 
 hw/xfree86/common/xf86Init.c          |    5 -
 xkb/xkbUtils.c                        |   93 ++++++++++++-------
 18 files changed, 415 insertions(+), 76 deletions(-)

New commits:
diff-tree 89d272bb183e85715d8e6047929fb2d912033d82 (from bd6f539ff9409aa7d9056fabe120b457b0a15997)
Author: Daniel Stone <daniel.stone at nokia.com>
Date:   Tue Aug 29 15:05:31 2006 +0300

    [PATCH] kdrive/linux keyboard: remove more debugging spew

diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c
index eb4a8f1..24653ad 100644
--- a/hw/kdrive/linux/keyboard.c
+++ b/hw/kdrive/linux/keyboard.c
@@ -579,7 +579,9 @@ LinuxKeyboardRead (int fd, void *closure
                 if (!prefix && ((b[0] & 0x7f) == KEY_Prefix0))
                 {
                         prefix = KEY_Prefix0;
+#ifdef DEBUG
                         ErrorF("Prefix0");
+#endif
                         /* swallow this up */
                         b++;
                         continue;
@@ -598,7 +600,9 @@ LinuxKeyboardRead (int fd, void *closure
                         /* from xf86Events.c */
                         case KEY_Prefix0:
                         {
+#ifdef DEBUG
                             ErrorF("Prefix0 scancode: 0x%02x\n", scancode);
+#endif
                             switch (scancode) {
                                 case KEY_KP_7:
                                     scancode = KEY_Home;      break;  /* curs home */
diff-tree bd6f539ff9409aa7d9056fabe120b457b0a15997 (from 5436fce09003e20744a388fa4ae49007c9cf8ede)
Author: Daniel Stone <daniel.stone at nokia.com>
Date:   Tue Aug 29 13:21:58 2006 +0300

    [PATCH] kdrive/linux keyboard: silence excessive debugging noise

diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c
index 9400e6b..eb4a8f1 100644
--- a/hw/kdrive/linux/keyboard.c
+++ b/hw/kdrive/linux/keyboard.c
@@ -659,8 +659,10 @@ LinuxKeyboardRead (int fd, void *closure
                                     prefix = 0;
                                     continue;
                                 default:
+#ifdef DEBUG
                                     ErrorF("Unreported Prefix0 scancode: 0x%02x\n",
                                            scancode);
+#endif
                                      /*
                                       * "Internet" keyboards are generating lots of new
                                       * codes.  Let them pass.  There is little consistency
@@ -675,7 +677,9 @@ LinuxKeyboardRead (int fd, void *closure
                         case KEY_Prefix1:
                         {
                             /* we do no handle these */
+#ifdef DEBUG
                             ErrorF("Prefix1 scancode: 0x%02x\n", scancode);
+#endif
                             b++;
                             prefix = 0;
                             continue;
@@ -683,7 +687,10 @@ LinuxKeyboardRead (int fd, void *closure
 
                         default: /* should not happen*/
                         case 0: /* do nothing */
+#ifdef DEBUG
                             ErrorF("Plain scancode: 0x%02x\n", scancode);
+#endif
+                            ;
                 }
 
                 prefix = 0;
diff-tree 5436fce09003e20744a388fa4ae49007c9cf8ede (from 0eb7299f445455a7bcacf2410e83227b23259675)
Author: Daniel Stone <daniel.stone at nokia.com>
Date:   Tue Aug 29 13:21:40 2006 +0300

    [PATCH] GetKeyboardValutorEvents: be even more careful
    
    Don't accept devices without a keyboard feedback class.

diff --git a/dix/events.c b/dix/events.c
index 581fa08..c2c0395 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4663,7 +4663,7 @@ int GetKeyboardValuatorEvents(xEvent *ev
     if (type != KeyPress && type != KeyRelease)
         return 0;
 
-    if (!pDev->key || !pDev->focus ||
+    if (!pDev->key || !pDev->focus || !pDev->kbdfeed ||
         (pDev->coreEvents && !inputInfo.keyboard->key))
         return 0;
 
diff-tree 0eb7299f445455a7bcacf2410e83227b23259675 (from 7fa3383e3c8eea7d1eb0e556393f2431cf8e6ed2)
Author: Daniel Stone <daniel.stone at nokia.com>
Date:   Tue Aug 29 13:19:12 2006 +0300

    [PATCH] XkbCopyKeymap: still more range fixes
    
    Make sure we don't stomp preserve if it doesn't already exist, and fix a
    couple of range-related thinkos in level name copying.

diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 5f1176b..813801d 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -1059,6 +1059,9 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr
                 if (dst->map->types) {
                     tmp = xrealloc(dst->map->types,
                                    src->map->size_types * sizeof(XkbKeyTypeRec));
+                    if (!tmp)
+                        return FALSE;
+                    dst->map->types = tmp;
                     bzero(dst->map->types +
                             (dst->map->size_types * sizeof(XkbKeyTypeRec)),
                           (src->map->size_types - dst->map->size_types) *
@@ -1066,10 +1069,10 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr
                 }
                 else {
                     tmp = xcalloc(src->map->size_types, sizeof(XkbKeyTypeRec));
+                    if (!tmp)
+                        return FALSE;
+                    dst->map->types = tmp;
                 }
-                if (!tmp)
-                    return FALSE;
-                dst->map->types = tmp;
             }
             else if (src->map->size_types < dst->map->size_types) {
                 if (dst->map->types) {
@@ -1085,7 +1088,7 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr
 
             stype = src->map->types;
             dtype = dst->map->types;
-            for (i = 0; i < dst->map->num_types; i++, dtype++, stype++) {
+            for (i = 0; i < src->map->num_types; i++, dtype++, stype++) {
                 if (stype->num_levels != dtype->num_levels) {
                     if (dtype->level_names)
                         tmp = xrealloc(dtype->level_names,
@@ -1105,41 +1108,69 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr
                 dtype->name = stype->name;
                 memcpy(&dtype->mods, &stype->mods, sizeof(XkbModsRec));
 
-                if (stype->map_count != dtype->map_count) {
-                    if (dtype->map)
-                        tmp = xrealloc(dtype->map,
-                                       stype->map_count *
-                                         sizeof(XkbKTMapEntryRec));
-                    else
+                if (stype->map) {
+                    if (dtype->map) {
+                        if (stype->map_count != dtype->map_count) {
+                            tmp = xrealloc(dtype->map,
+                                           stype->map_count *
+                                             sizeof(XkbKTMapEntryRec));
+                            if (!tmp)
+                                return FALSE;
+                            dtype->map = tmp;
+                        }
+                    }
+                    else {
                         tmp = xalloc(stype->map_count *
-                                     sizeof(XkbKTMapEntryRec));
-                    if (!tmp)
-                        return FALSE;
-                    dtype->map = tmp;
+                                       sizeof(XkbKTMapEntryRec));
+                        if (!tmp)
+                            return FALSE;
+                        dtype->map = tmp;
+                    }
 
-                    if (dtype->preserve)
-                        tmp = xrealloc(dtype->preserve,
-                                       stype->map_count * sizeof(XkbModsRec));
-                    else
+                    dtype->map_count = stype->map_count;
+                    memcpy(dtype->map, stype->map, stype->map_count *
+                                               sizeof(XkbKTMapEntryRec));
+                }
+
+                if (stype->preserve) {
+                    if (dtype->preserve) {
+                        if (stype->map_count != dtype->map_count) {
+                            tmp = xrealloc(dtype->preserve,
+                                           stype->map_count *
+                                             sizeof(XkbModsRec));
+                            if (!tmp)
+                                return FALSE;
+                            dtype->preserve = tmp;
+                        }
+                    }
+                    else {
                         tmp = xalloc(stype->map_count * sizeof(XkbModsRec));
-                    if (!tmp)
-                        return FALSE;
-                    dtype->preserve = tmp;
+                        if (!tmp)
+                            return FALSE;
+                        dtype->preserve = tmp;
+                    }
+
+                    memcpy(dtype->preserve, stype->preserve,
+                           stype->map_count * sizeof(XkbModsRec));
+                }
+                else {
+                    if (dtype->preserve) {
+                        xfree(dtype->preserve);
+                        dtype->preserve = NULL;
+                    }
                 }
-                dtype->map_count = stype->map_count;
-                memcpy(dtype->map, stype->map, stype->map_count *
-                                               sizeof(XkbKTMapEntryRec));
-                memcpy(dtype->preserve, stype->preserve, stype->map_count *
-                                                         sizeof(XkbModsRec));
             }
         }
         else {
             if (dst->map->types) {
                 for (i = 0, dtype = dst->map->types; i < dst->map->num_types;
                      i++, dtype++) {
-                    xfree(dtype->level_names);
-                    xfree(dtype->map);
-                    xfree(dtype->preserve);
+                    if (dtype->level_names)
+                        xfree(dtype->level_names);
+                    if (dtype->map)
+                        xfree(dtype->map);
+                    if (dtype->preserve)
+                        xfree(dtype->preserve);
                 }
                 xfree(dst->map->types);
                 dst->map->types = NULL;
@@ -1490,8 +1521,8 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr
         else {
             /* send NewKeyboardNotify if the keycode range changed, else
              * just MapNotify. */
-            if (src->min_key_code != dst->min_key_code ||
-                src->max_key_code != dst->max_key_code && sendNotifies) {
+            if ((src->min_key_code != dst->min_key_code ||
+                 src->max_key_code != dst->max_key_code) && sendNotifies) {
                 nkn.oldMinKeyCode = dst->min_key_code;
                 nkn.oldMaxKeyCode = dst->max_key_code;
                 nkn.deviceID = nkn.oldDeviceID = pDev->id;
diff-tree 7fa3383e3c8eea7d1eb0e556393f2431cf8e6ed2 (from parents)
Merge: 8d77d44fda3aacbae62864a3620e09095b79e92d ebbdc1342a243b301723390696f742dc91f59764
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Tue Aug 29 15:16:01 2006 +0300

    Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug

diff-tree ebbdc1342a243b301723390696f742dc91f59764 (from 2fde560bbb9c1148f26fd969dc30c4e736672b7c)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date:   Mon Aug 28 18:17:32 2006 -0400

    Remove calls to LoaderCheckUnresolved(), since it's now a stub.

diff --git a/hw/xfree86/common/xf86DoScanPci.c b/hw/xfree86/common/xf86DoScanPci.c
index 746ff70..0c6668a 100644
--- a/hw/xfree86/common/xf86DoScanPci.c
+++ b/hw/xfree86/common/xf86DoScanPci.c
@@ -100,10 +100,6 @@ void DoScanPci(int argc, char **argv, in
     LoaderErrorMsg(NULL, "scanpci", errmaj, errmin);
     exit(1);
   }
-  if (LoaderCheckUnresolved(LD_RESOLV_IFDONE)) {
-      /* For now, just a warning */
-      xf86Msg(X_WARNING, "Some symbols could not be resolved!\n");
-  }
   PciSetup = (ScanPciSetupProcPtr)LoaderSymbol("ScanPciSetupPciIds");
   DisplayPCICardInfo =
     (ScanPciDisplayCardInfoProcPtr)LoaderSymbol("ScanPciDisplayPCICardInfo");
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 408536d..8b4bf14 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -973,11 +973,6 @@ InitOutput(ScreenInfo *pScreenInfo, int 
 #endif
   }
 
-    if ((serverGeneration == 1) && LoaderCheckUnresolved(LD_RESOLV_IFDONE)) {
-	/* For now, just a warning */
-	xf86Msg(X_WARNING, "Some symbols could not be resolved!\n");
-    }
-
   xf86PostScreenInit();
 
   xf86InitOrigins();
diff-tree 8d77d44fda3aacbae62864a3620e09095b79e92d (from parents)
Merge: d6f36bd28009881ef7f7a20cdadb3808d808ed97 2fde560bbb9c1148f26fd969dc30c4e736672b7c
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Sun Aug 27 23:08:49 2006 +0300

    Merge branch 'origin' into input-hotplug

diff-tree 2fde560bbb9c1148f26fd969dc30c4e736672b7c (from e2d529963ed40b5f113cf82c17809d241cd4aac1)
Author: Ian Romanick <idr at umwelt.(none)>
Date:   Fri Aug 25 13:01:51 2006 -0700

    Enable GL_EXT_texture_filter_anisotropic and GL_EXT_blend_equation_separate.
    
    Re-generate from gl_API.xml 1.65.  This provides the missing bits for
    GL_EXT_texture_filter_anisotropic and GL_EXT_blend_equation_separate.
    Enable those extensions.

diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index 41e08af..43447a4 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -74,6 +74,7 @@ static const char GLServerExtensions[] =
 			"GL_EXT_abgr "
 			"GL_EXT_bgra "
  			"GL_EXT_blend_color "
+			"GL_EXT_blend_equation_separate "
 			"GL_EXT_blend_func_separate "
 			"GL_EXT_blend_logic_op "
  			"GL_EXT_blend_minmax "
@@ -104,6 +105,7 @@ static const char GLServerExtensions[] =
  			"GL_EXT_texture_env_add "
  			"GL_EXT_texture_env_combine "
  			"GL_EXT_texture_env_dot3 "
+ 			"GL_EXT_texture_filter_ansiotropic "
 			"GL_EXT_texture_lod "
  			"GL_EXT_texture_lod_bias "
  			"GL_EXT_texture_mirror_clamp "
diff --git a/GL/glx/indirect_dispatch.c b/GL/glx/indirect_dispatch.c
index 9c2b7b1..04bb204 100644
--- a/GL/glx/indirect_dispatch.c
+++ b/GL/glx/indirect_dispatch.c
@@ -5466,6 +5466,14 @@ void __glXDisp_ProgramNamedParameter4fvN
     ) );
 }
 
+void __glXDisp_BlendEquationSeparateEXT(GLbyte * pc)
+{
+    CALL_BlendEquationSeparateEXT( GET_DISPATCH(), (
+        *(GLenum   *)(pc +  0),
+        *(GLenum   *)(pc +  4)
+    ) );
+}
+
 void __glXDisp_BindFramebufferEXT(GLbyte * pc)
 {
     CALL_BindFramebufferEXT( GET_DISPATCH(), (
diff --git a/GL/glx/indirect_dispatch.h b/GL/glx/indirect_dispatch.h
index a0da3e5..2a2fd27 100644
--- a/GL/glx/indirect_dispatch.h
+++ b/GL/glx/indirect_dispatch.h
@@ -73,6 +73,8 @@ extern HIDDEN void __glXDisp_RasterPos4d
 extern HIDDEN void __glXDispSwap_RasterPos4dv(GLbyte * pc);
 extern HIDDEN void __glXDisp_PolygonStipple(GLbyte * pc);
 extern HIDDEN void __glXDispSwap_PolygonStipple(GLbyte * pc);
+extern HIDDEN void __glXDisp_BlendEquationSeparateEXT(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_BlendEquationSeparateEXT(GLbyte * pc);
 extern HIDDEN int __glXDisp_GetPixelMapfv(struct __GLXclientStateRec *, GLbyte *);
 extern HIDDEN int __glXDispSwap_GetPixelMapfv(struct __GLXclientStateRec *, GLbyte *);
 extern HIDDEN void __glXDisp_Color3uiv(GLbyte * pc);
@@ -247,8 +249,6 @@ extern HIDDEN void __glXDisp_PixelMapfv(
 extern HIDDEN void __glXDispSwap_PixelMapfv(GLbyte * pc);
 extern HIDDEN void __glXDisp_Color3usv(GLbyte * pc);
 extern HIDDEN void __glXDispSwap_Color3usv(GLbyte * pc);
-extern HIDDEN void __glXDisp_DrawBuffersARB(GLbyte * pc);
-extern HIDDEN void __glXDispSwap_DrawBuffersARB(GLbyte * pc);
 extern HIDDEN int __glXDisp_AreTexturesResident(struct __GLXclientStateRec *, GLbyte *);
 extern HIDDEN int __glXDispSwap_AreTexturesResident(struct __GLXclientStateRec *, GLbyte *);
 extern HIDDEN int __glXDisp_IsRenderbufferEXT(struct __GLXclientStateRec *, GLbyte *);
@@ -891,6 +891,8 @@ extern HIDDEN int __glXDisp_IsList(struc
 extern HIDDEN int __glXDispSwap_IsList(struct __GLXclientStateRec *, GLbyte *);
 extern HIDDEN int __glXDisp_RenderMode(struct __GLXclientStateRec *, GLbyte *);
 extern HIDDEN int __glXDispSwap_RenderMode(struct __GLXclientStateRec *, GLbyte *);
+extern HIDDEN void __glXDisp_DrawBuffersARB(GLbyte * pc);
+extern HIDDEN void __glXDispSwap_DrawBuffersARB(GLbyte * pc);
 extern HIDDEN void __glXDisp_LoadName(GLbyte * pc);
 extern HIDDEN void __glXDispSwap_LoadName(GLbyte * pc);
 extern HIDDEN void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc);
diff --git a/GL/glx/indirect_dispatch_swap.c b/GL/glx/indirect_dispatch_swap.c
index 06c1d03..9a06cce 100644
--- a/GL/glx/indirect_dispatch_swap.c
+++ b/GL/glx/indirect_dispatch_swap.c
@@ -5631,6 +5631,14 @@ void __glXDispSwap_ProgramNamedParameter
     ) );
 }
 
+void __glXDispSwap_BlendEquationSeparateEXT(GLbyte * pc)
+{
+    CALL_BlendEquationSeparateEXT( GET_DISPATCH(), (
+         (GLenum  )bswap_ENUM   ( pc +  0 ),
+         (GLenum  )bswap_ENUM   ( pc +  4 )
+    ) );
+}
+
 void __glXDispSwap_BindFramebufferEXT(GLbyte * pc)
 {
     CALL_BindFramebufferEXT( GET_DISPATCH(), (
diff --git a/GL/glx/indirect_size_get.c b/GL/glx/indirect_size_get.c
index c16b29a..6ca9a35 100644
--- a/GL/glx/indirect_size_get.c
+++ b/GL/glx/indirect_size_get.c
@@ -609,6 +609,7 @@ __glGetBooleanv_size( GLenum e )
         case GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB:
 /*      case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV:*/
         case GL_MAX_TEXTURE_LOD_BIAS:
+        case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
         case GL_MAX_SHININESS_NV:
         case GL_MAX_SPOT_EXPONENT_NV:
         case GL_TEXTURE_CUBE_MAP:
diff --git a/GL/glx/indirect_table.c b/GL/glx/indirect_table.c
index 8671a84..3e294ad 100644
--- a/GL/glx/indirect_table.c
+++ b/GL/glx/indirect_table.c
@@ -703,7 +703,7 @@ static const void *Render_function_table
     /* [ 353] =  4225 */ {NULL, NULL},
     /* [ 354] =  4226 */ {NULL, NULL},
     /* [ 355] =  4227 */ {NULL, NULL},
-    /* [ 356] =  4228 */ {NULL, NULL},
+    /* [ 356] =  4228 */ {__glXDisp_BlendEquationSeparateEXT, __glXDispSwap_BlendEquationSeparateEXT},
     /* [ 357] =  4229 */ {NULL, NULL},
     /* [ 358] =  4230 */ {__glXDisp_VertexAttrib4bvARB, __glXDispSwap_VertexAttrib4bvARB},
     /* [ 359] =  4231 */ {__glXDisp_VertexAttrib4ivARB, __glXDispSwap_VertexAttrib4ivARB},
@@ -1090,7 +1090,7 @@ static const int_fast16_t Render_size_ta
     /* [353] =  4225 */ {  0, ~0},
     /* [354] =  4226 */ {  0, ~0},
     /* [355] =  4227 */ {  0, ~0},
-    /* [356] =  4228 */ {  0, ~0},
+    /* [356] =  4228 */ { 12, ~0},
     /* [357] =  4229 */ {  0, ~0},
     /* [358] =  4230 */ { 12, ~0},
     /* [359] =  4231 */ { 24, ~0},
diff-tree e2d529963ed40b5f113cf82c17809d241cd4aac1 (from c33e39c86be2010b169ffbd8adbe53b93222dc5f)
Author: Ian Romanick <idr at umwelt.(none)>
Date:   Fri Aug 25 12:05:16 2006 -0700

    Enable vertex and fragment programs.
    
    Implement glGetProgramStringARB and glGetProgramStringNV.  With these
    functions implemented, GL_ARB_{vertex,fragment}_program,
    GL_NV_{vertex,fragment}_program, and related extensions can be enabled.

diff --git a/GL/glx/Makefile.am b/GL/glx/Makefile.am
index f8af30e..339fbe0 100644
--- a/GL/glx/Makefile.am
+++ b/GL/glx/Makefile.am
@@ -54,6 +54,7 @@ libglx_la_SOURCES = \
         indirect_dispatch.c \
         indirect_dispatch.h \
         indirect_dispatch_swap.c \
+        indirect_program.c \
         indirect_reqsize.c \
         indirect_reqsize.h \
         indirect_size_get.c \
diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index c94c27c..41e08af 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -49,6 +49,8 @@ const char GLServerVersion[] = "1.4";
 static const char GLServerExtensions[] = 
 			"GL_ARB_depth_texture "
 			"GL_ARB_draw_buffers "
+			"GL_ARB_fragment_program "
+			"GL_ARB_fragment_program_shadow "
 			"GL_ARB_imaging "
 			"GL_ARB_multisample "
 			"GL_ARB_multitexture "
@@ -58,8 +60,8 @@ static const char GLServerExtensions[] =
 			"GL_ARB_shadow "
 			"GL_ARB_shadow_ambient "
 			"GL_ARB_texture_border_clamp "
-			"GL_ARB_texture_cube_map "
 			"GL_ARB_texture_compression "
+			"GL_ARB_texture_cube_map "
 			"GL_ARB_texture_env_add "
 			"GL_ARB_texture_env_combine "
 			"GL_ARB_texture_env_crossbar "
@@ -67,6 +69,7 @@ static const char GLServerExtensions[] =
 			"GL_ARB_texture_mirrored_repeat "
 			"GL_ARB_texture_non_power_of_two "
 			"GL_ARB_transpose_matrix "
+			"GL_ARB_vertex_program "
 			"GL_ARB_window_pos "
 			"GL_EXT_abgr "
 			"GL_EXT_bgra "
@@ -120,6 +123,9 @@ static const char GLServerExtensions[] =
 			"GL_NV_blend_square "
 			"GL_NV_depth_clamp "
 			"GL_NV_fog_distance "
+			"GL_NV_fragment_program "
+			"GL_NV_fragment_program_option "
+			"GL_NV_fragment_program2 "
 			"GL_NV_light_max_exponent "
 			"GL_NV_multisample_filter_hint "
 			"GL_NV_point_sprite "
@@ -128,6 +134,11 @@ static const char GLServerExtensions[] =
 			"GL_NV_texture_env_combine4 "
 			"GL_NV_texture_expand_normal "
 			"GL_NV_texture_rectangle "
+			"GL_NV_vertex_program "
+			"GL_NV_vertex_program1_1 "
+			"GL_NV_vertex_program2 "
+			"GL_NV_vertex_program2_option "
+			"GL_NV_vertex_program3 "
 			"GL_OES_compressed_paletted_texture "
 			"GL_SGI_color_matrix "
 			"GL_SGI_color_table "
diff --git a/GL/glx/indirect_program.c b/GL/glx/indirect_program.c
new file mode 100644
index 0000000..d0fd3d1
--- /dev/null
+++ b/GL/glx/indirect_program.c
@@ -0,0 +1,163 @@
+/*
+ * (C) Copyright IBM Corporation 2005, 2006
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, THE AUTHORS, AND/OR THEIR SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file indirect_program.c
+ * Hand-coded routines needed to support programmable pipeline extensions.
+ *
+ * \author Ian Romanick <idr at us.ibm.com>
+ */
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "singlesize.h"
+#include "unpack.h"
+#include "indirect_size_get.h"
+#include "indirect_dispatch.h"
+#include "glapitable.h"
+#include "glapi.h"
+#include "glthread.h"
+#include "dispatch.h"
+#include "glapioffsets.h"
+
+#ifdef __linux__
+#include <byteswap.h>
+#elif defined(__OpenBSD__)
+#include <sys/endian.h>
+#define bswap_16 __swap16
+#define bswap_32 __swap32
+#define bswap_64 __swap64
+#else
+#include <sys/endian.h>
+#define bswap_16 bswap16
+#define bswap_32 bswap32
+#define bswap_64 bswap64
+#endif
+
+static int DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte *pc,
+    unsigned get_programiv_offset, unsigned get_program_string_offset,
+    Bool do_swap);
+
+/**
+ * Handle both types of glGetProgramString calls.
+ *
+ * This single function handles both \c glGetProgramStringARB and
+ * \c glGetProgramStringNV.  The dispatch offsets for the functions to use
+ * for \c glGetProgramivARB and \c glGetProgramStringARB are passed in by the
+ * caller.  These can be the offsets of either the ARB versions or the NV
+ * versions.
+ */
+int DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte *pc,
+		       unsigned get_programiv_offset,
+		       unsigned get_program_string_offset,
+		       Bool do_swap)
+{
+    xGLXVendorPrivateWithReplyReq * const req = 
+      (xGLXVendorPrivateWithReplyReq *) pc;
+    int error;
+    __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, & error);
+    ClientPtr client = cl->client;
+
+
+    pc += __GLX_VENDPRIV_HDR_SIZE;
+    if (cx != NULL) {
+	GLenum target;
+	GLenum pname;
+	GLint compsize = 0;
+	char *answer = NULL, answerBuffer[200];
+
+	if (do_swap) {
+	    target = (GLenum) bswap_32(*(int *)(pc + 0));
+	    pname =  (GLenum) bswap_32(*(int *)(pc + 4));
+	}
+	else {
+	    target = *(GLenum *)(pc + 0);
+	    pname =  *(GLuint *)(pc + 4);
+	}
+
+	/* The value of the GL_PROGRAM_LENGTH_ARB and GL_PROGRAM_LENGTH_NV
+	 * enumerants is the same.
+	 */
+	CALL_by_offset(GET_DISPATCH(),
+		       (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), 
+		       get_programiv_offset,
+		       (target, GL_PROGRAM_LENGTH_ARB, &compsize));
+
+	if (compsize != 0) {
+	    __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+	    __glXClearErrorOccured();
+
+	    CALL_by_offset(GET_DISPATCH(), 
+			   (void (GLAPIENTRYP)(GLuint, GLenum, GLubyte *)),
+			   get_program_string_offset,
+			   (target, pname, answer));
+	}
+
+	if (__glXErrorOccured()) {
+	    __GLX_BEGIN_REPLY(0);
+	    __GLX_SEND_HEADER();
+	} else {
+	    __GLX_BEGIN_REPLY(compsize);
+	    ((xGLXGetTexImageReply *)&__glXReply)->width = compsize;
+	    __GLX_SEND_HEADER();
+	    __GLX_SEND_VOID_ARRAY(compsize);
+	}
+
+	error = Success;
+    }
+
+    return error;
+}
+
+int __glXDisp_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte *pc)
+{
+    return DoGetProgramString(cl, pc, _gloffset_GetProgramivARB,
+			      _gloffset_GetProgramStringARB, False);
+}
+
+
+int __glXDispSwap_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte *pc)
+{
+    return DoGetProgramString(cl, pc, _gloffset_GetProgramivARB,
+			      _gloffset_GetProgramStringARB, True);
+}
+
+
+int __glXDisp_GetProgramStringNV(struct __GLXclientStateRec *cl, GLbyte *pc)
+{
+    return DoGetProgramString(cl, pc, _gloffset_GetProgramivNV,
+			      _gloffset_GetProgramStringNV, False);
+}
+
+
+int __glXDispSwap_GetProgramStringNV(struct __GLXclientStateRec *cl, GLbyte *pc)
+{
+    return DoGetProgramString(cl, pc, _gloffset_GetProgramivNV,
+			      _gloffset_GetProgramStringNV, True);
+}
diff --git a/GL/glx/single2.c b/GL/glx/single2.c
index 357cd31..3387af2 100644
--- a/GL/glx/single2.c
+++ b/GL/glx/single2.c
@@ -392,13 +392,3 @@ int __glXDisp_GetString(__GLXclientState
 {
     return DoGetString(cl, pc, GL_FALSE);
 }
-
-int __glXDisp_GetProgramStringARB(__GLXclientState *cl, GLbyte *pc)
-{
-    return BadRequest;
-}
-
-int __glXDisp_GetProgramStringNV(__GLXclientState *cl, GLbyte *pc)
-{
-    return BadRequest;
-}
diff --git a/GL/glx/single2swap.c b/GL/glx/single2swap.c
index 6d5e5ce..41a42bb 100644
--- a/GL/glx/single2swap.c
+++ b/GL/glx/single2swap.c
@@ -270,13 +270,3 @@ int __glXDispSwap_GetString(__GLXclientS
 {
     return DoGetString(cl, pc, GL_TRUE);
 }
-
-int __glXDispSwap_GetProgramStringARB(__GLXclientState *cl, GLbyte *pc)
-{
-    return BadRequest;
-}
-
-int __glXDispSwap_GetProgramStringNV(__GLXclientState *cl, GLbyte *pc)
-{
-    return BadRequest;
-}
diff-tree c33e39c86be2010b169ffbd8adbe53b93222dc5f (from cd2da4e41eae233b50f8830d9a8f5d1d916a5a1b)
Author: Ian Romanick <idr at umwelt.(none)>
Date:   Thu Aug 24 20:33:57 2006 -0700

    Finish support for GL_ARB_texture_compression.
    
    Fill in __glXDisp_GetCompressedTexImageARB and
    __glXDispSwap_GetCompressedTexImageARB to finish support for
    GL_ARB_texture_compression.  With this extension (and the related
    compression extensions), the server-side GLX supports all of the
    protocol for GL 1.4.  w00t!
    
    The bad news is that this has received only minimal testing, and Mesa
    does not contain any good tests for GL_ARB_texture_compression.

diff --git a/GL/glx/Makefile.am b/GL/glx/Makefile.am
index 4e21e50..f8af30e 100644
--- a/GL/glx/Makefile.am
+++ b/GL/glx/Makefile.am
@@ -60,6 +60,7 @@ libglx_la_SOURCES = \
         indirect_size_get.h \
         indirect_table.c \
         indirect_table.h \
+        indirect_texture_compression.c \
         indirect_util.c \
         indirect_util.h \
         render2.c \
diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index 763e55e..c94c27c 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -45,7 +45,7 @@
 #include "glxutil.h"
 #include "glxext.h"
 
-const char GLServerVersion[] = "1.2";
+const char GLServerVersion[] = "1.4";
 static const char GLServerExtensions[] = 
 			"GL_ARB_depth_texture "
 			"GL_ARB_draw_buffers "
@@ -59,6 +59,7 @@ static const char GLServerExtensions[] =
 			"GL_ARB_shadow_ambient "
 			"GL_ARB_texture_border_clamp "
 			"GL_ARB_texture_cube_map "
+			"GL_ARB_texture_compression "
 			"GL_ARB_texture_env_add "
 			"GL_ARB_texture_env_combine "
 			"GL_ARB_texture_env_crossbar "
@@ -94,6 +95,8 @@ static const char GLServerExtensions[] =
 			"GL_EXT_subtexture "
 			"GL_EXT_texture "
 			"GL_EXT_texture3D "
+			"GL_EXT_texture_compression_dxt1 "
+			"GL_EXT_texture_compression_s3tc "
 			"GL_EXT_texture_edge_clamp "
  			"GL_EXT_texture_env_add "
  			"GL_EXT_texture_env_combine "
@@ -104,6 +107,7 @@ static const char GLServerExtensions[] =
 			"GL_EXT_texture_object "
 			"GL_EXT_texture_rectangle "
 			"GL_EXT_vertex_array "
+			"GL_3DFX_texture_compression_FXT1 "
 			"GL_APPLE_packed_pixels "
 			"GL_ATI_draw_buffers "
 			"GL_ATI_texture_env_combine3 "
@@ -120,9 +124,11 @@ static const char GLServerExtensions[] =
 			"GL_NV_multisample_filter_hint "
 			"GL_NV_point_sprite "
 			"GL_NV_texgen_reflection "
+			"GL_NV_texture_compression_vtc "
 			"GL_NV_texture_env_combine4 "
 			"GL_NV_texture_expand_normal "
 			"GL_NV_texture_rectangle "
+			"GL_OES_compressed_paletted_texture "
 			"GL_SGI_color_matrix "
 			"GL_SGI_color_table "
 			"GL_SGIS_generate_mipmap "
diff --git a/GL/glx/indirect_texture_compression.c b/GL/glx/indirect_texture_compression.c
new file mode 100644
index 0000000..0c42ea0
--- /dev/null
+++ b/GL/glx/indirect_texture_compression.c
@@ -0,0 +1,133 @@
+/*
+ * (C) Copyright IBM Corporation 2005, 2006
+ * All Rights Reserved.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+ * IBM,
+ * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#define NEED_REPLIES
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "glxserver.h"
+#include "glxext.h"
+#include "singlesize.h"
+#include "unpack.h"
+#include "indirect_size_get.h"
+#include "indirect_dispatch.h"
+#include "glapitable.h"
+#include "glapi.h"
+#include "glthread.h"
+#include "dispatch.h"
+
+#ifdef __linux__
+#include <byteswap.h>
+#elif defined(__OpenBSD__)
+#include <sys/endian.h>
+#define bswap_16 __swap16
+#define bswap_32 __swap32
+#define bswap_64 __swap64
+#else
+#include <sys/endian.h>
+#define bswap_16 bswap16
+#define bswap_32 bswap32
+#define bswap_64 bswap64
+#endif
+
+int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc)
+{
+    xGLXSingleReq * const req = (xGLXSingleReq *) pc;
+    int error;
+    __GLXcontext * const cx = __glXForceCurrent( cl, req->contextTag, & error );
+    ClientPtr client = cl->client;
+
+
+    pc += __GLX_SINGLE_HDR_SIZE;
+    if ( cx != NULL ) {
+	const GLenum target = *(GLenum *)(pc + 0);
+	const GLint  level  = *(GLint  *)(pc + 4);
+	GLint compsize = 0;
+	char *answer, answerBuffer[200];
+
+	CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
+
+	if ( compsize != 0 ) {
+	    __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+	    __glXClearErrorOccured();
+	    CALL_GetCompressedTexImageARB(GET_DISPATCH(), (target, level, answer));
+	}
+
+	if (__glXErrorOccured()) {
+	    __GLX_BEGIN_REPLY(0);
+	    __GLX_SEND_HEADER();
+	} else {
+	    __GLX_BEGIN_REPLY(compsize);
+	    ((xGLXGetTexImageReply *)&__glXReply)->width = compsize;
+	    __GLX_SEND_HEADER();
+	    __GLX_SEND_VOID_ARRAY(compsize);
+	}
+
+	error = Success;
+    }
+
+    return error;
+}
+
+
+int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc)
+{
+    xGLXSingleReq * const req = (xGLXSingleReq *) pc;
+    int error;
+    __GLXcontext * const cx = __glXForceCurrent( cl, bswap_32( req->contextTag ), & error );
+    ClientPtr client = cl->client;
+
+
+    pc += __GLX_SINGLE_HDR_SIZE;
+    if ( cx != NULL ) {
+	const GLenum target = (GLenum) bswap_32( *(int *)(pc + 0) );
+	const GLint  level =  (GLint ) bswap_32( *(int *)(pc + 4) );
+	GLint compsize = 0;
+	char *answer, answerBuffer[200];
+
+	CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
+
+	if ( compsize != 0 ) {
+	    __GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
+	    __glXClearErrorOccured();
+	    CALL_GetCompressedTexImageARB(GET_DISPATCH(), (target, level, answer));
+	}
+
+	if (__glXErrorOccured()) {
+	    __GLX_BEGIN_REPLY(0);
+	    __GLX_SEND_HEADER();
+	} else {
+	    __GLX_BEGIN_REPLY(compsize);
+	    ((xGLXGetTexImageReply *)&__glXReply)->width = compsize;
+	    __GLX_SEND_HEADER();
+	    __GLX_SEND_VOID_ARRAY(compsize);
+	}
+	
+	error = Success;
+    }
+
+    return error;
+}
diff --git a/GL/glx/singlepix.c b/GL/glx/singlepix.c
index 62588b0..3f76e5e 100644
--- a/GL/glx/singlepix.c
+++ b/GL/glx/singlepix.c
@@ -515,8 +515,3 @@ int __glXDisp_GetColorTableSGI(__GLXclie
 
     return Success;
 }
-
-int __glXDisp_GetCompressedTexImageARB(__GLXclientState *cl, GLbyte *pc)
-{
-    return BadRequest;
-}
diff --git a/GL/glx/singlepixswap.c b/GL/glx/singlepixswap.c
index d5510b9..c2e06d1 100644
--- a/GL/glx/singlepixswap.c
+++ b/GL/glx/singlepixswap.c
@@ -576,8 +576,3 @@ int __glXDispSwap_GetColorTableSGI(__GLX
 
     return Success;
 }
-
-int __glXDispSwap_GetCompressedTexImageARB(__GLXclientState *cl, GLbyte *pc)
-{
-    return BadRequest;
-}



More information about the xorg-commit mailing list