aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--X11/xtrans/Xtrans.c135
-rw-r--r--X11/xtrans/Xtrans.h20
-rw-r--r--X11/xtrans/Xtransint.h115
-rw-r--r--X11/xtrans/Xtranslcl.c369
-rw-r--r--X11/xtrans/Xtranssock.c336
-rw-r--r--X11/xtrans/Xtranstli.c283
-rw-r--r--X11/xtrans/Xtransutil.c59
-rw-r--r--X11/xtrans/doc/xtrans.xml28
-rw-r--r--X11/xtrans/transport.c3
-rw-r--r--libX11/nls/iso8859-1/Compose.pre2
-rw-r--r--libXdmcp/doc/xdmcp.xml4
-rw-r--r--libXmu/doc/Xmu.xml162
-rw-r--r--libxcb/xcb-proto/src/xproto.xml4881
-rw-r--r--mesalib/Android.mk2
-rw-r--r--mesalib/configs/default1
-rw-r--r--mesalib/configs/freebsd-dri4
-rw-r--r--mesalib/configs/linux-dri16
-rw-r--r--mesalib/configs/linux-dri-xcb10
-rw-r--r--mesalib/configs/linux-egl116
-rw-r--r--mesalib/configs/linux-llvm2
-rw-r--r--mesalib/configure.ac4
-rw-r--r--mesalib/docs/envvars.html2
-rw-r--r--mesalib/docs/install.html13
-rw-r--r--mesalib/src/glsl/glcpp/glcpp-parse.y89
-rw-r--r--mesalib/src/glsl/ir_validate.cpp1
-rw-r--r--mesalib/src/glsl/linker.cpp146
-rw-r--r--mesalib/src/glsl/opt_function_inlining.cpp1
-rw-r--r--mesalib/src/glsl/standalone_scaffolding.cpp1
-rw-r--r--mesalib/src/mapi/glapi/gen/ARB_draw_buffers.xml187
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_API.xml119
-rw-r--r--mesalib/src/mapi/glapi/gen/gles_api.py2
-rw-r--r--mesalib/src/mapi/glapi/glapi.h6
-rw-r--r--mesalib/src/mapi/glapi/glapi_gentable.c7
-rw-r--r--mesalib/src/mapi/glapi/glapi_mapi_tmp.h11
-rw-r--r--mesalib/src/mapi/glapi/glapi_sparc.S1
-rw-r--r--mesalib/src/mapi/glapi/glapi_x86-64.S1
-rw-r--r--mesalib/src/mapi/glapi/glapi_x86.S1
-rw-r--r--mesalib/src/mapi/glapi/glapitemp.h7
-rw-r--r--mesalib/src/mapi/glapi/glprocs.h324
-rw-r--r--mesalib/src/mesa/SConscript2
-rw-r--r--mesalib/src/mesa/drivers/common/driverfuncs.c2
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c31
-rw-r--r--mesalib/src/mesa/drivers/common/meta.h3
-rw-r--r--mesalib/src/mesa/drivers/dri/swrast/swrast.c1
-rw-r--r--mesalib/src/mesa/main/APIspec.xml93
-rw-r--r--mesalib/src/mesa/main/accum.c3
-rw-r--r--mesalib/src/mesa/main/accum.h150
-rw-r--r--mesalib/src/mesa/main/api_arrayelt.h168
-rw-r--r--mesalib/src/mesa/main/api_loopback.h96
-rw-r--r--mesalib/src/mesa/main/arrayobj.c1104
-rw-r--r--mesalib/src/mesa/main/atifragshader.h308
-rw-r--r--mesalib/src/mesa/main/attrib.c106
-rw-r--r--mesalib/src/mesa/main/attrib.h160
-rw-r--r--mesalib/src/mesa/main/bitset.h2
-rw-r--r--mesalib/src/mesa/main/bufferobj.c4
-rw-r--r--mesalib/src/mesa/main/bufferobj.h6
-rw-r--r--mesalib/src/mesa/main/clear.c16
-rw-r--r--mesalib/src/mesa/main/colortab.h6
-rw-r--r--mesalib/src/mesa/main/convolve.h102
-rw-r--r--mesalib/src/mesa/main/dd.h22
-rw-r--r--mesalib/src/mesa/main/debug.c4
-rw-r--r--mesalib/src/mesa/main/dlist.c8
-rw-r--r--mesalib/src/mesa/main/dlist.h208
-rw-r--r--mesalib/src/mesa/main/drawpix.c11
-rw-r--r--mesalib/src/mesa/main/drawpix.h100
-rw-r--r--mesalib/src/mesa/main/enums.c6292
-rw-r--r--mesalib/src/mesa/main/eval.h222
-rw-r--r--mesalib/src/mesa/main/extensions.c9
-rw-r--r--mesalib/src/mesa/main/fbobject.c85
-rw-r--r--mesalib/src/mesa/main/fbobject.h390
-rw-r--r--mesalib/src/mesa/main/feedback.c2
-rw-r--r--mesalib/src/mesa/main/feedback.h198
-rw-r--r--mesalib/src/mesa/main/format_unpack.c2
-rw-r--r--mesalib/src/mesa/main/formats.c518
-rw-r--r--mesalib/src/mesa/main/formats.h46
-rw-r--r--mesalib/src/mesa/main/framebuffer.h2
-rw-r--r--mesalib/src/mesa/main/get.c48
-rw-r--r--mesalib/src/mesa/main/hash.c1094
-rw-r--r--mesalib/src/mesa/main/histogram.h116
-rw-r--r--mesalib/src/mesa/main/image.c4
-rw-r--r--mesalib/src/mesa/main/imports.h48
-rw-r--r--mesalib/src/mesa/main/mipmap.c356
-rw-r--r--mesalib/src/mesa/main/mipmap.h4
-rw-r--r--mesalib/src/mesa/main/mm.c2
-rw-r--r--mesalib/src/mesa/main/mtypes.h20
-rw-r--r--mesalib/src/mesa/main/pack.c10
-rw-r--r--mesalib/src/mesa/main/pixel.c2
-rw-r--r--mesalib/src/mesa/main/pixel.h153
-rw-r--r--mesalib/src/mesa/main/queryobj.h8
-rw-r--r--mesalib/src/mesa/main/rastpos.h120
-rw-r--r--mesalib/src/mesa/main/remap.h196
-rw-r--r--mesalib/src/mesa/main/remap_helper.h443
-rw-r--r--mesalib/src/mesa/main/renderbuffer.h2
-rw-r--r--mesalib/src/mesa/main/samplerobj.c2
-rw-r--r--mesalib/src/mesa/main/samplerobj.h2
-rw-r--r--mesalib/src/mesa/main/shader_query.cpp239
-rw-r--r--mesalib/src/mesa/main/shaderapi.c145
-rw-r--r--mesalib/src/mesa/main/shaderapi.h390
-rw-r--r--mesalib/src/mesa/main/shaderobj.c11
-rw-r--r--mesalib/src/mesa/main/shaderobj.h274
-rw-r--r--mesalib/src/mesa/main/state.h2
-rw-r--r--mesalib/src/mesa/main/syncobj.h238
-rw-r--r--mesalib/src/mesa/main/texcompress_s3tc.c2
-rw-r--r--mesalib/src/mesa/main/texcompress_s3tc.h2
-rw-r--r--mesalib/src/mesa/main/texformat.c83
-rw-r--r--mesalib/src/mesa/main/texgen.h170
-rw-r--r--mesalib/src/mesa/main/texgetimage.c24
-rw-r--r--mesalib/src/mesa/main/texgetimage.h3
-rw-r--r--mesalib/src/mesa/main/teximage.c2
-rw-r--r--mesalib/src/mesa/main/teximage.h4
-rw-r--r--mesalib/src/mesa/main/texobj.h2
-rw-r--r--mesalib/src/mesa/main/texparam.c4
-rw-r--r--mesalib/src/mesa/main/texstate.h184
-rw-r--r--mesalib/src/mesa/main/texstore.c441
-rw-r--r--mesalib/src/mesa/main/transformfeedback.h274
-rw-r--r--mesalib/src/mesa/main/varray.h2
-rw-r--r--mesalib/src/mesa/main/version.c1
-rw-r--r--mesalib/src/mesa/main/vtxfmt.h118
-rw-r--r--mesalib/src/mesa/program/hash_table.c39
-rw-r--r--mesalib/src/mesa/program/hash_table.h99
-rw-r--r--mesalib/src/mesa/program/ir_to_mesa.cpp16
-rw-r--r--mesalib/src/mesa/program/prog_execute.c14
-rw-r--r--mesalib/src/mesa/program/prog_parameter.c22
-rw-r--r--mesalib/src/mesa/program/prog_parameter.h6
-rw-r--r--mesalib/src/mesa/program/prog_statevars.c7
-rw-r--r--mesalib/src/mesa/program/program.c10
-rw-r--r--mesalib/src/mesa/program/program.h18
-rw-r--r--mesalib/src/mesa/program/sampler.cpp17
-rw-r--r--mesalib/src/mesa/program/string_to_uint_map.cpp42
-rw-r--r--mesalib/src/mesa/sources.mak6
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c102
-rw-r--r--mesalib/src/mesa/state_tracker/st_extensions.c14
-rw-r--r--mesalib/src/mesa/state_tracker/st_gen_mipmap.c205
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp14
-rw-r--r--mesalib/src/mesa/swrast/s_aaline.c984
-rw-r--r--mesalib/src/mesa/swrast/s_aatriangle.c624
-rw-r--r--mesalib/src/mesa/swrast/s_blit.c2
-rw-r--r--mesalib/src/mesa/swrast/s_context.c11
-rw-r--r--mesalib/src/mesa/swrast/s_context.h12
-rw-r--r--mesalib/src/mesa/swrast/s_fragprog.c2
-rw-r--r--mesalib/src/mesa/swrast/s_logic.c438
-rw-r--r--mesalib/src/mesa/swrast/s_points.c1144
-rw-r--r--mesalib/src/mesa/swrast/s_span.c22
-rw-r--r--mesalib/src/mesa/swrast/s_stencil.c2
-rw-r--r--mesalib/src/mesa/swrast/s_texcombine.c22
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch.c2
-rw-r--r--mesalib/src/mesa/swrast/s_texfilter.c52
-rw-r--r--mesalib/src/mesa/swrast/s_texture.c7
-rw-r--r--mesalib/src/mesa/swrast/s_triangle.c8
-rw-r--r--mesalib/src/mesa/swrast/s_zoom.c866
-rw-r--r--mesalib/src/mesa/tnl/t_vb_program.c1146
-rw-r--r--mesalib/src/mesa/tnl/t_vertex_generic.c98
-rw-r--r--mesalib/src/mesa/vbo/vbo_attrib_tmp.h12
-rw-r--r--mesalib/src/mesa/vbo/vbo_context.h226
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec.h4
-rw-r--r--mesalib/src/mesa/vbo/vbo_rebase.c3
-rw-r--r--mesalib/src/mesa/vbo/vbo_save.h4
-rw-r--r--mkfontscale/list.c2
-rw-r--r--mkfontscale/list.h2
-rw-r--r--mkfontscale/mkfontscale.c4
-rw-r--r--pixman/test/scaling-helpers-test.c1
-rw-r--r--xorg-server/Xext/xcmisc.c5
-rw-r--r--xorg-server/Xi/exevents.c64
-rw-r--r--xorg-server/Xi/xiproperty.c5
-rw-r--r--xorg-server/Xi/xiquerydevice.c73
-rw-r--r--xorg-server/Xi/xiquerydevice.h1
-rw-r--r--xorg-server/Xi/xiwarppointer.c2
-rw-r--r--xorg-server/config/Makefile.am88
-rw-r--r--xorg-server/config/config-backends.h5
-rw-r--r--xorg-server/config/config.c5
-rw-r--r--xorg-server/config/udev.c4
-rw-r--r--xorg-server/config/wscons.c268
-rw-r--r--xorg-server/configure.ac37
-rw-r--r--xorg-server/dbe/dbe.c5
-rw-r--r--xorg-server/dix/devices.c12
-rw-r--r--xorg-server/dix/dixfonts.c30
-rw-r--r--xorg-server/dix/eventconvert.c22
-rw-r--r--xorg-server/dix/events.c92
-rw-r--r--xorg-server/dix/getevents.c618
-rw-r--r--xorg-server/dix/inpututils.c32
-rw-r--r--xorg-server/dix/ptrveloc.c259
-rw-r--r--xorg-server/doc/Xinput.xml26
-rw-r--r--xorg-server/doc/Xserver-spec.xml23
-rw-r--r--xorg-server/doc/dtrace/Xserver-DTrace.xml1156
-rw-r--r--xorg-server/fb/fbpict.c4
-rw-r--r--xorg-server/hw/kdrive/src/kinfo.c12
-rw-r--r--xorg-server/hw/xfree86/Makefile.am2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Config.c19
-rw-r--r--xorg-server/hw/xfree86/common/xf86Globals.c4
-rw-r--r--xorg-server/hw/xfree86/common/xf86Module.h2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Privstr.h3
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.c11
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.h2
-rw-r--r--xorg-server/hw/xfree86/doc/ddxDesign.xml10
-rw-r--r--xorg-server/hw/xfree86/man/xorg.conf.man12
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Crtc.c6475
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Crtc.h24
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Cursors.c88
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Rotate.c135
-rw-r--r--xorg-server/hw/xfree86/os-support/bsd/alpha_video.c1438
-rw-r--r--xorg-server/hw/xfree86/os-support/bsd/arm_video.c1332
-rw-r--r--xorg-server/hw/xfree86/os-support/bsd/bsd_bell.c4
-rw-r--r--xorg-server/hw/xfree86/os-support/bsd/bsd_init.c51
-rw-r--r--xorg-server/hw/xfree86/os-support/bsd/i386_video.c1816
-rw-r--r--xorg-server/hw/xfree86/os-support/bsd/ppc_video.c4
-rw-r--r--xorg-server/hw/xfree86/os-support/bsd/sparc64_video.c182
-rw-r--r--xorg-server/hw/xfree86/os-support/xf86_OSlib.h808
-rw-r--r--xorg-server/hw/xfree86/parser/xf86tokens.h2
-rw-r--r--xorg-server/hw/xquartz/X11Application.m2
-rw-r--r--xorg-server/hw/xquartz/pbproxy/Makefile.am1
-rw-r--r--xorg-server/include/dix-config.h.in9
-rw-r--r--xorg-server/include/eventstr.h11
-rw-r--r--xorg-server/include/exevents.h647
-rw-r--r--xorg-server/include/input.h6
-rw-r--r--xorg-server/include/inputstr.h23
-rw-r--r--xorg-server/include/inpututils.h2
-rw-r--r--xorg-server/include/misc.h6
-rw-r--r--xorg-server/include/protocol-versions.h2
-rw-r--r--xorg-server/include/ptrveloc.h32
-rw-r--r--xorg-server/include/xserver-properties.h2
-rw-r--r--xorg-server/render/render.c4
-rw-r--r--xorg-server/test/input.c78
-rw-r--r--xorg-server/test/xi2/protocol-common.c63
-rw-r--r--xorg-server/test/xi2/protocol-eventconvert.c40
-rw-r--r--xorg-server/test/xi2/protocol-xiquerydevice.c49
-rw-r--r--xorg-server/xkb/xkbAccessX.c1
-rw-r--r--xorg-server/xkeyboard-config/NEWS1
-rw-r--r--xorg-server/xkeyboard-config/configure.in2
-rw-r--r--xorg-server/xkeyboard-config/symbols/in12
-rw-r--r--xorg-server/xkeyboard-config/symbols/keypad1266
-rw-r--r--xorg-server/xkeyboard-config/symbols/srvr_ctrl8
-rw-r--r--xorg-server/xkeyboard-config/symbols/terminate14
232 files changed, 24367 insertions, 22715 deletions
diff --git a/X11/xtrans/Xtrans.c b/X11/xtrans/Xtrans.c
index 948e2831c..f90bd47e8 100644
--- a/X11/xtrans/Xtrans.c
+++ b/X11/xtrans/Xtrans.c
@@ -137,7 +137,7 @@ void
TRANS(FreeConnInfo) (XtransConnInfo ciptr)
{
- PRMSG (3,"FreeConnInfo(%p)\n", ciptr, 0, 0);
+ prmsg (3,"FreeConnInfo(%p)\n", ciptr);
if (ciptr->addr)
xfree (ciptr->addr);
@@ -155,13 +155,13 @@ TRANS(FreeConnInfo) (XtransConnInfo ciptr)
#define PROTOBUFSIZE 20
static Xtransport *
-TRANS(SelectTransport) (char *protocol)
+TRANS(SelectTransport) (const char *protocol)
{
char protobuf[PROTOBUFSIZE];
int i;
- PRMSG (3,"SelectTransport(%s)\n", protocol, 0, 0);
+ prmsg (3,"SelectTransport(%s)\n", protocol);
/*
* Force Protocol to be lowercase as a way of doing
@@ -208,11 +208,12 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
*/
char *mybuf, *tmpptr;
- char *_protocol, *_host, *_port;
+ const char *_protocol;
+ char *_host, *_port;
char hostnamebuf[256];
int _host_len;
- PRMSG (3,"ParseAddress(%s)\n", address, 0, 0);
+ prmsg (3,"ParseAddress(%s)\n", address);
/* Copy the string so it can be changed */
@@ -409,12 +410,12 @@ TRANS(Open) (int type, char *address)
XtransConnInfo ciptr = NULL;
Xtransport *thistrans;
- PRMSG (2,"Open(%d,%s)\n", type, address, 0);
+ prmsg (2,"Open(%d,%s)\n", type, address);
#if defined(WIN32) && defined(TCPCONN)
if (TRANS(WSAStartup)())
{
- PRMSG (1,"Open: WSAStartup failed\n", 0, 0, 0);
+ prmsg (1,"Open: WSAStartup failed\n");
return NULL;
}
#endif
@@ -423,7 +424,7 @@ TRANS(Open) (int type, char *address)
if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0)
{
- PRMSG (1,"Open: Unable to Parse address %s\n", address, 0, 0);
+ prmsg (1,"Open: Unable to Parse address %s\n", address);
return NULL;
}
@@ -431,8 +432,8 @@ TRANS(Open) (int type, char *address)
if ((thistrans = TRANS(SelectTransport) (protocol)) == NULL)
{
- PRMSG (1,"Open: Unable to find transport for %s\n",
- protocol, 0, 0);
+ prmsg (1,"Open: Unable to find transport for %s\n",
+ protocol);
xfree (protocol);
xfree (host);
@@ -465,14 +466,14 @@ TRANS(Open) (int type, char *address)
#endif /* TRANS_SERVER */
break;
default:
- PRMSG (1,"Open: Unknown Open type %d\n", type, 0, 0);
+ prmsg (1,"Open: Unknown Open type %d\n", type);
}
if (ciptr == NULL)
{
if (!(thistrans->flags & TRANS_DISABLED))
{
- PRMSG (1,"Open: transport open failed for %s/%s:%s\n",
+ prmsg (1,"Open: transport open failed for %s/%s:%s\n",
protocol, host, port);
}
xfree (protocol);
@@ -508,7 +509,7 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
char *save_port;
int i;
- PRMSG (2,"Reopen(%d,%d,%s)\n", trans_id, fd, port);
+ prmsg (2,"Reopen(%d,%d,%s)\n", trans_id, fd, port);
/* Determine the transport type */
@@ -521,15 +522,15 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
if (thistrans == NULL)
{
- PRMSG (1,"Reopen: Unable to find transport id %d\n",
- trans_id, 0, 0);
+ prmsg (1,"Reopen: Unable to find transport id %d\n",
+ trans_id);
return NULL;
}
if ((save_port = (char *) xalloc (strlen (port) + 1)) == NULL)
{
- PRMSG (1,"Reopen: Unable to malloc port string\n", 0, 0, 0);
+ prmsg (1,"Reopen: Unable to malloc port string\n");
return NULL;
}
@@ -547,12 +548,12 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
ciptr = thistrans->ReopenCLTSServer(thistrans, fd, port);
break;
default:
- PRMSG (1,"Reopen: Bad Open type %d\n", type, 0, 0);
+ prmsg (1,"Reopen: Bad Open type %d\n", type);
}
if (ciptr == NULL)
{
- PRMSG (1,"Reopen: transport open failed\n", 0, 0, 0);
+ prmsg (1,"Reopen: transport open failed\n");
return NULL;
}
@@ -578,7 +579,7 @@ XtransConnInfo
TRANS(OpenCOTSClient) (char *address)
{
- PRMSG (2,"OpenCOTSClient(%s)\n", address, 0, 0);
+ prmsg (2,"OpenCOTSClient(%s)\n", address);
return TRANS(Open) (XTRANS_OPEN_COTS_CLIENT, address);
}
@@ -591,7 +592,7 @@ XtransConnInfo
TRANS(OpenCOTSServer) (char *address)
{
- PRMSG (2,"OpenCOTSServer(%s)\n", address, 0, 0);
+ prmsg (2,"OpenCOTSServer(%s)\n", address);
return TRANS(Open) (XTRANS_OPEN_COTS_SERVER, address);
}
@@ -604,7 +605,7 @@ XtransConnInfo
TRANS(OpenCLTSClient) (char *address)
{
- PRMSG (2,"OpenCLTSClient(%s)\n", address, 0, 0);
+ prmsg (2,"OpenCLTSClient(%s)\n", address);
return TRANS(Open) (XTRANS_OPEN_CLTS_CLIENT, address);
}
@@ -617,7 +618,7 @@ XtransConnInfo
TRANS(OpenCLTSServer) (char *address)
{
- PRMSG (2,"OpenCLTSServer(%s)\n", address, 0, 0);
+ prmsg (2,"OpenCLTSServer(%s)\n", address);
return TRANS(Open) (XTRANS_OPEN_CLTS_SERVER, address);
}
@@ -630,7 +631,7 @@ XtransConnInfo
TRANS(ReopenCOTSServer) (int trans_id, int fd, char *port)
{
- PRMSG (2,"ReopenCOTSServer(%d, %d, %s)\n", trans_id, fd, port);
+ prmsg (2,"ReopenCOTSServer(%d, %d, %s)\n", trans_id, fd, port);
return TRANS(Reopen) (XTRANS_OPEN_COTS_SERVER, trans_id, fd, port);
}
@@ -638,7 +639,7 @@ XtransConnInfo
TRANS(ReopenCLTSServer) (int trans_id, int fd, char *port)
{
- PRMSG (2,"ReopenCLTSServer(%d, %d, %s)\n", trans_id, fd, port);
+ prmsg (2,"ReopenCLTSServer(%d, %d, %s)\n", trans_id, fd, port);
return TRANS(Reopen) (XTRANS_OPEN_CLTS_SERVER, trans_id, fd, port);
}
@@ -678,7 +679,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
int fd = ciptr->fd;
int ret = 0;
- PRMSG (2,"SetOption(%d,%d,%d)\n", fd, option, arg);
+ prmsg (2,"SetOption(%d,%d,%d)\n", fd, option, arg);
/*
* For now, all transport type use the same stuff for setting options.
@@ -764,7 +765,7 @@ TRANS(CreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
}
int
-TRANS(NoListen) (char * protocol)
+TRANS(NoListen) (const char * protocol)
{
Xtransport *trans;
@@ -772,8 +773,8 @@ TRANS(NoListen) (char * protocol)
if ((trans = TRANS(SelectTransport)(protocol)) == NULL)
{
- PRMSG (1,"TransNoListen: unable to find transport: %s\n",
- protocol, 0, 0);
+ prmsg (1,"TransNoListen: unable to find transport: %s\n",
+ protocol);
return -1;
}
@@ -806,7 +807,7 @@ TRANS(Accept) (XtransConnInfo ciptr, int *status)
{
XtransConnInfo newciptr;
- PRMSG (2,"Accept(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"Accept(%d)\n", ciptr->fd);
newciptr = ciptr->transptr->Accept (ciptr, status);
@@ -830,12 +831,12 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address)
char *port;
int ret;
- PRMSG (2,"Connect(%d,%s)\n", ciptr->fd, address, 0);
+ prmsg (2,"Connect(%d,%s)\n", ciptr->fd, address);
if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0)
{
- PRMSG (1,"Connect: Unable to Parse address %s\n",
- address, 0, 0);
+ prmsg (1,"Connect: Unable to Parse address %s\n",
+ address);
return -1;
}
@@ -845,8 +846,8 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address)
if (!port || !*port)
{
- PRMSG (1,"Connect: Missing port specification in %s\n",
- address, 0, 0);
+ prmsg (1,"Connect: Missing port specification in %s\n",
+ address);
if (protocol) xfree (protocol);
if (host) xfree (host);
return -1;
@@ -912,7 +913,7 @@ TRANS(Close) (XtransConnInfo ciptr)
{
int ret;
- PRMSG (2,"Close(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"Close(%d)\n", ciptr->fd);
ret = ciptr->transptr->Close (ciptr);
@@ -927,7 +928,7 @@ TRANS(CloseForCloning) (XtransConnInfo ciptr)
{
int ret;
- PRMSG (2,"CloseForCloning(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"CloseForCloning(%d)\n", ciptr->fd);
ret = ciptr->transptr->CloseForCloning (ciptr);
@@ -949,14 +950,14 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
Xtransaddr **addrp)
{
- PRMSG (2,"GetMyAddr(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"GetMyAddr(%d)\n", ciptr->fd);
*familyp = ciptr->family;
*addrlenp = ciptr->addrlen;
if ((*addrp = (Xtransaddr *) xalloc (ciptr->addrlen)) == NULL)
{
- PRMSG (1,"GetMyAddr: malloc failed\n", 0, 0, 0);
+ prmsg (1,"GetMyAddr: malloc failed\n");
return -1;
}
memcpy(*addrp, ciptr->addr, ciptr->addrlen);
@@ -969,14 +970,14 @@ TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
Xtransaddr **addrp)
{
- PRMSG (2,"GetPeerAddr(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"GetPeerAddr(%d)\n", ciptr->fd);
*familyp = ciptr->family;
*addrlenp = ciptr->peeraddrlen;
if ((*addrp = (Xtransaddr *) xalloc (ciptr->peeraddrlen)) == NULL)
{
- PRMSG (1,"GetPeerAddr: malloc failed\n", 0, 0, 0);
+ prmsg (1,"GetPeerAddr: malloc failed\n");
return -1;
}
memcpy(*addrp, ciptr->peeraddr, ciptr->peeraddrlen);
@@ -1045,8 +1046,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
#if defined(IPv6) && defined(AF_INET6)
int ipv6_succ = 0;
#endif
- PRMSG (2,"MakeAllCOTSServerListeners(%s,%p)\n",
- port ? port : "NULL", ciptrs_ret, 0);
+ prmsg (2,"MakeAllCOTSServerListeners(%s,%p)\n",
+ port ? port : "NULL", ciptrs_ret);
*count_ret = 0;
@@ -1072,17 +1073,17 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
snprintf(buffer, sizeof(buffer), "%s/:%s",
trans->TransName, port ? port : "");
- PRMSG (5,"MakeAllCOTSServerListeners: opening %s\n",
- buffer, 0, 0);
+ prmsg (5,"MakeAllCOTSServerListeners: opening %s\n",
+ buffer);
if ((ciptr = TRANS(OpenCOTSServer(buffer))) == NULL)
{
if (trans->flags & TRANS_DISABLED)
continue;
- PRMSG (1,
+ prmsg (1,
"MakeAllCOTSServerListeners: failed to open listener for %s\n",
- trans->TransName, 0, 0);
+ trans->TransName);
continue;
}
#if defined(IPv6) && defined(AF_INET6)
@@ -1101,9 +1102,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
* running at this address, and this function should fail.
*/
- PRMSG (1,
- "MakeAllCOTSServerListeners: server already running\n",
- 0, 0, 0);
+ prmsg (1,
+ "MakeAllCOTSServerListeners: server already running\n");
for (j = 0; j < *count_ret; j++)
TRANS(Close) (temp_ciptrs[j]);
@@ -1115,9 +1115,9 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
}
else
{
- PRMSG (1,
+ prmsg (1,
"MakeAllCOTSServerListeners: failed to create listener for %s\n",
- trans->TransName, 0, 0);
+ trans->TransName);
continue;
}
@@ -1128,9 +1128,9 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
ipv6_succ = 1;
#endif
- PRMSG (5,
+ prmsg (5,
"MakeAllCOTSServerListeners: opened listener for %s, %d\n",
- trans->TransName, ciptr->fd, 0);
+ trans->TransName, ciptr->fd);
temp_ciptrs[*count_ret] = ciptr;
(*count_ret)++;
@@ -1138,7 +1138,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
*partial = (*count_ret < complete_network_count());
- PRMSG (5,
+ prmsg (5,
"MakeAllCOTSServerListeners: partial=%d, actual=%d, complete=%d \n",
*partial, *count_ret, complete_network_count());
@@ -1170,8 +1170,8 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
XtransConnInfo ciptr, temp_ciptrs[NUMTRANS];
int status, i, j;
- PRMSG (2,"MakeAllCLTSServerListeners(%s,%p)\n",
- port ? port : "NULL", ciptrs_ret, 0);
+ prmsg (2,"MakeAllCLTSServerListeners(%s,%p)\n",
+ port ? port : "NULL", ciptrs_ret);
*count_ret = 0;
@@ -1185,14 +1185,14 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
snprintf(buffer, sizeof(buffer), "%s/:%s",
trans->TransName, port ? port : "");
- PRMSG (5,"MakeAllCLTSServerListeners: opening %s\n",
- buffer, 0, 0);
+ prmsg (5,"MakeAllCLTSServerListeners: opening %s\n",
+ buffer);
if ((ciptr = TRANS(OpenCLTSServer (buffer))) == NULL)
{
- PRMSG (1,
+ prmsg (1,
"MakeAllCLTSServerListeners: failed to open listener for %s\n",
- trans->TransName, 0, 0);
+ trans->TransName);
continue;
}
@@ -1206,9 +1206,8 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
* running at this address, and this function should fail.
*/
- PRMSG (1,
- "MakeAllCLTSServerListeners: server already running\n",
- 0, 0, 0);
+ prmsg (1,
+ "MakeAllCLTSServerListeners: server already running\n");
for (j = 0; j < *count_ret; j++)
TRANS(Close) (temp_ciptrs[j]);
@@ -1220,24 +1219,24 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
}
else
{
- PRMSG (1,
+ prmsg (1,
"MakeAllCLTSServerListeners: failed to create listener for %s\n",
- trans->TransName, 0, 0);
+ trans->TransName);
continue;
}
}
- PRMSG (5,
+ prmsg (5,
"MakeAllCLTSServerListeners: opened listener for %s, %d\n",
- trans->TransName, ciptr->fd, 0);
+ trans->TransName, ciptr->fd);
temp_ciptrs[*count_ret] = ciptr;
(*count_ret)++;
}
*partial = (*count_ret < complete_network_count());
- PRMSG (5,
+ prmsg (5,
"MakeAllCLTSServerListeners: partial=%d, actual=%d, complete=%d \n",
*partial, *count_ret, complete_network_count());
diff --git a/X11/xtrans/Xtrans.h b/X11/xtrans/Xtrans.h
index 6f8f909c8..2945b2aba 100644
--- a/X11/xtrans/Xtrans.h
+++ b/X11/xtrans/Xtrans.h
@@ -70,14 +70,14 @@ from The Open Group.
#ifdef X11_t
#define TRANS(func) _X11Trans##func
#ifdef XTRANSDEBUG
-static char* __xtransname = "_X11Trans";
+static const char *__xtransname = "_X11Trans";
#endif
#endif /* X11_t */
#ifdef XSERV_t
#define TRANS(func) _XSERVTrans##func
#ifdef XTRANSDEBUG
-static char* __xtransname = "_XSERVTrans";
+static const char *__xtransname = "_XSERVTrans";
#endif
#define X11_t
#endif /* XSERV_t */
@@ -85,35 +85,35 @@ static char* __xtransname = "_XSERVTrans";
#ifdef XIM_t
#define TRANS(func) _XimXTrans##func
#ifdef XTRANSDEBUG
-static char* __xtransname = "_XimTrans";
+static const char *__xtransname = "_XimTrans";
#endif
#endif /* XIM_t */
#ifdef FS_t
#define TRANS(func) _FSTrans##func
#ifdef XTRANSDEBUG
-static char* __xtransname = "_FSTrans";
+static const char *__xtransname = "_FSTrans";
#endif
#endif /* FS_t */
#ifdef FONT_t
#define TRANS(func) _FontTrans##func
#ifdef XTRANSDEBUG
-static char* __xtransname = "_FontTrans";
+static const char *__xtransname = "_FontTrans";
#endif
#endif /* FONT_t */
#ifdef ICE_t
#define TRANS(func) _IceTrans##func
#ifdef XTRANSDEBUG
-static char* __xtransname = "_IceTrans";
+static const char *__xtransname = "_IceTrans";
#endif
#endif /* ICE_t */
#ifdef TEST_t
#define TRANS(func) _TESTTrans##func
#ifdef XTRANSDEBUG
-static char* __xtransname = "_TESTTrans";
+static const char *__xtransname = "_TESTTrans";
#endif
#endif /* TEST_t */
@@ -121,14 +121,14 @@ static char* __xtransname = "_TESTTrans";
#define TRANS(func) _LBXPROXYTrans##func
#define X11_t /* The server defines this - so should the LBX proxy */
#ifdef XTRANSDEBUG
-static char* __xtransname = "_LBXPROXYTrans";
+static const char *__xtransname = "_LBXPROXYTrans";
#endif
#endif /* LBXPROXY_t */
#if !defined(TRANS)
#define TRANS(func) _XTrans##func
#ifdef XTRANSDEBUG
-static char* __xtransname = "_XTrans";
+static const char *__xtransname = "_XTrans";
#endif
#endif /* !TRANS */
@@ -304,7 +304,7 @@ int TRANS(CreateListener)(
);
int TRANS(NoListen) (
- char* /* protocol*/
+ const char* /* protocol*/
);
int TRANS(ResetListener)(
diff --git a/X11/xtrans/Xtransint.h b/X11/xtrans/Xtransint.h
index 787d72124..3bce8dc6b 100644
--- a/X11/xtrans/Xtransint.h
+++ b/X11/xtrans/Xtransint.h
@@ -68,7 +68,7 @@ from The Open Group.
* message.
*/
-#ifndef XTRANSDEBUG
+#if !defined(XTRANSDEBUG) && defined(XTRANS_TRANSPORT_C)
# define XTRANSDEBUG 1
#endif
@@ -78,6 +78,10 @@ from The Open Group.
#include "Xtrans.h"
+#ifndef _X_UNUSED /* Defined in Xfuncproto.h in xproto >= 7.0.22 */
+# define _X_UNUSED /* */
+#endif
+
#ifdef XTRANSDEBUG
# include <stdio.h>
#endif /* XTRANSDEBUG */
@@ -140,7 +144,7 @@ struct _XtransConnInfo {
typedef struct _Xtransport {
- char *TransName;
+ const char *TransName;
int flags;
#ifdef TRANS_CLIENT
@@ -155,7 +159,7 @@ typedef struct _Xtransport {
#endif /* TRANS_CLIENT */
#ifdef TRANS_SERVER
- char ** nolisten;
+ const char ** nolisten;
XtransConnInfo (*OpenCOTSServer)(
struct _Xtransport *, /* transport */
char *, /* protocol */
@@ -307,6 +311,9 @@ typedef struct _Xtransport_table {
/* Flags to preserve when setting others */
#define TRANS_KEEPFLAGS (TRANS_NOUNLINK|TRANS_ABSTRACT)
+#ifdef XTRANS_TRANSPORT_C /* only provide static function prototypes when
+ building the transport.c file that has them in */
+
#ifdef __clang__
/* Not all clients make use of all provided statics */
#pragma clang diagnostic push
@@ -371,54 +378,62 @@ static int trans_mkdir (
* Some XTRANSDEBUG stuff
*/
-#if defined(XTRANSDEBUG)
-/* add hack to the format string to avoid warnings about extra arguments
- * to fprintf.
+#ifdef XTRANSDEBUG
+#include <stdarg.h>
+
+/*
+ * The X server provides ErrorF() & VErrorF(), for other software that uses
+ * xtrans, we provide our own simple versions.
*/
-#ifdef XTRANSDEBUGTIMESTAMP
-#if defined(XSERV_t) && defined(TRANS_SERVER)
-/* Use ErrorF() for the X server */
-#define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \
- int hack= 0, saveerrno=errno; \
- struct timeval tp;\
- gettimeofday(&tp,0); \
- ErrorF("%s",__xtransname); \
- ErrorF(x+hack,a,b,c); \
- ErrorF("timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \
- errno=saveerrno; \
- } else ((void)0)
-#else
-#define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \
- int hack= 0, saveerrno=errno; \
- struct timeval tp;\
- gettimeofday(&tp,0); \
- fprintf(stderr, "%s", __xtransname); fflush(stderr); \
- fprintf(stderr, x+hack,a,b,c); fflush(stderr); \
- fprintf(stderr, "timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \
- fflush(stderr); \
- errno=saveerrno; \
- } else ((void)0)
-#endif /* XSERV_t && TRANS_SERVER */
-#else /* XTRANSDEBUGTIMESTAMP */
-#if defined(XSERV_t) && defined(TRANS_SERVER)
-/* Use ErrorF() for the X server */
-#define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \
- int hack= 0, saveerrno=errno; \
- ErrorF("%s",__xtransname); \
- ErrorF(x+hack,a,b,c); \
- errno=saveerrno; \
- } else ((void)0)
-#else
-#define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \
- int hack= 0, saveerrno=errno; \
- fprintf(stderr, "%s", __xtransname); fflush(stderr); \
- fprintf(stderr, x+hack,a,b,c); fflush(stderr); \
- errno=saveerrno; \
- } else ((void)0)
-#endif /* XSERV_t && TRANS_SERVER */
-#endif /* XTRANSDEBUGTIMESTAMP */
-#else
-#define PRMSG(lvl,x,a,b,c) ((void)0)
+# if defined(XSERV_t) && defined(TRANS_SERVER)
+# include "os.h"
+# else
+static inline void _X_ATTRIBUTE_PRINTF(1, 0)
+VErrorF(const char *f, va_list args)
+{
+ vfprintf(stderr, f, args);
+ fflush(stderr);
+}
+
+static inline void _X_ATTRIBUTE_PRINTF(1, 2)
+ErrorF(const char *f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+ VErrorF(f, args);
+ va_end(args);
+}
+# endif /* xserver */
#endif /* XTRANSDEBUG */
+static inline void _X_ATTRIBUTE_PRINTF(2, 3)
+prmsg(int lvl, const char *f, ...)
+{
+#ifdef XTRANSDEBUG
+ va_list args;
+
+ va_start(args, f);
+ if (lvl <= XTRANSDEBUG) {
+ int saveerrno = errno;
+
+ ErrorF("%s", __xtransname);
+ VErrorF(f, args);
+
+# ifdef XTRANSDEBUGTIMESTAMP
+ {
+ struct timeval tp;
+ gettimeofday(&tp, 0);
+ ErrorF("timestamp (ms): %d\n",
+ tp.tv_sec * 1000 + tp.tv_usec / 1000);
+ }
+# endif
+ errno = saveerrno;
+ }
+ va_end(args);
+#endif /* XTRANSDEBUG */
+}
+
+#endif /* XTRANS_TRANSPORT_C */
+
#endif /* _XTRANSINT_H_ */
diff --git a/X11/xtrans/Xtranslcl.c b/X11/xtrans/Xtranslcl.c
index a4f3b1062..ddc5a3e81 100644
--- a/X11/xtrans/Xtranslcl.c
+++ b/X11/xtrans/Xtranslcl.c
@@ -129,7 +129,7 @@ static int TRANS(LocalClose)(XtransConnInfo ciptr);
/* Type Not Supported */
static int
-TRANS(OpenFail)(XtransConnInfo ciptr, char *port)
+TRANS(OpenFail)(XtransConnInfo ciptr _X_UNUSED, char *port _X_UNUSED)
{
return -1;
@@ -138,7 +138,7 @@ TRANS(OpenFail)(XtransConnInfo ciptr, char *port)
#ifdef TRANS_REOPEN
static int
-TRANS(ReopenFail)(XtransConnInfo ciptr, int fd, char *port)
+TRANS(ReopenFail)(XtransConnInfo ciptr _X_UNUSED, int fd _X_UNUSED, char *port _X_UNUSED)
{
return 0;
@@ -160,14 +160,14 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
if ((sunaddr = (struct sockaddr_un *) xalloc (ciptr->addrlen)) == NULL)
{
- PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n", 0, 0, 0);
+ prmsg(1,"FillAddrInfo: failed to allocate memory for addr\n");
return 0;
}
sunaddr->sun_family = AF_UNIX;
if (strlen(sun_path) > sizeof(sunaddr->sun_path) - 1) {
- PRMSG(1, "FillAddrInfo: path too long\n", 0, 0, 0);
+ prmsg(1, "FillAddrInfo: path too long\n");
xfree((char *) sunaddr);
return 0;
}
@@ -183,9 +183,8 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
if ((p_sunaddr = (struct sockaddr_un *) xalloc (
ciptr->peeraddrlen)) == NULL)
{
- PRMSG(1,
- "FillAddrInfo: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "FillAddrInfo: failed to allocate memory for peer addr\n");
xfree ((char *) sunaddr);
ciptr->addr = NULL;
@@ -195,7 +194,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
p_sunaddr->sun_family = AF_UNIX;
if (strlen(peer_sun_path) > sizeof(p_sunaddr->sun_path) - 1) {
- PRMSG(1, "FillAddrInfo: peer path too long\n", 0, 0, 0);
+ prmsg(1, "FillAddrInfo: peer path too long\n");
xfree((char *) p_sunaddr);
return 0;
}
@@ -228,7 +227,7 @@ extern char *ptsname(
int
);
-static void _dummy(int sig)
+static void _dummy(int sig _X_UNUSED)
{
}
@@ -321,20 +320,22 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
pid_t saved_pid;
#endif
- PRMSG(2,"PTSOpenClient(%s)\n", port, 0,0 );
+ prmsg(2,"PTSOpenClient(%s)\n", port);
#if !defined(PTSNODENAME)
- PRMSG(1,"PTSOpenClient: Protocol is not supported by a pts connection\n", 0,0,0);
+ prmsg(1,"PTSOpenClient: Protocol is not supported by a pts connection\n");
return -1;
#else
if (port && *port ) {
if( *port == '/' ) { /* A full pathname */
- (void) sprintf(server_path, "%s", port);
- } else {
- (void) sprintf(server_path, "%s%s", PTSNODENAME, port);
- }
+ snprintf(server_path, sizeof(server_path), "%s", port);
+ } else {
+ snprintf(server_path, sizeof(server_path), "%s%s",
+ PTSNODENAME, port);
+ }
} else {
- (void) sprintf(server_path, "%s%d", PTSNODENAME, getpid());
+ snprintf(server_path, sizeof(server_path), "%s%d",
+ PTSNODENAME, getpid());
}
@@ -343,7 +344,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
*/
if ((server = open (server_path, O_RDWR)) < 0) {
- PRMSG(1,"PTSOpenClient: failed to open %s\n", server_path, 0,0);
+ prmsg(1,"PTSOpenClient: failed to open %s\n", server_path);
return -1;
}
@@ -353,7 +354,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
*/
if ((fd = open(DEV_PTMX, O_RDWR)) < 0) {
- PRMSG(1,"PTSOpenClient: failed to open %s\n", DEV_PTMX, 0,0);
+ prmsg(1,"PTSOpenClient: failed to open %s\n", DEV_PTMX);
close(server);
return(-1);
}
@@ -364,7 +365,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
slave = ptsname(fd); /* get name */
if( slave == NULL ) {
- PRMSG(1,"PTSOpenClient: failed to get ptsname()\n", 0,0,0);
+ prmsg(1,"PTSOpenClient: failed to get ptsname()\n");
close(fd);
close(server);
return -1;
@@ -397,14 +398,14 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
if (WIFEXITED(exitval) && WEXITSTATUS(exitval) != 0) {
close(fd);
close(server);
- PRMSG(1, "PTSOpenClient: cannot set the owner of %s\n",
- slave, 0, 0);
+ prmsg(1, "PTSOpenClient: cannot set the owner of %s\n",
+ slave);
return(-1);
}
if (chmod(slave, 0666) < 0) {
close(fd);
close(server);
- PRMSG(1,"PTSOpenClient: Cannot chmod %s\n", slave, 0,0);
+ prmsg(1,"PTSOpenClient: Cannot chmod %s\n", slave);
return(-1);
}
@@ -431,8 +432,8 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
(void) signal(SIGALRM, savef);
if (ret != 1) {
- PRMSG(1,
- "PTSOpenClient: failed to get acknoledgement from server\n", 0, 0, 0);
+ prmsg(1,
+ "PTSOpenClient: failed to get acknoledgement from server\n");
(void) close(fd);
fd = -1;
}
@@ -443,7 +444,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, slave, server_path) == 0)
{
- PRMSG(1,"PTSOpenClient: failed to fill in addr info\n", 0, 0, 0);
+ prmsg(1,"PTSOpenClient: failed to fill in addr info\n");
close(fd);
return -1;
}
@@ -468,10 +469,10 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
int mode;
#endif
- PRMSG(2,"PTSOpenServer(%s)\n", port, 0,0 );
+ prmsg(2,"PTSOpenServer(%s)\n", port);
#if !defined(PTSNODENAME)
- PRMSG(1,"PTSOpenServer: Protocol is not supported by a pts connection\n", 0,0,0);
+ prmsg(1,"PTSOpenServer: Protocol is not supported by a pts connection\n");
return -1;
#else
if (port && *port ) {
@@ -490,8 +491,8 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
mode = 0777;
#endif
if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
- PRMSG (1, "PTSOpenServer: mkdir(%s) failed, errno = %d\n",
- X_STREAMS_DIR, errno, 0);
+ prmsg (1, "PTSOpenServer: mkdir(%s) failed, errno = %d\n",
+ X_STREAMS_DIR, errno);
return(-1);
}
@@ -502,8 +503,8 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
* prevent clients from trying to connect to the in-use PTS (which
* is often in use by something other than another server).
*/
- PRMSG(1, "PTSOpenServer: A server is already running on port %s\n", port, 0,0 );
- PRMSG(1, "PTSOpenServer: Remove %s if this is incorrect.\n", server_path, 0,0 );
+ prmsg(1, "PTSOpenServer: A server is already running on port %s\n", port);
+ prmsg(1, "PTSOpenServer: Remove %s if this is incorrect.\n", server_path);
close(fd);
return(-1);
}
@@ -514,7 +515,7 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
unlink(server_path);
if( (fd=open(DEV_PTMX, O_RDWR)) < 0) {
- PRMSG(1, "PTSOpenServer: Unable to open %s\n", DEV_PTMX, 0,0 );
+ prmsg(1, "PTSOpenServer: Unable to open %s\n", DEV_PTMX);
return(-1);
}
@@ -522,25 +523,25 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
unlockpt(fd);
if( (slave=ptsname(fd)) == NULL) {
- PRMSG(1, "PTSOpenServer: Unable to get slave device name\n", 0,0,0 );
+ prmsg(1, "PTSOpenServer: Unable to get slave device name\n");
close(fd);
return(-1);
}
if( link(slave,server_path) < 0 ) {
- PRMSG(1, "PTSOpenServer: Unable to link %s to %s\n", slave, server_path,0 );
+ prmsg(1, "PTSOpenServer: Unable to link %s to %s\n", slave, server_path);
close(fd);
return(-1);
}
if( chmod(server_path, 0666) < 0 ) {
- PRMSG(1, "PTSOpenServer: Unable to chmod %s to 0666\n", server_path,0,0 );
+ prmsg(1, "PTSOpenServer: Unable to chmod %s to 0666\n", server_path);
close(fd);
return(-1);
}
if( (server=open(server_path, O_RDWR)) < 0 ) {
- PRMSG(1, "PTSOpenServer: Unable to open server device %s\n", server_path,0,0 );
+ prmsg(1, "PTSOpenServer: Unable to open server device %s\n", server_path);
close(fd);
return(-1);
}
@@ -553,7 +554,7 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"PTSOpenServer: failed to fill in addr info\n", 0, 0, 0);
+ prmsg(1,"PTSOpenServer: failed to fill in addr info\n");
close(fd);
return -1;
}
@@ -573,17 +574,17 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
char buf[256];
struct sockaddr_un *sunaddr;
- PRMSG(2,"PTSAccept(%x->%d)\n",ciptr,ciptr->fd,0);
+ prmsg(2,"PTSAccept(%x->%d)\n",ciptr,ciptr->fd);
if( (in=read(ciptr->fd,&length,1)) <= 0 ){
if( !in ) {
- PRMSG(2,
- "PTSAccept: Incoming connection closed\n",0,0,0);
+ prmsg(2,
+ "PTSAccept: Incoming connection closed\n");
}
else {
- PRMSG(1,
+ prmsg(1,
"PTSAccept: Error reading incoming connection. errno=%d \n",
- errno,0,0);
+ errno);
}
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
@@ -591,13 +592,13 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
if( (in=read(ciptr->fd,buf,length)) <= 0 ){
if( !in ) {
- PRMSG(2,
- "PTSAccept: Incoming connection closed\n",0,0,0);
+ prmsg(2,
+ "PTSAccept: Incoming connection closed\n");
}
else {
- PRMSG(1,
+ prmsg(1,
"PTSAccept: Error reading device name for new connection. errno=%d \n",
- errno,0,0);
+ errno);
}
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
@@ -606,7 +607,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
buf[length] = '\0';
if( (newfd=open(buf,O_RDWR)) < 0 ) {
- PRMSG(1, "PTSAccept: Failed to open %s\n",buf,0,0);
+ prmsg(1, "PTSAccept: Failed to open %s\n",buf);
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
}
@@ -619,8 +620,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
- PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n");
close(newfd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -630,8 +630,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=sizeof(struct sockaddr_un);
if( (sunaddr=(struct sockaddr_un *)xalloc(newciptr->peeraddrlen)) == NULL ) {
- PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n");
xfree(newciptr->addr);
close(newfd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -674,10 +673,10 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
# endif
#endif
- PRMSG(2,"NAMEDOpenClient(%s)\n", port, 0,0 );
+ prmsg(2,"NAMEDOpenClient(%s)\n", port);
#if !defined(NAMEDNODENAME)
- PRMSG(1,"NAMEDOpenClient: Protocol is not supported by a NAMED connection\n", 0,0,0);
+ prmsg(1,"NAMEDOpenClient: Protocol is not supported by a NAMED connection\n");
return -1;
#else
if ( port && *port ) {
@@ -691,18 +690,18 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
}
if ((fd = open(server_path, O_RDWR)) < 0) {
- PRMSG(1,"NAMEDOpenClient: Cannot open %s for NAMED connection\n", server_path, 0,0 );
+ prmsg(1,"NAMEDOpenClient: Cannot open %s for NAMED connection\n", server_path);
return -1;
}
if (fstat(fd, &filestat) < 0 ) {
- PRMSG(1,"NAMEDOpenClient: Cannot stat %s for NAMED connection\n", server_path, 0,0 );
+ prmsg(1,"NAMEDOpenClient: Cannot stat %s for NAMED connection\n", server_path);
(void) close(fd);
return -1;
}
if ((filestat.st_mode & S_IFMT) != S_IFIFO) {
- PRMSG(1,"NAMEDOpenClient: Device %s is not a FIFO\n", server_path, 0,0 );
+ prmsg(1,"NAMEDOpenClient: Device %s is not a FIFO\n", server_path);
/* Is this really a failure? */
(void) close(fd);
return -1;
@@ -710,7 +709,7 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
if (isastream(fd) <= 0) {
- PRMSG(1,"NAMEDOpenClient: %s is not a streams device\n", server_path, 0,0 );
+ prmsg(1,"NAMEDOpenClient: %s is not a streams device\n", server_path);
(void) close(fd);
return -1;
}
@@ -721,8 +720,7 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"NAMEDOpenClient: failed to fill in addr info\n",
- 0,0,0);
+ prmsg(1,"NAMEDOpenClient: failed to fill in addr info\n");
close(fd);
return -1;
}
@@ -742,54 +740,54 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
static int
TRANS(NAMEDOpenPipe)(const char *server_path)
{
- PRMSG(2,"NAMEDOpenPipe(%s)\n", server_path, 0,0 );
-
int fd, pipefd[2];
struct stat sbuf;
int mode;
+ prmsg(2,"NAMEDOpenPipe(%s)\n", server_path);
+
#ifdef HAS_STICKY_DIR_BIT
mode = 01777;
#else
mode = 0777;
#endif
if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
- PRMSG (1, "NAMEDOpenPipe: mkdir(%s) failed, errno = %d\n",
- X_STREAMS_DIR, errno, 0);
+ prmsg (1, "NAMEDOpenPipe: mkdir(%s) failed, errno = %d\n",
+ X_STREAMS_DIR, errno);
return(-1);
}
if(stat(server_path, &sbuf) != 0) {
if (errno == ENOENT) {
if ((fd = creat(server_path, (mode_t)0666)) == -1) {
- PRMSG(1, "NAMEDOpenPipe: Can't open %s\n", server_path, 0,0 );
+ prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
return(-1);
}
close(fd);
if (chmod(server_path, (mode_t)0666) < 0) {
- PRMSG(1, "NAMEDOpenPipe: Can't open %s\n", server_path, 0,0 );
+ prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
return(-1);
}
} else {
- PRMSG(1, "NAMEDOpenPipe: stat on %s failed\n", server_path, 0,0 );
+ prmsg(1, "NAMEDOpenPipe: stat on %s failed\n", server_path);
return(-1);
}
}
if( pipe(pipefd) != 0) {
- PRMSG(1, "NAMEDOpenPipe: pipe() failed, errno=%d\n",errno, 0,0 );
+ prmsg(1, "NAMEDOpenPipe: pipe() failed, errno=%d\n",errno);
return(-1);
}
if( ioctl(pipefd[0], I_PUSH, "connld") != 0) {
- PRMSG(1, "NAMEDOpenPipe: ioctl(I_PUSH,\"connld\") failed, errno=%d\n",errno, 0,0 );
+ prmsg(1, "NAMEDOpenPipe: ioctl(I_PUSH,\"connld\") failed, errno=%d\n",errno);
close(pipefd[0]);
close(pipefd[1]);
return(-1);
}
if( fattach(pipefd[0], server_path) != 0) {
- PRMSG(1, "NAMEDOpenPipe: fattach(%s) failed, errno=%d\n", server_path,errno, 0 );
+ prmsg(1, "NAMEDOpenPipe: fattach(%s) failed, errno=%d\n", server_path,errno);
close(pipefd[0]);
close(pipefd[1]);
return(-1);
@@ -807,10 +805,10 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
char server_path[64];
#endif
- PRMSG(2,"NAMEDOpenServer(%s)\n", port, 0,0 );
+ prmsg(2,"NAMEDOpenServer(%s)\n", port);
#if !defined(NAMEDNODENAME)
- PRMSG(1,"NAMEDOpenServer: Protocol is not supported by a NAMED connection\n", 0,0,0);
+ prmsg(1,"NAMEDOpenServer: Protocol is not supported by a NAMED connection\n");
return -1;
#else
if ( port && *port ) {
@@ -836,7 +834,7 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"NAMEDOpenServer: failed to fill in addr info\n", 0,0,0);
+ prmsg(1,"NAMEDOpenServer: failed to fill in addr info\n");
TRANS(LocalClose)(ciptr);
return -1;
}
@@ -850,11 +848,10 @@ static int
TRANS(NAMEDResetListener) (XtransConnInfo ciptr)
{
- int status = TRANS_RESET_NOOP;
struct sockaddr_un *sockname=(struct sockaddr_un *) ciptr->addr;
struct stat statb;
- PRMSG(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd, 0 );
+ prmsg(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd);
if (ciptr->fd != -1) {
/*
@@ -863,7 +860,7 @@ TRANS(NAMEDResetListener) (XtransConnInfo ciptr)
if (stat (sockname->sun_path, &statb) == -1 ||
(statb.st_mode & S_IFMT) != S_IFIFO) {
- PRMSG(3, "Pipe %s trashed, recreating\n", sockname->sun_path, 0, 0);
+ prmsg(3, "Pipe %s trashed, recreating\n", sockname->sun_path);
TRANS(LocalClose)(ciptr);
ciptr->fd = TRANS(NAMEDOpenPipe)(sockname->sun_path);
if (ciptr->fd >= 0)
@@ -881,10 +878,10 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
{
struct strrecvfd str;
- PRMSG(2,"NAMEDAccept(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ prmsg(2,"NAMEDAccept(%p->%d)\n", ciptr, ciptr->fd);
if( ioctl(ciptr->fd, I_RECVFD, &str ) < 0 ) {
- PRMSG(1, "NAMEDAccept: ioctl(I_RECVFD) failed, errno=%d\n", errno, 0,0 );
+ prmsg(1, "NAMEDAccept: ioctl(I_RECVFD) failed, errno=%d\n", errno);
*status = TRANS_ACCEPT_MISC_ERROR;
return(-1);
}
@@ -895,9 +892,8 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->family=ciptr->family;
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
- PRMSG(1,
- "NAMEDAccept: failed to allocate memory for pipe addr\n",
- 0,0,0);
+ prmsg(1,
+ "NAMEDAccept: failed to allocate memory for pipe addr\n");
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -907,9 +903,8 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) {
- PRMSG(1,
- "NAMEDAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "NAMEDAccept: failed to allocate memory for peer addr\n");
xfree(newciptr->addr);
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -1021,23 +1016,23 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
extern int getmsg(), putmsg();
#endif
- PRMSG(2,"SCOOpenClient(%s)\n", port, 0,0 );
+ prmsg(2,"SCOOpenClient(%s)\n", port);
if (!port || !port[0])
port = "0";
#if !defined(SCORNODENAME)
- PRMSG(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n", 0,0,0);
+ prmsg(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n");
return -1;
#else
(void) sprintf(server_path, SCORNODENAME, port);
if ((server = open(server_path, O_RDWR)) < 0) {
- PRMSG(1,"SCOOpenClient: failed to open %s\n", server_path, 0,0 );
+ prmsg(1,"SCOOpenClient: failed to open %s\n", server_path);
return -1;
}
if ((fd = open(DEV_SPX, O_RDWR)) < 0) {
- PRMSG(1,"SCOOpenClient: failed to open %s\n", DEV_SPX, 0,0 );
+ prmsg(1,"SCOOpenClient: failed to open %s\n", DEV_SPX);
close(server);
return -1;
}
@@ -1057,7 +1052,7 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
(void) signal(SIGALRM, savef);
if (ret < 0) {
- PRMSG(1,"SCOOpenClient: error from getmsg\n", 0,0,0 );
+ prmsg(1,"SCOOpenClient: error from getmsg\n");
close(fd);
close(server);
return -1;
@@ -1081,7 +1076,7 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
#endif
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"SCOOpenClient: failed to fill addr info\n", 0, 0, 0);
+ prmsg(1,"SCOOpenClient: failed to fill addr info\n");
close(fd);
return -1;
}
@@ -1107,12 +1102,12 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
int fds = -1;
#endif
- PRMSG(2,"SCOOpenServer(%s)\n", port, 0,0 );
+ prmsg(2,"SCOOpenServer(%s)\n", port);
if (!port || !port[0])
port = "0";
#if !defined(SCORNODENAME)
- PRMSG(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
+ prmsg(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n");
return -1;
#else
(void) sprintf(serverR_path, SCORNODENAME, port);
@@ -1124,7 +1119,7 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
if ((fds = open(DEV_SPX, O_RDWR)) < 0 ||
(fdr = open(DEV_SPX, O_RDWR)) < 0 ) {
- PRMSG(1,"SCOOpenServer: failed to open %s\n", DEV_SPX, 0,0 );
+ prmsg(1,"SCOOpenServer: failed to open %s\n", DEV_SPX);
if (fds >= 0)
close(fds);
if (fdr >= 0)
@@ -1133,14 +1128,14 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
}
if (named_spipe (fds, serverS_path) == -1) {
- PRMSG(1,"SCOOpenServer: failed to create %s\n", serverS_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to create %s\n", serverS_path);
close (fdr);
close (fds);
return -1;
}
if (named_spipe (fdr, serverR_path) == -1) {
- PRMSG(1,"SCOOpenServer: failed to create %s\n", serverR_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to create %s\n", serverR_path);
close (fdr);
close (fds);
return -1;
@@ -1149,7 +1144,7 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
fds = open (serverS_path, O_RDWR | O_NDELAY);
if (fds < 0) {
- PRMSG(1,"SCOOpenServer: failed to open %s\n", serverS_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to open %s\n", serverS_path);
return -1;
}
@@ -1162,22 +1157,22 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
mylock.l_start = 0;
mylock.l_len = 0;
if (fcntl (fds, F_SETLK, &mylock) < 0) {
- PRMSG(1,"SCOOpenServer: failed to lock %s\n", serverS_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to lock %s\n", serverS_path);
close (fds);
return -1;
}
fdr = open (serverR_path, O_RDWR | O_NDELAY);
if (fdr < 0) {
- PRMSG(1,"SCOOpenServer: failed to open %s\n", serverR_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to open %s\n", serverR_path);
close (fds);
return -1;
}
#endif /* X11_t */
if (connect_spipe(fds, fdr)) {
- PRMSG(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n",
- serverS_path, 0, 0);
+ prmsg(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n",
+ serverS_path);
close (fdr);
close (fds);
return -1;
@@ -1191,7 +1186,7 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
ciptr->flags |= TRANS_NOUNLINK;
#endif
if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0) {
- PRMSG(1,"SCOOpenServer: failed to fill in addr info\n", 0,0,0);
+ prmsg(1,"SCOOpenServer: failed to fill in addr info\n");
close(fds);
close(fdr);
return -1;
@@ -1208,22 +1203,22 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
char c;
int fd;
- PRMSG(2,"SCOAccept(%d)\n", ciptr->fd, 0,0 );
+ prmsg(2,"SCOAccept(%d)\n", ciptr->fd);
if (read(ciptr->fd, &c, 1) < 0) {
- PRMSG(1,"SCOAccept: can't read from client\n",0,0,0);
+ prmsg(1,"SCOAccept: can't read from client\n");
*status = TRANS_ACCEPT_MISC_ERROR;
return(-1);
}
if( (fd = open(DEV_SPX, O_RDWR)) < 0 ) {
- PRMSG(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX, 0,0 );
+ prmsg(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX);
*status = TRANS_ACCEPT_MISC_ERROR;
return(-1);
}
if (connect_spipe (ciptr->fd, fd) < 0) {
- PRMSG(1,"SCOAccept: ioctl(I_FDINSERT) failed\n", 0, 0, 0);
+ prmsg(1,"SCOAccept: ioctl(I_FDINSERT) failed\n");
close (fd);
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
@@ -1235,9 +1230,8 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
- PRMSG(1,
- "SCOAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "SCOAccept: failed to allocate memory for peer addr\n");
close(fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -1250,9 +1244,8 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) {
- PRMSG(1,
- "SCOAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "SCOAccept: failed to allocate memory for peer addr\n");
xfree(newciptr->addr);
close(fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -1282,26 +1275,27 @@ TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, char *port)
char server_path[64];
#endif
- PRMSG(2,"PTSReopenServer(%d,%s)\n", fd, port, 0 );
+ prmsg(2,"PTSReopenServer(%d,%s)\n", fd, port);
#if !defined(PTSNODENAME)
- PRMSG(1,"PTSReopenServer: Protocol is not supported by a pts connection\n", 0,0,0);
+ prmsg(1,"PTSReopenServer: Protocol is not supported by a pts connection\n");
return 0;
#else
if (port && *port ) {
if( *port == '/' ) { /* A full pathname */
- (void) sprintf(server_path, "%s", port);
- } else {
- (void) sprintf(server_path, "%s%s", PTSNODENAME, port);
- }
+ snprintf(server_path, sizeof(server_path), "%s", port);
+ } else {
+ snprintf(server_path, sizeof(server_path), "%s%s",
+ PTSNODENAME, port);
+ }
} else {
- (void) sprintf(server_path, "%s%ld", PTSNODENAME, (long)getpid());
+ snprintf(server_path, sizeof(server_path), "%s%ld",
+ PTSNODENAME, (long)getpid());
}
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"PTSReopenServer: failed to fill in addr info\n",
- 0,0,0);
+ prmsg(1,"PTSReopenServer: failed to fill in addr info\n");
return 0;
}
@@ -1315,33 +1309,34 @@ TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, char *port)
#ifdef LOCAL_TRANS_NAMED
static int
-TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd, char *port)
+TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, char *port)
{
#ifdef NAMEDNODENAME
char server_path[64];
#endif
- PRMSG(2,"NAMEDReopenServer(%s)\n", port, 0,0 );
+ prmsg(2,"NAMEDReopenServer(%s)\n", port);
#if !defined(NAMEDNODENAME)
- PRMSG(1,"NAMEDReopenServer: Protocol is not supported by a NAMED connection\n", 0,0,0);
+ prmsg(1,"NAMEDReopenServer: Protocol is not supported by a NAMED connection\n");
return 0;
#else
if ( port && *port ) {
if( *port == '/' ) { /* A full pathname */
- (void) sprintf(server_path, "%s", port);
+ snprintf(server_path, sizeof(server_path),"%s", port);
} else {
- (void) sprintf(server_path, "%s%s", NAMEDNODENAME, port);
+ snprintf(server_path, sizeof(server_path), "%s%s",
+ NAMEDNODENAME, port);
}
} else {
- (void) sprintf(server_path, "%s%ld", NAMEDNODENAME, (long)getpid());
+ snprintf(server_path, sizeof(server_path), "%s%ld",
+ NAMEDNODENAME, (long)getpid());
}
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"NAMEDReopenServer: failed to fill in addr info\n",
- 0,0,0);
+ prmsg(1,"NAMEDReopenServer: failed to fill in addr info\n");
return 0;
}
@@ -1362,12 +1357,12 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
char serverR_path[64], serverS_path[64];
#endif
- PRMSG(2,"SCOReopenServer(%s)\n", port, 0,0 );
+ prmsg(2,"SCOReopenServer(%s)\n", port);
if (!port || !port[0])
port = "0";
#if !defined(SCORNODENAME)
- PRMSG(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
+ prmsg(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n");
return 0;
#else
(void) sprintf(serverR_path, SCORNODENAME, port);
@@ -1378,7 +1373,7 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
#endif
if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0)
{
- PRMSG(1, "SCOReopenServer: failed to fill in addr info\n", 0,0,0);
+ prmsg(1, "SCOReopenServer: failed to fill in addr info\n");
return 0;
}
@@ -1399,7 +1394,7 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
*/
typedef struct _LOCALtrans2dev {
- char *transname;
+ const char *transname;
#ifdef TRANS_CLIENT
@@ -1660,7 +1655,7 @@ static LOCALtrans2dev LOCALtrans2devtab[] = {
#define NUMTRANSPORTS (sizeof(LOCALtrans2devtab)/sizeof(LOCALtrans2dev))
-static char *XLOCAL=NULL;
+static const char *XLOCAL=NULL;
static char *workingXLOCAL=NULL;
static char *freeXLOCAL=NULL;
@@ -1675,10 +1670,10 @@ static char *freeXLOCAL=NULL;
#endif
static void
-TRANS(LocalInitTransports)(char *protocol)
+TRANS(LocalInitTransports)(const char *protocol)
{
- PRMSG(3,"LocalInitTransports(%s)\n", protocol, 0,0 );
+ prmsg(3,"LocalInitTransports(%s)\n", protocol);
if( strcmp(protocol,"local") && strcmp(protocol,"LOCAL") )
{
@@ -1700,7 +1695,7 @@ static void
TRANS(LocalEndTransports)(void)
{
- PRMSG(3,"LocalEndTransports()\n", 0,0,0 );
+ prmsg(3,"LocalEndTransports()\n");
xfree(freeXLOCAL);
}
@@ -1715,7 +1710,7 @@ TRANS(LocalGetNextTransport)(void)
int i,j;
char *typetocheck;
char typebuf[TYPEBUFSIZE];
- PRMSG(3,"LocalGetNextTransport()\n", 0,0,0 );
+ prmsg(3,"LocalGetNextTransport()\n");
while(1)
{
@@ -1795,7 +1790,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
XtransConnInfo ciptr;
int index;
- PRMSG(3,"LocalOpenClient()\n", 0,0,0 );
+ prmsg(3,"LocalOpenClient()\n");
/*
* Make sure 'host' is really local. If not, we return failure.
@@ -1807,9 +1802,9 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
if (strcmp (host, "unix") != 0 && !HostReallyLocal (host))
{
- PRMSG (1,
+ prmsg (1,
"LocalOpenClient: Cannot connect to non-local host %s\n",
- host, 0, 0);
+ host);
return NULL;
}
@@ -1828,8 +1823,8 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1,"LocalOpenClient: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ prmsg(1,"LocalOpenClient: calloc(1,%lu) failed\n",
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -1851,14 +1846,13 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
break;
case XTRANS_OPEN_COTS_SERVER:
case XTRANS_OPEN_CLTS_SERVER:
- PRMSG(1,
- "LocalOpenClient: Should not be opening a server with this function\n",
- 0,0,0);
+ prmsg(1,
+ "LocalOpenClient: Should not be opening a server with this function\n");
break;
default:
- PRMSG(1,
+ prmsg(1,
"LocalOpenClient: Unknown Open type %d\n",
- type, 0,0 );
+ type);
}
if( ciptr->fd >= 0 )
break;
@@ -1884,13 +1878,13 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
+TRANS(LocalOpenServer)(int type, char *protocol, char *host _X_UNUSED, char *port)
{
int i;
XtransConnInfo ciptr;
- PRMSG(2,"LocalOpenServer(%d,%s,%s)\n", type, protocol, port);
+ prmsg(2,"LocalOpenServer(%d,%s,%s)\n", type, protocol, port);
#if defined(X11_t)
/*
@@ -1903,8 +1897,8 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1,"LocalOpenServer: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ prmsg(1,"LocalOpenServer: calloc(1,%lu) failed\n",
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -1916,9 +1910,8 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
{
case XTRANS_OPEN_COTS_CLIENT:
case XTRANS_OPEN_CLTS_CLIENT:
- PRMSG(1,
- "LocalOpenServer: Should not be opening a client with this function\n",
- 0,0,0);
+ prmsg(1,
+ "LocalOpenServer: Should not be opening a client with this function\n");
break;
case XTRANS_OPEN_COTS_SERVER:
ciptr->fd=LOCALtrans2devtab[i].devcotsopenserver(ciptr,port);
@@ -1927,8 +1920,8 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
ciptr->fd=LOCALtrans2devtab[i].devcltsopenserver(ciptr,port);
break;
default:
- PRMSG(1,"LocalOpenServer: Unknown Open type %d\n",
- type ,0,0);
+ prmsg(1,"LocalOpenServer: Unknown Open type %d\n",
+ type );
}
if( ciptr->fd >= 0 ) {
ciptr->priv=(char *)&LOCALtrans2devtab[i];
@@ -1954,12 +1947,12 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
XtransConnInfo ciptr;
int stat = 0;
- PRMSG(2,"LocalReopenServer(%d,%d,%d)\n", type, index, fd);
+ prmsg(2,"LocalReopenServer(%d,%d,%d)\n", type, index, fd);
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1,"LocalReopenServer: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ prmsg(1,"LocalReopenServer: calloc(1,%lu) failed\n",
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -1974,8 +1967,8 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
stat = LOCALtrans2devtab[index].devcltsreopenserver(ciptr,fd,port);
break;
default:
- PRMSG(1,"LocalReopenServer: Unknown Open type %d\n",
- type ,0,0);
+ prmsg(1,"LocalReopenServer: Unknown Open type %d\n",
+ type );
}
if( stat > 0 ) {
@@ -2000,11 +1993,11 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
char *host, char *port)
{
- PRMSG(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port);
+ prmsg(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port);
return TRANS(LocalOpenClient)(XTRANS_OPEN_COTS_CLIENT, protocol, host, port);
}
@@ -2023,7 +2016,7 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
int found = 0;
char typebuf[TYPEBUFSIZE];
- PRMSG(2,"LocalOpenCOTSServer(%s,%s,%s)\n",protocol,host,port);
+ prmsg(2,"LocalOpenCOTSServer(%s,%s,%s)\n",protocol,host,port);
/* Check if this local type is in the XLOCAL list */
TRANS(LocalInitTransports)("local");
@@ -2045,7 +2038,7 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
TRANS(LocalEndTransports)();
if (!found) {
- PRMSG(3,"LocalOpenCOTSServer: disabling %s\n",thistrans->TransName,0,0);
+ prmsg(3,"LocalOpenCOTSServer: disabling %s\n",thistrans->TransName);
thistrans->flags |= TRANS_DISABLED;
return NULL;
}
@@ -2059,11 +2052,11 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, char *protocol,
char *host, char *port)
{
- PRMSG(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port);
+ prmsg(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port);
return TRANS(LocalOpenClient)(XTRANS_OPEN_CLTS_CLIENT, protocol, host, port);
}
@@ -2074,11 +2067,11 @@ TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(LocalOpenCLTSServer)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCLTSServer)(Xtransport *thistrans _X_UNUSED, char *protocol,
char *host, char *port)
{
- PRMSG(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port);
+ prmsg(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port);
return TRANS(LocalOpenServer)(XTRANS_OPEN_CLTS_SERVER, protocol, host, port);
}
@@ -2094,7 +2087,7 @@ TRANS(LocalReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
{
int index;
- PRMSG(2,"LocalReopenCOTSServer(%d,%s)\n", fd, port, 0);
+ prmsg(2,"LocalReopenCOTSServer(%d,%s)\n", fd, port);
for(index=1;index<NUMTRANSPORTS;index++)
{
@@ -2118,7 +2111,7 @@ TRANS(LocalReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
{
int index;
- PRMSG(2,"LocalReopenCLTSServer(%d,%s)\n", fd, port, 0);
+ prmsg(2,"LocalReopenCLTSServer(%d,%s)\n", fd, port);
for(index=1;index<NUMTRANSPORTS;index++)
{
@@ -2144,7 +2137,7 @@ static int
TRANS(LocalSetOption)(XtransConnInfo ciptr, int option, int arg)
{
- PRMSG(2,"LocalSetOption(%d,%d,%d)\n",ciptr->fd,option,arg);
+ prmsg(2,"LocalSetOption(%d,%d,%d)\n",ciptr->fd,option,arg);
return -1;
}
@@ -2153,10 +2146,10 @@ TRANS(LocalSetOption)(XtransConnInfo ciptr, int option, int arg)
#ifdef TRANS_SERVER
static int
-TRANS(LocalCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags)
+TRANS(LocalCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags _X_UNUSED)
{
- PRMSG(2,"LocalCreateListener(%x->%d,%s)\n",ciptr,ciptr->fd,port);
+ prmsg(2,"LocalCreateListener(%p->%d,%s)\n",ciptr,ciptr->fd,port);
return 0;
}
@@ -2167,7 +2160,7 @@ TRANS(LocalResetListener)(XtransConnInfo ciptr)
{
LOCALtrans2dev *transptr;
- PRMSG(2,"LocalResetListener(%x)\n",ciptr,0,0);
+ prmsg(2,"LocalResetListener(%p)\n",ciptr);
transptr=(LOCALtrans2dev *)ciptr->priv;
if (transptr->devreset != NULL) {
@@ -2184,14 +2177,14 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
XtransConnInfo newciptr;
LOCALtrans2dev *transptr;
- PRMSG(2,"LocalAccept(%x->%d)\n", ciptr, ciptr->fd,0);
+ prmsg(2,"LocalAccept(%p->%d)\n", ciptr, ciptr->fd);
transptr=(LOCALtrans2dev *)ciptr->priv;
if( (newciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo)))==NULL )
{
- PRMSG(1,"LocalAccept: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ prmsg(1,"LocalAccept: calloc(1,%lu) failed\n",
+ sizeof(struct _XtransConnInfo));
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -2218,10 +2211,10 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
#ifdef TRANS_CLIENT
static int
-TRANS(LocalConnect)(XtransConnInfo ciptr, char *host, char *port)
+TRANS(LocalConnect)(XtransConnInfo ciptr, char *host _X_UNUSED, char *port)
{
- PRMSG(2,"LocalConnect(%x->%d,%s)\n", ciptr, ciptr->fd, port);
+ prmsg(2,"LocalConnect(%p->%d,%s)\n", ciptr, ciptr->fd, port);
return 0;
}
@@ -2233,7 +2226,7 @@ static int
TRANS(LocalBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend )
{
- PRMSG(2,"LocalBytesReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend);
+ prmsg(2,"LocalBytesReadable(%p->%d,%p)\n", ciptr, ciptr->fd, pend);
#if defined(SCO325)
return ioctl(ciptr->fd, I_NREAD, (char *)pend);
@@ -2246,7 +2239,7 @@ static int
TRANS(LocalRead)(XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG(2,"LocalRead(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2,"LocalRead(%d,%p,%d)\n", ciptr->fd, buf, size );
return read(ciptr->fd,buf,size);
}
@@ -2255,7 +2248,7 @@ static int
TRANS(LocalWrite)(XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG(2,"LocalWrite(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2,"LocalWrite(%d,%p,%d)\n", ciptr->fd, buf, size );
return write(ciptr->fd,buf,size);
}
@@ -2264,7 +2257,7 @@ static int
TRANS(LocalReadv)(XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG(2,"LocalReadv(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2,"LocalReadv(%d,%p,%d)\n", ciptr->fd, buf, size );
return READV(ciptr,buf,size);
}
@@ -2273,7 +2266,7 @@ static int
TRANS(LocalWritev)(XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG(2,"LocalWritev(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2,"LocalWritev(%d,%p,%d)\n", ciptr->fd, buf, size );
return WRITEV(ciptr,buf,size);
}
@@ -2282,7 +2275,7 @@ static int
TRANS(LocalDisconnect)(XtransConnInfo ciptr)
{
- PRMSG(2,"LocalDisconnect(%x->%d)\n", ciptr, ciptr->fd, 0);
+ prmsg(2,"LocalDisconnect(%p->%d)\n", ciptr, ciptr->fd);
return 0;
}
@@ -2294,7 +2287,7 @@ TRANS(LocalClose)(XtransConnInfo ciptr)
struct sockaddr_un *sockname=(struct sockaddr_un *) ciptr->addr;
int ret;
- PRMSG(2,"LocalClose(%x->%d)\n", ciptr, ciptr->fd ,0);
+ prmsg(2,"LocalClose(%p->%d)\n", ciptr, ciptr->fd );
ret=close(ciptr->fd);
@@ -2316,7 +2309,7 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr)
{
int ret;
- PRMSG(2,"LocalCloseForCloning(%x->%d)\n", ciptr, ciptr->fd ,0);
+ prmsg(2,"LocalCloseForCloning(%p->%d)\n", ciptr, ciptr->fd );
/* Don't unlink path */
@@ -2337,7 +2330,7 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr)
*/
#ifdef TRANS_SERVER
-static char * local_aliases[] = {
+static const char * local_aliases[] = {
# ifdef LOCAL_TRANS_PTS
"pts",
# endif
diff --git a/X11/xtrans/Xtranssock.c b/X11/xtrans/Xtranssock.c
index 08a763ea7..dff33f323 100644
--- a/X11/xtrans/Xtranssock.c
+++ b/X11/xtrans/Xtranssock.c
@@ -176,7 +176,7 @@ from the copyright holders.
*/
typedef struct _Sockettrans2dev {
- char *transname;
+ const char *transname;
int family;
int devcotsname;
int devcltsname;
@@ -262,12 +262,12 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr);
*/
static int
-TRANS(SocketSelectFamily) (int first, char *family)
+TRANS(SocketSelectFamily) (int first, const char *family)
{
int i;
- PRMSG (3,"SocketSelectFamily(%s)\n", family, 0, 0);
+ prmsg (3,"SocketSelectFamily(%s)\n", family);
for (i = first + 1; i < NUMSOCKETFAMILIES;i++)
{
@@ -296,7 +296,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
void *socknamePtr;
SOCKLEN_T namelen;
- PRMSG (3,"SocketINETGetAddr(%p)\n", ciptr, 0, 0);
+ prmsg (3,"SocketINETGetAddr(%p)\n", ciptr);
#if defined(IPv6) && defined(AF_INET6)
namelen = sizeof(socknamev6);
@@ -314,8 +314,8 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
#ifdef WIN32
errno = WSAGetLastError();
#endif
- PRMSG (1,"SocketINETGetAddr: getsockname() failed: %d\n",
- EGET(),0, 0);
+ prmsg (1,"SocketINETGetAddr: getsockname() failed: %d\n",
+ EGET());
return -1;
}
@@ -325,9 +325,8 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
{
- PRMSG (1,
- "SocketINETGetAddr: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETGetAddr: Can't allocate space for the addr\n");
return -1;
}
@@ -374,7 +373,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
bzero(socknamePtr, namelen);
- PRMSG (3,"SocketINETGetPeerAddr(%p)\n", ciptr, 0, 0);
+ prmsg (3,"SocketINETGetPeerAddr(%p)\n", ciptr);
if (getpeername (ciptr->fd, (struct sockaddr *) socknamePtr,
(void *)&namelen) < 0)
@@ -382,8 +381,8 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
#ifdef WIN32
errno = WSAGetLastError();
#endif
- PRMSG (1,"SocketINETGetPeerAddr: getpeername() failed: %d\n",
- EGET(), 0, 0);
+ prmsg (1,"SocketINETGetPeerAddr: getpeername() failed: %d\n",
+ EGET());
return -1;
}
@@ -393,9 +392,8 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL)
{
- PRMSG (1,
- "SocketINETGetPeerAddr: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETGetPeerAddr: Can't allocate space for the addr\n");
return -1;
}
@@ -412,12 +410,12 @@ TRANS(SocketOpen) (int i, int type)
{
XtransConnInfo ciptr;
- PRMSG (3,"SocketOpen(%d,%d)\n", i, type, 0);
+ prmsg (3,"SocketOpen(%d,%d)\n", i, type);
if ((ciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketOpen: malloc failed\n", 0, 0, 0);
+ prmsg (1, "SocketOpen: malloc failed\n");
return NULL;
}
@@ -432,8 +430,8 @@ TRANS(SocketOpen) (int i, int type)
#ifdef WIN32
errno = WSAGetLastError();
#endif
- PRMSG (2, "SocketOpen: socket() failed for %s\n",
- Sockettrans2devtab[i].transname, 0, 0);
+ prmsg (2, "SocketOpen: socket() failed for %s\n",
+ Sockettrans2devtab[i].transname);
xfree ((char *) ciptr);
return NULL;
@@ -463,30 +461,30 @@ TRANS(SocketOpen) (int i, int type)
#ifdef TRANS_REOPEN
static XtransConnInfo
-TRANS(SocketReopen) (int i, int type, int fd, char *port)
+TRANS(SocketReopen) (int i _X_UNUSED, int type, int fd, char *port)
{
XtransConnInfo ciptr;
int portlen;
struct sockaddr *addr;
- PRMSG (3,"SocketReopen(%d,%d,%s)\n", type, fd, port);
+ prmsg (3,"SocketReopen(%d,%d,%s)\n", type, fd, port);
if (port == NULL) {
- PRMSG (1, "SocketReopen: port was null!\n", 0, 0, 0);
+ prmsg (1, "SocketReopen: port was null!\n");
return NULL;
}
portlen = strlen(port) + 1; // include space for trailing null
#ifdef SOCK_MAXADDRLEN
if (portlen < 0 || portlen > (SOCK_MAXADDRLEN + 2)) {
- PRMSG (1, "SocketReopen: invalid portlen %d\n", portlen, 0, 0);
+ prmsg (1, "SocketReopen: invalid portlen %d\n", portlen);
return NULL;
}
if (portlen < 14) portlen = 14;
#else
if (portlen < 0 || portlen > 14) {
- PRMSG (1, "SocketReopen: invalid portlen %d\n", portlen, 0, 0);
+ prmsg (1, "SocketReopen: invalid portlen %d\n", portlen);
return NULL;
}
#endif /*SOCK_MAXADDRLEN*/
@@ -494,21 +492,21 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
if ((ciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketReopen: malloc(ciptr) failed\n", 0, 0, 0);
+ prmsg (1, "SocketReopen: malloc(ciptr) failed\n");
return NULL;
}
ciptr->fd = fd;
if ((addr = (struct sockaddr *) xcalloc (1, portlen + 2)) == NULL) {
- PRMSG (1, "SocketReopen: malloc(addr) failed\n", 0, 0, 0);
+ prmsg (1, "SocketReopen: malloc(addr) failed\n");
return NULL;
}
ciptr->addr = (char *) addr;
ciptr->addrlen = portlen + 2;
if ((ciptr->peeraddr = (char *) xcalloc (1, portlen + 2)) == NULL) {
- PRMSG (1, "SocketReopen: malloc(portaddr) failed\n", 0, 0, 0);
+ prmsg (1, "SocketReopen: malloc(portaddr) failed\n");
return NULL;
}
ciptr->peeraddrlen = portlen + 2;
@@ -548,13 +546,13 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
- char *host, char *port, int previndex)
+TRANS(SocketOpenCOTSClientBase) (const char *transname, const char *protocol,
+ const char *host, const char *port, int previndex)
{
XtransConnInfo ciptr;
int i = previndex;
- PRMSG (2, "SocketOpenCOTSClient(%s,%s,%s)\n",
+ prmsg (2, "SocketOpenCOTSClient(%s,%s,%s)\n",
protocol, host, port);
SocketInitOnce();
@@ -570,11 +568,11 @@ TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketOpenCOTSClient: Unable to open socket for %s\n",
- transname, 0, 0);
+ prmsg (1,"SocketOpenCOTSClient: Unable to open socket for %s\n",
+ transname);
else
- PRMSG (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n",
- transname, 0, 0);
+ prmsg (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n",
+ transname);
return NULL;
}
@@ -603,7 +601,7 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port);
+ prmsg (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port);
SocketInitOnce();
@@ -614,11 +612,11 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketOpenCOTSServer: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCOTSServer: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -670,7 +668,7 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,"SocketOpenCLTSClient(%s,%s,%s)\n", protocol, host, port);
+ prmsg (2,"SocketOpenCLTSClient(%s,%s,%s)\n", protocol, host, port);
SocketInitOnce();
@@ -681,11 +679,11 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketOpenCLTSClient: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCLTSClient: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -709,7 +707,7 @@ TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,"SocketOpenCLTSServer(%s,%s,%s)\n", protocol, host, port);
+ prmsg (2,"SocketOpenCLTSServer(%s,%s,%s)\n", protocol, host, port);
SocketInitOnce();
@@ -720,11 +718,11 @@ TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketOpenCLTSServer: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCLTSServer: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -754,8 +752,8 @@ TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,
- "SocketReopenCOTSServer(%d, %s)\n", fd, port, 0);
+ prmsg (2,
+ "SocketReopenCOTSServer(%d, %s)\n", fd, port);
SocketInitOnce();
@@ -766,11 +764,11 @@ TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketReopenCOTSServer: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketReopenCOTSServer: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -788,8 +786,8 @@ TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,
- "SocketReopenCLTSServer(%d, %s)\n", fd, port, 0);
+ prmsg (2,
+ "SocketReopenCLTSServer(%d, %s)\n", fd, port);
SocketInitOnce();
@@ -800,11 +798,11 @@ TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketReopenCLTSServer: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketReopenCLTSServer: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -822,7 +820,7 @@ static int
TRANS(SocketSetOption) (XtransConnInfo ciptr, int option, int arg)
{
- PRMSG (2,"SocketSetOption(%d,%d,%d)\n", ciptr->fd, option, arg);
+ prmsg (2,"SocketSetOption(%d,%d,%d)\n", ciptr->fd, option, arg);
return -1;
}
@@ -850,7 +848,7 @@ set_sun_path(const char *port, const char *upath, char *path, int abstract)
if (strlen(port) + strlen(upath) > maxlen)
return -1;
- sprintf(path, "%s%s%s", at, upath, port);
+ snprintf(path, sizeof(s.sun_path), "%s%s%s", at, upath, port);
return 0;
}
#endif
@@ -867,7 +865,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
int fd = ciptr->fd;
int retry;
- PRMSG (3, "SocketCreateListener(%x,%p)\n", ciptr, fd, 0);
+ prmsg (3, "SocketCreateListener(%p,%d)\n", ciptr, fd);
if (Sockettrans2devtab[ciptr->index].family == AF_INET
#if defined(IPv6) && defined(AF_INET6)
@@ -888,8 +886,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
}
if (retry-- == 0) {
- PRMSG (1, "SocketCreateListener: failed to bind listener\n",
- 0, 0, 0);
+ prmsg (1, "SocketCreateListener: failed to bind listener\n");
close (fd);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -920,7 +917,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
if (listen (fd, BACKLOG) < 0)
{
- PRMSG (1, "SocketCreateListener: listen() failed\n", 0, 0, 0);
+ prmsg (1, "SocketCreateListener: listen() failed\n");
close (fd);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -955,7 +952,7 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
char portbuf[PORTBUFSIZE];
#endif
- PRMSG (2, "SocketINETCreateListener(%s)\n", port, 0, 0);
+ prmsg (2, "SocketINETCreateListener(%s)\n", port);
#ifdef X11_t
/*
@@ -971,7 +968,7 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
{
/* fixup the server port address */
tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
- sprintf (portbuf,"%lu", tmpport);
+ snprintf (portbuf, sizeof(portbuf), "%lu", tmpport);
port = portbuf;
}
#endif
@@ -984,9 +981,9 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
{
if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL)
{
- PRMSG (1,
+ prmsg (1,
"SocketINETCreateListener: Unable to get service for %s\n",
- port, 0, 0);
+ port);
return TRANS_CREATE_LISTENER_FAILED;
}
/* we trust getservbyname to return a valid number */
@@ -1041,17 +1038,15 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
if ((status = TRANS(SocketCreateListener) (ciptr,
(struct sockaddr *) &sockname, namelen, flags)) < 0)
{
- PRMSG (1,
- "SocketINETCreateListener: ...SocketCreateListener() failed\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETCreateListener: ...SocketCreateListener() failed\n");
return status;
}
if (TRANS(SocketINETGetAddr) (ciptr) < 0)
{
- PRMSG (1,
- "SocketINETCreateListener: ...SocketINETGetAddr() failed\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETCreateListener: ...SocketINETGetAddr() failed\n");
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1080,8 +1075,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
#endif
- PRMSG (2, "SocketUNIXCreateListener(%s)\n",
- port ? port : "NULL", 0, 0);
+ prmsg (2, "SocketUNIXCreateListener(%s)\n",
+ port ? port : "NULL");
/* Make sure the directory is created */
@@ -1094,8 +1089,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
mode = 0777;
#endif
if (!abstract && trans_mkdir(UNIX_DIR, mode) == -1) {
- PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n",
- UNIX_DIR, errno, 0);
+ prmsg (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n",
+ UNIX_DIR, errno);
(void) umask (oldUmask);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1109,7 +1104,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
port = tmpport;
}
if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
- PRMSG (1, "SocketUNIXCreateListener: path too long\n", 0, 0, 0);
+ prmsg (1, "SocketUNIXCreateListener: path too long\n");
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1133,9 +1128,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
if ((status = TRANS(SocketCreateListener) (ciptr,
(struct sockaddr *) &sockname, namelen, flags)) < 0)
{
- PRMSG (1,
- "SocketUNIXCreateListener: ...SocketCreateListener() failed\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXCreateListener: ...SocketCreateListener() failed\n");
(void) umask (oldUmask);
return status;
}
@@ -1151,9 +1145,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
if ((ciptr->addr = (char *) xalloc (namelen)) == NULL)
{
- PRMSG (1,
- "SocketUNIXCreateListener: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXCreateListener: Can't allocate space for the addr\n");
(void) umask (oldUmask);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1188,7 +1181,7 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
#endif
- PRMSG (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd);
if (!abstract && (
stat (unsock->sun_path, &statb) == -1 ||
@@ -1209,8 +1202,8 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
mode = 0777;
#endif
if (trans_mkdir(UNIX_DIR, mode) == -1) {
- PRMSG (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n",
- UNIX_DIR, errno, 0);
+ prmsg (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n",
+ UNIX_DIR, errno);
(void) umask (oldUmask);
return TRANS_RESET_FAILURE;
}
@@ -1266,12 +1259,12 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
#endif
SOCKLEN_T namelen = sizeof(sockname);
- PRMSG (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd);
if ((newciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketINETAccept: malloc failed\n", 0, 0, 0);
+ prmsg (1, "SocketINETAccept: malloc failed\n");
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -1282,7 +1275,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
#ifdef WIN32
errno = WSAGetLastError();
#endif
- PRMSG (1, "SocketINETAccept: accept() failed\n", 0, 0, 0);
+ prmsg (1, "SocketINETAccept: accept() failed\n");
xfree (newciptr);
*status = TRANS_ACCEPT_FAILED;
return NULL;
@@ -1307,9 +1300,8 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
if (TRANS(SocketINETGetAddr) (newciptr) < 0)
{
- PRMSG (1,
- "SocketINETAccept: ...SocketINETGetAddr() failed:\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETAccept: ...SocketINETGetAddr() failed:\n");
close (newciptr->fd);
xfree (newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
@@ -1318,9 +1310,8 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
if (TRANS(SocketINETGetPeerAddr) (newciptr) < 0)
{
- PRMSG (1,
- "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n");
close (newciptr->fd);
if (newciptr->addr) xfree (newciptr->addr);
xfree (newciptr);
@@ -1345,12 +1336,12 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
struct sockaddr_un sockname;
SOCKLEN_T namelen = sizeof sockname;
- PRMSG (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd);
if ((newciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketUNIXAccept: malloc() failed\n", 0, 0, 0);
+ prmsg (1, "SocketUNIXAccept: malloc() failed\n");
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -1358,7 +1349,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
if ((newciptr->fd = accept (ciptr->fd,
(struct sockaddr *) &sockname, (void *)&namelen)) < 0)
{
- PRMSG (1, "SocketUNIXAccept: accept() failed\n", 0, 0, 0);
+ prmsg (1, "SocketUNIXAccept: accept() failed\n");
xfree (newciptr);
*status = TRANS_ACCEPT_FAILED;
return NULL;
@@ -1372,9 +1363,8 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
if ((newciptr->addr = (char *) xalloc (ciptr->addrlen)) == NULL)
{
- PRMSG (1,
- "SocketUNIXAccept: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXAccept: Can't allocate space for the addr\n");
close (newciptr->fd);
xfree (newciptr);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -1391,9 +1381,8 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
if ((newciptr->peeraddr = (char *) xalloc (ciptr->addrlen)) == NULL)
{
- PRMSG (1,
- "SocketUNIXAccept: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXAccept: Can't allocate space for the addr\n");
close (newciptr->fd);
if (newciptr->addr) xfree (newciptr->addr);
xfree (newciptr);
@@ -1442,23 +1431,23 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
struct addrinfo hints;
char ntopbuf[INET6_ADDRSTRLEN];
int resetonce = 0;
-#endif
+#else
struct sockaddr_in sockname;
+ struct hostent *hostp;
+ struct servent *servp;
+ unsigned long tmpaddr;
+#endif
#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
_Xgethostbynameparams hparams;
_Xgetservbynameparams sparams;
#endif
- struct hostent *hostp;
- struct servent *servp;
- unsigned long tmpaddr;
#ifdef X11_t
char portbuf[PORTBUFSIZE];
#endif
- long tmpport;
char hostnamebuf[256]; /* tmp space */
- PRMSG (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port);
+ prmsg (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port);
if (!host)
{
@@ -1479,8 +1468,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (is_numeric (port))
{
- tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
- sprintf (portbuf, "%lu", tmpport);
+ long tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
+ snprintf (portbuf, sizeof(portbuf), "%lu", tmpport);
port = portbuf;
}
#endif
@@ -1509,7 +1498,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
res = getaddrinfo(host,port,&hints,&addrlist->firstaddr);
if (res != 0) {
- PRMSG (1, "SocketINETConnect() can't get address "
+ prmsg (1, "SocketINETConnect() can't get address "
"for %s:%s: %s\n", host, port, gai_strerror(res));
ESET(EINVAL);
return TRANS_CONNECT_FAILED;
@@ -1518,7 +1507,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
addrlist->addr ; res++) {
addrlist->addr = addrlist->addr->ai_next;
}
- PRMSG(4,"Got New Address list with %d addresses\n", res, 0, 0);
+ prmsg(4,"Got New Address list with %d addresses\n", res);
res = 0;
addrlist->addr = NULL;
}
@@ -1527,8 +1516,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (addrlist->addr == NULL) {
if (resetonce) {
/* Already checked entire list - no usable addresses */
- PRMSG (1, "SocketINETConnect() no usable address "
- "for %s:%s\n", host, port, 0);
+ prmsg (1, "SocketINETConnect() no usable address "
+ "for %s:%s\n", host, port);
return TRANS_CONNECT_FAILED;
} else {
/* Go back to beginning of list */
@@ -1543,12 +1532,12 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (addrlist->addr->ai_family == AF_INET) {
struct sockaddr_in *sin = (struct sockaddr_in *) socketaddr;
- PRMSG (4,"SocketINETConnect() sockname.sin_addr = %s\n",
+ prmsg (4,"SocketINETConnect() sockname.sin_addr = %s\n",
inet_ntop(addrlist->addr->ai_family,&sin->sin_addr,
- ntopbuf,sizeof(ntopbuf)), 0, 0);
+ ntopbuf,sizeof(ntopbuf)));
- PRMSG (4,"SocketINETConnect() sockname.sin_port = %d\n",
- ntohs(sin->sin_port), 0, 0);
+ prmsg (4,"SocketINETConnect() sockname.sin_port = %d\n",
+ ntohs(sin->sin_port));
if (Sockettrans2devtab[ciptr->index].family == AF_INET6) {
if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -1570,26 +1559,24 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
Sockettrans2devtab[newciptr->index].family !=
AF_INET) {
socketaddr = NULL;
- PRMSG (4,"SocketINETConnect() Cannot get IPv4 "
- " socketfor IPv4 address\n", 0,0,0);
+ prmsg (4,"SocketINETConnect() Cannot get IPv4 "
+ " socketfor IPv4 address\n");
}
if (newciptr)
xfree(newciptr);
} else {
socketaddr = NULL;
- PRMSG (4,"SocketINETConnect Skipping IPv4 address\n",
- 0,0,0);
+ prmsg (4,"SocketINETConnect Skipping IPv4 address\n");
}
}
} else if (addrlist->addr->ai_family == AF_INET6) {
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) socketaddr;
- PRMSG (4,"SocketINETConnect() sockname.sin6_addr = %s\n",
+ prmsg (4,"SocketINETConnect() sockname.sin6_addr = %s\n",
inet_ntop(addrlist->addr->ai_family,
- &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)),
- 0, 0);
- PRMSG (4,"SocketINETConnect() sockname.sin6_port = %d\n",
- ntohs(sin6->sin6_port), 0, 0);
+ &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)));
+ prmsg (4,"SocketINETConnect() sockname.sin6_port = %d\n",
+ ntohs(sin6->sin6_port));
if (Sockettrans2devtab[ciptr->index].family == AF_INET) {
if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -1608,8 +1595,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
Sockettrans2devtab[newciptr->index].family !=
AF_INET6) {
socketaddr = NULL;
- PRMSG (4,"SocketINETConnect() Cannot get IPv6 "
- "socket for IPv6 address\n", 0,0,0);
+ prmsg (4,"SocketINETConnect() Cannot get IPv6 "
+ "socket for IPv6 address\n");
}
if (newciptr)
xfree(newciptr);
@@ -1617,8 +1604,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
else
{
socketaddr = NULL;
- PRMSG (4,"SocketINETConnect() Skipping IPv6 address\n",
- 0,0,0);
+ prmsg (4,"SocketINETConnect() Skipping IPv6 address\n");
}
}
} else {
@@ -1656,17 +1642,17 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
tmpaddr = INADDR_NONE;
}
- PRMSG (4,"SocketINETConnect() inet_addr(%s) = %x\n", host, tmpaddr, 0);
+ prmsg (4,"SocketINETConnect() inet_addr(%s) = %x\n", host, tmpaddr);
if (tmpaddr == INADDR_NONE) {
if ((hostp = _XGethostbyname(host,hparams)) == NULL) {
- PRMSG (1,"SocketINETConnect: Can't get address for %s\n",
- host, 0, 0);
+ prmsg (1,"SocketINETConnect: Can't get address for %s\n",
+ host);
ESET(EINVAL);
return TRANS_CONNECT_FAILED;
}
if (hostp->h_addrtype != AF_INET) { /* is IP host? */
- PRMSG (1,"SocketINETConnect: not INET host%s\n", host, 0, 0);
+ prmsg (1,"SocketINETConnect: not INET host%s\n", host);
ESET(EPROTOTYPE);
return TRANS_CONNECT_FAILED;
}
@@ -1686,20 +1672,20 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (!is_numeric (port)) {
if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL) {
- PRMSG (1,"SocketINETConnect: can't get service for %s\n",
- port, 0, 0);
+ prmsg (1,"SocketINETConnect: can't get service for %s\n",
+ port);
return TRANS_CONNECT_FAILED;
}
sockname.sin_port = htons (servp->s_port);
} else {
- tmpport = strtol (port, (char**)NULL, 10);
+ long tmpport = strtol (port, (char**)NULL, 10);
if (tmpport < 1024 || tmpport > USHRT_MAX)
return TRANS_CONNECT_FAILED;
sockname.sin_port = htons (((unsigned short) tmpport));
}
- PRMSG (4,"SocketINETConnect: sockname.sin_port = %d\n",
- ntohs(sockname.sin_port), 0, 0);
+ prmsg (4,"SocketINETConnect: sockname.sin_port = %d\n",
+ ntohs(sockname.sin_port));
socketaddr = (struct sockaddr *) &sockname;
socketaddrlen = sizeof(sockname);
}
@@ -1769,8 +1755,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
res = TRANS_IN_PROGRESS;
else
{
- PRMSG (2,"SocketINETConnect: Can't connect: errno = %d\n",
- olderrno,0, 0);
+ prmsg (2,"SocketINETConnect: Can't connect: errno = %d\n",
+ olderrno);
res = TRANS_CONNECT_FAILED;
}
@@ -1784,17 +1770,15 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (TRANS(SocketINETGetAddr) (ciptr) < 0)
{
- PRMSG (1,
- "SocketINETConnect: ...SocketINETGetAddr() failed:\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETConnect: ...SocketINETGetAddr() failed:\n");
res = TRANS_CONNECT_FAILED;
}
else if (TRANS(SocketINETGetPeerAddr) (ciptr) < 0)
{
- PRMSG (1,
- "SocketINETConnect: ...SocketINETGetPeerAddr() failed:\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETConnect: ...SocketINETGetPeerAddr() failed:\n");
res = TRANS_CONNECT_FAILED;
}
}
@@ -1962,7 +1946,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
#endif
- PRMSG (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port);
+ prmsg (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port);
/*
* Make sure 'host' is really local. If not, we return failure.
@@ -1974,9 +1958,9 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
if (host && *host && host[0]!='/' && strcmp (host, "unix") != 0 && !UnixHostReallyLocal (host))
{
- PRMSG (1,
+ prmsg (1,
"SocketUNIXConnect: Cannot connect to non-local host %s\n",
- host, 0, 0);
+ host);
return TRANS_CONNECT_FAILED;
}
@@ -1987,8 +1971,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
if (!port || !*port)
{
- PRMSG (1,"SocketUNIXConnect: Missing port specification\n",
- 0, 0, 0);
+ prmsg (1,"SocketUNIXConnect: Missing port specification\n");
return TRANS_CONNECT_FAILED;
}
@@ -1999,7 +1982,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
sockname.sun_family = AF_UNIX;
if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
- PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0);
+ prmsg (1, "SocketUNIXConnect: path too long\n");
return TRANS_CONNECT_FAILED;
}
@@ -2066,8 +2049,8 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
return TRANS_CONNECT_FAILED;
}
} else {
- PRMSG (2,"SocketUNIXConnect: Can't connect: errno = %d\n",
- EGET(),0, 0);
+ prmsg (2,"SocketUNIXConnect: Can't connect: errno = %d\n",
+ EGET());
return TRANS_CONNECT_FAILED;
}
@@ -2082,9 +2065,8 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
if ((ciptr->addr = (char *) xalloc(namelen)) == NULL ||
(ciptr->peeraddr = (char *) xalloc(namelen)) == NULL)
{
- PRMSG (1,
- "SocketUNIXCreateListener: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXCreateListener: Can't allocate space for the addr\n");
return TRANS_CONNECT_FAILED;
}
@@ -2109,7 +2091,7 @@ static int
TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend)
{
- PRMSG (2,"SocketBytesReadable(%p,%d,%p)\n",
+ prmsg (2,"SocketBytesReadable(%p,%d,%p)\n",
ciptr, ciptr->fd, pend);
#ifdef WIN32
{
@@ -2131,7 +2113,7 @@ static int
TRANS(SocketRead) (XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size);
+ prmsg (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size);
#if defined(WIN32)
{
@@ -2151,7 +2133,7 @@ static int
TRANS(SocketWrite) (XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size);
+ prmsg (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size);
#if defined(WIN32)
{
@@ -2171,7 +2153,7 @@ static int
TRANS(SocketReadv) (XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG (2,"SocketReadv(%d,%p,%d)\n", ciptr->fd, buf, size);
+ prmsg (2,"SocketReadv(%d,%p,%d)\n", ciptr->fd, buf, size);
return READV (ciptr, buf, size);
}
@@ -2181,7 +2163,7 @@ static int
TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG (2,"SocketWritev(%d,%p,%d)\n", ciptr->fd, buf, size);
+ prmsg (2,"SocketWritev(%d,%p,%d)\n", ciptr->fd, buf, size);
return WRITEV (ciptr, buf, size);
}
@@ -2191,7 +2173,7 @@ static int
TRANS(SocketDisconnect) (XtransConnInfo ciptr)
{
- PRMSG (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd);
#ifdef WIN32
{
@@ -2210,7 +2192,7 @@ static int
TRANS(SocketINETClose) (XtransConnInfo ciptr)
{
- PRMSG (2,"SocketINETClose(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2,"SocketINETClose(%p,%d)\n", ciptr, ciptr->fd);
#ifdef WIN32
{
@@ -2238,7 +2220,7 @@ TRANS(SocketUNIXClose) (XtransConnInfo ciptr)
struct sockaddr_un *sockname = (struct sockaddr_un *) ciptr->addr;
int ret;
- PRMSG (2,"SocketUNIXClose(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2,"SocketUNIXClose(%p,%d)\n", ciptr, ciptr->fd);
ret = close(ciptr->fd);
@@ -2265,8 +2247,8 @@ TRANS(SocketUNIXCloseForCloning) (XtransConnInfo ciptr)
int ret;
- PRMSG (2,"SocketUNIXCloseForCloning(%p,%d)\n",
- ciptr, ciptr->fd, 0);
+ prmsg (2,"SocketUNIXCloseForCloning(%p,%d)\n",
+ ciptr, ciptr->fd);
ret = close(ciptr->fd);
@@ -2278,7 +2260,7 @@ TRANS(SocketUNIXCloseForCloning) (XtransConnInfo ciptr)
#ifdef TCPCONN
# ifdef TRANS_SERVER
-static char* tcp_nolisten[] = {
+static const char* tcp_nolisten[] = {
"inet",
#if defined(IPv6) && defined(AF_INET6)
"inet6",
diff --git a/X11/xtrans/Xtranstli.c b/X11/xtrans/Xtranstli.c
index f35214c6f..8601c137b 100644
--- a/X11/xtrans/Xtranstli.c
+++ b/X11/xtrans/Xtranstli.c
@@ -123,7 +123,7 @@ TRANS(TLISelectFamily)(char *family)
{
int i;
- PRMSG(3,"TLISelectFamily(%s)\n", family, 0,0 );
+ prmsg(3,"TLISelectFamily(%s)\n", family);
for(i=0;i<NUMTLIFAMILIES;i++)
{
@@ -146,7 +146,7 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
Xtransaddr sockname;
struct netbuf netbuf;
- PRMSG(3,"TLIGetAddr(%x)\n", ciptr, 0,0 );
+ prmsg(3,"TLIGetAddr(%x)\n", ciptr);
netbuf.buf=(char *)&sockname;
netbuf.len=sizeof(sockname);
@@ -154,13 +154,13 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
if( t_getname(ciptr->fd,&netbuf,LOCALNAME) < 0 )
{
- PRMSG(1,"TLIGetAddr: t_getname(LOCALNAME) failed: %d\n",
- errno, 0,0 );
+ prmsg(1,"TLIGetAddr: t_getname(LOCALNAME) failed: %d\n",
+ errno);
return -1;
}
- PRMSG(4,"TLIGetAddr: got family %d len %d\n",
- ((struct sockaddr *) &sockname)->sa_family ,netbuf.len, 0 );
+ prmsg(4,"TLIGetAddr: got family %d len %d\n",
+ ((struct sockaddr *) &sockname)->sa_family ,netbuf.len);
/*
* Everything looks good: fill in the XtransConnInfo structure.
@@ -171,8 +171,7 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
if( (ciptr->addr=(char *)xalloc(netbuf.len)) == NULL )
{
- PRMSG(1, "TLIGetAddr: Can't allocate space for the addr\n",
- 0,0,0);
+ prmsg(1, "TLIGetAddr: Can't allocate space for the addr\n");
return -1;
}
@@ -196,7 +195,7 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
Xtransaddr sockname;
struct netbuf netbuf;
- PRMSG(3,"TLIGetPeerAddr(%x)\n", ciptr, 0,0 );
+ prmsg(3,"TLIGetPeerAddr(%x)\n", ciptr);
netbuf.buf=(char *)&sockname;
netbuf.len=sizeof(sockname);
@@ -204,13 +203,13 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
if( t_getname(ciptr->fd,&netbuf,REMOTENAME) < 0 )
{
- PRMSG(1,"TLIGetPeerAddr: t_getname(REMOTENAME) failed: %d\n",
- errno, 0,0 );
+ prmsg(1,"TLIGetPeerAddr: t_getname(REMOTENAME) failed: %d\n",
+ errno);
return -1;
}
- PRMSG(4,"TLIGetPeerAddr: got family %d len %d\n",
- ((struct sockaddr *) &sockname)->sa_family ,netbuf.len, 0 );
+ prmsg(4,"TLIGetPeerAddr: got family %d len %d\n",
+ ((struct sockaddr *) &sockname)->sa_family ,netbuf.len);
/*
* Everything looks good: fill in the XtransConnInfo structure.
@@ -221,9 +220,8 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
if( (ciptr->peeraddr=(char *)xalloc(netbuf.len)) == NULL )
{
- PRMSG(1,
- "TLIGetPeerAddr: Can't allocate space for the addr\n",
- 0,0,0);
+ prmsg(1,
+ "TLIGetPeerAddr: Can't allocate space for the addr\n");
return -1;
}
@@ -251,24 +249,22 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
struct sockaddr_un *sunaddr=NULL;
struct t_bind *req=NULL;
- PRMSG(2, "TLITLIBindLocal(%d,%d,%s)\n", fd, family, port);
+ prmsg(2, "TLITLIBindLocal(%d,%d,%s)\n", fd, family, port);
if( family == AF_UNIX )
{
if( (req=(struct t_bind *)t_alloc(fd,T_BIND,0)) == NULL )
{
- PRMSG(1,
- "TLITLIBindLocal() failed to allocate a t_bind\n",
- 0,0,0 );
+ prmsg(1,
+ "TLITLIBindLocal() failed to allocate a t_bind\n");
return -1;
}
if( (sunaddr=(struct sockaddr_un *)
malloc(sizeof(struct sockaddr_un))) == NULL )
{
- PRMSG(1,
- "TLITLIBindLocal: failed to allocate a sockaddr_un\n",
- 0,0,0 );
+ prmsg(1,
+ "TLITLIBindLocal: failed to allocate a sockaddr_un\n");
t_free((char *)req,T_BIND);
return -1;
}
@@ -286,8 +282,8 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
(void) sprintf(sunaddr->sun_path,"%s%d",
TLINODENAME, getpid()^time(NULL) );
- PRMSG(4, "TLITLIBindLocal: binding to %s\n",
- sunaddr->sun_path, 0,0);
+ prmsg(4, "TLITLIBindLocal: binding to %s\n",
+ sunaddr->sun_path);
req->addr.buf=(char *)sunaddr;
req->addr.len=sizeof(*sunaddr);
@@ -296,9 +292,9 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
if( t_bind(fd, req, NULL) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIBindLocal: Unable to bind TLI device to %s\n",
- port, 0,0 );
+ port);
if (sunaddr)
free((char *) sunaddr);
if (req)
@@ -314,17 +310,17 @@ TRANS(TLIOpen)(char *device)
{
XtransConnInfo ciptr;
- PRMSG(3,"TLIOpen(%s)\n", device, 0,0 );
+ prmsg(3,"TLIOpen(%s)\n", device);
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1, "TLIOpen: calloc failed\n", 0,0,0 );
+ prmsg(1, "TLIOpen: calloc failed\n");
return NULL;
}
if( (ciptr->fd=t_open( device, O_RDWR, NULL )) < 0 )
{
- PRMSG(1, "TLIOpen: t_open failed for %s\n", device, 0,0 );
+ prmsg(1, "TLIOpen: t_open failed for %s\n", device);
free(ciptr);
return NULL;
}
@@ -341,17 +337,17 @@ TRANS(TLIReopen)(char *device, int fd, char *port)
{
XtransConnInfo ciptr;
- PRMSG(3,"TLIReopen(%s,%d, %s)\n", device, fd, port );
+ prmsg(3,"TLIReopen(%s,%d, %s)\n", device, fd, port );
if (t_sync (fd) < 0)
{
- PRMSG(1, "TLIReopen: t_sync failed\n", 0,0,0 );
+ prmsg(1, "TLIReopen: t_sync failed\n");
return NULL;
}
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1, "TLIReopen: calloc failed\n", 0,0,0 );
+ prmsg(1, "TLIReopen: calloc failed\n");
return NULL;
}
@@ -374,7 +370,7 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
void *handlep;
long lport;
- PRMSG(3,"TLIAddrToNetbuf(%d,%s,%s)\n", tlifamily, host, port );
+ prmsg(3,"TLIAddrToNetbuf(%d,%s,%s)\n", tlifamily, host, port );
if( (handlep=setnetconfig()) == NULL )
return -1;
@@ -395,15 +391,14 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
if( strcmp(netconfigp->nc_protofmly,
TLItrans2devtab[tlifamily].protofamily) != 0 )
continue;
- PRMSG(5,"TLIAddrToNetbuf: Trying to resolve %s.%s for %s\n",
+ prmsg(5,"TLIAddrToNetbuf: Trying to resolve %s.%s for %s\n",
host, port, TLItrans2devtab[tlifamily].protofamily );
if( netdir_getbyname(netconfigp,&nd_hostserv, &nd_addrlistp) == 0 )
{
/* we have at least one address to use */
- PRMSG(5, "TLIAddrToNetbuf: found address for %s.%s\n", host, port, 0 );
- PRMSG(5, "TLIAddrToNetbuf: %s\n",taddr2uaddr(netconfigp,nd_addrlistp->n_addrs),
- 0,0 );
+ prmsg(5, "TLIAddrToNetbuf: found address for %s.%s\n", host, port);
+ prmsg(5, "TLIAddrToNetbuf: %s\n",taddr2uaddr(netconfigp,nd_addrlistp->n_addrs));
memcpy(netbufp->buf,nd_addrlistp->n_addrs->buf,
nd_addrlistp->n_addrs->len);
@@ -431,27 +426,27 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i;
- PRMSG(2,"TLIOpenCOTSClient(%s,%s,%s)\n", protocol, host, port );
+ prmsg(2,"TLIOpenCOTSClient(%s,%s,%s)\n", protocol, host, port );
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,"TLIOpenCOTSClient: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ prmsg(1,"TLIOpenCOTSClient: Unable to determine device for %s\n",
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
{
- PRMSG(1,"TLIOpenCOTSClient: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ prmsg(1,"TLIOpenCOTSClient: Unable to open device for %s\n",
+ thistrans->TransName);
return NULL;
}
if( TRANS(TLITLIBindLocal)(ciptr->fd,TLItrans2devtab[i].family,port) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCOTSClient: ...TLITLIBindLocal() failed: %d\n",
- errno, 0,0 );
+ errno);
t_close(ciptr->fd);
xfree(ciptr);
return NULL;
@@ -459,9 +454,9 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
if( TRANS(TLIGetAddr)(ciptr) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCOTSClient: ...TLIGetAddr() failed: %d\n",
- errno, 0,0 );
+ errno);
t_close(ciptr->fd);
xfree(ciptr);
return NULL;
@@ -486,21 +481,21 @@ TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i;
- PRMSG(2,"TLIOpenCOTSServer(%s,%s,%s)\n", protocol, host, port );
+ prmsg(2,"TLIOpenCOTSServer(%s,%s,%s)\n", protocol, host, port );
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCOTSServer: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCOTSServer: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
@@ -529,29 +524,29 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i;
- PRMSG(2,"TLIOpenCLTSClient(%s,%s,%s)\n", protocol, host, port );
+ prmsg(2,"TLIOpenCLTSClient(%s,%s,%s)\n", protocol, host, port );
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCLTSClient: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCLTSClient: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
if( TRANS(TLITLIBindLocal)(ciptr->fd,TLItrans2devtab[i].family,port) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCLTSClient: ...TLITLIBindLocal() failed: %d\n",
- errno, 0,0 );
+ errno);
t_close(ciptr->fd);
xfree(ciptr);
return NULL;
@@ -559,9 +554,9 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
if( TRANS(TLIGetAddr)(ciptr) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCLTSClient: ...TLIGetPeerAddr() failed: %d\n",
- errno, 0,0 );
+ errno);
t_close(ciptr->fd);
xfree(ciptr);
return NULL;
@@ -583,21 +578,21 @@ TRANS(TLIOpenCLTSServer)(Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i;
- PRMSG(2,"TLIOpenCLTSServer(%s,%s,%s)\n", protocol, host, port );
+ prmsg(2,"TLIOpenCLTSServer(%s,%s,%s)\n", protocol, host, port );
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCLTSServer: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL )
{
- PRMSG(1,
+ prmsg(1,
"TLIOpenCLTSServer: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
@@ -616,22 +611,22 @@ TRANS(TLIReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
XtransConnInfo ciptr;
int i;
- PRMSG(2,"TLIReopenCOTSServer(%d, %s)\n", fd, port, 0 );
+ prmsg(2,"TLIReopenCOTSServer(%d, %s)\n", fd, port);
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIReopenCOTSServer: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIReopen)(
TLItrans2devtab[i].devcotsname, fd, port)) == NULL )
{
- PRMSG(1,
+ prmsg(1,
"TLIReopenCOTSServer: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
@@ -650,22 +645,22 @@ TRANS(TLIReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
XtransConnInfo ciptr;
int i;
- PRMSG(2,"TLIReopenCLTSServer(%d, %s)\n", fd, port, 0 );
+ prmsg(2,"TLIReopenCLTSServer(%d, %s)\n", fd, port);
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIReopenCLTSServer: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIReopen)(
TLItrans2devtab[i].devcltsname, fd, port)) == NULL )
{
- PRMSG(1,
+ prmsg(1,
"TLIReopenCLTSServer: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
@@ -681,7 +676,7 @@ static int
TRANS(TLISetOption)(XtransConnInfo ciptr, int option, int arg)
{
- PRMSG(2,"TLISetOption(%d,%d,%d)\n", ciptr->fd, option, arg );
+ prmsg(2,"TLISetOption(%d,%d,%d)\n", ciptr->fd, option, arg );
return -1;
}
@@ -695,19 +690,18 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
{
struct t_bind *ret;
- PRMSG(2,"TLICreateListener(%x->%d,%x)\n", ciptr, ciptr->fd, req );
+ prmsg(2,"TLICreateListener(%x->%d,%x)\n", ciptr, ciptr->fd, req );
if( (ret=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,T_ALL)) == NULL )
{
- PRMSG(1, "TLICreateListener: failed to allocate a t_bind\n",
- 0,0,0 );
+ prmsg(1, "TLICreateListener: failed to allocate a t_bind\n");
t_free((char *)req,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
if( t_bind(ciptr->fd, req, ret) < 0 )
{
- PRMSG(1, "TLICreateListener: t_bind failed\n", 0,0,0 );
+ prmsg(1, "TLICreateListener: t_bind failed\n");
t_free((char *)req,T_BIND);
t_free((char *)ret,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
@@ -715,8 +709,8 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
if( memcmp(req->addr.buf,ret->addr.buf,req->addr.len) != 0 )
{
- PRMSG(1, "TLICreateListener: unable to bind to %x\n",
- req, 0,0 );
+ prmsg(1, "TLICreateListener: unable to bind to %x\n",
+ req);
t_free((char *)req,T_BIND);
t_free((char *)ret,T_BIND);
return TRANS_ADDR_IN_USE;
@@ -728,9 +722,8 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
if( (ciptr->addr=(char *)xalloc(ret->addr.len)) == NULL )
{
- PRMSG(1,
- "TLICreateListener: Unable to allocate space for the address\n",
- 0,0,0 );
+ prmsg(1,
+ "TLICreateListener: Unable to allocate space for the address\n");
t_free((char *)req,T_BIND);
t_free((char *)ret, T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
@@ -755,7 +748,7 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
struct sockaddr_in *sinaddr;
long tmpport;
- PRMSG(2,"TLIINETCreateListener(%x->%d,%s)\n", ciptr,
+ prmsg(2,"TLIINETCreateListener(%x->%d,%s)\n", ciptr,
ciptr->fd, port ? port : "NULL" );
#ifdef X11_t
@@ -778,18 +771,17 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
if( (req=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,T_ALL)) == NULL )
{
- PRMSG(1,
- "TLIINETCreateListener: failed to allocate a t_bind\n",
- 0,0,0 );
+ prmsg(1,
+ "TLIINETCreateListener: failed to allocate a t_bind\n");
return TRANS_CREATE_LISTENER_FAILED;
}
if( port && *port ) {
if(TRANS(TLIAddrToNetbuf)(ciptr->index,HOST_SELF,port,&(req->addr)) < 0)
{
- PRMSG(1,
+ prmsg(1,
"TLIINETCreateListener: can't resolve name:HOST_SELF.%s\n",
- port, 0,0 );
+ port);
t_free((char *)req,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -816,23 +808,21 @@ TRANS(TLITLICreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags
struct sockaddr_un *sunaddr;
int ret_value;
- PRMSG(2,"TLITLICreateListener(%x->%d,%s)\n", ciptr, ciptr->fd,
+ prmsg(2,"TLITLICreateListener(%x->%d,%s)\n", ciptr, ciptr->fd,
port ? port : "NULL");
if( (req=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,0)) == NULL )
{
- PRMSG(1,
- "TLITLICreateListener: failed to allocate a t_bind\n",
- 0,0,0 );
+ prmsg(1,
+ "TLITLICreateListener: failed to allocate a t_bind\n");
return TRANS_CREATE_LISTENER_FAILED;
}
if( (sunaddr=(struct sockaddr_un *)
malloc(sizeof(struct sockaddr_un))) == NULL )
{
- PRMSG(1,
- "TLITLICreateListener: failed to allocate a sockaddr_un\n",
- 0,0,0 );
+ prmsg(1,
+ "TLITLICreateListener: failed to allocate a sockaddr_un\n");
t_free((char *)req,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -872,11 +862,11 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
XtransConnInfo newciptr;
int i;
- PRMSG(2,"TLIAccept(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ prmsg(2,"TLIAccept(%x->%d)\n", ciptr, ciptr->fd);
if( (call=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_ALL)) == NULL )
{
- PRMSG(1, "TLIAccept() failed to allocate a t_call\n", 0,0,0 );
+ prmsg(1, "TLIAccept() failed to allocate a t_call\n");
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -885,8 +875,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
{
extern char *t_errlist[];
extern int t_errno;
- PRMSG(1, "TLIAccept() t_listen() failed\n", 0,0,0 );
- PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno], 0,0 );
+ prmsg(1, "TLIAccept() t_listen() failed\n");
+ prmsg(1, "TLIAccept: %s\n", t_errlist[t_errno]);
t_free((char *)call,T_CALL);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
@@ -900,7 +890,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( (newciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
{
- PRMSG(1, "TLIAccept() failed to open a new endpoint\n", 0,0,0 );
+ prmsg(1, "TLIAccept() failed to open a new endpoint\n");
t_free((char *)call,T_CALL);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
@@ -908,9 +898,9 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( TRANS(TLITLIBindLocal)(newciptr->fd,TLItrans2devtab[i].family,"") < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIAccept: TRANS(TLITLIBindLocal)() failed: %d\n",
- errno, 0,0 );
+ errno);
t_free((char *)call,T_CALL);
t_close(newciptr->fd);
xfree(newciptr);
@@ -923,19 +913,19 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
{
extern char *t_errlist[];
extern int t_errno;
- PRMSG(1, "TLIAccept() t_accept() failed\n", 0,0,0 );
- PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno], 0,0 );
+ prmsg(1, "TLIAccept() t_accept() failed\n");
+ prmsg(1, "TLIAccept: %s\n", t_errlist[t_errno]);
if( t_errno == TLOOK )
{
int evtype = t_look(ciptr->fd);
- PRMSG(1, "TLIAccept() t_look() returned %d\n", evtype,0,0 );
+ prmsg(1, "TLIAccept() t_look() returned %d\n", evtype);
switch( evtype )
{
case T_DISCONNECT:
if( t_rcvdis(ciptr->fd, NULL) < 0 )
{
- PRMSG(1, "TLIAccept() t_rcvdis() failed\n", 0,0,0 );
- PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno], 0,0 );
+ prmsg(1, "TLIAccept() t_rcvdis() failed\n");
+ prmsg(1, "TLIAccept: %s\n", t_errlist[t_errno]);
}
break;
default:
@@ -953,9 +943,9 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( TRANS(TLIGetAddr)(newciptr) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",
- errno, 0,0 );
+ errno);
t_close(newciptr->fd);
xfree(newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
@@ -964,9 +954,9 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( TRANS(TLIGetPeerAddr)(newciptr) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",
- errno, 0,0 );
+ errno);
t_close(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr);
@@ -976,8 +966,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( ioctl(newciptr->fd, I_POP,"timod") < 0 )
{
- PRMSG(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n",
- errno,0,0 );
+ prmsg(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n",
+ errno);
t_close(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr);
@@ -987,8 +977,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( ioctl(newciptr->fd, I_PUSH,"tirdwr") < 0 )
{
- PRMSG(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
- errno,0,0 );
+ prmsg(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
+ errno);
t_close(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr);
@@ -1010,14 +1000,14 @@ static int
TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
{
- PRMSG(2, "TLIConnect(%x->%d,%x)\n", ciptr, ciptr->fd, sndcall);
+ prmsg(2, "TLIConnect(%x->%d,%x)\n", ciptr, ciptr->fd, sndcall);
if( t_connect(ciptr->fd,sndcall,NULL) < 0 )
{
extern char *t_errlist[];
extern int t_errno;
- PRMSG(1, "TLIConnect() t_connect() failed\n", 0,0,0 );
- PRMSG(1, "TLIConnect: %s\n", t_errlist[t_errno], 0,0 );
+ prmsg(1, "TLIConnect() t_connect() failed\n");
+ prmsg(1, "TLIConnect: %s\n", t_errlist[t_errno]);
t_free((char *)sndcall,T_CALL);
if (t_errno == TLOOK && t_look(ciptr->fd) == T_DISCONNECT)
{
@@ -1036,31 +1026,31 @@ TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
if( TRANS(TLIGetAddr)(ciptr) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIConnect: ...TLIGetAddr() failed: %d\n",
- errno, 0,0 );
+ errno);
return TRANS_CONNECT_FAILED;
}
if( TRANS(TLIGetPeerAddr)(ciptr) < 0 )
{
- PRMSG(1,
+ prmsg(1,
"TLIConnect: ...TLIGetPeerAddr() failed: %d\n",
- errno, 0,0 );
+ errno);
return TRANS_CONNECT_FAILED;
}
if( ioctl(ciptr->fd, I_POP,"timod") < 0 )
{
- PRMSG(1, "TLIConnect() ioctl(I_POP,\"timod\") failed %d\n",
- errno,0,0 );
+ prmsg(1, "TLIConnect() ioctl(I_POP,\"timod\") failed %d\n",
+ errno);
return TRANS_CONNECT_FAILED;
}
if( ioctl(ciptr->fd, I_PUSH,"tirdwr") < 0 )
{
- PRMSG(1, "TLIConnect() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
- errno,0,0 );
+ prmsg(1, "TLIConnect() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
+ errno);
return TRANS_CONNECT_FAILED;
}
@@ -1076,7 +1066,7 @@ TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
struct t_call *sndcall;
long tmpport;
- PRMSG(2, "TLIINETConnect(%s,%s)\n", host, port, 0);
+ prmsg(2, "TLIINETConnect(%s,%s)\n", host, port);
#ifdef X11_t
/*
@@ -1098,14 +1088,14 @@ TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_ALL)) == NULL )
{
- PRMSG(1, "TLIINETConnect() failed to allocate a t_call\n", 0,0,0 );
+ prmsg(1, "TLIINETConnect() failed to allocate a t_call\n");
return TRANS_CONNECT_FAILED;
}
if( TRANS(TLIAddrToNetbuf)(ciptr->index, host, port, &(sndcall->addr) ) < 0 )
{
- PRMSG(1, "TLIINETConnect() unable to resolve name:%s.%s\n",
- host, port, 0 );
+ prmsg(1, "TLIINETConnect() unable to resolve name:%s.%s\n",
+ host, port);
t_free((char *)sndcall,T_CALL);
return TRANS_CONNECT_FAILED;
}
@@ -1122,20 +1112,19 @@ TRANS(TLITLIConnect)(XtransConnInfo ciptr, char *host, char *port)
struct sockaddr_un *sunaddr;
int ret_value;
- PRMSG(2, "TLITLIConnect(%s,%s)\n", host, port, 0);
+ prmsg(2, "TLITLIConnect(%s,%s)\n", host, port);
if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_OPT|T_UDATA)) == NULL )
{
- PRMSG(1, "TLITLIConnect() failed to allocate a t_call\n", 0,0,0 );
+ prmsg(1, "TLITLIConnect() failed to allocate a t_call\n");
return TRANS_CONNECT_FAILED;
}
if( (sunaddr=(struct sockaddr_un *)
malloc(sizeof(struct sockaddr_un))) == NULL )
{
- PRMSG(1,
- "TLITLIConnect: failed to allocate a sockaddr_un\n",
- 0,0,0 );
+ prmsg(1,
+ "TLITLIConnect: failed to allocate a sockaddr_un\n");
t_free((char *)sndcall,T_CALL);
return TRANS_CONNECT_FAILED;
}
@@ -1170,7 +1159,7 @@ TRANS(TLIBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend)
int ret;
struct pollfd filedes;
- PRMSG(2, "TLIByteReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend );
+ prmsg(2, "TLIByteReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend );
/*
* This function should detect hangup conditions. Use poll to check
@@ -1212,7 +1201,7 @@ static int
TRANS(TLIRead)(XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG(2, "TLIRead(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2, "TLIRead(%d,%x,%d)\n", ciptr->fd, buf, size );
return read(ciptr->fd,buf,size);
}
@@ -1222,7 +1211,7 @@ static int
TRANS(TLIWrite)(XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG(2, "TLIWrite(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2, "TLIWrite(%d,%x,%d)\n", ciptr->fd, buf, size );
return write(ciptr->fd,buf,size);
}
@@ -1232,7 +1221,7 @@ static int
TRANS(TLIReadv)(XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG(2, "TLIReadv(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2, "TLIReadv(%d,%x,%d)\n", ciptr->fd, buf, size );
return READV(ciptr,buf,size);
}
@@ -1242,7 +1231,7 @@ static int
TRANS(TLIWritev)(XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG(2, "TLIWritev(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2, "TLIWritev(%d,%x,%d)\n", ciptr->fd, buf, size );
return WRITEV(ciptr,buf,size);
}
@@ -1252,7 +1241,7 @@ static int
TRANS(TLIDisconnect)(XtransConnInfo ciptr)
{
- PRMSG(2, "TLIDisconnect(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ prmsg(2, "TLIDisconnect(%x->%d)\n", ciptr, ciptr->fd);
/*
* Restore the TLI modules so that the connection can be properly shutdown.
@@ -1272,7 +1261,7 @@ static int
TRANS(TLIClose)(XtransConnInfo ciptr)
{
- PRMSG(2, "TLIClose(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ prmsg(2, "TLIClose(%x->%d)\n", ciptr, ciptr->fd);
t_unbind(ciptr->fd);
@@ -1288,7 +1277,7 @@ TRANS(TLICloseForCloning)(XtransConnInfo ciptr)
* Don't unbind.
*/
- PRMSG(2, "TLICloseForCloning(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ prmsg(2, "TLICloseForCloning(%x->%d)\n", ciptr, ciptr->fd);
return (t_close(ciptr->fd));
}
diff --git a/X11/xtrans/Xtransutil.c b/X11/xtrans/Xtransutil.c
index 56f01583a..5dd245307 100644
--- a/X11/xtrans/Xtransutil.c
+++ b/X11/xtrans/Xtransutil.c
@@ -91,7 +91,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
{
- PRMSG(2,"ConvertAddress(%d,%d,%x)\n",*familyp,*addrlenp,*addrp);
+ prmsg(2,"ConvertAddress(%d,%d,%p)\n",*familyp,*addrlenp,*addrp);
switch( *familyp )
{
@@ -178,8 +178,8 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
#endif
default:
- PRMSG(1,"ConvertAddress: Unknown family type %d\n",
- *familyp, 0,0 );
+ prmsg(1,"ConvertAddress: Unknown family type %d\n",
+ *familyp);
return -1;
}
@@ -242,7 +242,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
char *addr = ciptr->addr;
char hostnamebuf[256];
char *networkId = NULL;
- char *transName = ciptr->transptr->TransName;
+ const char *transName = ciptr->transptr->TransName;
if (gethostname (hostnamebuf, sizeof (hostnamebuf)) < 0)
{
@@ -316,7 +316,7 @@ int
void
#endif
#endif
-nameserver_lost(int sig)
+nameserver_lost(int sig _X_UNUSED)
{
nameserver_timedout = 1;
longjmp (env, -1);
@@ -437,7 +437,7 @@ TRANS(WSAStartup) (void)
{
static WSADATA wsadata;
- PRMSG (2,"WSAStartup()\n", 0, 0, 0);
+ prmsg (2,"WSAStartup()\n");
if (!wsadata.wVersion && WSAStartup(MAKEWORD(2,2), &wsadata))
return 1;
@@ -485,8 +485,8 @@ trans_mkdir(const char *path, int mode)
if (lstat(path, &buf) != 0) {
if (errno != ENOENT) {
- PRMSG(1, "mkdir: ERROR: (l)stat failed for %s (%d)\n",
- path, errno, 0);
+ prmsg(1, "mkdir: ERROR: (l)stat failed for %s (%d)\n",
+ path, errno);
return -1;
}
/* Dir doesn't exist. Try to create it */
@@ -499,15 +499,15 @@ trans_mkdir(const char *path, int mode)
*/
if (geteuid() != 0) {
if (mode & 01000) {
- PRMSG(1, "mkdir: ERROR: euid != 0,"
+ prmsg(1, "mkdir: ERROR: euid != 0,"
"directory %s will not be created.\n",
- path, 0, 0);
+ path);
#ifdef FAIL_HARD
return -1;
#endif
} else {
- PRMSG(1, "mkdir: Cannot create %s with root ownership\n",
- path, 0, 0);
+ prmsg(1, "mkdir: Cannot create %s with root ownership\n",
+ path);
}
}
#endif
@@ -515,8 +515,8 @@ trans_mkdir(const char *path, int mode)
#ifndef WIN32
if (mkdir(path, mode) == 0) {
if (chmod(path, mode)) {
- PRMSG(1, "mkdir: ERROR: Mode of %s should be set to %04o\n",
- path, mode, 0);
+ prmsg(1, "mkdir: ERROR: Mode of %s should be set to %04o\n",
+ path, mode);
#ifdef FAIL_HARD
return -1;
#endif
@@ -525,8 +525,8 @@ trans_mkdir(const char *path, int mode)
if (mkdir(path) == 0) {
#endif
} else {
- PRMSG(1, "mkdir: ERROR: Cannot create %s\n",
- path, 0, 0);
+ prmsg(1, "mkdir: ERROR: Cannot create %s\n",
+ path);
return -1;
}
@@ -584,8 +584,8 @@ trans_mkdir(const char *path, int mode)
struct stat fbuf;
if ((fd = open(path, O_RDONLY)) != -1) {
if (fstat(fd, &fbuf) == -1) {
- PRMSG(1, "mkdir: ERROR: fstat failed for %s (%d)\n",
- path, errno, 0);
+ prmsg(1, "mkdir: ERROR: fstat failed for %s (%d)\n",
+ path, errno);
return -1;
}
/*
@@ -595,8 +595,8 @@ trans_mkdir(const char *path, int mode)
if (!S_ISDIR(fbuf.st_mode) ||
buf.st_dev != fbuf.st_dev ||
buf.st_ino != fbuf.st_ino) {
- PRMSG(1, "mkdir: ERROR: inode for %s changed\n",
- path, 0, 0);
+ prmsg(1, "mkdir: ERROR: inode for %s changed\n",
+ path);
return -1;
}
if (updateOwner && fchown(fd, 0, 0) == 0)
@@ -611,30 +611,29 @@ trans_mkdir(const char *path, int mode)
if (updateOwner && !updatedOwner) {
#ifdef FAIL_HARD
if (status & FAIL_IF_NOT_ROOT) {
- PRMSG(1, "mkdir: ERROR: Owner of %s must be set to root\n",
- path, 0, 0);
+ prmsg(1, "mkdir: ERROR: Owner of %s must be set to root\n",
+ path);
return -1;
}
#endif
#if !defined(__APPLE_CC__) && !defined(__CYGWIN__)
- PRMSG(1, "mkdir: Owner of %s should be set to root\n",
- path, 0, 0);
+ prmsg(1, "mkdir: Owner of %s should be set to root\n",
+ path);
#endif
}
if (updateMode && !updatedMode) {
#ifdef FAIL_HARD
if (status & FAIL_IF_NOMODE) {
- PRMSG(1, "mkdir: ERROR: Mode of %s must be set to %04o\n",
- path, mode, 0);
+ prmsg(1, "mkdir: ERROR: Mode of %s must be set to %04o\n",
+ path, mode);
return -1;
}
#endif
- PRMSG(1, "mkdir: Mode of %s should be set to %04o\n",
- path, mode, 0);
+ prmsg(1, "mkdir: Mode of %s should be set to %04o\n",
+ path, mode);
if (status & WARN_NO_ACCESS) {
- PRMSG(1, "mkdir: this may cause subsequent errors\n",
- 0, 0, 0);
+ prmsg(1, "mkdir: this may cause subsequent errors\n");
}
}
return 0;
diff --git a/X11/xtrans/doc/xtrans.xml b/X11/xtrans/doc/xtrans.xml
index 5b01b89be..82e95a408 100644
--- a/X11/xtrans/doc/xtrans.xml
+++ b/X11/xtrans/doc/xtrans.xml
@@ -103,7 +103,7 @@ for client vs. server code.
</para></note>
</preface>
-<chapter id='purposes_and_goals'>
+<chapter id='Purposes_and_Goals'>
<title>Purposes and Goals</title>
<para>The X Transport Interface is intended to combine all system and
@@ -121,7 +121,7 @@ FS, and connection-less oriented protocols such as XDMCP.</para>
</chapter>
-<chapter id='overview_of_the_interface'>
+<chapter id='Overview_of_the_Interface'>
<title>Overview of the Interface</title>
<para>
@@ -142,7 +142,7 @@ an interface would affect performance.
</para>
</chapter>
-<chapter id='definition_of_address_specification_format'>
+<chapter id='Definition_of_Address_Specification_Format'>
<title>Definition of Address Specification Format</title>
<para>
@@ -169,14 +169,14 @@ part of an address.
</para>
</chapter>
-<chapter id='internal_data_structures'>
+<chapter id='Internal_Data_Structures'>
<title>Internal Data Structures</title>
<para>
There are two major data structures associated with the transport
independent portion of this interface. Additional data structures
may be used internally by each transport.
</para>
-<sect1 id="xtransport">
+<sect1 id='Xtransport'>
<title>Xtransport</title>
<para>
Each transport supported has an entry in the transport table. The transport
@@ -337,7 +337,7 @@ should not be unlinked.
</para>
</sect1>
-<sect1 id="xtransconninfo">
+<sect1 id='XtransConnInfo'>
<title>XtransConnInfo</title>
<para>
Each connection will have an opaque <structname>XtransConnInfo</structname>
@@ -364,7 +364,7 @@ struct _XtransConnInfo {
</sect1>
</chapter>
-<chapter id='exposed_transport_independent_api'>
+<chapter id='Exposed_Transport_Independent_API'>
<title>Exposed Transport Independent API</title>
<para>
@@ -385,7 +385,7 @@ All failures are considered fatal, and the connection should be closed
and re-established if desired. In most cases, however, the value of
errno will be available for debugging purposes.
</para>
-<sect1 id="core_interface_api">
+<sect1 id='Core_Interface_API'>
<title>Core Interface API</title>
<itemizedlist mark='bullet'>
<listitem>
@@ -659,7 +659,7 @@ is the list of transports.
</itemizedlist>
</sect1>
-<sect1 id="utility_api">
+<sect1 id='Utility_API'>
<title>Utility API</title>
<para>
This section describes a few useful functions that have been implemented on
@@ -681,7 +681,7 @@ FamilyLocal)).
</sect1>
</chapter>
-<chapter id="transport_option_definition">
+<chapter id='Transport_Option_Definition'>
<title>Transport Option Definition</title>
<para>
The following options are defined for the
@@ -715,7 +715,7 @@ connection will not be closed when an exec occurs.
</itemizedlist>
</chapter>
-<chapter id="hidden_transport_dependent_api">
+<chapter id='Hidden_Transport_Dependent_API'>
<title>Hidden Transport Dependent API</title>
<para>
The hidden transport dependent functions are placed in the Xtransport record.
@@ -935,7 +935,7 @@ This function will break the connection, and close the endpoint.
</listitem>
</itemizedlist>
</chapter>
-<chapter id="configuration">
+<chapter id='Configuration'>
<title>Configuration</title>
<para>
@@ -1018,7 +1018,7 @@ In X11R7 modular releases, these flags are set when running
</chapter>
-<chapter id="transport_specific_definitions">
+<chapter id='Transport_Specific_Definitions'>
<title>Transport Specific Definitions</title>
<informaltable pgwide='0' frame='none'>
@@ -1075,7 +1075,7 @@ In X11R7 modular releases, these flags are set when running
</chapter>
-<chapter id="implementation_notes">
+<chapter id='Implementation_Notes'>
<title>Implementation Notes</title>
<para>
This section refers to the prototype implementation that is being developed
diff --git a/X11/xtrans/transport.c b/X11/xtrans/transport.c
index 0013b01d8..c14057dd3 100644
--- a/X11/xtrans/transport.c
+++ b/X11/xtrans/transport.c
@@ -53,6 +53,9 @@ from The Open Group.
#define xrealloc(_ptr,_size) realloc(_ptr,_size)
#define xfree(_ptr) free(_ptr)
+#define XTRANS_TRANSPORT_C /* used to flag Xtransint.h that it's being used
+ here, not just #included in another file */
+
#include "Xtransint.h"
#ifdef __clang__
diff --git a/libX11/nls/iso8859-1/Compose.pre b/libX11/nls/iso8859-1/Compose.pre
index 39f596777..c726ecf73 100644
--- a/libX11/nls/iso8859-1/Compose.pre
+++ b/libX11/nls/iso8859-1/Compose.pre
@@ -477,7 +477,7 @@ XCOMM Special Character
Ctrl<T> <plus> <plus> : "#" numbersign
Ctrl<T> <apostrophe> <space> : "'" apostrophe
Ctrl<T> <space> <apostrophe> : "'" apostrophe
-Ctrl<T> <A> <A> : "@" at
+Ctrl<T> <A> <T> : "@" at
Ctrl<T> <parenleft> <parenleft> : "[" bracketleft
Ctrl<T> <slash> <slash> : "\\" backslash
Ctrl<T> <slash> <less> : "\\" backslash
diff --git a/libXdmcp/doc/xdmcp.xml b/libXdmcp/doc/xdmcp.xml
index 36abb75a9..817838e58 100644
--- a/libXdmcp/doc/xdmcp.xml
+++ b/libXdmcp/doc/xdmcp.xml
@@ -1591,7 +1591,7 @@ should terminate the protocol at this point and display an error to the user.
<entry spanname="col4_on">
Is the data sent to the display to indicate the type of authorization the
manager will be using in the first call to
-<function>XOpenDisplay</function>
+<olink targetdoc='libX11' targetptr='XOpenDisplay'><function>XOpenDisplay</function></olink>
after the
<function>Manage</function>
packet is received.
@@ -3312,7 +3312,7 @@ Send <function>Refuse</function> packet
Terminate any session in progress
</para>
<para>
-<function>XOpenDisplay</function>
+<olink targetdoc='libX11' targetptr='XOpenDisplay'><function>XOpenDisplay</function></olink>
</para>
<para>
Open display succeeds -&gt;
diff --git a/libXmu/doc/Xmu.xml b/libXmu/doc/Xmu.xml
index 43d8047c9..2d363a924 100644
--- a/libXmu/doc/Xmu.xml
+++ b/libXmu/doc/Xmu.xml
@@ -49,8 +49,8 @@ is a trademark of The Open Group.
</legalnotice>
</articleinfo>
- <sect1 id='introduction'>
- <title>Introduction</title>
+ <sect1 id='Introduction'>
+<title>Introduction</title>
<para>
The Xmu Library is a collection of miscellaneous (some might say random)
@@ -81,8 +81,8 @@ cc -o xapplication xapplication.o `pkg-config --libs xmu`
</sect1>
- <sect1 id='atom_functions'>
- <title>Atom Functions</title>
+ <sect1 id='Atom_Functions'>
+<title>Atom Functions</title>
<para>
To use the functions and macros defined in this section, you should include
@@ -203,11 +203,11 @@ value is cached, such that subsequent requests do not cause
another round-trip to the server.
</para>
- <para id="XmuMakeAtom">
+ <para>
<indexterm zone="XmuMakeAtom">
- <primary><function>XmuMakeAtom</function></primary>
+ <primary><xref linkend='XmuMakeAtom' xrefstyle='select: title'/></primary>
</indexterm>
- <funcsynopsis id='xmumakeatom'>
+ <funcsynopsis id='XmuMakeAtom'>
<funcprototype>
<funcdef>AtomPtr <function>XmuMakeAtom</function></funcdef>
<paramdef>const char *<parameter>name</parameter></paramdef>
@@ -228,15 +228,15 @@ for an
<type>Atom</type>
with the
given name.
-<function>XmuInternAtom</function>
+<xref linkend='XmuInternAtom' xrefstyle='select: title'/>
can be used to cache the Atom value for one or more displays.
</para>
- <para id="XmuNameOfAtom">
+ <para>
<indexterm zone="XmuNameOfAtom">
- <primary><function>XmuNameOfAtom</function></primary>
+ <primary><xref linkend='XmuNameOfAtom' xrefstyle='select: title'/></primary>
</indexterm>
- <funcsynopsis id='xmunameofatom'>
+ <funcsynopsis id='XmuNameOfAtom'>
<funcprototype>
<funcdef>char *<function>XmuNameOfAtom</function></funcdef>
<paramdef>AtomPtr <parameter>atom_ptr</parameter></paramdef>
@@ -254,11 +254,11 @@ specifies the AtomPtr
The function returns the name of an AtomPtr.
</para>
- <para id="XmuInternAtom">
+ <para>
<indexterm zone="XmuInternAtom">
- <primary><function>XmuInternAtom</function></primary>
+ <primary><xref linkend='XmuInternAtom' xrefstyle='select: title'/></primary>
</indexterm>
- <funcsynopsis id='xmuinternatom'>
+ <funcsynopsis id='XmuInternAtom'>
<funcprototype>
<funcdef>Atom <function>XmuInternAtom</function></funcdef>
<paramdef>Display *<parameter>dpy</parameter></paramdef>
@@ -290,11 +290,11 @@ is cached,
such that subsequent requests do not cause another round-trip to the server.
</para>
- <para id="XmuGetAtomName">
+ <para>
<indexterm zone="XmuGetAtomName">
- <primary><function>XmuGetAtomName</function></primary>
+ <primary><xref linkend='XmuGetAtomName' xrefstyle='select: title'/></primary>
</indexterm>
- <funcsynopsis id='xmugetatomname'>
+ <funcsynopsis id='XmuGetAtomName'>
<funcprototype>
<funcdef>char *<function>XmuGetAtomName</function></funcdef>
<paramdef>Display *<parameter>dpy</parameter></paramdef>
@@ -322,11 +322,11 @@ The result is cached, such that subsequent
requests do not cause another round-trip to the server.
</para>
- <para id="XmuInternStrings">
+ <para>
<indexterm zone="XmuInternStrings">
- <primary><function>XmuInternStrings</function></primary>
+ <primary><xref linkend='XmuInternStrings' xrefstyle='select: title'/></primary>
</indexterm>
- <funcsynopsis id='xmuinternstrings'>
+ <funcsynopsis id='XmuInternStrings'>
<funcprototype>
<funcdef>void <function>XmuInternStrings</function></funcdef>
<paramdef>Display *<parameter>dpy</parameter></paramdef>
@@ -371,8 +371,8 @@ The caller is responsible for preallocating the array pointed at by atoms.
</sect1>
- <sect1 id='error_handler_functions'>
- <title>Error Handler Functions</title>
+ <sect1 id='Error_Handler_Functions'>
+<title>Error Handler Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -384,11 +384,11 @@ file
and link against the libXmu or libXmuu library.
</para>
- <para id="XmuPrintDefaultErrorMessage">
+ <para>
<indexterm zone="XmuPrintDefaultErrorMessage">
- <primary><function>XmuPrintDefaultErrorMessage</function></primary>
+ <primary><xref linkend='XmuPrintDefaultErrorMessage' xrefstyle='select: title'/></primary>
</indexterm>
- <funcsynopsis id='xmuprintdefaulterrormessage'>
+ <funcsynopsis id='XmuPrintDefaultErrorMessage'>
<funcprototype>
<funcdef>int <function>XmuPrintDefaultErrorMessage</function></funcdef>
<paramdef>Display *<parameter>dpy</parameter></paramdef>
@@ -454,21 +454,21 @@ specifies the error
This function ignores errors for
<errorname>BadWindow</errorname>
errors for
-<function>XQueryTree</function>
+<olink targetdoc='libX11' targetptr='XQueryTree'><function>XQueryTree</function></olink>
and
-<function>XGetWindowAttributes</function>,
+<olink targetdoc='libX11' targetptr='XGetWindowAttributes'><function>XGetWindowAttributes</function></olink>,
and ignores
<errorname>BadDrawable</errorname>
errors for
-<function>XGetGeometry</function>;
+<olink targetdoc='libX11' targetptr='XGetGeometry'><function>XGetGeometry</function></olink>;
it returns 0 in those cases. Otherwise, it prints the default error message,
and returns a non-zero value if the caller should consider exiting,
and 0 if the caller should not exit.
</para>
</sect1>
- <sect1 id='system_utility_functions'>
- <title>System Utility Functions</title>
+ <sect1 id='System_Utility_Functions'>
+<title>System Utility Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -550,8 +550,8 @@ in software that needs to continue to support non-Unix98 compliant platforms.
</sect1>
- <sect1 id='window_utility_functions'>
- <title>Window Utility Functions</title>
+ <sect1 id='Window_Utility_Functions'>
+<title>Window Utility Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -675,17 +675,17 @@ and
flags in the hints structure, and then stores the hints for the
window using
<indexterm zone="XmuUpdateMapHints">
- <primary><function>XSetWMNormalHints</function></primary>
+ <primary><olink targetdoc='libX11' targetptr='XSetWMNormalHints'><function>XSetWMNormalHints</function></olink></primary>
</indexterm>
-<function>XSetWMNormalHints</function>
+<olink targetdoc='libX11' targetptr='XSetWMNormalHints'><function>XSetWMNormalHints</function></olink>
and returns
<symbol>True</symbol>.
If <symbol>NULL</symbol> is passed for the
hints structure, then the current hints are read back from the window using
<indexterm zone="XmuUpdateMapHints">
- <primary><function>XGetWMNormalHints</function></primary>
+ <primary><olink targetdoc='libX11' targetptr='XGetWMNormalHints'><function>XGetWMNormalHints</function></olink></primary>
</indexterm>
-<function>XGetWMNormalHints</function>
+<olink targetdoc='libX11' targetptr='XGetWMNormalHints'><function>XGetWMNormalHints</function></olink>
and are used instead, and
<symbol>True</symbol>
is returned; otherwise
@@ -695,8 +695,8 @@ is returned.
</sect1>
- <sect1 id='cursor_utility_functions'>
- <title>Cursor Utility Functions</title>
+ <sect1 id='Cursor_Utility_Functions'>
+<title>Cursor Utility Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -736,8 +736,8 @@ manual.
</sect1>
- <sect1 id='graphics_functions'>
- <title>Graphics Functions</title>
+ <sect1 id='Graphics_Functions'>
+<title>Graphics Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -1128,10 +1128,10 @@ returns the y coordinate of the hotspot
This function reads a standard bitmap file description from the specified
stream, and returns the parsed data in a format suitable for passing to
-<function>XCreateBitmapFromData</function>.
+<olink targetdoc='libX11' targetptr='XCreateBitmapFromData'><function>XCreateBitmapFromData</function></olink>.
The return value of the function has the same
interpretation as the return value for
-<function>XReadBitmapFile</function>.
+<olink targetdoc='libX11' targetptr='XReadBitmapFile'><function>XReadBitmapFile</function></olink>.
</para>
<para id="XmuReadBitmapDataFromFile">
@@ -1190,10 +1190,10 @@ returns the y coordinate of the hotspot
This function reads a standard bitmap file description from the specified
file, and returns the parsed data in a format suitable for passing to
-<function>XCreateBitmapFromData</function>.
+<olink targetdoc='libX11' targetptr='XCreateBitmapFromData'><function>XCreateBitmapFromData</function></olink>.
The return value of the function has the same
interpretation as the return value for
-<function>XReadBitmapFile</function>.
+<olink targetdoc='libX11' targetptr='XReadBitmapFile'><function>XReadBitmapFile</function></olink>.
</para>
<para id="XmuLocateBitmapFile">
@@ -1265,7 +1265,7 @@ returns the y coordinate of the hotspot
</variablelist>
This function reads a file in standard bitmap file format, using
-<function>XReadBitmapFile</function>,
+<olink targetdoc='libX11' targetptr='XReadBitmapFile'><function>XReadBitmapFile</function></olink>,
and returns the created bitmap. The filename may be
absolute, or relative to the global resource named
<indexterm zone="XmuLocateBitmapFile">
@@ -1352,7 +1352,7 @@ specifies the background pixel value
This function creates a pixmap of the specified width, height, and depth, on
the same screen as the specified drawable, and then performs an
-<function>XCopyPlane</function>
+<olink targetdoc='libX11' targetptr='XCopyPlane'><function>XCopyPlane</function></olink>
from the specified bitmap to the pixmap,
using the specified foreground and background pixel values.
The created pixmap is returned.
@@ -1360,8 +1360,8 @@ The created pixmap is returned.
</sect1>
- <sect1 id='selection_functions'>
- <title>Selection Functions</title>
+ <sect1 id='Selection_Functions'>
+<title>Selection Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -1450,8 +1450,8 @@ if the conversion was successful, else it returns
</para>
</sect1>
- <sect1 id='type_converter_functions'>
- <title>Type Converter Functions</title>
+ <sect1 id='Type_Converter_Functions'>
+<title>Type Converter Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -2310,8 +2310,8 @@ XtSetTypeConverter(XtRString, XtRWidget, XmuNewCvtStringToWidget,
</sect1>
- <sect1 id='character_set_functions'>
- <title>Character Set Functions</title>
+ <sect1 id='Character_Set_Functions'>
+<title>Character Set Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -2517,8 +2517,8 @@ less than second. The two strings are assumed to be encoded using ISO
</para>
</sect1>
- <sect1 id='keyboard_event'>
- <title>Keyboard Event Translation Functions</title>
+ <sect1 id='Keyboard_Event_Translation_Functions'>
+<title>Keyboard Event Translation Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -2533,7 +2533,7 @@ and link against the libXmu library.
<warning><para>
The functions in this section are <emphasis remap='B'>deprecated</emphasis> because they don't work
in most locales now supported by X11; the function
-<function>XmbLookupString</function>
+<olink targetdoc='libX11' targetptr='XmbLookupString'><function>XmbLookupString</function></olink>
provides a better alternative.
</para></warning>
@@ -2585,7 +2585,7 @@ specifies or returns the compose state
</variablelist>
This function is identical to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
and exists only for naming symmetry with other functions.
</para>
@@ -2637,7 +2637,7 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event
to an Latin-2 (ISO 8859-2) string, or to an ASCII control string.
</para>
@@ -2690,7 +2690,7 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event
to an Latin-3 (ISO 8859-3) string, or to an ASCII control string.
</para>
@@ -2743,7 +2743,7 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event
to an Latin-4 (ISO 8859-4) string, or to an ASCII control string.
</para>
@@ -2796,7 +2796,7 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event
to a string in an encoding consisting of Latin-1 (ISO 8859-1) and ASCII
control in the Graphics Left half (values 0 to 127), and Katakana in the
@@ -2852,7 +2852,7 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event
to a string in the JIS X0201-1976 encoding, including ASCII control.
</para>
@@ -2905,7 +2905,7 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event
to a Latin/Arabic (ISO 8859-6) string, or to an ASCII control string.
</para>
@@ -2958,7 +2958,7 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event
to a Latin/Cyrillic (ISO 8859-5) string, or to an ASCII control string.
</para>
@@ -3011,7 +3011,7 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event
to a Latin/Greek (ISO 8859-7) string, or to an ASCII control string.
</para>
@@ -3064,7 +3064,7 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event
to a Latin/Hebrew (ISO 8859-8) string, or to an ASCII control string.
</para>
@@ -3117,14 +3117,14 @@ specifies or returns the compose state
</variablelist>
This function is similar to
-<function>XLookupString</function>,
+<olink targetdoc='libX11' targetptr='XLookupString'><function>XLookupString</function></olink>,
except that it maps a key event to an APL string.
</para>
</sect1>
- <sect1 id='compound_text_functions'>
- <title>Compound Text Functions</title>
+ <sect1 id='Compound_Text_Functions'>
+<title>Compound Text Functions</title>
<para>
The functions defined in this section are for parsing Compound Text strings,
@@ -3478,8 +3478,8 @@ structure.
</sect1>
- <sect1 id='closedisplay_hook_functions'>
- <title>CloseDisplay Hook Functions</title>
+ <sect1 id='CloseDisplay_Hook_Functions'>
+<title>CloseDisplay Hook Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -3652,8 +3652,8 @@ if a matching callback exists, else returns
</para>
</sect1>
- <sect1 id='display_queue_functions'>
- <title>Display Queue Functions</title>
+ <sect1 id='Display_Queue_Functions'>
+<title>Display Queue Functions</title>
<para>
To use the functions and types defined in this section, you should include the
@@ -3917,8 +3917,8 @@ is not called on the display.
</sect1>
- <sect1 id='toolkit_convenience_functions'>
- <title>Toolkit Convenience Functions</title>
+ <sect1 id='Toolkit_Convenience_Functions'>
+<title>Toolkit Convenience Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -3995,8 +3995,8 @@ Otherwise, this function does nothing.
</sect1>
- <sect1 id='standard_colormap_functions'>
- <title>Standard Colormap Functions</title>
+ <sect1 id='Standard_Colormap_Functions'>
+<title>Standard Colormap Functions</title>
<para>
To use the functions defined in this section, you should include the header
@@ -4534,8 +4534,8 @@ possible.
</sect1>
- <sect1 id='widget_description_functions'>
- <title>Widget Description Functions</title>
+ <sect1 id='Widget_Description_Functions'>
+<title>Widget Description Functions</title>
<para>
The functions defined in this section are for building a description of
@@ -4601,7 +4601,7 @@ specifies the widget class for which resources should be obtained.
specifies the widget that should be used for creating an instance of
<parameter>node</parameter>
from which resources are extracted. This is typically the value returned
-by <function>XtAppInitialize</function>.
+by <olink targetdoc='libXaw' targetptr='XtAppInitialize'><function>XtAppInitialize</function></olink>.
</para></listitem>
</varlistentry>
<varlistentry>
@@ -4696,8 +4696,8 @@ widget name or widget class name. If no match is found, it returns
</sect1>
- <sect1 id='participation_in_the_editres_protocol'>
- <title>Participation in the Editres Protocol</title>
+ <sect1 id='Participation_in_the_Editres_Protocol'>
+<title>Participation in the Editres Protocol</title>
<para>
<indexterm>
diff --git a/libxcb/xcb-proto/src/xproto.xml b/libxcb/xcb-proto/src/xproto.xml
index 4070b8463..cbb5fa2db 100644
--- a/libxcb/xcb-proto/src/xproto.xml
+++ b/libxcb/xcb-proto/src/xproto.xml
@@ -1,2440 +1,2441 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Copyright (C) 2001-2004 Bart Massey, Jamey Sharp, and Josh Triplett.
-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, sublicense, 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 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 NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS 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.
-
-Except as contained in this notice, the names of the authors or their
-institutions shall not be used in advertising or otherwise to promote the
-sale, use or other dealings in this Software without prior written
-authorization from the authors.
--->
-<xcb header="xproto">
- <!-- Core protocol types -->
-
- <struct name="CHAR2B">
- <field type="CARD8" name="byte1" />
- <field type="CARD8" name="byte2" />
- </struct>
-
- <xidtype name="WINDOW" />
-
- <xidtype name="PIXMAP" />
-
- <xidtype name="CURSOR" />
-
- <xidtype name="FONT" />
-
- <xidtype name="GCONTEXT" />
-
- <xidtype name="COLORMAP" />
-
- <xidtype name="ATOM" />
-
- <xidunion name="DRAWABLE">
- <type>WINDOW</type>
- <type>PIXMAP</type>
- </xidunion>
-
- <xidunion name="FONTABLE">
- <type>FONT</type>
- <type>GCONTEXT</type>
- </xidunion>
-
- <typedef oldname="CARD32" newname="VISUALID" />
-
- <typedef oldname="CARD32" newname="TIMESTAMP" />
-
- <typedef oldname="CARD32" newname="KEYSYM" />
-
- <typedef oldname="CARD8" newname="KEYCODE" />
-
- <typedef oldname="CARD8" newname="BUTTON" />
-
- <struct name="POINT">
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- </struct>
-
- <struct name="RECTANGLE">
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- </struct>
-
- <struct name="ARC">
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="INT16" name="angle1" />
- <field type="INT16" name="angle2" />
- </struct>
-
- <!-- Connection setup-related types -->
-
- <struct name="FORMAT">
- <field type="CARD8" name="depth" />
- <field type="CARD8" name="bits_per_pixel" />
- <field type="CARD8" name="scanline_pad" />
- <pad bytes="5" />
- </struct>
-
- <enum name="VisualClass">
- <item name="StaticGray"> <value>0</value></item>
- <item name="GrayScale"> <value>1</value></item>
- <item name="StaticColor"><value>2</value></item>
- <item name="PseudoColor"><value>3</value></item>
- <item name="TrueColor"> <value>4</value></item>
- <item name="DirectColor"><value>5</value></item>
- </enum>
-
- <struct name="VISUALTYPE">
- <field type="VISUALID" name="visual_id" />
- <field type="CARD8" name="class" enum="VisualClass" />
- <field type="CARD8" name="bits_per_rgb_value" />
- <field type="CARD16" name="colormap_entries" />
- <field type="CARD32" name="red_mask" />
- <field type="CARD32" name="green_mask" />
- <field type="CARD32" name="blue_mask" />
- <pad bytes="4" />
- </struct>
-
- <struct name="DEPTH">
- <field type="CARD8" name="depth" />
- <pad bytes="1" />
- <field type="CARD16" name="visuals_len" />
- <pad bytes="4" />
- <list type="VISUALTYPE" name="visuals">
- <fieldref>visuals_len</fieldref>
- </list>
- </struct>
-
- <enum name="EventMask">
- <item name="NoEvent"> <value>0</value></item>
- <item name="KeyPress"> <bit>0</bit></item>
- <item name="KeyRelease"> <bit>1</bit></item>
- <item name="ButtonPress"> <bit>2</bit></item>
- <item name="ButtonRelease"> <bit>3</bit></item>
- <item name="EnterWindow"> <bit>4</bit></item>
- <item name="LeaveWindow"> <bit>5</bit></item>
- <item name="PointerMotion"> <bit>6</bit></item>
- <item name="PointerMotionHint"> <bit>7</bit></item>
- <item name="Button1Motion"> <bit>8</bit></item>
- <item name="Button2Motion"> <bit>9</bit></item>
- <item name="Button3Motion"> <bit>10</bit></item>
- <item name="Button4Motion"> <bit>11</bit></item>
- <item name="Button5Motion"> <bit>12</bit></item>
- <item name="ButtonMotion"> <bit>13</bit></item>
- <item name="KeymapState"> <bit>14</bit></item>
- <item name="Exposure"> <bit>15</bit></item>
- <item name="VisibilityChange"> <bit>16</bit></item>
- <item name="StructureNotify"> <bit>17</bit></item>
- <item name="ResizeRedirect"> <bit>18</bit></item>
- <item name="SubstructureNotify"> <bit>19</bit></item>
- <item name="SubstructureRedirect"><bit>20</bit></item>
- <item name="FocusChange"> <bit>21</bit></item>
- <item name="PropertyChange"> <bit>22</bit></item>
- <item name="ColorMapChange"> <bit>23</bit></item>
- <item name="OwnerGrabButton"> <bit>24</bit></item>
- </enum>
-
- <enum name="BackingStore">
- <item name="NotUseful"> <value>0</value></item>
- <item name="WhenMapped"><value>1</value></item>
- <item name="Always"> <value>2</value></item>
- </enum>
-
- <struct name="SCREEN">
- <field type="WINDOW" name="root" />
- <field type="COLORMAP" name="default_colormap" />
- <field type="CARD32" name="white_pixel" />
- <field type="CARD32" name="black_pixel" />
- <field type="CARD32" name="current_input_masks" mask="EventMask" />
- <field type="CARD16" name="width_in_pixels" />
- <field type="CARD16" name="height_in_pixels" />
- <field type="CARD16" name="width_in_millimeters" />
- <field type="CARD16" name="height_in_millimeters" />
- <field type="CARD16" name="min_installed_maps" />
- <field type="CARD16" name="max_installed_maps" />
- <field type="VISUALID" name="root_visual" />
- <field type="BYTE" name="backing_stores" enum="BackingStore" />
- <field type="BOOL" name="save_unders" />
- <field type="CARD8" name="root_depth" />
- <field type="CARD8" name="allowed_depths_len" />
- <list type="DEPTH" name="allowed_depths">
- <fieldref>allowed_depths_len</fieldref>
- </list>
- </struct>
-
- <struct name="SetupRequest">
- <field type="CARD8" name="byte_order" />
- <pad bytes="1" />
- <field type="CARD16" name="protocol_major_version" />
- <field type="CARD16" name="protocol_minor_version" />
- <field type="CARD16" name="authorization_protocol_name_len" />
- <field type="CARD16" name="authorization_protocol_data_len" />
- <pad bytes="2" />
- <list type="char" name="authorization_protocol_name">
- <fieldref>authorization_protocol_name_len</fieldref>
- </list>
- <list type="char" name="authorization_protocol_data">
- <fieldref>authorization_protocol_data_len</fieldref>
- </list>
- </struct>
-
- <struct name="SetupFailed">
- <field type="CARD8" name="status" /> <!-- always 0 -> Failed -->
- <field type="CARD8" name="reason_len" />
- <field type="CARD16" name="protocol_major_version" />
- <field type="CARD16" name="protocol_minor_version" />
- <field type="CARD16" name="length" />
- <list type="char" name="reason">
- <fieldref>reason_len</fieldref>
- </list>
- </struct>
-
- <struct name="SetupAuthenticate">
- <field type="CARD8" name="status" /> <!-- always 2 -> Authenticate -->
- <pad bytes="5" />
- <field type="CARD16" name="length" />
- <list type="char" name="reason">
- <op op="*">
- <fieldref>length</fieldref>
- <value>4</value>
- </op>
- </list>
- </struct>
-
- <enum name="ImageOrder">
- <item name="LSBFirst"><value>0</value></item>
- <item name="MSBFirst"><value>1</value></item>
- </enum>
-
- <struct name="Setup">
- <field type="CARD8" name="status" /> <!-- always 1 -> Success -->
- <pad bytes="1" />
- <field type="CARD16" name="protocol_major_version" />
- <field type="CARD16" name="protocol_minor_version" />
- <field type="CARD16" name="length" />
- <field type="CARD32" name="release_number" />
- <field type="CARD32" name="resource_id_base" />
- <field type="CARD32" name="resource_id_mask" />
- <field type="CARD32" name="motion_buffer_size" />
- <field type="CARD16" name="vendor_len" />
- <field type="CARD16" name="maximum_request_length" />
- <field type="CARD8" name="roots_len" />
- <field type="CARD8" name="pixmap_formats_len" />
- <field type="CARD8" name="image_byte_order" enum="ImageOrder" />
- <field type="CARD8" name="bitmap_format_bit_order" enum="ImageOrder" />
- <field type="CARD8" name="bitmap_format_scanline_unit" />
- <field type="CARD8" name="bitmap_format_scanline_pad" />
- <field type="KEYCODE" name="min_keycode" />
- <field type="KEYCODE" name="max_keycode" />
- <pad bytes="4" />
- <list type="char" name="vendor">
- <fieldref>vendor_len</fieldref>
- </list>
- <list type="FORMAT" name="pixmap_formats">
- <fieldref>pixmap_formats_len</fieldref>
- </list>
- <list type="SCREEN" name="roots">
- <fieldref>roots_len</fieldref>
- </list>
- </struct>
-
- <!-- Core event types -->
-
- <enum name="ModMask">
- <item name="Shift"> <bit>0</bit></item>
- <item name="Lock"> <bit>1</bit></item>
- <item name="Control"><bit>2</bit></item>
- <item name="1"> <bit>3</bit></item>
- <item name="2"> <bit>4</bit></item>
- <item name="3"> <bit>5</bit></item>
- <item name="4"> <bit>6</bit></item>
- <item name="5"> <bit>7</bit></item>
- <item name="Any"> <bit>15</bit></item>
- </enum>
-
- <enum name="KeyButMask">
- <item name="Shift"> <bit>0</bit></item>
- <item name="Lock"> <bit>1</bit></item>
- <item name="Control"><bit>2</bit></item>
- <item name="Mod1"> <bit>3</bit></item>
- <item name="Mod2"> <bit>4</bit></item>
- <item name="Mod3"> <bit>5</bit></item>
- <item name="Mod4"> <bit>6</bit></item>
- <item name="Mod5"> <bit>7</bit></item>
- <item name="Button1"><bit>8</bit></item>
- <item name="Button2"><bit>9</bit></item>
- <item name="Button3"><bit>10</bit></item>
- <item name="Button4"><bit>11</bit></item>
- <item name="Button5"><bit>12</bit></item>
- </enum>
-
- <enum name="Window">
- <item name="None"> <value>0</value></item>
- </enum>
-
- <event name="KeyPress" number="2">
- <field type="KEYCODE" name="detail" />
- <field type="TIMESTAMP" name="time" />
- <field type="WINDOW" name="root" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="child" altenum="Window" />
- <field type="INT16" name="root_x" />
- <field type="INT16" name="root_y" />
- <field type="INT16" name="event_x" />
- <field type="INT16" name="event_y" />
- <field type="CARD16" name="state" mask="KeyButMask" />
- <field type="BOOL" name="same_screen" />
- <pad bytes="1" />
- </event>
-
- <eventcopy name="KeyRelease" number="3" ref="KeyPress" />
-
- <enum name="ButtonMask">
- <item name="1"> <bit>8</bit></item>
- <item name="2"> <bit>9</bit></item>
- <item name="3"> <bit>10</bit></item>
- <item name="4"> <bit>11</bit></item>
- <item name="5"> <bit>12</bit></item>
- <item name="Any"> <bit>15</bit></item>
- </enum>
-
- <event name="ButtonPress" number="4">
- <field type="BUTTON" name="detail" />
- <field type="TIMESTAMP" name="time" />
- <field type="WINDOW" name="root" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="child" altenum="Window" />
- <field type="INT16" name="root_x" />
- <field type="INT16" name="root_y" />
- <field type="INT16" name="event_x" />
- <field type="INT16" name="event_y" />
- <field type="CARD16" name="state" mask="KeyButMask" />
- <field type="BOOL" name="same_screen" />
- <pad bytes="1" />
- </event>
-
- <eventcopy name="ButtonRelease" number="5" ref="ButtonPress" />
-
- <!-- MotionNotify detail -->
- <enum name="Motion">
- <item name="Normal"><value>0</value></item>
- <item name="Hint"> <value>1</value></item>
- </enum>
-
- <event name="MotionNotify" number="6">
- <field type="BYTE" name="detail" enum="Motion" />
- <field type="TIMESTAMP" name="time" />
- <field type="WINDOW" name="root" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="child" altenum="Window" />
- <field type="INT16" name="root_x" />
- <field type="INT16" name="root_y" />
- <field type="INT16" name="event_x" />
- <field type="INT16" name="event_y" />
- <field type="CARD16" name="state" mask="KeyButMask" />
- <field type="BOOL" name="same_screen" />
- <pad bytes="1" />
- </event>
-
- <enum name="NotifyDetail">
- <item name="Ancestor"> <value>0</value></item>
- <item name="Virtual"> <value>1</value></item>
- <item name="Inferior"> <value>2</value></item>
- <item name="Nonlinear"> <value>3</value></item>
- <item name="NonlinearVirtual"><value>4</value></item>
- <item name="Pointer"> <value>5</value></item>
- <item name="PointerRoot"> <value>6</value></item>
- <item name="None"> <value>7</value></item>
- </enum>
-
- <enum name="NotifyMode">
- <item name="Normal"> <value>0</value></item>
- <item name="Grab"> <value>1</value></item>
- <item name="Ungrab"> <value>2</value></item>
- <item name="WhileGrabbed"><value>3</value></item>
- </enum>
-
- <event name="EnterNotify" number="7">
- <field type="BYTE" name="detail" enum="NotifyDetail" />
- <field type="TIMESTAMP" name="time" />
- <field type="WINDOW" name="root" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="child" altenum="Window" />
- <field type="INT16" name="root_x" />
- <field type="INT16" name="root_y" />
- <field type="INT16" name="event_x" />
- <field type="INT16" name="event_y" />
- <field type="CARD16" name="state" mask="KeyButMask" />
- <field type="BYTE" name="mode" enum="NotifyMode" />
- <field type="BYTE" name="same_screen_focus" />
- </event>
-
- <eventcopy name="LeaveNotify" number="8" ref="EnterNotify" />
-
- <event name="FocusIn" number="9">
- <field type="BYTE" name="detail" enum="NotifyDetail" />
- <field type="WINDOW" name="event" />
- <field type="BYTE" name="mode" enum="NotifyMode" />
- <pad bytes="3" />
- </event>
-
- <eventcopy name="FocusOut" number="10" ref="FocusIn" />
-
- <event name="KeymapNotify" number="11" no-sequence-number="true">
- <list type="CARD8" name="keys"><value>31</value></list>
- </event>
-
- <event name="Expose" number="12">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="CARD16" name="x" />
- <field type="CARD16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="CARD16" name="count" />
- <pad bytes="2" />
- </event>
-
- <event name="GraphicsExposure" number="13">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="CARD16" name="x" />
- <field type="CARD16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="CARD16" name="minor_opcode" />
- <field type="CARD16" name="count" />
- <field type="CARD8" name="major_opcode" />
- <pad bytes="3" />
- </event>
-
- <event name="NoExposure" number="14">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="CARD16" name="minor_opcode" />
- <field type="CARD8" name="major_opcode" />
- <pad bytes="1" />
- </event>
-
- <enum name="Visibility">
- <item name="Unobscured"> <value>0</value></item>
- <item name="PartiallyObscured"><value>1</value></item>
- <item name="FullyObscured"> <value>2</value></item>
- </enum>
-
- <event name="VisibilityNotify" number="15">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="BYTE" name="state" enum="Visibility" />
- <pad bytes="3" />
- </event>
-
- <event name="CreateNotify" number="16">
- <pad bytes="1" />
- <field type="WINDOW" name="parent" />
- <field type="WINDOW" name="window" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="CARD16" name="border_width" />
- <field type="BOOL" name="override_redirect" />
- <pad bytes="1" />
- </event>
-
- <event name="DestroyNotify" number="17">
- <pad bytes="1" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="window" />
- </event>
-
- <event name="UnmapNotify" number="18">
- <pad bytes="1" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="window" />
- <field type="BOOL" name="from_configure" />
- <pad bytes="3" />
- </event>
-
- <event name="MapNotify" number="19">
- <pad bytes="1" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="window" />
- <field type="BOOL" name="override_redirect" />
- <pad bytes="3" />
- </event>
-
- <event name="MapRequest" number="20">
- <pad bytes="1" />
- <field type="WINDOW" name="parent" />
- <field type="WINDOW" name="window" />
- </event>
-
- <event name="ReparentNotify" number="21">
- <pad bytes="1" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="window" />
- <field type="WINDOW" name="parent" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="BOOL" name="override_redirect" />
- <pad bytes="3" />
- </event>
-
- <event name="ConfigureNotify" number="22">
- <pad bytes="1" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="window" />
- <field type="WINDOW" name="above_sibling" altenum="Window" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="CARD16" name="border_width" />
- <field type="BOOL" name="override_redirect" />
- <pad bytes="1" />
- </event>
-
- <event name="ConfigureRequest" number="23">
- <field type="BYTE" name="stack_mode" enum="StackMode" />
- <field type="WINDOW" name="parent" />
- <field type="WINDOW" name="window" />
- <field type="WINDOW" name="sibling" altenum="Window" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="CARD16" name="border_width" />
- <field type="CARD16" name="value_mask" mask="ConfigWindow" />
- </event>
-
- <event name="GravityNotify" number="24">
- <pad bytes="1" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="window" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- </event>
-
- <event name="ResizeRequest" number="25">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- </event>
-
- <enum name="Place">
- <item name="OnTop"> <value>0</value></item>
- <item name="OnBottom"><value>1</value></item>
- </enum>
-
- <event name="CirculateNotify" number="26">
- <pad bytes="1" />
- <field type="WINDOW" name="event" />
- <field type="WINDOW" name="window" />
- <pad bytes="4" />
- <field type="BYTE" name="place" enum="Place" />
- <pad bytes="3" />
- </event>
-
- <eventcopy name="CirculateRequest" number="27" ref="CirculateNotify" />
-
- <enum name="Property">
- <item name="NewValue"><value>0</value></item>
- <item name="Delete"> <value>1</value></item>
- </enum>
-
- <event name="PropertyNotify" number="28">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="ATOM" name="atom" />
- <field type="TIMESTAMP" name="time" />
- <field type="BYTE" name="state" enum="Property" />
- <pad bytes="3" />
- </event>
-
- <event name="SelectionClear" number="29">
- <pad bytes="1" />
- <field type="TIMESTAMP" name="time" />
- <field type="WINDOW" name="owner" />
- <field type="ATOM" name="selection" />
- </event>
-
- <enum name="Time">
- <item name="CurrentTime"> <value>0</value> </item>
- </enum>
-
- <enum name="Atom">
- <item name="None"> <value>0</value></item>
- <item name="Any"> <value>0</value></item>
- <item name="PRIMARY" />
- <item name="SECONDARY" />
- <item name="ARC" />
- <item name="ATOM" />
- <item name="BITMAP" />
- <item name="CARDINAL" />
- <item name="COLORMAP" />
- <item name="CURSOR" />
- <item name="CUT_BUFFER0" />
- <item name="CUT_BUFFER1" />
- <item name="CUT_BUFFER2" />
- <item name="CUT_BUFFER3" />
- <item name="CUT_BUFFER4" />
- <item name="CUT_BUFFER5" />
- <item name="CUT_BUFFER6" />
- <item name="CUT_BUFFER7" />
- <item name="DRAWABLE" />
- <item name="FONT" />
- <item name="INTEGER" />
- <item name="PIXMAP" />
- <item name="POINT" />
- <item name="RECTANGLE" />
- <item name="RESOURCE_MANAGER" />
- <item name="RGB_COLOR_MAP" />
- <item name="RGB_BEST_MAP" />
- <item name="RGB_BLUE_MAP" />
- <item name="RGB_DEFAULT_MAP" />
- <item name="RGB_GRAY_MAP" />
- <item name="RGB_GREEN_MAP" />
- <item name="RGB_RED_MAP" />
- <item name="STRING" />
- <item name="VISUALID" />
- <item name="WINDOW" />
- <item name="WM_COMMAND" />
- <item name="WM_HINTS" />
- <item name="WM_CLIENT_MACHINE" />
- <item name="WM_ICON_NAME" />
- <item name="WM_ICON_SIZE" />
- <item name="WM_NAME" />
- <item name="WM_NORMAL_HINTS" />
- <item name="WM_SIZE_HINTS" />
- <item name="WM_ZOOM_HINTS" />
- <item name="MIN_SPACE" />
- <item name="NORM_SPACE" />
- <item name="MAX_SPACE" />
- <item name="END_SPACE" />
- <item name="SUPERSCRIPT_X" />
- <item name="SUPERSCRIPT_Y" />
- <item name="SUBSCRIPT_X" />
- <item name="SUBSCRIPT_Y" />
- <item name="UNDERLINE_POSITION" />
- <item name="UNDERLINE_THICKNESS" />
- <item name="STRIKEOUT_ASCENT" />
- <item name="STRIKEOUT_DESCENT" />
- <item name="ITALIC_ANGLE" />
- <item name="X_HEIGHT" />
- <item name="QUAD_WIDTH" />
- <item name="WEIGHT" />
- <item name="POINT_SIZE" />
- <item name="RESOLUTION" />
- <item name="COPYRIGHT" />
- <item name="NOTICE" />
- <item name="FONT_NAME" />
- <item name="FAMILY_NAME" />
- <item name="FULL_NAME" />
- <item name="CAP_HEIGHT" />
- <item name="WM_CLASS" />
- <item name="WM_TRANSIENT_FOR" />
- </enum>
-
- <event name="SelectionRequest" number="30">
- <pad bytes="1" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- <field type="WINDOW" name="owner" />
- <field type="WINDOW" name="requestor" />
- <field type="ATOM" name="selection" />
- <field type="ATOM" name="target" />
- <field type="ATOM" name="property" altenum="Atom" />
- </event>
-
- <event name="SelectionNotify" number="31">
- <pad bytes="1" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- <field type="WINDOW" name="requestor" />
- <field type="ATOM" name="selection" />
- <field type="ATOM" name="target" />
- <field type="ATOM" name="property" altenum="Atom" />
- </event>
-
- <enum name="ColormapState">
- <item name="Uninstalled"><value>0</value></item>
- <item name="Installed"> <value>1</value></item>
- </enum>
-
- <enum name="Colormap">
- <item name="None"> <value>0</value></item>
- </enum>
-
- <event name="ColormapNotify" number="32">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="COLORMAP" name="colormap" altenum="Colormap" />
- <field type="BOOL" name="new" />
- <field type="BYTE" name="state" enum="ColormapState" />
- <pad bytes="2" />
- </event>
-
- <union name="ClientMessageData">
- <!-- The format member of the ClientMessage event determines which array
- to use. -->
- <list type="CARD8" name="data8" ><value>20</value></list> <!-- 8 -->
- <list type="CARD16" name="data16"><value>10</value></list> <!-- 16 -->
- <list type="CARD32" name="data32"><value>5</value></list> <!-- 32 -->
- </union>
-
- <event name="ClientMessage" number="33">
- <field type="CARD8" name="format" /> <!-- 8, 16, or 32. -->
- <field type="WINDOW" name="window" />
- <field type="ATOM" name="type" />
- <field type="ClientMessageData" name="data" />
- </event>
-
- <enum name="Mapping">
- <item name="Modifier"><value>0</value></item>
- <item name="Keyboard"><value>1</value></item>
- <item name="Pointer"> <value>2</value></item>
- </enum>
-
- <event name="MappingNotify" number="34">
- <pad bytes="1" />
- <field type="BYTE" name="request" enum="Mapping" />
- <field type="KEYCODE" name="first_keycode" />
- <field type="CARD8" name="count" />
- <pad bytes="1" />
- </event>
-
-
-
- <!-- Core error types -->
-
-
-
- <error name="Request" number="1">
- <field type="CARD32" name="bad_value" />
- <field type="CARD16" name="minor_opcode" />
- <field type="CARD8" name="major_opcode" />
- <pad bytes="1" />
- </error>
-
- <error name="Value" number="2">
- <field type="CARD32" name="bad_value" />
- <field type="CARD16" name="minor_opcode" />
- <field type="CARD8" name="major_opcode" />
- <pad bytes="1" />
- </error>
-
- <errorcopy name="Window" number="3" ref="Value" />
- <errorcopy name="Pixmap" number="4" ref="Value" />
- <errorcopy name="Atom" number="5" ref="Value" />
- <errorcopy name="Cursor" number="6" ref="Value" />
- <errorcopy name="Font" number="7" ref="Value" />
- <errorcopy name="Match" number="8" ref="Request" />
- <errorcopy name="Drawable" number="9" ref="Value" />
- <errorcopy name="Access" number="10" ref="Request" />
- <errorcopy name="Alloc" number="11" ref="Request" />
- <errorcopy name="Colormap" number="12" ref="Value" />
- <errorcopy name="GContext" number="13" ref="Value" />
- <errorcopy name="IDChoice" number="14" ref="Value" />
- <errorcopy name="Name" number="15" ref="Request" />
- <errorcopy name="Length" number="16" ref="Request" />
- <errorcopy name="Implementation" number="17" ref="Request" />
-
-
-
- <!-- The core requests, in major number order. -->
- <!-- It is the caller's responsibility to free returned XCB*Rep objects. -->
-
-
-
- <enum name="WindowClass">
- <item name="CopyFromParent"><value>0</value></item>
- <item name="InputOutput"> <value>1</value></item>
- <item name="InputOnly"> <value>2</value></item>
- </enum>
-
- <!-- Window attributes for CreateWindow and ChangeWindowAttributes. -->
- <enum name="CW">
- <item name="BackPixmap"> <bit>0</bit></item>
- <item name="BackPixel"> <bit>1</bit></item>
- <item name="BorderPixmap"> <bit>2</bit></item>
- <item name="BorderPixel"> <bit>3</bit></item>
- <item name="BitGravity"> <bit>4</bit></item>
- <item name="WinGravity"> <bit>5</bit></item>
- <item name="BackingStore"> <bit>6</bit></item>
- <item name="BackingPlanes"> <bit>7</bit></item>
- <item name="BackingPixel"> <bit>8</bit></item>
- <item name="OverrideRedirect"><bit>9</bit></item>
- <item name="SaveUnder"> <bit>10</bit></item>
- <item name="EventMask"> <bit>11</bit></item>
- <item name="DontPropagate"> <bit>12</bit></item>
- <item name="Colormap"> <bit>13</bit></item>
- <item name="Cursor"> <bit>14</bit></item>
- </enum>
-
- <enum name="BackPixmap">
- <item name="None"> <value>0</value></item>
- <item name="ParentRelative"><value>1</value></item>
- </enum>
-
- <enum name="Gravity">
- <item name="BitForget"><value>0</value></item>
- <item name="WinUnmap"> <value>0</value></item>
- <item name="NorthWest"><value>1</value></item>
- <item name="North"> <value>2</value></item>
- <item name="NorthEast"><value>3</value></item>
- <item name="West"> <value>4</value></item>
- <item name="Center"> <value>5</value></item>
- <item name="East"> <value>6</value></item>
- <item name="SouthWest"><value>7</value></item>
- <item name="South"> <value>8</value></item>
- <item name="SouthEast"><value>9</value></item>
- <item name="Static"> <value>10</value></item>
- </enum>
-
- <request name="CreateWindow" opcode="1">
- <field type="CARD8" name="depth" />
- <field type="WINDOW" name="wid" />
- <field type="WINDOW" name="parent" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="CARD16" name="border_width" />
- <field type="CARD16" name="class" enum="WindowClass" />
- <field type="VISUALID" name="visual" />
- <valueparam value-mask-type="CARD32"
- value-mask-name="value_mask"
- value-list-name="value_list" />
- </request>
-
- <request name="ChangeWindowAttributes" opcode="2">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <valueparam value-mask-type="CARD32"
- value-mask-name="value_mask"
- value-list-name="value_list" />
- </request>
-
- <enum name="MapState">
- <item name="Unmapped"> <value>0</value></item>
- <item name="Unviewable"><value>1</value></item>
- <item name="Viewable"> <value>2</value></item>
- </enum>
-
- <request name="GetWindowAttributes" opcode="3">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <reply>
- <field type="CARD8" name="backing_store" enum="BackingStore" />
- <field type="VISUALID" name="visual" />
- <field type="CARD16" name="class" enum="WindowClass" />
- <field type="CARD8" name="bit_gravity" enum="Gravity" />
- <field type="CARD8" name="win_gravity" enum="Gravity" />
- <field type="CARD32" name="backing_planes" />
- <field type="CARD32" name="backing_pixel" />
- <field type="BOOL" name="save_under" />
- <field type="BOOL" name="map_is_installed" />
- <field type="CARD8" name="map_state" enum="MapState" />
- <field type="BOOL" name="override_redirect" />
- <field type="COLORMAP" name="colormap" altenum="Colormap" />
- <field type="CARD32" name="all_event_masks" mask="EventMask" />
- <field type="CARD32" name="your_event_mask" mask="EventMask" />
- <field type="CARD16" name="do_not_propagate_mask" mask="EventMask" />
- <pad bytes="2" />
- </reply>
- </request>
-
- <request name="DestroyWindow" opcode="4">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- </request>
-
- <request name="DestroySubwindows" opcode="5">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- </request>
-
- <enum name="SetMode">
- <item name="Insert"><value>0</value></item>
- <item name="Delete"><value>1</value></item>
- </enum>
-
- <request name="ChangeSaveSet" opcode="6">
- <field type="BYTE" name="mode" enum="SetMode" />
- <field type="WINDOW" name="window" />
- </request>
-
- <request name="ReparentWindow" opcode="7">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="WINDOW" name="parent" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- </request>
-
- <request name="MapWindow" opcode="8">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- </request>
-
- <request name="MapSubwindows" opcode="9">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- </request>
-
- <request name="UnmapWindow" opcode="10">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- </request>
-
- <request name="UnmapSubwindows" opcode="11">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- </request>
-
- <enum name="ConfigWindow">
- <item name="X"> <bit>0</bit></item>
- <item name="Y"> <bit>1</bit></item>
- <item name="Width"> <bit>2</bit></item>
- <item name="Height"> <bit>3</bit></item>
- <item name="BorderWidth"><bit>4</bit></item>
- <item name="Sibling"> <bit>5</bit></item>
- <item name="StackMode"> <bit>6</bit></item>
- </enum>
-
- <enum name="StackMode">
- <item name="Above"> <value>0</value></item>
- <item name="Below"> <value>1</value></item>
- <item name="TopIf"> <value>2</value></item>
- <item name="BottomIf"><value>3</value></item>
- <item name="Opposite"><value>4</value></item>
- </enum>
-
- <request name="ConfigureWindow" opcode="12">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="CARD16" name="value_mask" />
- <pad bytes="2" />
- <valueparam value-mask-type="CARD16"
- value-mask-name="value_mask"
- value-list-name="value_list" />
- </request>
-
- <enum name="Circulate">
- <item name="RaiseLowest"> <value>0</value></item>
- <item name="LowerHighest"><value>1</value></item>
- </enum>
-
- <request name="CirculateWindow" opcode="13">
- <field type="CARD8" name="direction" enum="Circulate" />
- <field type="WINDOW" name="window" />
- </request>
-
- <request name="GetGeometry" opcode="14">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <reply>
- <field type="CARD8" name="depth" />
- <field type="WINDOW" name="root" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="CARD16" name="border_width" />
- <pad bytes="2" />
- </reply>
- </request>
-
- <request name="QueryTree" opcode="15">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <reply>
- <pad bytes="1" />
- <field type="WINDOW" name="root" />
- <field type="WINDOW" name="parent" altenum="Window" />
- <field type="CARD16" name="children_len" />
- <pad bytes="14" />
- <list type="WINDOW" name="children">
- <fieldref>children_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="InternAtom" opcode="16">
- <field type="BOOL" name="only_if_exists" />
- <field type="CARD16" name="name_len" />
- <pad bytes="2" />
- <list type="char" name="name">
- <fieldref>name_len</fieldref>
- </list>
- <reply>
- <pad bytes="1" />
- <field type="ATOM" name="atom" altenum="Atom" />
- </reply>
- </request>
-
- <request name="GetAtomName" opcode="17">
- <pad bytes="1" />
- <field type="ATOM" name="atom" />
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="name_len" />
- <pad bytes="22" />
- <list type="char" name="name">
- <fieldref>name_len</fieldref>
- </list>
- </reply>
- </request>
-
- <enum name="PropMode">
- <item name="Replace"><value>0</value></item>
- <item name="Prepend"><value>1</value></item>
- <item name="Append"> <value>2</value></item>
- </enum>
-
- <request name="ChangeProperty" opcode="18">
- <field type="CARD8" name="mode" enum="PropMode" />
- <field type="WINDOW" name="window" />
- <field type="ATOM" name="property" />
- <field type="ATOM" name="type" />
- <field type="CARD8" name="format" />
- <pad bytes="3" />
- <field type="CARD32" name="data_len" />
- <list type="void" name="data">
- <op op="/">
- <op op="*">
- <fieldref>data_len</fieldref>
- <fieldref>format</fieldref>
- </op>
- <value>8</value>
- </op>
- </list>
- </request>
-
- <request name="DeleteProperty" opcode="19">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="ATOM" name="property" />
- </request>
-
- <enum name="GetPropertyType">
- <item name="Any"><value>0</value></item>
- </enum>
-
- <request name="GetProperty" opcode="20">
- <field type="BOOL" name="delete" />
- <field type="WINDOW" name="window" />
- <field type="ATOM" name="property" />
- <field type="ATOM" name="type" altenum="GetPropertyType" />
- <field type="CARD32" name="long_offset" />
- <field type="CARD32" name="long_length" />
- <reply>
- <field type="CARD8" name="format" />
- <field type="ATOM" name="type" />
- <field type="CARD32" name="bytes_after" />
- <field type="CARD32" name="value_len" />
- <pad bytes="12" />
- <list type="void" name="value">
- <op op="*">
- <fieldref>value_len</fieldref>
- <op op="/">
- <fieldref>format</fieldref>
- <value>8</value>
- </op>
- </op>
- </list>
- </reply>
- </request>
-
- <request name="ListProperties" opcode="21">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="atoms_len" />
- <pad bytes="22" />
- <list type="ATOM" name="atoms">
- <fieldref>atoms_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="SetSelectionOwner" opcode="22">
- <pad bytes="1" />
- <field type="WINDOW" name="owner" altenum="Window" />
- <field type="ATOM" name="selection" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- </request>
-
- <request name="GetSelectionOwner" opcode="23">
- <pad bytes="1" />
- <field type="ATOM" name="selection" />
- <reply>
- <pad bytes="1" />
- <field type="WINDOW" name="owner" altenum="Window" />
- </reply>
- </request>
-
- <request name="ConvertSelection" opcode="24">
- <pad bytes="1" />
- <field type="WINDOW" name="requestor" />
- <field type="ATOM" name="selection" />
- <field type="ATOM" name="target" />
- <field type="ATOM" name="property" altenum="Atom" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- </request>
-
- <enum name="SendEventDest">
- <item name="PointerWindow"><value>0</value></item>
- <item name="ItemFocus"> <value>1</value></item>
- </enum>
-
- <request name="SendEvent" opcode="25">
- <field type="BOOL" name="propagate" />
- <field type="WINDOW" name="destination" altenum="SendEventDest" />
- <field type="CARD32" name="event_mask" mask="EventMask" />
- <list type="char" name="event"><value>32</value></list>
- </request>
-
- <enum name="GrabMode">
- <item name="Sync"> <value>0</value></item>
- <item name="Async"><value>1</value></item>
- </enum>
-
- <enum name="GrabStatus">
- <item name="Success"> <value>0</value></item>
- <item name="AlreadyGrabbed"><value>1</value></item>
- <item name="InvalidTime"> <value>2</value></item>
- <item name="NotViewable"> <value>3</value></item>
- <item name="Frozen"> <value>4</value></item>
- </enum>
-
- <enum name="Cursor">
- <item name="None"> <value>0</value></item>
- </enum>
-
- <request name="GrabPointer" opcode="26">
- <field type="BOOL" name="owner_events" />
- <field type="WINDOW" name="grab_window" />
- <field type="CARD16" name="event_mask" mask="EventMask" />
- <field type="BYTE" name="pointer_mode" enum="GrabMode" />
- <field type="BYTE" name="keyboard_mode" enum="GrabMode" />
- <field type="WINDOW" name="confine_to" altenum="Window" />
- <field type="CURSOR" name="cursor" altenum="Cursor" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- <reply>
- <field type="BYTE" name="status" enum="GrabStatus" />
- </reply>
- </request>
-
- <request name="UngrabPointer" opcode="27">
- <pad bytes="1" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- </request>
-
- <enum name="ButtonIndex">
- <item name="Any"><value>0</value></item>
- <item name="1"> <value>1</value></item>
- <item name="2"> <value>2</value></item>
- <item name="3"> <value>3</value></item>
- <item name="4"> <value>4</value></item>
- <item name="5"> <value>5</value></item>
- </enum>
-
- <request name="GrabButton" opcode="28">
- <field type="BOOL" name="owner_events" />
- <field type="WINDOW" name="grab_window" />
- <field type="CARD16" name="event_mask" mask="EventMask" />
- <field type="CARD8" name="pointer_mode" enum="GrabMode" />
- <field type="CARD8" name="keyboard_mode" enum="GrabMode" />
- <field type="WINDOW" name="confine_to" altenum="Window" />
- <field type="CURSOR" name="cursor" altenum="Cursor" />
- <field type="CARD8" name="button" enum="ButtonIndex" />
- <pad bytes="1" />
- <field type="CARD16" name="modifiers" mask="ModMask" />
- </request>
-
- <request name="UngrabButton" opcode="29">
- <field type="CARD8" name="button" enum="ButtonIndex" />
- <field type="WINDOW" name="grab_window" />
- <field type="CARD16" name="modifiers" mask="ModMask" />
- <pad bytes="2" />
- </request>
-
- <request name="ChangeActivePointerGrab" opcode="30">
- <pad bytes="1" />
- <field type="CURSOR" name="cursor" altenum="Cursor" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- <field type="CARD16" name="event_mask" mask="EventMask" />
- <pad bytes="2" />
- </request>
-
- <request name="GrabKeyboard" opcode="31">
- <field type="BOOL" name="owner_events" />
- <field type="WINDOW" name="grab_window" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- <field type="BYTE" name="pointer_mode" enum="GrabMode" />
- <field type="BYTE" name="keyboard_mode" enum="GrabMode" />
- <pad bytes="2" />
- <reply>
- <field type="BYTE" name="status" enum="GrabStatus" />
- </reply>
- </request>
-
- <request name="UngrabKeyboard" opcode="32">
- <pad bytes="1" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- </request>
-
- <!-- Use KEYCODE any = { XCBGrabAny }; to grab any key -->
- <enum name="Grab">
- <item name="Any"><value>0</value></item>
- </enum>
-
- <request name="GrabKey" opcode="33">
- <field type="BOOL" name="owner_events" />
- <field type="WINDOW" name="grab_window" />
- <field type="CARD16" name="modifiers" mask="ModMask" />
- <field type="KEYCODE" name="key" altenum="Grab" />
- <field type="CARD8" name="pointer_mode" enum="GrabMode" />
- <field type="CARD8" name="keyboard_mode" enum="GrabMode" />
- <pad bytes="3" />
- </request>
-
- <request name="UngrabKey" opcode="34">
- <field type="KEYCODE" name="key" altenum="Grab" />
- <field type="WINDOW" name="grab_window" />
- <field type="CARD16" name="modifiers" mask="ModMask" />
- <pad bytes="2" />
- </request>
-
- <enum name="Allow">
- <item name="AsyncPointer"> <value>0</value></item>
- <item name="SyncPointer"> <value>1</value></item>
- <item name="ReplayPointer"> <value>2</value></item>
- <item name="AsyncKeyboard"> <value>3</value></item>
- <item name="SyncKeyboard"> <value>4</value></item>
- <item name="ReplayKeyboard"><value>5</value></item>
- <item name="AsyncBoth"> <value>6</value></item>
- <item name="SyncBoth"> <value>7</value></item>
- </enum>
-
- <request name="AllowEvents" opcode="35">
- <field type="CARD8" name="mode" enum="Allow" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- </request>
-
- <request name="GrabServer" opcode="36" />
-
- <request name="UngrabServer" opcode="37" />
-
- <request name="QueryPointer" opcode="38">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <reply>
- <field type="BOOL" name="same_screen" />
- <field type="WINDOW" name="root" />
- <field type="WINDOW" name="child" altenum="Window" />
- <field type="INT16" name="root_x" />
- <field type="INT16" name="root_y" />
- <field type="INT16" name="win_x" />
- <field type="INT16" name="win_y" />
- <field type="CARD16" name="mask" mask="KeyButMask" />
- <pad bytes="2" />
- </reply>
- </request>
-
- <struct name="TIMECOORD">
- <field type="TIMESTAMP" name="time" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- </struct>
-
- <request name="GetMotionEvents" opcode="39">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="TIMESTAMP" name="start" altenum="Time" />
- <field type="TIMESTAMP" name="stop" altenum="Time" />
- <reply>
- <pad bytes="1" />
- <field type="CARD32" name="events_len" />
- <pad bytes="20" />
- <list type="TIMECOORD" name="events">
- <fieldref>events_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="TranslateCoordinates" opcode="40">
- <pad bytes="1" />
- <field type="WINDOW" name="src_window" />
- <field type="WINDOW" name="dst_window" />
- <field type="INT16" name="src_x" />
- <field type="INT16" name="src_y" />
- <reply>
- <field type="BOOL" name="same_screen" />
- <field type="WINDOW" name="child" altenum="Window" />
- <field type="INT16" name="dst_x" />
- <field type="INT16" name="dst_y" />
- </reply>
- </request>
-
- <request name="WarpPointer" opcode="41">
- <pad bytes="1" />
- <field type="WINDOW" name="src_window" altenum="Window" />
- <field type="WINDOW" name="dst_window" altenum="Window" />
- <field type="INT16" name="src_x" />
- <field type="INT16" name="src_y" />
- <field type="CARD16" name="src_width" />
- <field type="CARD16" name="src_height" />
- <field type="INT16" name="dst_x" />
- <field type="INT16" name="dst_y" />
- </request>
-
- <!-- used for revert_to and focus -->
- <enum name="InputFocus">
- <item name="None"> <value>0</value></item>
- <item name="PointerRoot"><value>1</value></item>
- <item name="Parent"> <value>2</value></item> <!-- revert_to only -->
- <item name="FollowKeyboard"><value>3</value></item> <!-- xinput extension only -->
- </enum>
-
- <request name="SetInputFocus" opcode="42">
- <field type="CARD8" name="revert_to" enum="InputFocus" />
- <field type="WINDOW" name="focus" altenum="InputFocus" />
- <field type="TIMESTAMP" name="time" altenum="Time" />
- </request>
-
- <request name="GetInputFocus" opcode="43">
- <reply>
- <field type="CARD8" name="revert_to" enum="InputFocus" />
- <field type="WINDOW" name="focus" altenum="InputFocus" />
- </reply>
- </request>
-
- <request name="QueryKeymap" opcode="44">
- <reply>
- <pad bytes="1" />
- <list type="CARD8" name="keys"><value>32</value></list>
- </reply>
- </request>
-
- <request name="OpenFont" opcode="45">
- <pad bytes="1" />
- <field type="FONT" name="fid" />
- <field type="CARD16" name="name_len" />
- <pad bytes="2" />
- <list type="char" name="name">
- <fieldref>name_len</fieldref>
- </list>
- </request>
-
- <request name="CloseFont" opcode="46">
- <pad bytes="1" />
- <field type="FONT" name="font" />
- </request>
-
- <enum name="FontDraw">
- <item name="LeftToRight"><value>0</value></item>
- <item name="RightToLeft"><value>1</value></item>
- </enum>
-
- <struct name="FONTPROP">
- <field type="ATOM" name="name" />
- <field type="CARD32" name="value" />
- </struct>
-
- <struct name="CHARINFO">
- <field type="INT16" name="left_side_bearing" />
- <field type="INT16" name="right_side_bearing" />
- <field type="INT16" name="character_width" />
- <field type="INT16" name="ascent" />
- <field type="INT16" name="descent" />
- <field type="CARD16" name="attributes" />
- </struct>
-
- <request name="QueryFont" opcode="47">
- <pad bytes="1" />
- <field type="FONTABLE" name="font" />
- <reply>
- <pad bytes="1" />
- <field type="CHARINFO" name="min_bounds" />
- <pad bytes="4" />
- <field type="CHARINFO" name="max_bounds" />
- <pad bytes="4" />
- <field type="CARD16" name="min_char_or_byte2" />
- <field type="CARD16" name="max_char_or_byte2" />
- <field type="CARD16" name="default_char" />
- <field type="CARD16" name="properties_len" />
- <field type="BYTE" name="draw_direction" enum="FontDraw" />
- <field type="CARD8" name="min_byte1" />
- <field type="CARD8" name="max_byte1" />
- <field type="BOOL" name="all_chars_exist" />
- <field type="INT16" name="font_ascent" />
- <field type="INT16" name="font_descent" />
- <field type="CARD32" name="char_infos_len" />
- <list type="FONTPROP" name="properties">
- <fieldref>properties_len</fieldref>
- </list>
- <list type="CHARINFO" name="char_infos">
- <fieldref>char_infos_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="QueryTextExtents" opcode="48">
- <exprfield type="BOOL" name="odd_length">
- <op op="&amp;"><fieldref>string_len</fieldref><value>1</value></op>
- </exprfield>
- <field type="FONTABLE" name="font" />
- <list type="CHAR2B" name="string" />
- <reply>
- <field type="BYTE" name="draw_direction" enum="FontDraw" />
- <field type="INT16" name="font_ascent" />
- <field type="INT16" name="font_descent" />
- <field type="INT16" name="overall_ascent" />
- <field type="INT16" name="overall_descent" />
- <field type="INT32" name="overall_width" />
- <field type="INT32" name="overall_left" />
- <field type="INT32" name="overall_right" />
- </reply>
- </request>
-
- <struct name="STR">
- <field type="CARD8" name="name_len" />
- <list type="char" name="name">
- <fieldref>name_len</fieldref>
- </list>
- </struct>
-
- <request name="ListFonts" opcode="49">
- <pad bytes="1" />
- <field type="CARD16" name="max_names" />
- <field type="CARD16" name="pattern_len" />
- <list type="char" name="pattern">
- <fieldref>pattern_len</fieldref>
- </list>
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="names_len" />
- <pad bytes="22" />
- <list type="STR" name="names">
- <fieldref>names_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="ListFontsWithInfo" opcode="50">
- <pad bytes="1" />
- <field type="CARD16" name="max_names" />
- <field type="CARD16" name="pattern_len" />
- <list type="char" name="pattern">
- <fieldref>pattern_len</fieldref>
- </list>
- <reply>
- <field type="CARD8" name="name_len" />
- <field type="CHARINFO" name="min_bounds" />
- <pad bytes="4" />
- <field type="CHARINFO" name="max_bounds" />
- <pad bytes="4" />
- <field type="CARD16" name="min_char_or_byte2" />
- <field type="CARD16" name="max_char_or_byte2" />
- <field type="CARD16" name="default_char" />
- <field type="CARD16" name="properties_len" />
- <field type="BYTE" name="draw_direction" enum="FontDraw" />
- <field type="CARD8" name="min_byte1" />
- <field type="CARD8" name="max_byte1" />
- <field type="BOOL" name="all_chars_exist" />
- <field type="INT16" name="font_ascent" />
- <field type="INT16" name="font_descent" />
- <field type="CARD32" name="replies_hint" />
- <list type="FONTPROP" name="properties">
- <fieldref>properties_len</fieldref>
- </list>
- <list type="char" name="name">
- <fieldref>name_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="SetFontPath" opcode="51">
- <pad bytes="1" />
- <field type="CARD16" name="font_qty" />
- <list type="char" name="path" />
- </request>
-
- <request name="GetFontPath" opcode="52">
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="path_len" />
- <pad bytes="22" />
- <list type="STR" name="path">
- <fieldref>path_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="CreatePixmap" opcode="53">
- <field type="CARD8" name="depth" />
- <field type="PIXMAP" name="pid" />
- <field type="DRAWABLE" name="drawable" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- </request>
-
- <request name="FreePixmap" opcode="54">
- <pad bytes="1" />
- <field type="PIXMAP" name="pixmap" />
- </request>
-
- <enum name="GC">
- <item name="Function"> <bit>0</bit></item>
- <item name="PlaneMask"> <bit>1</bit></item>
- <item name="Foreground"> <bit>2</bit></item>
- <item name="Background"> <bit>3</bit></item>
- <item name="LineWidth"> <bit>4</bit></item>
- <item name="LineStyle"> <bit>5</bit></item>
- <item name="CapStyle"> <bit>6</bit></item>
- <item name="JoinStyle"> <bit>7</bit></item>
- <item name="FillStyle"> <bit>8</bit></item>
- <item name="FillRule"> <bit>9</bit></item>
- <item name="Tile"> <bit>10</bit></item>
- <item name="Stipple"> <bit>11</bit></item>
- <item name="TileStippleOriginX"><bit>12</bit></item>
- <item name="TileStippleOriginY"><bit>13</bit></item>
- <item name="Font"> <bit>14</bit></item>
- <item name="SubwindowMode"> <bit>15</bit></item>
- <item name="GraphicsExposures"> <bit>16</bit></item>
- <item name="ClipOriginX"> <bit>17</bit></item>
- <item name="ClipOriginY"> <bit>18</bit></item>
- <item name="ClipMask"> <bit>19</bit></item>
- <item name="DashOffset"> <bit>20</bit></item>
- <item name="DashList"> <bit>21</bit></item>
- <item name="ArcMode"> <bit>22</bit></item>
- </enum>
-
- <!-- GC Function values -->
- <enum name="GX">
- <item name="clear"> <value>0</value></item>
- <item name="and"> <value>1</value></item>
- <item name="andReverse"> <value>2</value></item>
- <item name="copy"> <value>3</value></item>
- <item name="andInverted"> <value>4</value></item>
- <item name="noop"> <value>5</value></item>
- <item name="xor"> <value>6</value></item>
- <item name="or"> <value>7</value></item>
- <item name="nor"> <value>8</value></item>
- <item name="equiv"> <value>9</value></item>
- <item name="invert"> <value>10</value></item>
- <item name="orReverse"> <value>11</value></item>
- <item name="copyInverted"><value>12</value></item>
- <item name="orInverted"> <value>13</value></item>
- <item name="nand"> <value>14</value></item>
- <item name="set"> <value>15</value></item>
- </enum>
-
- <enum name="LineStyle">
- <item name="Solid"> <value>0</value></item>
- <item name="OnOffDash"> <value>1</value></item>
- <item name="DoubleDash"><value>2</value></item>
- </enum>
-
- <enum name="CapStyle">
- <item name="NotLast"> <value>0</value></item>
- <item name="Butt"> <value>1</value></item>
- <item name="Round"> <value>2</value></item>
- <item name="Projecting"><value>3</value></item>
- </enum>
-
- <enum name="JoinStyle">
- <item name="Miter"> <value>0</value></item>
- <item name="Round"> <value>1</value></item>
- <item name="Bevel"> <value>2</value></item>
- </enum>
-
- <enum name="FillStyle">
- <item name="Solid"> <value>0</value></item>
- <item name="Tiled"> <value>1</value></item>
- <item name="Stippled"> <value>2</value></item>
- <item name="OpaqueStippled"><value>3</value></item>
- </enum>
-
- <enum name="FillRule">
- <item name="EvenOdd"><value>0</value></item>
- <item name="Winding"><value>1</value></item>
- </enum>
-
- <enum name="SubwindowMode">
- <item name="ClipByChildren"> <value>0</value></item>
- <item name="IncludeInferiors"><value>1</value></item>
- </enum>
-
- <enum name="ArcMode">
- <item name="Chord"> <value>0</value></item>
- <item name="PieSlice"><value>1</value></item>
- </enum>
-
- <request name="CreateGC" opcode="55">
- <pad bytes="1" />
- <field type="GCONTEXT" name="cid" />
- <field type="DRAWABLE" name="drawable" />
- <valueparam value-mask-type="CARD32"
- value-mask-name="value_mask"
- value-list-name="value_list" />
- </request>
-
- <request name="ChangeGC" opcode="56">
- <pad bytes="1" />
- <field type="GCONTEXT" name="gc" />
- <valueparam value-mask-type="CARD32"
- value-mask-name="value_mask"
- value-list-name="value_list" />
- </request>
-
- <request name="CopyGC" opcode="57">
- <pad bytes="1" />
- <field type="GCONTEXT" name="src_gc" />
- <field type="GCONTEXT" name="dst_gc" />
- <field type="CARD32" name="value_mask" mask="GC" />
- </request>
-
- <request name="SetDashes" opcode="58">
- <pad bytes="1" />
- <field type="GCONTEXT" name="gc" />
- <field type="CARD16" name="dash_offset" />
- <field type="CARD16" name="dashes_len" />
- <list type="CARD8" name="dashes">
- <fieldref>dashes_len</fieldref>
- </list>
- </request>
-
- <enum name="ClipOrdering">
- <item name="Unsorted"><value>0</value></item>
- <item name="YSorted"> <value>1</value></item>
- <item name="YXSorted"><value>2</value></item>
- <item name="YXBanded"><value>3</value></item>
- </enum>
-
- <request name="SetClipRectangles" opcode="59">
- <field type="BYTE" name="ordering" enum="ClipOrdering" />
- <field type="GCONTEXT" name="gc" />
- <field type="INT16" name="clip_x_origin" />
- <field type="INT16" name="clip_y_origin" />
- <list type="RECTANGLE" name="rectangles" />
- </request>
-
- <request name="FreeGC" opcode="60">
- <pad bytes="1" />
- <field type="GCONTEXT" name="gc" />
- </request>
-
- <request name="ClearArea" opcode="61">
- <field type="BOOL" name="exposures" />
- <field type="WINDOW" name="window" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- </request>
-
- <request name="CopyArea" opcode="62">
- <pad bytes="1" />
- <field type="DRAWABLE" name="src_drawable" />
- <field type="DRAWABLE" name="dst_drawable" />
- <field type="GCONTEXT" name="gc" />
- <field type="INT16" name="src_x" />
- <field type="INT16" name="src_y" />
- <field type="INT16" name="dst_x" />
- <field type="INT16" name="dst_y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- </request>
-
- <request name="CopyPlane" opcode="63">
- <pad bytes="1" />
- <field type="DRAWABLE" name="src_drawable" />
- <field type="DRAWABLE" name="dst_drawable" />
- <field type="GCONTEXT" name="gc" />
- <field type="INT16" name="src_x" />
- <field type="INT16" name="src_y" />
- <field type="INT16" name="dst_x" />
- <field type="INT16" name="dst_y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="CARD32" name="bit_plane" />
- </request>
-
- <enum name="CoordMode">
- <item name="Origin"> <value>0</value></item>
- <item name="Previous"><value>1</value></item>
- </enum>
-
- <!-- combine-adjacent doesn't work for mode==Relative -->
- <request name="PolyPoint" opcode="64">
- <field type="BYTE" name="coordinate_mode" enum="CoordMode" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <list type="POINT" name="points" />
- </request>
-
- <request name="PolyLine" opcode="65" combine-adjacent="true">
- <field type="BYTE" name="coordinate_mode" enum="CoordMode" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <list type="POINT" name="points" />
- </request>
-
- <struct name="SEGMENT">
- <field type="INT16" name="x1" />
- <field type="INT16" name="y1" />
- <field type="INT16" name="x2" />
- <field type="INT16" name="y2" />
- </struct>
-
- <request name="PolySegment" opcode="66" combine-adjacent="true">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <list type="SEGMENT" name="segments" />
- </request>
-
- <request name="PolyRectangle" opcode="67" combine-adjacent="true">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <list type="RECTANGLE" name="rectangles" />
- </request>
-
- <!--
- The semantics of PolyArc change after the first arc: the GC's
- join style may be applied to successive arcs under some circumstances.
- So using combine-adjacent here is bad.
- -->
- <request name="PolyArc" opcode="68">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <list type="ARC" name="arcs" />
- </request>
-
- <enum name="PolyShape">
- <item name="Complex"> <value>0</value></item>
- <item name="Nonconvex"><value>1</value></item>
- <item name="Convex"> <value>2</value></item>
- </enum>
-
- <request name="FillPoly" opcode="69">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <field type="CARD8" name="shape" enum="PolyShape" />
- <field type="CARD8" name="coordinate_mode" enum="CoordMode" />
- <pad bytes="2" />
- <list type="POINT" name="points" />
- </request>
-
- <request name="PolyFillRectangle" opcode="70" combine-adjacent="true">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <list type="RECTANGLE" name="rectangles" />
- </request>
-
- <request name="PolyFillArc" opcode="71" combine-adjacent="true">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <list type="ARC" name="arcs" />
- </request>
-
- <enum name="ImageFormat">
- <item name="XYBitmap"><value>0</value></item>
- <item name="XYPixmap"><value>1</value></item>
- <item name="ZPixmap"> <value>2</value></item>
- </enum>
-
- <request name="PutImage" opcode="72">
- <field type="CARD8" name="format" enum="ImageFormat" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="INT16" name="dst_x" />
- <field type="INT16" name="dst_y" />
- <field type="CARD8" name="left_pad" />
- <field type="CARD8" name="depth" />
- <pad bytes="2" />
- <list type="BYTE" name="data" />
- </request>
-
- <!-- FIXME: data array in reply will include padding, but ought not to. -->
- <request name="GetImage" opcode="73">
- <field type="CARD8" name="format" enum="ImageFormat" />
- <field type="DRAWABLE" name="drawable" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <field type="CARD32" name="plane_mask" />
- <reply>
- <field type="CARD8" name="depth" />
- <field type="VISUALID" name="visual" />
- <pad bytes="20" />
- <list type="BYTE" name="data">
- <op op="*">
- <fieldref>length</fieldref>
- <value>4</value>
- </op>
- </list>
- </reply>
- </request>
-
- <request name="PolyText8" opcode="74">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <list type="BYTE" name="items" />
- </request>
-
- <request name="PolyText16" opcode="75">
- <pad bytes="1" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <list type="BYTE" name="items" />
- </request>
-
- <request name="ImageText8" opcode="76">
- <field type="BYTE" name="string_len" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <list type="char" name="string">
- <fieldref>string_len</fieldref>
- </list>
- </request>
-
- <request name="ImageText16" opcode="77">
- <field type="BYTE" name="string_len" />
- <field type="DRAWABLE" name="drawable" />
- <field type="GCONTEXT" name="gc" />
- <field type="INT16" name="x" />
- <field type="INT16" name="y" />
- <list type="CHAR2B" name="string">
- <fieldref>string_len</fieldref>
- </list>
- </request>
-
- <enum name= "ColormapAlloc">
- <item name="None"><value>0</value></item>
- <item name="All"> <value>1</value></item>
- </enum>
-
- <request name="CreateColormap" opcode="78">
- <field type="BYTE" name="alloc" enum="ColormapAlloc" />
- <field type="COLORMAP" name="mid" />
- <field type="WINDOW" name="window" />
- <field type="VISUALID" name="visual" />
- </request>
-
- <request name="FreeColormap" opcode="79">
- <pad bytes="1" />
- <field type="COLORMAP" name="cmap" />
- </request>
-
- <request name="CopyColormapAndFree" opcode="80">
- <pad bytes="1" />
- <field type="COLORMAP" name="mid" />
- <field type="COLORMAP" name="src_cmap" />
- </request>
-
- <request name="InstallColormap" opcode="81">
- <pad bytes="1" />
- <field type="COLORMAP" name="cmap" />
- </request>
-
- <request name="UninstallColormap" opcode="82">
- <pad bytes="1" />
- <field type="COLORMAP" name="cmap" />
- </request>
-
- <request name="ListInstalledColormaps" opcode="83">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="cmaps_len" />
- <pad bytes="22" />
- <list type="COLORMAP" name="cmaps">
- <fieldref>cmaps_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="AllocColor" opcode="84">
- <pad bytes="1" />
- <field type="COLORMAP" name="cmap" />
- <field type="CARD16" name="red" />
- <field type="CARD16" name="green" />
- <field type="CARD16" name="blue" />
- <pad bytes="2" />
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="red" />
- <field type="CARD16" name="green" />
- <field type="CARD16" name="blue" />
- <pad bytes="2" />
- <field type="CARD32" name="pixel" />
- </reply>
- </request>
-
- <request name="AllocNamedColor" opcode="85">
- <pad bytes="1" />
- <field type="COLORMAP" name="cmap" />
- <field type="CARD16" name="name_len" />
- <pad bytes="2" />
- <list type="char" name="name">
- <fieldref>name_len</fieldref>
- </list>
- <reply>
- <pad bytes="1" />
- <field type="CARD32" name="pixel" />
- <field type="CARD16" name="exact_red" />
- <field type="CARD16" name="exact_green" />
- <field type="CARD16" name="exact_blue" />
- <field type="CARD16" name="visual_red" />
- <field type="CARD16" name="visual_green" />
- <field type="CARD16" name="visual_blue" />
- </reply>
- </request>
-
- <request name="AllocColorCells" opcode="86">
- <field type="BOOL" name="contiguous" />
- <field type="COLORMAP" name="cmap" />
- <field type="CARD16" name="colors" />
- <field type="CARD16" name="planes" />
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="pixels_len" />
- <field type="CARD16" name="masks_len" />
- <pad bytes="20" />
- <list type="CARD32" name="pixels">
- <fieldref>pixels_len</fieldref>
- </list>
- <list type="CARD32" name="masks">
- <fieldref>masks_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="AllocColorPlanes" opcode="87">
- <field type="BOOL" name="contiguous" />
- <field type="COLORMAP" name="cmap" />
- <field type="CARD16" name="colors" />
- <field type="CARD16" name="reds" />
- <field type="CARD16" name="greens" />
- <field type="CARD16" name="blues" />
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="pixels_len" />
- <pad bytes="2" />
- <field type="CARD32" name="red_mask" />
- <field type="CARD32" name="green_mask" />
- <field type="CARD32" name="blue_mask" />
- <pad bytes="8" />
- <list type="CARD32" name="pixels">
- <fieldref>pixels_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="FreeColors" opcode="88">
- <pad bytes="1" />
- <field type="COLORMAP" name="cmap" />
- <field type="CARD32" name="plane_mask" />
- <list type="CARD32" name="pixels" />
- </request>
-
- <enum name="ColorFlag">
- <item name="Red"> <bit>0</bit></item>
- <item name="Green"><bit>1</bit></item>
- <item name="Blue"> <bit>2</bit></item>
- </enum>
-
- <struct name="COLORITEM">
- <field type="CARD32" name="pixel" />
- <field type="CARD16" name="red" />
- <field type="CARD16" name="green" />
- <field type="CARD16" name="blue" />
- <field type="BYTE" name="flags" mask="ColorFlag" />
- <pad bytes="1" />
- </struct>
-
- <request name="StoreColors" opcode="89" combine-adjacent="true">
- <pad bytes="1" />
- <field type="COLORMAP" name="cmap" />
- <list type="COLORITEM" name="items" />
- </request>
-
- <request name="StoreNamedColor" opcode="90">
- <field type="CARD8" name="flags" mask="ColorFlag" />
- <field type="COLORMAP" name="cmap" />
- <field type="CARD32" name="pixel" />
- <field type="CARD16" name="name_len" />
- <pad bytes="2" />
- <list type="char" name="name">
- <fieldref>name_len</fieldref>
- </list>
- </request>
-
- <struct name="RGB">
- <field type="CARD16" name="red" />
- <field type="CARD16" name="green" />
- <field type="CARD16" name="blue" />
- <pad bytes="2" />
- </struct>
-
- <request name="QueryColors" opcode="91">
- <pad bytes="1" />
- <field type="COLORMAP" name="cmap" />
- <list type="CARD32" name="pixels" />
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="colors_len" />
- <pad bytes="22" />
- <list type="RGB" name="colors">
- <fieldref>colors_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="LookupColor" opcode="92">
- <pad bytes="1" />
- <field type="COLORMAP" name="cmap" />
- <field type="CARD16" name="name_len" />
- <pad bytes="2" />
- <list type="char" name="name">
- <fieldref>name_len</fieldref>
- </list>
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="exact_red" />
- <field type="CARD16" name="exact_green" />
- <field type="CARD16" name="exact_blue" />
- <field type="CARD16" name="visual_red" />
- <field type="CARD16" name="visual_green" />
- <field type="CARD16" name="visual_blue" />
- </reply>
- </request>
-
- <enum name="Pixmap">
- <item name="None"> <value>0</value></item>
- </enum>
-
- <request name="CreateCursor" opcode="93">
- <pad bytes="1" />
- <field type="CURSOR" name="cid" />
- <field type="PIXMAP" name="source" />
- <field type="PIXMAP" name="mask" altenum="Pixmap" />
- <field type="CARD16" name="fore_red" />
- <field type="CARD16" name="fore_green" />
- <field type="CARD16" name="fore_blue" />
- <field type="CARD16" name="back_red" />
- <field type="CARD16" name="back_green" />
- <field type="CARD16" name="back_blue" />
- <field type="CARD16" name="x" />
- <field type="CARD16" name="y" />
- </request>
-
- <enum name="Font">
- <item name="None"> <value>0</value></item>
- </enum>
-
- <request name="CreateGlyphCursor" opcode="94">
- <pad bytes="1" />
- <field type="CURSOR" name="cid" />
- <field type="FONT" name="source_font" />
- <field type="FONT" name="mask_font" altenum="Font" />
- <field type="CARD16" name="source_char" />
- <field type="CARD16" name="mask_char" />
- <field type="CARD16" name="fore_red" />
- <field type="CARD16" name="fore_green" />
- <field type="CARD16" name="fore_blue" />
- <field type="CARD16" name="back_red" />
- <field type="CARD16" name="back_green" />
- <field type="CARD16" name="back_blue" />
- </request>
-
- <request name="FreeCursor" opcode="95">
- <pad bytes="1" />
- <field type="CURSOR" name="cursor" />
- </request>
-
- <request name="RecolorCursor" opcode="96">
- <pad bytes="1" />
- <field type="CURSOR" name="cursor" />
- <field type="CARD16" name="fore_red" />
- <field type="CARD16" name="fore_green" />
- <field type="CARD16" name="fore_blue" />
- <field type="CARD16" name="back_red" />
- <field type="CARD16" name="back_green" />
- <field type="CARD16" name="back_blue" />
- </request>
-
- <enum name="QueryShapeOf">
- <item name="LargestCursor"> <value>0</value></item>
- <item name="FastestTile"> <value>1</value></item>
- <item name="FastestStipple"><value>2</value></item>
- </enum>
-
- <request name="QueryBestSize" opcode="97">
- <field type="CARD8" name="class" enum="QueryShapeOf" />
- <field type="DRAWABLE" name="drawable" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="width" />
- <field type="CARD16" name="height" />
- </reply>
- </request>
-
- <request name="QueryExtension" opcode="98">
- <pad bytes="1" />
- <field type="CARD16" name="name_len" />
- <pad bytes="2" />
- <list type="char" name="name">
- <fieldref>name_len</fieldref>
- </list>
- <reply>
- <pad bytes="1" />
- <field type="BOOL" name="present" />
- <field type="CARD8" name="major_opcode" />
- <field type="CARD8" name="first_event" />
- <field type="CARD8" name="first_error" />
- </reply>
- </request>
-
- <request name="ListExtensions" opcode="99">
- <reply>
- <field type="CARD8" name="names_len" />
- <pad bytes="24" />
- <list type="STR" name="names">
- <fieldref>names_len</fieldref>
- </list>
- </reply>
- </request>
-
- <request name="ChangeKeyboardMapping" opcode="100">
- <field type="CARD8" name="keycode_count" />
- <field type="KEYCODE" name="first_keycode" />
- <field type="CARD8" name="keysyms_per_keycode" />
- <list type="KEYSYM" name="keysyms">
- <op op="*">
- <fieldref>keycode_count</fieldref>
- <fieldref>keysyms_per_keycode</fieldref>
- </op>
- </list>
- </request>
-
- <request name="GetKeyboardMapping" opcode="101">
- <pad bytes="1" />
- <field type="KEYCODE" name="first_keycode" />
- <field type="CARD8" name="count" />
- <reply>
- <field type="BYTE" name="keysyms_per_keycode" />
- <pad bytes="24" />
- <list type="KEYSYM" name="keysyms">
- <fieldref>length</fieldref>
- </list>
- </reply>
- </request>
-
- <enum name="KB">
- <item name="KeyClickPercent"><bit>0</bit></item>
- <item name="BellPercent"> <bit>1</bit></item>
- <item name="BellPitch"> <bit>2</bit></item>
- <item name="BellDuration"> <bit>3</bit></item>
- <item name="Led"> <bit>4</bit></item>
- <item name="LedMode"> <bit>5</bit></item>
- <item name="Key"> <bit>6</bit></item>
- <item name="AutoRepeatMode"> <bit>7</bit></item>
- </enum>
-
- <enum name="LedMode">
- <item name="Off"><value>0</value></item>
- <item name="On"> <value>1</value></item>
- </enum>
-
- <enum name="AutoRepeatMode">
- <item name="Off"> <value>0</value></item>
- <item name="On"> <value>1</value></item>
- <item name="Default"><value>2</value></item>
- </enum>
-
- <request name="ChangeKeyboardControl" opcode="102">
- <pad bytes="1" />
- <valueparam value-mask-type="CARD32"
- value-mask-name="value_mask"
- value-list-name="value_list" />
- </request>
-
- <request name="GetKeyboardControl" opcode="103">
- <reply>
- <field type="BYTE" name="global_auto_repeat" enum="AutoRepeatMode" />
- <field type="CARD32" name="led_mask" />
- <field type="CARD8" name="key_click_percent" />
- <field type="CARD8" name="bell_percent" />
- <field type="CARD16" name="bell_pitch" />
- <field type="CARD16" name="bell_duration" />
- <pad bytes="2" />
- <list type="CARD8" name="auto_repeats"><value>32</value></list>
- </reply>
- </request>
-
- <request name="Bell" opcode="104">
- <field type="INT8" name="percent" />
- </request>
-
- <request name="ChangePointerControl" opcode="105">
- <pad bytes="1" />
- <field type="INT16" name="acceleration_numerator" />
- <field type="INT16" name="acceleration_denominator" />
- <field type="INT16" name="threshold" />
- <field type="BOOL" name="do_acceleration" />
- <field type="BOOL" name="do_threshold" />
- </request>
-
- <request name="GetPointerControl" opcode="106">
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="acceleration_numerator" />
- <field type="CARD16" name="acceleration_denominator" />
- <field type="CARD16" name="threshold" />
- <pad bytes="18" />
- </reply>
- </request>
-
- <!-- Screen saver timeout and interval can be set to -1 to restore defaults
- and set to 0 to disable the screen saver. -->
-
- <enum name="Blanking">
- <item name="NotPreferred"><value>0</value></item>
- <item name="Preferred"> <value>1</value></item>
- <item name="Default"> <value>2</value></item>
- </enum>
-
- <enum name="Exposures">
- <item name="NotAllowed"><value>0</value></item>
- <item name="Allowed"> <value>1</value></item>
- <item name="Default"> <value>2</value></item>
- </enum>
-
- <request name="SetScreenSaver" opcode="107">
- <pad bytes="1" />
- <field type="INT16" name="timeout" />
- <field type="INT16" name="interval" />
- <field type="CARD8" name="prefer_blanking" enum="Blanking" />
- <field type="CARD8" name="allow_exposures" enum="Exposures" />
- </request>
-
- <request name="GetScreenSaver" opcode="108">
- <reply>
- <pad bytes="1" />
- <field type="CARD16" name="timeout" />
- <field type="CARD16" name="interval" />
- <field type="BYTE" name="prefer_blanking" enum="Blanking" />
- <field type="BYTE" name="allow_exposures" enum="Exposures" />
- <pad bytes="18" />
- </reply>
- </request>
-
- <enum name="HostMode">
- <item name="Insert"><value>0</value></item>
- <item name="Delete"><value>1</value></item>
- </enum>
-
- <!-- also used and extended for Xau authentication -->
- <enum name="Family">
- <item name="Internet"> <value>0</value></item>
- <item name="DECnet"> <value>1</value></item>
- <item name="Chaos"> <value>2</value></item>
- <item name="ServerInterpreted"><value>5</value></item>
- <item name="Internet6"> <value>6</value></item>
- </enum>
-
- <request name="ChangeHosts" opcode="109">
- <field type="CARD8" name="mode" enum="HostMode" />
- <field type="CARD8" name="family" enum="Family" />
- <pad bytes="1" />
- <field type="CARD16" name="address_len" />
- <list type="char" name="address">
- <fieldref>address_len</fieldref>
- </list>
- </request>
-
- <struct name="HOST">
- <field type="CARD8" name="family" enum="Family" />
- <pad bytes="1" />
- <field type="CARD16" name="address_len" />
- <list type="BYTE" name="address">
- <fieldref>address_len</fieldref>
- </list>
- </struct>
-
- <request name="ListHosts" opcode="110">
- <reply>
- <field type="BYTE" name="mode" enum="AccessControl" />
- <field type="CARD16" name="hosts_len" />
- <pad bytes="22" />
- <list type="HOST" name="hosts">
- <fieldref>hosts_len</fieldref>
- </list>
- </reply>
- </request>
-
- <enum name="AccessControl">
- <item name="Disable"><value>0</value></item>
- <item name="Enable"> <value>1</value></item>
- </enum>
-
- <request name="SetAccessControl" opcode="111">
- <field type="CARD8" name="mode" enum="AccessControl" />
- </request>
-
- <enum name="CloseDown">
- <item name="DestroyAll"> <value>0</value></item>
- <item name="RetainPermanent"><value>1</value></item>
- <item name="RetainTemporary"><value>2</value></item>
- </enum>
-
- <request name="SetCloseDownMode" opcode="112">
- <field type="CARD8" name="mode" enum="CloseDown" />
- </request>
-
- <enum name="Kill">
- <item name="AllTemporary"><value>0</value></item>
- </enum>
-
- <request name="KillClient" opcode="113">
- <pad bytes="1" />
- <field type="CARD32" name="resource" altenum="Kill" />
- </request>
-
- <request name="RotateProperties" opcode="114">
- <pad bytes="1" />
- <field type="WINDOW" name="window" />
- <field type="CARD16" name="atoms_len" />
- <field type="INT16" name="delta" />
- <list type="ATOM" name="atoms">
- <fieldref>atoms_len</fieldref>
- </list>
- </request>
-
- <enum name="ScreenSaver">
- <item name="Reset"> <value>0</value></item>
- <item name="Active"><value>1</value></item>
- </enum>
-
- <request name="ForceScreenSaver" opcode="115">
- <field type="CARD8" name="mode" enum="ScreenSaver" />
- </request>
-
- <!-- Reply from SetPointerMapping or SetModifierMapping -->
- <enum name="MappingStatus">
- <item name="Success"><value>0</value></item>
- <item name="Busy"> <value>1</value></item>
- <item name="Failure"><value>2</value></item>
- </enum>
-
- <request name="SetPointerMapping" opcode="116">
- <field type="CARD8" name="map_len" />
- <list type="CARD8" name="map">
- <fieldref>map_len</fieldref>
- </list>
- <reply>
- <field type="BYTE" name="status" enum="MappingStatus" />
- </reply>
- </request>
-
- <request name="GetPointerMapping" opcode="117">
- <reply>
- <field type="CARD8" name="map_len" />
- <pad bytes="24" />
- <list type="CARD8" name="map">
- <fieldref>map_len</fieldref>
- </list>
- </reply>
- </request>
-
- <enum name="MapIndex">
- <item name="Shift"> <value>0</value></item>
- <item name="Lock"> <value>1</value></item>
- <item name="Control"><value>2</value></item>
- <item name="1"> <value>3</value></item>
- <item name="2"> <value>4</value></item>
- <item name="3"> <value>5</value></item>
- <item name="4"> <value>6</value></item>
- <item name="5"> <value>7</value></item>
- </enum>
-
- <request name="SetModifierMapping" opcode="118">
- <field type="CARD8" name="keycodes_per_modifier" />
- <list type="KEYCODE" name="keycodes">
- <op op="*">
- <fieldref>keycodes_per_modifier</fieldref>
- <value>8</value>
- </op>
- </list>
- <reply>
- <field type="BYTE" name="status" enum="MappingStatus" />
- </reply>
- </request>
-
- <request name="GetModifierMapping" opcode="119">
- <reply>
- <field type="CARD8" name="keycodes_per_modifier" />
- <pad bytes="24" />
- <list type="KEYCODE" name="keycodes">
- <op op="*">
- <fieldref>keycodes_per_modifier</fieldref>
- <value>8</value>
- </op>
- </list>
- </reply>
- </request>
-
- <!--
- FIXME: NoOperation should allow specifying payload length
- but geez, malloc()ing a 262140 byte buffer just so I have something
- to hand to write(2) seems silly...!
- -->
- <request name="NoOperation" opcode="127" />
-
-</xcb>
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (C) 2001-2004 Bart Massey, Jamey Sharp, and Josh Triplett.
+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, sublicense, 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 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 NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS 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.
+
+Except as contained in this notice, the names of the authors or their
+institutions shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization from the authors.
+-->
+<xcb header="xproto">
+ <!-- Core protocol types -->
+
+ <struct name="CHAR2B">
+ <field type="CARD8" name="byte1" />
+ <field type="CARD8" name="byte2" />
+ </struct>
+
+ <xidtype name="WINDOW" />
+
+ <xidtype name="PIXMAP" />
+
+ <xidtype name="CURSOR" />
+
+ <xidtype name="FONT" />
+
+ <xidtype name="GCONTEXT" />
+
+ <xidtype name="COLORMAP" />
+
+ <xidtype name="ATOM" />
+
+ <xidunion name="DRAWABLE">
+ <type>WINDOW</type>
+ <type>PIXMAP</type>
+ </xidunion>
+
+ <xidunion name="FONTABLE">
+ <type>FONT</type>
+ <type>GCONTEXT</type>
+ </xidunion>
+
+ <typedef oldname="CARD32" newname="VISUALID" />
+
+ <typedef oldname="CARD32" newname="TIMESTAMP" />
+
+ <typedef oldname="CARD32" newname="KEYSYM" />
+
+ <typedef oldname="CARD8" newname="KEYCODE" />
+
+ <typedef oldname="CARD8" newname="BUTTON" />
+
+ <struct name="POINT">
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ </struct>
+
+ <struct name="RECTANGLE">
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ </struct>
+
+ <struct name="ARC">
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="INT16" name="angle1" />
+ <field type="INT16" name="angle2" />
+ </struct>
+
+ <!-- Connection setup-related types -->
+
+ <struct name="FORMAT">
+ <field type="CARD8" name="depth" />
+ <field type="CARD8" name="bits_per_pixel" />
+ <field type="CARD8" name="scanline_pad" />
+ <pad bytes="5" />
+ </struct>
+
+ <enum name="VisualClass">
+ <item name="StaticGray"> <value>0</value></item>
+ <item name="GrayScale"> <value>1</value></item>
+ <item name="StaticColor"><value>2</value></item>
+ <item name="PseudoColor"><value>3</value></item>
+ <item name="TrueColor"> <value>4</value></item>
+ <item name="DirectColor"><value>5</value></item>
+ </enum>
+
+ <struct name="VISUALTYPE">
+ <field type="VISUALID" name="visual_id" />
+ <field type="CARD8" name="class" enum="VisualClass" />
+ <field type="CARD8" name="bits_per_rgb_value" />
+ <field type="CARD16" name="colormap_entries" />
+ <field type="CARD32" name="red_mask" />
+ <field type="CARD32" name="green_mask" />
+ <field type="CARD32" name="blue_mask" />
+ <pad bytes="4" />
+ </struct>
+
+ <struct name="DEPTH">
+ <field type="CARD8" name="depth" />
+ <pad bytes="1" />
+ <field type="CARD16" name="visuals_len" />
+ <pad bytes="4" />
+ <list type="VISUALTYPE" name="visuals">
+ <fieldref>visuals_len</fieldref>
+ </list>
+ </struct>
+
+ <enum name="EventMask">
+ <item name="NoEvent"> <value>0</value></item>
+ <item name="KeyPress"> <bit>0</bit></item>
+ <item name="KeyRelease"> <bit>1</bit></item>
+ <item name="ButtonPress"> <bit>2</bit></item>
+ <item name="ButtonRelease"> <bit>3</bit></item>
+ <item name="EnterWindow"> <bit>4</bit></item>
+ <item name="LeaveWindow"> <bit>5</bit></item>
+ <item name="PointerMotion"> <bit>6</bit></item>
+ <item name="PointerMotionHint"> <bit>7</bit></item>
+ <item name="Button1Motion"> <bit>8</bit></item>
+ <item name="Button2Motion"> <bit>9</bit></item>
+ <item name="Button3Motion"> <bit>10</bit></item>
+ <item name="Button4Motion"> <bit>11</bit></item>
+ <item name="Button5Motion"> <bit>12</bit></item>
+ <item name="ButtonMotion"> <bit>13</bit></item>
+ <item name="KeymapState"> <bit>14</bit></item>
+ <item name="Exposure"> <bit>15</bit></item>
+ <item name="VisibilityChange"> <bit>16</bit></item>
+ <item name="StructureNotify"> <bit>17</bit></item>
+ <item name="ResizeRedirect"> <bit>18</bit></item>
+ <item name="SubstructureNotify"> <bit>19</bit></item>
+ <item name="SubstructureRedirect"><bit>20</bit></item>
+ <item name="FocusChange"> <bit>21</bit></item>
+ <item name="PropertyChange"> <bit>22</bit></item>
+ <item name="ColorMapChange"> <bit>23</bit></item>
+ <item name="OwnerGrabButton"> <bit>24</bit></item>
+ </enum>
+
+ <enum name="BackingStore">
+ <item name="NotUseful"> <value>0</value></item>
+ <item name="WhenMapped"><value>1</value></item>
+ <item name="Always"> <value>2</value></item>
+ </enum>
+
+ <struct name="SCREEN">
+ <field type="WINDOW" name="root" />
+ <field type="COLORMAP" name="default_colormap" />
+ <field type="CARD32" name="white_pixel" />
+ <field type="CARD32" name="black_pixel" />
+ <field type="CARD32" name="current_input_masks" mask="EventMask" />
+ <field type="CARD16" name="width_in_pixels" />
+ <field type="CARD16" name="height_in_pixels" />
+ <field type="CARD16" name="width_in_millimeters" />
+ <field type="CARD16" name="height_in_millimeters" />
+ <field type="CARD16" name="min_installed_maps" />
+ <field type="CARD16" name="max_installed_maps" />
+ <field type="VISUALID" name="root_visual" />
+ <field type="BYTE" name="backing_stores" enum="BackingStore" />
+ <field type="BOOL" name="save_unders" />
+ <field type="CARD8" name="root_depth" />
+ <field type="CARD8" name="allowed_depths_len" />
+ <list type="DEPTH" name="allowed_depths">
+ <fieldref>allowed_depths_len</fieldref>
+ </list>
+ </struct>
+
+ <struct name="SetupRequest">
+ <field type="CARD8" name="byte_order" />
+ <pad bytes="1" />
+ <field type="CARD16" name="protocol_major_version" />
+ <field type="CARD16" name="protocol_minor_version" />
+ <field type="CARD16" name="authorization_protocol_name_len" />
+ <field type="CARD16" name="authorization_protocol_data_len" />
+ <pad bytes="2" />
+ <list type="char" name="authorization_protocol_name">
+ <fieldref>authorization_protocol_name_len</fieldref>
+ </list>
+ <list type="char" name="authorization_protocol_data">
+ <fieldref>authorization_protocol_data_len</fieldref>
+ </list>
+ </struct>
+
+ <struct name="SetupFailed">
+ <field type="CARD8" name="status" /> <!-- always 0 -> Failed -->
+ <field type="CARD8" name="reason_len" />
+ <field type="CARD16" name="protocol_major_version" />
+ <field type="CARD16" name="protocol_minor_version" />
+ <field type="CARD16" name="length" />
+ <list type="char" name="reason">
+ <fieldref>reason_len</fieldref>
+ </list>
+ </struct>
+
+ <struct name="SetupAuthenticate">
+ <field type="CARD8" name="status" /> <!-- always 2 -> Authenticate -->
+ <pad bytes="5" />
+ <field type="CARD16" name="length" />
+ <list type="char" name="reason">
+ <op op="*">
+ <fieldref>length</fieldref>
+ <value>4</value>
+ </op>
+ </list>
+ </struct>
+
+ <enum name="ImageOrder">
+ <item name="LSBFirst"><value>0</value></item>
+ <item name="MSBFirst"><value>1</value></item>
+ </enum>
+
+ <struct name="Setup">
+ <field type="CARD8" name="status" /> <!-- always 1 -> Success -->
+ <pad bytes="1" />
+ <field type="CARD16" name="protocol_major_version" />
+ <field type="CARD16" name="protocol_minor_version" />
+ <field type="CARD16" name="length" />
+ <field type="CARD32" name="release_number" />
+ <field type="CARD32" name="resource_id_base" />
+ <field type="CARD32" name="resource_id_mask" />
+ <field type="CARD32" name="motion_buffer_size" />
+ <field type="CARD16" name="vendor_len" />
+ <field type="CARD16" name="maximum_request_length" />
+ <field type="CARD8" name="roots_len" />
+ <field type="CARD8" name="pixmap_formats_len" />
+ <field type="CARD8" name="image_byte_order" enum="ImageOrder" />
+ <field type="CARD8" name="bitmap_format_bit_order" enum="ImageOrder" />
+ <field type="CARD8" name="bitmap_format_scanline_unit" />
+ <field type="CARD8" name="bitmap_format_scanline_pad" />
+ <field type="KEYCODE" name="min_keycode" />
+ <field type="KEYCODE" name="max_keycode" />
+ <pad bytes="4" />
+ <list type="char" name="vendor">
+ <fieldref>vendor_len</fieldref>
+ </list>
+ <list type="FORMAT" name="pixmap_formats">
+ <fieldref>pixmap_formats_len</fieldref>
+ </list>
+ <list type="SCREEN" name="roots">
+ <fieldref>roots_len</fieldref>
+ </list>
+ </struct>
+
+ <!-- Core event types -->
+
+ <enum name="ModMask">
+ <item name="Shift"> <bit>0</bit></item>
+ <item name="Lock"> <bit>1</bit></item>
+ <item name="Control"><bit>2</bit></item>
+ <item name="1"> <bit>3</bit></item>
+ <item name="2"> <bit>4</bit></item>
+ <item name="3"> <bit>5</bit></item>
+ <item name="4"> <bit>6</bit></item>
+ <item name="5"> <bit>7</bit></item>
+ <item name="Any"> <bit>15</bit></item>
+ </enum>
+
+ <enum name="KeyButMask">
+ <item name="Shift"> <bit>0</bit></item>
+ <item name="Lock"> <bit>1</bit></item>
+ <item name="Control"><bit>2</bit></item>
+ <item name="Mod1"> <bit>3</bit></item>
+ <item name="Mod2"> <bit>4</bit></item>
+ <item name="Mod3"> <bit>5</bit></item>
+ <item name="Mod4"> <bit>6</bit></item>
+ <item name="Mod5"> <bit>7</bit></item>
+ <item name="Button1"><bit>8</bit></item>
+ <item name="Button2"><bit>9</bit></item>
+ <item name="Button3"><bit>10</bit></item>
+ <item name="Button4"><bit>11</bit></item>
+ <item name="Button5"><bit>12</bit></item>
+ </enum>
+
+ <enum name="Window">
+ <item name="None"> <value>0</value></item>
+ </enum>
+
+ <event name="KeyPress" number="2">
+ <field type="KEYCODE" name="detail" />
+ <field type="TIMESTAMP" name="time" />
+ <field type="WINDOW" name="root" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="child" altenum="Window" />
+ <field type="INT16" name="root_x" />
+ <field type="INT16" name="root_y" />
+ <field type="INT16" name="event_x" />
+ <field type="INT16" name="event_y" />
+ <field type="CARD16" name="state" mask="KeyButMask" />
+ <field type="BOOL" name="same_screen" />
+ <pad bytes="1" />
+ </event>
+
+ <eventcopy name="KeyRelease" number="3" ref="KeyPress" />
+
+ <enum name="ButtonMask">
+ <item name="1"> <bit>8</bit></item>
+ <item name="2"> <bit>9</bit></item>
+ <item name="3"> <bit>10</bit></item>
+ <item name="4"> <bit>11</bit></item>
+ <item name="5"> <bit>12</bit></item>
+ <item name="Any"> <bit>15</bit></item>
+ </enum>
+
+ <event name="ButtonPress" number="4">
+ <field type="BUTTON" name="detail" />
+ <field type="TIMESTAMP" name="time" />
+ <field type="WINDOW" name="root" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="child" altenum="Window" />
+ <field type="INT16" name="root_x" />
+ <field type="INT16" name="root_y" />
+ <field type="INT16" name="event_x" />
+ <field type="INT16" name="event_y" />
+ <field type="CARD16" name="state" mask="KeyButMask" />
+ <field type="BOOL" name="same_screen" />
+ <pad bytes="1" />
+ </event>
+
+ <eventcopy name="ButtonRelease" number="5" ref="ButtonPress" />
+
+ <!-- MotionNotify detail -->
+ <enum name="Motion">
+ <item name="Normal"><value>0</value></item>
+ <item name="Hint"> <value>1</value></item>
+ </enum>
+
+ <event name="MotionNotify" number="6">
+ <field type="BYTE" name="detail" enum="Motion" />
+ <field type="TIMESTAMP" name="time" />
+ <field type="WINDOW" name="root" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="child" altenum="Window" />
+ <field type="INT16" name="root_x" />
+ <field type="INT16" name="root_y" />
+ <field type="INT16" name="event_x" />
+ <field type="INT16" name="event_y" />
+ <field type="CARD16" name="state" mask="KeyButMask" />
+ <field type="BOOL" name="same_screen" />
+ <pad bytes="1" />
+ </event>
+
+ <enum name="NotifyDetail">
+ <item name="Ancestor"> <value>0</value></item>
+ <item name="Virtual"> <value>1</value></item>
+ <item name="Inferior"> <value>2</value></item>
+ <item name="Nonlinear"> <value>3</value></item>
+ <item name="NonlinearVirtual"><value>4</value></item>
+ <item name="Pointer"> <value>5</value></item>
+ <item name="PointerRoot"> <value>6</value></item>
+ <item name="None"> <value>7</value></item>
+ </enum>
+
+ <enum name="NotifyMode">
+ <item name="Normal"> <value>0</value></item>
+ <item name="Grab"> <value>1</value></item>
+ <item name="Ungrab"> <value>2</value></item>
+ <item name="WhileGrabbed"><value>3</value></item>
+ </enum>
+
+ <event name="EnterNotify" number="7">
+ <field type="BYTE" name="detail" enum="NotifyDetail" />
+ <field type="TIMESTAMP" name="time" />
+ <field type="WINDOW" name="root" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="child" altenum="Window" />
+ <field type="INT16" name="root_x" />
+ <field type="INT16" name="root_y" />
+ <field type="INT16" name="event_x" />
+ <field type="INT16" name="event_y" />
+ <field type="CARD16" name="state" mask="KeyButMask" />
+ <field type="BYTE" name="mode" enum="NotifyMode" />
+ <field type="BYTE" name="same_screen_focus" />
+ </event>
+
+ <eventcopy name="LeaveNotify" number="8" ref="EnterNotify" />
+
+ <event name="FocusIn" number="9">
+ <field type="BYTE" name="detail" enum="NotifyDetail" />
+ <field type="WINDOW" name="event" />
+ <field type="BYTE" name="mode" enum="NotifyMode" />
+ <pad bytes="3" />
+ </event>
+
+ <eventcopy name="FocusOut" number="10" ref="FocusIn" />
+
+ <event name="KeymapNotify" number="11" no-sequence-number="true">
+ <list type="CARD8" name="keys"><value>31</value></list>
+ </event>
+
+ <event name="Expose" number="12">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="CARD16" name="x" />
+ <field type="CARD16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD16" name="count" />
+ <pad bytes="2" />
+ </event>
+
+ <event name="GraphicsExposure" number="13">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="CARD16" name="x" />
+ <field type="CARD16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD16" name="minor_opcode" />
+ <field type="CARD16" name="count" />
+ <field type="CARD8" name="major_opcode" />
+ <pad bytes="3" />
+ </event>
+
+ <event name="NoExposure" number="14">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="CARD16" name="minor_opcode" />
+ <field type="CARD8" name="major_opcode" />
+ <pad bytes="1" />
+ </event>
+
+ <enum name="Visibility">
+ <item name="Unobscured"> <value>0</value></item>
+ <item name="PartiallyObscured"><value>1</value></item>
+ <item name="FullyObscured"> <value>2</value></item>
+ </enum>
+
+ <event name="VisibilityNotify" number="15">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="BYTE" name="state" enum="Visibility" />
+ <pad bytes="3" />
+ </event>
+
+ <event name="CreateNotify" number="16">
+ <pad bytes="1" />
+ <field type="WINDOW" name="parent" />
+ <field type="WINDOW" name="window" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD16" name="border_width" />
+ <field type="BOOL" name="override_redirect" />
+ <pad bytes="1" />
+ </event>
+
+ <event name="DestroyNotify" number="17">
+ <pad bytes="1" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="window" />
+ </event>
+
+ <event name="UnmapNotify" number="18">
+ <pad bytes="1" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="window" />
+ <field type="BOOL" name="from_configure" />
+ <pad bytes="3" />
+ </event>
+
+ <event name="MapNotify" number="19">
+ <pad bytes="1" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="window" />
+ <field type="BOOL" name="override_redirect" />
+ <pad bytes="3" />
+ </event>
+
+ <event name="MapRequest" number="20">
+ <pad bytes="1" />
+ <field type="WINDOW" name="parent" />
+ <field type="WINDOW" name="window" />
+ </event>
+
+ <event name="ReparentNotify" number="21">
+ <pad bytes="1" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="window" />
+ <field type="WINDOW" name="parent" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="BOOL" name="override_redirect" />
+ <pad bytes="3" />
+ </event>
+
+ <event name="ConfigureNotify" number="22">
+ <pad bytes="1" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="window" />
+ <field type="WINDOW" name="above_sibling" altenum="Window" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD16" name="border_width" />
+ <field type="BOOL" name="override_redirect" />
+ <pad bytes="1" />
+ </event>
+
+ <event name="ConfigureRequest" number="23">
+ <field type="BYTE" name="stack_mode" enum="StackMode" />
+ <field type="WINDOW" name="parent" />
+ <field type="WINDOW" name="window" />
+ <field type="WINDOW" name="sibling" altenum="Window" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD16" name="border_width" />
+ <field type="CARD16" name="value_mask" mask="ConfigWindow" />
+ </event>
+
+ <event name="GravityNotify" number="24">
+ <pad bytes="1" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="window" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ </event>
+
+ <event name="ResizeRequest" number="25">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ </event>
+
+ <enum name="Place">
+ <item name="OnTop"> <value>0</value></item>
+ <item name="OnBottom"><value>1</value></item>
+ </enum>
+
+ <event name="CirculateNotify" number="26">
+ <pad bytes="1" />
+ <field type="WINDOW" name="event" />
+ <field type="WINDOW" name="window" />
+ <pad bytes="4" />
+ <field type="BYTE" name="place" enum="Place" />
+ <pad bytes="3" />
+ </event>
+
+ <eventcopy name="CirculateRequest" number="27" ref="CirculateNotify" />
+
+ <enum name="Property">
+ <item name="NewValue"><value>0</value></item>
+ <item name="Delete"> <value>1</value></item>
+ </enum>
+
+ <event name="PropertyNotify" number="28">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="ATOM" name="atom" />
+ <field type="TIMESTAMP" name="time" />
+ <field type="BYTE" name="state" enum="Property" />
+ <pad bytes="3" />
+ </event>
+
+ <event name="SelectionClear" number="29">
+ <pad bytes="1" />
+ <field type="TIMESTAMP" name="time" />
+ <field type="WINDOW" name="owner" />
+ <field type="ATOM" name="selection" />
+ </event>
+
+ <enum name="Time">
+ <item name="CurrentTime"> <value>0</value> </item>
+ </enum>
+
+ <enum name="Atom">
+ <item name="None"> <value>0</value></item>
+ <item name="Any"> <value>0</value></item>
+ <item name="PRIMARY" />
+ <item name="SECONDARY" />
+ <item name="ARC" />
+ <item name="ATOM" />
+ <item name="BITMAP" />
+ <item name="CARDINAL" />
+ <item name="COLORMAP" />
+ <item name="CURSOR" />
+ <item name="CUT_BUFFER0" />
+ <item name="CUT_BUFFER1" />
+ <item name="CUT_BUFFER2" />
+ <item name="CUT_BUFFER3" />
+ <item name="CUT_BUFFER4" />
+ <item name="CUT_BUFFER5" />
+ <item name="CUT_BUFFER6" />
+ <item name="CUT_BUFFER7" />
+ <item name="DRAWABLE" />
+ <item name="FONT" />
+ <item name="INTEGER" />
+ <item name="PIXMAP" />
+ <item name="POINT" />
+ <item name="RECTANGLE" />
+ <item name="RESOURCE_MANAGER" />
+ <item name="RGB_COLOR_MAP" />
+ <item name="RGB_BEST_MAP" />
+ <item name="RGB_BLUE_MAP" />
+ <item name="RGB_DEFAULT_MAP" />
+ <item name="RGB_GRAY_MAP" />
+ <item name="RGB_GREEN_MAP" />
+ <item name="RGB_RED_MAP" />
+ <item name="STRING" />
+ <item name="VISUALID" />
+ <item name="WINDOW" />
+ <item name="WM_COMMAND" />
+ <item name="WM_HINTS" />
+ <item name="WM_CLIENT_MACHINE" />
+ <item name="WM_ICON_NAME" />
+ <item name="WM_ICON_SIZE" />
+ <item name="WM_NAME" />
+ <item name="WM_NORMAL_HINTS" />
+ <item name="WM_SIZE_HINTS" />
+ <item name="WM_ZOOM_HINTS" />
+ <item name="MIN_SPACE" />
+ <item name="NORM_SPACE" />
+ <item name="MAX_SPACE" />
+ <item name="END_SPACE" />
+ <item name="SUPERSCRIPT_X" />
+ <item name="SUPERSCRIPT_Y" />
+ <item name="SUBSCRIPT_X" />
+ <item name="SUBSCRIPT_Y" />
+ <item name="UNDERLINE_POSITION" />
+ <item name="UNDERLINE_THICKNESS" />
+ <item name="STRIKEOUT_ASCENT" />
+ <item name="STRIKEOUT_DESCENT" />
+ <item name="ITALIC_ANGLE" />
+ <item name="X_HEIGHT" />
+ <item name="QUAD_WIDTH" />
+ <item name="WEIGHT" />
+ <item name="POINT_SIZE" />
+ <item name="RESOLUTION" />
+ <item name="COPYRIGHT" />
+ <item name="NOTICE" />
+ <item name="FONT_NAME" />
+ <item name="FAMILY_NAME" />
+ <item name="FULL_NAME" />
+ <item name="CAP_HEIGHT" />
+ <item name="WM_CLASS" />
+ <item name="WM_TRANSIENT_FOR" />
+ </enum>
+
+ <event name="SelectionRequest" number="30">
+ <pad bytes="1" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ <field type="WINDOW" name="owner" />
+ <field type="WINDOW" name="requestor" />
+ <field type="ATOM" name="selection" />
+ <field type="ATOM" name="target" />
+ <field type="ATOM" name="property" altenum="Atom" />
+ </event>
+
+ <event name="SelectionNotify" number="31">
+ <pad bytes="1" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ <field type="WINDOW" name="requestor" />
+ <field type="ATOM" name="selection" />
+ <field type="ATOM" name="target" />
+ <field type="ATOM" name="property" altenum="Atom" />
+ </event>
+
+ <enum name="ColormapState">
+ <item name="Uninstalled"><value>0</value></item>
+ <item name="Installed"> <value>1</value></item>
+ </enum>
+
+ <enum name="Colormap">
+ <item name="None"> <value>0</value></item>
+ </enum>
+
+ <event name="ColormapNotify" number="32">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="COLORMAP" name="colormap" altenum="Colormap" />
+ <field type="BOOL" name="new" />
+ <field type="BYTE" name="state" enum="ColormapState" />
+ <pad bytes="2" />
+ </event>
+
+ <union name="ClientMessageData">
+ <!-- The format member of the ClientMessage event determines which array
+ to use. -->
+ <list type="CARD8" name="data8" ><value>20</value></list> <!-- 8 -->
+ <list type="CARD16" name="data16"><value>10</value></list> <!-- 16 -->
+ <list type="CARD32" name="data32"><value>5</value></list> <!-- 32 -->
+ </union>
+
+ <event name="ClientMessage" number="33">
+ <field type="CARD8" name="format" /> <!-- 8, 16, or 32. -->
+ <field type="WINDOW" name="window" />
+ <field type="ATOM" name="type" />
+ <field type="ClientMessageData" name="data" />
+ </event>
+
+ <enum name="Mapping">
+ <item name="Modifier"><value>0</value></item>
+ <item name="Keyboard"><value>1</value></item>
+ <item name="Pointer"> <value>2</value></item>
+ </enum>
+
+ <event name="MappingNotify" number="34">
+ <pad bytes="1" />
+ <field type="BYTE" name="request" enum="Mapping" />
+ <field type="KEYCODE" name="first_keycode" />
+ <field type="CARD8" name="count" />
+ <pad bytes="1" />
+ </event>
+
+
+
+ <!-- Core error types -->
+
+
+
+ <error name="Request" number="1">
+ <field type="CARD32" name="bad_value" />
+ <field type="CARD16" name="minor_opcode" />
+ <field type="CARD8" name="major_opcode" />
+ <pad bytes="1" />
+ </error>
+
+ <error name="Value" number="2">
+ <field type="CARD32" name="bad_value" />
+ <field type="CARD16" name="minor_opcode" />
+ <field type="CARD8" name="major_opcode" />
+ <pad bytes="1" />
+ </error>
+
+ <errorcopy name="Window" number="3" ref="Value" />
+ <errorcopy name="Pixmap" number="4" ref="Value" />
+ <errorcopy name="Atom" number="5" ref="Value" />
+ <errorcopy name="Cursor" number="6" ref="Value" />
+ <errorcopy name="Font" number="7" ref="Value" />
+ <errorcopy name="Match" number="8" ref="Request" />
+ <errorcopy name="Drawable" number="9" ref="Value" />
+ <errorcopy name="Access" number="10" ref="Request" />
+ <errorcopy name="Alloc" number="11" ref="Request" />
+ <errorcopy name="Colormap" number="12" ref="Value" />
+ <errorcopy name="GContext" number="13" ref="Value" />
+ <errorcopy name="IDChoice" number="14" ref="Value" />
+ <errorcopy name="Name" number="15" ref="Request" />
+ <errorcopy name="Length" number="16" ref="Request" />
+ <errorcopy name="Implementation" number="17" ref="Request" />
+
+
+
+ <!-- The core requests, in major number order. -->
+ <!-- It is the caller's responsibility to free returned XCB*Rep objects. -->
+
+
+
+ <enum name="WindowClass">
+ <item name="CopyFromParent"><value>0</value></item>
+ <item name="InputOutput"> <value>1</value></item>
+ <item name="InputOnly"> <value>2</value></item>
+ </enum>
+
+ <!-- Window attributes for CreateWindow and ChangeWindowAttributes. -->
+ <enum name="CW">
+ <item name="BackPixmap"> <bit>0</bit></item>
+ <item name="BackPixel"> <bit>1</bit></item>
+ <item name="BorderPixmap"> <bit>2</bit></item>
+ <item name="BorderPixel"> <bit>3</bit></item>
+ <item name="BitGravity"> <bit>4</bit></item>
+ <item name="WinGravity"> <bit>5</bit></item>
+ <item name="BackingStore"> <bit>6</bit></item>
+ <item name="BackingPlanes"> <bit>7</bit></item>
+ <item name="BackingPixel"> <bit>8</bit></item>
+ <item name="OverrideRedirect"><bit>9</bit></item>
+ <item name="SaveUnder"> <bit>10</bit></item>
+ <item name="EventMask"> <bit>11</bit></item>
+ <item name="DontPropagate"> <bit>12</bit></item>
+ <item name="Colormap"> <bit>13</bit></item>
+ <item name="Cursor"> <bit>14</bit></item>
+ </enum>
+
+ <enum name="BackPixmap">
+ <item name="None"> <value>0</value></item>
+ <item name="ParentRelative"><value>1</value></item>
+ </enum>
+
+ <enum name="Gravity">
+ <item name="BitForget"><value>0</value></item>
+ <item name="WinUnmap"> <value>0</value></item>
+ <item name="NorthWest"><value>1</value></item>
+ <item name="North"> <value>2</value></item>
+ <item name="NorthEast"><value>3</value></item>
+ <item name="West"> <value>4</value></item>
+ <item name="Center"> <value>5</value></item>
+ <item name="East"> <value>6</value></item>
+ <item name="SouthWest"><value>7</value></item>
+ <item name="South"> <value>8</value></item>
+ <item name="SouthEast"><value>9</value></item>
+ <item name="Static"> <value>10</value></item>
+ </enum>
+
+ <request name="CreateWindow" opcode="1">
+ <field type="CARD8" name="depth" />
+ <field type="WINDOW" name="wid" />
+ <field type="WINDOW" name="parent" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD16" name="border_width" />
+ <field type="CARD16" name="class" enum="WindowClass" />
+ <field type="VISUALID" name="visual" />
+ <valueparam value-mask-type="CARD32"
+ value-mask-name="value_mask"
+ value-list-name="value_list" />
+ </request>
+
+ <request name="ChangeWindowAttributes" opcode="2">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <valueparam value-mask-type="CARD32"
+ value-mask-name="value_mask"
+ value-list-name="value_list" />
+ </request>
+
+ <enum name="MapState">
+ <item name="Unmapped"> <value>0</value></item>
+ <item name="Unviewable"><value>1</value></item>
+ <item name="Viewable"> <value>2</value></item>
+ </enum>
+
+ <request name="GetWindowAttributes" opcode="3">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <reply>
+ <field type="CARD8" name="backing_store" enum="BackingStore" />
+ <field type="VISUALID" name="visual" />
+ <field type="CARD16" name="class" enum="WindowClass" />
+ <field type="CARD8" name="bit_gravity" enum="Gravity" />
+ <field type="CARD8" name="win_gravity" enum="Gravity" />
+ <field type="CARD32" name="backing_planes" />
+ <field type="CARD32" name="backing_pixel" />
+ <field type="BOOL" name="save_under" />
+ <field type="BOOL" name="map_is_installed" />
+ <field type="CARD8" name="map_state" enum="MapState" />
+ <field type="BOOL" name="override_redirect" />
+ <field type="COLORMAP" name="colormap" altenum="Colormap" />
+ <field type="CARD32" name="all_event_masks" mask="EventMask" />
+ <field type="CARD32" name="your_event_mask" mask="EventMask" />
+ <field type="CARD16" name="do_not_propagate_mask" mask="EventMask" />
+ <pad bytes="2" />
+ </reply>
+ </request>
+
+ <request name="DestroyWindow" opcode="4">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ </request>
+
+ <request name="DestroySubwindows" opcode="5">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ </request>
+
+ <enum name="SetMode">
+ <item name="Insert"><value>0</value></item>
+ <item name="Delete"><value>1</value></item>
+ </enum>
+
+ <request name="ChangeSaveSet" opcode="6">
+ <field type="BYTE" name="mode" enum="SetMode" />
+ <field type="WINDOW" name="window" />
+ </request>
+
+ <request name="ReparentWindow" opcode="7">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="WINDOW" name="parent" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ </request>
+
+ <request name="MapWindow" opcode="8">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ </request>
+
+ <request name="MapSubwindows" opcode="9">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ </request>
+
+ <request name="UnmapWindow" opcode="10">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ </request>
+
+ <request name="UnmapSubwindows" opcode="11">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ </request>
+
+ <enum name="ConfigWindow">
+ <item name="X"> <bit>0</bit></item>
+ <item name="Y"> <bit>1</bit></item>
+ <item name="Width"> <bit>2</bit></item>
+ <item name="Height"> <bit>3</bit></item>
+ <item name="BorderWidth"><bit>4</bit></item>
+ <item name="Sibling"> <bit>5</bit></item>
+ <item name="StackMode"> <bit>6</bit></item>
+ </enum>
+
+ <enum name="StackMode">
+ <item name="Above"> <value>0</value></item>
+ <item name="Below"> <value>1</value></item>
+ <item name="TopIf"> <value>2</value></item>
+ <item name="BottomIf"><value>3</value></item>
+ <item name="Opposite"><value>4</value></item>
+ </enum>
+
+ <request name="ConfigureWindow" opcode="12">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="CARD16" name="value_mask" />
+ <pad bytes="2" />
+ <valueparam value-mask-type="CARD16"
+ value-mask-name="value_mask"
+ value-list-name="value_list" />
+ </request>
+
+ <enum name="Circulate">
+ <item name="RaiseLowest"> <value>0</value></item>
+ <item name="LowerHighest"><value>1</value></item>
+ </enum>
+
+ <request name="CirculateWindow" opcode="13">
+ <field type="CARD8" name="direction" enum="Circulate" />
+ <field type="WINDOW" name="window" />
+ </request>
+
+ <request name="GetGeometry" opcode="14">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <reply>
+ <field type="CARD8" name="depth" />
+ <field type="WINDOW" name="root" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD16" name="border_width" />
+ <pad bytes="2" />
+ </reply>
+ </request>
+
+ <request name="QueryTree" opcode="15">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <reply>
+ <pad bytes="1" />
+ <field type="WINDOW" name="root" />
+ <field type="WINDOW" name="parent" altenum="Window" />
+ <field type="CARD16" name="children_len" />
+ <pad bytes="14" />
+ <list type="WINDOW" name="children">
+ <fieldref>children_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="InternAtom" opcode="16">
+ <field type="BOOL" name="only_if_exists" />
+ <field type="CARD16" name="name_len" />
+ <pad bytes="2" />
+ <list type="char" name="name">
+ <fieldref>name_len</fieldref>
+ </list>
+ <reply>
+ <pad bytes="1" />
+ <field type="ATOM" name="atom" altenum="Atom" />
+ </reply>
+ </request>
+
+ <request name="GetAtomName" opcode="17">
+ <pad bytes="1" />
+ <field type="ATOM" name="atom" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="name_len" />
+ <pad bytes="22" />
+ <list type="char" name="name">
+ <fieldref>name_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <enum name="PropMode">
+ <item name="Replace"><value>0</value></item>
+ <item name="Prepend"><value>1</value></item>
+ <item name="Append"> <value>2</value></item>
+ </enum>
+
+ <request name="ChangeProperty" opcode="18">
+ <field type="CARD8" name="mode" enum="PropMode" />
+ <field type="WINDOW" name="window" />
+ <field type="ATOM" name="property" />
+ <field type="ATOM" name="type" />
+ <field type="CARD8" name="format" />
+ <pad bytes="3" />
+ <field type="CARD32" name="data_len" />
+ <list type="void" name="data">
+ <op op="/">
+ <op op="*">
+ <fieldref>data_len</fieldref>
+ <fieldref>format</fieldref>
+ </op>
+ <value>8</value>
+ </op>
+ </list>
+ </request>
+
+ <request name="DeleteProperty" opcode="19">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="ATOM" name="property" />
+ </request>
+
+ <enum name="GetPropertyType">
+ <item name="Any"><value>0</value></item>
+ </enum>
+
+ <request name="GetProperty" opcode="20">
+ <field type="BOOL" name="delete" />
+ <field type="WINDOW" name="window" />
+ <field type="ATOM" name="property" />
+ <field type="ATOM" name="type" altenum="GetPropertyType" />
+ <field type="CARD32" name="long_offset" />
+ <field type="CARD32" name="long_length" />
+ <reply>
+ <field type="CARD8" name="format" />
+ <field type="ATOM" name="type" />
+ <field type="CARD32" name="bytes_after" />
+ <field type="CARD32" name="value_len" />
+ <pad bytes="12" />
+ <list type="void" name="value">
+ <op op="*">
+ <fieldref>value_len</fieldref>
+ <op op="/">
+ <fieldref>format</fieldref>
+ <value>8</value>
+ </op>
+ </op>
+ </list>
+ </reply>
+ </request>
+
+ <request name="ListProperties" opcode="21">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="atoms_len" />
+ <pad bytes="22" />
+ <list type="ATOM" name="atoms">
+ <fieldref>atoms_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="SetSelectionOwner" opcode="22">
+ <pad bytes="1" />
+ <field type="WINDOW" name="owner" altenum="Window" />
+ <field type="ATOM" name="selection" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ </request>
+
+ <request name="GetSelectionOwner" opcode="23">
+ <pad bytes="1" />
+ <field type="ATOM" name="selection" />
+ <reply>
+ <pad bytes="1" />
+ <field type="WINDOW" name="owner" altenum="Window" />
+ </reply>
+ </request>
+
+ <request name="ConvertSelection" opcode="24">
+ <pad bytes="1" />
+ <field type="WINDOW" name="requestor" />
+ <field type="ATOM" name="selection" />
+ <field type="ATOM" name="target" />
+ <field type="ATOM" name="property" altenum="Atom" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ </request>
+
+ <enum name="SendEventDest">
+ <item name="PointerWindow"><value>0</value></item>
+ <item name="ItemFocus"> <value>1</value></item>
+ </enum>
+
+ <request name="SendEvent" opcode="25">
+ <field type="BOOL" name="propagate" />
+ <field type="WINDOW" name="destination" altenum="SendEventDest" />
+ <field type="CARD32" name="event_mask" mask="EventMask" />
+ <list type="char" name="event"><value>32</value></list>
+ </request>
+
+ <enum name="GrabMode">
+ <item name="Sync"> <value>0</value></item>
+ <item name="Async"><value>1</value></item>
+ </enum>
+
+ <enum name="GrabStatus">
+ <item name="Success"> <value>0</value></item>
+ <item name="AlreadyGrabbed"><value>1</value></item>
+ <item name="InvalidTime"> <value>2</value></item>
+ <item name="NotViewable"> <value>3</value></item>
+ <item name="Frozen"> <value>4</value></item>
+ </enum>
+
+ <enum name="Cursor">
+ <item name="None"> <value>0</value></item>
+ </enum>
+
+ <request name="GrabPointer" opcode="26">
+ <field type="BOOL" name="owner_events" />
+ <field type="WINDOW" name="grab_window" />
+ <field type="CARD16" name="event_mask" mask="EventMask" />
+ <field type="BYTE" name="pointer_mode" enum="GrabMode" />
+ <field type="BYTE" name="keyboard_mode" enum="GrabMode" />
+ <field type="WINDOW" name="confine_to" altenum="Window" />
+ <field type="CURSOR" name="cursor" altenum="Cursor" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ <reply>
+ <field type="BYTE" name="status" enum="GrabStatus" />
+ </reply>
+ </request>
+
+ <request name="UngrabPointer" opcode="27">
+ <pad bytes="1" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ </request>
+
+ <enum name="ButtonIndex">
+ <item name="Any"><value>0</value></item>
+ <item name="1"> <value>1</value></item>
+ <item name="2"> <value>2</value></item>
+ <item name="3"> <value>3</value></item>
+ <item name="4"> <value>4</value></item>
+ <item name="5"> <value>5</value></item>
+ </enum>
+
+ <request name="GrabButton" opcode="28">
+ <field type="BOOL" name="owner_events" />
+ <field type="WINDOW" name="grab_window" />
+ <field type="CARD16" name="event_mask" mask="EventMask" />
+ <field type="CARD8" name="pointer_mode" enum="GrabMode" />
+ <field type="CARD8" name="keyboard_mode" enum="GrabMode" />
+ <field type="WINDOW" name="confine_to" altenum="Window" />
+ <field type="CURSOR" name="cursor" altenum="Cursor" />
+ <field type="CARD8" name="button" enum="ButtonIndex" />
+ <pad bytes="1" />
+ <field type="CARD16" name="modifiers" mask="ModMask" />
+ </request>
+
+ <request name="UngrabButton" opcode="29">
+ <field type="CARD8" name="button" enum="ButtonIndex" />
+ <field type="WINDOW" name="grab_window" />
+ <field type="CARD16" name="modifiers" mask="ModMask" />
+ <pad bytes="2" />
+ </request>
+
+ <request name="ChangeActivePointerGrab" opcode="30">
+ <pad bytes="1" />
+ <field type="CURSOR" name="cursor" altenum="Cursor" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ <field type="CARD16" name="event_mask" mask="EventMask" />
+ <pad bytes="2" />
+ </request>
+
+ <request name="GrabKeyboard" opcode="31">
+ <field type="BOOL" name="owner_events" />
+ <field type="WINDOW" name="grab_window" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ <field type="BYTE" name="pointer_mode" enum="GrabMode" />
+ <field type="BYTE" name="keyboard_mode" enum="GrabMode" />
+ <pad bytes="2" />
+ <reply>
+ <field type="BYTE" name="status" enum="GrabStatus" />
+ </reply>
+ </request>
+
+ <request name="UngrabKeyboard" opcode="32">
+ <pad bytes="1" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ </request>
+
+ <!-- Use KEYCODE any = { XCBGrabAny }; to grab any key -->
+ <enum name="Grab">
+ <item name="Any"><value>0</value></item>
+ </enum>
+
+ <request name="GrabKey" opcode="33">
+ <field type="BOOL" name="owner_events" />
+ <field type="WINDOW" name="grab_window" />
+ <field type="CARD16" name="modifiers" mask="ModMask" />
+ <field type="KEYCODE" name="key" altenum="Grab" />
+ <field type="CARD8" name="pointer_mode" enum="GrabMode" />
+ <field type="CARD8" name="keyboard_mode" enum="GrabMode" />
+ <pad bytes="3" />
+ </request>
+
+ <request name="UngrabKey" opcode="34">
+ <field type="KEYCODE" name="key" altenum="Grab" />
+ <field type="WINDOW" name="grab_window" />
+ <field type="CARD16" name="modifiers" mask="ModMask" />
+ <pad bytes="2" />
+ </request>
+
+ <enum name="Allow">
+ <item name="AsyncPointer"> <value>0</value></item>
+ <item name="SyncPointer"> <value>1</value></item>
+ <item name="ReplayPointer"> <value>2</value></item>
+ <item name="AsyncKeyboard"> <value>3</value></item>
+ <item name="SyncKeyboard"> <value>4</value></item>
+ <item name="ReplayKeyboard"><value>5</value></item>
+ <item name="AsyncBoth"> <value>6</value></item>
+ <item name="SyncBoth"> <value>7</value></item>
+ </enum>
+
+ <request name="AllowEvents" opcode="35">
+ <field type="CARD8" name="mode" enum="Allow" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ </request>
+
+ <request name="GrabServer" opcode="36" />
+
+ <request name="UngrabServer" opcode="37" />
+
+ <request name="QueryPointer" opcode="38">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <reply>
+ <field type="BOOL" name="same_screen" />
+ <field type="WINDOW" name="root" />
+ <field type="WINDOW" name="child" altenum="Window" />
+ <field type="INT16" name="root_x" />
+ <field type="INT16" name="root_y" />
+ <field type="INT16" name="win_x" />
+ <field type="INT16" name="win_y" />
+ <field type="CARD16" name="mask" mask="KeyButMask" />
+ <pad bytes="2" />
+ </reply>
+ </request>
+
+ <struct name="TIMECOORD">
+ <field type="TIMESTAMP" name="time" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ </struct>
+
+ <request name="GetMotionEvents" opcode="39">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="TIMESTAMP" name="start" altenum="Time" />
+ <field type="TIMESTAMP" name="stop" altenum="Time" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD32" name="events_len" />
+ <pad bytes="20" />
+ <list type="TIMECOORD" name="events">
+ <fieldref>events_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="TranslateCoordinates" opcode="40">
+ <pad bytes="1" />
+ <field type="WINDOW" name="src_window" />
+ <field type="WINDOW" name="dst_window" />
+ <field type="INT16" name="src_x" />
+ <field type="INT16" name="src_y" />
+ <reply>
+ <field type="BOOL" name="same_screen" />
+ <field type="WINDOW" name="child" altenum="Window" />
+ <field type="INT16" name="dst_x" />
+ <field type="INT16" name="dst_y" />
+ </reply>
+ </request>
+
+ <request name="WarpPointer" opcode="41">
+ <pad bytes="1" />
+ <field type="WINDOW" name="src_window" altenum="Window" />
+ <field type="WINDOW" name="dst_window" altenum="Window" />
+ <field type="INT16" name="src_x" />
+ <field type="INT16" name="src_y" />
+ <field type="CARD16" name="src_width" />
+ <field type="CARD16" name="src_height" />
+ <field type="INT16" name="dst_x" />
+ <field type="INT16" name="dst_y" />
+ </request>
+
+ <!-- used for revert_to and focus -->
+ <enum name="InputFocus">
+ <item name="None"> <value>0</value></item>
+ <item name="PointerRoot"><value>1</value></item>
+ <item name="Parent"> <value>2</value></item> <!-- revert_to only -->
+ <item name="FollowKeyboard"><value>3</value></item> <!-- xinput extension only -->
+ </enum>
+
+ <request name="SetInputFocus" opcode="42">
+ <field type="CARD8" name="revert_to" enum="InputFocus" />
+ <field type="WINDOW" name="focus" altenum="InputFocus" />
+ <field type="TIMESTAMP" name="time" altenum="Time" />
+ </request>
+
+ <request name="GetInputFocus" opcode="43">
+ <reply>
+ <field type="CARD8" name="revert_to" enum="InputFocus" />
+ <field type="WINDOW" name="focus" altenum="InputFocus" />
+ </reply>
+ </request>
+
+ <request name="QueryKeymap" opcode="44">
+ <reply>
+ <pad bytes="1" />
+ <list type="CARD8" name="keys"><value>32</value></list>
+ </reply>
+ </request>
+
+ <request name="OpenFont" opcode="45">
+ <pad bytes="1" />
+ <field type="FONT" name="fid" />
+ <field type="CARD16" name="name_len" />
+ <pad bytes="2" />
+ <list type="char" name="name">
+ <fieldref>name_len</fieldref>
+ </list>
+ </request>
+
+ <request name="CloseFont" opcode="46">
+ <pad bytes="1" />
+ <field type="FONT" name="font" />
+ </request>
+
+ <enum name="FontDraw">
+ <item name="LeftToRight"><value>0</value></item>
+ <item name="RightToLeft"><value>1</value></item>
+ </enum>
+
+ <struct name="FONTPROP">
+ <field type="ATOM" name="name" />
+ <field type="CARD32" name="value" />
+ </struct>
+
+ <struct name="CHARINFO">
+ <field type="INT16" name="left_side_bearing" />
+ <field type="INT16" name="right_side_bearing" />
+ <field type="INT16" name="character_width" />
+ <field type="INT16" name="ascent" />
+ <field type="INT16" name="descent" />
+ <field type="CARD16" name="attributes" />
+ </struct>
+
+ <request name="QueryFont" opcode="47">
+ <pad bytes="1" />
+ <field type="FONTABLE" name="font" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CHARINFO" name="min_bounds" />
+ <pad bytes="4" />
+ <field type="CHARINFO" name="max_bounds" />
+ <pad bytes="4" />
+ <field type="CARD16" name="min_char_or_byte2" />
+ <field type="CARD16" name="max_char_or_byte2" />
+ <field type="CARD16" name="default_char" />
+ <field type="CARD16" name="properties_len" />
+ <field type="BYTE" name="draw_direction" enum="FontDraw" />
+ <field type="CARD8" name="min_byte1" />
+ <field type="CARD8" name="max_byte1" />
+ <field type="BOOL" name="all_chars_exist" />
+ <field type="INT16" name="font_ascent" />
+ <field type="INT16" name="font_descent" />
+ <field type="CARD32" name="char_infos_len" />
+ <list type="FONTPROP" name="properties">
+ <fieldref>properties_len</fieldref>
+ </list>
+ <list type="CHARINFO" name="char_infos">
+ <fieldref>char_infos_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="QueryTextExtents" opcode="48">
+ <exprfield type="BOOL" name="odd_length">
+ <op op="&amp;"><fieldref>string_len</fieldref><value>1</value></op>
+ </exprfield>
+ <field type="FONTABLE" name="font" />
+ <list type="CHAR2B" name="string" />
+ <reply>
+ <field type="BYTE" name="draw_direction" enum="FontDraw" />
+ <field type="INT16" name="font_ascent" />
+ <field type="INT16" name="font_descent" />
+ <field type="INT16" name="overall_ascent" />
+ <field type="INT16" name="overall_descent" />
+ <field type="INT32" name="overall_width" />
+ <field type="INT32" name="overall_left" />
+ <field type="INT32" name="overall_right" />
+ </reply>
+ </request>
+
+ <struct name="STR">
+ <field type="CARD8" name="name_len" />
+ <list type="char" name="name">
+ <fieldref>name_len</fieldref>
+ </list>
+ </struct>
+
+ <request name="ListFonts" opcode="49">
+ <pad bytes="1" />
+ <field type="CARD16" name="max_names" />
+ <field type="CARD16" name="pattern_len" />
+ <list type="char" name="pattern">
+ <fieldref>pattern_len</fieldref>
+ </list>
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="names_len" />
+ <pad bytes="22" />
+ <list type="STR" name="names">
+ <fieldref>names_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="ListFontsWithInfo" opcode="50">
+ <pad bytes="1" />
+ <field type="CARD16" name="max_names" />
+ <field type="CARD16" name="pattern_len" />
+ <list type="char" name="pattern">
+ <fieldref>pattern_len</fieldref>
+ </list>
+ <reply>
+ <field type="CARD8" name="name_len" />
+ <field type="CHARINFO" name="min_bounds" />
+ <pad bytes="4" />
+ <field type="CHARINFO" name="max_bounds" />
+ <pad bytes="4" />
+ <field type="CARD16" name="min_char_or_byte2" />
+ <field type="CARD16" name="max_char_or_byte2" />
+ <field type="CARD16" name="default_char" />
+ <field type="CARD16" name="properties_len" />
+ <field type="BYTE" name="draw_direction" enum="FontDraw" />
+ <field type="CARD8" name="min_byte1" />
+ <field type="CARD8" name="max_byte1" />
+ <field type="BOOL" name="all_chars_exist" />
+ <field type="INT16" name="font_ascent" />
+ <field type="INT16" name="font_descent" />
+ <field type="CARD32" name="replies_hint" />
+ <list type="FONTPROP" name="properties">
+ <fieldref>properties_len</fieldref>
+ </list>
+ <list type="char" name="name">
+ <fieldref>name_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="SetFontPath" opcode="51">
+ <pad bytes="1" />
+ <field type="CARD16" name="font_qty" />
+ <list type="char" name="path" />
+ </request>
+
+ <request name="GetFontPath" opcode="52">
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="path_len" />
+ <pad bytes="22" />
+ <list type="STR" name="path">
+ <fieldref>path_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="CreatePixmap" opcode="53">
+ <field type="CARD8" name="depth" />
+ <field type="PIXMAP" name="pid" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ </request>
+
+ <request name="FreePixmap" opcode="54">
+ <pad bytes="1" />
+ <field type="PIXMAP" name="pixmap" />
+ </request>
+
+ <enum name="GC">
+ <item name="Function"> <bit>0</bit></item>
+ <item name="PlaneMask"> <bit>1</bit></item>
+ <item name="Foreground"> <bit>2</bit></item>
+ <item name="Background"> <bit>3</bit></item>
+ <item name="LineWidth"> <bit>4</bit></item>
+ <item name="LineStyle"> <bit>5</bit></item>
+ <item name="CapStyle"> <bit>6</bit></item>
+ <item name="JoinStyle"> <bit>7</bit></item>
+ <item name="FillStyle"> <bit>8</bit></item>
+ <item name="FillRule"> <bit>9</bit></item>
+ <item name="Tile"> <bit>10</bit></item>
+ <item name="Stipple"> <bit>11</bit></item>
+ <item name="TileStippleOriginX"><bit>12</bit></item>
+ <item name="TileStippleOriginY"><bit>13</bit></item>
+ <item name="Font"> <bit>14</bit></item>
+ <item name="SubwindowMode"> <bit>15</bit></item>
+ <item name="GraphicsExposures"> <bit>16</bit></item>
+ <item name="ClipOriginX"> <bit>17</bit></item>
+ <item name="ClipOriginY"> <bit>18</bit></item>
+ <item name="ClipMask"> <bit>19</bit></item>
+ <item name="DashOffset"> <bit>20</bit></item>
+ <item name="DashList"> <bit>21</bit></item>
+ <item name="ArcMode"> <bit>22</bit></item>
+ </enum>
+
+ <!-- GC Function values -->
+ <enum name="GX">
+ <item name="clear"> <value>0</value></item>
+ <item name="and"> <value>1</value></item>
+ <item name="andReverse"> <value>2</value></item>
+ <item name="copy"> <value>3</value></item>
+ <item name="andInverted"> <value>4</value></item>
+ <item name="noop"> <value>5</value></item>
+ <item name="xor"> <value>6</value></item>
+ <item name="or"> <value>7</value></item>
+ <item name="nor"> <value>8</value></item>
+ <item name="equiv"> <value>9</value></item>
+ <item name="invert"> <value>10</value></item>
+ <item name="orReverse"> <value>11</value></item>
+ <item name="copyInverted"><value>12</value></item>
+ <item name="orInverted"> <value>13</value></item>
+ <item name="nand"> <value>14</value></item>
+ <item name="set"> <value>15</value></item>
+ </enum>
+
+ <enum name="LineStyle">
+ <item name="Solid"> <value>0</value></item>
+ <item name="OnOffDash"> <value>1</value></item>
+ <item name="DoubleDash"><value>2</value></item>
+ </enum>
+
+ <enum name="CapStyle">
+ <item name="NotLast"> <value>0</value></item>
+ <item name="Butt"> <value>1</value></item>
+ <item name="Round"> <value>2</value></item>
+ <item name="Projecting"><value>3</value></item>
+ </enum>
+
+ <enum name="JoinStyle">
+ <item name="Miter"> <value>0</value></item>
+ <item name="Round"> <value>1</value></item>
+ <item name="Bevel"> <value>2</value></item>
+ </enum>
+
+ <enum name="FillStyle">
+ <item name="Solid"> <value>0</value></item>
+ <item name="Tiled"> <value>1</value></item>
+ <item name="Stippled"> <value>2</value></item>
+ <item name="OpaqueStippled"><value>3</value></item>
+ </enum>
+
+ <enum name="FillRule">
+ <item name="EvenOdd"><value>0</value></item>
+ <item name="Winding"><value>1</value></item>
+ </enum>
+
+ <enum name="SubwindowMode">
+ <item name="ClipByChildren"> <value>0</value></item>
+ <item name="IncludeInferiors"><value>1</value></item>
+ </enum>
+
+ <enum name="ArcMode">
+ <item name="Chord"> <value>0</value></item>
+ <item name="PieSlice"><value>1</value></item>
+ </enum>
+
+ <request name="CreateGC" opcode="55">
+ <pad bytes="1" />
+ <field type="GCONTEXT" name="cid" />
+ <field type="DRAWABLE" name="drawable" />
+ <valueparam value-mask-type="CARD32"
+ value-mask-name="value_mask"
+ value-list-name="value_list" />
+ </request>
+
+ <request name="ChangeGC" opcode="56">
+ <pad bytes="1" />
+ <field type="GCONTEXT" name="gc" />
+ <valueparam value-mask-type="CARD32"
+ value-mask-name="value_mask"
+ value-list-name="value_list" />
+ </request>
+
+ <request name="CopyGC" opcode="57">
+ <pad bytes="1" />
+ <field type="GCONTEXT" name="src_gc" />
+ <field type="GCONTEXT" name="dst_gc" />
+ <field type="CARD32" name="value_mask" mask="GC" />
+ </request>
+
+ <request name="SetDashes" opcode="58">
+ <pad bytes="1" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="CARD16" name="dash_offset" />
+ <field type="CARD16" name="dashes_len" />
+ <list type="CARD8" name="dashes">
+ <fieldref>dashes_len</fieldref>
+ </list>
+ </request>
+
+ <enum name="ClipOrdering">
+ <item name="Unsorted"><value>0</value></item>
+ <item name="YSorted"> <value>1</value></item>
+ <item name="YXSorted"><value>2</value></item>
+ <item name="YXBanded"><value>3</value></item>
+ </enum>
+
+ <request name="SetClipRectangles" opcode="59">
+ <field type="BYTE" name="ordering" enum="ClipOrdering" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="INT16" name="clip_x_origin" />
+ <field type="INT16" name="clip_y_origin" />
+ <list type="RECTANGLE" name="rectangles" />
+ </request>
+
+ <request name="FreeGC" opcode="60">
+ <pad bytes="1" />
+ <field type="GCONTEXT" name="gc" />
+ </request>
+
+ <request name="ClearArea" opcode="61">
+ <field type="BOOL" name="exposures" />
+ <field type="WINDOW" name="window" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ </request>
+
+ <request name="CopyArea" opcode="62">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="src_drawable" />
+ <field type="DRAWABLE" name="dst_drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="INT16" name="src_x" />
+ <field type="INT16" name="src_y" />
+ <field type="INT16" name="dst_x" />
+ <field type="INT16" name="dst_y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ </request>
+
+ <request name="CopyPlane" opcode="63">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="src_drawable" />
+ <field type="DRAWABLE" name="dst_drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="INT16" name="src_x" />
+ <field type="INT16" name="src_y" />
+ <field type="INT16" name="dst_x" />
+ <field type="INT16" name="dst_y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD32" name="bit_plane" />
+ </request>
+
+ <enum name="CoordMode">
+ <item name="Origin"> <value>0</value></item>
+ <item name="Previous"><value>1</value></item>
+ </enum>
+
+ <!-- combine-adjacent doesn't work for mode==Relative -->
+ <request name="PolyPoint" opcode="64">
+ <field type="BYTE" name="coordinate_mode" enum="CoordMode" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <list type="POINT" name="points" />
+ </request>
+
+ <request name="PolyLine" opcode="65" combine-adjacent="true">
+ <field type="BYTE" name="coordinate_mode" enum="CoordMode" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <list type="POINT" name="points" />
+ </request>
+
+ <struct name="SEGMENT">
+ <field type="INT16" name="x1" />
+ <field type="INT16" name="y1" />
+ <field type="INT16" name="x2" />
+ <field type="INT16" name="y2" />
+ </struct>
+
+ <request name="PolySegment" opcode="66" combine-adjacent="true">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <list type="SEGMENT" name="segments" />
+ </request>
+
+ <request name="PolyRectangle" opcode="67" combine-adjacent="true">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <list type="RECTANGLE" name="rectangles" />
+ </request>
+
+ <!--
+ The semantics of PolyArc change after the first arc: the GC's
+ join style may be applied to successive arcs under some circumstances.
+ So using combine-adjacent here is bad.
+ -->
+ <request name="PolyArc" opcode="68">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <list type="ARC" name="arcs" />
+ </request>
+
+ <enum name="PolyShape">
+ <item name="Complex"> <value>0</value></item>
+ <item name="Nonconvex"><value>1</value></item>
+ <item name="Convex"> <value>2</value></item>
+ </enum>
+
+ <request name="FillPoly" opcode="69">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="CARD8" name="shape" enum="PolyShape" />
+ <field type="CARD8" name="coordinate_mode" enum="CoordMode" />
+ <pad bytes="2" />
+ <list type="POINT" name="points" />
+ </request>
+
+ <request name="PolyFillRectangle" opcode="70" combine-adjacent="true">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <list type="RECTANGLE" name="rectangles" />
+ </request>
+
+ <request name="PolyFillArc" opcode="71" combine-adjacent="true">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <list type="ARC" name="arcs" />
+ </request>
+
+ <enum name="ImageFormat">
+ <item name="XYBitmap"><value>0</value></item>
+ <item name="XYPixmap"><value>1</value></item>
+ <item name="ZPixmap"> <value>2</value></item>
+ </enum>
+
+ <request name="PutImage" opcode="72">
+ <field type="CARD8" name="format" enum="ImageFormat" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="INT16" name="dst_x" />
+ <field type="INT16" name="dst_y" />
+ <field type="CARD8" name="left_pad" />
+ <field type="CARD8" name="depth" />
+ <pad bytes="2" />
+ <list type="BYTE" name="data" />
+ </request>
+
+ <!-- FIXME: data array in reply will include padding, but ought not to. -->
+ <request name="GetImage" opcode="73">
+ <field type="CARD8" name="format" enum="ImageFormat" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD32" name="plane_mask" />
+ <reply>
+ <field type="CARD8" name="depth" />
+ <field type="VISUALID" name="visual" />
+ <pad bytes="20" />
+ <list type="BYTE" name="data">
+ <op op="*">
+ <fieldref>length</fieldref>
+ <value>4</value>
+ </op>
+ </list>
+ </reply>
+ </request>
+
+ <request name="PolyText8" opcode="74">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <list type="BYTE" name="items" />
+ </request>
+
+ <request name="PolyText16" opcode="75">
+ <pad bytes="1" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <list type="BYTE" name="items" />
+ </request>
+
+ <request name="ImageText8" opcode="76">
+ <field type="BYTE" name="string_len" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <list type="char" name="string">
+ <fieldref>string_len</fieldref>
+ </list>
+ </request>
+
+ <request name="ImageText16" opcode="77">
+ <field type="BYTE" name="string_len" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="GCONTEXT" name="gc" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <list type="CHAR2B" name="string">
+ <fieldref>string_len</fieldref>
+ </list>
+ </request>
+
+ <enum name= "ColormapAlloc">
+ <item name="None"><value>0</value></item>
+ <item name="All"> <value>1</value></item>
+ </enum>
+
+ <request name="CreateColormap" opcode="78">
+ <field type="BYTE" name="alloc" enum="ColormapAlloc" />
+ <field type="COLORMAP" name="mid" />
+ <field type="WINDOW" name="window" />
+ <field type="VISUALID" name="visual" />
+ </request>
+
+ <request name="FreeColormap" opcode="79">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="cmap" />
+ </request>
+
+ <request name="CopyColormapAndFree" opcode="80">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="mid" />
+ <field type="COLORMAP" name="src_cmap" />
+ </request>
+
+ <request name="InstallColormap" opcode="81">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="cmap" />
+ </request>
+
+ <request name="UninstallColormap" opcode="82">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="cmap" />
+ </request>
+
+ <request name="ListInstalledColormaps" opcode="83">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="cmaps_len" />
+ <pad bytes="22" />
+ <list type="COLORMAP" name="cmaps">
+ <fieldref>cmaps_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="AllocColor" opcode="84">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="cmap" />
+ <field type="CARD16" name="red" />
+ <field type="CARD16" name="green" />
+ <field type="CARD16" name="blue" />
+ <pad bytes="2" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="red" />
+ <field type="CARD16" name="green" />
+ <field type="CARD16" name="blue" />
+ <pad bytes="2" />
+ <field type="CARD32" name="pixel" />
+ </reply>
+ </request>
+
+ <request name="AllocNamedColor" opcode="85">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="cmap" />
+ <field type="CARD16" name="name_len" />
+ <pad bytes="2" />
+ <list type="char" name="name">
+ <fieldref>name_len</fieldref>
+ </list>
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD32" name="pixel" />
+ <field type="CARD16" name="exact_red" />
+ <field type="CARD16" name="exact_green" />
+ <field type="CARD16" name="exact_blue" />
+ <field type="CARD16" name="visual_red" />
+ <field type="CARD16" name="visual_green" />
+ <field type="CARD16" name="visual_blue" />
+ </reply>
+ </request>
+
+ <request name="AllocColorCells" opcode="86">
+ <field type="BOOL" name="contiguous" />
+ <field type="COLORMAP" name="cmap" />
+ <field type="CARD16" name="colors" />
+ <field type="CARD16" name="planes" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="pixels_len" />
+ <field type="CARD16" name="masks_len" />
+ <pad bytes="20" />
+ <list type="CARD32" name="pixels">
+ <fieldref>pixels_len</fieldref>
+ </list>
+ <list type="CARD32" name="masks">
+ <fieldref>masks_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="AllocColorPlanes" opcode="87">
+ <field type="BOOL" name="contiguous" />
+ <field type="COLORMAP" name="cmap" />
+ <field type="CARD16" name="colors" />
+ <field type="CARD16" name="reds" />
+ <field type="CARD16" name="greens" />
+ <field type="CARD16" name="blues" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="pixels_len" />
+ <pad bytes="2" />
+ <field type="CARD32" name="red_mask" />
+ <field type="CARD32" name="green_mask" />
+ <field type="CARD32" name="blue_mask" />
+ <pad bytes="8" />
+ <list type="CARD32" name="pixels">
+ <fieldref>pixels_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="FreeColors" opcode="88">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="cmap" />
+ <field type="CARD32" name="plane_mask" />
+ <list type="CARD32" name="pixels" />
+ </request>
+
+ <enum name="ColorFlag">
+ <item name="Red"> <bit>0</bit></item>
+ <item name="Green"><bit>1</bit></item>
+ <item name="Blue"> <bit>2</bit></item>
+ </enum>
+
+ <struct name="COLORITEM">
+ <field type="CARD32" name="pixel" />
+ <field type="CARD16" name="red" />
+ <field type="CARD16" name="green" />
+ <field type="CARD16" name="blue" />
+ <field type="BYTE" name="flags" mask="ColorFlag" />
+ <pad bytes="1" />
+ </struct>
+
+ <request name="StoreColors" opcode="89" combine-adjacent="true">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="cmap" />
+ <list type="COLORITEM" name="items" />
+ </request>
+
+ <request name="StoreNamedColor" opcode="90">
+ <field type="CARD8" name="flags" mask="ColorFlag" />
+ <field type="COLORMAP" name="cmap" />
+ <field type="CARD32" name="pixel" />
+ <field type="CARD16" name="name_len" />
+ <pad bytes="2" />
+ <list type="char" name="name">
+ <fieldref>name_len</fieldref>
+ </list>
+ </request>
+
+ <struct name="RGB">
+ <field type="CARD16" name="red" />
+ <field type="CARD16" name="green" />
+ <field type="CARD16" name="blue" />
+ <pad bytes="2" />
+ </struct>
+
+ <request name="QueryColors" opcode="91">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="cmap" />
+ <list type="CARD32" name="pixels" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="colors_len" />
+ <pad bytes="22" />
+ <list type="RGB" name="colors">
+ <fieldref>colors_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="LookupColor" opcode="92">
+ <pad bytes="1" />
+ <field type="COLORMAP" name="cmap" />
+ <field type="CARD16" name="name_len" />
+ <pad bytes="2" />
+ <list type="char" name="name">
+ <fieldref>name_len</fieldref>
+ </list>
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="exact_red" />
+ <field type="CARD16" name="exact_green" />
+ <field type="CARD16" name="exact_blue" />
+ <field type="CARD16" name="visual_red" />
+ <field type="CARD16" name="visual_green" />
+ <field type="CARD16" name="visual_blue" />
+ </reply>
+ </request>
+
+ <enum name="Pixmap">
+ <item name="None"> <value>0</value></item>
+ </enum>
+
+ <request name="CreateCursor" opcode="93">
+ <pad bytes="1" />
+ <field type="CURSOR" name="cid" />
+ <field type="PIXMAP" name="source" />
+ <field type="PIXMAP" name="mask" altenum="Pixmap" />
+ <field type="CARD16" name="fore_red" />
+ <field type="CARD16" name="fore_green" />
+ <field type="CARD16" name="fore_blue" />
+ <field type="CARD16" name="back_red" />
+ <field type="CARD16" name="back_green" />
+ <field type="CARD16" name="back_blue" />
+ <field type="CARD16" name="x" />
+ <field type="CARD16" name="y" />
+ </request>
+
+ <enum name="Font">
+ <item name="None"> <value>0</value></item>
+ </enum>
+
+ <request name="CreateGlyphCursor" opcode="94">
+ <pad bytes="1" />
+ <field type="CURSOR" name="cid" />
+ <field type="FONT" name="source_font" />
+ <field type="FONT" name="mask_font" altenum="Font" />
+ <field type="CARD16" name="source_char" />
+ <field type="CARD16" name="mask_char" />
+ <field type="CARD16" name="fore_red" />
+ <field type="CARD16" name="fore_green" />
+ <field type="CARD16" name="fore_blue" />
+ <field type="CARD16" name="back_red" />
+ <field type="CARD16" name="back_green" />
+ <field type="CARD16" name="back_blue" />
+ </request>
+
+ <request name="FreeCursor" opcode="95">
+ <pad bytes="1" />
+ <field type="CURSOR" name="cursor" />
+ </request>
+
+ <request name="RecolorCursor" opcode="96">
+ <pad bytes="1" />
+ <field type="CURSOR" name="cursor" />
+ <field type="CARD16" name="fore_red" />
+ <field type="CARD16" name="fore_green" />
+ <field type="CARD16" name="fore_blue" />
+ <field type="CARD16" name="back_red" />
+ <field type="CARD16" name="back_green" />
+ <field type="CARD16" name="back_blue" />
+ </request>
+
+ <enum name="QueryShapeOf">
+ <item name="LargestCursor"> <value>0</value></item>
+ <item name="FastestTile"> <value>1</value></item>
+ <item name="FastestStipple"><value>2</value></item>
+ </enum>
+
+ <request name="QueryBestSize" opcode="97">
+ <field type="CARD8" name="class" enum="QueryShapeOf" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ </reply>
+ </request>
+
+ <request name="QueryExtension" opcode="98">
+ <pad bytes="1" />
+ <field type="CARD16" name="name_len" />
+ <pad bytes="2" />
+ <list type="char" name="name">
+ <fieldref>name_len</fieldref>
+ </list>
+ <reply>
+ <pad bytes="1" />
+ <field type="BOOL" name="present" />
+ <field type="CARD8" name="major_opcode" />
+ <field type="CARD8" name="first_event" />
+ <field type="CARD8" name="first_error" />
+ </reply>
+ </request>
+
+ <request name="ListExtensions" opcode="99">
+ <reply>
+ <field type="CARD8" name="names_len" />
+ <pad bytes="24" />
+ <list type="STR" name="names">
+ <fieldref>names_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <request name="ChangeKeyboardMapping" opcode="100">
+ <field type="CARD8" name="keycode_count" />
+ <field type="KEYCODE" name="first_keycode" />
+ <field type="CARD8" name="keysyms_per_keycode" />
+ <pad bytes="2" />
+ <list type="KEYSYM" name="keysyms">
+ <op op="*">
+ <fieldref>keycode_count</fieldref>
+ <fieldref>keysyms_per_keycode</fieldref>
+ </op>
+ </list>
+ </request>
+
+ <request name="GetKeyboardMapping" opcode="101">
+ <pad bytes="1" />
+ <field type="KEYCODE" name="first_keycode" />
+ <field type="CARD8" name="count" />
+ <reply>
+ <field type="BYTE" name="keysyms_per_keycode" />
+ <pad bytes="24" />
+ <list type="KEYSYM" name="keysyms">
+ <fieldref>length</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <enum name="KB">
+ <item name="KeyClickPercent"><bit>0</bit></item>
+ <item name="BellPercent"> <bit>1</bit></item>
+ <item name="BellPitch"> <bit>2</bit></item>
+ <item name="BellDuration"> <bit>3</bit></item>
+ <item name="Led"> <bit>4</bit></item>
+ <item name="LedMode"> <bit>5</bit></item>
+ <item name="Key"> <bit>6</bit></item>
+ <item name="AutoRepeatMode"> <bit>7</bit></item>
+ </enum>
+
+ <enum name="LedMode">
+ <item name="Off"><value>0</value></item>
+ <item name="On"> <value>1</value></item>
+ </enum>
+
+ <enum name="AutoRepeatMode">
+ <item name="Off"> <value>0</value></item>
+ <item name="On"> <value>1</value></item>
+ <item name="Default"><value>2</value></item>
+ </enum>
+
+ <request name="ChangeKeyboardControl" opcode="102">
+ <pad bytes="1" />
+ <valueparam value-mask-type="CARD32"
+ value-mask-name="value_mask"
+ value-list-name="value_list" />
+ </request>
+
+ <request name="GetKeyboardControl" opcode="103">
+ <reply>
+ <field type="BYTE" name="global_auto_repeat" enum="AutoRepeatMode" />
+ <field type="CARD32" name="led_mask" />
+ <field type="CARD8" name="key_click_percent" />
+ <field type="CARD8" name="bell_percent" />
+ <field type="CARD16" name="bell_pitch" />
+ <field type="CARD16" name="bell_duration" />
+ <pad bytes="2" />
+ <list type="CARD8" name="auto_repeats"><value>32</value></list>
+ </reply>
+ </request>
+
+ <request name="Bell" opcode="104">
+ <field type="INT8" name="percent" />
+ </request>
+
+ <request name="ChangePointerControl" opcode="105">
+ <pad bytes="1" />
+ <field type="INT16" name="acceleration_numerator" />
+ <field type="INT16" name="acceleration_denominator" />
+ <field type="INT16" name="threshold" />
+ <field type="BOOL" name="do_acceleration" />
+ <field type="BOOL" name="do_threshold" />
+ </request>
+
+ <request name="GetPointerControl" opcode="106">
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="acceleration_numerator" />
+ <field type="CARD16" name="acceleration_denominator" />
+ <field type="CARD16" name="threshold" />
+ <pad bytes="18" />
+ </reply>
+ </request>
+
+ <!-- Screen saver timeout and interval can be set to -1 to restore defaults
+ and set to 0 to disable the screen saver. -->
+
+ <enum name="Blanking">
+ <item name="NotPreferred"><value>0</value></item>
+ <item name="Preferred"> <value>1</value></item>
+ <item name="Default"> <value>2</value></item>
+ </enum>
+
+ <enum name="Exposures">
+ <item name="NotAllowed"><value>0</value></item>
+ <item name="Allowed"> <value>1</value></item>
+ <item name="Default"> <value>2</value></item>
+ </enum>
+
+ <request name="SetScreenSaver" opcode="107">
+ <pad bytes="1" />
+ <field type="INT16" name="timeout" />
+ <field type="INT16" name="interval" />
+ <field type="CARD8" name="prefer_blanking" enum="Blanking" />
+ <field type="CARD8" name="allow_exposures" enum="Exposures" />
+ </request>
+
+ <request name="GetScreenSaver" opcode="108">
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD16" name="timeout" />
+ <field type="CARD16" name="interval" />
+ <field type="BYTE" name="prefer_blanking" enum="Blanking" />
+ <field type="BYTE" name="allow_exposures" enum="Exposures" />
+ <pad bytes="18" />
+ </reply>
+ </request>
+
+ <enum name="HostMode">
+ <item name="Insert"><value>0</value></item>
+ <item name="Delete"><value>1</value></item>
+ </enum>
+
+ <!-- also used and extended for Xau authentication -->
+ <enum name="Family">
+ <item name="Internet"> <value>0</value></item>
+ <item name="DECnet"> <value>1</value></item>
+ <item name="Chaos"> <value>2</value></item>
+ <item name="ServerInterpreted"><value>5</value></item>
+ <item name="Internet6"> <value>6</value></item>
+ </enum>
+
+ <request name="ChangeHosts" opcode="109">
+ <field type="CARD8" name="mode" enum="HostMode" />
+ <field type="CARD8" name="family" enum="Family" />
+ <pad bytes="1" />
+ <field type="CARD16" name="address_len" />
+ <list type="char" name="address">
+ <fieldref>address_len</fieldref>
+ </list>
+ </request>
+
+ <struct name="HOST">
+ <field type="CARD8" name="family" enum="Family" />
+ <pad bytes="1" />
+ <field type="CARD16" name="address_len" />
+ <list type="BYTE" name="address">
+ <fieldref>address_len</fieldref>
+ </list>
+ </struct>
+
+ <request name="ListHosts" opcode="110">
+ <reply>
+ <field type="BYTE" name="mode" enum="AccessControl" />
+ <field type="CARD16" name="hosts_len" />
+ <pad bytes="22" />
+ <list type="HOST" name="hosts">
+ <fieldref>hosts_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <enum name="AccessControl">
+ <item name="Disable"><value>0</value></item>
+ <item name="Enable"> <value>1</value></item>
+ </enum>
+
+ <request name="SetAccessControl" opcode="111">
+ <field type="CARD8" name="mode" enum="AccessControl" />
+ </request>
+
+ <enum name="CloseDown">
+ <item name="DestroyAll"> <value>0</value></item>
+ <item name="RetainPermanent"><value>1</value></item>
+ <item name="RetainTemporary"><value>2</value></item>
+ </enum>
+
+ <request name="SetCloseDownMode" opcode="112">
+ <field type="CARD8" name="mode" enum="CloseDown" />
+ </request>
+
+ <enum name="Kill">
+ <item name="AllTemporary"><value>0</value></item>
+ </enum>
+
+ <request name="KillClient" opcode="113">
+ <pad bytes="1" />
+ <field type="CARD32" name="resource" altenum="Kill" />
+ </request>
+
+ <request name="RotateProperties" opcode="114">
+ <pad bytes="1" />
+ <field type="WINDOW" name="window" />
+ <field type="CARD16" name="atoms_len" />
+ <field type="INT16" name="delta" />
+ <list type="ATOM" name="atoms">
+ <fieldref>atoms_len</fieldref>
+ </list>
+ </request>
+
+ <enum name="ScreenSaver">
+ <item name="Reset"> <value>0</value></item>
+ <item name="Active"><value>1</value></item>
+ </enum>
+
+ <request name="ForceScreenSaver" opcode="115">
+ <field type="CARD8" name="mode" enum="ScreenSaver" />
+ </request>
+
+ <!-- Reply from SetPointerMapping or SetModifierMapping -->
+ <enum name="MappingStatus">
+ <item name="Success"><value>0</value></item>
+ <item name="Busy"> <value>1</value></item>
+ <item name="Failure"><value>2</value></item>
+ </enum>
+
+ <request name="SetPointerMapping" opcode="116">
+ <field type="CARD8" name="map_len" />
+ <list type="CARD8" name="map">
+ <fieldref>map_len</fieldref>
+ </list>
+ <reply>
+ <field type="BYTE" name="status" enum="MappingStatus" />
+ </reply>
+ </request>
+
+ <request name="GetPointerMapping" opcode="117">
+ <reply>
+ <field type="CARD8" name="map_len" />
+ <pad bytes="24" />
+ <list type="CARD8" name="map">
+ <fieldref>map_len</fieldref>
+ </list>
+ </reply>
+ </request>
+
+ <enum name="MapIndex">
+ <item name="Shift"> <value>0</value></item>
+ <item name="Lock"> <value>1</value></item>
+ <item name="Control"><value>2</value></item>
+ <item name="1"> <value>3</value></item>
+ <item name="2"> <value>4</value></item>
+ <item name="3"> <value>5</value></item>
+ <item name="4"> <value>6</value></item>
+ <item name="5"> <value>7</value></item>
+ </enum>
+
+ <request name="SetModifierMapping" opcode="118">
+ <field type="CARD8" name="keycodes_per_modifier" />
+ <list type="KEYCODE" name="keycodes">
+ <op op="*">
+ <fieldref>keycodes_per_modifier</fieldref>
+ <value>8</value>
+ </op>
+ </list>
+ <reply>
+ <field type="BYTE" name="status" enum="MappingStatus" />
+ </reply>
+ </request>
+
+ <request name="GetModifierMapping" opcode="119">
+ <reply>
+ <field type="CARD8" name="keycodes_per_modifier" />
+ <pad bytes="24" />
+ <list type="KEYCODE" name="keycodes">
+ <op op="*">
+ <fieldref>keycodes_per_modifier</fieldref>
+ <value>8</value>
+ </op>
+ </list>
+ </reply>
+ </request>
+
+ <!--
+ FIXME: NoOperation should allow specifying payload length
+ but geez, malloc()ing a 262140 byte buffer just so I have something
+ to hand to write(2) seems silly...!
+ -->
+ <request name="NoOperation" opcode="127" />
+
+</xcb>
diff --git a/mesalib/Android.mk b/mesalib/Android.mk
index a5c9ebc5f..29453bc34 100644
--- a/mesalib/Android.mk
+++ b/mesalib/Android.mk
@@ -149,7 +149,7 @@ ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_pipe_r300
endif
ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),)
-gallium_DRIVERS += libmesa_pipe_r600 libmesa_winsys_r600
+gallium_DRIVERS += libmesa_pipe_r600
endif
endif
diff --git a/mesalib/configs/default b/mesalib/configs/default
index 43666110b..2b1bf9bef 100644
--- a/mesalib/configs/default
+++ b/mesalib/configs/default
@@ -40,6 +40,7 @@ MKDEP_OPTIONS = -fdepend
MAKE = make
FLEX = flex
BISON = bison
+PKG_CONFIG = pkg-config
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
diff --git a/mesalib/configs/freebsd-dri b/mesalib/configs/freebsd-dri
index c4169b81d..9e810c4b8 100644
--- a/mesalib/configs/freebsd-dri
+++ b/mesalib/configs/freebsd-dri
@@ -32,8 +32,8 @@ MESA_ASM_SOURCES =
# Library/program dependencies
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
-LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
-LIBDRM_LIB = `pkg-config --libs libdrm`
+LIBDRM_CFLAGS = `$(PKG_CONFIG) --cflags libdrm`
+LIBDRM_LIB = `$(PKG_CONFIG) --libs libdrm`
DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)
diff --git a/mesalib/configs/linux-dri b/mesalib/configs/linux-dri
index 26c73ccf0..a3e9baba2 100644
--- a/mesalib/configs/linux-dri
+++ b/mesalib/configs/linux-dri
@@ -44,8 +44,8 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
-LIBDRM_LIB = $(shell pkg-config --libs libdrm)
+LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
+LIBDRM_LIB = $(shell $(PKG_CONFIG) --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
@@ -64,13 +64,13 @@ GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i915 i965 nouveau r200 r300 r600 radeon swrast
-INTEL_LIBS = $(shell pkg-config --libs libdrm_intel)
-INTEL_CFLAGS = $(shell pkg-config --cflags libdrm_intel)
+INTEL_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_intel)
+INTEL_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_intel)
-NOUVEAU_LIBS = $(shell pkg-config --libs libdrm_nouveau)
-NOUVEAU_CFLAGS = $(shell pkg-config --cflags libdrm_nouveau)
+NOUVEAU_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_nouveau)
+NOUVEAU_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_nouveau)
-LIBDRM_RADEON_LIBS = $(shell pkg-config --libs libdrm_radeon)
-LIBDRM_RADEON_CFLAGS = $(shell pkg-config --cflags libdrm_radeon)
+LIBDRM_RADEON_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_radeon)
+LIBDRM_RADEON_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_radeon)
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)
diff --git a/mesalib/configs/linux-dri-xcb b/mesalib/configs/linux-dri-xcb
index a845f71d2..6968bebe4 100644
--- a/mesalib/configs/linux-dri-xcb
+++ b/mesalib/configs/linux-dri-xcb
@@ -25,7 +25,7 @@ DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
-X11_INCLUDES = $(shell pkg-config --cflags-only-I x11) $(shell pkg-config --cflags-only-I xcb) $(shell pkg-config --cflags-only-I x11-xcb) $(shell pkg-config --cflags-only-I xcb-glx)
+X11_INCLUDES = $(shell $(PKG_CONFIG) --cflags-only-I x11) $(shell $(PKG_CONFIG) --cflags-only-I xcb) $(shell $(PKG_CONFIG) --cflags-only-I x11-xcb) $(shell $(PKG_CONFIG) --cflags-only-I xcb-glx)
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
@@ -39,15 +39,15 @@ CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
-EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
+EXTRA_LIB_PATH=$(shell $(PKG_CONFIG) --libs-only-L x11)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
-LIBDRM_LIB = $(shell pkg-config --libs libdrm)
+LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
+LIBDRM_LIB = $(shell $(PKG_CONFIG) --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
- $(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)
+ $(LIBDRM_LIB) $(shell $(PKG_CONFIG) --libs xcb) $(shell $(PKG_CONFIG) --libs x11-xcb) $(shell $(PKG_CONFIG) --libs xcb-glx)
SRC_DIRS = glx gallium mesa glu
diff --git a/mesalib/configs/linux-egl b/mesalib/configs/linux-egl
index 7e928a690..2c8bfdd6f 100644
--- a/mesalib/configs/linux-egl
+++ b/mesalib/configs/linux-egl
@@ -1,58 +1,58 @@
-# -*-makefile-*-
-# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
-
-include $(TOP)/configs/default
-
-CONFIG_NAME = linux-dri
-
-# Compiler and flags
-CC = gcc
-CXX = g++
-
-#MKDEP = /usr/X11R6/bin/makedepend
-#MKDEP = gcc -M
-#MKDEP_OPTIONS = -MF depend
-
-OPT_FLAGS = -O -g
-PIC_FLAGS = -fPIC
-
-# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
-ARCH_FLAGS ?=
-
-DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
- -D_BSD_SOURCE -D_GNU_SOURCE \
- -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
- -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
- -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
-
-X11_INCLUDES = -I/usr/X11R6/include
-
-CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
- $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
-
-CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
-
-
-MESA_ASM_SOURCES =
-
-# Library/program dependencies
-EXTRA_LIB_PATH=-L/usr/X11R6/lib
-
-MESA_MODULES = $(TOP)/src/mesa/libmesa.a
-
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
-LIBDRM_LIB = $(shell pkg-config --libs libdrm)
-DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
-GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
- -lm -lpthread -ldl \
- $(LIBDRM_LIB)
-
-
-# Directories
-SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl
-
-DRIVER_DIRS = dri
-GALLIUM_WINSYS_DIRS = egl_drm
-GALLIUM_TARGET_DIRS =
-
-DRI_DIRS = intel
+# -*-makefile-*-
+# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
+
+include $(TOP)/configs/default
+
+CONFIG_NAME = linux-dri
+
+# Compiler and flags
+CC = gcc
+CXX = g++
+
+#MKDEP = /usr/X11R6/bin/makedepend
+#MKDEP = gcc -M
+#MKDEP_OPTIONS = -MF depend
+
+OPT_FLAGS = -O -g
+PIC_FLAGS = -fPIC
+
+# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
+ARCH_FLAGS ?=
+
+DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
+ -D_BSD_SOURCE -D_GNU_SOURCE \
+ -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
+ -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
+ -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
+
+X11_INCLUDES = -I/usr/X11R6/include
+
+CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
+ $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
+
+CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
+
+
+MESA_ASM_SOURCES =
+
+# Library/program dependencies
+EXTRA_LIB_PATH=-L/usr/X11R6/lib
+
+MESA_MODULES = $(TOP)/src/mesa/libmesa.a
+
+LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
+LIBDRM_LIB = $(shell $(PKG_CONFIG) --libs libdrm)
+DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
+GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
+ -lm -lpthread -ldl \
+ $(LIBDRM_LIB)
+
+
+# Directories
+SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl
+
+DRIVER_DIRS = dri
+GALLIUM_WINSYS_DIRS = egl_drm
+GALLIUM_TARGET_DIRS =
+
+DRI_DIRS = intel
diff --git a/mesalib/configs/linux-llvm b/mesalib/configs/linux-llvm
index ef6c7bb10..259d8ac7a 100644
--- a/mesalib/configs/linux-llvm
+++ b/mesalib/configs/linux-llvm
@@ -44,4 +44,4 @@ LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++
# to allow the NV drivers to compile
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
+LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
diff --git a/mesalib/configure.ac b/mesalib/configure.ac
index 56aac7a81..49e81ad17 100644
--- a/mesalib/configure.ac
+++ b/mesalib/configure.ac
@@ -1798,7 +1798,7 @@ if test "x$with_gallium_drivers" != x; then
case "x$driver" in
xsvga)
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
- gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx" "xa-vmwgfx"
+ gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
;;
xi915)
PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
@@ -1824,7 +1824,7 @@ if test "x$with_gallium_drivers" != x; then
;;
xr600)
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
- gallium_check_st "r600/drm radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
+ gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
;;
xnouveau)
PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
diff --git a/mesalib/docs/envvars.html b/mesalib/docs/envvars.html
index 8c5c6abf7..4b5e89926 100644
--- a/mesalib/docs/envvars.html
+++ b/mesalib/docs/envvars.html
@@ -84,8 +84,6 @@ See the <A HREF="xlibdriver.html">Xlib software driver page</A> for details.
<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
-<li>MESA_GLX_FX - set to either "fullscreen" for full-screen rendering,
- "window" to render into a window, or "disable" to disable the Glide driver.
<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
<li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer.
<li>MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel.
diff --git a/mesalib/docs/install.html b/mesalib/docs/install.html
index 85047913d..07e38bf3d 100644
--- a/mesalib/docs/install.html
+++ b/mesalib/docs/install.html
@@ -304,17 +304,8 @@ Documentation for other environments (some may be very out of date):
<UL>
<li><A HREF="README.VMS">README.VMS</A> - VMS
-<LI><A HREF="README.GGI">README.GGI</A> - GGI
-<LI><A HREF="README.3DFX">README.3DFX</A> - 3Dfx/Glide driver
-<LI><A HREF="README.AMIWIN">README.AMIWIN</A> - Amiga Amiwin
-<LI><A HREF="README.D3D">README.D3D</A> - Direct3D driver
-<LI><A HREF="README.DJ">README.DJ</A> - DJGPP
-<LI><A HREF="README.LYNXOS">README.LYNXOS</A> - LynxOS
-<LI><A HREF="README.MINGW32">README.MINGW32</A> - Mingw32
-<LI><A HREF="README.NeXT">README.NeXT</A> - NeXT
-<LI><A HREF="README.OpenStep">README.OpenStep</A> - OpenStep
-<LI><A HREF="README.OS2">README.OS2</A> - OS/2
-<LI><A HREF="README.WINDML">README.WINDML</A> - WindML
+<LI><A HREF="README.CYGWIN">README.CYGWIN</A> - Cygwin
+<LI><A HREF="README.WIN32">README.WIN32</A> - Win32
</UL>
diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y
index 940830416..17941a9be 100644
--- a/mesalib/src/glsl/glcpp/glcpp-parse.y
+++ b/mesalib/src/glsl/glcpp/glcpp-parse.y
@@ -1275,6 +1275,48 @@ _glcpp_parser_expand_if (glcpp_parser_t *parser, int type, token_list_t *list)
glcpp_parser_lex_from (parser, expanded);
}
+static void
+_glcpp_parser_apply_pastes (glcpp_parser_t *parser, token_list_t *list)
+{
+ token_node_t *node;
+
+ node = list->head;
+ while (node)
+ {
+ token_node_t *next_non_space;
+
+ /* Look ahead for a PASTE token, skipping space. */
+ next_non_space = node->next;
+ while (next_non_space && next_non_space->token->type == SPACE)
+ next_non_space = next_non_space->next;
+
+ if (next_non_space == NULL)
+ break;
+
+ if (next_non_space->token->type != PASTE) {
+ node = next_non_space;
+ continue;
+ }
+
+ /* Now find the next non-space token after the PASTE. */
+ next_non_space = next_non_space->next;
+ while (next_non_space && next_non_space->token->type == SPACE)
+ next_non_space = next_non_space->next;
+
+ if (next_non_space == NULL) {
+ yyerror (&node->token->location, parser, "'##' cannot appear at either end of a macro expansion\n");
+ return;
+ }
+
+ node->token = _token_paste (parser, node->token, next_non_space->token);
+ node->next = next_non_space->next;
+ if (next_non_space == list->tail)
+ list->tail = node;
+ }
+
+ list->non_space_tail = list->tail;
+}
+
/* This is a helper function that's essentially part of the
* implementation of _glcpp_parser_expand_node. It shouldn't be called
* except for by that function.
@@ -1386,43 +1428,7 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser,
_token_list_trim_trailing_space (substituted);
- node = substituted->head;
- while (node)
- {
- token_node_t *next_non_space;
-
- /* Look ahead for a PASTE token, skipping space. */
- next_non_space = node->next;
- while (next_non_space && next_non_space->token->type == SPACE)
- next_non_space = next_non_space->next;
-
- if (next_non_space == NULL)
- break;
-
- if (next_non_space->token->type != PASTE) {
- node = next_non_space;
- continue;
- }
-
- /* Now find the next non-space token after the PASTE. */
- next_non_space = next_non_space->next;
- while (next_non_space && next_non_space->token->type == SPACE)
- next_non_space = next_non_space->next;
-
- if (next_non_space == NULL) {
- yyerror (&node->token->location, parser, "'##' cannot appear at either end of a macro expansion\n");
- return NULL;
- }
-
- node->token = _token_paste (parser, node->token, next_non_space->token);
- node->next = next_non_space->next;
- if (next_non_space == substituted->tail)
- substituted->tail = node;
-
- node = node->next;
- }
-
- substituted->non_space_tail = substituted->tail;
+ _glcpp_parser_apply_pastes (parser, substituted);
return substituted;
}
@@ -1492,13 +1498,16 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser,
if (! macro->is_function)
{
+ token_list_t *replacement;
*last = node;
/* Replace a macro defined as empty with a SPACE token. */
if (macro->replacements == NULL)
return _token_list_create_with_one_space (parser);
- return _token_list_copy (parser, macro->replacements);
+ replacement = _token_list_copy (parser, macro->replacements);
+ _glcpp_parser_apply_pastes (parser, replacement);
+ return replacement;
}
return _glcpp_parser_expand_function (parser, node, last);
@@ -1654,8 +1663,8 @@ _check_for_reserved_macro_name (glcpp_parser_t *parser, YYLTYPE *loc,
/* According to the GLSL specification, macro names starting with "__"
* or "GL_" are reserved for future use. So, don't allow them.
*/
- if (strncmp(identifier, "__", 2) == 0) {
- glcpp_error (loc, parser, "Macro names starting with \"__\" are reserved.\n");
+ if (strstr(identifier, "__")) {
+ glcpp_error (loc, parser, "Macro names containing \"__\" are reserved.\n");
}
if (strncmp(identifier, "GL_", 3) == 0) {
glcpp_error (loc, parser, "Macro names starting with \"GL_\" are reserved.\n");
diff --git a/mesalib/src/glsl/ir_validate.cpp b/mesalib/src/glsl/ir_validate.cpp
index 2d1c6097c..c387ecbca 100644
--- a/mesalib/src/glsl/ir_validate.cpp
+++ b/mesalib/src/glsl/ir_validate.cpp
@@ -33,7 +33,6 @@
* a dereference chain.
*/
-#include <inttypes.h>
#include "ir.h"
#include "ir_hierarchical_visitor.h"
#include "program/hash_table.h"
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index d802a0a9b..9463f5305 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -1298,71 +1298,6 @@ assign_attribute_or_color_locations(gl_shader_program *prog,
invalidate_variable_locations(sh, direction, generic_base);
- if ((target_index == MESA_SHADER_VERTEX) && (prog->Attributes != NULL)) {
- for (unsigned i = 0; i < prog->Attributes->NumParameters; i++) {
- ir_variable *const var =
- sh->symbols->get_variable(prog->Attributes->Parameters[i].Name);
-
- /* Note: attributes that occupy multiple slots, such as arrays or
- * matrices, may appear in the attrib array multiple times.
- */
- if ((var == NULL) || (var->location != -1))
- continue;
-
- /* From page 61 of the OpenGL 4.0 spec:
- *
- * "LinkProgram will fail if the attribute bindings assigned by
- * BindAttribLocation do not leave not enough space to assign a
- * location for an active matrix attribute or an active attribute
- * array, both of which require multiple contiguous generic
- * attributes."
- *
- * Previous versions of the spec contain similar language but omit the
- * bit about attribute arrays.
- *
- * Page 61 of the OpenGL 4.0 spec also says:
- *
- * "It is possible for an application to bind more than one
- * attribute name to the same location. This is referred to as
- * aliasing. This will only work if only one of the aliased
- * attributes is active in the executable program, or if no path
- * through the shader consumes more than one attribute of a set
- * of attributes aliased to the same location. A link error can
- * occur if the linker determines that every path through the
- * shader consumes multiple aliased attributes, but
- * implementations are not required to generate an error in this
- * case."
- *
- * These two paragraphs are either somewhat contradictory, or I don't
- * fully understand one or both of them.
- */
- /* FINISHME: The code as currently written does not support attribute
- * FINISHME: location aliasing (see comment above).
- */
- const int attr = prog->Attributes->Parameters[i].StateIndexes[0];
- const unsigned slots = count_attribute_slots(var->type);
-
- /* Mask representing the contiguous slots that will be used by this
- * attribute.
- */
- const unsigned use_mask = (1 << slots) - 1;
-
- /* Generate a link error if the set of bits requested for this
- * attribute overlaps any previously allocated bits.
- */
- if ((~(use_mask << attr) & used_locations) != used_locations) {
- linker_error(prog,
- "insufficient contiguous attribute locations "
- "available for vertex shader input `%s'",
- var->name);
- return false;
- }
-
- var->location = VERT_ATTRIB_GENERIC0 + attr;
- used_locations |= (use_mask << attr);
- }
- }
-
/* Temporary storage for the set of attributes that need locations assigned.
*/
struct temp_attr {
@@ -1389,28 +1324,83 @@ assign_attribute_or_color_locations(gl_shader_program *prog,
continue;
if (var->explicit_location) {
- const unsigned slots = count_attribute_slots(var->type);
- const unsigned use_mask = (1 << slots) - 1;
- const int attr = var->location - generic_base;
-
if ((var->location >= (int)(max_index + generic_base))
|| (var->location < 0)) {
linker_error(prog,
"invalid explicit location %d specified for `%s'\n",
- (var->location < 0) ? var->location : attr,
+ (var->location < 0)
+ ? var->location : var->location - generic_base,
var->name);
return false;
- } else if (var->location >= generic_base) {
- used_locations |= (use_mask << attr);
+ }
+ } else if (target_index == MESA_SHADER_VERTEX) {
+ unsigned binding;
+
+ if (prog->AttributeBindings->get(binding, var->name)) {
+ assert(binding >= VERT_ATTRIB_GENERIC0);
+ var->location = binding;
}
}
/* The location was explicitly assigned, nothing to do here.
*/
- if (var->location != -1)
+ const unsigned slots = count_attribute_slots(var->type);
+ if (var->location != -1) {
+ if (var->location >= generic_base) {
+ /* From page 61 of the OpenGL 4.0 spec:
+ *
+ * "LinkProgram will fail if the attribute bindings assigned
+ * by BindAttribLocation do not leave not enough space to
+ * assign a location for an active matrix attribute or an
+ * active attribute array, both of which require multiple
+ * contiguous generic attributes."
+ *
+ * Previous versions of the spec contain similar language but omit
+ * the bit about attribute arrays.
+ *
+ * Page 61 of the OpenGL 4.0 spec also says:
+ *
+ * "It is possible for an application to bind more than one
+ * attribute name to the same location. This is referred to as
+ * aliasing. This will only work if only one of the aliased
+ * attributes is active in the executable program, or if no
+ * path through the shader consumes more than one attribute of
+ * a set of attributes aliased to the same location. A link
+ * error can occur if the linker determines that every path
+ * through the shader consumes multiple aliased attributes,
+ * but implementations are not required to generate an error
+ * in this case."
+ *
+ * These two paragraphs are either somewhat contradictory, or I
+ * don't fully understand one or both of them.
+ */
+ /* FINISHME: The code as currently written does not support
+ * FINISHME: attribute location aliasing (see comment above).
+ */
+ /* Mask representing the contiguous slots that will be used by
+ * this attribute.
+ */
+ const unsigned attr = var->location - generic_base;
+ const unsigned use_mask = (1 << slots) - 1;
+
+ /* Generate a link error if the set of bits requested for this
+ * attribute overlaps any previously allocated bits.
+ */
+ if ((~(use_mask << attr) & used_locations) != used_locations) {
+ linker_error(prog,
+ "insufficient contiguous attribute locations "
+ "available for vertex shader input `%s'",
+ var->name);
+ return false;
+ }
+
+ used_locations |= (use_mask << attr);
+ }
+
continue;
+ }
- to_assign[num_attr].slots = count_attribute_slots(var->type);
+ to_assign[num_attr].slots = slots;
to_assign[num_attr].var = var;
num_attr++;
}
@@ -1831,6 +1821,14 @@ done:
/* Retain any live IR, but trash the rest. */
reparent_ir(prog->_LinkedShaders[i]->ir, prog->_LinkedShaders[i]->ir);
+
+ /* The symbol table in the linked shaders may contain references to
+ * variables that were removed (e.g., unused uniforms). Since it may
+ * contain junk, there is no possible valid use. Delete it and set the
+ * pointer to NULL.
+ */
+ delete prog->_LinkedShaders[i]->symbols;
+ prog->_LinkedShaders[i]->symbols = NULL;
}
ralloc_free(mem_ctx);
diff --git a/mesalib/src/glsl/opt_function_inlining.cpp b/mesalib/src/glsl/opt_function_inlining.cpp
index 8fef358cc..ec8b72c63 100644
--- a/mesalib/src/glsl/opt_function_inlining.cpp
+++ b/mesalib/src/glsl/opt_function_inlining.cpp
@@ -27,7 +27,6 @@
* Replaces calls to functions with the body of the function.
*/
-#include <inttypes.h>
#include "ir.h"
#include "ir_visitor.h"
#include "ir_function_inlining.h"
diff --git a/mesalib/src/glsl/standalone_scaffolding.cpp b/mesalib/src/glsl/standalone_scaffolding.cpp
index 72aa1e428..5cc6c9879 100644
--- a/mesalib/src/glsl/standalone_scaffolding.cpp
+++ b/mesalib/src/glsl/standalone_scaffolding.cpp
@@ -67,7 +67,6 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
ctx->Extensions.dummy_false = false;
ctx->Extensions.dummy_true = true;
ctx->Extensions.ARB_ES2_compatibility = true;
- ctx->Extensions.ARB_draw_buffers = true;
ctx->Extensions.ARB_draw_instanced = true;
ctx->Extensions.ARB_fragment_coord_conventions = true;
ctx->Extensions.EXT_texture_array = true;
diff --git a/mesalib/src/mapi/glapi/gen/ARB_draw_buffers.xml b/mesalib/src/mapi/glapi/gen/ARB_draw_buffers.xml
new file mode 100644
index 000000000..f8ecc11ee
--- /dev/null
+++ b/mesalib/src/mapi/glapi/gen/ARB_draw_buffers.xml
@@ -0,0 +1,187 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<OpenGLAPI>
+<category name="GL_ARB_draw_buffers" number="37">
+ <enum name="MAX_DRAW_BUFFERS_ARB" count="1" value="0x8824">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER0_ARB" count="1" value="0x8825">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER1_ARB" count="1" value="0x8826">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER2_ARB" count="1" value="0x8827">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER3_ARB" count="1" value="0x8828">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER4_ARB" count="1" value="0x8829">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER5_ARB" count="1" value="0x882A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER6_ARB" count="1" value="0x882B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER7_ARB" count="1" value="0x882C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER8_ARB" count="1" value="0x882D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER9_ARB" count="1" value="0x882E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER10_ARB" count="1" value="0x882F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER11_ARB" count="1" value="0x8830">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER12_ARB" count="1" value="0x8831">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER13_ARB" count="1" value="0x8832">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER14_ARB" count="1" value="0x8833">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER15_ARB" count="1" value="0x8834">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="DrawBuffersARB" offset="assign">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="bufs" type="const GLenum *" count="n"/>
+ <glx rop="233" large="true"/>
+ </function>
+</category>
+
+<category name="GL_ATI_draw_buffers" number="277">
+ <enum name="MAX_DRAW_BUFFERS_ATI" count="1" value="0x8824">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER0_ATI" count="1" value="0x8825">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER1_ATI" count="1" value="0x8826">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER2_ATI" count="1" value="0x8827">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER3_ATI" count="1" value="0x8828">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER4_ATI" count="1" value="0x8829">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER5_ATI" count="1" value="0x882A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER6_ATI" count="1" value="0x882B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER7_ATI" count="1" value="0x882C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER8_ATI" count="1" value="0x882D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER9_ATI" count="1" value="0x882E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER10_ATI" count="1" value="0x882F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER11_ATI" count="1" value="0x8830">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER12_ATI" count="1" value="0x8831">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER13_ATI" count="1" value="0x8832">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER14_ATI" count="1" value="0x8833">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER15_ATI" count="1" value="0x8834">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="DrawBuffersATI" alias="DrawBuffersARB">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="bufs" type="const GLenum *" count="n"/>
+ </function>
+</category>
+
+<!--
+ This extension serves a similar purpose to ARB_draw_buffers except
+ that this is for OpenGL ES 2.0.
+-->
+<category name="GL_NV_draw_buffers" number="91">
+ <enum name="MAX_DRAW_BUFFERS_NV" count="1" value="0x8824">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER0_NV" count="1" value="0x8825">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER1_NV" count="1" value="0x8826">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER2_NV" count="1" value="0x8827">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER3_NV" count="1" value="0x8828">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER4_NV" count="1" value="0x8829">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER5_NV" count="1" value="0x882A">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER6_NV" count="1" value="0x882B">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER7_NV" count="1" value="0x882C">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER8_NV" count="1" value="0x882D">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER9_NV" count="1" value="0x882E">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER10_NV" count="1" value="0x882F">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER11_NV" count="1" value="0x8830">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER12_NV" count="1" value="0x8831">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER13_NV" count="1" value="0x8832">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER14_NV" count="1" value="0x8833">
+ <size name="Get" mode="get"/>
+ </enum>
+ <enum name="DRAW_BUFFER15_NV" count="1" value="0x8834">
+ <size name="Get" mode="get"/>
+ </enum>
+
+ <function name="DrawBuffersNV" alias="DrawBuffersARB">
+ <param name="n" type="GLsizei" counter="true"/>
+ <param name="bufs" type="const GLenum *" count="n"/>
+ </function>
+</category>
+
+</OpenGLAPI>
diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml
index b8389f0b3..be66a4001 100644
--- a/mesalib/src/mapi/glapi/gen/gl_API.xml
+++ b/mesalib/src/mapi/glapi/gen/gl_API.xml
@@ -7876,65 +7876,7 @@
<!-- No new functions, types, enums. -->
</category>
-<category name="GL_ARB_draw_buffers" number="37">
- <enum name="MAX_DRAW_BUFFERS_ARB" count="1" value="0x8824">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER0_ARB" count="1" value="0x8825">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER1_ARB" count="1" value="0x8826">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER2_ARB" count="1" value="0x8827">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER3_ARB" count="1" value="0x8828">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER4_ARB" count="1" value="0x8829">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER5_ARB" count="1" value="0x882A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER6_ARB" count="1" value="0x882B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER7_ARB" count="1" value="0x882C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER8_ARB" count="1" value="0x882D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER9_ARB" count="1" value="0x882E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER10_ARB" count="1" value="0x882F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER11_ARB" count="1" value="0x8830">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER12_ARB" count="1" value="0x8831">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER13_ARB" count="1" value="0x8832">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER14_ARB" count="1" value="0x8833">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER15_ARB" count="1" value="0x8834">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="DrawBuffersARB" offset="assign">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="bufs" type="const GLenum *" count="n"/>
- <glx rop="233" large="true"/>
- </function>
-</category>
+<xi:include href="ARB_draw_buffers.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<category name="GL_ARB_texture_rectangle" number="38">
<enum name="TEXTURE_RECTANGLE_ARB" count="1" value="0x84F5">
@@ -12013,65 +11955,6 @@
<enum name="RGBA4_DXT5_S3TC" value="0x83A5"/>
</category>
-<category name="GL_ATI_draw_buffers" number="277">
- <enum name="MAX_DRAW_BUFFERS_ATI" count="1" value="0x8824">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER0_ATI" count="1" value="0x8825">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER1_ATI" count="1" value="0x8826">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER2_ATI" count="1" value="0x8827">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER3_ATI" count="1" value="0x8828">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER4_ATI" count="1" value="0x8829">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER5_ATI" count="1" value="0x882A">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER6_ATI" count="1" value="0x882B">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER7_ATI" count="1" value="0x882C">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER8_ATI" count="1" value="0x882D">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER9_ATI" count="1" value="0x882E">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER10_ATI" count="1" value="0x882F">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER11_ATI" count="1" value="0x8830">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER12_ATI" count="1" value="0x8831">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER13_ATI" count="1" value="0x8832">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER14_ATI" count="1" value="0x8833">
- <size name="Get" mode="get"/>
- </enum>
- <enum name="DRAW_BUFFER15_ATI" count="1" value="0x8834">
- <size name="Get" mode="get"/>
- </enum>
-
- <function name="DrawBuffersATI" alias="DrawBuffersARB">
- <param name="n" type="GLsizei" counter="true"/>
- <param name="bufs" type="const GLenum *" count="n"/>
- </function>
-</category>
-
<!-- Extension number 278 is a WGL extension. -->
<category name="GL_ATI_texture_env_combine3" number="279">
diff --git a/mesalib/src/mapi/glapi/gen/gles_api.py b/mesalib/src/mapi/glapi/gen/gles_api.py
index 4cde9e544..0116ba474 100644
--- a/mesalib/src/mapi/glapi/gen/gles_api.py
+++ b/mesalib/src/mapi/glapi/gen/gles_api.py
@@ -449,4 +449,6 @@ es2_api = es2_core + (
# GL_OES_get_program_binary
'GetProgramBinaryOES',
'ProgramBinaryOES',
+ # GL_NV_draw_buffers
+ 'DrawBuffersNV',
)
diff --git a/mesalib/src/mapi/glapi/glapi.h b/mesalib/src/mapi/glapi/glapi.h
index 39b209fe1..8ef654636 100644
--- a/mesalib/src/mapi/glapi/glapi.h
+++ b/mesalib/src/mapi/glapi/glapi.h
@@ -44,6 +44,9 @@
#ifndef _GLAPI_H
#define _GLAPI_H
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifdef _GLAPI_NO_EXPORTS
# define _GLAPI_EXPORT
#else /* _GLAPI_NO_EXPORTS */
@@ -178,3 +181,6 @@ extern struct _glapi_table *
_glapi_create_table_from_handle(void *handle, const char *symbol_prefix);
#endif
+#ifdef __cplusplus
+}
+#endif
diff --git a/mesalib/src/mapi/glapi/glapi_gentable.c b/mesalib/src/mapi/glapi/glapi_gentable.c
index f3fbe6f56..27d1f861b 100644
--- a/mesalib/src/mapi/glapi/glapi_gentable.c
+++ b/mesalib/src/mapi/glapi/glapi_gentable.c
@@ -5512,6 +5512,13 @@ _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) {
}
+ if(!disp->DrawBuffersARB) {
+ void ** procp = (void **) &disp->DrawBuffersARB;
+ snprintf(symboln, sizeof(symboln), "%sDrawBuffersNV", symbol_prefix);
+ *procp = dlsym(handle, symboln);
+ }
+
+
if(!disp->ClampColorARB) {
void ** procp = (void **) &disp->ClampColorARB;
snprintf(symboln, sizeof(symboln), "%sClampColorARB", symbol_prefix);
diff --git a/mesalib/src/mapi/glapi/glapi_mapi_tmp.h b/mesalib/src/mapi/glapi/glapi_mapi_tmp.h
index 8cdadc9a2..7f49ff020 100644
--- a/mesalib/src/mapi/glapi/glapi_mapi_tmp.h
+++ b/mesalib/src/mapi/glapi/glapi_mapi_tmp.h
@@ -774,6 +774,7 @@ GLAPI GLint APIENTRY GLAPI_PREFIX(GetAttribLocation)(GLuint program, const GLcha
GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersARB)(GLsizei n, const GLenum *bufs);
GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffers)(GLsizei n, const GLenum *bufs);
GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersATI)(GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersNV)(GLsizei n, const GLenum *bufs);
GLAPI void APIENTRY GLAPI_PREFIX(ClampColorARB)(GLenum target, GLenum clamp);
GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstancedARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
GLAPI void APIENTRY GLAPI_PREFIX(DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
@@ -6595,6 +6596,13 @@ GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersATI)(GLsizei n, const GLenum *bufs)
((void (APIENTRY *)(GLsizei n, const GLenum *bufs)) _func)(n, bufs);
}
+GLAPI void APIENTRY GLAPI_PREFIX(DrawBuffersNV)(GLsizei n, const GLenum *bufs)
+{
+ const struct mapi_table *_tbl = entry_current_get();
+ mapi_func _func = ((const mapi_func *) _tbl)[571];
+ ((void (APIENTRY *)(GLsizei n, const GLenum *bufs)) _func)(n, bufs);
+}
+
GLAPI void APIENTRY GLAPI_PREFIX(ClampColorARB)(GLenum target, GLenum clamp)
{
const struct mapi_table *_tbl = entry_current_get();
@@ -12446,6 +12454,9 @@ STUB_ASM_ENTRY(GLAPI_PREFIX_STR(DrawBuffersARB))"\n"
".globl "GLAPI_PREFIX_STR(DrawBuffersATI)"\n"
".set "GLAPI_PREFIX_STR(DrawBuffersATI)", "GLAPI_PREFIX_STR(DrawBuffersARB)"\n"
+".globl "GLAPI_PREFIX_STR(DrawBuffersNV)"\n"
+".set "GLAPI_PREFIX_STR(DrawBuffersNV)", "GLAPI_PREFIX_STR(DrawBuffersARB)"\n"
+
STUB_ASM_ENTRY(GLAPI_PREFIX_STR(ClampColorARB))"\n"
"\t"STUB_ASM_CODE("572")"\n"
diff --git a/mesalib/src/mapi/glapi/glapi_sparc.S b/mesalib/src/mapi/glapi/glapi_sparc.S
index f4ce09866..15b9e8737 100644
--- a/mesalib/src/mapi/glapi/glapi_sparc.S
+++ b/mesalib/src/mapi/glapi/glapi_sparc.S
@@ -1440,6 +1440,7 @@ gl_dispatch_functions_start:
GL_STUB_ALIAS(glGetAttribLocation, glGetAttribLocationARB)
GL_STUB_ALIAS(glDrawBuffers, glDrawBuffersARB)
GL_STUB_ALIAS(glDrawBuffersATI, glDrawBuffersARB)
+ GL_STUB_ALIAS(glDrawBuffersNV, glDrawBuffersARB)
GL_STUB_ALIAS(glDrawArraysInstancedEXT, glDrawArraysInstancedARB)
GL_STUB_ALIAS(glDrawArraysInstanced, glDrawArraysInstancedARB)
GL_STUB_ALIAS(glDrawElementsInstancedEXT, glDrawElementsInstancedARB)
diff --git a/mesalib/src/mapi/glapi/glapi_x86-64.S b/mesalib/src/mapi/glapi/glapi_x86-64.S
index cfd8e4a16..a1fbe74ab 100644
--- a/mesalib/src/mapi/glapi/glapi_x86-64.S
+++ b/mesalib/src/mapi/glapi/glapi_x86-64.S
@@ -36997,6 +36997,7 @@ GL_PREFIX(EGLImageTargetTexture2DOES):
.globl GL_PREFIX(GetAttribLocation) ; .set GL_PREFIX(GetAttribLocation), GL_PREFIX(GetAttribLocationARB)
.globl GL_PREFIX(DrawBuffers) ; .set GL_PREFIX(DrawBuffers), GL_PREFIX(DrawBuffersARB)
.globl GL_PREFIX(DrawBuffersATI) ; .set GL_PREFIX(DrawBuffersATI), GL_PREFIX(DrawBuffersARB)
+ .globl GL_PREFIX(DrawBuffersNV) ; .set GL_PREFIX(DrawBuffersNV), GL_PREFIX(DrawBuffersARB)
.globl GL_PREFIX(DrawArraysInstancedEXT) ; .set GL_PREFIX(DrawArraysInstancedEXT), GL_PREFIX(DrawArraysInstancedARB)
.globl GL_PREFIX(DrawArraysInstanced) ; .set GL_PREFIX(DrawArraysInstanced), GL_PREFIX(DrawArraysInstancedARB)
.globl GL_PREFIX(DrawElementsInstancedEXT) ; .set GL_PREFIX(DrawElementsInstancedEXT), GL_PREFIX(DrawElementsInstancedARB)
diff --git a/mesalib/src/mapi/glapi/glapi_x86.S b/mesalib/src/mapi/glapi/glapi_x86.S
index 220e7092a..a72193f87 100644
--- a/mesalib/src/mapi/glapi/glapi_x86.S
+++ b/mesalib/src/mapi/glapi/glapi_x86.S
@@ -1336,6 +1336,7 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB_ALIAS(GetAttribLocation, 570, GetAttribLocation@8, GetAttribLocationARB, GetAttribLocationARB@8)
GL_STUB_ALIAS(DrawBuffers, 571, DrawBuffers@8, DrawBuffersARB, DrawBuffersARB@8)
GL_STUB_ALIAS(DrawBuffersATI, 571, DrawBuffersATI@8, DrawBuffersARB, DrawBuffersARB@8)
+ GL_STUB_ALIAS(DrawBuffersNV, 571, DrawBuffersNV@8, DrawBuffersARB, DrawBuffersARB@8)
GL_STUB_ALIAS(DrawArraysInstancedEXT, 573, DrawArraysInstancedEXT@16, DrawArraysInstancedARB, DrawArraysInstancedARB@16)
GL_STUB_ALIAS(DrawArraysInstanced, 573, DrawArraysInstanced@16, DrawArraysInstancedARB, DrawArraysInstancedARB@16)
GL_STUB_ALIAS(DrawElementsInstancedEXT, 574, DrawElementsInstancedEXT@20, DrawElementsInstancedARB, DrawElementsInstancedARB@20)
diff --git a/mesalib/src/mapi/glapi/glapitemp.h b/mesalib/src/mapi/glapi/glapitemp.h
index cb259068e..a0282ddc0 100644
--- a/mesalib/src/mapi/glapi/glapitemp.h
+++ b/mesalib/src/mapi/glapi/glapitemp.h
@@ -4638,6 +4638,12 @@ KEYWORD1 void KEYWORD2 NAME(DrawBuffersATI)(GLsizei n, const GLenum * bufs)
DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersATI(%d, %p);\n", n, (const void *) bufs));
}
+KEYWORD1 void KEYWORD2 NAME(DrawBuffersNV)(GLsizei n, const GLenum * bufs)
+{
+ (void) n; (void) bufs;
+ DISPATCH(DrawBuffersARB, (n, bufs), (F, "glDrawBuffersNV(%d, %p);\n", n, (const void *) bufs));
+}
+
KEYWORD1 void KEYWORD2 NAME(ClampColorARB)(GLenum target, GLenum clamp)
{
(void) target; (void) clamp;
@@ -9454,6 +9460,7 @@ _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(GetAttribLocation),
TABLE_ENTRY(DrawBuffers),
TABLE_ENTRY(DrawBuffersATI),
+ TABLE_ENTRY(DrawBuffersNV),
TABLE_ENTRY(DrawArraysInstancedEXT),
TABLE_ENTRY(DrawArraysInstanced),
TABLE_ENTRY(DrawElementsInstancedEXT),
diff --git a/mesalib/src/mapi/glapi/glprocs.h b/mesalib/src/mapi/glapi/glprocs.h
index 31ead416a..215dbcfcd 100644
--- a/mesalib/src/mapi/glapi/glprocs.h
+++ b/mesalib/src/mapi/glapi/glprocs.h
@@ -1222,6 +1222,7 @@ static const char gl_string_table[] =
"glGetAttribLocation\0"
"glDrawBuffers\0"
"glDrawBuffersATI\0"
+ "glDrawBuffersNV\0"
"glDrawArraysInstancedEXT\0"
"glDrawArraysInstanced\0"
"glDrawElementsInstancedEXT\0"
@@ -2660,167 +2661,168 @@ static const glprocs_table_t static_functions[] = {
NAME_FUNC_OFFSET(21444, glGetAttribLocationARB, glGetAttribLocationARB, NULL, 570),
NAME_FUNC_OFFSET(21464, glDrawBuffersARB, glDrawBuffersARB, NULL, 571),
NAME_FUNC_OFFSET(21478, glDrawBuffersARB, glDrawBuffersARB, NULL, 571),
- NAME_FUNC_OFFSET(21495, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
- NAME_FUNC_OFFSET(21520, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
- NAME_FUNC_OFFSET(21542, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
- NAME_FUNC_OFFSET(21569, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
- NAME_FUNC_OFFSET(21593, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, 575),
- NAME_FUNC_OFFSET(21629, glBlendEquationSeparateiARB, glBlendEquationSeparateiARB, NULL, 597),
- NAME_FUNC_OFFSET(21663, glBlendEquationiARB, glBlendEquationiARB, NULL, 598),
- NAME_FUNC_OFFSET(21689, glBlendFuncSeparateiARB, glBlendFuncSeparateiARB, NULL, 599),
- NAME_FUNC_OFFSET(21719, glBlendFunciARB, glBlendFunciARB, NULL, 600),
- NAME_FUNC_OFFSET(21741, gl_dispatch_stub_692, gl_dispatch_stub_692, NULL, 692),
- NAME_FUNC_OFFSET(21757, gl_dispatch_stub_693, gl_dispatch_stub_693, NULL, 693),
- NAME_FUNC_OFFSET(21776, glPointParameterfEXT, glPointParameterfEXT, NULL, 700),
- NAME_FUNC_OFFSET(21794, glPointParameterfEXT, glPointParameterfEXT, NULL, 700),
- NAME_FUNC_OFFSET(21815, glPointParameterfEXT, glPointParameterfEXT, NULL, 700),
- NAME_FUNC_OFFSET(21837, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 701),
- NAME_FUNC_OFFSET(21856, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 701),
- NAME_FUNC_OFFSET(21878, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 701),
- NAME_FUNC_OFFSET(21901, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, 704),
- NAME_FUNC_OFFSET(21920, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, 705),
- NAME_FUNC_OFFSET(21940, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, 706),
- NAME_FUNC_OFFSET(21959, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, 707),
- NAME_FUNC_OFFSET(21979, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, 708),
- NAME_FUNC_OFFSET(21998, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, 709),
- NAME_FUNC_OFFSET(22018, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, 710),
- NAME_FUNC_OFFSET(22037, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, 711),
- NAME_FUNC_OFFSET(22057, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, 712),
- NAME_FUNC_OFFSET(22076, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, 713),
- NAME_FUNC_OFFSET(22096, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, 714),
- NAME_FUNC_OFFSET(22116, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, 715),
- NAME_FUNC_OFFSET(22137, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, 716),
- NAME_FUNC_OFFSET(22157, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, 717),
- NAME_FUNC_OFFSET(22178, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, 718),
- NAME_FUNC_OFFSET(22198, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, 719),
- NAME_FUNC_OFFSET(22219, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, 720),
- NAME_FUNC_OFFSET(22243, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, 721),
- NAME_FUNC_OFFSET(22261, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, 722),
- NAME_FUNC_OFFSET(22281, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, 723),
- NAME_FUNC_OFFSET(22299, glFogCoorddEXT, glFogCoorddEXT, NULL, 724),
- NAME_FUNC_OFFSET(22311, glFogCoorddvEXT, glFogCoorddvEXT, NULL, 725),
- NAME_FUNC_OFFSET(22324, glFogCoordfEXT, glFogCoordfEXT, NULL, 726),
- NAME_FUNC_OFFSET(22336, glFogCoordfvEXT, glFogCoordfvEXT, NULL, 727),
- NAME_FUNC_OFFSET(22349, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 729),
- NAME_FUNC_OFFSET(22369, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 729),
- NAME_FUNC_OFFSET(22393, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 746),
- NAME_FUNC_OFFSET(22407, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 746),
- NAME_FUNC_OFFSET(22424, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 747),
- NAME_FUNC_OFFSET(22439, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 747),
- NAME_FUNC_OFFSET(22457, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 748),
- NAME_FUNC_OFFSET(22471, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 748),
- NAME_FUNC_OFFSET(22488, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 749),
- NAME_FUNC_OFFSET(22503, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 749),
- NAME_FUNC_OFFSET(22521, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 750),
- NAME_FUNC_OFFSET(22535, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 750),
- NAME_FUNC_OFFSET(22552, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 751),
- NAME_FUNC_OFFSET(22567, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 751),
- NAME_FUNC_OFFSET(22585, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 752),
- NAME_FUNC_OFFSET(22599, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 752),
- NAME_FUNC_OFFSET(22616, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 753),
- NAME_FUNC_OFFSET(22631, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 753),
- NAME_FUNC_OFFSET(22649, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 754),
- NAME_FUNC_OFFSET(22663, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 754),
- NAME_FUNC_OFFSET(22680, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 755),
- NAME_FUNC_OFFSET(22695, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 755),
- NAME_FUNC_OFFSET(22713, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 756),
- NAME_FUNC_OFFSET(22727, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 756),
- NAME_FUNC_OFFSET(22744, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 757),
- NAME_FUNC_OFFSET(22759, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 757),
- NAME_FUNC_OFFSET(22777, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 758),
- NAME_FUNC_OFFSET(22791, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 758),
- NAME_FUNC_OFFSET(22808, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 759),
- NAME_FUNC_OFFSET(22823, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 759),
- NAME_FUNC_OFFSET(22841, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 760),
- NAME_FUNC_OFFSET(22855, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 760),
- NAME_FUNC_OFFSET(22872, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 761),
- NAME_FUNC_OFFSET(22887, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 761),
- NAME_FUNC_OFFSET(22905, glBindProgramNV, glBindProgramNV, NULL, 780),
- NAME_FUNC_OFFSET(22922, glDeleteProgramsNV, glDeleteProgramsNV, NULL, 781),
- NAME_FUNC_OFFSET(22942, glGenProgramsNV, glGenProgramsNV, NULL, 783),
- NAME_FUNC_OFFSET(22959, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 789),
- NAME_FUNC_OFFSET(22985, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 789),
- NAME_FUNC_OFFSET(23014, glIsProgramNV, glIsProgramNV, NULL, 793),
- NAME_FUNC_OFFSET(23029, glPointParameteriNV, glPointParameteriNV, NULL, 857),
- NAME_FUNC_OFFSET(23047, glPointParameterivNV, glPointParameterivNV, NULL, 858),
- NAME_FUNC_OFFSET(23066, gl_dispatch_stub_861, gl_dispatch_stub_861, NULL, 861),
- NAME_FUNC_OFFSET(23087, gl_dispatch_stub_863, gl_dispatch_stub_863, NULL, 863),
- NAME_FUNC_OFFSET(23103, glPrimitiveRestartIndexNV, glPrimitiveRestartIndexNV, NULL, 870),
- NAME_FUNC_OFFSET(23127, gl_dispatch_stub_873, gl_dispatch_stub_873, NULL, 873),
- NAME_FUNC_OFFSET(23151, gl_dispatch_stub_873, gl_dispatch_stub_873, NULL, 873),
- NAME_FUNC_OFFSET(23178, glBindFramebufferEXT, glBindFramebufferEXT, NULL, 874),
- NAME_FUNC_OFFSET(23196, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, 875),
- NAME_FUNC_OFFSET(23215, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, 876),
- NAME_FUNC_OFFSET(23240, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, 877),
- NAME_FUNC_OFFSET(23261, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, 878),
- NAME_FUNC_OFFSET(23283, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, 879),
- NAME_FUNC_OFFSET(23309, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, 880),
- NAME_FUNC_OFFSET(23332, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, 881),
- NAME_FUNC_OFFSET(23355, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, 882),
- NAME_FUNC_OFFSET(23378, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, 883),
- NAME_FUNC_OFFSET(23396, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, 884),
- NAME_FUNC_OFFSET(23415, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, 885),
- NAME_FUNC_OFFSET(23432, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, 886),
- NAME_FUNC_OFFSET(23470, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, 887),
- NAME_FUNC_OFFSET(23499, glIsFramebufferEXT, glIsFramebufferEXT, NULL, 888),
- NAME_FUNC_OFFSET(23515, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, 889),
- NAME_FUNC_OFFSET(23532, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, 890),
- NAME_FUNC_OFFSET(23554, gl_dispatch_stub_891, gl_dispatch_stub_891, NULL, 891),
- NAME_FUNC_OFFSET(23572, glBindFragDataLocationEXT, glBindFragDataLocationEXT, NULL, 894),
- NAME_FUNC_OFFSET(23595, glGetFragDataLocationEXT, glGetFragDataLocationEXT, NULL, 895),
- NAME_FUNC_OFFSET(23617, glGetUniformuivEXT, glGetUniformuivEXT, NULL, 896),
- NAME_FUNC_OFFSET(23633, glGetVertexAttribIivEXT, glGetVertexAttribIivEXT, NULL, 897),
- NAME_FUNC_OFFSET(23654, glGetVertexAttribIuivEXT, glGetVertexAttribIuivEXT, NULL, 898),
- NAME_FUNC_OFFSET(23676, glUniform1uiEXT, glUniform1uiEXT, NULL, 899),
- NAME_FUNC_OFFSET(23689, glUniform1uivEXT, glUniform1uivEXT, NULL, 900),
- NAME_FUNC_OFFSET(23703, glUniform2uiEXT, glUniform2uiEXT, NULL, 901),
- NAME_FUNC_OFFSET(23716, glUniform2uivEXT, glUniform2uivEXT, NULL, 902),
- NAME_FUNC_OFFSET(23730, glUniform3uiEXT, glUniform3uiEXT, NULL, 903),
- NAME_FUNC_OFFSET(23743, glUniform3uivEXT, glUniform3uivEXT, NULL, 904),
- NAME_FUNC_OFFSET(23757, glUniform4uiEXT, glUniform4uiEXT, NULL, 905),
- NAME_FUNC_OFFSET(23770, glUniform4uivEXT, glUniform4uivEXT, NULL, 906),
- NAME_FUNC_OFFSET(23784, glVertexAttribI1iEXT, glVertexAttribI1iEXT, NULL, 907),
- NAME_FUNC_OFFSET(23802, glVertexAttribI1ivEXT, glVertexAttribI1ivEXT, NULL, 908),
- NAME_FUNC_OFFSET(23821, glVertexAttribI1uiEXT, glVertexAttribI1uiEXT, NULL, 909),
- NAME_FUNC_OFFSET(23840, glVertexAttribI1uivEXT, glVertexAttribI1uivEXT, NULL, 910),
- NAME_FUNC_OFFSET(23860, glVertexAttribI2iEXT, glVertexAttribI2iEXT, NULL, 911),
- NAME_FUNC_OFFSET(23878, glVertexAttribI2ivEXT, glVertexAttribI2ivEXT, NULL, 912),
- NAME_FUNC_OFFSET(23897, glVertexAttribI2uiEXT, glVertexAttribI2uiEXT, NULL, 913),
- NAME_FUNC_OFFSET(23916, glVertexAttribI2uivEXT, glVertexAttribI2uivEXT, NULL, 914),
- NAME_FUNC_OFFSET(23936, glVertexAttribI3iEXT, glVertexAttribI3iEXT, NULL, 915),
- NAME_FUNC_OFFSET(23954, glVertexAttribI3ivEXT, glVertexAttribI3ivEXT, NULL, 916),
- NAME_FUNC_OFFSET(23973, glVertexAttribI3uiEXT, glVertexAttribI3uiEXT, NULL, 917),
- NAME_FUNC_OFFSET(23992, glVertexAttribI3uivEXT, glVertexAttribI3uivEXT, NULL, 918),
- NAME_FUNC_OFFSET(24012, glVertexAttribI4bvEXT, glVertexAttribI4bvEXT, NULL, 919),
- NAME_FUNC_OFFSET(24031, glVertexAttribI4iEXT, glVertexAttribI4iEXT, NULL, 920),
- NAME_FUNC_OFFSET(24049, glVertexAttribI4ivEXT, glVertexAttribI4ivEXT, NULL, 921),
- NAME_FUNC_OFFSET(24068, glVertexAttribI4svEXT, glVertexAttribI4svEXT, NULL, 922),
- NAME_FUNC_OFFSET(24087, glVertexAttribI4ubvEXT, glVertexAttribI4ubvEXT, NULL, 923),
- NAME_FUNC_OFFSET(24107, glVertexAttribI4uiEXT, glVertexAttribI4uiEXT, NULL, 924),
- NAME_FUNC_OFFSET(24126, glVertexAttribI4uivEXT, glVertexAttribI4uivEXT, NULL, 925),
- NAME_FUNC_OFFSET(24146, glVertexAttribI4usvEXT, glVertexAttribI4usvEXT, NULL, 926),
- NAME_FUNC_OFFSET(24166, glVertexAttribIPointerEXT, glVertexAttribIPointerEXT, NULL, 927),
- NAME_FUNC_OFFSET(24189, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, 928),
- NAME_FUNC_OFFSET(24215, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, 928),
- NAME_FUNC_OFFSET(24244, glColorMaskIndexedEXT, glColorMaskIndexedEXT, NULL, 929),
- NAME_FUNC_OFFSET(24257, glDisableIndexedEXT, glDisableIndexedEXT, NULL, 930),
- NAME_FUNC_OFFSET(24268, glEnableIndexedEXT, glEnableIndexedEXT, NULL, 931),
- NAME_FUNC_OFFSET(24278, glGetBooleanIndexedvEXT, glGetBooleanIndexedvEXT, NULL, 932),
- NAME_FUNC_OFFSET(24294, glGetIntegerIndexedvEXT, glGetIntegerIndexedvEXT, NULL, 933),
- NAME_FUNC_OFFSET(24310, glIsEnabledIndexedEXT, glIsEnabledIndexedEXT, NULL, 934),
- NAME_FUNC_OFFSET(24323, glGetTexParameterIivEXT, glGetTexParameterIivEXT, NULL, 937),
- NAME_FUNC_OFFSET(24344, glGetTexParameterIuivEXT, glGetTexParameterIuivEXT, NULL, 938),
- NAME_FUNC_OFFSET(24366, glTexParameterIivEXT, glTexParameterIivEXT, NULL, 939),
- NAME_FUNC_OFFSET(24384, glTexParameterIuivEXT, glTexParameterIuivEXT, NULL, 940),
- NAME_FUNC_OFFSET(24403, glBeginConditionalRenderNV, glBeginConditionalRenderNV, NULL, 941),
- NAME_FUNC_OFFSET(24428, glEndConditionalRenderNV, glEndConditionalRenderNV, NULL, 942),
- NAME_FUNC_OFFSET(24451, glBeginTransformFeedbackEXT, glBeginTransformFeedbackEXT, NULL, 943),
- NAME_FUNC_OFFSET(24476, glBindBufferBaseEXT, glBindBufferBaseEXT, NULL, 944),
- NAME_FUNC_OFFSET(24493, glBindBufferRangeEXT, glBindBufferRangeEXT, NULL, 946),
- NAME_FUNC_OFFSET(24511, glEndTransformFeedbackEXT, glEndTransformFeedbackEXT, NULL, 947),
- NAME_FUNC_OFFSET(24534, glGetTransformFeedbackVaryingEXT, glGetTransformFeedbackVaryingEXT, NULL, 948),
- NAME_FUNC_OFFSET(24564, glTransformFeedbackVaryingsEXT, glTransformFeedbackVaryingsEXT, NULL, 949),
- NAME_FUNC_OFFSET(24592, glProvokingVertexEXT, glProvokingVertexEXT, NULL, 950),
+ NAME_FUNC_OFFSET(21495, glDrawBuffersARB, glDrawBuffersARB, NULL, 571),
+ NAME_FUNC_OFFSET(21511, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
+ NAME_FUNC_OFFSET(21536, glDrawArraysInstancedARB, glDrawArraysInstancedARB, NULL, 573),
+ NAME_FUNC_OFFSET(21558, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
+ NAME_FUNC_OFFSET(21585, glDrawElementsInstancedARB, glDrawElementsInstancedARB, NULL, 574),
+ NAME_FUNC_OFFSET(21609, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, 575),
+ NAME_FUNC_OFFSET(21645, glBlendEquationSeparateiARB, glBlendEquationSeparateiARB, NULL, 597),
+ NAME_FUNC_OFFSET(21679, glBlendEquationiARB, glBlendEquationiARB, NULL, 598),
+ NAME_FUNC_OFFSET(21705, glBlendFuncSeparateiARB, glBlendFuncSeparateiARB, NULL, 599),
+ NAME_FUNC_OFFSET(21735, glBlendFunciARB, glBlendFunciARB, NULL, 600),
+ NAME_FUNC_OFFSET(21757, gl_dispatch_stub_692, gl_dispatch_stub_692, NULL, 692),
+ NAME_FUNC_OFFSET(21773, gl_dispatch_stub_693, gl_dispatch_stub_693, NULL, 693),
+ NAME_FUNC_OFFSET(21792, glPointParameterfEXT, glPointParameterfEXT, NULL, 700),
+ NAME_FUNC_OFFSET(21810, glPointParameterfEXT, glPointParameterfEXT, NULL, 700),
+ NAME_FUNC_OFFSET(21831, glPointParameterfEXT, glPointParameterfEXT, NULL, 700),
+ NAME_FUNC_OFFSET(21853, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 701),
+ NAME_FUNC_OFFSET(21872, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 701),
+ NAME_FUNC_OFFSET(21894, glPointParameterfvEXT, glPointParameterfvEXT, NULL, 701),
+ NAME_FUNC_OFFSET(21917, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, 704),
+ NAME_FUNC_OFFSET(21936, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, 705),
+ NAME_FUNC_OFFSET(21956, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, 706),
+ NAME_FUNC_OFFSET(21975, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, 707),
+ NAME_FUNC_OFFSET(21995, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, 708),
+ NAME_FUNC_OFFSET(22014, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, 709),
+ NAME_FUNC_OFFSET(22034, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, 710),
+ NAME_FUNC_OFFSET(22053, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, 711),
+ NAME_FUNC_OFFSET(22073, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, 712),
+ NAME_FUNC_OFFSET(22092, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, 713),
+ NAME_FUNC_OFFSET(22112, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, 714),
+ NAME_FUNC_OFFSET(22132, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, 715),
+ NAME_FUNC_OFFSET(22153, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, 716),
+ NAME_FUNC_OFFSET(22173, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, 717),
+ NAME_FUNC_OFFSET(22194, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, 718),
+ NAME_FUNC_OFFSET(22214, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, 719),
+ NAME_FUNC_OFFSET(22235, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, 720),
+ NAME_FUNC_OFFSET(22259, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, 721),
+ NAME_FUNC_OFFSET(22277, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, 722),
+ NAME_FUNC_OFFSET(22297, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, 723),
+ NAME_FUNC_OFFSET(22315, glFogCoorddEXT, glFogCoorddEXT, NULL, 724),
+ NAME_FUNC_OFFSET(22327, glFogCoorddvEXT, glFogCoorddvEXT, NULL, 725),
+ NAME_FUNC_OFFSET(22340, glFogCoordfEXT, glFogCoordfEXT, NULL, 726),
+ NAME_FUNC_OFFSET(22352, glFogCoordfvEXT, glFogCoordfvEXT, NULL, 727),
+ NAME_FUNC_OFFSET(22365, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 729),
+ NAME_FUNC_OFFSET(22385, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, 729),
+ NAME_FUNC_OFFSET(22409, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 746),
+ NAME_FUNC_OFFSET(22423, glWindowPos2dMESA, glWindowPos2dMESA, NULL, 746),
+ NAME_FUNC_OFFSET(22440, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 747),
+ NAME_FUNC_OFFSET(22455, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, 747),
+ NAME_FUNC_OFFSET(22473, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 748),
+ NAME_FUNC_OFFSET(22487, glWindowPos2fMESA, glWindowPos2fMESA, NULL, 748),
+ NAME_FUNC_OFFSET(22504, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 749),
+ NAME_FUNC_OFFSET(22519, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, 749),
+ NAME_FUNC_OFFSET(22537, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 750),
+ NAME_FUNC_OFFSET(22551, glWindowPos2iMESA, glWindowPos2iMESA, NULL, 750),
+ NAME_FUNC_OFFSET(22568, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 751),
+ NAME_FUNC_OFFSET(22583, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, 751),
+ NAME_FUNC_OFFSET(22601, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 752),
+ NAME_FUNC_OFFSET(22615, glWindowPos2sMESA, glWindowPos2sMESA, NULL, 752),
+ NAME_FUNC_OFFSET(22632, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 753),
+ NAME_FUNC_OFFSET(22647, glWindowPos2svMESA, glWindowPos2svMESA, NULL, 753),
+ NAME_FUNC_OFFSET(22665, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 754),
+ NAME_FUNC_OFFSET(22679, glWindowPos3dMESA, glWindowPos3dMESA, NULL, 754),
+ NAME_FUNC_OFFSET(22696, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 755),
+ NAME_FUNC_OFFSET(22711, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, 755),
+ NAME_FUNC_OFFSET(22729, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 756),
+ NAME_FUNC_OFFSET(22743, glWindowPos3fMESA, glWindowPos3fMESA, NULL, 756),
+ NAME_FUNC_OFFSET(22760, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 757),
+ NAME_FUNC_OFFSET(22775, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, 757),
+ NAME_FUNC_OFFSET(22793, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 758),
+ NAME_FUNC_OFFSET(22807, glWindowPos3iMESA, glWindowPos3iMESA, NULL, 758),
+ NAME_FUNC_OFFSET(22824, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 759),
+ NAME_FUNC_OFFSET(22839, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, 759),
+ NAME_FUNC_OFFSET(22857, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 760),
+ NAME_FUNC_OFFSET(22871, glWindowPos3sMESA, glWindowPos3sMESA, NULL, 760),
+ NAME_FUNC_OFFSET(22888, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 761),
+ NAME_FUNC_OFFSET(22903, glWindowPos3svMESA, glWindowPos3svMESA, NULL, 761),
+ NAME_FUNC_OFFSET(22921, glBindProgramNV, glBindProgramNV, NULL, 780),
+ NAME_FUNC_OFFSET(22938, glDeleteProgramsNV, glDeleteProgramsNV, NULL, 781),
+ NAME_FUNC_OFFSET(22958, glGenProgramsNV, glGenProgramsNV, NULL, 783),
+ NAME_FUNC_OFFSET(22975, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 789),
+ NAME_FUNC_OFFSET(23001, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, 789),
+ NAME_FUNC_OFFSET(23030, glIsProgramNV, glIsProgramNV, NULL, 793),
+ NAME_FUNC_OFFSET(23045, glPointParameteriNV, glPointParameteriNV, NULL, 857),
+ NAME_FUNC_OFFSET(23063, glPointParameterivNV, glPointParameterivNV, NULL, 858),
+ NAME_FUNC_OFFSET(23082, gl_dispatch_stub_861, gl_dispatch_stub_861, NULL, 861),
+ NAME_FUNC_OFFSET(23103, gl_dispatch_stub_863, gl_dispatch_stub_863, NULL, 863),
+ NAME_FUNC_OFFSET(23119, glPrimitiveRestartIndexNV, glPrimitiveRestartIndexNV, NULL, 870),
+ NAME_FUNC_OFFSET(23143, gl_dispatch_stub_873, gl_dispatch_stub_873, NULL, 873),
+ NAME_FUNC_OFFSET(23167, gl_dispatch_stub_873, gl_dispatch_stub_873, NULL, 873),
+ NAME_FUNC_OFFSET(23194, glBindFramebufferEXT, glBindFramebufferEXT, NULL, 874),
+ NAME_FUNC_OFFSET(23212, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, 875),
+ NAME_FUNC_OFFSET(23231, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, 876),
+ NAME_FUNC_OFFSET(23256, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, 877),
+ NAME_FUNC_OFFSET(23277, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, 878),
+ NAME_FUNC_OFFSET(23299, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, 879),
+ NAME_FUNC_OFFSET(23325, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, 880),
+ NAME_FUNC_OFFSET(23348, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, 881),
+ NAME_FUNC_OFFSET(23371, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, 882),
+ NAME_FUNC_OFFSET(23394, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, 883),
+ NAME_FUNC_OFFSET(23412, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, 884),
+ NAME_FUNC_OFFSET(23431, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, 885),
+ NAME_FUNC_OFFSET(23448, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, 886),
+ NAME_FUNC_OFFSET(23486, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, 887),
+ NAME_FUNC_OFFSET(23515, glIsFramebufferEXT, glIsFramebufferEXT, NULL, 888),
+ NAME_FUNC_OFFSET(23531, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, 889),
+ NAME_FUNC_OFFSET(23548, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, 890),
+ NAME_FUNC_OFFSET(23570, gl_dispatch_stub_891, gl_dispatch_stub_891, NULL, 891),
+ NAME_FUNC_OFFSET(23588, glBindFragDataLocationEXT, glBindFragDataLocationEXT, NULL, 894),
+ NAME_FUNC_OFFSET(23611, glGetFragDataLocationEXT, glGetFragDataLocationEXT, NULL, 895),
+ NAME_FUNC_OFFSET(23633, glGetUniformuivEXT, glGetUniformuivEXT, NULL, 896),
+ NAME_FUNC_OFFSET(23649, glGetVertexAttribIivEXT, glGetVertexAttribIivEXT, NULL, 897),
+ NAME_FUNC_OFFSET(23670, glGetVertexAttribIuivEXT, glGetVertexAttribIuivEXT, NULL, 898),
+ NAME_FUNC_OFFSET(23692, glUniform1uiEXT, glUniform1uiEXT, NULL, 899),
+ NAME_FUNC_OFFSET(23705, glUniform1uivEXT, glUniform1uivEXT, NULL, 900),
+ NAME_FUNC_OFFSET(23719, glUniform2uiEXT, glUniform2uiEXT, NULL, 901),
+ NAME_FUNC_OFFSET(23732, glUniform2uivEXT, glUniform2uivEXT, NULL, 902),
+ NAME_FUNC_OFFSET(23746, glUniform3uiEXT, glUniform3uiEXT, NULL, 903),
+ NAME_FUNC_OFFSET(23759, glUniform3uivEXT, glUniform3uivEXT, NULL, 904),
+ NAME_FUNC_OFFSET(23773, glUniform4uiEXT, glUniform4uiEXT, NULL, 905),
+ NAME_FUNC_OFFSET(23786, glUniform4uivEXT, glUniform4uivEXT, NULL, 906),
+ NAME_FUNC_OFFSET(23800, glVertexAttribI1iEXT, glVertexAttribI1iEXT, NULL, 907),
+ NAME_FUNC_OFFSET(23818, glVertexAttribI1ivEXT, glVertexAttribI1ivEXT, NULL, 908),
+ NAME_FUNC_OFFSET(23837, glVertexAttribI1uiEXT, glVertexAttribI1uiEXT, NULL, 909),
+ NAME_FUNC_OFFSET(23856, glVertexAttribI1uivEXT, glVertexAttribI1uivEXT, NULL, 910),
+ NAME_FUNC_OFFSET(23876, glVertexAttribI2iEXT, glVertexAttribI2iEXT, NULL, 911),
+ NAME_FUNC_OFFSET(23894, glVertexAttribI2ivEXT, glVertexAttribI2ivEXT, NULL, 912),
+ NAME_FUNC_OFFSET(23913, glVertexAttribI2uiEXT, glVertexAttribI2uiEXT, NULL, 913),
+ NAME_FUNC_OFFSET(23932, glVertexAttribI2uivEXT, glVertexAttribI2uivEXT, NULL, 914),
+ NAME_FUNC_OFFSET(23952, glVertexAttribI3iEXT, glVertexAttribI3iEXT, NULL, 915),
+ NAME_FUNC_OFFSET(23970, glVertexAttribI3ivEXT, glVertexAttribI3ivEXT, NULL, 916),
+ NAME_FUNC_OFFSET(23989, glVertexAttribI3uiEXT, glVertexAttribI3uiEXT, NULL, 917),
+ NAME_FUNC_OFFSET(24008, glVertexAttribI3uivEXT, glVertexAttribI3uivEXT, NULL, 918),
+ NAME_FUNC_OFFSET(24028, glVertexAttribI4bvEXT, glVertexAttribI4bvEXT, NULL, 919),
+ NAME_FUNC_OFFSET(24047, glVertexAttribI4iEXT, glVertexAttribI4iEXT, NULL, 920),
+ NAME_FUNC_OFFSET(24065, glVertexAttribI4ivEXT, glVertexAttribI4ivEXT, NULL, 921),
+ NAME_FUNC_OFFSET(24084, glVertexAttribI4svEXT, glVertexAttribI4svEXT, NULL, 922),
+ NAME_FUNC_OFFSET(24103, glVertexAttribI4ubvEXT, glVertexAttribI4ubvEXT, NULL, 923),
+ NAME_FUNC_OFFSET(24123, glVertexAttribI4uiEXT, glVertexAttribI4uiEXT, NULL, 924),
+ NAME_FUNC_OFFSET(24142, glVertexAttribI4uivEXT, glVertexAttribI4uivEXT, NULL, 925),
+ NAME_FUNC_OFFSET(24162, glVertexAttribI4usvEXT, glVertexAttribI4usvEXT, NULL, 926),
+ NAME_FUNC_OFFSET(24182, glVertexAttribIPointerEXT, glVertexAttribIPointerEXT, NULL, 927),
+ NAME_FUNC_OFFSET(24205, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, 928),
+ NAME_FUNC_OFFSET(24231, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, 928),
+ NAME_FUNC_OFFSET(24260, glColorMaskIndexedEXT, glColorMaskIndexedEXT, NULL, 929),
+ NAME_FUNC_OFFSET(24273, glDisableIndexedEXT, glDisableIndexedEXT, NULL, 930),
+ NAME_FUNC_OFFSET(24284, glEnableIndexedEXT, glEnableIndexedEXT, NULL, 931),
+ NAME_FUNC_OFFSET(24294, glGetBooleanIndexedvEXT, glGetBooleanIndexedvEXT, NULL, 932),
+ NAME_FUNC_OFFSET(24310, glGetIntegerIndexedvEXT, glGetIntegerIndexedvEXT, NULL, 933),
+ NAME_FUNC_OFFSET(24326, glIsEnabledIndexedEXT, glIsEnabledIndexedEXT, NULL, 934),
+ NAME_FUNC_OFFSET(24339, glGetTexParameterIivEXT, glGetTexParameterIivEXT, NULL, 937),
+ NAME_FUNC_OFFSET(24360, glGetTexParameterIuivEXT, glGetTexParameterIuivEXT, NULL, 938),
+ NAME_FUNC_OFFSET(24382, glTexParameterIivEXT, glTexParameterIivEXT, NULL, 939),
+ NAME_FUNC_OFFSET(24400, glTexParameterIuivEXT, glTexParameterIuivEXT, NULL, 940),
+ NAME_FUNC_OFFSET(24419, glBeginConditionalRenderNV, glBeginConditionalRenderNV, NULL, 941),
+ NAME_FUNC_OFFSET(24444, glEndConditionalRenderNV, glEndConditionalRenderNV, NULL, 942),
+ NAME_FUNC_OFFSET(24467, glBeginTransformFeedbackEXT, glBeginTransformFeedbackEXT, NULL, 943),
+ NAME_FUNC_OFFSET(24492, glBindBufferBaseEXT, glBindBufferBaseEXT, NULL, 944),
+ NAME_FUNC_OFFSET(24509, glBindBufferRangeEXT, glBindBufferRangeEXT, NULL, 946),
+ NAME_FUNC_OFFSET(24527, glEndTransformFeedbackEXT, glEndTransformFeedbackEXT, NULL, 947),
+ NAME_FUNC_OFFSET(24550, glGetTransformFeedbackVaryingEXT, glGetTransformFeedbackVaryingEXT, NULL, 948),
+ NAME_FUNC_OFFSET(24580, glTransformFeedbackVaryingsEXT, glTransformFeedbackVaryingsEXT, NULL, 949),
+ NAME_FUNC_OFFSET(24608, glProvokingVertexEXT, glProvokingVertexEXT, NULL, 950),
NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)
};
diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript
index abcce4133..9f142bf08 100644
--- a/mesalib/src/mesa/SConscript
+++ b/mesalib/src/mesa/SConscript
@@ -108,6 +108,7 @@ main_sources = [
'main/scissor.c',
'main/shaderapi.c',
'main/shaderobj.c',
+ 'main/shader_query.cpp',
'main/shared.c',
'main/state.c',
'main/stencil.c',
@@ -307,6 +308,7 @@ program_sources = [
'program/programopt.c',
'program/sampler.cpp',
'program/symbol_table.c',
+ 'program/string_to_uint_map.cpp',
program_lex,
program_parse[0],
]
diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c
index 3e2896980..33da9346c 100644
--- a/mesalib/src/mesa/drivers/common/driverfuncs.c
+++ b/mesalib/src/mesa/drivers/common/driverfuncs.c
@@ -200,8 +200,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
_mesa_init_sampler_object_functions(driver);
/* T&L stuff */
- driver->NeedValidate = GL_FALSE;
- driver->ValidateTnlModule = NULL;
driver->CurrentExecPrimitive = 0;
driver->CurrentSavePrimitive = 0;
driver->NeedFlush = 0;
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index b6e80d70a..4d645e200 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -49,6 +49,7 @@
#include "main/macros.h"
#include "main/matrix.h"
#include "main/mipmap.h"
+#include "main/pixel.h"
#include "main/pbo.h"
#include "main/polygon.h"
#include "main/readpix.h"
@@ -3235,8 +3236,27 @@ decompress_texture_image(struct gl_context *ctx,
}
/* read pixels from renderbuffer */
- ctx->Pack.RowLength = destRowLength;
- _mesa_ReadPixels(0, 0, width, height, destFormat, destType, dest);
+ {
+ GLenum baseTexFormat = texImage->_BaseFormat;
+
+ /* The pixel transfer state will be set to default values at this point
+ * (see MESA_META_PIXEL_TRANSFER) so pixel transfer ops are effectively
+ * turned off (as required by glGetTexImage) but we need to handle some
+ * special cases. In particular, single-channel texture values are
+ * returned as red and two-channel texture values are returned as
+ * red/alpha.
+ */
+ if (baseTexFormat == GL_LUMINANCE ||
+ baseTexFormat == GL_LUMINANCE_ALPHA ||
+ baseTexFormat == GL_INTENSITY) {
+ /* Green and blue must be zero */
+ _mesa_PixelTransferf(GL_GREEN_SCALE, 0.0f);
+ _mesa_PixelTransferf(GL_BLUE_SCALE, 0.0f);
+ }
+
+ ctx->Pack.RowLength = destRowLength;
+ _mesa_ReadPixels(0, 0, width, height, destFormat, destType, dest);
+ }
/* disable texture unit */
_mesa_set_enable(ctx, target, GL_FALSE);
@@ -3260,9 +3280,8 @@ decompress_texture_image(struct gl_context *ctx,
* from core Mesa.
*/
void
-_mesa_meta_GetTexImage(struct gl_context *ctx, GLenum target, GLint level,
+_mesa_meta_GetTexImage(struct gl_context *ctx,
GLenum format, GLenum type, GLvoid *pixels,
- struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
/* We can only use the decompress-with-blit method here if the texels are
@@ -3272,6 +3291,7 @@ _mesa_meta_GetTexImage(struct gl_context *ctx, GLenum target, GLint level,
if (_mesa_is_format_compressed(texImage->TexFormat) &&
_mesa_get_format_datatype(texImage->TexFormat)
== GL_UNSIGNED_NORMALIZED) {
+ struct gl_texture_object *texObj = texImage->TexObject;
const GLuint slice = 0; /* only 2D compressed textures for now */
/* Need to unlock the texture here to prevent deadlock... */
_mesa_unlock_texture(ctx, texObj);
@@ -3281,7 +3301,6 @@ _mesa_meta_GetTexImage(struct gl_context *ctx, GLenum target, GLint level,
_mesa_lock_texture(ctx, texObj);
}
else {
- _mesa_get_teximage(ctx, target, level, format, type, pixels,
- texObj, texImage);
+ _mesa_get_teximage(ctx, format, type, pixels, texImage);
}
}
diff --git a/mesalib/src/mesa/drivers/common/meta.h b/mesalib/src/mesa/drivers/common/meta.h
index 3c917924a..7ec568388 100644
--- a/mesalib/src/mesa/drivers/common/meta.h
+++ b/mesalib/src/mesa/drivers/common/meta.h
@@ -124,9 +124,8 @@ _mesa_meta_CopyTexSubImage3D(struct gl_context *ctx, GLenum target, GLint level,
GLsizei width, GLsizei height);
extern void
-_mesa_meta_GetTexImage(struct gl_context *ctx, GLenum target, GLint level,
+_mesa_meta_GetTexImage(struct gl_context *ctx,
GLenum format, GLenum type, GLvoid *pixels,
- struct gl_texture_object *texObj,
struct gl_texture_image *texImage);
diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c
index 8f7509704..1bf39435b 100644
--- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c
+++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c
@@ -582,7 +582,6 @@ swrast_init_driver_functions(struct dd_function_table *driver)
static const char *es2_extensions[] = {
/* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */
- "GL_ARB_draw_buffers",
"GL_ARB_transpose_matrix",
"GL_ARB_window_pos",
"GL_EXT_blend_func_separate",
diff --git a/mesalib/src/mesa/main/APIspec.xml b/mesalib/src/mesa/main/APIspec.xml
index 0f82d0a38..5d5fc03be 100644
--- a/mesalib/src/mesa/main/APIspec.xml
+++ b/mesalib/src/mesa/main/APIspec.xml
@@ -3114,11 +3114,6 @@
<param name="target" type="GLenum"/>
<param name="framebuffer" type="GLuint"/>
</proto>
-
- <desc name="target">
- <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
- </desc>
</template>
<template name="DeleteFramebuffers">
@@ -3143,11 +3138,6 @@
<param name="target" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
</proto>
-
- <desc name="target">
- <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_RENDERBUFFER" category="GLES2.0"/>
- </desc>
</template>
<template name="DeleteRenderbuffers">
@@ -3175,11 +3165,6 @@
<param name="height" type="GLsizei"/>
</proto>
- <desc name="target">
- <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_RENDERBUFFER" category="GLES2.0"/>
- </desc>
-
<desc name="internalFormat">
<value name="GL_DEPTH_COMPONENT16_OES" category="OES_framebuffer_object"/>
<value name="GL_RGBA4_OES" category="OES_framebuffer_object"/>
@@ -3211,25 +3196,6 @@
<param name="renderbuffertarget" type="GLenum"/>
<param name="renderbuffer" type="GLuint"/>
</proto>
-
- <desc name="target">
- <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
- </desc>
-
- <desc name="attachment">
- <value name="GL_COLOR_ATTACHMENT0_OES" category="OES_framebuffer_object"/>
- <value name="GL_DEPTH_ATTACHMENT_OES" category="OES_framebuffer_object"/>
- <value name="GL_STENCIL_ATTACHMENT_OES" category="OES_framebuffer_object"/>
- <value name="GL_COLOR_ATTACHMENT0" category="GLES2.0"/>
- <value name="GL_DEPTH_ATTACHMENT" category="GLES2.0"/>
- <value name="GL_STENCIL_ATTACHMENT" category="GLES2.0"/>
- </desc>
-
- <desc name="renderbuffertarget">
- <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_RENDERBUFFER" category="GLES2.0"/>
- </desc>
</template>
<template name="FramebufferTexture2D">
@@ -3242,20 +3208,6 @@
<param name="level" type="GLint"/>
</proto>
- <desc name="target">
- <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
- </desc>
-
- <desc name="attachment">
- <value name="GL_COLOR_ATTACHMENT0_OES" category="OES_framebuffer_object"/>
- <value name="GL_DEPTH_ATTACHMENT_OES" category="OES_framebuffer_object"/>
- <value name="GL_STENCIL_ATTACHMENT_OES" category="OES_framebuffer_object"/>
- <value name="GL_COLOR_ATTACHMENT0" category="GLES2.0"/>
- <value name="GL_DEPTH_ATTACHMENT" category="GLES2.0"/>
- <value name="GL_STENCIL_ATTACHMENT" category="GLES2.0"/>
- </desc>
-
<desc name="textarget" error="GL_INVALID_OPERATION">
<value name="GL_TEXTURE_2D"/>
<value name="GL_TEXTURE_CUBE_MAP_POSITIVE_X" category="GLES2.0"/>
@@ -3287,20 +3239,6 @@
<param name="zoffset" type="GLint"/>
</proto>
- <desc name="target">
- <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
- </desc>
-
- <desc name="attachment">
- <value name="GL_COLOR_ATTACHMENT0_OES" category="OES_framebuffer_object"/>
- <value name="GL_DEPTH_ATTACHMENT_OES" category="OES_framebuffer_object"/>
- <value name="GL_STENCIL_ATTACHMENT_OES" category="OES_framebuffer_object"/>
- <value name="GL_COLOR_ATTACHMENT0" category="GLES2.0"/>
- <value name="GL_DEPTH_ATTACHMENT" category="GLES2.0"/>
- <value name="GL_STENCIL_ATTACHMENT" category="GLES2.0"/>
- </desc>
-
<desc name="textarget" error="GL_INVALID_OPERATION">
<value name="GL_TEXTURE_3D_OES" category="OES_texture_3D"/>
</desc>
@@ -3311,11 +3249,6 @@
<return type="GLenum"/>
<param name="target" type="GLenum"/>
</proto>
-
- <desc name="target">
- <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
- </desc>
</template>
<template name="GetFramebufferAttachmentParameter" direction="get">
@@ -3327,11 +3260,6 @@
<vector name="params" type="GLtype *" size="dynamic"/>
</proto>
- <desc name="target">
- <value name="GL_FRAMEBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_FRAMEBUFFER" category="GLES2.0"/>
- </desc>
-
<desc name="pname">
<value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES" category="OES_framebuffer_object"/>
<value name="GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES" category="OES_framebuffer_object"/>
@@ -3356,11 +3284,6 @@
<vector name="params" type="GLtype *" size="dynamic"/>
</proto>
- <desc name="target">
- <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_RENDERBUFFER" category="GLES2.0"/>
- </desc>
-
<desc name="pname" category="OES_framebuffer_object">
<value name="GL_RENDERBUFFER_WIDTH_OES"/>
<value name="GL_RENDERBUFFER_HEIGHT_OES"/>
@@ -3587,11 +3510,14 @@
<param name="target" type="GLenum"/>
<param name="image" type="GLeglImageOES"/>
</proto>
+</template>
- <desc name="target">
- <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/>
- <value name="GL_RENDERBUFFER" category="GLES2.0"/>
- </desc>
+<template name="DrawBuffers">
+ <proto>
+ <return type="void"/>
+ <param name="n" type="GLsizei"/>
+ <param name="bufs" type="const GLenum *"/>
+ </proto>
</template>
<api name="mesa" implementation="true">
@@ -3868,6 +3794,8 @@
<!-- OES_EGL_image -->
<function name="EGLImageTargetTexture2DOES" template="EGLImageTargetTexture2D"/>
<function name="EGLImageTargetRenderbufferStorageOES" template="EGLImageTargetRenderbufferStorage"/>
+
+ <function name="DrawBuffersARB" template="DrawBuffers"/>
</api>
<api name="GLES1.1">
@@ -4199,6 +4127,9 @@
<category name="EXT_multi_draw_arrays"/>
<category name="OES_EGL_image"/>
+ <category name="NV_draw_buffers"/>
+ <function name="DrawBuffersNV" template="DrawBuffers"/>
+
<function name="CullFace" template="CullFace"/>
<function name="FrontFace" template="FrontFace"/>
diff --git a/mesalib/src/mesa/main/accum.c b/mesalib/src/mesa/main/accum.c
index 6a83930a1..d7ed3a849 100644
--- a/mesalib/src/mesa/main/accum.c
+++ b/mesalib/src/mesa/main/accum.c
@@ -97,6 +97,9 @@ _mesa_Accum( GLenum op, GLfloat value )
return;
}
+ if (ctx->TransformFeedback.RasterDiscard)
+ return;
+
if (ctx->RenderMode == GL_RENDER) {
ctx->Driver.Accum(ctx, op, value);
}
diff --git a/mesalib/src/mesa/main/accum.h b/mesalib/src/mesa/main/accum.h
index bcd91bd53..f16378cc1 100644
--- a/mesalib/src/mesa/main/accum.h
+++ b/mesalib/src/mesa/main/accum.h
@@ -1,75 +1,75 @@
-/**
- * \file accum.h
- * Accumulation buffer operations.
- *
- * \if subset
- * (No-op)
- *
- * \endif
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-
-#ifndef ACCUM_H
-#define ACCUM_H
-
-#include "main/glheader.h"
-#include "main/mfeatures.h"
-
-struct _glapi_table;
-struct gl_context;
-
-#if FEATURE_accum
-
-extern void GLAPIENTRY
-_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
-
-extern void
-_mesa_init_accum_dispatch(struct _glapi_table *disp);
-
-#else /* FEATURE_accum */
-
-#include "main/compiler.h"
-
-static INLINE void
-_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
-{
- /* this is used in _mesa_PopAttrib */
- ASSERT_NO_FEATURE();
-}
-
-static INLINE void
-_mesa_init_accum_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_accum */
-
-extern void
-_mesa_init_accum( struct gl_context *ctx );
-
-#endif /* ACCUM_H */
+/**
+ * \file accum.h
+ * Accumulation buffer operations.
+ *
+ * \if subset
+ * (No-op)
+ *
+ * \endif
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+
+#ifndef ACCUM_H
+#define ACCUM_H
+
+#include "main/glheader.h"
+#include "main/mfeatures.h"
+
+struct _glapi_table;
+struct gl_context;
+
+#if FEATURE_accum
+
+extern void GLAPIENTRY
+_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
+
+extern void
+_mesa_init_accum_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_accum */
+
+#include "main/compiler.h"
+
+static inline void
+_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
+{
+ /* this is used in _mesa_PopAttrib */
+ ASSERT_NO_FEATURE();
+}
+
+static inline void
+_mesa_init_accum_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_accum */
+
+extern void
+_mesa_init_accum( struct gl_context *ctx );
+
+#endif /* ACCUM_H */
diff --git a/mesalib/src/mesa/main/api_arrayelt.h b/mesalib/src/mesa/main/api_arrayelt.h
index 16e938fd0..03810c69b 100644
--- a/mesalib/src/mesa/main/api_arrayelt.h
+++ b/mesalib/src/mesa/main/api_arrayelt.h
@@ -1,84 +1,84 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef API_ARRAYELT_H
-#define API_ARRAYELT_H
-
-
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-
-#if FEATURE_arrayelt
-
-#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) \
- do { \
- (vfmt)->ArrayElement = impl ## ArrayElement; \
- } while (0)
-
-extern GLboolean _ae_create_context( struct gl_context *ctx );
-extern void _ae_destroy_context( struct gl_context *ctx );
-extern void _ae_invalidate_state( struct gl_context *ctx, GLuint new_state );
-extern void GLAPIENTRY _ae_ArrayElement( GLint elt );
-
-/* May optionally be called before a batch of element calls:
- */
-extern void _ae_map_vbos( struct gl_context *ctx );
-extern void _ae_unmap_vbos( struct gl_context *ctx );
-
-extern void
-_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt);
-
-#else /* FEATURE_arrayelt */
-
-#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) do { } while (0)
-
-static INLINE GLboolean
-_ae_create_context( struct gl_context *ctx )
-{
- return GL_TRUE;
-}
-
-static INLINE void
-_ae_destroy_context( struct gl_context *ctx )
-{
-}
-
-static INLINE void
-_ae_invalidate_state( struct gl_context *ctx, GLuint new_state )
-{
-}
-
-static INLINE void
-_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt)
-{
-}
-
-#endif /* FEATURE_arrayelt */
-
-
-#endif /* API_ARRAYELT_H */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef API_ARRAYELT_H
+#define API_ARRAYELT_H
+
+
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+
+#if FEATURE_arrayelt
+
+#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) \
+ do { \
+ (vfmt)->ArrayElement = impl ## ArrayElement; \
+ } while (0)
+
+extern GLboolean _ae_create_context( struct gl_context *ctx );
+extern void _ae_destroy_context( struct gl_context *ctx );
+extern void _ae_invalidate_state( struct gl_context *ctx, GLuint new_state );
+extern void GLAPIENTRY _ae_ArrayElement( GLint elt );
+
+/* May optionally be called before a batch of element calls:
+ */
+extern void _ae_map_vbos( struct gl_context *ctx );
+extern void _ae_unmap_vbos( struct gl_context *ctx );
+
+extern void
+_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt);
+
+#else /* FEATURE_arrayelt */
+
+#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) do { } while (0)
+
+static inline GLboolean
+_ae_create_context( struct gl_context *ctx )
+{
+ return GL_TRUE;
+}
+
+static inline void
+_ae_destroy_context( struct gl_context *ctx )
+{
+}
+
+static inline void
+_ae_invalidate_state( struct gl_context *ctx, GLuint new_state )
+{
+}
+
+static inline void
+_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt)
+{
+}
+
+#endif /* FEATURE_arrayelt */
+
+
+#endif /* API_ARRAYELT_H */
diff --git a/mesalib/src/mesa/main/api_loopback.h b/mesalib/src/mesa/main/api_loopback.h
index 921637641..f53b90280 100644
--- a/mesalib/src/mesa/main/api_loopback.h
+++ b/mesalib/src/mesa/main/api_loopback.h
@@ -1,48 +1,48 @@
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-
-#ifndef API_LOOPBACK_H
-#define API_LOOPBACK_H
-
-#include "main/compiler.h"
-#include "main/mfeatures.h"
-
-struct _glapi_table;
-
-#if FEATURE_beginend
-
-extern void _mesa_loopback_init_api_table( struct _glapi_table *dest );
-
-#else /* FEATURE_beginend */
-
-static INLINE void
-_mesa_loopback_init_api_table( struct _glapi_table *dest )
-{
-}
-
-#endif /* FEATURE_beginend */
-
-#endif /* API_LOOPBACK_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+
+#ifndef API_LOOPBACK_H
+#define API_LOOPBACK_H
+
+#include "main/compiler.h"
+#include "main/mfeatures.h"
+
+struct _glapi_table;
+
+#if FEATURE_beginend
+
+extern void _mesa_loopback_init_api_table( struct _glapi_table *dest );
+
+#else /* FEATURE_beginend */
+
+static inline void
+_mesa_loopback_init_api_table( struct _glapi_table *dest )
+{
+}
+
+#endif /* FEATURE_beginend */
+
+#endif /* API_LOOPBACK_H */
diff --git a/mesalib/src/mesa/main/arrayobj.c b/mesalib/src/mesa/main/arrayobj.c
index 8d53186c8..78f56ab00 100644
--- a/mesalib/src/mesa/main/arrayobj.c
+++ b/mesalib/src/mesa/main/arrayobj.c
@@ -1,552 +1,552 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.6
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * (C) Copyright IBM Corporation 2006
- * Copyright (C) 2009 VMware, Inc. 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL OR IBM 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 arrayobj.c
- * Functions for the GL_APPLE_vertex_array_object extension.
- *
- * \todo
- * The code in this file borrows a lot from bufferobj.c. There's a certain
- * amount of cruft left over from that origin that may be unnecessary.
- *
- * \author Ian Romanick <idr@us.ibm.com>
- * \author Brian Paul
- */
-
-
-#include "glheader.h"
-#include "hash.h"
-#include "image.h"
-#include "imports.h"
-#include "context.h"
-#include "mfeatures.h"
-#if FEATURE_ARB_vertex_buffer_object
-#include "bufferobj.h"
-#endif
-#include "arrayobj.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "varray.h"
-#include "main/dispatch.h"
-
-
-/**
- * Look up the array object for the given ID.
- *
- * \returns
- * Either a pointer to the array object with the specified ID or \c NULL for
- * a non-existent ID. The spec defines ID 0 as being technically
- * non-existent.
- */
-
-static INLINE struct gl_array_object *
-lookup_arrayobj(struct gl_context *ctx, GLuint id)
-{
- if (id == 0)
- return NULL;
- else
- return (struct gl_array_object *)
- _mesa_HashLookup(ctx->Array.Objects, id);
-}
-
-
-/**
- * For all the vertex arrays in the array object, unbind any pointers
- * to any buffer objects (VBOs).
- * This is done just prior to array object destruction.
- */
-static void
-unbind_array_object_vbos(struct gl_context *ctx, struct gl_array_object *obj)
-{
- GLuint i;
-
- _mesa_reference_buffer_object(ctx, &obj->Vertex.BufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &obj->Weight.BufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &obj->Normal.BufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &obj->Color.BufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &obj->SecondaryColor.BufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &obj->FogCoord.BufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &obj->Index.BufferObj, NULL);
- _mesa_reference_buffer_object(ctx, &obj->EdgeFlag.BufferObj, NULL);
-
- for (i = 0; i < Elements(obj->TexCoord); i++)
- _mesa_reference_buffer_object(ctx, &obj->TexCoord[i].BufferObj, NULL);
-
- for (i = 0; i < Elements(obj->VertexAttrib); i++)
- _mesa_reference_buffer_object(ctx, &obj->VertexAttrib[i].BufferObj,NULL);
-
-#if FEATURE_point_size_array
- _mesa_reference_buffer_object(ctx, &obj->PointSize.BufferObj, NULL);
-#endif
-}
-
-
-/**
- * Allocate and initialize a new vertex array object.
- *
- * This function is intended to be called via
- * \c dd_function_table::NewArrayObject.
- */
-struct gl_array_object *
-_mesa_new_array_object( struct gl_context *ctx, GLuint name )
-{
- struct gl_array_object *obj = CALLOC_STRUCT(gl_array_object);
- if (obj)
- _mesa_initialize_array_object(ctx, obj, name);
- return obj;
-}
-
-
-/**
- * Delete an array object.
- *
- * This function is intended to be called via
- * \c dd_function_table::DeleteArrayObject.
- */
-void
-_mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj )
-{
- (void) ctx;
- unbind_array_object_vbos(ctx, obj);
- _glthread_DESTROY_MUTEX(obj->Mutex);
- free(obj);
-}
-
-
-/**
- * Set ptr to arrayObj w/ reference counting.
- */
-void
-_mesa_reference_array_object(struct gl_context *ctx,
- struct gl_array_object **ptr,
- struct gl_array_object *arrayObj)
-{
- if (*ptr == arrayObj)
- return;
-
- if (*ptr) {
- /* Unreference the old array object */
- GLboolean deleteFlag = GL_FALSE;
- struct gl_array_object *oldObj = *ptr;
-
- _glthread_LOCK_MUTEX(oldObj->Mutex);
- ASSERT(oldObj->RefCount > 0);
- oldObj->RefCount--;
-#if 0
- printf("ArrayObj %p %d DECR to %d\n",
- (void *) oldObj, oldObj->Name, oldObj->RefCount);
-#endif
- deleteFlag = (oldObj->RefCount == 0);
- _glthread_UNLOCK_MUTEX(oldObj->Mutex);
-
- if (deleteFlag) {
- ASSERT(ctx->Driver.DeleteArrayObject);
- ctx->Driver.DeleteArrayObject(ctx, oldObj);
- }
-
- *ptr = NULL;
- }
- ASSERT(!*ptr);
-
- if (arrayObj) {
- /* reference new array object */
- _glthread_LOCK_MUTEX(arrayObj->Mutex);
- if (arrayObj->RefCount == 0) {
- /* this array's being deleted (look just above) */
- /* Not sure this can every really happen. Warn if it does. */
- _mesa_problem(NULL, "referencing deleted array object");
- *ptr = NULL;
- }
- else {
- arrayObj->RefCount++;
-#if 0
- printf("ArrayObj %p %d INCR to %d\n",
- (void *) arrayObj, arrayObj->Name, arrayObj->RefCount);
-#endif
- *ptr = arrayObj;
- }
- _glthread_UNLOCK_MUTEX(arrayObj->Mutex);
- }
-}
-
-
-
-static void
-init_array(struct gl_context *ctx,
- struct gl_client_array *array, GLint size, GLint type)
-{
- array->Size = size;
- array->Type = type;
- array->Format = GL_RGBA; /* only significant for GL_EXT_vertex_array_bgra */
- array->Stride = 0;
- array->StrideB = 0;
- array->Ptr = NULL;
- array->Enabled = GL_FALSE;
- array->Normalized = GL_FALSE;
- array->_ElementSize = size * _mesa_sizeof_type(type);
-#if FEATURE_ARB_vertex_buffer_object
- /* Vertex array buffers */
- _mesa_reference_buffer_object(ctx, &array->BufferObj,
- ctx->Shared->NullBufferObj);
-#endif
-}
-
-
-/**
- * Initialize a gl_array_object's arrays.
- */
-void
-_mesa_initialize_array_object( struct gl_context *ctx,
- struct gl_array_object *obj,
- GLuint name )
-{
- GLuint i;
-
- obj->Name = name;
-
- _glthread_INIT_MUTEX(obj->Mutex);
- obj->RefCount = 1;
-
- /* Init the individual arrays */
- init_array(ctx, &obj->Vertex, 4, GL_FLOAT);
- init_array(ctx, &obj->Weight, 1, GL_FLOAT);
- init_array(ctx, &obj->Normal, 3, GL_FLOAT);
- init_array(ctx, &obj->Color, 4, GL_FLOAT);
- init_array(ctx, &obj->SecondaryColor, 3, GL_FLOAT);
- init_array(ctx, &obj->FogCoord, 1, GL_FLOAT);
- init_array(ctx, &obj->Index, 1, GL_FLOAT);
- for (i = 0; i < Elements(obj->TexCoord); i++) {
- init_array(ctx, &obj->TexCoord[i], 4, GL_FLOAT);
- }
- init_array(ctx, &obj->EdgeFlag, 1, GL_BOOL);
- for (i = 0; i < Elements(obj->VertexAttrib); i++) {
- init_array(ctx, &obj->VertexAttrib[i], 4, GL_FLOAT);
- }
-
-#if FEATURE_point_size_array
- init_array(ctx, &obj->PointSize, 1, GL_FLOAT);
-#endif
-}
-
-
-/**
- * Add the given array object to the array object pool.
- */
-static void
-save_array_object( struct gl_context *ctx, struct gl_array_object *obj )
-{
- if (obj->Name > 0) {
- /* insert into hash table */
- _mesa_HashInsert(ctx->Array.Objects, obj->Name, obj);
- }
-}
-
-
-/**
- * Remove the given array object from the array object pool.
- * Do not deallocate the array object though.
- */
-static void
-remove_array_object( struct gl_context *ctx, struct gl_array_object *obj )
-{
- if (obj->Name > 0) {
- /* remove from hash table */
- _mesa_HashRemove(ctx->Array.Objects, obj->Name);
- }
-}
-
-
-
-/**
- * Helper for update_arrays().
- * \return min(current min, array->_MaxElement).
- */
-static GLuint
-update_min(GLuint min, struct gl_client_array *array)
-{
- if (array->Enabled) {
- _mesa_update_array_max_element(array);
- return MIN2(min, array->_MaxElement);
- }
- else
- return min;
-}
-
-
-/**
- * Examine vertex arrays to update the gl_array_object::_MaxElement field.
- */
-void
-_mesa_update_array_object_max_element(struct gl_context *ctx,
- struct gl_array_object *arrayObj)
-{
- GLuint i, min = ~0;
-
- min = update_min(min, &arrayObj->Vertex);
- min = update_min(min, &arrayObj->Weight);
- min = update_min(min, &arrayObj->Normal);
- min = update_min(min, &arrayObj->Color);
- min = update_min(min, &arrayObj->SecondaryColor);
- min = update_min(min, &arrayObj->FogCoord);
- min = update_min(min, &arrayObj->Index);
- min = update_min(min, &arrayObj->EdgeFlag);
-#if FEATURE_point_size_array
- min = update_min(min, &arrayObj->PointSize);
-#endif
- for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
- min = update_min(min, &arrayObj->TexCoord[i]);
- for (i = 0; i < Elements(arrayObj->VertexAttrib); i++)
- min = update_min(min, &arrayObj->VertexAttrib[i]);
-
- /* _MaxElement is one past the last legal array element */
- arrayObj->_MaxElement = min;
-}
-
-
-/**********************************************************************/
-/* API Functions */
-/**********************************************************************/
-
-
-/**
- * Helper for _mesa_BindVertexArray() and _mesa_BindVertexArrayAPPLE().
- * \param genRequired specifies behavour when id was not generated with
- * glGenVertexArrays().
- */
-static void
-bind_vertex_array(struct gl_context *ctx, GLuint id, GLboolean genRequired)
-{
- struct gl_array_object * const oldObj = ctx->Array.ArrayObj;
- struct gl_array_object *newObj = NULL;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- ASSERT(oldObj != NULL);
-
- if ( oldObj->Name == id )
- return; /* rebinding the same array object- no change */
-
- /*
- * Get pointer to new array object (newObj)
- */
- if (id == 0) {
- /* The spec says there is no array object named 0, but we use
- * one internally because it simplifies things.
- */
- newObj = ctx->Array.DefaultArrayObj;
- }
- else {
- /* non-default array object */
- newObj = lookup_arrayobj(ctx, id);
- if (!newObj) {
- if (genRequired) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glBindVertexArray(id)");
- return;
- }
-
- /* For APPLE version, generate a new array object now */
- newObj = (*ctx->Driver.NewArrayObject)(ctx, id);
- if (!newObj) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE");
- return;
- }
- save_array_object(ctx, newObj);
- }
- }
-
- ctx->NewState |= _NEW_ARRAY;
- ctx->Array.NewState |= _NEW_ARRAY_ALL;
- _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, newObj);
-
- /* Pass BindVertexArray call to device driver */
- if (ctx->Driver.BindArrayObject && newObj)
- ctx->Driver.BindArrayObject(ctx, newObj);
-}
-
-
-/**
- * ARB version of glBindVertexArray()
- * This function behaves differently from glBindVertexArrayAPPLE() in
- * that this function requires all ids to have been previously generated
- * by glGenVertexArrays[APPLE]().
- */
-void GLAPIENTRY
-_mesa_BindVertexArray( GLuint id )
-{
- GET_CURRENT_CONTEXT(ctx);
- bind_vertex_array(ctx, id, GL_TRUE);
-}
-
-
-/**
- * Bind a new array.
- *
- * \todo
- * The binding could be done more efficiently by comparing the non-NULL
- * pointers in the old and new objects. The only arrays that are "dirty" are
- * the ones that are non-NULL in either object.
- */
-void GLAPIENTRY
-_mesa_BindVertexArrayAPPLE( GLuint id )
-{
- GET_CURRENT_CONTEXT(ctx);
- bind_vertex_array(ctx, id, GL_FALSE);
-}
-
-
-/**
- * Delete a set of array objects.
- *
- * \param n Number of array objects to delete.
- * \param ids Array of \c n array object IDs.
- */
-void GLAPIENTRY
-_mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLsizei i;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (n < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteVertexArrayAPPLE(n)");
- return;
- }
-
- for (i = 0; i < n; i++) {
- struct gl_array_object *obj = lookup_arrayobj(ctx, ids[i]);
-
- if ( obj != NULL ) {
- ASSERT( obj->Name == ids[i] );
-
- /* If the array object is currently bound, the spec says "the binding
- * for that object reverts to zero and the default vertex array
- * becomes current."
- */
- if ( obj == ctx->Array.ArrayObj ) {
- CALL_BindVertexArrayAPPLE( ctx->Exec, (0) );
- }
-
- /* The ID is immediately freed for re-use */
- remove_array_object(ctx, obj);
-
- /* Unreference the array object.
- * If refcount hits zero, the object will be deleted.
- */
- _mesa_reference_array_object(ctx, &obj, NULL);
- }
- }
-}
-
-
-/**
- * Generate a set of unique array object IDs and store them in \c arrays.
- * Helper for _mesa_GenVertexArrays[APPLE]() functions below.
- * \param n Number of IDs to generate.
- * \param arrays Array of \c n locations to store the IDs.
- * \param vboOnly Will arrays have to reside in VBOs?
- */
-static void
-gen_vertex_arrays(struct gl_context *ctx, GLsizei n, GLuint *arrays,
- GLboolean vboOnly)
-{
- GLuint first;
- GLint i;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (n < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGenVertexArraysAPPLE");
- return;
- }
-
- if (!arrays) {
- return;
- }
-
- first = _mesa_HashFindFreeKeyBlock(ctx->Array.Objects, n);
-
- /* Allocate new, empty array objects and return identifiers */
- for (i = 0; i < n; i++) {
- struct gl_array_object *obj;
- GLuint name = first + i;
-
- obj = (*ctx->Driver.NewArrayObject)( ctx, name );
- if (!obj) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenVertexArraysAPPLE");
- return;
- }
- obj->VBOonly = vboOnly;
- save_array_object(ctx, obj);
- arrays[i] = first + i;
- }
-}
-
-
-/**
- * ARB version of glGenVertexArrays()
- * All arrays will be required to live in VBOs.
- */
-void GLAPIENTRY
-_mesa_GenVertexArrays(GLsizei n, GLuint *arrays)
-{
- GET_CURRENT_CONTEXT(ctx);
- gen_vertex_arrays(ctx, n, arrays, GL_TRUE);
-}
-
-
-/**
- * APPLE version of glGenVertexArraysAPPLE()
- * Arrays may live in VBOs or ordinary memory.
- */
-void GLAPIENTRY
-_mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *arrays)
-{
- GET_CURRENT_CONTEXT(ctx);
- gen_vertex_arrays(ctx, n, arrays, GL_FALSE);
-}
-
-
-/**
- * Determine if ID is the name of an array object.
- *
- * \param id ID of the potential array object.
- * \return \c GL_TRUE if \c id is the name of a array object,
- * \c GL_FALSE otherwise.
- */
-GLboolean GLAPIENTRY
-_mesa_IsVertexArrayAPPLE( GLuint id )
-{
- struct gl_array_object * obj;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
-
- if (id == 0)
- return GL_FALSE;
-
- obj = lookup_arrayobj(ctx, id);
-
- return (obj != NULL) ? GL_TRUE : GL_FALSE;
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.6
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * (C) Copyright IBM Corporation 2006
+ * Copyright (C) 2009 VMware, Inc. 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL OR IBM 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 arrayobj.c
+ * Functions for the GL_APPLE_vertex_array_object extension.
+ *
+ * \todo
+ * The code in this file borrows a lot from bufferobj.c. There's a certain
+ * amount of cruft left over from that origin that may be unnecessary.
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ * \author Brian Paul
+ */
+
+
+#include "glheader.h"
+#include "hash.h"
+#include "image.h"
+#include "imports.h"
+#include "context.h"
+#include "mfeatures.h"
+#if FEATURE_ARB_vertex_buffer_object
+#include "bufferobj.h"
+#endif
+#include "arrayobj.h"
+#include "macros.h"
+#include "mtypes.h"
+#include "varray.h"
+#include "main/dispatch.h"
+
+
+/**
+ * Look up the array object for the given ID.
+ *
+ * \returns
+ * Either a pointer to the array object with the specified ID or \c NULL for
+ * a non-existent ID. The spec defines ID 0 as being technically
+ * non-existent.
+ */
+
+static inline struct gl_array_object *
+lookup_arrayobj(struct gl_context *ctx, GLuint id)
+{
+ if (id == 0)
+ return NULL;
+ else
+ return (struct gl_array_object *)
+ _mesa_HashLookup(ctx->Array.Objects, id);
+}
+
+
+/**
+ * For all the vertex arrays in the array object, unbind any pointers
+ * to any buffer objects (VBOs).
+ * This is done just prior to array object destruction.
+ */
+static void
+unbind_array_object_vbos(struct gl_context *ctx, struct gl_array_object *obj)
+{
+ GLuint i;
+
+ _mesa_reference_buffer_object(ctx, &obj->Vertex.BufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &obj->Weight.BufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &obj->Normal.BufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &obj->Color.BufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &obj->SecondaryColor.BufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &obj->FogCoord.BufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &obj->Index.BufferObj, NULL);
+ _mesa_reference_buffer_object(ctx, &obj->EdgeFlag.BufferObj, NULL);
+
+ for (i = 0; i < Elements(obj->TexCoord); i++)
+ _mesa_reference_buffer_object(ctx, &obj->TexCoord[i].BufferObj, NULL);
+
+ for (i = 0; i < Elements(obj->VertexAttrib); i++)
+ _mesa_reference_buffer_object(ctx, &obj->VertexAttrib[i].BufferObj,NULL);
+
+#if FEATURE_point_size_array
+ _mesa_reference_buffer_object(ctx, &obj->PointSize.BufferObj, NULL);
+#endif
+}
+
+
+/**
+ * Allocate and initialize a new vertex array object.
+ *
+ * This function is intended to be called via
+ * \c dd_function_table::NewArrayObject.
+ */
+struct gl_array_object *
+_mesa_new_array_object( struct gl_context *ctx, GLuint name )
+{
+ struct gl_array_object *obj = CALLOC_STRUCT(gl_array_object);
+ if (obj)
+ _mesa_initialize_array_object(ctx, obj, name);
+ return obj;
+}
+
+
+/**
+ * Delete an array object.
+ *
+ * This function is intended to be called via
+ * \c dd_function_table::DeleteArrayObject.
+ */
+void
+_mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj )
+{
+ (void) ctx;
+ unbind_array_object_vbos(ctx, obj);
+ _glthread_DESTROY_MUTEX(obj->Mutex);
+ free(obj);
+}
+
+
+/**
+ * Set ptr to arrayObj w/ reference counting.
+ */
+void
+_mesa_reference_array_object(struct gl_context *ctx,
+ struct gl_array_object **ptr,
+ struct gl_array_object *arrayObj)
+{
+ if (*ptr == arrayObj)
+ return;
+
+ if (*ptr) {
+ /* Unreference the old array object */
+ GLboolean deleteFlag = GL_FALSE;
+ struct gl_array_object *oldObj = *ptr;
+
+ _glthread_LOCK_MUTEX(oldObj->Mutex);
+ ASSERT(oldObj->RefCount > 0);
+ oldObj->RefCount--;
+#if 0
+ printf("ArrayObj %p %d DECR to %d\n",
+ (void *) oldObj, oldObj->Name, oldObj->RefCount);
+#endif
+ deleteFlag = (oldObj->RefCount == 0);
+ _glthread_UNLOCK_MUTEX(oldObj->Mutex);
+
+ if (deleteFlag) {
+ ASSERT(ctx->Driver.DeleteArrayObject);
+ ctx->Driver.DeleteArrayObject(ctx, oldObj);
+ }
+
+ *ptr = NULL;
+ }
+ ASSERT(!*ptr);
+
+ if (arrayObj) {
+ /* reference new array object */
+ _glthread_LOCK_MUTEX(arrayObj->Mutex);
+ if (arrayObj->RefCount == 0) {
+ /* this array's being deleted (look just above) */
+ /* Not sure this can every really happen. Warn if it does. */
+ _mesa_problem(NULL, "referencing deleted array object");
+ *ptr = NULL;
+ }
+ else {
+ arrayObj->RefCount++;
+#if 0
+ printf("ArrayObj %p %d INCR to %d\n",
+ (void *) arrayObj, arrayObj->Name, arrayObj->RefCount);
+#endif
+ *ptr = arrayObj;
+ }
+ _glthread_UNLOCK_MUTEX(arrayObj->Mutex);
+ }
+}
+
+
+
+static void
+init_array(struct gl_context *ctx,
+ struct gl_client_array *array, GLint size, GLint type)
+{
+ array->Size = size;
+ array->Type = type;
+ array->Format = GL_RGBA; /* only significant for GL_EXT_vertex_array_bgra */
+ array->Stride = 0;
+ array->StrideB = 0;
+ array->Ptr = NULL;
+ array->Enabled = GL_FALSE;
+ array->Normalized = GL_FALSE;
+ array->_ElementSize = size * _mesa_sizeof_type(type);
+#if FEATURE_ARB_vertex_buffer_object
+ /* Vertex array buffers */
+ _mesa_reference_buffer_object(ctx, &array->BufferObj,
+ ctx->Shared->NullBufferObj);
+#endif
+}
+
+
+/**
+ * Initialize a gl_array_object's arrays.
+ */
+void
+_mesa_initialize_array_object( struct gl_context *ctx,
+ struct gl_array_object *obj,
+ GLuint name )
+{
+ GLuint i;
+
+ obj->Name = name;
+
+ _glthread_INIT_MUTEX(obj->Mutex);
+ obj->RefCount = 1;
+
+ /* Init the individual arrays */
+ init_array(ctx, &obj->Vertex, 4, GL_FLOAT);
+ init_array(ctx, &obj->Weight, 1, GL_FLOAT);
+ init_array(ctx, &obj->Normal, 3, GL_FLOAT);
+ init_array(ctx, &obj->Color, 4, GL_FLOAT);
+ init_array(ctx, &obj->SecondaryColor, 3, GL_FLOAT);
+ init_array(ctx, &obj->FogCoord, 1, GL_FLOAT);
+ init_array(ctx, &obj->Index, 1, GL_FLOAT);
+ for (i = 0; i < Elements(obj->TexCoord); i++) {
+ init_array(ctx, &obj->TexCoord[i], 4, GL_FLOAT);
+ }
+ init_array(ctx, &obj->EdgeFlag, 1, GL_BOOL);
+ for (i = 0; i < Elements(obj->VertexAttrib); i++) {
+ init_array(ctx, &obj->VertexAttrib[i], 4, GL_FLOAT);
+ }
+
+#if FEATURE_point_size_array
+ init_array(ctx, &obj->PointSize, 1, GL_FLOAT);
+#endif
+}
+
+
+/**
+ * Add the given array object to the array object pool.
+ */
+static void
+save_array_object( struct gl_context *ctx, struct gl_array_object *obj )
+{
+ if (obj->Name > 0) {
+ /* insert into hash table */
+ _mesa_HashInsert(ctx->Array.Objects, obj->Name, obj);
+ }
+}
+
+
+/**
+ * Remove the given array object from the array object pool.
+ * Do not deallocate the array object though.
+ */
+static void
+remove_array_object( struct gl_context *ctx, struct gl_array_object *obj )
+{
+ if (obj->Name > 0) {
+ /* remove from hash table */
+ _mesa_HashRemove(ctx->Array.Objects, obj->Name);
+ }
+}
+
+
+
+/**
+ * Helper for update_arrays().
+ * \return min(current min, array->_MaxElement).
+ */
+static GLuint
+update_min(GLuint min, struct gl_client_array *array)
+{
+ if (array->Enabled) {
+ _mesa_update_array_max_element(array);
+ return MIN2(min, array->_MaxElement);
+ }
+ else
+ return min;
+}
+
+
+/**
+ * Examine vertex arrays to update the gl_array_object::_MaxElement field.
+ */
+void
+_mesa_update_array_object_max_element(struct gl_context *ctx,
+ struct gl_array_object *arrayObj)
+{
+ GLuint i, min = ~0;
+
+ min = update_min(min, &arrayObj->Vertex);
+ min = update_min(min, &arrayObj->Weight);
+ min = update_min(min, &arrayObj->Normal);
+ min = update_min(min, &arrayObj->Color);
+ min = update_min(min, &arrayObj->SecondaryColor);
+ min = update_min(min, &arrayObj->FogCoord);
+ min = update_min(min, &arrayObj->Index);
+ min = update_min(min, &arrayObj->EdgeFlag);
+#if FEATURE_point_size_array
+ min = update_min(min, &arrayObj->PointSize);
+#endif
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
+ min = update_min(min, &arrayObj->TexCoord[i]);
+ for (i = 0; i < Elements(arrayObj->VertexAttrib); i++)
+ min = update_min(min, &arrayObj->VertexAttrib[i]);
+
+ /* _MaxElement is one past the last legal array element */
+ arrayObj->_MaxElement = min;
+}
+
+
+/**********************************************************************/
+/* API Functions */
+/**********************************************************************/
+
+
+/**
+ * Helper for _mesa_BindVertexArray() and _mesa_BindVertexArrayAPPLE().
+ * \param genRequired specifies behavour when id was not generated with
+ * glGenVertexArrays().
+ */
+static void
+bind_vertex_array(struct gl_context *ctx, GLuint id, GLboolean genRequired)
+{
+ struct gl_array_object * const oldObj = ctx->Array.ArrayObj;
+ struct gl_array_object *newObj = NULL;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ ASSERT(oldObj != NULL);
+
+ if ( oldObj->Name == id )
+ return; /* rebinding the same array object- no change */
+
+ /*
+ * Get pointer to new array object (newObj)
+ */
+ if (id == 0) {
+ /* The spec says there is no array object named 0, but we use
+ * one internally because it simplifies things.
+ */
+ newObj = ctx->Array.DefaultArrayObj;
+ }
+ else {
+ /* non-default array object */
+ newObj = lookup_arrayobj(ctx, id);
+ if (!newObj) {
+ if (genRequired) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindVertexArray(id)");
+ return;
+ }
+
+ /* For APPLE version, generate a new array object now */
+ newObj = (*ctx->Driver.NewArrayObject)(ctx, id);
+ if (!newObj) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE");
+ return;
+ }
+ save_array_object(ctx, newObj);
+ }
+ }
+
+ ctx->NewState |= _NEW_ARRAY;
+ ctx->Array.NewState |= _NEW_ARRAY_ALL;
+ _mesa_reference_array_object(ctx, &ctx->Array.ArrayObj, newObj);
+
+ /* Pass BindVertexArray call to device driver */
+ if (ctx->Driver.BindArrayObject && newObj)
+ ctx->Driver.BindArrayObject(ctx, newObj);
+}
+
+
+/**
+ * ARB version of glBindVertexArray()
+ * This function behaves differently from glBindVertexArrayAPPLE() in
+ * that this function requires all ids to have been previously generated
+ * by glGenVertexArrays[APPLE]().
+ */
+void GLAPIENTRY
+_mesa_BindVertexArray( GLuint id )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ bind_vertex_array(ctx, id, GL_TRUE);
+}
+
+
+/**
+ * Bind a new array.
+ *
+ * \todo
+ * The binding could be done more efficiently by comparing the non-NULL
+ * pointers in the old and new objects. The only arrays that are "dirty" are
+ * the ones that are non-NULL in either object.
+ */
+void GLAPIENTRY
+_mesa_BindVertexArrayAPPLE( GLuint id )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ bind_vertex_array(ctx, id, GL_FALSE);
+}
+
+
+/**
+ * Delete a set of array objects.
+ *
+ * \param n Number of array objects to delete.
+ * \param ids Array of \c n array object IDs.
+ */
+void GLAPIENTRY
+_mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ GLsizei i;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteVertexArrayAPPLE(n)");
+ return;
+ }
+
+ for (i = 0; i < n; i++) {
+ struct gl_array_object *obj = lookup_arrayobj(ctx, ids[i]);
+
+ if ( obj != NULL ) {
+ ASSERT( obj->Name == ids[i] );
+
+ /* If the array object is currently bound, the spec says "the binding
+ * for that object reverts to zero and the default vertex array
+ * becomes current."
+ */
+ if ( obj == ctx->Array.ArrayObj ) {
+ CALL_BindVertexArrayAPPLE( ctx->Exec, (0) );
+ }
+
+ /* The ID is immediately freed for re-use */
+ remove_array_object(ctx, obj);
+
+ /* Unreference the array object.
+ * If refcount hits zero, the object will be deleted.
+ */
+ _mesa_reference_array_object(ctx, &obj, NULL);
+ }
+ }
+}
+
+
+/**
+ * Generate a set of unique array object IDs and store them in \c arrays.
+ * Helper for _mesa_GenVertexArrays[APPLE]() functions below.
+ * \param n Number of IDs to generate.
+ * \param arrays Array of \c n locations to store the IDs.
+ * \param vboOnly Will arrays have to reside in VBOs?
+ */
+static void
+gen_vertex_arrays(struct gl_context *ctx, GLsizei n, GLuint *arrays,
+ GLboolean vboOnly)
+{
+ GLuint first;
+ GLint i;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGenVertexArraysAPPLE");
+ return;
+ }
+
+ if (!arrays) {
+ return;
+ }
+
+ first = _mesa_HashFindFreeKeyBlock(ctx->Array.Objects, n);
+
+ /* Allocate new, empty array objects and return identifiers */
+ for (i = 0; i < n; i++) {
+ struct gl_array_object *obj;
+ GLuint name = first + i;
+
+ obj = (*ctx->Driver.NewArrayObject)( ctx, name );
+ if (!obj) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenVertexArraysAPPLE");
+ return;
+ }
+ obj->VBOonly = vboOnly;
+ save_array_object(ctx, obj);
+ arrays[i] = first + i;
+ }
+}
+
+
+/**
+ * ARB version of glGenVertexArrays()
+ * All arrays will be required to live in VBOs.
+ */
+void GLAPIENTRY
+_mesa_GenVertexArrays(GLsizei n, GLuint *arrays)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ gen_vertex_arrays(ctx, n, arrays, GL_TRUE);
+}
+
+
+/**
+ * APPLE version of glGenVertexArraysAPPLE()
+ * Arrays may live in VBOs or ordinary memory.
+ */
+void GLAPIENTRY
+_mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *arrays)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ gen_vertex_arrays(ctx, n, arrays, GL_FALSE);
+}
+
+
+/**
+ * Determine if ID is the name of an array object.
+ *
+ * \param id ID of the potential array object.
+ * \return \c GL_TRUE if \c id is the name of a array object,
+ * \c GL_FALSE otherwise.
+ */
+GLboolean GLAPIENTRY
+_mesa_IsVertexArrayAPPLE( GLuint id )
+{
+ struct gl_array_object * obj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+
+ if (id == 0)
+ return GL_FALSE;
+
+ obj = lookup_arrayobj(ctx, id);
+
+ return (obj != NULL) ? GL_TRUE : GL_FALSE;
+}
diff --git a/mesalib/src/mesa/main/atifragshader.h b/mesalib/src/mesa/main/atifragshader.h
index 838d327c0..90ada212a 100644
--- a/mesalib/src/mesa/main/atifragshader.h
+++ b/mesalib/src/mesa/main/atifragshader.h
@@ -1,154 +1,154 @@
-/*
- * Mesa 3-D graphics library ATI Fragment Shader
- *
- * Copyright (C) 2004 David Airlie All Rights Reserved.
- *
- */
-
-#ifndef ATIFRAGSHADER_H
-#define ATIFRAGSHADER_H
-
-#include "compiler.h"
-#include "glheader.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-struct gl_context;
-
-#define MAX_NUM_INSTRUCTIONS_PER_PASS_ATI 8
-#define MAX_NUM_PASSES_ATI 2
-#define MAX_NUM_FRAGMENT_REGISTERS_ATI 6
-
-struct ati_fs_opcode_st
-{
- GLenum opcode;
- GLint num_src_args;
-};
-
-extern struct ati_fs_opcode_st ati_fs_opcodes[];
-
-struct atifragshader_src_register
-{
- GLuint Index;
- GLuint argRep;
- GLuint argMod;
-};
-
-struct atifragshader_dst_register
-{
- GLuint Index;
- GLuint dstMod;
- GLuint dstMask;
-};
-
-#define ATI_FRAGMENT_SHADER_COLOR_OP 0
-#define ATI_FRAGMENT_SHADER_ALPHA_OP 1
-#define ATI_FRAGMENT_SHADER_PASS_OP 2
-#define ATI_FRAGMENT_SHADER_SAMPLE_OP 3
-
-/* two opcodes - one for color/one for alpha */
-/* up to three source registers for most ops */
-struct atifs_instruction
-{
- GLenum Opcode[2];
- GLuint ArgCount[2];
- struct atifragshader_src_register SrcReg[2][3];
- struct atifragshader_dst_register DstReg[2];
-};
-
-/* different from arithmetic shader instruction */
-struct atifs_setupinst
-{
- GLenum Opcode;
- GLuint src;
- GLenum swizzle;
-};
-
-
-#if FEATURE_ATI_fragment_shader
-
-extern void
-_mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp);
-
-extern struct ati_fragment_shader *
-_mesa_new_ati_fragment_shader(struct gl_context *ctx, GLuint id);
-
-extern void
-_mesa_delete_ati_fragment_shader(struct gl_context *ctx,
- struct ati_fragment_shader *s);
-
-
-extern GLuint GLAPIENTRY _mesa_GenFragmentShadersATI(GLuint range);
-
-extern void GLAPIENTRY _mesa_BindFragmentShaderATI(GLuint id);
-
-extern void GLAPIENTRY _mesa_DeleteFragmentShaderATI(GLuint id);
-
-extern void GLAPIENTRY _mesa_BeginFragmentShaderATI(void);
-
-extern void GLAPIENTRY _mesa_EndFragmentShaderATI(void);
-
-extern void GLAPIENTRY
-_mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle);
-
-extern void GLAPIENTRY
-_mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle);
-
-extern void GLAPIENTRY
-_mesa_ColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask,
- GLuint dstMod, GLuint arg1, GLuint arg1Rep,
- GLuint arg1Mod);
-
-extern void GLAPIENTRY
-_mesa_ColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask,
- GLuint dstMod, GLuint arg1, GLuint arg1Rep,
- GLuint arg1Mod, GLuint arg2, GLuint arg2Rep,
- GLuint arg2Mod);
-
-extern void GLAPIENTRY
-_mesa_ColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask,
- GLuint dstMod, GLuint arg1, GLuint arg1Rep,
- GLuint arg1Mod, GLuint arg2, GLuint arg2Rep,
- GLuint arg2Mod, GLuint arg3, GLuint arg3Rep,
- GLuint arg3Mod);
-
-extern void GLAPIENTRY
-_mesa_AlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
- GLuint arg1Rep, GLuint arg1Mod);
-
-extern void GLAPIENTRY
-_mesa_AlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
- GLuint arg1Rep, GLuint arg1Mod, GLuint arg2,
- GLuint arg2Rep, GLuint arg2Mod);
-
-extern void GLAPIENTRY
-_mesa_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
- GLuint arg1Rep, GLuint arg1Mod, GLuint arg2,
- GLuint arg2Rep, GLuint arg2Mod, GLuint arg3,
- GLuint arg3Rep, GLuint arg3Mod);
-
-extern void GLAPIENTRY
-_mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value);
-
-#else /* FEATURE_ATI_fragment_shader */
-
-static INLINE void
-_mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp)
-{
-}
-
-static INLINE struct ati_fragment_shader *
-_mesa_new_ati_fragment_shader(struct gl_context *ctx, GLuint id)
-{
- return NULL;
-}
-
-static INLINE void
-_mesa_delete_ati_fragment_shader(struct gl_context *ctx,
- struct ati_fragment_shader *s)
-{
-}
-
-#endif /* FEATURE_ATI_fragment_shader */
-
-#endif /* ATIFRAGSHADER_H */
+/*
+ * Mesa 3-D graphics library ATI Fragment Shader
+ *
+ * Copyright (C) 2004 David Airlie All Rights Reserved.
+ *
+ */
+
+#ifndef ATIFRAGSHADER_H
+#define ATIFRAGSHADER_H
+
+#include "compiler.h"
+#include "glheader.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+struct gl_context;
+
+#define MAX_NUM_INSTRUCTIONS_PER_PASS_ATI 8
+#define MAX_NUM_PASSES_ATI 2
+#define MAX_NUM_FRAGMENT_REGISTERS_ATI 6
+
+struct ati_fs_opcode_st
+{
+ GLenum opcode;
+ GLint num_src_args;
+};
+
+extern struct ati_fs_opcode_st ati_fs_opcodes[];
+
+struct atifragshader_src_register
+{
+ GLuint Index;
+ GLuint argRep;
+ GLuint argMod;
+};
+
+struct atifragshader_dst_register
+{
+ GLuint Index;
+ GLuint dstMod;
+ GLuint dstMask;
+};
+
+#define ATI_FRAGMENT_SHADER_COLOR_OP 0
+#define ATI_FRAGMENT_SHADER_ALPHA_OP 1
+#define ATI_FRAGMENT_SHADER_PASS_OP 2
+#define ATI_FRAGMENT_SHADER_SAMPLE_OP 3
+
+/* two opcodes - one for color/one for alpha */
+/* up to three source registers for most ops */
+struct atifs_instruction
+{
+ GLenum Opcode[2];
+ GLuint ArgCount[2];
+ struct atifragshader_src_register SrcReg[2][3];
+ struct atifragshader_dst_register DstReg[2];
+};
+
+/* different from arithmetic shader instruction */
+struct atifs_setupinst
+{
+ GLenum Opcode;
+ GLuint src;
+ GLenum swizzle;
+};
+
+
+#if FEATURE_ATI_fragment_shader
+
+extern void
+_mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp);
+
+extern struct ati_fragment_shader *
+_mesa_new_ati_fragment_shader(struct gl_context *ctx, GLuint id);
+
+extern void
+_mesa_delete_ati_fragment_shader(struct gl_context *ctx,
+ struct ati_fragment_shader *s);
+
+
+extern GLuint GLAPIENTRY _mesa_GenFragmentShadersATI(GLuint range);
+
+extern void GLAPIENTRY _mesa_BindFragmentShaderATI(GLuint id);
+
+extern void GLAPIENTRY _mesa_DeleteFragmentShaderATI(GLuint id);
+
+extern void GLAPIENTRY _mesa_BeginFragmentShaderATI(void);
+
+extern void GLAPIENTRY _mesa_EndFragmentShaderATI(void);
+
+extern void GLAPIENTRY
+_mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle);
+
+extern void GLAPIENTRY
+_mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle);
+
+extern void GLAPIENTRY
+_mesa_ColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask,
+ GLuint dstMod, GLuint arg1, GLuint arg1Rep,
+ GLuint arg1Mod);
+
+extern void GLAPIENTRY
+_mesa_ColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask,
+ GLuint dstMod, GLuint arg1, GLuint arg1Rep,
+ GLuint arg1Mod, GLuint arg2, GLuint arg2Rep,
+ GLuint arg2Mod);
+
+extern void GLAPIENTRY
+_mesa_ColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask,
+ GLuint dstMod, GLuint arg1, GLuint arg1Rep,
+ GLuint arg1Mod, GLuint arg2, GLuint arg2Rep,
+ GLuint arg2Mod, GLuint arg3, GLuint arg3Rep,
+ GLuint arg3Mod);
+
+extern void GLAPIENTRY
+_mesa_AlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
+ GLuint arg1Rep, GLuint arg1Mod);
+
+extern void GLAPIENTRY
+_mesa_AlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
+ GLuint arg1Rep, GLuint arg1Mod, GLuint arg2,
+ GLuint arg2Rep, GLuint arg2Mod);
+
+extern void GLAPIENTRY
+_mesa_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1,
+ GLuint arg1Rep, GLuint arg1Mod, GLuint arg2,
+ GLuint arg2Rep, GLuint arg2Mod, GLuint arg3,
+ GLuint arg3Rep, GLuint arg3Mod);
+
+extern void GLAPIENTRY
+_mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value);
+
+#else /* FEATURE_ATI_fragment_shader */
+
+static inline void
+_mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp)
+{
+}
+
+static inline struct ati_fragment_shader *
+_mesa_new_ati_fragment_shader(struct gl_context *ctx, GLuint id)
+{
+ return NULL;
+}
+
+static inline void
+_mesa_delete_ati_fragment_shader(struct gl_context *ctx,
+ struct ati_fragment_shader *s)
+{
+}
+
+#endif /* FEATURE_ATI_fragment_shader */
+
+#endif /* ATIFRAGSHADER_H */
diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c
index 6f427e008..e67957d4d 100644
--- a/mesalib/src/mesa/main/attrib.c
+++ b/mesalib/src/mesa/main/attrib.c
@@ -497,7 +497,7 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable)
const GLuint mask = 1 << i;
if ((ctx->Transform.ClipPlanesEnabled & mask) != (enable->ClipPlanes & mask))
_mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i),
- (GLboolean) ((enable->ClipPlanes & mask) ? GL_TRUE : GL_FALSE));
+ !!(enable->ClipPlanes & mask));
}
TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
@@ -620,38 +620,31 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable)
if (ctx->Texture.Unit[i].Enabled != enabled) {
_mesa_ActiveTextureARB(GL_TEXTURE0 + i);
- _mesa_set_enable(ctx, GL_TEXTURE_1D,
- (enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_2D,
- (enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_3D,
- (enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_1D, !!(enabled & TEXTURE_1D_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_2D, !!(enabled & TEXTURE_2D_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_3D, !!(enabled & TEXTURE_3D_BIT));
if (ctx->Extensions.NV_texture_rectangle) {
_mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_ARB,
- (enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE);
+ !!(enabled & TEXTURE_RECT_BIT));
}
if (ctx->Extensions.ARB_texture_cube_map) {
_mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP,
- (enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE);
+ !!(enabled & TEXTURE_CUBE_BIT));
}
if (ctx->Extensions.MESA_texture_array) {
_mesa_set_enable(ctx, GL_TEXTURE_1D_ARRAY_EXT,
- (enabled & TEXTURE_1D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
+ !!(enabled & TEXTURE_1D_ARRAY_BIT));
_mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT,
- (enabled & TEXTURE_2D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
+ !!(enabled & TEXTURE_2D_ARRAY_BIT));
}
}
if (ctx->Texture.Unit[i].TexGenEnabled != genEnabled) {
_mesa_ActiveTextureARB(GL_TEXTURE0 + i);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_S,
- (genEnabled & S_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_T,
- (genEnabled & T_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_R,
- (genEnabled & R_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q,
- (genEnabled & Q_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, !!(genEnabled & S_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_T, !!(genEnabled & T_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_R, !!(genEnabled & R_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, !!(genEnabled & Q_BIT));
}
}
@@ -674,25 +667,22 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
GLuint tgt;
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB + u);
- _mesa_set_enable(ctx, GL_TEXTURE_1D,
- (unit->Enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_2D,
- (unit->Enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE);
- _mesa_set_enable(ctx, GL_TEXTURE_3D,
- (unit->Enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE);
+ _mesa_set_enable(ctx, GL_TEXTURE_1D, !!(unit->Enabled & TEXTURE_1D_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_2D, !!(unit->Enabled & TEXTURE_2D_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_3D, !!(unit->Enabled & TEXTURE_3D_BIT));
if (ctx->Extensions.ARB_texture_cube_map) {
_mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP_ARB,
- (unit->Enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE);
+ !!(unit->Enabled & TEXTURE_CUBE_BIT));
}
if (ctx->Extensions.NV_texture_rectangle) {
_mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_NV,
- (unit->Enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE);
+ !!(unit->Enabled & TEXTURE_RECT_BIT));
}
if (ctx->Extensions.MESA_texture_array) {
_mesa_set_enable(ctx, GL_TEXTURE_1D_ARRAY_EXT,
- (unit->Enabled & TEXTURE_1D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
+ !!(unit->Enabled & TEXTURE_1D_ARRAY_BIT));
_mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT,
- (unit->Enabled & TEXTURE_2D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
+ !!(unit->Enabled & TEXTURE_2D_ARRAY_BIT));
}
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode);
@@ -719,44 +709,30 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
ctx->Driver.TexGen(ctx, GL_Q, GL_EYE_PLANE, unit->GenQ.EyePlane);
}
}
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_S,
- ((unit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE));
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_T,
- ((unit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE));
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_R,
- ((unit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE));
- _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q,
- ((unit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, !!(unit->TexGenEnabled & S_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_T, !!(unit->TexGenEnabled & T_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_R, !!(unit->TexGenEnabled & R_BIT));
+ _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, !!(unit->TexGenEnabled & Q_BIT));
_mesa_TexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS,
unit->LodBias);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB,
unit->Combine.ModeRGB);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA,
unit->Combine.ModeA);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB,
- unit->Combine.SourceRGB[0]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB,
- unit->Combine.SourceRGB[1]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB,
- unit->Combine.SourceRGB[2]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA,
- unit->Combine.SourceA[0]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA,
- unit->Combine.SourceA[1]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA,
- unit->Combine.SourceA[2]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB,
- unit->Combine.OperandRGB[0]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB,
- unit->Combine.OperandRGB[1]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB,
- unit->Combine.OperandRGB[2]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA,
- unit->Combine.OperandA[0]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA,
- unit->Combine.OperandA[1]);
- _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA,
- unit->Combine.OperandA[2]);
+ {
+ const GLuint n = ctx->Extensions.NV_texture_env_combine4 ? 4 : 3;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB + i,
+ unit->Combine.SourceRGB[i]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA + i,
+ unit->Combine.SourceA[i]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB + i,
+ unit->Combine.OperandRGB[i]);
+ _mesa_TexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA + i,
+ unit->Combine.OperandA[i]);
+ }
+ }
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE,
1 << unit->Combine.ScaleShiftRGB);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE,
@@ -1246,12 +1222,8 @@ _mesa_PopAttrib(void)
const GLuint mask = 1 << i;
const GLfloat *eyePlane = xform->EyeUserPlane[i];
COPY_4V(ctx->Transform.EyeUserPlane[i], eyePlane);
- if (xform->ClipPlanesEnabled & mask) {
- _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_TRUE);
- }
- else {
- _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_FALSE);
- }
+ _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i,
+ !!(xform->ClipPlanesEnabled & mask));
if (ctx->Driver.ClipPlane)
ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, eyePlane );
}
diff --git a/mesalib/src/mesa/main/attrib.h b/mesalib/src/mesa/main/attrib.h
index 8e7969a65..6809311cf 100644
--- a/mesalib/src/mesa/main/attrib.h
+++ b/mesalib/src/mesa/main/attrib.h
@@ -1,80 +1,80 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-#ifndef ATTRIB_H
-#define ATTRIB_H
-
-
-#include "compiler.h"
-#include "glheader.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-struct gl_context;
-
-#if FEATURE_attrib_stack
-
-extern void GLAPIENTRY
-_mesa_PushAttrib( GLbitfield mask );
-
-extern void GLAPIENTRY
-_mesa_PopAttrib( void );
-
-extern void GLAPIENTRY
-_mesa_PushClientAttrib( GLbitfield mask );
-
-extern void GLAPIENTRY
-_mesa_PopClientAttrib( void );
-
-extern void
-_mesa_init_attrib_dispatch(struct _glapi_table *disp);
-
-#else /* FEATURE_attrib_stack */
-
-static INLINE void
-_mesa_PushClientAttrib( GLbitfield mask )
-{
- ASSERT_NO_FEATURE();
-}
-
-static INLINE void
-_mesa_PopClientAttrib( void )
-{
- ASSERT_NO_FEATURE();
-}
-
-static INLINE void
-_mesa_init_attrib_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_attrib_stack */
-
-extern void
-_mesa_init_attrib( struct gl_context *ctx );
-
-extern void
-_mesa_free_attrib_data( struct gl_context *ctx );
-
-#endif /* ATTRIB_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+#ifndef ATTRIB_H
+#define ATTRIB_H
+
+
+#include "compiler.h"
+#include "glheader.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+struct gl_context;
+
+#if FEATURE_attrib_stack
+
+extern void GLAPIENTRY
+_mesa_PushAttrib( GLbitfield mask );
+
+extern void GLAPIENTRY
+_mesa_PopAttrib( void );
+
+extern void GLAPIENTRY
+_mesa_PushClientAttrib( GLbitfield mask );
+
+extern void GLAPIENTRY
+_mesa_PopClientAttrib( void );
+
+extern void
+_mesa_init_attrib_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_attrib_stack */
+
+static inline void
+_mesa_PushClientAttrib( GLbitfield mask )
+{
+ ASSERT_NO_FEATURE();
+}
+
+static inline void
+_mesa_PopClientAttrib( void )
+{
+ ASSERT_NO_FEATURE();
+}
+
+static inline void
+_mesa_init_attrib_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_attrib_stack */
+
+extern void
+_mesa_init_attrib( struct gl_context *ctx );
+
+extern void
+_mesa_free_attrib_data( struct gl_context *ctx );
+
+#endif /* ATTRIB_H */
diff --git a/mesalib/src/mesa/main/bitset.h b/mesalib/src/mesa/main/bitset.h
index 9f48b3cce..7a0704b14 100644
--- a/mesalib/src/mesa/main/bitset.h
+++ b/mesalib/src/mesa/main/bitset.h
@@ -81,7 +81,7 @@
/* Get first bit set in a bitset.
*/
-static INLINE int
+static inline int
__bitset_ffs(const BITSET_WORD *x, int n)
{
int i;
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index 45e72045a..67241eb1e 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -70,7 +70,7 @@ static struct gl_buffer_object DummyBufferObject;
* \return pointer to pointer to the buffer object bound to \c target in the
* specified context or \c NULL if \c target is invalid.
*/
-static INLINE struct gl_buffer_object **
+static inline struct gl_buffer_object **
get_buffer_target(struct gl_context *ctx, GLenum target)
{
switch (target) {
@@ -112,7 +112,7 @@ get_buffer_target(struct gl_context *ctx, GLenum target)
* \return pointer to the buffer object bound to \c target in the
* specified context or \c NULL if \c target is invalid.
*/
-static INLINE struct gl_buffer_object *
+static inline struct gl_buffer_object *
get_buffer(struct gl_context *ctx, GLenum target)
{
struct gl_buffer_object **bufObj = get_buffer_target(ctx, target);
diff --git a/mesalib/src/mesa/main/bufferobj.h b/mesalib/src/mesa/main/bufferobj.h
index f82e41411..b4e70f2f0 100644
--- a/mesalib/src/mesa/main/bufferobj.h
+++ b/mesalib/src/mesa/main/bufferobj.h
@@ -39,7 +39,7 @@
/** Is the given buffer object currently mapped? */
-static INLINE GLboolean
+static inline GLboolean
_mesa_bufferobj_mapped(const struct gl_buffer_object *obj)
{
return obj->Pointer != NULL;
@@ -50,7 +50,7 @@ _mesa_bufferobj_mapped(const struct gl_buffer_object *obj)
* Mesa uses default buffer objects in several places. Default buffers
* always have Name==0. User created buffers have Name!=0.
*/
-static INLINE GLboolean
+static inline GLboolean
_mesa_is_bufferobj(const struct gl_buffer_object *obj)
{
return obj->Name != 0;
@@ -79,7 +79,7 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
struct gl_buffer_object **ptr,
struct gl_buffer_object *bufObj);
-static INLINE void
+static inline void
_mesa_reference_buffer_object(struct gl_context *ctx,
struct gl_buffer_object **ptr,
struct gl_buffer_object *bufObj)
diff --git a/mesalib/src/mesa/main/clear.c b/mesalib/src/mesa/main/clear.c
index 301fe694c..c35675fb4 100644
--- a/mesalib/src/mesa/main/clear.c
+++ b/mesalib/src/mesa/main/clear.c
@@ -200,6 +200,9 @@ _mesa_Clear( GLbitfield mask )
ctx->DrawBuffer->_Ymin >= ctx->DrawBuffer->_Ymax)
return;
+ if (ctx->TransformFeedback.RasterDiscard)
+ return;
+
if (ctx->RenderMode == GL_RENDER) {
GLbitfield bufferMask;
@@ -328,7 +331,7 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
drawbuffer);
return;
}
- else {
+ else if (!ctx->TransformFeedback.RasterDiscard) {
/* Save current stencil clear value, set to 'value', do the
* stencil clear and restore the clear value.
* XXX in the future we may have a new ctx->Driver.ClearBuffer()
@@ -352,7 +355,7 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
drawbuffer);
return;
}
- else if (mask) {
+ else if (mask && !ctx->TransformFeedback.RasterDiscard) {
union gl_color_union clearSave;
/* save color */
@@ -403,7 +406,7 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
drawbuffer);
return;
}
- else if (mask) {
+ else if (mask && !ctx->TransformFeedback.RasterDiscard) {
union gl_color_union clearSave;
/* save color */
@@ -452,7 +455,7 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
drawbuffer);
return;
}
- else {
+ else if (!ctx->TransformFeedback.RasterDiscard) {
/* Save current depth clear value, set to 'value', do the
* depth clear and restore the clear value.
* XXX in the future we may have a new ctx->Driver.ClearBuffer()
@@ -477,7 +480,7 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
drawbuffer);
return;
}
- else if (mask) {
+ else if (mask && !ctx->TransformFeedback.RasterDiscard) {
union gl_color_union clearSave;
/* save color */
@@ -528,6 +531,9 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
return;
}
+ if (ctx->TransformFeedback.RasterDiscard)
+ return;
+
if (ctx->NewState) {
_mesa_update_state( ctx );
}
diff --git a/mesalib/src/mesa/main/colortab.h b/mesalib/src/mesa/main/colortab.h
index b0d2b5db8..4e225ffc9 100644
--- a/mesalib/src/mesa/main/colortab.h
+++ b/mesalib/src/mesa/main/colortab.h
@@ -50,7 +50,7 @@ _mesa_init_colortable_dispatch(struct _glapi_table *disp);
#else /* FEATURE_colortable */
-static INLINE void GLAPIENTRY
+static inline void GLAPIENTRY
_mesa_ColorTable( GLenum target, GLenum internalformat,
GLsizei width, GLenum format, GLenum type,
const GLvoid *table )
@@ -58,7 +58,7 @@ _mesa_ColorTable( GLenum target, GLenum internalformat,
ASSERT_NO_FEATURE();
}
-static INLINE void GLAPIENTRY
+static inline void GLAPIENTRY
_mesa_ColorSubTable( GLenum target, GLsizei start,
GLsizei count, GLenum format, GLenum type,
const GLvoid *table )
@@ -66,7 +66,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
ASSERT_NO_FEATURE();
}
-static INLINE void
+static inline void
_mesa_init_colortable_dispatch(struct _glapi_table *disp)
{
}
diff --git a/mesalib/src/mesa/main/convolve.h b/mesalib/src/mesa/main/convolve.h
index 7ecfcd6b1..952285643 100644
--- a/mesalib/src/mesa/main/convolve.h
+++ b/mesalib/src/mesa/main/convolve.h
@@ -1,51 +1,51 @@
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef CONVOLVE_H
-#define CONVOLVE_H
-
-
-#include "compiler.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-
-
-#if FEATURE_convolve
-
-extern void
-_mesa_init_convolve_dispatch(struct _glapi_table *disp);
-
-#else /* FEATURE_convolve */
-
-static INLINE void
-_mesa_init_convolve_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_convolve */
-
-#endif /* CONVOLVE_H */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef CONVOLVE_H
+#define CONVOLVE_H
+
+
+#include "compiler.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+
+
+#if FEATURE_convolve
+
+extern void
+_mesa_init_convolve_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_convolve */
+
+static inline void
+_mesa_init_convolve_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_convolve */
+
+#endif /* CONVOLVE_H */
diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h
index 720e4f53d..787556451 100644
--- a/mesalib/src/mesa/main/dd.h
+++ b/mesalib/src/mesa/main/dd.h
@@ -284,9 +284,8 @@ struct dd_function_table {
/**
* Called by glGetTexImage().
*/
- void (*GetTexImage)( struct gl_context *ctx, GLenum target, GLint level,
+ void (*GetTexImage)( struct gl_context *ctx,
GLenum format, GLenum type, GLvoid *pixels,
- struct gl_texture_object *texObj,
struct gl_texture_image *texImage );
/**
@@ -815,25 +814,6 @@ struct dd_function_table {
/*@{*/
/**
- * Bitmask of state changes that require the current T&L module to be
- * validated, using ValidateTnlModule() below.
- */
- GLuint NeedValidate;
-
- /**
- * Validate the current T&L module.
- *
- * This is called directly after UpdateState() when a state change that has
- * occurred matches the dd_function_table::NeedValidate bitmask above. This
- * ensures all computed values are up to date, thus allowing the driver to
- * decide if the current T&L module needs to be swapped out.
- *
- * This must be non-NULL if a driver installs a custom T&L module and sets
- * the dd_function_table::NeedValidate bitmask, but may be NULL otherwise.
- */
- void (*ValidateTnlModule)( struct gl_context *ctx, GLuint new_state );
-
- /**
* Set by the driver-supplied T&L engine.
*
* Set to PRIM_OUTSIDE_BEGIN_END when outside glBegin()/glEnd().
diff --git a/mesalib/src/mesa/main/debug.c b/mesalib/src/mesa/main/debug.c
index 0a393e5fa..6e695d147 100644
--- a/mesalib/src/mesa/main/debug.c
+++ b/mesalib/src/mesa/main/debug.c
@@ -268,9 +268,7 @@ write_texture_image(struct gl_texture_object *texObj,
store = ctx->Pack; /* save */
ctx->Pack = ctx->DefaultPacking;
- ctx->Driver.GetTexImage(ctx, texObj->Target, level,
- GL_RGBA, GL_UNSIGNED_BYTE,
- buffer, texObj, img);
+ ctx->Driver.GetTexImage(ctx, GL_RGBA, GL_UNSIGNED_BYTE, buffer, img);
/* make filename */
_mesa_snprintf(s, sizeof(s), "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face);
diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c
index f11dae9d0..343feec6f 100644
--- a/mesalib/src/mesa/main/dlist.c
+++ b/mesalib/src/mesa/main/dlist.c
@@ -560,7 +560,7 @@ make_list(GLuint name, GLuint count)
/**
* Lookup function to just encapsulate casting.
*/
-static INLINE struct gl_display_list *
+static inline struct gl_display_list *
lookup_list(struct gl_context *ctx, GLuint list)
{
return (struct gl_display_list *)
@@ -569,7 +569,7 @@ lookup_list(struct gl_context *ctx, GLuint list)
/** Is the given opcode an extension code? */
-static INLINE GLboolean
+static inline GLboolean
is_ext_opcode(OpCode opcode)
{
return (opcode >= OPCODE_EXT_0);
@@ -1043,7 +1043,7 @@ _mesa_dlist_alloc_opcode(struct gl_context *ctx,
* \param nparams number of function parameters
* \return pointer to start of instruction space
*/
-static INLINE Node *
+static inline Node *
alloc_instruction(struct gl_context *ctx, OpCode opcode, GLuint nparams)
{
return dlist_alloc(ctx, opcode, nparams * sizeof(Node));
@@ -5672,7 +5672,7 @@ save_EdgeFlag(GLboolean x)
save_Attr1fNV(VERT_ATTRIB_EDGEFLAG, x ? (GLfloat)1.0 : (GLfloat)0.0);
}
-static INLINE GLboolean compare4fv( const GLfloat *a,
+static inline GLboolean compare4fv( const GLfloat *a,
const GLfloat *b,
GLuint count )
{
diff --git a/mesalib/src/mesa/main/dlist.h b/mesalib/src/mesa/main/dlist.h
index b954e06df..89008431a 100644
--- a/mesalib/src/mesa/main/dlist.h
+++ b/mesalib/src/mesa/main/dlist.h
@@ -1,104 +1,104 @@
-/**
- * \file dlist.h
- * Display lists management.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-
-#ifndef DLIST_H
-#define DLIST_H
-
-
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-
-
-#if FEATURE_dlist
-
-#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \
- do { \
- (vfmt)->CallList = impl ## CallList; \
- (vfmt)->CallLists = impl ## CallLists; \
- } while (0)
-
-extern void GLAPIENTRY _mesa_CallList( GLuint list );
-
-extern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists );
-
-
-extern void _mesa_compile_error( struct gl_context *ctx, GLenum error, const char *s );
-
-extern void *_mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint sz);
-
-extern GLint _mesa_dlist_alloc_opcode( struct gl_context *ctx, GLuint sz,
- void (*execute)( struct gl_context *, void * ),
- void (*destroy)( struct gl_context *, void * ),
- void (*print)( struct gl_context *, void * ) );
-
-extern void _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist);
-
-extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt );
-
-extern struct _glapi_table *_mesa_create_save_table(void);
-
-extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt);
-
-extern void _mesa_init_dlist_dispatch(struct _glapi_table *disp);
-
-#else /* FEATURE_dlist */
-
-#include "main/compiler.h"
-
-#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) do { } while (0)
-
-static INLINE void
-_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
-{
- /* there should be no list to delete */
- ASSERT_NO_FEATURE();
-}
-
-static INLINE void
-_mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt)
-{
-}
-
-static INLINE void
-_mesa_init_dlist_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_dlist */
-
-extern void _mesa_init_display_list( struct gl_context * ctx );
-
-extern void _mesa_free_display_list_data(struct gl_context *ctx);
-
-
-#endif /* DLIST_H */
+/**
+ * \file dlist.h
+ * Display lists management.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+
+#ifndef DLIST_H
+#define DLIST_H
+
+
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+
+
+#if FEATURE_dlist
+
+#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \
+ do { \
+ (vfmt)->CallList = impl ## CallList; \
+ (vfmt)->CallLists = impl ## CallLists; \
+ } while (0)
+
+extern void GLAPIENTRY _mesa_CallList( GLuint list );
+
+extern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists );
+
+
+extern void _mesa_compile_error( struct gl_context *ctx, GLenum error, const char *s );
+
+extern void *_mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint sz);
+
+extern GLint _mesa_dlist_alloc_opcode( struct gl_context *ctx, GLuint sz,
+ void (*execute)( struct gl_context *, void * ),
+ void (*destroy)( struct gl_context *, void * ),
+ void (*print)( struct gl_context *, void * ) );
+
+extern void _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist);
+
+extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt );
+
+extern struct _glapi_table *_mesa_create_save_table(void);
+
+extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt);
+
+extern void _mesa_init_dlist_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_dlist */
+
+#include "main/compiler.h"
+
+#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) do { } while (0)
+
+static inline void
+_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
+{
+ /* there should be no list to delete */
+ ASSERT_NO_FEATURE();
+}
+
+static inline void
+_mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt)
+{
+}
+
+static inline void
+_mesa_init_dlist_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_dlist */
+
+extern void _mesa_init_display_list( struct gl_context * ctx );
+
+extern void _mesa_free_display_list_data(struct gl_context *ctx);
+
+
+#endif /* DLIST_H */
diff --git a/mesalib/src/mesa/main/drawpix.c b/mesalib/src/mesa/main/drawpix.c
index b7e2c36e1..412cc15af 100644
--- a/mesalib/src/mesa/main/drawpix.c
+++ b/mesalib/src/mesa/main/drawpix.c
@@ -80,6 +80,10 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
goto end; /* the error code was recorded */
}
+ if (ctx->TransformFeedback.RasterDiscard) {
+ goto end;
+ }
+
if (!ctx->Current.RasterPosValid) {
goto end; /* no-op, not an error */
}
@@ -188,6 +192,10 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
goto end;
}
+ if (ctx->TransformFeedback.RasterDiscard) {
+ goto end;
+ }
+
if (!ctx->Current.RasterPosValid || width == 0 || height == 0) {
goto end; /* no-op, not an error */
}
@@ -242,6 +250,9 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
return;
}
+ if (ctx->TransformFeedback.RasterDiscard)
+ return;
+
if (ctx->RenderMode == GL_RENDER) {
/* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */
if (width > 0 && height > 0) {
diff --git a/mesalib/src/mesa/main/drawpix.h b/mesalib/src/mesa/main/drawpix.h
index 88d3ecc95..13efba5f8 100644
--- a/mesalib/src/mesa/main/drawpix.h
+++ b/mesalib/src/mesa/main/drawpix.h
@@ -1,50 +1,50 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-#ifndef DRAWPIX_H
-#define DRAWPIX_H
-
-
-#include "compiler.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-
-
-#if FEATURE_drawpix
-
-extern void
-_mesa_init_drawpix_dispatch(struct _glapi_table *disp);
-
-#else /* FEATURE_drawpix */
-
-static INLINE void
-_mesa_init_drawpix_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_drawpix */
-
-
-#endif /* DRAWPIX_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+#ifndef DRAWPIX_H
+#define DRAWPIX_H
+
+
+#include "compiler.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+
+
+#if FEATURE_drawpix
+
+extern void
+_mesa_init_drawpix_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_drawpix */
+
+static inline void
+_mesa_init_drawpix_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_drawpix */
+
+
+#endif /* DRAWPIX_H */
diff --git a/mesalib/src/mesa/main/enums.c b/mesalib/src/mesa/main/enums.c
index a8962a78a..fb5ed2922 100644
--- a/mesalib/src/mesa/main/enums.c
+++ b/mesalib/src/mesa/main/enums.c
@@ -495,51 +495,67 @@ LONGSTRING static const char enum_string_table[] =
"GL_DRAW_BUFFER0\0"
"GL_DRAW_BUFFER0_ARB\0"
"GL_DRAW_BUFFER0_ATI\0"
+ "GL_DRAW_BUFFER0_NV\0"
"GL_DRAW_BUFFER1\0"
"GL_DRAW_BUFFER10\0"
"GL_DRAW_BUFFER10_ARB\0"
"GL_DRAW_BUFFER10_ATI\0"
+ "GL_DRAW_BUFFER10_NV\0"
"GL_DRAW_BUFFER11\0"
"GL_DRAW_BUFFER11_ARB\0"
"GL_DRAW_BUFFER11_ATI\0"
+ "GL_DRAW_BUFFER11_NV\0"
"GL_DRAW_BUFFER12\0"
"GL_DRAW_BUFFER12_ARB\0"
"GL_DRAW_BUFFER12_ATI\0"
+ "GL_DRAW_BUFFER12_NV\0"
"GL_DRAW_BUFFER13\0"
"GL_DRAW_BUFFER13_ARB\0"
"GL_DRAW_BUFFER13_ATI\0"
+ "GL_DRAW_BUFFER13_NV\0"
"GL_DRAW_BUFFER14\0"
"GL_DRAW_BUFFER14_ARB\0"
"GL_DRAW_BUFFER14_ATI\0"
+ "GL_DRAW_BUFFER14_NV\0"
"GL_DRAW_BUFFER15\0"
"GL_DRAW_BUFFER15_ARB\0"
"GL_DRAW_BUFFER15_ATI\0"
+ "GL_DRAW_BUFFER15_NV\0"
"GL_DRAW_BUFFER1_ARB\0"
"GL_DRAW_BUFFER1_ATI\0"
+ "GL_DRAW_BUFFER1_NV\0"
"GL_DRAW_BUFFER2\0"
"GL_DRAW_BUFFER2_ARB\0"
"GL_DRAW_BUFFER2_ATI\0"
+ "GL_DRAW_BUFFER2_NV\0"
"GL_DRAW_BUFFER3\0"
"GL_DRAW_BUFFER3_ARB\0"
"GL_DRAW_BUFFER3_ATI\0"
+ "GL_DRAW_BUFFER3_NV\0"
"GL_DRAW_BUFFER4\0"
"GL_DRAW_BUFFER4_ARB\0"
"GL_DRAW_BUFFER4_ATI\0"
+ "GL_DRAW_BUFFER4_NV\0"
"GL_DRAW_BUFFER5\0"
"GL_DRAW_BUFFER5_ARB\0"
"GL_DRAW_BUFFER5_ATI\0"
+ "GL_DRAW_BUFFER5_NV\0"
"GL_DRAW_BUFFER6\0"
"GL_DRAW_BUFFER6_ARB\0"
"GL_DRAW_BUFFER6_ATI\0"
+ "GL_DRAW_BUFFER6_NV\0"
"GL_DRAW_BUFFER7\0"
"GL_DRAW_BUFFER7_ARB\0"
"GL_DRAW_BUFFER7_ATI\0"
+ "GL_DRAW_BUFFER7_NV\0"
"GL_DRAW_BUFFER8\0"
"GL_DRAW_BUFFER8_ARB\0"
"GL_DRAW_BUFFER8_ATI\0"
+ "GL_DRAW_BUFFER8_NV\0"
"GL_DRAW_BUFFER9\0"
"GL_DRAW_BUFFER9_ARB\0"
"GL_DRAW_BUFFER9_ATI\0"
+ "GL_DRAW_BUFFER9_NV\0"
"GL_DRAW_FRAMEBUFFER\0"
"GL_DRAW_FRAMEBUFFER_BINDING\0"
"GL_DRAW_FRAMEBUFFER_BINDING_EXT\0"
@@ -1082,6 +1098,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_MAX_DRAW_BUFFERS\0"
"GL_MAX_DRAW_BUFFERS_ARB\0"
"GL_MAX_DRAW_BUFFERS_ATI\0"
+ "GL_MAX_DRAW_BUFFERS_NV\0"
"GL_MAX_ELEMENTS_INDICES\0"
"GL_MAX_ELEMENTS_VERTICES\0"
"GL_MAX_EVAL_ORDER\0"
@@ -2357,7 +2374,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_ZOOM_Y\0"
;
-static const enum_elt all_enums[2318] =
+static const enum_elt all_enums[2335] =
{
{ 0, 0x00000600 }, /* GL_2D */
{ 6, 0x00001407 }, /* GL_2_BYTES */
@@ -2817,1949 +2834,1966 @@ static const enum_elt all_enums[2318] =
{ 9383, 0x00008825 }, /* GL_DRAW_BUFFER0 */
{ 9399, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */
{ 9419, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */
- { 9439, 0x00008826 }, /* GL_DRAW_BUFFER1 */
- { 9455, 0x0000882F }, /* GL_DRAW_BUFFER10 */
- { 9472, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
- { 9493, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
- { 9514, 0x00008830 }, /* GL_DRAW_BUFFER11 */
- { 9531, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
- { 9552, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
- { 9573, 0x00008831 }, /* GL_DRAW_BUFFER12 */
- { 9590, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
- { 9611, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
- { 9632, 0x00008832 }, /* GL_DRAW_BUFFER13 */
- { 9649, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
- { 9670, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
- { 9691, 0x00008833 }, /* GL_DRAW_BUFFER14 */
- { 9708, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
- { 9729, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
- { 9750, 0x00008834 }, /* GL_DRAW_BUFFER15 */
- { 9767, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
- { 9788, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
- { 9809, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
- { 9829, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
- { 9849, 0x00008827 }, /* GL_DRAW_BUFFER2 */
- { 9865, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
- { 9885, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
- { 9905, 0x00008828 }, /* GL_DRAW_BUFFER3 */
- { 9921, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
- { 9941, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
- { 9961, 0x00008829 }, /* GL_DRAW_BUFFER4 */
- { 9977, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
- { 9997, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
- { 10017, 0x0000882A }, /* GL_DRAW_BUFFER5 */
- { 10033, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
- { 10053, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
- { 10073, 0x0000882B }, /* GL_DRAW_BUFFER6 */
- { 10089, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
- { 10109, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
- { 10129, 0x0000882C }, /* GL_DRAW_BUFFER7 */
- { 10145, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
- { 10165, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
- { 10185, 0x0000882D }, /* GL_DRAW_BUFFER8 */
- { 10201, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
- { 10221, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
- { 10241, 0x0000882E }, /* GL_DRAW_BUFFER9 */
- { 10257, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
- { 10277, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
- { 10297, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */
- { 10317, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING */
- { 10345, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
- { 10377, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
- { 10401, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
- { 10421, 0x00000304 }, /* GL_DST_ALPHA */
- { 10434, 0x00000306 }, /* GL_DST_COLOR */
- { 10447, 0x0000877A }, /* GL_DU8DV8_ATI */
- { 10461, 0x00008779 }, /* GL_DUDV_ATI */
- { 10473, 0x000088EA }, /* GL_DYNAMIC_COPY */
- { 10489, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
- { 10509, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
- { 10525, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
- { 10545, 0x000088E9 }, /* GL_DYNAMIC_READ */
- { 10561, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
- { 10581, 0x00000B43 }, /* GL_EDGE_FLAG */
- { 10594, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
- { 10613, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- { 10647, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
- { 10685, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
- { 10712, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- { 10738, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
- { 10762, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- { 10794, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
- { 10830, 0x00001600 }, /* GL_EMISSION */
- { 10842, 0x00002000 }, /* GL_ENABLE_BIT */
- { 10856, 0x00000202 }, /* GL_EQUAL */
- { 10865, 0x00001509 }, /* GL_EQUIV */
- { 10874, 0x00010000 }, /* GL_EVAL_BIT */
- { 10886, 0x00000800 }, /* GL_EXP */
- { 10893, 0x00000801 }, /* GL_EXP2 */
- { 10901, 0x00001F03 }, /* GL_EXTENSIONS */
- { 10915, 0x00002400 }, /* GL_EYE_LINEAR */
- { 10929, 0x00002502 }, /* GL_EYE_PLANE */
- { 10942, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
- { 10967, 0x0000855B }, /* GL_EYE_RADIAL_NV */
- { 10984, 0x00000000 }, /* GL_FALSE */
- { 10993, 0x00001101 }, /* GL_FASTEST */
- { 11004, 0x00001C01 }, /* GL_FEEDBACK */
- { 11016, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
- { 11043, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
- { 11067, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
- { 11091, 0x00001B02 }, /* GL_FILL */
- { 11099, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */
- { 11126, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */
- { 11157, 0x0000140C }, /* GL_FIXED */
- { 11166, 0x0000140C }, /* GL_FIXED_OES */
- { 11179, 0x0000891D }, /* GL_FIXED_ONLY */
- { 11193, 0x0000891D }, /* GL_FIXED_ONLY_ARB */
- { 11211, 0x00001D00 }, /* GL_FLAT */
- { 11219, 0x00001406 }, /* GL_FLOAT */
- { 11228, 0x00008B5A }, /* GL_FLOAT_MAT2 */
- { 11242, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
- { 11260, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */
- { 11276, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */
- { 11292, 0x00008B5B }, /* GL_FLOAT_MAT3 */
- { 11306, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
- { 11324, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */
- { 11340, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */
- { 11356, 0x00008B5C }, /* GL_FLOAT_MAT4 */
- { 11370, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
- { 11388, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */
- { 11404, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */
- { 11420, 0x00008B50 }, /* GL_FLOAT_VEC2 */
- { 11434, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
- { 11452, 0x00008B51 }, /* GL_FLOAT_VEC3 */
- { 11466, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
- { 11484, 0x00008B52 }, /* GL_FLOAT_VEC4 */
- { 11498, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
- { 11516, 0x00000B60 }, /* GL_FOG */
- { 11523, 0x00000080 }, /* GL_FOG_BIT */
- { 11534, 0x00000B66 }, /* GL_FOG_COLOR */
- { 11547, 0x00008451 }, /* GL_FOG_COORD */
- { 11560, 0x00008451 }, /* GL_FOG_COORDINATE */
- { 11578, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
- { 11602, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- { 11641, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
- { 11684, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- { 11716, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- { 11747, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- { 11776, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
- { 11801, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
- { 11820, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
- { 11854, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
- { 11881, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
- { 11907, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
- { 11931, 0x00008450 }, /* GL_FOG_COORD_SRC */
- { 11948, 0x00000B62 }, /* GL_FOG_DENSITY */
- { 11963, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
- { 11987, 0x00000B64 }, /* GL_FOG_END */
- { 11998, 0x00000C54 }, /* GL_FOG_HINT */
- { 12010, 0x00000B61 }, /* GL_FOG_INDEX */
- { 12023, 0x00000B65 }, /* GL_FOG_MODE */
- { 12035, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
- { 12054, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
- { 12079, 0x00000B63 }, /* GL_FOG_START */
- { 12092, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
- { 12110, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
- { 12134, 0x00008B30 }, /* GL_FRAGMENT_SHADER */
- { 12153, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
- { 12176, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
- { 12211, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES */
- { 12250, 0x00008D40 }, /* GL_FRAMEBUFFER */
- { 12265, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
- { 12302, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
- { 12338, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
- { 12379, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
- { 12420, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
- { 12457, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
- { 12494, 0x00008DA7 }, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED */
- { 12528, 0x00008DA7 }, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB */
- { 12566, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
- { 12604, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
- { 12646, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES */
- { 12688, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
- { 12726, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
- { 12768, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES */
- { 12810, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
- { 12845, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
- { 12884, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
- { 12933, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES */
- { 12982, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
- { 13030, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
- { 13082, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES */
- { 13134, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
- { 13174, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
- { 13218, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
- { 13258, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
- { 13302, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES */
- { 13346, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING */
- { 13369, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
- { 13396, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_OES */
- { 13423, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */
- { 13447, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
- { 13475, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_OES */
- { 13503, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */
- { 13526, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
- { 13545, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
- { 13582, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
- { 13623, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES */
- { 13664, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS */
- { 13701, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- { 13742, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES */
- { 13783, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
- { 13821, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
- { 13863, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES */
- { 13905, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- { 13956, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- { 13994, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES */
- { 14032, 0x00008DA9 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB */
- { 14074, 0x00008DA8 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS */
- { 14114, 0x00008DA8 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB */
- { 14158, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
- { 14203, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
- { 14252, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES */
- { 14301, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
- { 14339, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT */
- { 14381, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
- { 14419, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
- { 14461, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES */
- { 14503, 0x00008D40 }, /* GL_FRAMEBUFFER_OES */
- { 14522, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- { 14554, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */
- { 14579, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */
- { 14606, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
- { 14637, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_OES */
- { 14668, 0x00000404 }, /* GL_FRONT */
- { 14677, 0x00000408 }, /* GL_FRONT_AND_BACK */
- { 14695, 0x00000B46 }, /* GL_FRONT_FACE */
- { 14709, 0x00000400 }, /* GL_FRONT_LEFT */
- { 14723, 0x00000401 }, /* GL_FRONT_RIGHT */
- { 14738, 0x00008006 }, /* GL_FUNC_ADD */
- { 14750, 0x00008006 }, /* GL_FUNC_ADD_EXT */
- { 14766, 0x00008006 }, /* GL_FUNC_ADD_OES */
- { 14782, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
- { 14807, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
- { 14836, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_OES */
- { 14865, 0x0000800A }, /* GL_FUNC_SUBTRACT */
- { 14882, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
- { 14903, 0x0000800A }, /* GL_FUNC_SUBTRACT_OES */
- { 14924, 0x00008191 }, /* GL_GENERATE_MIPMAP */
- { 14943, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
- { 14967, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
- { 14996, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
- { 15020, 0x00008917 }, /* GL_GEOMETRY_INPUT_TYPE */
- { 15043, 0x00008DDB }, /* GL_GEOMETRY_INPUT_TYPE_ARB */
- { 15070, 0x00008918 }, /* GL_GEOMETRY_OUTPUT_TYPE */
- { 15094, 0x00008DDC }, /* GL_GEOMETRY_OUTPUT_TYPE_ARB */
- { 15122, 0x00008DD9 }, /* GL_GEOMETRY_SHADER */
- { 15141, 0x00008DD9 }, /* GL_GEOMETRY_SHADER_ARB */
- { 15164, 0x00008916 }, /* GL_GEOMETRY_VERTICES_OUT */
- { 15189, 0x00008DDA }, /* GL_GEOMETRY_VERTICES_OUT_ARB */
- { 15218, 0x00000206 }, /* GL_GEQUAL */
- { 15228, 0x00000204 }, /* GL_GREATER */
- { 15239, 0x00001904 }, /* GL_GREEN */
- { 15248, 0x00000D19 }, /* GL_GREEN_BIAS */
- { 15262, 0x00000D53 }, /* GL_GREEN_BITS */
- { 15276, 0x00008D95 }, /* GL_GREEN_INTEGER */
- { 15293, 0x00008D95 }, /* GL_GREEN_INTEGER_EXT */
- { 15314, 0x00000D18 }, /* GL_GREEN_SCALE */
- { 15329, 0x00008253 }, /* GL_GUILTY_CONTEXT_RESET_ARB */
- { 15357, 0x0000140B }, /* GL_HALF_FLOAT */
- { 15371, 0x00008D61 }, /* GL_HALF_FLOAT_OES */
- { 15389, 0x00008DF2 }, /* GL_HIGH_FLOAT */
- { 15403, 0x00008DF5 }, /* GL_HIGH_INT */
- { 15415, 0x00008000 }, /* GL_HINT_BIT */
- { 15427, 0x00008024 }, /* GL_HISTOGRAM */
- { 15440, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
- { 15464, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
- { 15492, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
- { 15515, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
- { 15542, 0x00008024 }, /* GL_HISTOGRAM_EXT */
- { 15559, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
- { 15579, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
- { 15603, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
- { 15627, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
- { 15655, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- { 15683, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
- { 15715, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
- { 15737, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
- { 15763, 0x0000802D }, /* GL_HISTOGRAM_SINK */
- { 15781, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
- { 15803, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
- { 15822, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
- { 15845, 0x0000862A }, /* GL_IDENTITY_NV */
- { 15860, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
- { 15880, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */
- { 15916, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- { 15956, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */
- { 15990, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
- { 16028, 0x00001E02 }, /* GL_INCR */
- { 16036, 0x00008507 }, /* GL_INCR_WRAP */
- { 16049, 0x00008507 }, /* GL_INCR_WRAP_EXT */
- { 16066, 0x00008222 }, /* GL_INDEX */
- { 16075, 0x00008077 }, /* GL_INDEX_ARRAY */
- { 16090, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- { 16120, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
- { 16154, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
- { 16177, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
- { 16199, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
- { 16219, 0x00000D51 }, /* GL_INDEX_BITS */
- { 16233, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
- { 16254, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
- { 16272, 0x00000C30 }, /* GL_INDEX_MODE */
- { 16286, 0x00000D13 }, /* GL_INDEX_OFFSET */
- { 16302, 0x00000D12 }, /* GL_INDEX_SHIFT */
- { 16317, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
- { 16336, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */
- { 16355, 0x00008254 }, /* GL_INNOCENT_CONTEXT_RESET_ARB */
- { 16385, 0x00001404 }, /* GL_INT */
- { 16392, 0x00008049 }, /* GL_INTENSITY */
- { 16405, 0x0000804C }, /* GL_INTENSITY12 */
- { 16420, 0x0000804C }, /* GL_INTENSITY12_EXT */
- { 16439, 0x0000804D }, /* GL_INTENSITY16 */
- { 16454, 0x00008D8B }, /* GL_INTENSITY16I_EXT */
- { 16474, 0x00008D79 }, /* GL_INTENSITY16UI_EXT */
- { 16495, 0x0000804D }, /* GL_INTENSITY16_EXT */
- { 16514, 0x00008D85 }, /* GL_INTENSITY32I_EXT */
- { 16534, 0x00008D73 }, /* GL_INTENSITY32UI_EXT */
- { 16555, 0x0000804A }, /* GL_INTENSITY4 */
- { 16569, 0x0000804A }, /* GL_INTENSITY4_EXT */
- { 16587, 0x0000804B }, /* GL_INTENSITY8 */
- { 16601, 0x00008D91 }, /* GL_INTENSITY8I_EXT */
- { 16620, 0x00008D7F }, /* GL_INTENSITY8UI_EXT */
- { 16640, 0x0000804B }, /* GL_INTENSITY8_EXT */
- { 16658, 0x00008049 }, /* GL_INTENSITY_EXT */
- { 16675, 0x00008C8C }, /* GL_INTERLEAVED_ATTRIBS */
- { 16698, 0x00008C8C }, /* GL_INTERLEAVED_ATTRIBS_EXT */
- { 16725, 0x00008575 }, /* GL_INTERPOLATE */
- { 16740, 0x00008575 }, /* GL_INTERPOLATE_ARB */
- { 16759, 0x00008575 }, /* GL_INTERPOLATE_EXT */
- { 16778, 0x00008DF7 }, /* GL_INT_10_10_10_2_OES */
- { 16800, 0x00008D9F }, /* GL_INT_2_10_10_10_REV */
- { 16822, 0x00008DC9 }, /* GL_INT_SAMPLER_1D */
- { 16840, 0x00008DCE }, /* GL_INT_SAMPLER_1D_ARRAY */
- { 16864, 0x00008DCE }, /* GL_INT_SAMPLER_1D_ARRAY_EXT */
- { 16892, 0x00008DC9 }, /* GL_INT_SAMPLER_1D_EXT */
- { 16914, 0x00008DCA }, /* GL_INT_SAMPLER_2D */
- { 16932, 0x00008DCF }, /* GL_INT_SAMPLER_2D_ARRAY */
- { 16956, 0x00008DCF }, /* GL_INT_SAMPLER_2D_ARRAY_EXT */
- { 16984, 0x00008DCA }, /* GL_INT_SAMPLER_2D_EXT */
- { 17006, 0x00008DCD }, /* GL_INT_SAMPLER_2D_RECT */
- { 17029, 0x00008DCD }, /* GL_INT_SAMPLER_2D_RECT_EXT */
- { 17056, 0x00008DCB }, /* GL_INT_SAMPLER_3D */
- { 17074, 0x00008DCB }, /* GL_INT_SAMPLER_3D_EXT */
- { 17096, 0x00008DD0 }, /* GL_INT_SAMPLER_BUFFER */
- { 17118, 0x00008DD0 }, /* GL_INT_SAMPLER_BUFFER_EXT */
- { 17144, 0x00008DCC }, /* GL_INT_SAMPLER_CUBE */
- { 17164, 0x00008DCC }, /* GL_INT_SAMPLER_CUBE_EXT */
- { 17188, 0x00008B53 }, /* GL_INT_VEC2 */
- { 17200, 0x00008B53 }, /* GL_INT_VEC2_ARB */
- { 17216, 0x00008B54 }, /* GL_INT_VEC3 */
- { 17228, 0x00008B54 }, /* GL_INT_VEC3_ARB */
- { 17244, 0x00008B55 }, /* GL_INT_VEC4 */
- { 17256, 0x00008B55 }, /* GL_INT_VEC4_ARB */
- { 17272, 0x00000500 }, /* GL_INVALID_ENUM */
- { 17288, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */
- { 17321, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
- { 17358, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_OES */
- { 17395, 0x00000502 }, /* GL_INVALID_OPERATION */
- { 17416, 0x00000501 }, /* GL_INVALID_VALUE */
- { 17433, 0x0000862B }, /* GL_INVERSE_NV */
- { 17447, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
- { 17471, 0x0000150A }, /* GL_INVERT */
- { 17481, 0x00001E00 }, /* GL_KEEP */
- { 17489, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */
- { 17515, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */
- { 17545, 0x00000406 }, /* GL_LEFT */
- { 17553, 0x00000203 }, /* GL_LEQUAL */
- { 17563, 0x00000201 }, /* GL_LESS */
- { 17571, 0x00004000 }, /* GL_LIGHT0 */
- { 17581, 0x00004001 }, /* GL_LIGHT1 */
- { 17591, 0x00004002 }, /* GL_LIGHT2 */
- { 17601, 0x00004003 }, /* GL_LIGHT3 */
- { 17611, 0x00004004 }, /* GL_LIGHT4 */
- { 17621, 0x00004005 }, /* GL_LIGHT5 */
- { 17631, 0x00004006 }, /* GL_LIGHT6 */
- { 17641, 0x00004007 }, /* GL_LIGHT7 */
- { 17651, 0x00000B50 }, /* GL_LIGHTING */
- { 17663, 0x00000040 }, /* GL_LIGHTING_BIT */
- { 17679, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
- { 17702, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- { 17731, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
- { 17764, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- { 17792, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
- { 17816, 0x00001B01 }, /* GL_LINE */
- { 17824, 0x00002601 }, /* GL_LINEAR */
- { 17834, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
- { 17856, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- { 17886, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- { 17917, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
- { 17941, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
- { 17966, 0x00000001 }, /* GL_LINES */
- { 17975, 0x0000000A }, /* GL_LINES_ADJACENCY */
- { 17994, 0x0000000A }, /* GL_LINES_ADJACENCY_ARB */
- { 18017, 0x00000004 }, /* GL_LINE_BIT */
- { 18029, 0x00000002 }, /* GL_LINE_LOOP */
- { 18042, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
- { 18062, 0x00000B20 }, /* GL_LINE_SMOOTH */
- { 18077, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
- { 18097, 0x00000B24 }, /* GL_LINE_STIPPLE */
- { 18113, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
- { 18137, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
- { 18160, 0x00000003 }, /* GL_LINE_STRIP */
- { 18174, 0x0000000B }, /* GL_LINE_STRIP_ADJACENCY */
- { 18198, 0x0000000B }, /* GL_LINE_STRIP_ADJACENCY_ARB */
- { 18226, 0x00000702 }, /* GL_LINE_TOKEN */
- { 18240, 0x00000B21 }, /* GL_LINE_WIDTH */
- { 18254, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
- { 18280, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
- { 18300, 0x00008B82 }, /* GL_LINK_STATUS */
- { 18315, 0x00000B32 }, /* GL_LIST_BASE */
- { 18328, 0x00020000 }, /* GL_LIST_BIT */
- { 18340, 0x00000B33 }, /* GL_LIST_INDEX */
- { 18354, 0x00000B30 }, /* GL_LIST_MODE */
- { 18367, 0x00000101 }, /* GL_LOAD */
- { 18375, 0x00000BF1 }, /* GL_LOGIC_OP */
- { 18387, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
- { 18404, 0x00008252 }, /* GL_LOSE_CONTEXT_ON_RESET_ARB */
- { 18433, 0x00008CA1 }, /* GL_LOWER_LEFT */
- { 18447, 0x00008DF0 }, /* GL_LOW_FLOAT */
- { 18460, 0x00008DF3 }, /* GL_LOW_INT */
- { 18471, 0x00001909 }, /* GL_LUMINANCE */
- { 18484, 0x00008041 }, /* GL_LUMINANCE12 */
- { 18499, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
- { 18522, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
- { 18549, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
- { 18571, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
- { 18597, 0x00008041 }, /* GL_LUMINANCE12_EXT */
- { 18616, 0x00008042 }, /* GL_LUMINANCE16 */
- { 18631, 0x00008D8C }, /* GL_LUMINANCE16I_EXT */
- { 18651, 0x00008D7A }, /* GL_LUMINANCE16UI_EXT */
- { 18672, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
- { 18695, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
- { 18722, 0x00008042 }, /* GL_LUMINANCE16_EXT */
- { 18741, 0x00008D86 }, /* GL_LUMINANCE32I_EXT */
- { 18761, 0x00008D74 }, /* GL_LUMINANCE32UI_EXT */
- { 18782, 0x0000803F }, /* GL_LUMINANCE4 */
- { 18796, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
- { 18817, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
- { 18842, 0x0000803F }, /* GL_LUMINANCE4_EXT */
- { 18860, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
- { 18881, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
- { 18906, 0x00008040 }, /* GL_LUMINANCE8 */
- { 18920, 0x00008D92 }, /* GL_LUMINANCE8I_EXT */
- { 18939, 0x00008D80 }, /* GL_LUMINANCE8UI_EXT */
- { 18959, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
- { 18980, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
- { 19005, 0x00008040 }, /* GL_LUMINANCE8_EXT */
- { 19023, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
- { 19042, 0x00008D8D }, /* GL_LUMINANCE_ALPHA16I_EXT */
- { 19068, 0x00008D7B }, /* GL_LUMINANCE_ALPHA16UI_EXT */
- { 19095, 0x00008D87 }, /* GL_LUMINANCE_ALPHA32I_EXT */
- { 19121, 0x00008D75 }, /* GL_LUMINANCE_ALPHA32UI_EXT */
- { 19148, 0x00008D93 }, /* GL_LUMINANCE_ALPHA8I_EXT */
- { 19173, 0x00008D81 }, /* GL_LUMINANCE_ALPHA8UI_EXT */
- { 19199, 0x00008D9D }, /* GL_LUMINANCE_ALPHA_INTEGER_EXT */
- { 19230, 0x00008D9C }, /* GL_LUMINANCE_INTEGER_EXT */
- { 19255, 0x0000821B }, /* GL_MAJOR_VERSION */
- { 19272, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
- { 19288, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
- { 19308, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
- { 19330, 0x00000D91 }, /* GL_MAP1_INDEX */
- { 19344, 0x00000D92 }, /* GL_MAP1_NORMAL */
- { 19359, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
- { 19383, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
- { 19407, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
- { 19431, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
- { 19455, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
- { 19472, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
- { 19489, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- { 19517, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- { 19546, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- { 19575, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- { 19604, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- { 19633, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- { 19662, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- { 19691, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- { 19719, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- { 19747, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- { 19775, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- { 19803, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- { 19831, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- { 19859, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- { 19887, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- { 19915, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- { 19943, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
- { 19959, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
- { 19979, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
- { 20001, 0x00000DB1 }, /* GL_MAP2_INDEX */
- { 20015, 0x00000DB2 }, /* GL_MAP2_NORMAL */
- { 20030, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
- { 20054, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
- { 20078, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
- { 20102, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
- { 20126, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
- { 20143, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
- { 20160, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- { 20188, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- { 20217, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- { 20246, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- { 20275, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- { 20304, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- { 20333, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- { 20362, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- { 20390, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- { 20418, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- { 20446, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- { 20474, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- { 20502, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- { 20530, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
- { 20558, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- { 20586, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- { 20614, 0x00000D10 }, /* GL_MAP_COLOR */
- { 20627, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */
- { 20653, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */
- { 20682, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */
- { 20710, 0x00000001 }, /* GL_MAP_READ_BIT */
- { 20726, 0x00000D11 }, /* GL_MAP_STENCIL */
- { 20741, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */
- { 20767, 0x00000002 }, /* GL_MAP_WRITE_BIT */
- { 20784, 0x000088C0 }, /* GL_MATRIX0_ARB */
- { 20799, 0x00008630 }, /* GL_MATRIX0_NV */
- { 20813, 0x000088CA }, /* GL_MATRIX10_ARB */
- { 20829, 0x000088CB }, /* GL_MATRIX11_ARB */
- { 20845, 0x000088CC }, /* GL_MATRIX12_ARB */
- { 20861, 0x000088CD }, /* GL_MATRIX13_ARB */
- { 20877, 0x000088CE }, /* GL_MATRIX14_ARB */
- { 20893, 0x000088CF }, /* GL_MATRIX15_ARB */
- { 20909, 0x000088D0 }, /* GL_MATRIX16_ARB */
- { 20925, 0x000088D1 }, /* GL_MATRIX17_ARB */
- { 20941, 0x000088D2 }, /* GL_MATRIX18_ARB */
- { 20957, 0x000088D3 }, /* GL_MATRIX19_ARB */
- { 20973, 0x000088C1 }, /* GL_MATRIX1_ARB */
- { 20988, 0x00008631 }, /* GL_MATRIX1_NV */
- { 21002, 0x000088D4 }, /* GL_MATRIX20_ARB */
- { 21018, 0x000088D5 }, /* GL_MATRIX21_ARB */
- { 21034, 0x000088D6 }, /* GL_MATRIX22_ARB */
- { 21050, 0x000088D7 }, /* GL_MATRIX23_ARB */
- { 21066, 0x000088D8 }, /* GL_MATRIX24_ARB */
- { 21082, 0x000088D9 }, /* GL_MATRIX25_ARB */
- { 21098, 0x000088DA }, /* GL_MATRIX26_ARB */
- { 21114, 0x000088DB }, /* GL_MATRIX27_ARB */
- { 21130, 0x000088DC }, /* GL_MATRIX28_ARB */
- { 21146, 0x000088DD }, /* GL_MATRIX29_ARB */
- { 21162, 0x000088C2 }, /* GL_MATRIX2_ARB */
- { 21177, 0x00008632 }, /* GL_MATRIX2_NV */
- { 21191, 0x000088DE }, /* GL_MATRIX30_ARB */
- { 21207, 0x000088DF }, /* GL_MATRIX31_ARB */
- { 21223, 0x000088C3 }, /* GL_MATRIX3_ARB */
- { 21238, 0x00008633 }, /* GL_MATRIX3_NV */
- { 21252, 0x000088C4 }, /* GL_MATRIX4_ARB */
- { 21267, 0x00008634 }, /* GL_MATRIX4_NV */
- { 21281, 0x000088C5 }, /* GL_MATRIX5_ARB */
- { 21296, 0x00008635 }, /* GL_MATRIX5_NV */
- { 21310, 0x000088C6 }, /* GL_MATRIX6_ARB */
- { 21325, 0x00008636 }, /* GL_MATRIX6_NV */
- { 21339, 0x000088C7 }, /* GL_MATRIX7_ARB */
- { 21354, 0x00008637 }, /* GL_MATRIX7_NV */
- { 21368, 0x000088C8 }, /* GL_MATRIX8_ARB */
- { 21383, 0x000088C9 }, /* GL_MATRIX9_ARB */
- { 21398, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
- { 21424, 0x00008B9E }, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */
- { 21465, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_OES */
- { 21491, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- { 21525, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_OES */
- { 21559, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- { 21590, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_OES */
- { 21621, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- { 21654, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_OES */
- { 21687, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- { 21718, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_OES */
- { 21749, 0x00000BA0 }, /* GL_MATRIX_MODE */
- { 21764, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
- { 21786, 0x00008840 }, /* GL_MATRIX_PALETTE_OES */
- { 21808, 0x00008008 }, /* GL_MAX */
- { 21815, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
- { 21838, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE_OES */
- { 21865, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS */
- { 21893, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */
- { 21925, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
- { 21951, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- { 21984, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- { 22010, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 22044, 0x00000D32 }, /* GL_MAX_CLIP_DISTANCES */
- { 22066, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
- { 22085, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */
- { 22110, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
- { 22139, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- { 22171, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
- { 22207, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
- { 22243, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
- { 22283, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
- { 22309, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
- { 22339, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
- { 22364, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
- { 22393, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- { 22422, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
- { 22455, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES */
- { 22488, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */
- { 22508, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
- { 22532, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
- { 22556, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
- { 22580, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
- { 22605, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
- { 22623, 0x00008008 }, /* GL_MAX_EXT */
- { 22634, 0x00009125 }, /* GL_MAX_FRAGMENT_INPUT_COMPONENTS */
- { 22667, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
- { 22702, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
- { 22741, 0x00008DFD }, /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */
- { 22773, 0x00009123 }, /* GL_MAX_GEOMETRY_INPUT_COMPONENTS */
- { 22806, 0x00009124 }, /* GL_MAX_GEOMETRY_OUTPUT_COMPONENTS */
- { 22840, 0x00008DE0 }, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES */
- { 22872, 0x00008DE0 }, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB */
- { 22908, 0x00008C29 }, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS */
- { 22944, 0x00008C29 }, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB */
- { 22984, 0x00008DE1 }, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS */
- { 23024, 0x00008DE1 }, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB */
- { 23068, 0x00008DDF }, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS */
- { 23103, 0x00008DDF }, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB */
- { 23142, 0x00008DDD }, /* GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB */
- { 23181, 0x00000D31 }, /* GL_MAX_LIGHTS */
- { 23195, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
- { 23215, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- { 23253, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- { 23282, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
- { 23306, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
- { 23334, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_OES */
- { 23362, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
- { 23385, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 23422, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 23458, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- { 23485, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- { 23514, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- { 23548, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
- { 23584, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- { 23611, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- { 23643, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- { 23679, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- { 23708, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- { 23737, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
- { 23765, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- { 23803, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 23847, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 23890, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 23924, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 23963, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 24000, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 24038, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 24081, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 24124, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- { 24154, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- { 24185, 0x00008905 }, /* GL_MAX_PROGRAM_TEXEL_OFFSET */
- { 24213, 0x00008905 }, /* GL_MAX_PROGRAM_TEXEL_OFFSET_EXT */
- { 24245, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 24281, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 24317, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
- { 24347, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE */
- { 24377, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
- { 24411, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
- { 24444, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */
- { 24469, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
- { 24498, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_OES */
- { 24527, 0x00008D57 }, /* GL_MAX_SAMPLES */
- { 24542, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */
- { 24561, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */
- { 24588, 0x00008504 }, /* GL_MAX_SHININESS_NV */
- { 24608, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
- { 24632, 0x00008C2B }, /* GL_MAX_TEXTURE_BUFFER_SIZE */
- { 24659, 0x00008C2B }, /* GL_MAX_TEXTURE_BUFFER_SIZE_ARB */
- { 24690, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */
- { 24712, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
- { 24738, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */
- { 24765, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
- { 24796, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
- { 24820, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS_EXT */
- { 24848, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- { 24882, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
- { 24902, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
- { 24929, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
- { 24950, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
- { 24975, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
- { 25000, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
- { 25035, 0x00008C8A }, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS */
- { 25084, 0x00008C8A }, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT */
- { 25137, 0x00008C8B }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS */
- { 25180, 0x00008C8B }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT */
- { 25227, 0x00008C80 }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS */
- { 25273, 0x00008C80 }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT */
- { 25323, 0x00008B4B }, /* GL_MAX_VARYING_COMPONENTS */
- { 25349, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */
- { 25371, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
- { 25397, 0x00008DFC }, /* GL_MAX_VARYING_VECTORS */
- { 25420, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */
- { 25442, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
- { 25468, 0x00009122 }, /* GL_MAX_VERTEX_OUTPUT_COMPONENTS */
- { 25500, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
- { 25534, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
- { 25572, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
- { 25605, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
- { 25642, 0x00008DFB }, /* GL_MAX_VERTEX_UNIFORM_VECTORS */
- { 25672, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
- { 25696, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_OES */
- { 25720, 0x00008DDE }, /* GL_MAX_VERTEX_VARYING_COMPONENTS_ARB */
- { 25757, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
- { 25778, 0x00008DF1 }, /* GL_MEDIUM_FLOAT */
- { 25794, 0x00008DF4 }, /* GL_MEDIUM_INT */
- { 25808, 0x00008007 }, /* GL_MIN */
- { 25815, 0x0000802E }, /* GL_MINMAX */
- { 25825, 0x0000802E }, /* GL_MINMAX_EXT */
- { 25839, 0x0000802F }, /* GL_MINMAX_FORMAT */
- { 25856, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
- { 25877, 0x00008030 }, /* GL_MINMAX_SINK */
- { 25892, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
- { 25911, 0x0000821C }, /* GL_MINOR_VERSION */
- { 25928, 0x00008007 }, /* GL_MIN_EXT */
- { 25939, 0x00008904 }, /* GL_MIN_PROGRAM_TEXEL_OFFSET */
- { 25967, 0x00008904 }, /* GL_MIN_PROGRAM_TEXEL_OFFSET_EXT */
- { 25999, 0x00008370 }, /* GL_MIRRORED_REPEAT */
- { 26018, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
- { 26041, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
- { 26064, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
- { 26084, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
- { 26104, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- { 26134, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
- { 26162, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- { 26190, 0x00001700 }, /* GL_MODELVIEW */
- { 26203, 0x00001700 }, /* GL_MODELVIEW0_ARB */
- { 26221, 0x0000872A }, /* GL_MODELVIEW10_ARB */
- { 26240, 0x0000872B }, /* GL_MODELVIEW11_ARB */
- { 26259, 0x0000872C }, /* GL_MODELVIEW12_ARB */
- { 26278, 0x0000872D }, /* GL_MODELVIEW13_ARB */
- { 26297, 0x0000872E }, /* GL_MODELVIEW14_ARB */
- { 26316, 0x0000872F }, /* GL_MODELVIEW15_ARB */
- { 26335, 0x00008730 }, /* GL_MODELVIEW16_ARB */
- { 26354, 0x00008731 }, /* GL_MODELVIEW17_ARB */
- { 26373, 0x00008732 }, /* GL_MODELVIEW18_ARB */
- { 26392, 0x00008733 }, /* GL_MODELVIEW19_ARB */
- { 26411, 0x0000850A }, /* GL_MODELVIEW1_ARB */
- { 26429, 0x00008734 }, /* GL_MODELVIEW20_ARB */
- { 26448, 0x00008735 }, /* GL_MODELVIEW21_ARB */
- { 26467, 0x00008736 }, /* GL_MODELVIEW22_ARB */
- { 26486, 0x00008737 }, /* GL_MODELVIEW23_ARB */
- { 26505, 0x00008738 }, /* GL_MODELVIEW24_ARB */
- { 26524, 0x00008739 }, /* GL_MODELVIEW25_ARB */
- { 26543, 0x0000873A }, /* GL_MODELVIEW26_ARB */
- { 26562, 0x0000873B }, /* GL_MODELVIEW27_ARB */
- { 26581, 0x0000873C }, /* GL_MODELVIEW28_ARB */
- { 26600, 0x0000873D }, /* GL_MODELVIEW29_ARB */
- { 26619, 0x00008722 }, /* GL_MODELVIEW2_ARB */
- { 26637, 0x0000873E }, /* GL_MODELVIEW30_ARB */
- { 26656, 0x0000873F }, /* GL_MODELVIEW31_ARB */
- { 26675, 0x00008723 }, /* GL_MODELVIEW3_ARB */
- { 26693, 0x00008724 }, /* GL_MODELVIEW4_ARB */
- { 26711, 0x00008725 }, /* GL_MODELVIEW5_ARB */
- { 26729, 0x00008726 }, /* GL_MODELVIEW6_ARB */
- { 26747, 0x00008727 }, /* GL_MODELVIEW7_ARB */
- { 26765, 0x00008728 }, /* GL_MODELVIEW8_ARB */
- { 26783, 0x00008729 }, /* GL_MODELVIEW9_ARB */
- { 26801, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
- { 26821, 0x0000898D }, /* GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES */
- { 26863, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
- { 26890, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
- { 26915, 0x00002100 }, /* GL_MODULATE */
- { 26927, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
- { 26947, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
- { 26974, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
- { 26999, 0x00000103 }, /* GL_MULT */
- { 27007, 0x0000809D }, /* GL_MULTISAMPLE */
- { 27022, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
- { 27042, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
- { 27061, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
- { 27080, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
- { 27104, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
- { 27127, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- { 27157, 0x00002A25 }, /* GL_N3F_V3F */
- { 27168, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
- { 27188, 0x0000150E }, /* GL_NAND */
- { 27196, 0x00002600 }, /* GL_NEAREST */
- { 27207, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- { 27238, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- { 27270, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
- { 27295, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
- { 27321, 0x00000200 }, /* GL_NEVER */
- { 27330, 0x00001102 }, /* GL_NICEST */
- { 27340, 0x00000000 }, /* GL_NONE */
- { 27348, 0x00000000 }, /* GL_NONE_OES */
- { 27360, 0x00001505 }, /* GL_NOOP */
- { 27368, 0x00001508 }, /* GL_NOR */
- { 27375, 0x00000BA1 }, /* GL_NORMALIZE */
- { 27388, 0x00008075 }, /* GL_NORMAL_ARRAY */
- { 27404, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
- { 27435, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
- { 27470, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
- { 27494, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
- { 27517, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
- { 27538, 0x00008511 }, /* GL_NORMAL_MAP */
- { 27552, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
- { 27570, 0x00008511 }, /* GL_NORMAL_MAP_NV */
- { 27587, 0x00008511 }, /* GL_NORMAL_MAP_OES */
- { 27605, 0x00000205 }, /* GL_NOTEQUAL */
- { 27617, 0x00000000 }, /* GL_NO_ERROR */
- { 27629, 0x00008261 }, /* GL_NO_RESET_NOTIFICATION_ARB */
- { 27658, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
- { 27692, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */
- { 27730, 0x0000821D }, /* GL_NUM_EXTENSIONS */
- { 27748, 0x000087FE }, /* GL_NUM_PROGRAM_BINARY_FORMATS */
- { 27778, 0x000087FE }, /* GL_NUM_PROGRAM_BINARY_FORMATS_OES */
- { 27812, 0x00008DF9 }, /* GL_NUM_SHADER_BINARY_FORMATS */
- { 27841, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
- { 27873, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
- { 27915, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
- { 27945, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
- { 27985, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
- { 28016, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
- { 28045, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
- { 28073, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
- { 28103, 0x00002401 }, /* GL_OBJECT_LINEAR */
- { 28120, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
- { 28146, 0x00002501 }, /* GL_OBJECT_PLANE */
- { 28162, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
- { 28197, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
- { 28219, 0x00009112 }, /* GL_OBJECT_TYPE */
- { 28234, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
- { 28253, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
- { 28283, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
- { 28304, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
- { 28332, 0x00000001 }, /* GL_ONE */
- { 28339, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
- { 28367, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
- { 28399, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
- { 28427, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
- { 28459, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
- { 28482, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
- { 28505, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
- { 28528, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
- { 28551, 0x00008598 }, /* GL_OPERAND0_ALPHA */
- { 28569, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
- { 28591, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
- { 28613, 0x00008590 }, /* GL_OPERAND0_RGB */
- { 28629, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
- { 28649, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
- { 28669, 0x00008599 }, /* GL_OPERAND1_ALPHA */
- { 28687, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
- { 28709, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
- { 28731, 0x00008591 }, /* GL_OPERAND1_RGB */
- { 28747, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
- { 28767, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
- { 28787, 0x0000859A }, /* GL_OPERAND2_ALPHA */
- { 28805, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
- { 28827, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
- { 28849, 0x00008592 }, /* GL_OPERAND2_RGB */
- { 28865, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
- { 28885, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
- { 28905, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
- { 28926, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
- { 28945, 0x00001507 }, /* GL_OR */
- { 28951, 0x00000A01 }, /* GL_ORDER */
- { 28960, 0x0000150D }, /* GL_OR_INVERTED */
- { 28975, 0x0000150B }, /* GL_OR_REVERSE */
- { 28989, 0x00000505 }, /* GL_OUT_OF_MEMORY */
- { 29006, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
- { 29024, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
- { 29045, 0x00008758 }, /* GL_PACK_INVERT_MESA */
- { 29065, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
- { 29083, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
- { 29102, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
- { 29122, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
- { 29142, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
- { 29160, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
- { 29179, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
- { 29204, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
- { 29228, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
- { 29249, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
- { 29271, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
- { 29293, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
- { 29318, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
- { 29342, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
- { 29363, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
- { 29385, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
- { 29407, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
- { 29429, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
- { 29460, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
- { 29480, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- { 29505, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
- { 29525, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- { 29550, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
- { 29570, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- { 29595, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
- { 29615, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- { 29640, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
- { 29660, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- { 29685, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
- { 29705, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- { 29730, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
- { 29750, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- { 29775, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
- { 29795, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- { 29820, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
- { 29840, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- { 29865, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
- { 29885, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- { 29910, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
- { 29928, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */
- { 29949, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */
- { 29978, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
- { 30011, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
- { 30036, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */
- { 30059, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
- { 30090, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
- { 30125, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
- { 30152, 0x00001B00 }, /* GL_POINT */
- { 30161, 0x00000000 }, /* GL_POINTS */
- { 30171, 0x00000002 }, /* GL_POINT_BIT */
- { 30184, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
- { 30214, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
- { 30248, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
- { 30282, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
- { 30317, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
- { 30346, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
- { 30379, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
- { 30412, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
- { 30446, 0x00000B11 }, /* GL_POINT_SIZE */
- { 30460, 0x00008B9F }, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
- { 30499, 0x00008B9C }, /* GL_POINT_SIZE_ARRAY_OES */
- { 30523, 0x0000898C }, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
- { 30555, 0x0000898B }, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
- { 30586, 0x0000898A }, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
- { 30615, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
- { 30641, 0x00008127 }, /* GL_POINT_SIZE_MAX */
- { 30659, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
- { 30681, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
- { 30703, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
- { 30726, 0x00008126 }, /* GL_POINT_SIZE_MIN */
- { 30744, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
- { 30766, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
- { 30788, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
- { 30811, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
- { 30831, 0x00000B10 }, /* GL_POINT_SMOOTH */
- { 30847, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
- { 30868, 0x00008861 }, /* GL_POINT_SPRITE */
- { 30884, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
- { 30904, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
- { 30933, 0x00008861 }, /* GL_POINT_SPRITE_NV */
- { 30952, 0x00008861 }, /* GL_POINT_SPRITE_OES */
- { 30972, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
- { 30998, 0x00000701 }, /* GL_POINT_TOKEN */
- { 31013, 0x00000009 }, /* GL_POLYGON */
- { 31024, 0x00000008 }, /* GL_POLYGON_BIT */
- { 31039, 0x00000B40 }, /* GL_POLYGON_MODE */
- { 31055, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
- { 31078, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
- { 31103, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
- { 31126, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
- { 31149, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
- { 31173, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
- { 31197, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
- { 31215, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
- { 31238, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
- { 31257, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
- { 31280, 0x00000703 }, /* GL_POLYGON_TOKEN */
- { 31297, 0x00001203 }, /* GL_POSITION */
- { 31309, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- { 31341, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
- { 31377, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- { 31410, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
- { 31447, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- { 31478, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
- { 31513, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- { 31545, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
- { 31581, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- { 31614, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- { 31646, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
- { 31682, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- { 31715, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
- { 31752, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- { 31782, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
- { 31816, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- { 31847, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
- { 31882, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- { 31913, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
- { 31948, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- { 31980, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
- { 32016, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- { 32046, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
- { 32080, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- { 32111, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
- { 32146, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- { 32178, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- { 32209, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
- { 32244, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- { 32276, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
- { 32312, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
- { 32341, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
- { 32374, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
- { 32404, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
- { 32438, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- { 32477, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- { 32510, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- { 32550, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- { 32584, 0x00008578 }, /* GL_PREVIOUS */
- { 32596, 0x00008578 }, /* GL_PREVIOUS_ARB */
- { 32612, 0x00008578 }, /* GL_PREVIOUS_EXT */
- { 32628, 0x00008577 }, /* GL_PRIMARY_COLOR */
- { 32645, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
- { 32666, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
- { 32687, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED */
- { 32711, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED_EXT */
- { 32739, 0x00008F9D }, /* GL_PRIMITIVE_RESTART */
- { 32760, 0x00008F9E }, /* GL_PRIMITIVE_RESTART_INDEX */
- { 32787, 0x00008559 }, /* GL_PRIMITIVE_RESTART_INDEX_NV */
- { 32817, 0x00008558 }, /* GL_PRIMITIVE_RESTART_NV */
- { 32841, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- { 32874, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- { 32906, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
- { 32929, 0x000087FF }, /* GL_PROGRAM_BINARY_FORMATS */
- { 32955, 0x000087FF }, /* GL_PROGRAM_BINARY_FORMATS_OES */
- { 32985, 0x00008741 }, /* GL_PROGRAM_BINARY_LENGTH */
- { 33010, 0x00008741 }, /* GL_PROGRAM_BINARY_LENGTH_OES */
- { 33039, 0x00008257 }, /* GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
- { 33074, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
- { 33097, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
- { 33127, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
- { 33156, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
- { 33184, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
- { 33206, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- { 33234, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- { 33262, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
- { 33284, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
- { 33305, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- { 33345, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- { 33384, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- { 33414, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- { 33449, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- { 33482, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- { 33516, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- { 33555, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- { 33594, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
- { 33616, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
- { 33642, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
- { 33666, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE */
- { 33688, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE_ARB */
- { 33714, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
- { 33737, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
- { 33759, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
- { 33780, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
- { 33801, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
- { 33828, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- { 33860, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- { 33892, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- { 33927, 0x00001701 }, /* GL_PROJECTION */
- { 33941, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
- { 33962, 0x0000898E }, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
- { 34005, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
- { 34031, 0x00008E4F }, /* GL_PROVOKING_VERTEX */
- { 34051, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */
- { 34075, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
- { 34096, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
- { 34115, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
- { 34138, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
- { 34177, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- { 34215, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
- { 34235, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY */
- { 34261, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
- { 34291, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
- { 34315, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
- { 34335, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY */
- { 34361, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
- { 34391, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
- { 34415, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
- { 34435, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- { 34468, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
- { 34494, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
- { 34524, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE */
- { 34551, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
- { 34582, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
- { 34612, 0x00008A1D }, /* GL_PURGEABLE_APPLE */
- { 34631, 0x00002003 }, /* GL_Q */
- { 34636, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
- { 34661, 0x00000007 }, /* GL_QUADS */
- { 34670, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
- { 34714, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */
- { 34762, 0x00008614 }, /* GL_QUAD_MESH_SUN */
- { 34779, 0x00000008 }, /* GL_QUAD_STRIP */
- { 34793, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT */
- { 34820, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */
- { 34850, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT */
- { 34874, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */
- { 34901, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
- { 34923, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
- { 34949, 0x00008E14 }, /* GL_QUERY_NO_WAIT */
- { 34966, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */
- { 34986, 0x00008866 }, /* GL_QUERY_RESULT */
- { 35002, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
- { 35022, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
- { 35048, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
- { 35078, 0x00008E13 }, /* GL_QUERY_WAIT */
- { 35092, 0x00008E13 }, /* GL_QUERY_WAIT_NV */
- { 35109, 0x00002002 }, /* GL_R */
- { 35114, 0x00008C3A }, /* GL_R11F_G11F_B10F */
- { 35132, 0x00008F98 }, /* GL_R16_SNORM */
- { 35145, 0x00002A10 }, /* GL_R3_G3_B2 */
- { 35157, 0x00008F94 }, /* GL_R8_SNORM */
- { 35169, 0x00008C89 }, /* GL_RASTERIZER_DISCARD */
- { 35191, 0x00008C89 }, /* GL_RASTERIZER_DISCARD_EXT */
- { 35217, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- { 35250, 0x00000C02 }, /* GL_READ_BUFFER */
- { 35265, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */
- { 35285, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */
- { 35313, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
- { 35345, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
- { 35369, 0x000088B8 }, /* GL_READ_ONLY */
- { 35382, 0x000088B8 }, /* GL_READ_ONLY_ARB */
- { 35399, 0x000088BA }, /* GL_READ_WRITE */
- { 35413, 0x000088BA }, /* GL_READ_WRITE_ARB */
- { 35431, 0x00001903 }, /* GL_RED */
- { 35438, 0x00008016 }, /* GL_REDUCE */
- { 35448, 0x00008016 }, /* GL_REDUCE_EXT */
- { 35462, 0x00000D15 }, /* GL_RED_BIAS */
- { 35474, 0x00000D52 }, /* GL_RED_BITS */
- { 35486, 0x00008D94 }, /* GL_RED_INTEGER */
- { 35501, 0x00008D94 }, /* GL_RED_INTEGER_EXT */
- { 35520, 0x00000D14 }, /* GL_RED_SCALE */
- { 35533, 0x00008F90 }, /* GL_RED_SNORM */
- { 35546, 0x00008512 }, /* GL_REFLECTION_MAP */
- { 35564, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
- { 35586, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
- { 35607, 0x00008512 }, /* GL_REFLECTION_MAP_OES */
- { 35629, 0x00008A19 }, /* GL_RELEASED_APPLE */
- { 35647, 0x00001C00 }, /* GL_RENDER */
- { 35657, 0x00008D41 }, /* GL_RENDERBUFFER */
- { 35673, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */
- { 35700, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE_OES */
- { 35731, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */
- { 35755, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
- { 35783, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_OES */
- { 35811, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */
- { 35837, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE_OES */
- { 35867, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */
- { 35894, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE_OES */
- { 35925, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
- { 35945, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */
- { 35972, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE_OES */
- { 36003, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */
- { 36026, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
- { 36053, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_OES */
- { 36080, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
- { 36112, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
- { 36148, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
- { 36184, 0x00008D41 }, /* GL_RENDERBUFFER_OES */
- { 36204, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */
- { 36229, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE_OES */
- { 36258, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */
- { 36282, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */
- { 36310, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */
- { 36339, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE_OES */
- { 36372, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */
- { 36394, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
- { 36420, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_OES */
- { 36446, 0x00001F01 }, /* GL_RENDERER */
- { 36458, 0x00000C40 }, /* GL_RENDER_MODE */
- { 36473, 0x00002901 }, /* GL_REPEAT */
- { 36483, 0x00001E01 }, /* GL_REPLACE */
- { 36494, 0x00008062 }, /* GL_REPLACE_EXT */
- { 36509, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
- { 36532, 0x0000803A }, /* GL_RESCALE_NORMAL */
- { 36550, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
- { 36572, 0x00008256 }, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
- { 36607, 0x00008A1B }, /* GL_RETAINED_APPLE */
- { 36625, 0x00000102 }, /* GL_RETURN */
- { 36635, 0x00008F99 }, /* GL_RG16_SNORM */
- { 36649, 0x00008F95 }, /* GL_RG8_SNORM */
- { 36662, 0x00001907 }, /* GL_RGB */
- { 36669, 0x00008052 }, /* GL_RGB10 */
- { 36678, 0x00008059 }, /* GL_RGB10_A2 */
- { 36690, 0x00008059 }, /* GL_RGB10_A2_EXT */
- { 36706, 0x00008052 }, /* GL_RGB10_EXT */
- { 36719, 0x00008053 }, /* GL_RGB12 */
- { 36728, 0x00008053 }, /* GL_RGB12_EXT */
- { 36741, 0x00008054 }, /* GL_RGB16 */
- { 36750, 0x0000881B }, /* GL_RGB16F */
- { 36760, 0x00008D89 }, /* GL_RGB16I */
- { 36770, 0x00008D89 }, /* GL_RGB16I_EXT */
- { 36784, 0x00008D77 }, /* GL_RGB16UI */
- { 36795, 0x00008D77 }, /* GL_RGB16UI_EXT */
- { 36810, 0x00008054 }, /* GL_RGB16_EXT */
- { 36823, 0x00008F9A }, /* GL_RGB16_SNORM */
- { 36838, 0x0000804E }, /* GL_RGB2_EXT */
- { 36850, 0x00008815 }, /* GL_RGB32F */
- { 36860, 0x00008D83 }, /* GL_RGB32I */
- { 36870, 0x00008D83 }, /* GL_RGB32I_EXT */
- { 36884, 0x00008D71 }, /* GL_RGB32UI */
- { 36895, 0x00008D71 }, /* GL_RGB32UI_EXT */
- { 36910, 0x0000804F }, /* GL_RGB4 */
- { 36918, 0x0000804F }, /* GL_RGB4_EXT */
- { 36930, 0x000083A1 }, /* GL_RGB4_S3TC */
- { 36943, 0x00008050 }, /* GL_RGB5 */
- { 36951, 0x00008D62 }, /* GL_RGB565 */
- { 36961, 0x00008D62 }, /* GL_RGB565_OES */
- { 36975, 0x00008057 }, /* GL_RGB5_A1 */
- { 36986, 0x00008057 }, /* GL_RGB5_A1_EXT */
- { 37001, 0x00008057 }, /* GL_RGB5_A1_OES */
- { 37016, 0x00008050 }, /* GL_RGB5_EXT */
- { 37028, 0x00008051 }, /* GL_RGB8 */
- { 37036, 0x00008D8F }, /* GL_RGB8I */
- { 37045, 0x00008D8F }, /* GL_RGB8I_EXT */
- { 37058, 0x00008D7D }, /* GL_RGB8UI */
- { 37068, 0x00008D7D }, /* GL_RGB8UI_EXT */
- { 37082, 0x00008051 }, /* GL_RGB8_EXT */
- { 37094, 0x00008051 }, /* GL_RGB8_OES */
- { 37106, 0x00008F96 }, /* GL_RGB8_SNORM */
- { 37120, 0x00008C3D }, /* GL_RGB9_E5 */
- { 37131, 0x00001908 }, /* GL_RGBA */
- { 37139, 0x0000805A }, /* GL_RGBA12 */
- { 37149, 0x0000805A }, /* GL_RGBA12_EXT */
- { 37163, 0x0000805B }, /* GL_RGBA16 */
- { 37173, 0x0000881A }, /* GL_RGBA16F */
- { 37184, 0x00008D88 }, /* GL_RGBA16I */
- { 37195, 0x00008D88 }, /* GL_RGBA16I_EXT */
- { 37210, 0x00008D76 }, /* GL_RGBA16UI */
- { 37222, 0x00008D76 }, /* GL_RGBA16UI_EXT */
- { 37238, 0x0000805B }, /* GL_RGBA16_EXT */
- { 37252, 0x00008F9B }, /* GL_RGBA16_SNORM */
- { 37268, 0x00008055 }, /* GL_RGBA2 */
- { 37277, 0x00008055 }, /* GL_RGBA2_EXT */
- { 37290, 0x00008814 }, /* GL_RGBA32F */
- { 37301, 0x00008D82 }, /* GL_RGBA32I */
- { 37312, 0x00008D82 }, /* GL_RGBA32I_EXT */
- { 37327, 0x00008D70 }, /* GL_RGBA32UI */
- { 37339, 0x00008D70 }, /* GL_RGBA32UI_EXT */
- { 37355, 0x00008056 }, /* GL_RGBA4 */
- { 37364, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
- { 37383, 0x00008056 }, /* GL_RGBA4_EXT */
- { 37396, 0x00008056 }, /* GL_RGBA4_OES */
- { 37409, 0x000083A3 }, /* GL_RGBA4_S3TC */
- { 37423, 0x00008058 }, /* GL_RGBA8 */
- { 37432, 0x00008D8E }, /* GL_RGBA8I */
- { 37442, 0x00008D8E }, /* GL_RGBA8I_EXT */
- { 37456, 0x00008D7C }, /* GL_RGBA8UI */
- { 37467, 0x00008D7C }, /* GL_RGBA8UI_EXT */
- { 37482, 0x00008058 }, /* GL_RGBA8_EXT */
- { 37495, 0x00008058 }, /* GL_RGBA8_OES */
- { 37508, 0x00008F97 }, /* GL_RGBA8_SNORM */
- { 37523, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
- { 37541, 0x00008820 }, /* GL_RGBA_FLOAT_MODE_ARB */
- { 37564, 0x00008D99 }, /* GL_RGBA_INTEGER */
- { 37580, 0x00008D99 }, /* GL_RGBA_INTEGER_EXT */
- { 37600, 0x00008D9E }, /* GL_RGBA_INTEGER_MODE_EXT */
- { 37625, 0x00000C31 }, /* GL_RGBA_MODE */
- { 37638, 0x000083A2 }, /* GL_RGBA_S3TC */
- { 37651, 0x00008F93 }, /* GL_RGBA_SNORM */
- { 37665, 0x00008D98 }, /* GL_RGB_INTEGER */
- { 37680, 0x00008D98 }, /* GL_RGB_INTEGER_EXT */
- { 37699, 0x000083A0 }, /* GL_RGB_S3TC */
- { 37711, 0x00008573 }, /* GL_RGB_SCALE */
- { 37724, 0x00008573 }, /* GL_RGB_SCALE_ARB */
- { 37741, 0x00008573 }, /* GL_RGB_SCALE_EXT */
- { 37758, 0x00008F92 }, /* GL_RGB_SNORM */
- { 37771, 0x00008F91 }, /* GL_RG_SNORM */
- { 37783, 0x00000407 }, /* GL_RIGHT */
- { 37792, 0x00002000 }, /* GL_S */
- { 37797, 0x00008B5D }, /* GL_SAMPLER_1D */
- { 37811, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY */
- { 37831, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY_EXT */
- { 37855, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW */
- { 37882, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW_EXT */
- { 37913, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
- { 37934, 0x00008B5E }, /* GL_SAMPLER_2D */
- { 37948, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY */
- { 37968, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY_EXT */
- { 37992, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW */
- { 38019, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW_EXT */
- { 38050, 0x00008B63 }, /* GL_SAMPLER_2D_RECT */
- { 38069, 0x00008B64 }, /* GL_SAMPLER_2D_RECT_SHADOW */
- { 38095, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
- { 38116, 0x00008B5F }, /* GL_SAMPLER_3D */
- { 38130, 0x00008B5F }, /* GL_SAMPLER_3D_OES */
- { 38148, 0x00008919 }, /* GL_SAMPLER_BINDING */
- { 38167, 0x00008DC2 }, /* GL_SAMPLER_BUFFER */
- { 38185, 0x00008DC2 }, /* GL_SAMPLER_BUFFER_EXT */
- { 38207, 0x00008B60 }, /* GL_SAMPLER_CUBE */
- { 38223, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW */
- { 38246, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW_EXT */
- { 38273, 0x000080A9 }, /* GL_SAMPLES */
- { 38284, 0x000086B4 }, /* GL_SAMPLES_3DFX */
- { 38300, 0x000080A9 }, /* GL_SAMPLES_ARB */
- { 38315, 0x00008914 }, /* GL_SAMPLES_PASSED */
- { 38333, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
- { 38355, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- { 38383, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
- { 38415, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
- { 38438, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
- { 38465, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
- { 38483, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
- { 38506, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
- { 38528, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
- { 38547, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
- { 38570, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
- { 38596, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
- { 38626, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
- { 38651, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
- { 38680, 0x00080000 }, /* GL_SCISSOR_BIT */
- { 38695, 0x00000C10 }, /* GL_SCISSOR_BOX */
- { 38710, 0x00000C11 }, /* GL_SCISSOR_TEST */
- { 38726, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
- { 38751, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- { 38791, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
- { 38835, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- { 38868, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- { 38898, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- { 38930, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- { 38960, 0x00001C02 }, /* GL_SELECT */
- { 38970, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
- { 38998, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
- { 39023, 0x00008012 }, /* GL_SEPARABLE_2D */
- { 39039, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS */
- { 39059, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS_EXT */
- { 39083, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
- { 39110, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
- { 39141, 0x0000150F }, /* GL_SET */
- { 39148, 0x00008DF8 }, /* GL_SHADER_BINARY_FORMATS */
- { 39173, 0x00008DFA }, /* GL_SHADER_COMPILER */
- { 39192, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
- { 39213, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
- { 39237, 0x00008B4F }, /* GL_SHADER_TYPE */
- { 39252, 0x00000B54 }, /* GL_SHADE_MODEL */
- { 39267, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
- { 39295, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
- { 39318, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- { 39348, 0x00001601 }, /* GL_SHININESS */
- { 39361, 0x00001402 }, /* GL_SHORT */
- { 39370, 0x00009119 }, /* GL_SIGNALED */
- { 39382, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */
- { 39403, 0x000081F9 }, /* GL_SINGLE_COLOR */
- { 39419, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
- { 39439, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
- { 39458, 0x00008C46 }, /* GL_SLUMINANCE */
- { 39472, 0x00008C47 }, /* GL_SLUMINANCE8 */
- { 39487, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */
- { 39509, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */
- { 39529, 0x00001D01 }, /* GL_SMOOTH */
- { 39539, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
- { 39572, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
- { 39599, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
- { 39632, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
- { 39659, 0x00008588 }, /* GL_SOURCE0_ALPHA */
- { 39676, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
- { 39697, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
- { 39718, 0x00008580 }, /* GL_SOURCE0_RGB */
- { 39733, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
- { 39752, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
- { 39771, 0x00008589 }, /* GL_SOURCE1_ALPHA */
- { 39788, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
- { 39809, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
- { 39830, 0x00008581 }, /* GL_SOURCE1_RGB */
- { 39845, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
- { 39864, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
- { 39883, 0x0000858A }, /* GL_SOURCE2_ALPHA */
- { 39900, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
- { 39921, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
- { 39942, 0x00008582 }, /* GL_SOURCE2_RGB */
- { 39957, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
- { 39976, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
- { 39995, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
- { 40015, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
- { 40033, 0x00001202 }, /* GL_SPECULAR */
- { 40045, 0x00002402 }, /* GL_SPHERE_MAP */
- { 40059, 0x00001206 }, /* GL_SPOT_CUTOFF */
- { 40074, 0x00001204 }, /* GL_SPOT_DIRECTION */
- { 40092, 0x00001205 }, /* GL_SPOT_EXPONENT */
- { 40109, 0x00008588 }, /* GL_SRC0_ALPHA */
- { 40123, 0x00008580 }, /* GL_SRC0_RGB */
- { 40135, 0x00008589 }, /* GL_SRC1_ALPHA */
- { 40149, 0x00008581 }, /* GL_SRC1_RGB */
- { 40161, 0x0000858A }, /* GL_SRC2_ALPHA */
- { 40175, 0x00008582 }, /* GL_SRC2_RGB */
- { 40187, 0x00000302 }, /* GL_SRC_ALPHA */
- { 40200, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
- { 40222, 0x00000300 }, /* GL_SRC_COLOR */
- { 40235, 0x00008C40 }, /* GL_SRGB */
- { 40243, 0x00008C41 }, /* GL_SRGB8 */
- { 40252, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */
- { 40268, 0x00008C42 }, /* GL_SRGB_ALPHA */
- { 40282, 0x00000503 }, /* GL_STACK_OVERFLOW */
- { 40300, 0x00000504 }, /* GL_STACK_UNDERFLOW */
- { 40319, 0x000088E6 }, /* GL_STATIC_COPY */
- { 40334, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
- { 40353, 0x000088E4 }, /* GL_STATIC_DRAW */
- { 40368, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
- { 40387, 0x000088E5 }, /* GL_STATIC_READ */
- { 40402, 0x000088E5 }, /* GL_STATIC_READ_ARB */
- { 40421, 0x00001802 }, /* GL_STENCIL */
- { 40432, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */
- { 40454, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
- { 40480, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_OES */
- { 40506, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
- { 40527, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */
- { 40552, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
- { 40573, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */
- { 40598, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
- { 40630, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */
- { 40666, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
- { 40698, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */
- { 40734, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
- { 40754, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
- { 40781, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
- { 40807, 0x00000D57 }, /* GL_STENCIL_BITS */
- { 40823, 0x00008224 }, /* GL_STENCIL_BUFFER */
- { 40841, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
- { 40863, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
- { 40886, 0x00000B94 }, /* GL_STENCIL_FAIL */
- { 40902, 0x00000B92 }, /* GL_STENCIL_FUNC */
- { 40918, 0x00001901 }, /* GL_STENCIL_INDEX */
- { 40935, 0x00008D46 }, /* GL_STENCIL_INDEX1 */
- { 40953, 0x00008D49 }, /* GL_STENCIL_INDEX16 */
- { 40972, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
- { 40995, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
- { 41017, 0x00008D46 }, /* GL_STENCIL_INDEX1_OES */
- { 41039, 0x00008D47 }, /* GL_STENCIL_INDEX4 */
- { 41057, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
- { 41079, 0x00008D47 }, /* GL_STENCIL_INDEX4_OES */
- { 41101, 0x00008D48 }, /* GL_STENCIL_INDEX8 */
- { 41119, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
- { 41141, 0x00008D48 }, /* GL_STENCIL_INDEX8_OES */
- { 41163, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
- { 41184, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
- { 41211, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
- { 41238, 0x00000B97 }, /* GL_STENCIL_REF */
- { 41253, 0x00000B90 }, /* GL_STENCIL_TEST */
- { 41269, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
- { 41298, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
- { 41320, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
- { 41341, 0x00000C33 }, /* GL_STEREO */
- { 41351, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */
- { 41375, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */
- { 41400, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */
- { 41424, 0x000088E2 }, /* GL_STREAM_COPY */
- { 41439, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
- { 41458, 0x000088E0 }, /* GL_STREAM_DRAW */
- { 41473, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
- { 41492, 0x000088E1 }, /* GL_STREAM_READ */
- { 41507, 0x000088E1 }, /* GL_STREAM_READ_ARB */
- { 41526, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
- { 41543, 0x000084E7 }, /* GL_SUBTRACT */
- { 41555, 0x000084E7 }, /* GL_SUBTRACT_ARB */
- { 41571, 0x00009113 }, /* GL_SYNC_CONDITION */
- { 41589, 0x00009116 }, /* GL_SYNC_FENCE */
- { 41603, 0x00009115 }, /* GL_SYNC_FLAGS */
- { 41617, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */
- { 41644, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
- { 41674, 0x00009114 }, /* GL_SYNC_STATUS */
- { 41689, 0x00002001 }, /* GL_T */
- { 41694, 0x00002A2A }, /* GL_T2F_C3F_V3F */
- { 41709, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
- { 41728, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
- { 41744, 0x00002A2B }, /* GL_T2F_N3F_V3F */
- { 41759, 0x00002A27 }, /* GL_T2F_V3F */
- { 41770, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
- { 41789, 0x00002A28 }, /* GL_T4F_V4F */
- { 41800, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
- { 41823, 0x00001702 }, /* GL_TEXTURE */
- { 41834, 0x000084C0 }, /* GL_TEXTURE0 */
- { 41846, 0x000084C0 }, /* GL_TEXTURE0_ARB */
- { 41862, 0x000084C1 }, /* GL_TEXTURE1 */
- { 41874, 0x000084CA }, /* GL_TEXTURE10 */
- { 41887, 0x000084CA }, /* GL_TEXTURE10_ARB */
- { 41904, 0x000084CB }, /* GL_TEXTURE11 */
- { 41917, 0x000084CB }, /* GL_TEXTURE11_ARB */
- { 41934, 0x000084CC }, /* GL_TEXTURE12 */
- { 41947, 0x000084CC }, /* GL_TEXTURE12_ARB */
- { 41964, 0x000084CD }, /* GL_TEXTURE13 */
- { 41977, 0x000084CD }, /* GL_TEXTURE13_ARB */
- { 41994, 0x000084CE }, /* GL_TEXTURE14 */
- { 42007, 0x000084CE }, /* GL_TEXTURE14_ARB */
- { 42024, 0x000084CF }, /* GL_TEXTURE15 */
- { 42037, 0x000084CF }, /* GL_TEXTURE15_ARB */
- { 42054, 0x000084D0 }, /* GL_TEXTURE16 */
- { 42067, 0x000084D0 }, /* GL_TEXTURE16_ARB */
- { 42084, 0x000084D1 }, /* GL_TEXTURE17 */
- { 42097, 0x000084D1 }, /* GL_TEXTURE17_ARB */
- { 42114, 0x000084D2 }, /* GL_TEXTURE18 */
- { 42127, 0x000084D2 }, /* GL_TEXTURE18_ARB */
- { 42144, 0x000084D3 }, /* GL_TEXTURE19 */
- { 42157, 0x000084D3 }, /* GL_TEXTURE19_ARB */
- { 42174, 0x000084C1 }, /* GL_TEXTURE1_ARB */
- { 42190, 0x000084C2 }, /* GL_TEXTURE2 */
- { 42202, 0x000084D4 }, /* GL_TEXTURE20 */
- { 42215, 0x000084D4 }, /* GL_TEXTURE20_ARB */
- { 42232, 0x000084D5 }, /* GL_TEXTURE21 */
- { 42245, 0x000084D5 }, /* GL_TEXTURE21_ARB */
- { 42262, 0x000084D6 }, /* GL_TEXTURE22 */
- { 42275, 0x000084D6 }, /* GL_TEXTURE22_ARB */
- { 42292, 0x000084D7 }, /* GL_TEXTURE23 */
- { 42305, 0x000084D7 }, /* GL_TEXTURE23_ARB */
- { 42322, 0x000084D8 }, /* GL_TEXTURE24 */
- { 42335, 0x000084D8 }, /* GL_TEXTURE24_ARB */
- { 42352, 0x000084D9 }, /* GL_TEXTURE25 */
- { 42365, 0x000084D9 }, /* GL_TEXTURE25_ARB */
- { 42382, 0x000084DA }, /* GL_TEXTURE26 */
- { 42395, 0x000084DA }, /* GL_TEXTURE26_ARB */
- { 42412, 0x000084DB }, /* GL_TEXTURE27 */
- { 42425, 0x000084DB }, /* GL_TEXTURE27_ARB */
- { 42442, 0x000084DC }, /* GL_TEXTURE28 */
- { 42455, 0x000084DC }, /* GL_TEXTURE28_ARB */
- { 42472, 0x000084DD }, /* GL_TEXTURE29 */
- { 42485, 0x000084DD }, /* GL_TEXTURE29_ARB */
- { 42502, 0x000084C2 }, /* GL_TEXTURE2_ARB */
- { 42518, 0x000084C3 }, /* GL_TEXTURE3 */
- { 42530, 0x000084DE }, /* GL_TEXTURE30 */
- { 42543, 0x000084DE }, /* GL_TEXTURE30_ARB */
- { 42560, 0x000084DF }, /* GL_TEXTURE31 */
- { 42573, 0x000084DF }, /* GL_TEXTURE31_ARB */
- { 42590, 0x000084C3 }, /* GL_TEXTURE3_ARB */
- { 42606, 0x000084C4 }, /* GL_TEXTURE4 */
- { 42618, 0x000084C4 }, /* GL_TEXTURE4_ARB */
- { 42634, 0x000084C5 }, /* GL_TEXTURE5 */
- { 42646, 0x000084C5 }, /* GL_TEXTURE5_ARB */
- { 42662, 0x000084C6 }, /* GL_TEXTURE6 */
- { 42674, 0x000084C6 }, /* GL_TEXTURE6_ARB */
- { 42690, 0x000084C7 }, /* GL_TEXTURE7 */
- { 42702, 0x000084C7 }, /* GL_TEXTURE7_ARB */
- { 42718, 0x000084C8 }, /* GL_TEXTURE8 */
- { 42730, 0x000084C8 }, /* GL_TEXTURE8_ARB */
- { 42746, 0x000084C9 }, /* GL_TEXTURE9 */
- { 42758, 0x000084C9 }, /* GL_TEXTURE9_ARB */
- { 42774, 0x00000DE0 }, /* GL_TEXTURE_1D */
- { 42788, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY */
- { 42808, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */
- { 42832, 0x00000DE1 }, /* GL_TEXTURE_2D */
- { 42846, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY */
- { 42866, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */
- { 42890, 0x0000806F }, /* GL_TEXTURE_3D */
- { 42904, 0x0000806F }, /* GL_TEXTURE_3D_OES */
- { 42922, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
- { 42944, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
- { 42970, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
- { 42992, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
- { 43014, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY */
- { 43042, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
- { 43074, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
- { 43096, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY */
- { 43124, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
- { 43156, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
- { 43178, 0x0000806A }, /* GL_TEXTURE_BINDING_3D_OES */
- { 43204, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER */
- { 43230, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER_ARB */
- { 43260, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
- { 43288, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
- { 43320, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_OES */
- { 43352, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE */
- { 43381, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
- { 43414, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
- { 43446, 0x00040000 }, /* GL_TEXTURE_BIT */
- { 43461, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
- { 43482, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
- { 43507, 0x00001005 }, /* GL_TEXTURE_BORDER */
- { 43525, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
- { 43549, 0x00008C2A }, /* GL_TEXTURE_BUFFER */
- { 43567, 0x00008C2A }, /* GL_TEXTURE_BUFFER_ARB */
- { 43589, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
- { 43626, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB */
- { 43667, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT */
- { 43692, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT_ARB */
- { 43721, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- { 43752, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- { 43782, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- { 43812, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- { 43847, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- { 43878, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- { 43916, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
- { 43943, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- { 43975, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
- { 44009, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
- { 44033, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
- { 44061, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
- { 44085, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
- { 44113, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- { 44146, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
- { 44170, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
- { 44192, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
- { 44214, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
- { 44240, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
- { 44274, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- { 44307, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
- { 44344, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
- { 44372, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
- { 44404, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
- { 44427, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- { 44465, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
- { 44507, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- { 44538, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- { 44566, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- { 44596, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- { 44624, 0x00008B9D }, /* GL_TEXTURE_CROP_RECT_OES */
- { 44649, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
- { 44669, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
- { 44693, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- { 44724, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
- { 44759, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES */
- { 44794, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- { 44825, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
- { 44860, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES */
- { 44895, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- { 44926, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
- { 44961, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES */
- { 44996, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_OES */
- { 45020, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- { 45051, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
- { 45086, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES */
- { 45121, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- { 45152, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
- { 45187, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES */
- { 45222, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- { 45253, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
- { 45288, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES */
- { 45323, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
- { 45352, 0x00008071 }, /* GL_TEXTURE_DEPTH */
- { 45369, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
- { 45391, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
- { 45417, 0x00002300 }, /* GL_TEXTURE_ENV */
- { 45432, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
- { 45453, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
- { 45473, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
- { 45499, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL_EXT */
- { 45529, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
- { 45549, 0x00002500 }, /* GL_TEXTURE_GEN_MODE_OES */
- { 45573, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
- { 45590, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
- { 45607, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
- { 45624, 0x00008D60 }, /* GL_TEXTURE_GEN_STR_OES */
- { 45647, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
- { 45664, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
- { 45689, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
- { 45711, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
- { 45737, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
- { 45755, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
- { 45781, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
- { 45807, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
- { 45837, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
- { 45864, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
- { 45889, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
- { 45909, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
- { 45933, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- { 45960, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- { 45987, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- { 46014, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
- { 46040, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
- { 46070, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
- { 46092, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
- { 46110, 0x0000898F }, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
- { 46150, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- { 46180, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- { 46208, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- { 46236, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- { 46264, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
- { 46285, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
- { 46304, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
- { 46326, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
- { 46345, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
- { 46365, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
- { 46395, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */
- { 46426, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE */
- { 46447, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
- { 46472, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
- { 46496, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
- { 46516, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
- { 46540, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
- { 46560, 0x00008C3F }, /* GL_TEXTURE_SHARED_SIZE */
- { 46583, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
- { 46606, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */
- { 46630, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */
- { 46658, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */
- { 46688, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
- { 46713, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
- { 46747, 0x00001000 }, /* GL_TEXTURE_WIDTH */
- { 46764, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
- { 46782, 0x00008072 }, /* GL_TEXTURE_WRAP_R_OES */
- { 46804, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
- { 46822, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
- { 46840, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */
- { 46859, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
- { 46879, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
- { 46898, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- { 46927, 0x00001000 }, /* GL_TRANSFORM_BIT */
- { 46944, 0x00008E22 }, /* GL_TRANSFORM_FEEDBACK */
- { 46966, 0x00008E25 }, /* GL_TRANSFORM_FEEDBACK_BINDING */
- { 46996, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER */
- { 47025, 0x00008E24 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
- { 47061, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
- { 47098, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT */
- { 47139, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER_EXT */
- { 47172, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
- { 47206, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT */
- { 47244, 0x00008E23 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
- { 47280, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
- { 47314, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT */
- { 47352, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
- { 47387, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT */
- { 47426, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
- { 47467, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT */
- { 47512, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
- { 47543, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS_EXT */
- { 47578, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
- { 47619, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT */
- { 47664, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
- { 47690, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
- { 47720, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- { 47752, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- { 47782, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
- { 47816, 0x0000862C }, /* GL_TRANSPOSE_NV */
- { 47832, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- { 47863, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
- { 47898, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- { 47926, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
- { 47958, 0x00000004 }, /* GL_TRIANGLES */
- { 47971, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY */
- { 47994, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY_ARB */
- { 48021, 0x00000006 }, /* GL_TRIANGLE_FAN */
- { 48037, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
- { 48058, 0x00000005 }, /* GL_TRIANGLE_STRIP */
- { 48076, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY */
- { 48104, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY_ARB */
- { 48136, 0x00000001 }, /* GL_TRUE */
- { 48144, 0x00008A1C }, /* GL_UNDEFINED_APPLE */
- { 48163, 0x00008255 }, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
- { 48192, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
- { 48212, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
- { 48235, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
- { 48255, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
- { 48276, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
- { 48298, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
- { 48320, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
- { 48340, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
- { 48361, 0x00009118 }, /* GL_UNSIGNALED */
- { 48375, 0x00001401 }, /* GL_UNSIGNED_BYTE */
- { 48392, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- { 48419, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
- { 48442, 0x00001405 }, /* GL_UNSIGNED_INT */
- { 48458, 0x00008C3B }, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
- { 48490, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
- { 48517, 0x00008DF6 }, /* GL_UNSIGNED_INT_10_10_10_2_OES */
- { 48548, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */
- { 48569, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */
- { 48594, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
- { 48618, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_OES */
- { 48643, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- { 48674, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV_EXT */
- { 48709, 0x00008C3E }, /* GL_UNSIGNED_INT_5_9_9_9_REV */
- { 48737, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
- { 48761, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- { 48789, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D */
- { 48816, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
- { 48849, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT */
- { 48886, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D_EXT */
- { 48917, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D */
- { 48944, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
- { 48977, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT */
- { 49014, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D_EXT */
- { 49045, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
- { 49077, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT */
- { 49113, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D */
- { 49140, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D_EXT */
- { 49171, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
- { 49202, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT */
- { 49237, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
- { 49266, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE_EXT */
- { 49299, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2 */
- { 49320, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2_EXT */
- { 49345, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3 */
- { 49366, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3_EXT */
- { 49391, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4 */
- { 49412, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4_EXT */
- { 49437, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */
- { 49460, 0x00001403 }, /* GL_UNSIGNED_SHORT */
- { 49478, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- { 49508, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT */
- { 49542, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- { 49568, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- { 49598, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT */
- { 49632, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- { 49658, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
- { 49682, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- { 49710, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- { 49738, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
- { 49765, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- { 49797, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
- { 49828, 0x00008CA2 }, /* GL_UPPER_LEFT */
- { 49842, 0x00002A20 }, /* GL_V2F */
- { 49849, 0x00002A21 }, /* GL_V3F */
- { 49856, 0x00008B83 }, /* GL_VALIDATE_STATUS */
- { 49875, 0x00001F00 }, /* GL_VENDOR */
- { 49885, 0x00001F02 }, /* GL_VERSION */
- { 49896, 0x00008074 }, /* GL_VERTEX_ARRAY */
- { 49912, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */
- { 49936, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- { 49966, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- { 49997, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
- { 50032, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
- { 50056, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
- { 50077, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
- { 50100, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
- { 50121, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- { 50148, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- { 50176, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- { 50204, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- { 50232, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- { 50260, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- { 50288, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- { 50316, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- { 50343, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- { 50370, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- { 50397, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- { 50424, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- { 50451, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- { 50478, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- { 50505, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- { 50532, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- { 50559, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- { 50597, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
- { 50639, 0x000088FE }, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
- { 50674, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- { 50705, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- { 50740, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
- { 50771, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT */
- { 50806, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
- { 50840, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- { 50878, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
- { 50909, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- { 50944, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- { 50972, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- { 51004, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- { 51034, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- { 51068, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
- { 51096, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- { 51128, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
- { 51148, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
- { 51170, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
- { 51199, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
- { 51220, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
- { 51249, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- { 51282, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- { 51314, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
- { 51341, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- { 51372, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- { 51402, 0x00008B31 }, /* GL_VERTEX_SHADER */
- { 51419, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
- { 51440, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
- { 51467, 0x00000BA2 }, /* GL_VIEWPORT */
- { 51479, 0x00000800 }, /* GL_VIEWPORT_BIT */
- { 51495, 0x00008A1A }, /* GL_VOLATILE_APPLE */
- { 51513, 0x0000911D }, /* GL_WAIT_FAILED */
- { 51528, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
- { 51548, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- { 51579, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
- { 51614, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_OES */
- { 51649, 0x000086AD }, /* GL_WEIGHT_ARRAY_OES */
- { 51669, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- { 51697, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_OES */
- { 51725, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- { 51750, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_OES */
- { 51775, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- { 51802, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_OES */
- { 51829, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- { 51854, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_OES */
- { 51879, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
- { 51903, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
- { 51922, 0x000088B9 }, /* GL_WRITE_ONLY */
- { 51936, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
- { 51954, 0x000088B9 }, /* GL_WRITE_ONLY_OES */
- { 51972, 0x00001506 }, /* GL_XOR */
- { 51979, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
- { 51998, 0x00008757 }, /* GL_YCBCR_MESA */
- { 52012, 0x00000000 }, /* GL_ZERO */
- { 52020, 0x00000D16 }, /* GL_ZOOM_X */
- { 52030, 0x00000D17 }, /* GL_ZOOM_Y */
+ { 9439, 0x00008825 }, /* GL_DRAW_BUFFER0_NV */
+ { 9458, 0x00008826 }, /* GL_DRAW_BUFFER1 */
+ { 9474, 0x0000882F }, /* GL_DRAW_BUFFER10 */
+ { 9491, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */
+ { 9512, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */
+ { 9533, 0x0000882F }, /* GL_DRAW_BUFFER10_NV */
+ { 9553, 0x00008830 }, /* GL_DRAW_BUFFER11 */
+ { 9570, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */
+ { 9591, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */
+ { 9612, 0x00008830 }, /* GL_DRAW_BUFFER11_NV */
+ { 9632, 0x00008831 }, /* GL_DRAW_BUFFER12 */
+ { 9649, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */
+ { 9670, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */
+ { 9691, 0x00008831 }, /* GL_DRAW_BUFFER12_NV */
+ { 9711, 0x00008832 }, /* GL_DRAW_BUFFER13 */
+ { 9728, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */
+ { 9749, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */
+ { 9770, 0x00008832 }, /* GL_DRAW_BUFFER13_NV */
+ { 9790, 0x00008833 }, /* GL_DRAW_BUFFER14 */
+ { 9807, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */
+ { 9828, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */
+ { 9849, 0x00008833 }, /* GL_DRAW_BUFFER14_NV */
+ { 9869, 0x00008834 }, /* GL_DRAW_BUFFER15 */
+ { 9886, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */
+ { 9907, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */
+ { 9928, 0x00008834 }, /* GL_DRAW_BUFFER15_NV */
+ { 9948, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */
+ { 9968, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */
+ { 9988, 0x00008826 }, /* GL_DRAW_BUFFER1_NV */
+ { 10007, 0x00008827 }, /* GL_DRAW_BUFFER2 */
+ { 10023, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */
+ { 10043, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */
+ { 10063, 0x00008827 }, /* GL_DRAW_BUFFER2_NV */
+ { 10082, 0x00008828 }, /* GL_DRAW_BUFFER3 */
+ { 10098, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */
+ { 10118, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */
+ { 10138, 0x00008828 }, /* GL_DRAW_BUFFER3_NV */
+ { 10157, 0x00008829 }, /* GL_DRAW_BUFFER4 */
+ { 10173, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */
+ { 10193, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */
+ { 10213, 0x00008829 }, /* GL_DRAW_BUFFER4_NV */
+ { 10232, 0x0000882A }, /* GL_DRAW_BUFFER5 */
+ { 10248, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */
+ { 10268, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */
+ { 10288, 0x0000882A }, /* GL_DRAW_BUFFER5_NV */
+ { 10307, 0x0000882B }, /* GL_DRAW_BUFFER6 */
+ { 10323, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */
+ { 10343, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */
+ { 10363, 0x0000882B }, /* GL_DRAW_BUFFER6_NV */
+ { 10382, 0x0000882C }, /* GL_DRAW_BUFFER7 */
+ { 10398, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */
+ { 10418, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */
+ { 10438, 0x0000882C }, /* GL_DRAW_BUFFER7_NV */
+ { 10457, 0x0000882D }, /* GL_DRAW_BUFFER8 */
+ { 10473, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */
+ { 10493, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */
+ { 10513, 0x0000882D }, /* GL_DRAW_BUFFER8_NV */
+ { 10532, 0x0000882E }, /* GL_DRAW_BUFFER9 */
+ { 10548, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */
+ { 10568, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */
+ { 10588, 0x0000882E }, /* GL_DRAW_BUFFER9_NV */
+ { 10607, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */
+ { 10627, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING */
+ { 10655, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */
+ { 10687, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */
+ { 10711, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */
+ { 10731, 0x00000304 }, /* GL_DST_ALPHA */
+ { 10744, 0x00000306 }, /* GL_DST_COLOR */
+ { 10757, 0x0000877A }, /* GL_DU8DV8_ATI */
+ { 10771, 0x00008779 }, /* GL_DUDV_ATI */
+ { 10783, 0x000088EA }, /* GL_DYNAMIC_COPY */
+ { 10799, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */
+ { 10819, 0x000088E8 }, /* GL_DYNAMIC_DRAW */
+ { 10835, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */
+ { 10855, 0x000088E9 }, /* GL_DYNAMIC_READ */
+ { 10871, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */
+ { 10891, 0x00000B43 }, /* GL_EDGE_FLAG */
+ { 10904, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */
+ { 10923, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ { 10957, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */
+ { 10995, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ { 11022, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ { 11048, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */
+ { 11072, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ { 11104, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */
+ { 11140, 0x00001600 }, /* GL_EMISSION */
+ { 11152, 0x00002000 }, /* GL_ENABLE_BIT */
+ { 11166, 0x00000202 }, /* GL_EQUAL */
+ { 11175, 0x00001509 }, /* GL_EQUIV */
+ { 11184, 0x00010000 }, /* GL_EVAL_BIT */
+ { 11196, 0x00000800 }, /* GL_EXP */
+ { 11203, 0x00000801 }, /* GL_EXP2 */
+ { 11211, 0x00001F03 }, /* GL_EXTENSIONS */
+ { 11225, 0x00002400 }, /* GL_EYE_LINEAR */
+ { 11239, 0x00002502 }, /* GL_EYE_PLANE */
+ { 11252, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ { 11277, 0x0000855B }, /* GL_EYE_RADIAL_NV */
+ { 11294, 0x00000000 }, /* GL_FALSE */
+ { 11303, 0x00001101 }, /* GL_FASTEST */
+ { 11314, 0x00001C01 }, /* GL_FEEDBACK */
+ { 11326, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */
+ { 11353, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */
+ { 11377, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */
+ { 11401, 0x00001B02 }, /* GL_FILL */
+ { 11409, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */
+ { 11436, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */
+ { 11467, 0x0000140C }, /* GL_FIXED */
+ { 11476, 0x0000140C }, /* GL_FIXED_OES */
+ { 11489, 0x0000891D }, /* GL_FIXED_ONLY */
+ { 11503, 0x0000891D }, /* GL_FIXED_ONLY_ARB */
+ { 11521, 0x00001D00 }, /* GL_FLAT */
+ { 11529, 0x00001406 }, /* GL_FLOAT */
+ { 11538, 0x00008B5A }, /* GL_FLOAT_MAT2 */
+ { 11552, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */
+ { 11570, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */
+ { 11586, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */
+ { 11602, 0x00008B5B }, /* GL_FLOAT_MAT3 */
+ { 11616, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */
+ { 11634, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */
+ { 11650, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */
+ { 11666, 0x00008B5C }, /* GL_FLOAT_MAT4 */
+ { 11680, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */
+ { 11698, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */
+ { 11714, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */
+ { 11730, 0x00008B50 }, /* GL_FLOAT_VEC2 */
+ { 11744, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */
+ { 11762, 0x00008B51 }, /* GL_FLOAT_VEC3 */
+ { 11776, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */
+ { 11794, 0x00008B52 }, /* GL_FLOAT_VEC4 */
+ { 11808, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */
+ { 11826, 0x00000B60 }, /* GL_FOG */
+ { 11833, 0x00000080 }, /* GL_FOG_BIT */
+ { 11844, 0x00000B66 }, /* GL_FOG_COLOR */
+ { 11857, 0x00008451 }, /* GL_FOG_COORD */
+ { 11870, 0x00008451 }, /* GL_FOG_COORDINATE */
+ { 11888, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */
+ { 11912, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ { 11951, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */
+ { 11994, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ { 12026, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ { 12057, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ { 12086, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */
+ { 12111, 0x00008457 }, /* GL_FOG_COORD_ARRAY */
+ { 12130, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */
+ { 12164, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */
+ { 12191, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */
+ { 12217, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */
+ { 12241, 0x00008450 }, /* GL_FOG_COORD_SRC */
+ { 12258, 0x00000B62 }, /* GL_FOG_DENSITY */
+ { 12273, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */
+ { 12297, 0x00000B64 }, /* GL_FOG_END */
+ { 12308, 0x00000C54 }, /* GL_FOG_HINT */
+ { 12320, 0x00000B61 }, /* GL_FOG_INDEX */
+ { 12333, 0x00000B65 }, /* GL_FOG_MODE */
+ { 12345, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */
+ { 12364, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */
+ { 12389, 0x00000B63 }, /* GL_FOG_START */
+ { 12402, 0x00008452 }, /* GL_FRAGMENT_DEPTH */
+ { 12420, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */
+ { 12444, 0x00008B30 }, /* GL_FRAGMENT_SHADER */
+ { 12463, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */
+ { 12486, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ { 12521, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES */
+ { 12560, 0x00008D40 }, /* GL_FRAMEBUFFER */
+ { 12575, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+ { 12612, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+ { 12648, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+ { 12689, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+ { 12730, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+ { 12767, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+ { 12804, 0x00008DA7 }, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED */
+ { 12838, 0x00008DA7 }, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB */
+ { 12876, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+ { 12914, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */
+ { 12956, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES */
+ { 12998, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+ { 13036, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */
+ { 13078, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES */
+ { 13120, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+ { 13155, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+ { 13194, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */
+ { 13243, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES */
+ { 13292, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+ { 13340, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */
+ { 13392, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES */
+ { 13444, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+ { 13484, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+ { 13528, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+ { 13568, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */
+ { 13612, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES */
+ { 13656, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING */
+ { 13679, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */
+ { 13706, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_OES */
+ { 13733, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */
+ { 13757, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */
+ { 13785, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_OES */
+ { 13813, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */
+ { 13836, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */
+ { 13855, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+ { 13892, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */
+ { 13933, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES */
+ { 13974, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS */
+ { 14011, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ { 14052, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES */
+ { 14093, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
+ { 14131, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */
+ { 14173, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES */
+ { 14215, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ { 14266, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ { 14304, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES */
+ { 14342, 0x00008DA9 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB */
+ { 14384, 0x00008DA8 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS */
+ { 14424, 0x00008DA8 }, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB */
+ { 14468, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+ { 14513, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */
+ { 14562, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES */
+ { 14611, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+ { 14649, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT */
+ { 14691, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
+ { 14729, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */
+ { 14771, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES */
+ { 14813, 0x00008D40 }, /* GL_FRAMEBUFFER_OES */
+ { 14832, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ { 14864, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */
+ { 14889, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */
+ { 14916, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */
+ { 14947, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_OES */
+ { 14978, 0x00000404 }, /* GL_FRONT */
+ { 14987, 0x00000408 }, /* GL_FRONT_AND_BACK */
+ { 15005, 0x00000B46 }, /* GL_FRONT_FACE */
+ { 15019, 0x00000400 }, /* GL_FRONT_LEFT */
+ { 15033, 0x00000401 }, /* GL_FRONT_RIGHT */
+ { 15048, 0x00008006 }, /* GL_FUNC_ADD */
+ { 15060, 0x00008006 }, /* GL_FUNC_ADD_EXT */
+ { 15076, 0x00008006 }, /* GL_FUNC_ADD_OES */
+ { 15092, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */
+ { 15117, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */
+ { 15146, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_OES */
+ { 15175, 0x0000800A }, /* GL_FUNC_SUBTRACT */
+ { 15192, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */
+ { 15213, 0x0000800A }, /* GL_FUNC_SUBTRACT_OES */
+ { 15234, 0x00008191 }, /* GL_GENERATE_MIPMAP */
+ { 15253, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */
+ { 15277, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */
+ { 15306, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */
+ { 15330, 0x00008917 }, /* GL_GEOMETRY_INPUT_TYPE */
+ { 15353, 0x00008DDB }, /* GL_GEOMETRY_INPUT_TYPE_ARB */
+ { 15380, 0x00008918 }, /* GL_GEOMETRY_OUTPUT_TYPE */
+ { 15404, 0x00008DDC }, /* GL_GEOMETRY_OUTPUT_TYPE_ARB */
+ { 15432, 0x00008DD9 }, /* GL_GEOMETRY_SHADER */
+ { 15451, 0x00008DD9 }, /* GL_GEOMETRY_SHADER_ARB */
+ { 15474, 0x00008916 }, /* GL_GEOMETRY_VERTICES_OUT */
+ { 15499, 0x00008DDA }, /* GL_GEOMETRY_VERTICES_OUT_ARB */
+ { 15528, 0x00000206 }, /* GL_GEQUAL */
+ { 15538, 0x00000204 }, /* GL_GREATER */
+ { 15549, 0x00001904 }, /* GL_GREEN */
+ { 15558, 0x00000D19 }, /* GL_GREEN_BIAS */
+ { 15572, 0x00000D53 }, /* GL_GREEN_BITS */
+ { 15586, 0x00008D95 }, /* GL_GREEN_INTEGER */
+ { 15603, 0x00008D95 }, /* GL_GREEN_INTEGER_EXT */
+ { 15624, 0x00000D18 }, /* GL_GREEN_SCALE */
+ { 15639, 0x00008253 }, /* GL_GUILTY_CONTEXT_RESET_ARB */
+ { 15667, 0x0000140B }, /* GL_HALF_FLOAT */
+ { 15681, 0x00008D61 }, /* GL_HALF_FLOAT_OES */
+ { 15699, 0x00008DF2 }, /* GL_HIGH_FLOAT */
+ { 15713, 0x00008DF5 }, /* GL_HIGH_INT */
+ { 15725, 0x00008000 }, /* GL_HINT_BIT */
+ { 15737, 0x00008024 }, /* GL_HISTOGRAM */
+ { 15750, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */
+ { 15774, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */
+ { 15802, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */
+ { 15825, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */
+ { 15852, 0x00008024 }, /* GL_HISTOGRAM_EXT */
+ { 15869, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */
+ { 15889, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */
+ { 15913, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */
+ { 15937, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */
+ { 15965, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ { 15993, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */
+ { 16025, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */
+ { 16047, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */
+ { 16073, 0x0000802D }, /* GL_HISTOGRAM_SINK */
+ { 16091, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */
+ { 16113, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */
+ { 16132, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */
+ { 16155, 0x0000862A }, /* GL_IDENTITY_NV */
+ { 16170, 0x00008150 }, /* GL_IGNORE_BORDER_HP */
+ { 16190, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */
+ { 16226, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
+ { 16266, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */
+ { 16300, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
+ { 16338, 0x00001E02 }, /* GL_INCR */
+ { 16346, 0x00008507 }, /* GL_INCR_WRAP */
+ { 16359, 0x00008507 }, /* GL_INCR_WRAP_EXT */
+ { 16376, 0x00008222 }, /* GL_INDEX */
+ { 16385, 0x00008077 }, /* GL_INDEX_ARRAY */
+ { 16400, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ { 16430, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */
+ { 16464, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */
+ { 16487, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */
+ { 16509, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */
+ { 16529, 0x00000D51 }, /* GL_INDEX_BITS */
+ { 16543, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */
+ { 16564, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */
+ { 16582, 0x00000C30 }, /* GL_INDEX_MODE */
+ { 16596, 0x00000D13 }, /* GL_INDEX_OFFSET */
+ { 16612, 0x00000D12 }, /* GL_INDEX_SHIFT */
+ { 16627, 0x00000C21 }, /* GL_INDEX_WRITEMASK */
+ { 16646, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */
+ { 16665, 0x00008254 }, /* GL_INNOCENT_CONTEXT_RESET_ARB */
+ { 16695, 0x00001404 }, /* GL_INT */
+ { 16702, 0x00008049 }, /* GL_INTENSITY */
+ { 16715, 0x0000804C }, /* GL_INTENSITY12 */
+ { 16730, 0x0000804C }, /* GL_INTENSITY12_EXT */
+ { 16749, 0x0000804D }, /* GL_INTENSITY16 */
+ { 16764, 0x00008D8B }, /* GL_INTENSITY16I_EXT */
+ { 16784, 0x00008D79 }, /* GL_INTENSITY16UI_EXT */
+ { 16805, 0x0000804D }, /* GL_INTENSITY16_EXT */
+ { 16824, 0x00008D85 }, /* GL_INTENSITY32I_EXT */
+ { 16844, 0x00008D73 }, /* GL_INTENSITY32UI_EXT */
+ { 16865, 0x0000804A }, /* GL_INTENSITY4 */
+ { 16879, 0x0000804A }, /* GL_INTENSITY4_EXT */
+ { 16897, 0x0000804B }, /* GL_INTENSITY8 */
+ { 16911, 0x00008D91 }, /* GL_INTENSITY8I_EXT */
+ { 16930, 0x00008D7F }, /* GL_INTENSITY8UI_EXT */
+ { 16950, 0x0000804B }, /* GL_INTENSITY8_EXT */
+ { 16968, 0x00008049 }, /* GL_INTENSITY_EXT */
+ { 16985, 0x00008C8C }, /* GL_INTERLEAVED_ATTRIBS */
+ { 17008, 0x00008C8C }, /* GL_INTERLEAVED_ATTRIBS_EXT */
+ { 17035, 0x00008575 }, /* GL_INTERPOLATE */
+ { 17050, 0x00008575 }, /* GL_INTERPOLATE_ARB */
+ { 17069, 0x00008575 }, /* GL_INTERPOLATE_EXT */
+ { 17088, 0x00008DF7 }, /* GL_INT_10_10_10_2_OES */
+ { 17110, 0x00008D9F }, /* GL_INT_2_10_10_10_REV */
+ { 17132, 0x00008DC9 }, /* GL_INT_SAMPLER_1D */
+ { 17150, 0x00008DCE }, /* GL_INT_SAMPLER_1D_ARRAY */
+ { 17174, 0x00008DCE }, /* GL_INT_SAMPLER_1D_ARRAY_EXT */
+ { 17202, 0x00008DC9 }, /* GL_INT_SAMPLER_1D_EXT */
+ { 17224, 0x00008DCA }, /* GL_INT_SAMPLER_2D */
+ { 17242, 0x00008DCF }, /* GL_INT_SAMPLER_2D_ARRAY */
+ { 17266, 0x00008DCF }, /* GL_INT_SAMPLER_2D_ARRAY_EXT */
+ { 17294, 0x00008DCA }, /* GL_INT_SAMPLER_2D_EXT */
+ { 17316, 0x00008DCD }, /* GL_INT_SAMPLER_2D_RECT */
+ { 17339, 0x00008DCD }, /* GL_INT_SAMPLER_2D_RECT_EXT */
+ { 17366, 0x00008DCB }, /* GL_INT_SAMPLER_3D */
+ { 17384, 0x00008DCB }, /* GL_INT_SAMPLER_3D_EXT */
+ { 17406, 0x00008DD0 }, /* GL_INT_SAMPLER_BUFFER */
+ { 17428, 0x00008DD0 }, /* GL_INT_SAMPLER_BUFFER_EXT */
+ { 17454, 0x00008DCC }, /* GL_INT_SAMPLER_CUBE */
+ { 17474, 0x00008DCC }, /* GL_INT_SAMPLER_CUBE_EXT */
+ { 17498, 0x00008B53 }, /* GL_INT_VEC2 */
+ { 17510, 0x00008B53 }, /* GL_INT_VEC2_ARB */
+ { 17526, 0x00008B54 }, /* GL_INT_VEC3 */
+ { 17538, 0x00008B54 }, /* GL_INT_VEC3_ARB */
+ { 17554, 0x00008B55 }, /* GL_INT_VEC4 */
+ { 17566, 0x00008B55 }, /* GL_INT_VEC4_ARB */
+ { 17582, 0x00000500 }, /* GL_INVALID_ENUM */
+ { 17598, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */
+ { 17631, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */
+ { 17668, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_OES */
+ { 17705, 0x00000502 }, /* GL_INVALID_OPERATION */
+ { 17726, 0x00000501 }, /* GL_INVALID_VALUE */
+ { 17743, 0x0000862B }, /* GL_INVERSE_NV */
+ { 17757, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */
+ { 17781, 0x0000150A }, /* GL_INVERT */
+ { 17791, 0x00001E00 }, /* GL_KEEP */
+ { 17799, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */
+ { 17825, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */
+ { 17855, 0x00000406 }, /* GL_LEFT */
+ { 17863, 0x00000203 }, /* GL_LEQUAL */
+ { 17873, 0x00000201 }, /* GL_LESS */
+ { 17881, 0x00004000 }, /* GL_LIGHT0 */
+ { 17891, 0x00004001 }, /* GL_LIGHT1 */
+ { 17901, 0x00004002 }, /* GL_LIGHT2 */
+ { 17911, 0x00004003 }, /* GL_LIGHT3 */
+ { 17921, 0x00004004 }, /* GL_LIGHT4 */
+ { 17931, 0x00004005 }, /* GL_LIGHT5 */
+ { 17941, 0x00004006 }, /* GL_LIGHT6 */
+ { 17951, 0x00004007 }, /* GL_LIGHT7 */
+ { 17961, 0x00000B50 }, /* GL_LIGHTING */
+ { 17973, 0x00000040 }, /* GL_LIGHTING_BIT */
+ { 17989, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */
+ { 18012, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ { 18041, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */
+ { 18074, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ { 18102, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */
+ { 18126, 0x00001B01 }, /* GL_LINE */
+ { 18134, 0x00002601 }, /* GL_LINEAR */
+ { 18144, 0x00001208 }, /* GL_LINEAR_ATTENUATION */
+ { 18166, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ { 18196, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ { 18227, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */
+ { 18251, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */
+ { 18276, 0x00000001 }, /* GL_LINES */
+ { 18285, 0x0000000A }, /* GL_LINES_ADJACENCY */
+ { 18304, 0x0000000A }, /* GL_LINES_ADJACENCY_ARB */
+ { 18327, 0x00000004 }, /* GL_LINE_BIT */
+ { 18339, 0x00000002 }, /* GL_LINE_LOOP */
+ { 18352, 0x00000707 }, /* GL_LINE_RESET_TOKEN */
+ { 18372, 0x00000B20 }, /* GL_LINE_SMOOTH */
+ { 18387, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */
+ { 18407, 0x00000B24 }, /* GL_LINE_STIPPLE */
+ { 18423, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */
+ { 18447, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */
+ { 18470, 0x00000003 }, /* GL_LINE_STRIP */
+ { 18484, 0x0000000B }, /* GL_LINE_STRIP_ADJACENCY */
+ { 18508, 0x0000000B }, /* GL_LINE_STRIP_ADJACENCY_ARB */
+ { 18536, 0x00000702 }, /* GL_LINE_TOKEN */
+ { 18550, 0x00000B21 }, /* GL_LINE_WIDTH */
+ { 18564, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */
+ { 18590, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */
+ { 18610, 0x00008B82 }, /* GL_LINK_STATUS */
+ { 18625, 0x00000B32 }, /* GL_LIST_BASE */
+ { 18638, 0x00020000 }, /* GL_LIST_BIT */
+ { 18650, 0x00000B33 }, /* GL_LIST_INDEX */
+ { 18664, 0x00000B30 }, /* GL_LIST_MODE */
+ { 18677, 0x00000101 }, /* GL_LOAD */
+ { 18685, 0x00000BF1 }, /* GL_LOGIC_OP */
+ { 18697, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */
+ { 18714, 0x00008252 }, /* GL_LOSE_CONTEXT_ON_RESET_ARB */
+ { 18743, 0x00008CA1 }, /* GL_LOWER_LEFT */
+ { 18757, 0x00008DF0 }, /* GL_LOW_FLOAT */
+ { 18770, 0x00008DF3 }, /* GL_LOW_INT */
+ { 18781, 0x00001909 }, /* GL_LUMINANCE */
+ { 18794, 0x00008041 }, /* GL_LUMINANCE12 */
+ { 18809, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */
+ { 18832, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */
+ { 18859, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */
+ { 18881, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */
+ { 18907, 0x00008041 }, /* GL_LUMINANCE12_EXT */
+ { 18926, 0x00008042 }, /* GL_LUMINANCE16 */
+ { 18941, 0x00008D8C }, /* GL_LUMINANCE16I_EXT */
+ { 18961, 0x00008D7A }, /* GL_LUMINANCE16UI_EXT */
+ { 18982, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */
+ { 19005, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */
+ { 19032, 0x00008042 }, /* GL_LUMINANCE16_EXT */
+ { 19051, 0x00008D86 }, /* GL_LUMINANCE32I_EXT */
+ { 19071, 0x00008D74 }, /* GL_LUMINANCE32UI_EXT */
+ { 19092, 0x0000803F }, /* GL_LUMINANCE4 */
+ { 19106, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */
+ { 19127, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */
+ { 19152, 0x0000803F }, /* GL_LUMINANCE4_EXT */
+ { 19170, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */
+ { 19191, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */
+ { 19216, 0x00008040 }, /* GL_LUMINANCE8 */
+ { 19230, 0x00008D92 }, /* GL_LUMINANCE8I_EXT */
+ { 19249, 0x00008D80 }, /* GL_LUMINANCE8UI_EXT */
+ { 19269, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */
+ { 19290, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */
+ { 19315, 0x00008040 }, /* GL_LUMINANCE8_EXT */
+ { 19333, 0x0000190A }, /* GL_LUMINANCE_ALPHA */
+ { 19352, 0x00008D8D }, /* GL_LUMINANCE_ALPHA16I_EXT */
+ { 19378, 0x00008D7B }, /* GL_LUMINANCE_ALPHA16UI_EXT */
+ { 19405, 0x00008D87 }, /* GL_LUMINANCE_ALPHA32I_EXT */
+ { 19431, 0x00008D75 }, /* GL_LUMINANCE_ALPHA32UI_EXT */
+ { 19458, 0x00008D93 }, /* GL_LUMINANCE_ALPHA8I_EXT */
+ { 19483, 0x00008D81 }, /* GL_LUMINANCE_ALPHA8UI_EXT */
+ { 19509, 0x00008D9D }, /* GL_LUMINANCE_ALPHA_INTEGER_EXT */
+ { 19540, 0x00008D9C }, /* GL_LUMINANCE_INTEGER_EXT */
+ { 19565, 0x0000821B }, /* GL_MAJOR_VERSION */
+ { 19582, 0x00000D90 }, /* GL_MAP1_COLOR_4 */
+ { 19598, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */
+ { 19618, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */
+ { 19640, 0x00000D91 }, /* GL_MAP1_INDEX */
+ { 19654, 0x00000D92 }, /* GL_MAP1_NORMAL */
+ { 19669, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */
+ { 19693, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */
+ { 19717, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */
+ { 19741, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */
+ { 19765, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */
+ { 19782, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */
+ { 19799, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ { 19827, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ { 19856, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ { 19885, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ { 19914, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ { 19943, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ { 19972, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ { 20001, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ { 20029, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ { 20057, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ { 20085, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ { 20113, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ { 20141, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ { 20169, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ { 20197, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ { 20225, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ { 20253, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */
+ { 20269, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */
+ { 20289, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */
+ { 20311, 0x00000DB1 }, /* GL_MAP2_INDEX */
+ { 20325, 0x00000DB2 }, /* GL_MAP2_NORMAL */
+ { 20340, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */
+ { 20364, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */
+ { 20388, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */
+ { 20412, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */
+ { 20436, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */
+ { 20453, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */
+ { 20470, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ { 20498, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ { 20527, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ { 20556, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ { 20585, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ { 20614, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ { 20643, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ { 20672, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ { 20700, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ { 20728, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ { 20756, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ { 20784, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ { 20812, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ { 20840, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */
+ { 20868, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ { 20896, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ { 20924, 0x00000D10 }, /* GL_MAP_COLOR */
+ { 20937, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */
+ { 20963, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */
+ { 20992, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */
+ { 21020, 0x00000001 }, /* GL_MAP_READ_BIT */
+ { 21036, 0x00000D11 }, /* GL_MAP_STENCIL */
+ { 21051, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */
+ { 21077, 0x00000002 }, /* GL_MAP_WRITE_BIT */
+ { 21094, 0x000088C0 }, /* GL_MATRIX0_ARB */
+ { 21109, 0x00008630 }, /* GL_MATRIX0_NV */
+ { 21123, 0x000088CA }, /* GL_MATRIX10_ARB */
+ { 21139, 0x000088CB }, /* GL_MATRIX11_ARB */
+ { 21155, 0x000088CC }, /* GL_MATRIX12_ARB */
+ { 21171, 0x000088CD }, /* GL_MATRIX13_ARB */
+ { 21187, 0x000088CE }, /* GL_MATRIX14_ARB */
+ { 21203, 0x000088CF }, /* GL_MATRIX15_ARB */
+ { 21219, 0x000088D0 }, /* GL_MATRIX16_ARB */
+ { 21235, 0x000088D1 }, /* GL_MATRIX17_ARB */
+ { 21251, 0x000088D2 }, /* GL_MATRIX18_ARB */
+ { 21267, 0x000088D3 }, /* GL_MATRIX19_ARB */
+ { 21283, 0x000088C1 }, /* GL_MATRIX1_ARB */
+ { 21298, 0x00008631 }, /* GL_MATRIX1_NV */
+ { 21312, 0x000088D4 }, /* GL_MATRIX20_ARB */
+ { 21328, 0x000088D5 }, /* GL_MATRIX21_ARB */
+ { 21344, 0x000088D6 }, /* GL_MATRIX22_ARB */
+ { 21360, 0x000088D7 }, /* GL_MATRIX23_ARB */
+ { 21376, 0x000088D8 }, /* GL_MATRIX24_ARB */
+ { 21392, 0x000088D9 }, /* GL_MATRIX25_ARB */
+ { 21408, 0x000088DA }, /* GL_MATRIX26_ARB */
+ { 21424, 0x000088DB }, /* GL_MATRIX27_ARB */
+ { 21440, 0x000088DC }, /* GL_MATRIX28_ARB */
+ { 21456, 0x000088DD }, /* GL_MATRIX29_ARB */
+ { 21472, 0x000088C2 }, /* GL_MATRIX2_ARB */
+ { 21487, 0x00008632 }, /* GL_MATRIX2_NV */
+ { 21501, 0x000088DE }, /* GL_MATRIX30_ARB */
+ { 21517, 0x000088DF }, /* GL_MATRIX31_ARB */
+ { 21533, 0x000088C3 }, /* GL_MATRIX3_ARB */
+ { 21548, 0x00008633 }, /* GL_MATRIX3_NV */
+ { 21562, 0x000088C4 }, /* GL_MATRIX4_ARB */
+ { 21577, 0x00008634 }, /* GL_MATRIX4_NV */
+ { 21591, 0x000088C5 }, /* GL_MATRIX5_ARB */
+ { 21606, 0x00008635 }, /* GL_MATRIX5_NV */
+ { 21620, 0x000088C6 }, /* GL_MATRIX6_ARB */
+ { 21635, 0x00008636 }, /* GL_MATRIX6_NV */
+ { 21649, 0x000088C7 }, /* GL_MATRIX7_ARB */
+ { 21664, 0x00008637 }, /* GL_MATRIX7_NV */
+ { 21678, 0x000088C8 }, /* GL_MATRIX8_ARB */
+ { 21693, 0x000088C9 }, /* GL_MATRIX9_ARB */
+ { 21708, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ { 21734, 0x00008B9E }, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */
+ { 21775, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_OES */
+ { 21801, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ { 21835, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_OES */
+ { 21869, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ { 21900, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_OES */
+ { 21931, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ { 21964, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_OES */
+ { 21997, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ { 22028, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_OES */
+ { 22059, 0x00000BA0 }, /* GL_MATRIX_MODE */
+ { 22074, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */
+ { 22096, 0x00008840 }, /* GL_MATRIX_PALETTE_OES */
+ { 22118, 0x00008008 }, /* GL_MAX */
+ { 22125, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */
+ { 22148, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE_OES */
+ { 22175, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS */
+ { 22203, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */
+ { 22235, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ { 22261, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ { 22294, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ { 22320, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 22354, 0x00000D32 }, /* GL_MAX_CLIP_DISTANCES */
+ { 22376, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */
+ { 22395, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */
+ { 22420, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */
+ { 22449, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ { 22481, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */
+ { 22517, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ { 22553, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */
+ { 22593, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */
+ { 22619, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */
+ { 22649, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */
+ { 22674, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */
+ { 22703, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ { 22732, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */
+ { 22765, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES */
+ { 22798, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */
+ { 22818, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */
+ { 22842, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */
+ { 22866, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_NV */
+ { 22889, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */
+ { 22913, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */
+ { 22938, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */
+ { 22956, 0x00008008 }, /* GL_MAX_EXT */
+ { 22967, 0x00009125 }, /* GL_MAX_FRAGMENT_INPUT_COMPONENTS */
+ { 23000, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ { 23035, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */
+ { 23074, 0x00008DFD }, /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */
+ { 23106, 0x00009123 }, /* GL_MAX_GEOMETRY_INPUT_COMPONENTS */
+ { 23139, 0x00009124 }, /* GL_MAX_GEOMETRY_OUTPUT_COMPONENTS */
+ { 23173, 0x00008DE0 }, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES */
+ { 23205, 0x00008DE0 }, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB */
+ { 23241, 0x00008C29 }, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS */
+ { 23277, 0x00008C29 }, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB */
+ { 23317, 0x00008DE1 }, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS */
+ { 23357, 0x00008DE1 }, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB */
+ { 23401, 0x00008DDF }, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS */
+ { 23436, 0x00008DDF }, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB */
+ { 23475, 0x00008DDD }, /* GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB */
+ { 23514, 0x00000D31 }, /* GL_MAX_LIGHTS */
+ { 23528, 0x00000B31 }, /* GL_MAX_LIST_NESTING */
+ { 23548, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ { 23586, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ { 23615, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */
+ { 23639, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */
+ { 23667, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_OES */
+ { 23695, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */
+ { 23718, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 23755, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 23791, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ { 23818, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ { 23847, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ { 23881, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+ { 23917, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ { 23944, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ { 23976, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ { 24012, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ { 24041, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ { 24070, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ { 24098, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ { 24136, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 24180, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 24223, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 24257, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 24296, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 24333, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 24371, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 24414, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 24457, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ { 24487, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ { 24518, 0x00008905 }, /* GL_MAX_PROGRAM_TEXEL_OFFSET */
+ { 24546, 0x00008905 }, /* GL_MAX_PROGRAM_TEXEL_OFFSET_EXT */
+ { 24578, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 24614, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 24650, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ { 24680, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE */
+ { 24710, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
+ { 24744, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */
+ { 24777, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */
+ { 24802, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */
+ { 24831, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_OES */
+ { 24860, 0x00008D57 }, /* GL_MAX_SAMPLES */
+ { 24875, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */
+ { 24894, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */
+ { 24921, 0x00008504 }, /* GL_MAX_SHININESS_NV */
+ { 24941, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */
+ { 24965, 0x00008C2B }, /* GL_MAX_TEXTURE_BUFFER_SIZE */
+ { 24992, 0x00008C2B }, /* GL_MAX_TEXTURE_BUFFER_SIZE_ARB */
+ { 25023, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */
+ { 25045, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */
+ { 25071, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ { 25098, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */
+ { 25129, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */
+ { 25153, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS_EXT */
+ { 25181, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 25215, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */
+ { 25235, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ { 25262, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */
+ { 25283, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */
+ { 25308, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */
+ { 25333, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
+ { 25368, 0x00008C8A }, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS */
+ { 25417, 0x00008C8A }, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT */
+ { 25470, 0x00008C8B }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS */
+ { 25513, 0x00008C8B }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT */
+ { 25560, 0x00008C80 }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS */
+ { 25606, 0x00008C80 }, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT */
+ { 25656, 0x00008B4B }, /* GL_MAX_VARYING_COMPONENTS */
+ { 25682, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */
+ { 25704, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */
+ { 25730, 0x00008DFC }, /* GL_MAX_VARYING_VECTORS */
+ { 25753, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */
+ { 25775, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */
+ { 25801, 0x00009122 }, /* GL_MAX_VERTEX_OUTPUT_COMPONENTS */
+ { 25833, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ { 25867, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+ { 25905, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ { 25938, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */
+ { 25975, 0x00008DFB }, /* GL_MAX_VERTEX_UNIFORM_VECTORS */
+ { 26005, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */
+ { 26029, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_OES */
+ { 26053, 0x00008DDE }, /* GL_MAX_VERTEX_VARYING_COMPONENTS_ARB */
+ { 26090, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */
+ { 26111, 0x00008DF1 }, /* GL_MEDIUM_FLOAT */
+ { 26127, 0x00008DF4 }, /* GL_MEDIUM_INT */
+ { 26141, 0x00008007 }, /* GL_MIN */
+ { 26148, 0x0000802E }, /* GL_MINMAX */
+ { 26158, 0x0000802E }, /* GL_MINMAX_EXT */
+ { 26172, 0x0000802F }, /* GL_MINMAX_FORMAT */
+ { 26189, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */
+ { 26210, 0x00008030 }, /* GL_MINMAX_SINK */
+ { 26225, 0x00008030 }, /* GL_MINMAX_SINK_EXT */
+ { 26244, 0x0000821C }, /* GL_MINOR_VERSION */
+ { 26261, 0x00008007 }, /* GL_MIN_EXT */
+ { 26272, 0x00008904 }, /* GL_MIN_PROGRAM_TEXEL_OFFSET */
+ { 26300, 0x00008904 }, /* GL_MIN_PROGRAM_TEXEL_OFFSET_EXT */
+ { 26332, 0x00008370 }, /* GL_MIRRORED_REPEAT */
+ { 26351, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */
+ { 26374, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */
+ { 26397, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */
+ { 26417, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */
+ { 26437, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ { 26467, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */
+ { 26495, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ { 26523, 0x00001700 }, /* GL_MODELVIEW */
+ { 26536, 0x00001700 }, /* GL_MODELVIEW0_ARB */
+ { 26554, 0x0000872A }, /* GL_MODELVIEW10_ARB */
+ { 26573, 0x0000872B }, /* GL_MODELVIEW11_ARB */
+ { 26592, 0x0000872C }, /* GL_MODELVIEW12_ARB */
+ { 26611, 0x0000872D }, /* GL_MODELVIEW13_ARB */
+ { 26630, 0x0000872E }, /* GL_MODELVIEW14_ARB */
+ { 26649, 0x0000872F }, /* GL_MODELVIEW15_ARB */
+ { 26668, 0x00008730 }, /* GL_MODELVIEW16_ARB */
+ { 26687, 0x00008731 }, /* GL_MODELVIEW17_ARB */
+ { 26706, 0x00008732 }, /* GL_MODELVIEW18_ARB */
+ { 26725, 0x00008733 }, /* GL_MODELVIEW19_ARB */
+ { 26744, 0x0000850A }, /* GL_MODELVIEW1_ARB */
+ { 26762, 0x00008734 }, /* GL_MODELVIEW20_ARB */
+ { 26781, 0x00008735 }, /* GL_MODELVIEW21_ARB */
+ { 26800, 0x00008736 }, /* GL_MODELVIEW22_ARB */
+ { 26819, 0x00008737 }, /* GL_MODELVIEW23_ARB */
+ { 26838, 0x00008738 }, /* GL_MODELVIEW24_ARB */
+ { 26857, 0x00008739 }, /* GL_MODELVIEW25_ARB */
+ { 26876, 0x0000873A }, /* GL_MODELVIEW26_ARB */
+ { 26895, 0x0000873B }, /* GL_MODELVIEW27_ARB */
+ { 26914, 0x0000873C }, /* GL_MODELVIEW28_ARB */
+ { 26933, 0x0000873D }, /* GL_MODELVIEW29_ARB */
+ { 26952, 0x00008722 }, /* GL_MODELVIEW2_ARB */
+ { 26970, 0x0000873E }, /* GL_MODELVIEW30_ARB */
+ { 26989, 0x0000873F }, /* GL_MODELVIEW31_ARB */
+ { 27008, 0x00008723 }, /* GL_MODELVIEW3_ARB */
+ { 27026, 0x00008724 }, /* GL_MODELVIEW4_ARB */
+ { 27044, 0x00008725 }, /* GL_MODELVIEW5_ARB */
+ { 27062, 0x00008726 }, /* GL_MODELVIEW6_ARB */
+ { 27080, 0x00008727 }, /* GL_MODELVIEW7_ARB */
+ { 27098, 0x00008728 }, /* GL_MODELVIEW8_ARB */
+ { 27116, 0x00008729 }, /* GL_MODELVIEW9_ARB */
+ { 27134, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */
+ { 27154, 0x0000898D }, /* GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES */
+ { 27196, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */
+ { 27223, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */
+ { 27248, 0x00002100 }, /* GL_MODULATE */
+ { 27260, 0x00008744 }, /* GL_MODULATE_ADD_ATI */
+ { 27280, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */
+ { 27307, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */
+ { 27332, 0x00000103 }, /* GL_MULT */
+ { 27340, 0x0000809D }, /* GL_MULTISAMPLE */
+ { 27355, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */
+ { 27375, 0x0000809D }, /* GL_MULTISAMPLE_ARB */
+ { 27394, 0x20000000 }, /* GL_MULTISAMPLE_BIT */
+ { 27413, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */
+ { 27437, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */
+ { 27460, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ { 27490, 0x00002A25 }, /* GL_N3F_V3F */
+ { 27501, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */
+ { 27521, 0x0000150E }, /* GL_NAND */
+ { 27529, 0x00002600 }, /* GL_NEAREST */
+ { 27540, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ { 27571, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ { 27603, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */
+ { 27628, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */
+ { 27654, 0x00000200 }, /* GL_NEVER */
+ { 27663, 0x00001102 }, /* GL_NICEST */
+ { 27673, 0x00000000 }, /* GL_NONE */
+ { 27681, 0x00000000 }, /* GL_NONE_OES */
+ { 27693, 0x00001505 }, /* GL_NOOP */
+ { 27701, 0x00001508 }, /* GL_NOR */
+ { 27708, 0x00000BA1 }, /* GL_NORMALIZE */
+ { 27721, 0x00008075 }, /* GL_NORMAL_ARRAY */
+ { 27737, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ { 27768, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */
+ { 27803, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */
+ { 27827, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */
+ { 27850, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */
+ { 27871, 0x00008511 }, /* GL_NORMAL_MAP */
+ { 27885, 0x00008511 }, /* GL_NORMAL_MAP_ARB */
+ { 27903, 0x00008511 }, /* GL_NORMAL_MAP_NV */
+ { 27920, 0x00008511 }, /* GL_NORMAL_MAP_OES */
+ { 27938, 0x00000205 }, /* GL_NOTEQUAL */
+ { 27950, 0x00000000 }, /* GL_NO_ERROR */
+ { 27962, 0x00008261 }, /* GL_NO_RESET_NOTIFICATION_ARB */
+ { 27991, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ { 28025, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */
+ { 28063, 0x0000821D }, /* GL_NUM_EXTENSIONS */
+ { 28081, 0x000087FE }, /* GL_NUM_PROGRAM_BINARY_FORMATS */
+ { 28111, 0x000087FE }, /* GL_NUM_PROGRAM_BINARY_FORMATS_OES */
+ { 28145, 0x00008DF9 }, /* GL_NUM_SHADER_BINARY_FORMATS */
+ { 28174, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */
+ { 28206, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */
+ { 28248, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */
+ { 28278, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */
+ { 28318, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */
+ { 28349, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */
+ { 28378, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */
+ { 28406, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */
+ { 28436, 0x00002401 }, /* GL_OBJECT_LINEAR */
+ { 28453, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */
+ { 28479, 0x00002501 }, /* GL_OBJECT_PLANE */
+ { 28495, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */
+ { 28530, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */
+ { 28552, 0x00009112 }, /* GL_OBJECT_TYPE */
+ { 28567, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */
+ { 28586, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */
+ { 28616, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */
+ { 28637, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */
+ { 28665, 0x00000001 }, /* GL_ONE */
+ { 28672, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ { 28700, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */
+ { 28732, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ { 28760, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */
+ { 28792, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */
+ { 28815, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */
+ { 28838, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */
+ { 28861, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */
+ { 28884, 0x00008598 }, /* GL_OPERAND0_ALPHA */
+ { 28902, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */
+ { 28924, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */
+ { 28946, 0x00008590 }, /* GL_OPERAND0_RGB */
+ { 28962, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */
+ { 28982, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */
+ { 29002, 0x00008599 }, /* GL_OPERAND1_ALPHA */
+ { 29020, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */
+ { 29042, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */
+ { 29064, 0x00008591 }, /* GL_OPERAND1_RGB */
+ { 29080, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */
+ { 29100, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */
+ { 29120, 0x0000859A }, /* GL_OPERAND2_ALPHA */
+ { 29138, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */
+ { 29160, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */
+ { 29182, 0x00008592 }, /* GL_OPERAND2_RGB */
+ { 29198, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */
+ { 29218, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */
+ { 29238, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */
+ { 29259, 0x00008593 }, /* GL_OPERAND3_RGB_NV */
+ { 29278, 0x00001507 }, /* GL_OR */
+ { 29284, 0x00000A01 }, /* GL_ORDER */
+ { 29293, 0x0000150D }, /* GL_OR_INVERTED */
+ { 29308, 0x0000150B }, /* GL_OR_REVERSE */
+ { 29322, 0x00000505 }, /* GL_OUT_OF_MEMORY */
+ { 29339, 0x00000D05 }, /* GL_PACK_ALIGNMENT */
+ { 29357, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */
+ { 29378, 0x00008758 }, /* GL_PACK_INVERT_MESA */
+ { 29398, 0x00000D01 }, /* GL_PACK_LSB_FIRST */
+ { 29416, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */
+ { 29435, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */
+ { 29455, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */
+ { 29475, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */
+ { 29493, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */
+ { 29512, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */
+ { 29537, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */
+ { 29561, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */
+ { 29582, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */
+ { 29604, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */
+ { 29626, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */
+ { 29651, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */
+ { 29675, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */
+ { 29696, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */
+ { 29718, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */
+ { 29740, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */
+ { 29762, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ { 29793, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */
+ { 29813, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ { 29838, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */
+ { 29858, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ { 29883, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */
+ { 29903, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ { 29928, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */
+ { 29948, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ { 29973, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */
+ { 29993, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ { 30018, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */
+ { 30038, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ { 30063, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */
+ { 30083, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ { 30108, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */
+ { 30128, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ { 30153, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */
+ { 30173, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ { 30198, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */
+ { 30218, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ { 30243, 0x00000020 }, /* GL_PIXEL_MODE_BIT */
+ { 30261, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */
+ { 30282, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */
+ { 30311, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */
+ { 30344, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */
+ { 30369, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */
+ { 30392, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
+ { 30423, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */
+ { 30458, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */
+ { 30485, 0x00001B00 }, /* GL_POINT */
+ { 30494, 0x00000000 }, /* GL_POINTS */
+ { 30504, 0x00000002 }, /* GL_POINT_BIT */
+ { 30517, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */
+ { 30547, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */
+ { 30581, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */
+ { 30615, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */
+ { 30650, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ { 30679, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */
+ { 30712, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */
+ { 30745, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */
+ { 30779, 0x00000B11 }, /* GL_POINT_SIZE */
+ { 30793, 0x00008B9F }, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
+ { 30832, 0x00008B9C }, /* GL_POINT_SIZE_ARRAY_OES */
+ { 30856, 0x0000898C }, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
+ { 30888, 0x0000898B }, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
+ { 30919, 0x0000898A }, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
+ { 30948, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */
+ { 30974, 0x00008127 }, /* GL_POINT_SIZE_MAX */
+ { 30992, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */
+ { 31014, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */
+ { 31036, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */
+ { 31059, 0x00008126 }, /* GL_POINT_SIZE_MIN */
+ { 31077, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */
+ { 31099, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */
+ { 31121, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */
+ { 31144, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */
+ { 31164, 0x00000B10 }, /* GL_POINT_SMOOTH */
+ { 31180, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */
+ { 31201, 0x00008861 }, /* GL_POINT_SPRITE */
+ { 31217, 0x00008861 }, /* GL_POINT_SPRITE_ARB */
+ { 31237, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ { 31266, 0x00008861 }, /* GL_POINT_SPRITE_NV */
+ { 31285, 0x00008861 }, /* GL_POINT_SPRITE_OES */
+ { 31305, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */
+ { 31331, 0x00000701 }, /* GL_POINT_TOKEN */
+ { 31346, 0x00000009 }, /* GL_POLYGON */
+ { 31357, 0x00000008 }, /* GL_POLYGON_BIT */
+ { 31372, 0x00000B40 }, /* GL_POLYGON_MODE */
+ { 31388, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */
+ { 31411, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */
+ { 31436, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */
+ { 31459, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */
+ { 31482, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */
+ { 31506, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */
+ { 31530, 0x00000B41 }, /* GL_POLYGON_SMOOTH */
+ { 31548, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */
+ { 31571, 0x00000B42 }, /* GL_POLYGON_STIPPLE */
+ { 31590, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */
+ { 31613, 0x00000703 }, /* GL_POLYGON_TOKEN */
+ { 31630, 0x00001203 }, /* GL_POSITION */
+ { 31642, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ { 31674, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */
+ { 31710, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ { 31743, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */
+ { 31780, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ { 31811, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */
+ { 31846, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ { 31878, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */
+ { 31914, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 31947, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ { 31979, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */
+ { 32015, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ { 32048, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */
+ { 32085, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ { 32115, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */
+ { 32149, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ { 32180, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */
+ { 32215, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ { 32246, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */
+ { 32281, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ { 32313, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */
+ { 32349, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ { 32379, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */
+ { 32413, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ { 32444, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */
+ { 32479, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ { 32511, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ { 32542, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */
+ { 32577, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ { 32609, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */
+ { 32645, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */
+ { 32674, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */
+ { 32707, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */
+ { 32737, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */
+ { 32771, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ { 32810, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ { 32843, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ { 32883, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ { 32917, 0x00008578 }, /* GL_PREVIOUS */
+ { 32929, 0x00008578 }, /* GL_PREVIOUS_ARB */
+ { 32945, 0x00008578 }, /* GL_PREVIOUS_EXT */
+ { 32961, 0x00008577 }, /* GL_PRIMARY_COLOR */
+ { 32978, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */
+ { 32999, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */
+ { 33020, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED */
+ { 33044, 0x00008C87 }, /* GL_PRIMITIVES_GENERATED_EXT */
+ { 33072, 0x00008F9D }, /* GL_PRIMITIVE_RESTART */
+ { 33093, 0x00008F9E }, /* GL_PRIMITIVE_RESTART_INDEX */
+ { 33120, 0x00008559 }, /* GL_PRIMITIVE_RESTART_INDEX_NV */
+ { 33150, 0x00008558 }, /* GL_PRIMITIVE_RESTART_NV */
+ { 33174, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ { 33207, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ { 33239, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */
+ { 33262, 0x000087FF }, /* GL_PROGRAM_BINARY_FORMATS */
+ { 33288, 0x000087FF }, /* GL_PROGRAM_BINARY_FORMATS_OES */
+ { 33318, 0x00008741 }, /* GL_PROGRAM_BINARY_LENGTH */
+ { 33343, 0x00008741 }, /* GL_PROGRAM_BINARY_LENGTH_OES */
+ { 33372, 0x00008257 }, /* GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
+ { 33407, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */
+ { 33430, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ { 33460, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */
+ { 33489, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */
+ { 33517, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */
+ { 33539, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ { 33567, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ { 33595, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */
+ { 33617, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */
+ { 33638, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ { 33678, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ { 33717, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ { 33747, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ { 33782, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ { 33815, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ { 33849, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ { 33888, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ { 33927, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */
+ { 33949, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */
+ { 33975, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */
+ { 33999, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE */
+ { 34021, 0x00008642 }, /* GL_PROGRAM_POINT_SIZE_ARB */
+ { 34047, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */
+ { 34070, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */
+ { 34092, 0x00008628 }, /* GL_PROGRAM_STRING_NV */
+ { 34113, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */
+ { 34134, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */
+ { 34161, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ { 34193, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ { 34225, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ { 34260, 0x00001701 }, /* GL_PROJECTION */
+ { 34274, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */
+ { 34295, 0x0000898E }, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
+ { 34338, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */
+ { 34364, 0x00008E4F }, /* GL_PROVOKING_VERTEX */
+ { 34384, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */
+ { 34408, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */
+ { 34429, 0x00008025 }, /* GL_PROXY_HISTOGRAM */
+ { 34448, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */
+ { 34471, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ { 34510, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ { 34548, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */
+ { 34568, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY */
+ { 34594, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
+ { 34624, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */
+ { 34648, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */
+ { 34668, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY */
+ { 34694, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */
+ { 34724, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */
+ { 34748, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */
+ { 34768, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ { 34801, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ { 34827, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */
+ { 34857, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE */
+ { 34884, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
+ { 34915, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */
+ { 34945, 0x00008A1D }, /* GL_PURGEABLE_APPLE */
+ { 34964, 0x00002003 }, /* GL_Q */
+ { 34969, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */
+ { 34994, 0x00000007 }, /* GL_QUADS */
+ { 35003, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
+ { 35047, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */
+ { 35095, 0x00008614 }, /* GL_QUAD_MESH_SUN */
+ { 35112, 0x00000008 }, /* GL_QUAD_STRIP */
+ { 35126, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT */
+ { 35153, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */
+ { 35183, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT */
+ { 35207, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */
+ { 35234, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */
+ { 35256, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */
+ { 35282, 0x00008E14 }, /* GL_QUERY_NO_WAIT */
+ { 35299, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */
+ { 35319, 0x00008866 }, /* GL_QUERY_RESULT */
+ { 35335, 0x00008866 }, /* GL_QUERY_RESULT_ARB */
+ { 35355, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */
+ { 35381, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */
+ { 35411, 0x00008E13 }, /* GL_QUERY_WAIT */
+ { 35425, 0x00008E13 }, /* GL_QUERY_WAIT_NV */
+ { 35442, 0x00002002 }, /* GL_R */
+ { 35447, 0x00008C3A }, /* GL_R11F_G11F_B10F */
+ { 35465, 0x00008F98 }, /* GL_R16_SNORM */
+ { 35478, 0x00002A10 }, /* GL_R3_G3_B2 */
+ { 35490, 0x00008F94 }, /* GL_R8_SNORM */
+ { 35502, 0x00008C89 }, /* GL_RASTERIZER_DISCARD */
+ { 35524, 0x00008C89 }, /* GL_RASTERIZER_DISCARD_EXT */
+ { 35550, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ { 35583, 0x00000C02 }, /* GL_READ_BUFFER */
+ { 35598, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */
+ { 35618, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */
+ { 35646, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */
+ { 35678, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */
+ { 35702, 0x000088B8 }, /* GL_READ_ONLY */
+ { 35715, 0x000088B8 }, /* GL_READ_ONLY_ARB */
+ { 35732, 0x000088BA }, /* GL_READ_WRITE */
+ { 35746, 0x000088BA }, /* GL_READ_WRITE_ARB */
+ { 35764, 0x00001903 }, /* GL_RED */
+ { 35771, 0x00008016 }, /* GL_REDUCE */
+ { 35781, 0x00008016 }, /* GL_REDUCE_EXT */
+ { 35795, 0x00000D15 }, /* GL_RED_BIAS */
+ { 35807, 0x00000D52 }, /* GL_RED_BITS */
+ { 35819, 0x00008D94 }, /* GL_RED_INTEGER */
+ { 35834, 0x00008D94 }, /* GL_RED_INTEGER_EXT */
+ { 35853, 0x00000D14 }, /* GL_RED_SCALE */
+ { 35866, 0x00008F90 }, /* GL_RED_SNORM */
+ { 35879, 0x00008512 }, /* GL_REFLECTION_MAP */
+ { 35897, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */
+ { 35919, 0x00008512 }, /* GL_REFLECTION_MAP_NV */
+ { 35940, 0x00008512 }, /* GL_REFLECTION_MAP_OES */
+ { 35962, 0x00008A19 }, /* GL_RELEASED_APPLE */
+ { 35980, 0x00001C00 }, /* GL_RENDER */
+ { 35990, 0x00008D41 }, /* GL_RENDERBUFFER */
+ { 36006, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */
+ { 36033, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE_OES */
+ { 36064, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */
+ { 36088, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */
+ { 36116, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_OES */
+ { 36144, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */
+ { 36170, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE_OES */
+ { 36200, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */
+ { 36227, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE_OES */
+ { 36258, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */
+ { 36278, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */
+ { 36305, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE_OES */
+ { 36336, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */
+ { 36359, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */
+ { 36386, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_OES */
+ { 36413, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
+ { 36445, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */
+ { 36481, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
+ { 36517, 0x00008D41 }, /* GL_RENDERBUFFER_OES */
+ { 36537, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */
+ { 36562, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE_OES */
+ { 36591, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */
+ { 36615, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */
+ { 36643, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */
+ { 36672, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE_OES */
+ { 36705, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */
+ { 36727, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */
+ { 36753, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_OES */
+ { 36779, 0x00001F01 }, /* GL_RENDERER */
+ { 36791, 0x00000C40 }, /* GL_RENDER_MODE */
+ { 36806, 0x00002901 }, /* GL_REPEAT */
+ { 36816, 0x00001E01 }, /* GL_REPLACE */
+ { 36827, 0x00008062 }, /* GL_REPLACE_EXT */
+ { 36842, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */
+ { 36865, 0x0000803A }, /* GL_RESCALE_NORMAL */
+ { 36883, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */
+ { 36905, 0x00008256 }, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
+ { 36940, 0x00008A1B }, /* GL_RETAINED_APPLE */
+ { 36958, 0x00000102 }, /* GL_RETURN */
+ { 36968, 0x00008F99 }, /* GL_RG16_SNORM */
+ { 36982, 0x00008F95 }, /* GL_RG8_SNORM */
+ { 36995, 0x00001907 }, /* GL_RGB */
+ { 37002, 0x00008052 }, /* GL_RGB10 */
+ { 37011, 0x00008059 }, /* GL_RGB10_A2 */
+ { 37023, 0x00008059 }, /* GL_RGB10_A2_EXT */
+ { 37039, 0x00008052 }, /* GL_RGB10_EXT */
+ { 37052, 0x00008053 }, /* GL_RGB12 */
+ { 37061, 0x00008053 }, /* GL_RGB12_EXT */
+ { 37074, 0x00008054 }, /* GL_RGB16 */
+ { 37083, 0x0000881B }, /* GL_RGB16F */
+ { 37093, 0x00008D89 }, /* GL_RGB16I */
+ { 37103, 0x00008D89 }, /* GL_RGB16I_EXT */
+ { 37117, 0x00008D77 }, /* GL_RGB16UI */
+ { 37128, 0x00008D77 }, /* GL_RGB16UI_EXT */
+ { 37143, 0x00008054 }, /* GL_RGB16_EXT */
+ { 37156, 0x00008F9A }, /* GL_RGB16_SNORM */
+ { 37171, 0x0000804E }, /* GL_RGB2_EXT */
+ { 37183, 0x00008815 }, /* GL_RGB32F */
+ { 37193, 0x00008D83 }, /* GL_RGB32I */
+ { 37203, 0x00008D83 }, /* GL_RGB32I_EXT */
+ { 37217, 0x00008D71 }, /* GL_RGB32UI */
+ { 37228, 0x00008D71 }, /* GL_RGB32UI_EXT */
+ { 37243, 0x0000804F }, /* GL_RGB4 */
+ { 37251, 0x0000804F }, /* GL_RGB4_EXT */
+ { 37263, 0x000083A1 }, /* GL_RGB4_S3TC */
+ { 37276, 0x00008050 }, /* GL_RGB5 */
+ { 37284, 0x00008D62 }, /* GL_RGB565 */
+ { 37294, 0x00008D62 }, /* GL_RGB565_OES */
+ { 37308, 0x00008057 }, /* GL_RGB5_A1 */
+ { 37319, 0x00008057 }, /* GL_RGB5_A1_EXT */
+ { 37334, 0x00008057 }, /* GL_RGB5_A1_OES */
+ { 37349, 0x00008050 }, /* GL_RGB5_EXT */
+ { 37361, 0x00008051 }, /* GL_RGB8 */
+ { 37369, 0x00008D8F }, /* GL_RGB8I */
+ { 37378, 0x00008D8F }, /* GL_RGB8I_EXT */
+ { 37391, 0x00008D7D }, /* GL_RGB8UI */
+ { 37401, 0x00008D7D }, /* GL_RGB8UI_EXT */
+ { 37415, 0x00008051 }, /* GL_RGB8_EXT */
+ { 37427, 0x00008051 }, /* GL_RGB8_OES */
+ { 37439, 0x00008F96 }, /* GL_RGB8_SNORM */
+ { 37453, 0x00008C3D }, /* GL_RGB9_E5 */
+ { 37464, 0x00001908 }, /* GL_RGBA */
+ { 37472, 0x0000805A }, /* GL_RGBA12 */
+ { 37482, 0x0000805A }, /* GL_RGBA12_EXT */
+ { 37496, 0x0000805B }, /* GL_RGBA16 */
+ { 37506, 0x0000881A }, /* GL_RGBA16F */
+ { 37517, 0x00008D88 }, /* GL_RGBA16I */
+ { 37528, 0x00008D88 }, /* GL_RGBA16I_EXT */
+ { 37543, 0x00008D76 }, /* GL_RGBA16UI */
+ { 37555, 0x00008D76 }, /* GL_RGBA16UI_EXT */
+ { 37571, 0x0000805B }, /* GL_RGBA16_EXT */
+ { 37585, 0x00008F9B }, /* GL_RGBA16_SNORM */
+ { 37601, 0x00008055 }, /* GL_RGBA2 */
+ { 37610, 0x00008055 }, /* GL_RGBA2_EXT */
+ { 37623, 0x00008814 }, /* GL_RGBA32F */
+ { 37634, 0x00008D82 }, /* GL_RGBA32I */
+ { 37645, 0x00008D82 }, /* GL_RGBA32I_EXT */
+ { 37660, 0x00008D70 }, /* GL_RGBA32UI */
+ { 37672, 0x00008D70 }, /* GL_RGBA32UI_EXT */
+ { 37688, 0x00008056 }, /* GL_RGBA4 */
+ { 37697, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */
+ { 37716, 0x00008056 }, /* GL_RGBA4_EXT */
+ { 37729, 0x00008056 }, /* GL_RGBA4_OES */
+ { 37742, 0x000083A3 }, /* GL_RGBA4_S3TC */
+ { 37756, 0x00008058 }, /* GL_RGBA8 */
+ { 37765, 0x00008D8E }, /* GL_RGBA8I */
+ { 37775, 0x00008D8E }, /* GL_RGBA8I_EXT */
+ { 37789, 0x00008D7C }, /* GL_RGBA8UI */
+ { 37800, 0x00008D7C }, /* GL_RGBA8UI_EXT */
+ { 37815, 0x00008058 }, /* GL_RGBA8_EXT */
+ { 37828, 0x00008058 }, /* GL_RGBA8_OES */
+ { 37841, 0x00008F97 }, /* GL_RGBA8_SNORM */
+ { 37856, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */
+ { 37874, 0x00008820 }, /* GL_RGBA_FLOAT_MODE_ARB */
+ { 37897, 0x00008D99 }, /* GL_RGBA_INTEGER */
+ { 37913, 0x00008D99 }, /* GL_RGBA_INTEGER_EXT */
+ { 37933, 0x00008D9E }, /* GL_RGBA_INTEGER_MODE_EXT */
+ { 37958, 0x00000C31 }, /* GL_RGBA_MODE */
+ { 37971, 0x000083A2 }, /* GL_RGBA_S3TC */
+ { 37984, 0x00008F93 }, /* GL_RGBA_SNORM */
+ { 37998, 0x00008D98 }, /* GL_RGB_INTEGER */
+ { 38013, 0x00008D98 }, /* GL_RGB_INTEGER_EXT */
+ { 38032, 0x000083A0 }, /* GL_RGB_S3TC */
+ { 38044, 0x00008573 }, /* GL_RGB_SCALE */
+ { 38057, 0x00008573 }, /* GL_RGB_SCALE_ARB */
+ { 38074, 0x00008573 }, /* GL_RGB_SCALE_EXT */
+ { 38091, 0x00008F92 }, /* GL_RGB_SNORM */
+ { 38104, 0x00008F91 }, /* GL_RG_SNORM */
+ { 38116, 0x00000407 }, /* GL_RIGHT */
+ { 38125, 0x00002000 }, /* GL_S */
+ { 38130, 0x00008B5D }, /* GL_SAMPLER_1D */
+ { 38144, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY */
+ { 38164, 0x00008DC0 }, /* GL_SAMPLER_1D_ARRAY_EXT */
+ { 38188, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW */
+ { 38215, 0x00008DC3 }, /* GL_SAMPLER_1D_ARRAY_SHADOW_EXT */
+ { 38246, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */
+ { 38267, 0x00008B5E }, /* GL_SAMPLER_2D */
+ { 38281, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY */
+ { 38301, 0x00008DC1 }, /* GL_SAMPLER_2D_ARRAY_EXT */
+ { 38325, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW */
+ { 38352, 0x00008DC4 }, /* GL_SAMPLER_2D_ARRAY_SHADOW_EXT */
+ { 38383, 0x00008B63 }, /* GL_SAMPLER_2D_RECT */
+ { 38402, 0x00008B64 }, /* GL_SAMPLER_2D_RECT_SHADOW */
+ { 38428, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */
+ { 38449, 0x00008B5F }, /* GL_SAMPLER_3D */
+ { 38463, 0x00008B5F }, /* GL_SAMPLER_3D_OES */
+ { 38481, 0x00008919 }, /* GL_SAMPLER_BINDING */
+ { 38500, 0x00008DC2 }, /* GL_SAMPLER_BUFFER */
+ { 38518, 0x00008DC2 }, /* GL_SAMPLER_BUFFER_EXT */
+ { 38540, 0x00008B60 }, /* GL_SAMPLER_CUBE */
+ { 38556, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW */
+ { 38579, 0x00008DC5 }, /* GL_SAMPLER_CUBE_SHADOW_EXT */
+ { 38606, 0x000080A9 }, /* GL_SAMPLES */
+ { 38617, 0x000086B4 }, /* GL_SAMPLES_3DFX */
+ { 38633, 0x000080A9 }, /* GL_SAMPLES_ARB */
+ { 38648, 0x00008914 }, /* GL_SAMPLES_PASSED */
+ { 38666, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */
+ { 38688, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ { 38716, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */
+ { 38748, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */
+ { 38771, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */
+ { 38798, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */
+ { 38816, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */
+ { 38839, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */
+ { 38861, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */
+ { 38880, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */
+ { 38903, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */
+ { 38929, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */
+ { 38959, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */
+ { 38984, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */
+ { 39013, 0x00080000 }, /* GL_SCISSOR_BIT */
+ { 39028, 0x00000C10 }, /* GL_SCISSOR_BOX */
+ { 39043, 0x00000C11 }, /* GL_SCISSOR_TEST */
+ { 39059, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */
+ { 39084, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ { 39124, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */
+ { 39168, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ { 39201, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ { 39231, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ { 39263, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ { 39293, 0x00001C02 }, /* GL_SELECT */
+ { 39303, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */
+ { 39331, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */
+ { 39356, 0x00008012 }, /* GL_SEPARABLE_2D */
+ { 39372, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS */
+ { 39392, 0x00008C8D }, /* GL_SEPARATE_ATTRIBS_EXT */
+ { 39416, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */
+ { 39443, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */
+ { 39474, 0x0000150F }, /* GL_SET */
+ { 39481, 0x00008DF8 }, /* GL_SHADER_BINARY_FORMATS */
+ { 39506, 0x00008DFA }, /* GL_SHADER_COMPILER */
+ { 39525, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */
+ { 39546, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */
+ { 39570, 0x00008B4F }, /* GL_SHADER_TYPE */
+ { 39585, 0x00000B54 }, /* GL_SHADE_MODEL */
+ { 39600, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */
+ { 39628, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */
+ { 39651, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ { 39681, 0x00001601 }, /* GL_SHININESS */
+ { 39694, 0x00001402 }, /* GL_SHORT */
+ { 39703, 0x00009119 }, /* GL_SIGNALED */
+ { 39715, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */
+ { 39736, 0x000081F9 }, /* GL_SINGLE_COLOR */
+ { 39752, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */
+ { 39772, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */
+ { 39791, 0x00008C46 }, /* GL_SLUMINANCE */
+ { 39805, 0x00008C47 }, /* GL_SLUMINANCE8 */
+ { 39820, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */
+ { 39842, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */
+ { 39862, 0x00001D01 }, /* GL_SMOOTH */
+ { 39872, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */
+ { 39905, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */
+ { 39932, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */
+ { 39965, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */
+ { 39992, 0x00008588 }, /* GL_SOURCE0_ALPHA */
+ { 40009, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */
+ { 40030, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */
+ { 40051, 0x00008580 }, /* GL_SOURCE0_RGB */
+ { 40066, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */
+ { 40085, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */
+ { 40104, 0x00008589 }, /* GL_SOURCE1_ALPHA */
+ { 40121, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */
+ { 40142, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */
+ { 40163, 0x00008581 }, /* GL_SOURCE1_RGB */
+ { 40178, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */
+ { 40197, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */
+ { 40216, 0x0000858A }, /* GL_SOURCE2_ALPHA */
+ { 40233, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */
+ { 40254, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */
+ { 40275, 0x00008582 }, /* GL_SOURCE2_RGB */
+ { 40290, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */
+ { 40309, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */
+ { 40328, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */
+ { 40348, 0x00008583 }, /* GL_SOURCE3_RGB_NV */
+ { 40366, 0x00001202 }, /* GL_SPECULAR */
+ { 40378, 0x00002402 }, /* GL_SPHERE_MAP */
+ { 40392, 0x00001206 }, /* GL_SPOT_CUTOFF */
+ { 40407, 0x00001204 }, /* GL_SPOT_DIRECTION */
+ { 40425, 0x00001205 }, /* GL_SPOT_EXPONENT */
+ { 40442, 0x00008588 }, /* GL_SRC0_ALPHA */
+ { 40456, 0x00008580 }, /* GL_SRC0_RGB */
+ { 40468, 0x00008589 }, /* GL_SRC1_ALPHA */
+ { 40482, 0x00008581 }, /* GL_SRC1_RGB */
+ { 40494, 0x0000858A }, /* GL_SRC2_ALPHA */
+ { 40508, 0x00008582 }, /* GL_SRC2_RGB */
+ { 40520, 0x00000302 }, /* GL_SRC_ALPHA */
+ { 40533, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */
+ { 40555, 0x00000300 }, /* GL_SRC_COLOR */
+ { 40568, 0x00008C40 }, /* GL_SRGB */
+ { 40576, 0x00008C41 }, /* GL_SRGB8 */
+ { 40585, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */
+ { 40601, 0x00008C42 }, /* GL_SRGB_ALPHA */
+ { 40615, 0x00000503 }, /* GL_STACK_OVERFLOW */
+ { 40633, 0x00000504 }, /* GL_STACK_UNDERFLOW */
+ { 40652, 0x000088E6 }, /* GL_STATIC_COPY */
+ { 40667, 0x000088E6 }, /* GL_STATIC_COPY_ARB */
+ { 40686, 0x000088E4 }, /* GL_STATIC_DRAW */
+ { 40701, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */
+ { 40720, 0x000088E5 }, /* GL_STATIC_READ */
+ { 40735, 0x000088E5 }, /* GL_STATIC_READ_ARB */
+ { 40754, 0x00001802 }, /* GL_STENCIL */
+ { 40765, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */
+ { 40787, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */
+ { 40813, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_OES */
+ { 40839, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */
+ { 40860, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */
+ { 40885, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */
+ { 40906, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */
+ { 40931, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ { 40963, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */
+ { 40999, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ { 41031, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */
+ { 41067, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */
+ { 41087, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */
+ { 41114, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */
+ { 41140, 0x00000D57 }, /* GL_STENCIL_BITS */
+ { 41156, 0x00008224 }, /* GL_STENCIL_BUFFER */
+ { 41174, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */
+ { 41196, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */
+ { 41219, 0x00000B94 }, /* GL_STENCIL_FAIL */
+ { 41235, 0x00000B92 }, /* GL_STENCIL_FUNC */
+ { 41251, 0x00001901 }, /* GL_STENCIL_INDEX */
+ { 41268, 0x00008D46 }, /* GL_STENCIL_INDEX1 */
+ { 41286, 0x00008D49 }, /* GL_STENCIL_INDEX16 */
+ { 41305, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */
+ { 41328, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */
+ { 41350, 0x00008D46 }, /* GL_STENCIL_INDEX1_OES */
+ { 41372, 0x00008D47 }, /* GL_STENCIL_INDEX4 */
+ { 41390, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */
+ { 41412, 0x00008D47 }, /* GL_STENCIL_INDEX4_OES */
+ { 41434, 0x00008D48 }, /* GL_STENCIL_INDEX8 */
+ { 41452, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */
+ { 41474, 0x00008D48 }, /* GL_STENCIL_INDEX8_OES */
+ { 41496, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */
+ { 41517, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ { 41544, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */
+ { 41571, 0x00000B97 }, /* GL_STENCIL_REF */
+ { 41586, 0x00000B90 }, /* GL_STENCIL_TEST */
+ { 41602, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ { 41631, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */
+ { 41653, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */
+ { 41674, 0x00000C33 }, /* GL_STEREO */
+ { 41684, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */
+ { 41708, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */
+ { 41733, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */
+ { 41757, 0x000088E2 }, /* GL_STREAM_COPY */
+ { 41772, 0x000088E2 }, /* GL_STREAM_COPY_ARB */
+ { 41791, 0x000088E0 }, /* GL_STREAM_DRAW */
+ { 41806, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */
+ { 41825, 0x000088E1 }, /* GL_STREAM_READ */
+ { 41840, 0x000088E1 }, /* GL_STREAM_READ_ARB */
+ { 41859, 0x00000D50 }, /* GL_SUBPIXEL_BITS */
+ { 41876, 0x000084E7 }, /* GL_SUBTRACT */
+ { 41888, 0x000084E7 }, /* GL_SUBTRACT_ARB */
+ { 41904, 0x00009113 }, /* GL_SYNC_CONDITION */
+ { 41922, 0x00009116 }, /* GL_SYNC_FENCE */
+ { 41936, 0x00009115 }, /* GL_SYNC_FLAGS */
+ { 41950, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */
+ { 41977, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
+ { 42007, 0x00009114 }, /* GL_SYNC_STATUS */
+ { 42022, 0x00002001 }, /* GL_T */
+ { 42027, 0x00002A2A }, /* GL_T2F_C3F_V3F */
+ { 42042, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */
+ { 42061, 0x00002A29 }, /* GL_T2F_C4UB_V3F */
+ { 42077, 0x00002A2B }, /* GL_T2F_N3F_V3F */
+ { 42092, 0x00002A27 }, /* GL_T2F_V3F */
+ { 42103, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */
+ { 42122, 0x00002A28 }, /* GL_T4F_V4F */
+ { 42133, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */
+ { 42156, 0x00001702 }, /* GL_TEXTURE */
+ { 42167, 0x000084C0 }, /* GL_TEXTURE0 */
+ { 42179, 0x000084C0 }, /* GL_TEXTURE0_ARB */
+ { 42195, 0x000084C1 }, /* GL_TEXTURE1 */
+ { 42207, 0x000084CA }, /* GL_TEXTURE10 */
+ { 42220, 0x000084CA }, /* GL_TEXTURE10_ARB */
+ { 42237, 0x000084CB }, /* GL_TEXTURE11 */
+ { 42250, 0x000084CB }, /* GL_TEXTURE11_ARB */
+ { 42267, 0x000084CC }, /* GL_TEXTURE12 */
+ { 42280, 0x000084CC }, /* GL_TEXTURE12_ARB */
+ { 42297, 0x000084CD }, /* GL_TEXTURE13 */
+ { 42310, 0x000084CD }, /* GL_TEXTURE13_ARB */
+ { 42327, 0x000084CE }, /* GL_TEXTURE14 */
+ { 42340, 0x000084CE }, /* GL_TEXTURE14_ARB */
+ { 42357, 0x000084CF }, /* GL_TEXTURE15 */
+ { 42370, 0x000084CF }, /* GL_TEXTURE15_ARB */
+ { 42387, 0x000084D0 }, /* GL_TEXTURE16 */
+ { 42400, 0x000084D0 }, /* GL_TEXTURE16_ARB */
+ { 42417, 0x000084D1 }, /* GL_TEXTURE17 */
+ { 42430, 0x000084D1 }, /* GL_TEXTURE17_ARB */
+ { 42447, 0x000084D2 }, /* GL_TEXTURE18 */
+ { 42460, 0x000084D2 }, /* GL_TEXTURE18_ARB */
+ { 42477, 0x000084D3 }, /* GL_TEXTURE19 */
+ { 42490, 0x000084D3 }, /* GL_TEXTURE19_ARB */
+ { 42507, 0x000084C1 }, /* GL_TEXTURE1_ARB */
+ { 42523, 0x000084C2 }, /* GL_TEXTURE2 */
+ { 42535, 0x000084D4 }, /* GL_TEXTURE20 */
+ { 42548, 0x000084D4 }, /* GL_TEXTURE20_ARB */
+ { 42565, 0x000084D5 }, /* GL_TEXTURE21 */
+ { 42578, 0x000084D5 }, /* GL_TEXTURE21_ARB */
+ { 42595, 0x000084D6 }, /* GL_TEXTURE22 */
+ { 42608, 0x000084D6 }, /* GL_TEXTURE22_ARB */
+ { 42625, 0x000084D7 }, /* GL_TEXTURE23 */
+ { 42638, 0x000084D7 }, /* GL_TEXTURE23_ARB */
+ { 42655, 0x000084D8 }, /* GL_TEXTURE24 */
+ { 42668, 0x000084D8 }, /* GL_TEXTURE24_ARB */
+ { 42685, 0x000084D9 }, /* GL_TEXTURE25 */
+ { 42698, 0x000084D9 }, /* GL_TEXTURE25_ARB */
+ { 42715, 0x000084DA }, /* GL_TEXTURE26 */
+ { 42728, 0x000084DA }, /* GL_TEXTURE26_ARB */
+ { 42745, 0x000084DB }, /* GL_TEXTURE27 */
+ { 42758, 0x000084DB }, /* GL_TEXTURE27_ARB */
+ { 42775, 0x000084DC }, /* GL_TEXTURE28 */
+ { 42788, 0x000084DC }, /* GL_TEXTURE28_ARB */
+ { 42805, 0x000084DD }, /* GL_TEXTURE29 */
+ { 42818, 0x000084DD }, /* GL_TEXTURE29_ARB */
+ { 42835, 0x000084C2 }, /* GL_TEXTURE2_ARB */
+ { 42851, 0x000084C3 }, /* GL_TEXTURE3 */
+ { 42863, 0x000084DE }, /* GL_TEXTURE30 */
+ { 42876, 0x000084DE }, /* GL_TEXTURE30_ARB */
+ { 42893, 0x000084DF }, /* GL_TEXTURE31 */
+ { 42906, 0x000084DF }, /* GL_TEXTURE31_ARB */
+ { 42923, 0x000084C3 }, /* GL_TEXTURE3_ARB */
+ { 42939, 0x000084C4 }, /* GL_TEXTURE4 */
+ { 42951, 0x000084C4 }, /* GL_TEXTURE4_ARB */
+ { 42967, 0x000084C5 }, /* GL_TEXTURE5 */
+ { 42979, 0x000084C5 }, /* GL_TEXTURE5_ARB */
+ { 42995, 0x000084C6 }, /* GL_TEXTURE6 */
+ { 43007, 0x000084C6 }, /* GL_TEXTURE6_ARB */
+ { 43023, 0x000084C7 }, /* GL_TEXTURE7 */
+ { 43035, 0x000084C7 }, /* GL_TEXTURE7_ARB */
+ { 43051, 0x000084C8 }, /* GL_TEXTURE8 */
+ { 43063, 0x000084C8 }, /* GL_TEXTURE8_ARB */
+ { 43079, 0x000084C9 }, /* GL_TEXTURE9 */
+ { 43091, 0x000084C9 }, /* GL_TEXTURE9_ARB */
+ { 43107, 0x00000DE0 }, /* GL_TEXTURE_1D */
+ { 43121, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY */
+ { 43141, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */
+ { 43165, 0x00000DE1 }, /* GL_TEXTURE_2D */
+ { 43179, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY */
+ { 43199, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */
+ { 43223, 0x0000806F }, /* GL_TEXTURE_3D */
+ { 43237, 0x0000806F }, /* GL_TEXTURE_3D_OES */
+ { 43255, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */
+ { 43277, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */
+ { 43303, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */
+ { 43325, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */
+ { 43347, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY */
+ { 43375, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */
+ { 43407, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */
+ { 43429, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY */
+ { 43457, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */
+ { 43489, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */
+ { 43511, 0x0000806A }, /* GL_TEXTURE_BINDING_3D_OES */
+ { 43537, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER */
+ { 43563, 0x00008C2C }, /* GL_TEXTURE_BINDING_BUFFER_ARB */
+ { 43593, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ { 43621, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */
+ { 43653, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_OES */
+ { 43685, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE */
+ { 43714, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */
+ { 43747, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */
+ { 43779, 0x00040000 }, /* GL_TEXTURE_BIT */
+ { 43794, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */
+ { 43815, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */
+ { 43840, 0x00001005 }, /* GL_TEXTURE_BORDER */
+ { 43858, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */
+ { 43882, 0x00008C2A }, /* GL_TEXTURE_BUFFER */
+ { 43900, 0x00008C2A }, /* GL_TEXTURE_BUFFER_ARB */
+ { 43922, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
+ { 43959, 0x00008C2D }, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB */
+ { 44000, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT */
+ { 44025, 0x00008C2E }, /* GL_TEXTURE_BUFFER_FORMAT_ARB */
+ { 44054, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ { 44085, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ { 44115, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ { 44145, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ { 44180, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ { 44211, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ { 44249, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ { 44276, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ { 44308, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ { 44342, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */
+ { 44366, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */
+ { 44394, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */
+ { 44418, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */
+ { 44446, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ { 44479, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */
+ { 44503, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */
+ { 44525, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */
+ { 44547, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */
+ { 44573, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */
+ { 44607, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ { 44640, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */
+ { 44677, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */
+ { 44705, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */
+ { 44737, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */
+ { 44760, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ { 44798, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */
+ { 44840, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ { 44871, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ { 44899, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ { 44929, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ { 44957, 0x00008B9D }, /* GL_TEXTURE_CROP_RECT_OES */
+ { 44982, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */
+ { 45002, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */
+ { 45026, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ { 45057, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */
+ { 45092, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES */
+ { 45127, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ { 45158, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */
+ { 45193, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES */
+ { 45228, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ { 45259, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */
+ { 45294, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES */
+ { 45329, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_OES */
+ { 45353, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ { 45384, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */
+ { 45419, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES */
+ { 45454, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ { 45485, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */
+ { 45520, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES */
+ { 45555, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ { 45586, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */
+ { 45621, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES */
+ { 45656, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
+ { 45685, 0x00008071 }, /* GL_TEXTURE_DEPTH */
+ { 45702, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */
+ { 45724, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */
+ { 45750, 0x00002300 }, /* GL_TEXTURE_ENV */
+ { 45765, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */
+ { 45786, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */
+ { 45806, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */
+ { 45832, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL_EXT */
+ { 45862, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */
+ { 45882, 0x00002500 }, /* GL_TEXTURE_GEN_MODE_OES */
+ { 45906, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */
+ { 45923, 0x00000C62 }, /* GL_TEXTURE_GEN_R */
+ { 45940, 0x00000C60 }, /* GL_TEXTURE_GEN_S */
+ { 45957, 0x00008D60 }, /* GL_TEXTURE_GEN_STR_OES */
+ { 45980, 0x00000C61 }, /* GL_TEXTURE_GEN_T */
+ { 45997, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ { 46022, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */
+ { 46044, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */
+ { 46070, 0x00001001 }, /* GL_TEXTURE_HEIGHT */
+ { 46088, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ { 46114, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */
+ { 46140, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */
+ { 46170, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */
+ { 46197, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ { 46222, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */
+ { 46242, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */
+ { 46266, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ { 46293, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ { 46320, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ { 46347, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */
+ { 46373, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */
+ { 46403, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */
+ { 46425, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */
+ { 46443, 0x0000898F }, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
+ { 46483, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ { 46513, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ { 46541, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ { 46569, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ { 46597, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */
+ { 46618, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */
+ { 46637, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */
+ { 46659, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */
+ { 46678, 0x00008066 }, /* GL_TEXTURE_PRIORITY */
+ { 46698, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
+ { 46728, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */
+ { 46759, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE */
+ { 46780, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */
+ { 46805, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */
+ { 46829, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */
+ { 46849, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */
+ { 46873, 0x00008067 }, /* GL_TEXTURE_RESIDENT */
+ { 46893, 0x00008C3F }, /* GL_TEXTURE_SHARED_SIZE */
+ { 46916, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */
+ { 46939, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */
+ { 46963, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */
+ { 46991, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */
+ { 47021, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */
+ { 47046, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ { 47080, 0x00001000 }, /* GL_TEXTURE_WIDTH */
+ { 47097, 0x00008072 }, /* GL_TEXTURE_WRAP_R */
+ { 47115, 0x00008072 }, /* GL_TEXTURE_WRAP_R_OES */
+ { 47137, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
+ { 47155, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
+ { 47173, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */
+ { 47192, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
+ { 47212, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
+ { 47231, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ { 47260, 0x00001000 }, /* GL_TRANSFORM_BIT */
+ { 47277, 0x00008E22 }, /* GL_TRANSFORM_FEEDBACK */
+ { 47299, 0x00008E25 }, /* GL_TRANSFORM_FEEDBACK_BINDING */
+ { 47329, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER */
+ { 47358, 0x00008E24 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
+ { 47394, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
+ { 47431, 0x00008C8F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT */
+ { 47472, 0x00008C8E }, /* GL_TRANSFORM_FEEDBACK_BUFFER_EXT */
+ { 47505, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
+ { 47539, 0x00008C7F }, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT */
+ { 47577, 0x00008E23 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
+ { 47613, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
+ { 47647, 0x00008C85 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT */
+ { 47685, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
+ { 47720, 0x00008C84 }, /* GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT */
+ { 47759, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
+ { 47800, 0x00008C88 }, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT */
+ { 47845, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
+ { 47876, 0x00008C83 }, /* GL_TRANSFORM_FEEDBACK_VARYINGS_EXT */
+ { 47911, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
+ { 47952, 0x00008C76 }, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT */
+ { 47997, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
+ { 48023, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
+ { 48053, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ { 48085, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ { 48115, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
+ { 48149, 0x0000862C }, /* GL_TRANSPOSE_NV */
+ { 48165, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ { 48196, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
+ { 48231, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ { 48259, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
+ { 48291, 0x00000004 }, /* GL_TRIANGLES */
+ { 48304, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY */
+ { 48327, 0x0000000C }, /* GL_TRIANGLES_ADJACENCY_ARB */
+ { 48354, 0x00000006 }, /* GL_TRIANGLE_FAN */
+ { 48370, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
+ { 48391, 0x00000005 }, /* GL_TRIANGLE_STRIP */
+ { 48409, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY */
+ { 48437, 0x0000000D }, /* GL_TRIANGLE_STRIP_ADJACENCY_ARB */
+ { 48469, 0x00000001 }, /* GL_TRUE */
+ { 48477, 0x00008A1C }, /* GL_UNDEFINED_APPLE */
+ { 48496, 0x00008255 }, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
+ { 48525, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
+ { 48545, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
+ { 48568, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
+ { 48588, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
+ { 48609, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
+ { 48631, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
+ { 48653, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
+ { 48673, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
+ { 48694, 0x00009118 }, /* GL_UNSIGNALED */
+ { 48708, 0x00001401 }, /* GL_UNSIGNED_BYTE */
+ { 48725, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ { 48752, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
+ { 48775, 0x00001405 }, /* GL_UNSIGNED_INT */
+ { 48791, 0x00008C3B }, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
+ { 48823, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
+ { 48850, 0x00008DF6 }, /* GL_UNSIGNED_INT_10_10_10_2_OES */
+ { 48881, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */
+ { 48902, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */
+ { 48927, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
+ { 48951, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_OES */
+ { 48976, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ { 49007, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV_EXT */
+ { 49042, 0x00008C3E }, /* GL_UNSIGNED_INT_5_9_9_9_REV */
+ { 49070, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
+ { 49094, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ { 49122, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D */
+ { 49149, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
+ { 49182, 0x00008DD6 }, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT */
+ { 49219, 0x00008DD1 }, /* GL_UNSIGNED_INT_SAMPLER_1D_EXT */
+ { 49250, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D */
+ { 49277, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
+ { 49310, 0x00008DD7 }, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT */
+ { 49347, 0x00008DD2 }, /* GL_UNSIGNED_INT_SAMPLER_2D_EXT */
+ { 49378, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
+ { 49410, 0x00008DD5 }, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT */
+ { 49446, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D */
+ { 49473, 0x00008DD3 }, /* GL_UNSIGNED_INT_SAMPLER_3D_EXT */
+ { 49504, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
+ { 49535, 0x00008DD8 }, /* GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT */
+ { 49570, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
+ { 49599, 0x00008DD4 }, /* GL_UNSIGNED_INT_SAMPLER_CUBE_EXT */
+ { 49632, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2 */
+ { 49653, 0x00008DC6 }, /* GL_UNSIGNED_INT_VEC2_EXT */
+ { 49678, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3 */
+ { 49699, 0x00008DC7 }, /* GL_UNSIGNED_INT_VEC3_EXT */
+ { 49724, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4 */
+ { 49745, 0x00008DC8 }, /* GL_UNSIGNED_INT_VEC4_EXT */
+ { 49770, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */
+ { 49793, 0x00001403 }, /* GL_UNSIGNED_SHORT */
+ { 49811, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ { 49841, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT */
+ { 49875, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ { 49901, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ { 49931, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT */
+ { 49965, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ { 49991, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
+ { 50015, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ { 50043, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ { 50071, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
+ { 50098, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ { 50130, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
+ { 50161, 0x00008CA2 }, /* GL_UPPER_LEFT */
+ { 50175, 0x00002A20 }, /* GL_V2F */
+ { 50182, 0x00002A21 }, /* GL_V3F */
+ { 50189, 0x00008B83 }, /* GL_VALIDATE_STATUS */
+ { 50208, 0x00001F00 }, /* GL_VENDOR */
+ { 50218, 0x00001F02 }, /* GL_VERSION */
+ { 50229, 0x00008074 }, /* GL_VERTEX_ARRAY */
+ { 50245, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */
+ { 50269, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ { 50299, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ { 50330, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
+ { 50365, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
+ { 50389, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
+ { 50410, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
+ { 50433, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
+ { 50454, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ { 50481, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ { 50509, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ { 50537, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ { 50565, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ { 50593, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ { 50621, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ { 50649, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ { 50676, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ { 50703, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ { 50730, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ { 50757, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ { 50784, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ { 50811, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ { 50838, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ { 50865, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ { 50892, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ { 50930, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
+ { 50972, 0x000088FE }, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
+ { 51007, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ { 51038, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
+ { 51073, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
+ { 51104, 0x000088FD }, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT */
+ { 51139, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ { 51173, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
+ { 51211, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ { 51242, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
+ { 51277, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ { 51305, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
+ { 51337, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ { 51367, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
+ { 51401, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ { 51429, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
+ { 51461, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
+ { 51481, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
+ { 51503, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ { 51532, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
+ { 51553, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ { 51582, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
+ { 51615, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ { 51647, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ { 51674, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
+ { 51705, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ { 51735, 0x00008B31 }, /* GL_VERTEX_SHADER */
+ { 51752, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
+ { 51773, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
+ { 51800, 0x00000BA2 }, /* GL_VIEWPORT */
+ { 51812, 0x00000800 }, /* GL_VIEWPORT_BIT */
+ { 51828, 0x00008A1A }, /* GL_VOLATILE_APPLE */
+ { 51846, 0x0000911D }, /* GL_WAIT_FAILED */
+ { 51861, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
+ { 51881, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ { 51912, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
+ { 51947, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_OES */
+ { 51982, 0x000086AD }, /* GL_WEIGHT_ARRAY_OES */
+ { 52002, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ { 52030, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_OES */
+ { 52058, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ { 52083, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_OES */
+ { 52108, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ { 52135, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_OES */
+ { 52162, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ { 52187, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_OES */
+ { 52212, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
+ { 52236, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
+ { 52255, 0x000088B9 }, /* GL_WRITE_ONLY */
+ { 52269, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
+ { 52287, 0x000088B9 }, /* GL_WRITE_ONLY_OES */
+ { 52305, 0x00001506 }, /* GL_XOR */
+ { 52312, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
+ { 52331, 0x00008757 }, /* GL_YCBCR_MESA */
+ { 52345, 0x00000000 }, /* GL_ZERO */
+ { 52353, 0x00000D16 }, /* GL_ZOOM_X */
+ { 52363, 0x00000D17 }, /* GL_ZOOM_Y */
};
static const unsigned reduced_enums[1564] =
{
- 539, /* GL_FALSE */
- 835, /* GL_LINES */
- 839, /* GL_LINE_LOOP */
- 846, /* GL_LINE_STRIP */
- 2157, /* GL_TRIANGLES */
- 2162, /* GL_TRIANGLE_STRIP */
- 2160, /* GL_TRIANGLE_FAN */
- 1522, /* GL_QUADS */
- 1526, /* GL_QUAD_STRIP */
- 1390, /* GL_POLYGON */
- 836, /* GL_LINES_ADJACENCY */
- 847, /* GL_LINE_STRIP_ADJACENCY */
- 2158, /* GL_TRIANGLES_ADJACENCY */
- 2163, /* GL_TRIANGLE_STRIP_ADJACENCY */
- 1402, /* GL_POLYGON_STIPPLE_BIT */
- 1345, /* GL_PIXEL_MODE_BIT */
- 822, /* GL_LIGHTING_BIT */
- 573, /* GL_FOG_BIT */
+ 555, /* GL_FALSE */
+ 851, /* GL_LINES */
+ 855, /* GL_LINE_LOOP */
+ 862, /* GL_LINE_STRIP */
+ 2174, /* GL_TRIANGLES */
+ 2179, /* GL_TRIANGLE_STRIP */
+ 2177, /* GL_TRIANGLE_FAN */
+ 1539, /* GL_QUADS */
+ 1543, /* GL_QUAD_STRIP */
+ 1407, /* GL_POLYGON */
+ 852, /* GL_LINES_ADJACENCY */
+ 863, /* GL_LINE_STRIP_ADJACENCY */
+ 2175, /* GL_TRIANGLES_ADJACENCY */
+ 2180, /* GL_TRIANGLE_STRIP_ADJACENCY */
+ 1419, /* GL_POLYGON_STIPPLE_BIT */
+ 1362, /* GL_PIXEL_MODE_BIT */
+ 838, /* GL_LIGHTING_BIT */
+ 589, /* GL_FOG_BIT */
8, /* GL_ACCUM */
- 858, /* GL_LOAD */
- 1612, /* GL_RETURN */
- 1210, /* GL_MULT */
+ 874, /* GL_LOAD */
+ 1629, /* GL_RETURN */
+ 1227, /* GL_MULT */
24, /* GL_ADD */
- 1226, /* GL_NEVER */
- 812, /* GL_LESS */
- 529, /* GL_EQUAL */
- 811, /* GL_LEQUAL */
- 696, /* GL_GREATER */
- 1243, /* GL_NOTEQUAL */
- 695, /* GL_GEQUAL */
+ 1243, /* GL_NEVER */
+ 828, /* GL_LESS */
+ 545, /* GL_EQUAL */
+ 827, /* GL_LEQUAL */
+ 712, /* GL_GREATER */
+ 1260, /* GL_NOTEQUAL */
+ 711, /* GL_GEQUAL */
55, /* GL_ALWAYS */
- 1821, /* GL_SRC_COLOR */
- 1278, /* GL_ONE_MINUS_SRC_COLOR */
- 1819, /* GL_SRC_ALPHA */
- 1277, /* GL_ONE_MINUS_SRC_ALPHA */
- 508, /* GL_DST_ALPHA */
- 1275, /* GL_ONE_MINUS_DST_ALPHA */
- 509, /* GL_DST_COLOR */
- 1276, /* GL_ONE_MINUS_DST_COLOR */
- 1820, /* GL_SRC_ALPHA_SATURATE */
- 672, /* GL_FRONT_LEFT */
- 673, /* GL_FRONT_RIGHT */
+ 1838, /* GL_SRC_COLOR */
+ 1295, /* GL_ONE_MINUS_SRC_COLOR */
+ 1836, /* GL_SRC_ALPHA */
+ 1294, /* GL_ONE_MINUS_SRC_ALPHA */
+ 524, /* GL_DST_ALPHA */
+ 1292, /* GL_ONE_MINUS_DST_ALPHA */
+ 525, /* GL_DST_COLOR */
+ 1293, /* GL_ONE_MINUS_DST_COLOR */
+ 1837, /* GL_SRC_ALPHA_SATURATE */
+ 688, /* GL_FRONT_LEFT */
+ 689, /* GL_FRONT_RIGHT */
77, /* GL_BACK_LEFT */
78, /* GL_BACK_RIGHT */
- 669, /* GL_FRONT */
+ 685, /* GL_FRONT */
76, /* GL_BACK */
- 810, /* GL_LEFT */
- 1702, /* GL_RIGHT */
- 670, /* GL_FRONT_AND_BACK */
+ 826, /* GL_LEFT */
+ 1719, /* GL_RIGHT */
+ 686, /* GL_FRONT_AND_BACK */
71, /* GL_AUX0 */
72, /* GL_AUX1 */
73, /* GL_AUX2 */
74, /* GL_AUX3 */
- 798, /* GL_INVALID_ENUM */
- 803, /* GL_INVALID_VALUE */
- 802, /* GL_INVALID_OPERATION */
- 1826, /* GL_STACK_OVERFLOW */
- 1827, /* GL_STACK_UNDERFLOW */
- 1303, /* GL_OUT_OF_MEMORY */
- 799, /* GL_INVALID_FRAMEBUFFER_OPERATION */
+ 814, /* GL_INVALID_ENUM */
+ 819, /* GL_INVALID_VALUE */
+ 818, /* GL_INVALID_OPERATION */
+ 1843, /* GL_STACK_OVERFLOW */
+ 1844, /* GL_STACK_UNDERFLOW */
+ 1320, /* GL_OUT_OF_MEMORY */
+ 815, /* GL_INVALID_FRAMEBUFFER_OPERATION */
0, /* GL_2D */
2, /* GL_3D */
3, /* GL_3D_COLOR */
4, /* GL_3D_COLOR_TEXTURE */
6, /* GL_4D_COLOR_TEXTURE */
- 1323, /* GL_PASS_THROUGH_TOKEN */
- 1389, /* GL_POINT_TOKEN */
- 849, /* GL_LINE_TOKEN */
- 1403, /* GL_POLYGON_TOKEN */
+ 1340, /* GL_PASS_THROUGH_TOKEN */
+ 1406, /* GL_POINT_TOKEN */
+ 865, /* GL_LINE_TOKEN */
+ 1420, /* GL_POLYGON_TOKEN */
87, /* GL_BITMAP_TOKEN */
- 507, /* GL_DRAW_PIXEL_TOKEN */
+ 523, /* GL_DRAW_PIXEL_TOKEN */
353, /* GL_COPY_PIXEL_TOKEN */
- 840, /* GL_LINE_RESET_TOKEN */
- 532, /* GL_EXP */
- 533, /* GL_EXP2 */
+ 856, /* GL_LINE_RESET_TOKEN */
+ 548, /* GL_EXP */
+ 549, /* GL_EXP2 */
390, /* GL_CW */
154, /* GL_CCW */
187, /* GL_COEFF */
- 1300, /* GL_ORDER */
+ 1317, /* GL_ORDER */
444, /* GL_DOMAIN */
363, /* GL_CURRENT_COLOR */
366, /* GL_CURRENT_INDEX */
@@ -4771,67 +4805,67 @@ static const unsigned reduced_enums[1564] =
381, /* GL_CURRENT_RASTER_POSITION */
382, /* GL_CURRENT_RASTER_POSITION_VALID */
379, /* GL_CURRENT_RASTER_DISTANCE */
- 1381, /* GL_POINT_SMOOTH */
- 1365, /* GL_POINT_SIZE */
- 1380, /* GL_POINT_SIZE_RANGE */
- 1371, /* GL_POINT_SIZE_GRANULARITY */
- 841, /* GL_LINE_SMOOTH */
- 850, /* GL_LINE_WIDTH */
- 852, /* GL_LINE_WIDTH_RANGE */
- 851, /* GL_LINE_WIDTH_GRANULARITY */
- 843, /* GL_LINE_STIPPLE */
- 844, /* GL_LINE_STIPPLE_PATTERN */
- 845, /* GL_LINE_STIPPLE_REPEAT */
- 857, /* GL_LIST_MODE */
- 1065, /* GL_MAX_LIST_NESTING */
- 854, /* GL_LIST_BASE */
- 856, /* GL_LIST_INDEX */
- 1392, /* GL_POLYGON_MODE */
- 1399, /* GL_POLYGON_SMOOTH */
- 1401, /* GL_POLYGON_STIPPLE */
- 518, /* GL_EDGE_FLAG */
+ 1398, /* GL_POINT_SMOOTH */
+ 1382, /* GL_POINT_SIZE */
+ 1397, /* GL_POINT_SIZE_RANGE */
+ 1388, /* GL_POINT_SIZE_GRANULARITY */
+ 857, /* GL_LINE_SMOOTH */
+ 866, /* GL_LINE_WIDTH */
+ 868, /* GL_LINE_WIDTH_RANGE */
+ 867, /* GL_LINE_WIDTH_GRANULARITY */
+ 859, /* GL_LINE_STIPPLE */
+ 860, /* GL_LINE_STIPPLE_PATTERN */
+ 861, /* GL_LINE_STIPPLE_REPEAT */
+ 873, /* GL_LIST_MODE */
+ 1082, /* GL_MAX_LIST_NESTING */
+ 870, /* GL_LIST_BASE */
+ 872, /* GL_LIST_INDEX */
+ 1409, /* GL_POLYGON_MODE */
+ 1416, /* GL_POLYGON_SMOOTH */
+ 1418, /* GL_POLYGON_STIPPLE */
+ 534, /* GL_EDGE_FLAG */
356, /* GL_CULL_FACE */
357, /* GL_CULL_FACE_MODE */
- 671, /* GL_FRONT_FACE */
- 821, /* GL_LIGHTING */
- 826, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
- 827, /* GL_LIGHT_MODEL_TWO_SIDE */
- 823, /* GL_LIGHT_MODEL_AMBIENT */
- 1768, /* GL_SHADE_MODEL */
+ 687, /* GL_FRONT_FACE */
+ 837, /* GL_LIGHTING */
+ 842, /* GL_LIGHT_MODEL_LOCAL_VIEWER */
+ 843, /* GL_LIGHT_MODEL_TWO_SIDE */
+ 839, /* GL_LIGHT_MODEL_AMBIENT */
+ 1785, /* GL_SHADE_MODEL */
235, /* GL_COLOR_MATERIAL_FACE */
236, /* GL_COLOR_MATERIAL_PARAMETER */
234, /* GL_COLOR_MATERIAL */
- 572, /* GL_FOG */
- 594, /* GL_FOG_INDEX */
- 590, /* GL_FOG_DENSITY */
- 598, /* GL_FOG_START */
- 592, /* GL_FOG_END */
- 595, /* GL_FOG_MODE */
- 574, /* GL_FOG_COLOR */
+ 588, /* GL_FOG */
+ 610, /* GL_FOG_INDEX */
+ 606, /* GL_FOG_DENSITY */
+ 614, /* GL_FOG_START */
+ 608, /* GL_FOG_END */
+ 611, /* GL_FOG_MODE */
+ 590, /* GL_FOG_COLOR */
429, /* GL_DEPTH_RANGE */
438, /* GL_DEPTH_TEST */
441, /* GL_DEPTH_WRITEMASK */
414, /* GL_DEPTH_CLEAR_VALUE */
428, /* GL_DEPTH_FUNC */
12, /* GL_ACCUM_CLEAR_VALUE */
- 1871, /* GL_STENCIL_TEST */
- 1852, /* GL_STENCIL_CLEAR_VALUE */
- 1854, /* GL_STENCIL_FUNC */
- 1873, /* GL_STENCIL_VALUE_MASK */
- 1853, /* GL_STENCIL_FAIL */
- 1868, /* GL_STENCIL_PASS_DEPTH_FAIL */
- 1869, /* GL_STENCIL_PASS_DEPTH_PASS */
- 1870, /* GL_STENCIL_REF */
- 1874, /* GL_STENCIL_WRITEMASK */
- 1015, /* GL_MATRIX_MODE */
- 1232, /* GL_NORMALIZE */
- 2290, /* GL_VIEWPORT */
- 1205, /* GL_MODELVIEW_STACK_DEPTH */
- 1496, /* GL_PROJECTION_STACK_DEPTH */
- 2111, /* GL_TEXTURE_STACK_DEPTH */
- 1202, /* GL_MODELVIEW_MATRIX */
- 1494, /* GL_PROJECTION_MATRIX */
- 2091, /* GL_TEXTURE_MATRIX */
+ 1888, /* GL_STENCIL_TEST */
+ 1869, /* GL_STENCIL_CLEAR_VALUE */
+ 1871, /* GL_STENCIL_FUNC */
+ 1890, /* GL_STENCIL_VALUE_MASK */
+ 1870, /* GL_STENCIL_FAIL */
+ 1885, /* GL_STENCIL_PASS_DEPTH_FAIL */
+ 1886, /* GL_STENCIL_PASS_DEPTH_PASS */
+ 1887, /* GL_STENCIL_REF */
+ 1891, /* GL_STENCIL_WRITEMASK */
+ 1031, /* GL_MATRIX_MODE */
+ 1249, /* GL_NORMALIZE */
+ 2307, /* GL_VIEWPORT */
+ 1222, /* GL_MODELVIEW_STACK_DEPTH */
+ 1513, /* GL_PROJECTION_STACK_DEPTH */
+ 2128, /* GL_TEXTURE_STACK_DEPTH */
+ 1219, /* GL_MODELVIEW_MATRIX */
+ 1511, /* GL_PROJECTION_MATRIX */
+ 2108, /* GL_TEXTURE_MATRIX */
69, /* GL_ATTRIB_STACK_DEPTH */
169, /* GL_CLIENT_ATTRIB_STACK_DEPTH */
51, /* GL_ALPHA_TEST */
@@ -4841,267 +4875,267 @@ static const unsigned reduced_enums[1564] =
91, /* GL_BLEND_DST */
105, /* GL_BLEND_SRC */
88, /* GL_BLEND */
- 860, /* GL_LOGIC_OP_MODE */
- 745, /* GL_INDEX_LOGIC_OP */
+ 876, /* GL_LOGIC_OP_MODE */
+ 761, /* GL_INDEX_LOGIC_OP */
233, /* GL_COLOR_LOGIC_OP */
75, /* GL_AUX_BUFFERS */
454, /* GL_DRAW_BUFFER */
- 1549, /* GL_READ_BUFFER */
- 1745, /* GL_SCISSOR_BOX */
- 1746, /* GL_SCISSOR_TEST */
- 744, /* GL_INDEX_CLEAR_VALUE */
- 749, /* GL_INDEX_WRITEMASK */
+ 1566, /* GL_READ_BUFFER */
+ 1762, /* GL_SCISSOR_BOX */
+ 1763, /* GL_SCISSOR_TEST */
+ 760, /* GL_INDEX_CLEAR_VALUE */
+ 765, /* GL_INDEX_WRITEMASK */
230, /* GL_COLOR_CLEAR_VALUE */
272, /* GL_COLOR_WRITEMASK */
- 746, /* GL_INDEX_MODE */
- 1691, /* GL_RGBA_MODE */
+ 762, /* GL_INDEX_MODE */
+ 1708, /* GL_RGBA_MODE */
453, /* GL_DOUBLEBUFFER */
- 1875, /* GL_STEREO */
- 1603, /* GL_RENDER_MODE */
- 1324, /* GL_PERSPECTIVE_CORRECTION_HINT */
- 1382, /* GL_POINT_SMOOTH_HINT */
- 842, /* GL_LINE_SMOOTH_HINT */
- 1400, /* GL_POLYGON_SMOOTH_HINT */
- 593, /* GL_FOG_HINT */
- 2071, /* GL_TEXTURE_GEN_S */
- 2073, /* GL_TEXTURE_GEN_T */
- 2070, /* GL_TEXTURE_GEN_R */
- 2069, /* GL_TEXTURE_GEN_Q */
- 1337, /* GL_PIXEL_MAP_I_TO_I */
- 1343, /* GL_PIXEL_MAP_S_TO_S */
- 1339, /* GL_PIXEL_MAP_I_TO_R */
- 1335, /* GL_PIXEL_MAP_I_TO_G */
- 1333, /* GL_PIXEL_MAP_I_TO_B */
- 1331, /* GL_PIXEL_MAP_I_TO_A */
- 1341, /* GL_PIXEL_MAP_R_TO_R */
- 1329, /* GL_PIXEL_MAP_G_TO_G */
- 1327, /* GL_PIXEL_MAP_B_TO_B */
- 1325, /* GL_PIXEL_MAP_A_TO_A */
- 1338, /* GL_PIXEL_MAP_I_TO_I_SIZE */
- 1344, /* GL_PIXEL_MAP_S_TO_S_SIZE */
- 1340, /* GL_PIXEL_MAP_I_TO_R_SIZE */
- 1336, /* GL_PIXEL_MAP_I_TO_G_SIZE */
- 1334, /* GL_PIXEL_MAP_I_TO_B_SIZE */
- 1332, /* GL_PIXEL_MAP_I_TO_A_SIZE */
- 1342, /* GL_PIXEL_MAP_R_TO_R_SIZE */
- 1330, /* GL_PIXEL_MAP_G_TO_G_SIZE */
- 1328, /* GL_PIXEL_MAP_B_TO_B_SIZE */
- 1326, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- 2175, /* GL_UNPACK_SWAP_BYTES */
- 2170, /* GL_UNPACK_LSB_FIRST */
- 2171, /* GL_UNPACK_ROW_LENGTH */
- 2174, /* GL_UNPACK_SKIP_ROWS */
- 2173, /* GL_UNPACK_SKIP_PIXELS */
- 2168, /* GL_UNPACK_ALIGNMENT */
- 1312, /* GL_PACK_SWAP_BYTES */
- 1307, /* GL_PACK_LSB_FIRST */
- 1308, /* GL_PACK_ROW_LENGTH */
- 1311, /* GL_PACK_SKIP_ROWS */
- 1310, /* GL_PACK_SKIP_PIXELS */
- 1304, /* GL_PACK_ALIGNMENT */
- 956, /* GL_MAP_COLOR */
- 961, /* GL_MAP_STENCIL */
- 748, /* GL_INDEX_SHIFT */
- 747, /* GL_INDEX_OFFSET */
- 1565, /* GL_RED_SCALE */
- 1561, /* GL_RED_BIAS */
- 2316, /* GL_ZOOM_X */
- 2317, /* GL_ZOOM_Y */
- 702, /* GL_GREEN_SCALE */
- 698, /* GL_GREEN_BIAS */
+ 1892, /* GL_STEREO */
+ 1620, /* GL_RENDER_MODE */
+ 1341, /* GL_PERSPECTIVE_CORRECTION_HINT */
+ 1399, /* GL_POINT_SMOOTH_HINT */
+ 858, /* GL_LINE_SMOOTH_HINT */
+ 1417, /* GL_POLYGON_SMOOTH_HINT */
+ 609, /* GL_FOG_HINT */
+ 2088, /* GL_TEXTURE_GEN_S */
+ 2090, /* GL_TEXTURE_GEN_T */
+ 2087, /* GL_TEXTURE_GEN_R */
+ 2086, /* GL_TEXTURE_GEN_Q */
+ 1354, /* GL_PIXEL_MAP_I_TO_I */
+ 1360, /* GL_PIXEL_MAP_S_TO_S */
+ 1356, /* GL_PIXEL_MAP_I_TO_R */
+ 1352, /* GL_PIXEL_MAP_I_TO_G */
+ 1350, /* GL_PIXEL_MAP_I_TO_B */
+ 1348, /* GL_PIXEL_MAP_I_TO_A */
+ 1358, /* GL_PIXEL_MAP_R_TO_R */
+ 1346, /* GL_PIXEL_MAP_G_TO_G */
+ 1344, /* GL_PIXEL_MAP_B_TO_B */
+ 1342, /* GL_PIXEL_MAP_A_TO_A */
+ 1355, /* GL_PIXEL_MAP_I_TO_I_SIZE */
+ 1361, /* GL_PIXEL_MAP_S_TO_S_SIZE */
+ 1357, /* GL_PIXEL_MAP_I_TO_R_SIZE */
+ 1353, /* GL_PIXEL_MAP_I_TO_G_SIZE */
+ 1351, /* GL_PIXEL_MAP_I_TO_B_SIZE */
+ 1349, /* GL_PIXEL_MAP_I_TO_A_SIZE */
+ 1359, /* GL_PIXEL_MAP_R_TO_R_SIZE */
+ 1347, /* GL_PIXEL_MAP_G_TO_G_SIZE */
+ 1345, /* GL_PIXEL_MAP_B_TO_B_SIZE */
+ 1343, /* GL_PIXEL_MAP_A_TO_A_SIZE */
+ 2192, /* GL_UNPACK_SWAP_BYTES */
+ 2187, /* GL_UNPACK_LSB_FIRST */
+ 2188, /* GL_UNPACK_ROW_LENGTH */
+ 2191, /* GL_UNPACK_SKIP_ROWS */
+ 2190, /* GL_UNPACK_SKIP_PIXELS */
+ 2185, /* GL_UNPACK_ALIGNMENT */
+ 1329, /* GL_PACK_SWAP_BYTES */
+ 1324, /* GL_PACK_LSB_FIRST */
+ 1325, /* GL_PACK_ROW_LENGTH */
+ 1328, /* GL_PACK_SKIP_ROWS */
+ 1327, /* GL_PACK_SKIP_PIXELS */
+ 1321, /* GL_PACK_ALIGNMENT */
+ 972, /* GL_MAP_COLOR */
+ 977, /* GL_MAP_STENCIL */
+ 764, /* GL_INDEX_SHIFT */
+ 763, /* GL_INDEX_OFFSET */
+ 1582, /* GL_RED_SCALE */
+ 1578, /* GL_RED_BIAS */
+ 2333, /* GL_ZOOM_X */
+ 2334, /* GL_ZOOM_Y */
+ 718, /* GL_GREEN_SCALE */
+ 714, /* GL_GREEN_BIAS */
115, /* GL_BLUE_SCALE */
111, /* GL_BLUE_BIAS */
50, /* GL_ALPHA_SCALE */
47, /* GL_ALPHA_BIAS */
430, /* GL_DEPTH_SCALE */
406, /* GL_DEPTH_BIAS */
- 1047, /* GL_MAX_EVAL_ORDER */
- 1064, /* GL_MAX_LIGHTS */
- 1027, /* GL_MAX_CLIP_DISTANCES */
- 1120, /* GL_MAX_TEXTURE_SIZE */
- 1071, /* GL_MAX_PIXEL_MAP_TABLE */
- 1023, /* GL_MAX_ATTRIB_STACK_DEPTH */
- 1067, /* GL_MAX_MODELVIEW_STACK_DEPTH */
- 1068, /* GL_MAX_NAME_STACK_DEPTH */
- 1099, /* GL_MAX_PROJECTION_STACK_DEPTH */
- 1121, /* GL_MAX_TEXTURE_STACK_DEPTH */
- 1147, /* GL_MAX_VIEWPORT_DIMS */
- 1024, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
- 1885, /* GL_SUBPIXEL_BITS */
- 743, /* GL_INDEX_BITS */
- 1562, /* GL_RED_BITS */
- 699, /* GL_GREEN_BITS */
+ 1064, /* GL_MAX_EVAL_ORDER */
+ 1081, /* GL_MAX_LIGHTS */
+ 1043, /* GL_MAX_CLIP_DISTANCES */
+ 1137, /* GL_MAX_TEXTURE_SIZE */
+ 1088, /* GL_MAX_PIXEL_MAP_TABLE */
+ 1039, /* GL_MAX_ATTRIB_STACK_DEPTH */
+ 1084, /* GL_MAX_MODELVIEW_STACK_DEPTH */
+ 1085, /* GL_MAX_NAME_STACK_DEPTH */
+ 1116, /* GL_MAX_PROJECTION_STACK_DEPTH */
+ 1138, /* GL_MAX_TEXTURE_STACK_DEPTH */
+ 1164, /* GL_MAX_VIEWPORT_DIMS */
+ 1040, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */
+ 1902, /* GL_SUBPIXEL_BITS */
+ 759, /* GL_INDEX_BITS */
+ 1579, /* GL_RED_BITS */
+ 715, /* GL_GREEN_BITS */
112, /* GL_BLUE_BITS */
48, /* GL_ALPHA_BITS */
407, /* GL_DEPTH_BITS */
- 1849, /* GL_STENCIL_BITS */
+ 1866, /* GL_STENCIL_BITS */
14, /* GL_ACCUM_RED_BITS */
13, /* GL_ACCUM_GREEN_BITS */
10, /* GL_ACCUM_BLUE_BITS */
9, /* GL_ACCUM_ALPHA_BITS */
- 1219, /* GL_NAME_STACK_DEPTH */
+ 1236, /* GL_NAME_STACK_DEPTH */
70, /* GL_AUTO_NORMAL */
- 902, /* GL_MAP1_COLOR_4 */
- 905, /* GL_MAP1_INDEX */
- 906, /* GL_MAP1_NORMAL */
- 907, /* GL_MAP1_TEXTURE_COORD_1 */
- 908, /* GL_MAP1_TEXTURE_COORD_2 */
- 909, /* GL_MAP1_TEXTURE_COORD_3 */
- 910, /* GL_MAP1_TEXTURE_COORD_4 */
- 911, /* GL_MAP1_VERTEX_3 */
- 912, /* GL_MAP1_VERTEX_4 */
- 929, /* GL_MAP2_COLOR_4 */
- 932, /* GL_MAP2_INDEX */
- 933, /* GL_MAP2_NORMAL */
- 934, /* GL_MAP2_TEXTURE_COORD_1 */
- 935, /* GL_MAP2_TEXTURE_COORD_2 */
- 936, /* GL_MAP2_TEXTURE_COORD_3 */
- 937, /* GL_MAP2_TEXTURE_COORD_4 */
- 938, /* GL_MAP2_VERTEX_3 */
- 939, /* GL_MAP2_VERTEX_4 */
- 903, /* GL_MAP1_GRID_DOMAIN */
- 904, /* GL_MAP1_GRID_SEGMENTS */
- 930, /* GL_MAP2_GRID_DOMAIN */
- 931, /* GL_MAP2_GRID_SEGMENTS */
- 1968, /* GL_TEXTURE_1D */
- 1971, /* GL_TEXTURE_2D */
- 542, /* GL_FEEDBACK_BUFFER_POINTER */
- 543, /* GL_FEEDBACK_BUFFER_SIZE */
- 544, /* GL_FEEDBACK_BUFFER_TYPE */
- 1755, /* GL_SELECTION_BUFFER_POINTER */
- 1756, /* GL_SELECTION_BUFFER_SIZE */
- 2117, /* GL_TEXTURE_WIDTH */
- 2077, /* GL_TEXTURE_HEIGHT */
- 2021, /* GL_TEXTURE_COMPONENTS */
- 1999, /* GL_TEXTURE_BORDER_COLOR */
- 1998, /* GL_TEXTURE_BORDER */
+ 918, /* GL_MAP1_COLOR_4 */
+ 921, /* GL_MAP1_INDEX */
+ 922, /* GL_MAP1_NORMAL */
+ 923, /* GL_MAP1_TEXTURE_COORD_1 */
+ 924, /* GL_MAP1_TEXTURE_COORD_2 */
+ 925, /* GL_MAP1_TEXTURE_COORD_3 */
+ 926, /* GL_MAP1_TEXTURE_COORD_4 */
+ 927, /* GL_MAP1_VERTEX_3 */
+ 928, /* GL_MAP1_VERTEX_4 */
+ 945, /* GL_MAP2_COLOR_4 */
+ 948, /* GL_MAP2_INDEX */
+ 949, /* GL_MAP2_NORMAL */
+ 950, /* GL_MAP2_TEXTURE_COORD_1 */
+ 951, /* GL_MAP2_TEXTURE_COORD_2 */
+ 952, /* GL_MAP2_TEXTURE_COORD_3 */
+ 953, /* GL_MAP2_TEXTURE_COORD_4 */
+ 954, /* GL_MAP2_VERTEX_3 */
+ 955, /* GL_MAP2_VERTEX_4 */
+ 919, /* GL_MAP1_GRID_DOMAIN */
+ 920, /* GL_MAP1_GRID_SEGMENTS */
+ 946, /* GL_MAP2_GRID_DOMAIN */
+ 947, /* GL_MAP2_GRID_SEGMENTS */
+ 1985, /* GL_TEXTURE_1D */
+ 1988, /* GL_TEXTURE_2D */
+ 558, /* GL_FEEDBACK_BUFFER_POINTER */
+ 559, /* GL_FEEDBACK_BUFFER_SIZE */
+ 560, /* GL_FEEDBACK_BUFFER_TYPE */
+ 1772, /* GL_SELECTION_BUFFER_POINTER */
+ 1773, /* GL_SELECTION_BUFFER_SIZE */
+ 2134, /* GL_TEXTURE_WIDTH */
+ 2094, /* GL_TEXTURE_HEIGHT */
+ 2038, /* GL_TEXTURE_COMPONENTS */
+ 2016, /* GL_TEXTURE_BORDER_COLOR */
+ 2015, /* GL_TEXTURE_BORDER */
445, /* GL_DONT_CARE */
- 540, /* GL_FASTEST */
- 1227, /* GL_NICEST */
+ 556, /* GL_FASTEST */
+ 1244, /* GL_NICEST */
56, /* GL_AMBIENT */
442, /* GL_DIFFUSE */
- 1808, /* GL_SPECULAR */
- 1404, /* GL_POSITION */
- 1811, /* GL_SPOT_DIRECTION */
- 1812, /* GL_SPOT_EXPONENT */
- 1810, /* GL_SPOT_CUTOFF */
+ 1825, /* GL_SPECULAR */
+ 1421, /* GL_POSITION */
+ 1828, /* GL_SPOT_DIRECTION */
+ 1829, /* GL_SPOT_EXPONENT */
+ 1827, /* GL_SPOT_CUTOFF */
320, /* GL_CONSTANT_ATTENUATION */
- 830, /* GL_LINEAR_ATTENUATION */
- 1521, /* GL_QUADRATIC_ATTENUATION */
+ 846, /* GL_LINEAR_ATTENUATION */
+ 1538, /* GL_QUADRATIC_ATTENUATION */
287, /* GL_COMPILE */
288, /* GL_COMPILE_AND_EXECUTE */
149, /* GL_BYTE */
- 2177, /* GL_UNSIGNED_BYTE */
- 1773, /* GL_SHORT */
- 2216, /* GL_UNSIGNED_SHORT */
- 752, /* GL_INT */
- 2180, /* GL_UNSIGNED_INT */
- 553, /* GL_FLOAT */
+ 2194, /* GL_UNSIGNED_BYTE */
+ 1790, /* GL_SHORT */
+ 2233, /* GL_UNSIGNED_SHORT */
+ 768, /* GL_INT */
+ 2197, /* GL_UNSIGNED_INT */
+ 569, /* GL_FLOAT */
1, /* GL_2_BYTES */
5, /* GL_3_BYTES */
7, /* GL_4_BYTES */
452, /* GL_DOUBLE */
- 704, /* GL_HALF_FLOAT */
- 548, /* GL_FIXED */
+ 720, /* GL_HALF_FLOAT */
+ 564, /* GL_FIXED */
165, /* GL_CLEAR */
58, /* GL_AND */
60, /* GL_AND_REVERSE */
351, /* GL_COPY */
59, /* GL_AND_INVERTED */
- 1230, /* GL_NOOP */
- 2312, /* GL_XOR */
- 1299, /* GL_OR */
- 1231, /* GL_NOR */
- 530, /* GL_EQUIV */
- 806, /* GL_INVERT */
- 1302, /* GL_OR_REVERSE */
+ 1247, /* GL_NOOP */
+ 2329, /* GL_XOR */
+ 1316, /* GL_OR */
+ 1248, /* GL_NOR */
+ 546, /* GL_EQUIV */
+ 822, /* GL_INVERT */
+ 1319, /* GL_OR_REVERSE */
352, /* GL_COPY_INVERTED */
- 1301, /* GL_OR_INVERTED */
- 1220, /* GL_NAND */
- 1762, /* GL_SET */
- 527, /* GL_EMISSION */
- 1772, /* GL_SHININESS */
+ 1318, /* GL_OR_INVERTED */
+ 1237, /* GL_NAND */
+ 1779, /* GL_SET */
+ 543, /* GL_EMISSION */
+ 1789, /* GL_SHININESS */
57, /* GL_AMBIENT_AND_DIFFUSE */
232, /* GL_COLOR_INDEXES */
- 1169, /* GL_MODELVIEW */
- 1493, /* GL_PROJECTION */
- 1903, /* GL_TEXTURE */
+ 1186, /* GL_MODELVIEW */
+ 1510, /* GL_PROJECTION */
+ 1920, /* GL_TEXTURE */
188, /* GL_COLOR */
399, /* GL_DEPTH */
- 1834, /* GL_STENCIL */
+ 1851, /* GL_STENCIL */
231, /* GL_COLOR_INDEX */
- 1855, /* GL_STENCIL_INDEX */
+ 1872, /* GL_STENCIL_INDEX */
415, /* GL_DEPTH_COMPONENT */
- 1558, /* GL_RED */
- 697, /* GL_GREEN */
+ 1575, /* GL_RED */
+ 713, /* GL_GREEN */
110, /* GL_BLUE */
32, /* GL_ALPHA */
- 1615, /* GL_RGB */
- 1655, /* GL_RGBA */
- 865, /* GL_LUMINANCE */
- 892, /* GL_LUMINANCE_ALPHA */
+ 1632, /* GL_RGB */
+ 1672, /* GL_RGBA */
+ 881, /* GL_LUMINANCE */
+ 908, /* GL_LUMINANCE_ALPHA */
86, /* GL_BITMAP */
- 1354, /* GL_POINT */
- 828, /* GL_LINE */
- 545, /* GL_FILL */
- 1572, /* GL_RENDER */
- 541, /* GL_FEEDBACK */
- 1754, /* GL_SELECT */
- 552, /* GL_FLAT */
- 1783, /* GL_SMOOTH */
- 807, /* GL_KEEP */
- 1605, /* GL_REPLACE */
- 733, /* GL_INCR */
+ 1371, /* GL_POINT */
+ 844, /* GL_LINE */
+ 561, /* GL_FILL */
+ 1589, /* GL_RENDER */
+ 557, /* GL_FEEDBACK */
+ 1771, /* GL_SELECT */
+ 568, /* GL_FLAT */
+ 1800, /* GL_SMOOTH */
+ 823, /* GL_KEEP */
+ 1622, /* GL_REPLACE */
+ 749, /* GL_INCR */
395, /* GL_DECR */
- 2233, /* GL_VENDOR */
- 1602, /* GL_RENDERER */
- 2234, /* GL_VERSION */
- 534, /* GL_EXTENSIONS */
- 1703, /* GL_S */
- 1894, /* GL_T */
- 1541, /* GL_R */
- 1520, /* GL_Q */
- 1206, /* GL_MODULATE */
+ 2250, /* GL_VENDOR */
+ 1619, /* GL_RENDERER */
+ 2251, /* GL_VERSION */
+ 550, /* GL_EXTENSIONS */
+ 1720, /* GL_S */
+ 1911, /* GL_T */
+ 1558, /* GL_R */
+ 1537, /* GL_Q */
+ 1223, /* GL_MODULATE */
394, /* GL_DECAL */
- 2064, /* GL_TEXTURE_ENV_MODE */
- 2063, /* GL_TEXTURE_ENV_COLOR */
- 2062, /* GL_TEXTURE_ENV */
- 535, /* GL_EYE_LINEAR */
- 1260, /* GL_OBJECT_LINEAR */
- 1809, /* GL_SPHERE_MAP */
- 2067, /* GL_TEXTURE_GEN_MODE */
- 1262, /* GL_OBJECT_PLANE */
- 536, /* GL_EYE_PLANE */
- 1221, /* GL_NEAREST */
- 829, /* GL_LINEAR */
- 1225, /* GL_NEAREST_MIPMAP_NEAREST */
- 834, /* GL_LINEAR_MIPMAP_NEAREST */
- 1224, /* GL_NEAREST_MIPMAP_LINEAR */
- 833, /* GL_LINEAR_MIPMAP_LINEAR */
- 2090, /* GL_TEXTURE_MAG_FILTER */
- 2099, /* GL_TEXTURE_MIN_FILTER */
- 2120, /* GL_TEXTURE_WRAP_S */
- 2121, /* GL_TEXTURE_WRAP_T */
+ 2081, /* GL_TEXTURE_ENV_MODE */
+ 2080, /* GL_TEXTURE_ENV_COLOR */
+ 2079, /* GL_TEXTURE_ENV */
+ 551, /* GL_EYE_LINEAR */
+ 1277, /* GL_OBJECT_LINEAR */
+ 1826, /* GL_SPHERE_MAP */
+ 2084, /* GL_TEXTURE_GEN_MODE */
+ 1279, /* GL_OBJECT_PLANE */
+ 552, /* GL_EYE_PLANE */
+ 1238, /* GL_NEAREST */
+ 845, /* GL_LINEAR */
+ 1242, /* GL_NEAREST_MIPMAP_NEAREST */
+ 850, /* GL_LINEAR_MIPMAP_NEAREST */
+ 1241, /* GL_NEAREST_MIPMAP_LINEAR */
+ 849, /* GL_LINEAR_MIPMAP_LINEAR */
+ 2107, /* GL_TEXTURE_MAG_FILTER */
+ 2116, /* GL_TEXTURE_MIN_FILTER */
+ 2137, /* GL_TEXTURE_WRAP_S */
+ 2138, /* GL_TEXTURE_WRAP_T */
155, /* GL_CLAMP */
- 1604, /* GL_REPEAT */
- 1398, /* GL_POLYGON_OFFSET_UNITS */
- 1397, /* GL_POLYGON_OFFSET_POINT */
- 1396, /* GL_POLYGON_OFFSET_LINE */
- 1544, /* GL_R3_G3_B2 */
- 2230, /* GL_V2F */
- 2231, /* GL_V3F */
+ 1621, /* GL_REPEAT */
+ 1415, /* GL_POLYGON_OFFSET_UNITS */
+ 1414, /* GL_POLYGON_OFFSET_POINT */
+ 1413, /* GL_POLYGON_OFFSET_LINE */
+ 1561, /* GL_R3_G3_B2 */
+ 2247, /* GL_V2F */
+ 2248, /* GL_V3F */
152, /* GL_C4UB_V2F */
153, /* GL_C4UB_V3F */
150, /* GL_C3F_V3F */
- 1218, /* GL_N3F_V3F */
+ 1235, /* GL_N3F_V3F */
151, /* GL_C4F_N3F_V3F */
- 1899, /* GL_T2F_V3F */
- 1901, /* GL_T4F_V4F */
- 1897, /* GL_T2F_C4UB_V3F */
- 1895, /* GL_T2F_C3F_V3F */
- 1898, /* GL_T2F_N3F_V3F */
- 1896, /* GL_T2F_C4F_N3F_V3F */
- 1900, /* GL_T4F_C4F_N3F_V4F */
+ 1916, /* GL_T2F_V3F */
+ 1918, /* GL_T4F_V4F */
+ 1914, /* GL_T2F_C4UB_V3F */
+ 1912, /* GL_T2F_C3F_V3F */
+ 1915, /* GL_T2F_N3F_V3F */
+ 1913, /* GL_T2F_C4F_N3F_V3F */
+ 1917, /* GL_T4F_C4F_N3F_V4F */
172, /* GL_CLIP_DISTANCE0 */
173, /* GL_CLIP_DISTANCE1 */
174, /* GL_CLIP_DISTANCE2 */
@@ -5110,184 +5144,184 @@ static const unsigned reduced_enums[1564] =
177, /* GL_CLIP_DISTANCE5 */
178, /* GL_CLIP_DISTANCE6 */
179, /* GL_CLIP_DISTANCE7 */
- 813, /* GL_LIGHT0 */
- 814, /* GL_LIGHT1 */
- 815, /* GL_LIGHT2 */
- 816, /* GL_LIGHT3 */
- 817, /* GL_LIGHT4 */
- 818, /* GL_LIGHT5 */
- 819, /* GL_LIGHT6 */
- 820, /* GL_LIGHT7 */
- 708, /* GL_HINT_BIT */
+ 829, /* GL_LIGHT0 */
+ 830, /* GL_LIGHT1 */
+ 831, /* GL_LIGHT2 */
+ 832, /* GL_LIGHT3 */
+ 833, /* GL_LIGHT4 */
+ 834, /* GL_LIGHT5 */
+ 835, /* GL_LIGHT6 */
+ 836, /* GL_LIGHT7 */
+ 724, /* GL_HINT_BIT */
322, /* GL_CONSTANT_COLOR */
- 1273, /* GL_ONE_MINUS_CONSTANT_COLOR */
+ 1290, /* GL_ONE_MINUS_CONSTANT_COLOR */
317, /* GL_CONSTANT_ALPHA */
- 1271, /* GL_ONE_MINUS_CONSTANT_ALPHA */
+ 1288, /* GL_ONE_MINUS_CONSTANT_ALPHA */
89, /* GL_BLEND_COLOR */
- 674, /* GL_FUNC_ADD */
- 1150, /* GL_MIN */
- 1018, /* GL_MAX */
+ 690, /* GL_FUNC_ADD */
+ 1167, /* GL_MIN */
+ 1034, /* GL_MAX */
96, /* GL_BLEND_EQUATION */
- 680, /* GL_FUNC_SUBTRACT */
- 677, /* GL_FUNC_REVERSE_SUBTRACT */
+ 696, /* GL_FUNC_SUBTRACT */
+ 693, /* GL_FUNC_REVERSE_SUBTRACT */
331, /* GL_CONVOLUTION_1D */
332, /* GL_CONVOLUTION_2D */
- 1757, /* GL_SEPARABLE_2D */
+ 1774, /* GL_SEPARABLE_2D */
335, /* GL_CONVOLUTION_BORDER_MODE */
339, /* GL_CONVOLUTION_FILTER_SCALE */
337, /* GL_CONVOLUTION_FILTER_BIAS */
- 1559, /* GL_REDUCE */
+ 1576, /* GL_REDUCE */
341, /* GL_CONVOLUTION_FORMAT */
345, /* GL_CONVOLUTION_WIDTH */
343, /* GL_CONVOLUTION_HEIGHT */
- 1037, /* GL_MAX_CONVOLUTION_WIDTH */
- 1035, /* GL_MAX_CONVOLUTION_HEIGHT */
- 1437, /* GL_POST_CONVOLUTION_RED_SCALE */
- 1433, /* GL_POST_CONVOLUTION_GREEN_SCALE */
- 1428, /* GL_POST_CONVOLUTION_BLUE_SCALE */
- 1424, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
- 1435, /* GL_POST_CONVOLUTION_RED_BIAS */
- 1431, /* GL_POST_CONVOLUTION_GREEN_BIAS */
- 1426, /* GL_POST_CONVOLUTION_BLUE_BIAS */
- 1422, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
- 709, /* GL_HISTOGRAM */
- 1500, /* GL_PROXY_HISTOGRAM */
- 725, /* GL_HISTOGRAM_WIDTH */
- 715, /* GL_HISTOGRAM_FORMAT */
- 721, /* GL_HISTOGRAM_RED_SIZE */
- 717, /* GL_HISTOGRAM_GREEN_SIZE */
- 712, /* GL_HISTOGRAM_BLUE_SIZE */
- 710, /* GL_HISTOGRAM_ALPHA_SIZE */
- 719, /* GL_HISTOGRAM_LUMINANCE_SIZE */
- 723, /* GL_HISTOGRAM_SINK */
- 1151, /* GL_MINMAX */
- 1153, /* GL_MINMAX_FORMAT */
- 1155, /* GL_MINMAX_SINK */
- 1902, /* GL_TABLE_TOO_LARGE_EXT */
- 2179, /* GL_UNSIGNED_BYTE_3_3_2 */
- 2219, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- 2222, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- 2191, /* GL_UNSIGNED_INT_8_8_8_8 */
- 2182, /* GL_UNSIGNED_INT_10_10_10_2 */
- 1395, /* GL_POLYGON_OFFSET_FILL */
- 1394, /* GL_POLYGON_OFFSET_FACTOR */
- 1393, /* GL_POLYGON_OFFSET_BIAS */
- 1608, /* GL_RESCALE_NORMAL */
+ 1053, /* GL_MAX_CONVOLUTION_WIDTH */
+ 1051, /* GL_MAX_CONVOLUTION_HEIGHT */
+ 1454, /* GL_POST_CONVOLUTION_RED_SCALE */
+ 1450, /* GL_POST_CONVOLUTION_GREEN_SCALE */
+ 1445, /* GL_POST_CONVOLUTION_BLUE_SCALE */
+ 1441, /* GL_POST_CONVOLUTION_ALPHA_SCALE */
+ 1452, /* GL_POST_CONVOLUTION_RED_BIAS */
+ 1448, /* GL_POST_CONVOLUTION_GREEN_BIAS */
+ 1443, /* GL_POST_CONVOLUTION_BLUE_BIAS */
+ 1439, /* GL_POST_CONVOLUTION_ALPHA_BIAS */
+ 725, /* GL_HISTOGRAM */
+ 1517, /* GL_PROXY_HISTOGRAM */
+ 741, /* GL_HISTOGRAM_WIDTH */
+ 731, /* GL_HISTOGRAM_FORMAT */
+ 737, /* GL_HISTOGRAM_RED_SIZE */
+ 733, /* GL_HISTOGRAM_GREEN_SIZE */
+ 728, /* GL_HISTOGRAM_BLUE_SIZE */
+ 726, /* GL_HISTOGRAM_ALPHA_SIZE */
+ 735, /* GL_HISTOGRAM_LUMINANCE_SIZE */
+ 739, /* GL_HISTOGRAM_SINK */
+ 1168, /* GL_MINMAX */
+ 1170, /* GL_MINMAX_FORMAT */
+ 1172, /* GL_MINMAX_SINK */
+ 1919, /* GL_TABLE_TOO_LARGE_EXT */
+ 2196, /* GL_UNSIGNED_BYTE_3_3_2 */
+ 2236, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ 2239, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ 2208, /* GL_UNSIGNED_INT_8_8_8_8 */
+ 2199, /* GL_UNSIGNED_INT_10_10_10_2 */
+ 1412, /* GL_POLYGON_OFFSET_FILL */
+ 1411, /* GL_POLYGON_OFFSET_FACTOR */
+ 1410, /* GL_POLYGON_OFFSET_BIAS */
+ 1625, /* GL_RESCALE_NORMAL */
41, /* GL_ALPHA4 */
43, /* GL_ALPHA8 */
33, /* GL_ALPHA12 */
35, /* GL_ALPHA16 */
- 880, /* GL_LUMINANCE4 */
- 886, /* GL_LUMINANCE8 */
- 866, /* GL_LUMINANCE12 */
- 872, /* GL_LUMINANCE16 */
- 881, /* GL_LUMINANCE4_ALPHA4 */
- 884, /* GL_LUMINANCE6_ALPHA2 */
- 889, /* GL_LUMINANCE8_ALPHA8 */
- 869, /* GL_LUMINANCE12_ALPHA4 */
- 867, /* GL_LUMINANCE12_ALPHA12 */
- 875, /* GL_LUMINANCE16_ALPHA16 */
- 753, /* GL_INTENSITY */
- 762, /* GL_INTENSITY4 */
- 764, /* GL_INTENSITY8 */
- 754, /* GL_INTENSITY12 */
- 756, /* GL_INTENSITY16 */
- 1630, /* GL_RGB2_EXT */
- 1636, /* GL_RGB4 */
- 1639, /* GL_RGB5 */
- 1646, /* GL_RGB8 */
- 1616, /* GL_RGB10 */
- 1620, /* GL_RGB12 */
- 1622, /* GL_RGB16 */
- 1666, /* GL_RGBA2 */
- 1673, /* GL_RGBA4 */
- 1642, /* GL_RGB5_A1 */
- 1678, /* GL_RGBA8 */
- 1617, /* GL_RGB10_A2 */
- 1656, /* GL_RGBA12 */
- 1658, /* GL_RGBA16 */
- 2107, /* GL_TEXTURE_RED_SIZE */
- 2075, /* GL_TEXTURE_GREEN_SIZE */
- 1996, /* GL_TEXTURE_BLUE_SIZE */
- 1976, /* GL_TEXTURE_ALPHA_SIZE */
- 2088, /* GL_TEXTURE_LUMINANCE_SIZE */
- 2079, /* GL_TEXTURE_INTENSITY_SIZE */
- 1606, /* GL_REPLACE_EXT */
- 1504, /* GL_PROXY_TEXTURE_1D */
- 1508, /* GL_PROXY_TEXTURE_2D */
- 2115, /* GL_TEXTURE_TOO_LARGE_EXT */
- 2101, /* GL_TEXTURE_PRIORITY */
- 2109, /* GL_TEXTURE_RESIDENT */
- 1979, /* GL_TEXTURE_BINDING_1D */
- 1982, /* GL_TEXTURE_BINDING_2D */
- 1985, /* GL_TEXTURE_BINDING_3D */
- 1309, /* GL_PACK_SKIP_IMAGES */
- 1305, /* GL_PACK_IMAGE_HEIGHT */
- 2172, /* GL_UNPACK_SKIP_IMAGES */
- 2169, /* GL_UNPACK_IMAGE_HEIGHT */
- 1974, /* GL_TEXTURE_3D */
- 1512, /* GL_PROXY_TEXTURE_3D */
- 2059, /* GL_TEXTURE_DEPTH */
- 2118, /* GL_TEXTURE_WRAP_R */
- 1019, /* GL_MAX_3D_TEXTURE_SIZE */
- 2235, /* GL_VERTEX_ARRAY */
- 1233, /* GL_NORMAL_ARRAY */
+ 896, /* GL_LUMINANCE4 */
+ 902, /* GL_LUMINANCE8 */
+ 882, /* GL_LUMINANCE12 */
+ 888, /* GL_LUMINANCE16 */
+ 897, /* GL_LUMINANCE4_ALPHA4 */
+ 900, /* GL_LUMINANCE6_ALPHA2 */
+ 905, /* GL_LUMINANCE8_ALPHA8 */
+ 885, /* GL_LUMINANCE12_ALPHA4 */
+ 883, /* GL_LUMINANCE12_ALPHA12 */
+ 891, /* GL_LUMINANCE16_ALPHA16 */
+ 769, /* GL_INTENSITY */
+ 778, /* GL_INTENSITY4 */
+ 780, /* GL_INTENSITY8 */
+ 770, /* GL_INTENSITY12 */
+ 772, /* GL_INTENSITY16 */
+ 1647, /* GL_RGB2_EXT */
+ 1653, /* GL_RGB4 */
+ 1656, /* GL_RGB5 */
+ 1663, /* GL_RGB8 */
+ 1633, /* GL_RGB10 */
+ 1637, /* GL_RGB12 */
+ 1639, /* GL_RGB16 */
+ 1683, /* GL_RGBA2 */
+ 1690, /* GL_RGBA4 */
+ 1659, /* GL_RGB5_A1 */
+ 1695, /* GL_RGBA8 */
+ 1634, /* GL_RGB10_A2 */
+ 1673, /* GL_RGBA12 */
+ 1675, /* GL_RGBA16 */
+ 2124, /* GL_TEXTURE_RED_SIZE */
+ 2092, /* GL_TEXTURE_GREEN_SIZE */
+ 2013, /* GL_TEXTURE_BLUE_SIZE */
+ 1993, /* GL_TEXTURE_ALPHA_SIZE */
+ 2105, /* GL_TEXTURE_LUMINANCE_SIZE */
+ 2096, /* GL_TEXTURE_INTENSITY_SIZE */
+ 1623, /* GL_REPLACE_EXT */
+ 1521, /* GL_PROXY_TEXTURE_1D */
+ 1525, /* GL_PROXY_TEXTURE_2D */
+ 2132, /* GL_TEXTURE_TOO_LARGE_EXT */
+ 2118, /* GL_TEXTURE_PRIORITY */
+ 2126, /* GL_TEXTURE_RESIDENT */
+ 1996, /* GL_TEXTURE_BINDING_1D */
+ 1999, /* GL_TEXTURE_BINDING_2D */
+ 2002, /* GL_TEXTURE_BINDING_3D */
+ 1326, /* GL_PACK_SKIP_IMAGES */
+ 1322, /* GL_PACK_IMAGE_HEIGHT */
+ 2189, /* GL_UNPACK_SKIP_IMAGES */
+ 2186, /* GL_UNPACK_IMAGE_HEIGHT */
+ 1991, /* GL_TEXTURE_3D */
+ 1529, /* GL_PROXY_TEXTURE_3D */
+ 2076, /* GL_TEXTURE_DEPTH */
+ 2135, /* GL_TEXTURE_WRAP_R */
+ 1035, /* GL_MAX_3D_TEXTURE_SIZE */
+ 2252, /* GL_VERTEX_ARRAY */
+ 1250, /* GL_NORMAL_ARRAY */
189, /* GL_COLOR_ARRAY */
- 737, /* GL_INDEX_ARRAY */
- 2029, /* GL_TEXTURE_COORD_ARRAY */
- 519, /* GL_EDGE_FLAG_ARRAY */
- 2241, /* GL_VERTEX_ARRAY_SIZE */
- 2243, /* GL_VERTEX_ARRAY_TYPE */
- 2242, /* GL_VERTEX_ARRAY_STRIDE */
- 1238, /* GL_NORMAL_ARRAY_TYPE */
- 1237, /* GL_NORMAL_ARRAY_STRIDE */
+ 753, /* GL_INDEX_ARRAY */
+ 2046, /* GL_TEXTURE_COORD_ARRAY */
+ 535, /* GL_EDGE_FLAG_ARRAY */
+ 2258, /* GL_VERTEX_ARRAY_SIZE */
+ 2260, /* GL_VERTEX_ARRAY_TYPE */
+ 2259, /* GL_VERTEX_ARRAY_STRIDE */
+ 1255, /* GL_NORMAL_ARRAY_TYPE */
+ 1254, /* GL_NORMAL_ARRAY_STRIDE */
193, /* GL_COLOR_ARRAY_SIZE */
195, /* GL_COLOR_ARRAY_TYPE */
194, /* GL_COLOR_ARRAY_STRIDE */
- 742, /* GL_INDEX_ARRAY_TYPE */
- 741, /* GL_INDEX_ARRAY_STRIDE */
- 2033, /* GL_TEXTURE_COORD_ARRAY_SIZE */
- 2035, /* GL_TEXTURE_COORD_ARRAY_TYPE */
- 2034, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
- 523, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- 2240, /* GL_VERTEX_ARRAY_POINTER */
- 1236, /* GL_NORMAL_ARRAY_POINTER */
+ 758, /* GL_INDEX_ARRAY_TYPE */
+ 757, /* GL_INDEX_ARRAY_STRIDE */
+ 2050, /* GL_TEXTURE_COORD_ARRAY_SIZE */
+ 2052, /* GL_TEXTURE_COORD_ARRAY_TYPE */
+ 2051, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
+ 539, /* GL_EDGE_FLAG_ARRAY_STRIDE */
+ 2257, /* GL_VERTEX_ARRAY_POINTER */
+ 1253, /* GL_NORMAL_ARRAY_POINTER */
192, /* GL_COLOR_ARRAY_POINTER */
- 740, /* GL_INDEX_ARRAY_POINTER */
- 2032, /* GL_TEXTURE_COORD_ARRAY_POINTER */
- 522, /* GL_EDGE_FLAG_ARRAY_POINTER */
- 1211, /* GL_MULTISAMPLE */
- 1731, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
- 1733, /* GL_SAMPLE_ALPHA_TO_ONE */
- 1738, /* GL_SAMPLE_COVERAGE */
- 1735, /* GL_SAMPLE_BUFFERS */
- 1726, /* GL_SAMPLES */
- 1742, /* GL_SAMPLE_COVERAGE_VALUE */
- 1740, /* GL_SAMPLE_COVERAGE_INVERT */
+ 756, /* GL_INDEX_ARRAY_POINTER */
+ 2049, /* GL_TEXTURE_COORD_ARRAY_POINTER */
+ 538, /* GL_EDGE_FLAG_ARRAY_POINTER */
+ 1228, /* GL_MULTISAMPLE */
+ 1748, /* GL_SAMPLE_ALPHA_TO_COVERAGE */
+ 1750, /* GL_SAMPLE_ALPHA_TO_ONE */
+ 1755, /* GL_SAMPLE_COVERAGE */
+ 1752, /* GL_SAMPLE_BUFFERS */
+ 1743, /* GL_SAMPLES */
+ 1759, /* GL_SAMPLE_COVERAGE_VALUE */
+ 1757, /* GL_SAMPLE_COVERAGE_INVERT */
237, /* GL_COLOR_MATRIX */
239, /* GL_COLOR_MATRIX_STACK_DEPTH */
- 1031, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
- 1420, /* GL_POST_COLOR_MATRIX_RED_SCALE */
- 1416, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
- 1411, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
- 1407, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
- 1418, /* GL_POST_COLOR_MATRIX_RED_BIAS */
- 1414, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
- 1409, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
- 1405, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
- 2012, /* GL_TEXTURE_COLOR_TABLE_SGI */
- 1513, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
- 2014, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
+ 1047, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */
+ 1437, /* GL_POST_COLOR_MATRIX_RED_SCALE */
+ 1433, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */
+ 1428, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */
+ 1424, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */
+ 1435, /* GL_POST_COLOR_MATRIX_RED_BIAS */
+ 1431, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */
+ 1426, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */
+ 1422, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */
+ 2029, /* GL_TEXTURE_COLOR_TABLE_SGI */
+ 1530, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */
+ 2031, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
94, /* GL_BLEND_DST_RGB */
108, /* GL_BLEND_SRC_RGB */
92, /* GL_BLEND_DST_ALPHA */
106, /* GL_BLEND_SRC_ALPHA */
243, /* GL_COLOR_TABLE */
- 1430, /* GL_POST_CONVOLUTION_COLOR_TABLE */
- 1413, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
- 1499, /* GL_PROXY_COLOR_TABLE */
- 1503, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
- 1502, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1447, /* GL_POST_CONVOLUTION_COLOR_TABLE */
+ 1430, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */
+ 1516, /* GL_PROXY_COLOR_TABLE */
+ 1520, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */
+ 1519, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */
267, /* GL_COLOR_TABLE_SCALE */
247, /* GL_COLOR_TABLE_BIAS */
252, /* GL_COLOR_TABLE_FORMAT */
@@ -5300,398 +5334,398 @@ static const unsigned reduced_enums[1564] =
258, /* GL_COLOR_TABLE_INTENSITY_SIZE */
79, /* GL_BGR */
80, /* GL_BGRA */
- 1046, /* GL_MAX_ELEMENTS_VERTICES */
- 1045, /* GL_MAX_ELEMENTS_INDICES */
- 2078, /* GL_TEXTURE_INDEX_SIZE_EXT */
+ 1063, /* GL_MAX_ELEMENTS_VERTICES */
+ 1062, /* GL_MAX_ELEMENTS_INDICES */
+ 2095, /* GL_TEXTURE_INDEX_SIZE_EXT */
186, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */
- 1376, /* GL_POINT_SIZE_MIN */
- 1372, /* GL_POINT_SIZE_MAX */
- 1361, /* GL_POINT_FADE_THRESHOLD_SIZE */
- 1357, /* GL_POINT_DISTANCE_ATTENUATION */
+ 1393, /* GL_POINT_SIZE_MIN */
+ 1389, /* GL_POINT_SIZE_MAX */
+ 1378, /* GL_POINT_FADE_THRESHOLD_SIZE */
+ 1374, /* GL_POINT_DISTANCE_ATTENUATION */
159, /* GL_CLAMP_TO_BORDER */
162, /* GL_CLAMP_TO_EDGE */
- 2100, /* GL_TEXTURE_MIN_LOD */
- 2098, /* GL_TEXTURE_MAX_LOD */
- 1978, /* GL_TEXTURE_BASE_LEVEL */
- 2097, /* GL_TEXTURE_MAX_LEVEL */
- 728, /* GL_IGNORE_BORDER_HP */
+ 2117, /* GL_TEXTURE_MIN_LOD */
+ 2115, /* GL_TEXTURE_MAX_LOD */
+ 1995, /* GL_TEXTURE_BASE_LEVEL */
+ 2114, /* GL_TEXTURE_MAX_LEVEL */
+ 744, /* GL_IGNORE_BORDER_HP */
321, /* GL_CONSTANT_BORDER_HP */
- 1607, /* GL_REPLICATE_BORDER_HP */
+ 1624, /* GL_REPLICATE_BORDER_HP */
333, /* GL_CONVOLUTION_BORDER_COLOR */
- 1268, /* GL_OCCLUSION_TEST_HP */
- 1269, /* GL_OCCLUSION_TEST_RESULT_HP */
- 831, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
- 2006, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
- 2008, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
- 2010, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
- 2011, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 2009, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
- 2007, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
- 1025, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
- 1026, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
- 1440, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
- 1442, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
- 1439, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
- 1441, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
- 2086, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
- 2087, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
- 2085, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
- 683, /* GL_GENERATE_MIPMAP */
- 684, /* GL_GENERATE_MIPMAP_HINT */
- 596, /* GL_FOG_OFFSET_SGIX */
- 597, /* GL_FOG_OFFSET_VALUE_SGIX */
- 2020, /* GL_TEXTURE_COMPARE_SGIX */
- 2019, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
- 2082, /* GL_TEXTURE_LEQUAL_R_SGIX */
- 2074, /* GL_TEXTURE_GEQUAL_R_SGIX */
+ 1285, /* GL_OCCLUSION_TEST_HP */
+ 1286, /* GL_OCCLUSION_TEST_RESULT_HP */
+ 847, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */
+ 2023, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */
+ 2025, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */
+ 2027, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */
+ 2028, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 2026, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */
+ 2024, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */
+ 1041, /* GL_MAX_CLIPMAP_DEPTH_SGIX */
+ 1042, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */
+ 1457, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */
+ 1459, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */
+ 1456, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */
+ 1458, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */
+ 2103, /* GL_TEXTURE_LOD_BIAS_S_SGIX */
+ 2104, /* GL_TEXTURE_LOD_BIAS_T_SGIX */
+ 2102, /* GL_TEXTURE_LOD_BIAS_R_SGIX */
+ 699, /* GL_GENERATE_MIPMAP */
+ 700, /* GL_GENERATE_MIPMAP_HINT */
+ 612, /* GL_FOG_OFFSET_SGIX */
+ 613, /* GL_FOG_OFFSET_VALUE_SGIX */
+ 2037, /* GL_TEXTURE_COMPARE_SGIX */
+ 2036, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */
+ 2099, /* GL_TEXTURE_LEQUAL_R_SGIX */
+ 2091, /* GL_TEXTURE_GEQUAL_R_SGIX */
416, /* GL_DEPTH_COMPONENT16 */
420, /* GL_DEPTH_COMPONENT24 */
424, /* GL_DEPTH_COMPONENT32 */
358, /* GL_CULL_VERTEX_EXT */
360, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
359, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- 2308, /* GL_WRAP_BORDER_SUN */
- 2013, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
- 824, /* GL_LIGHT_MODEL_COLOR_CONTROL */
- 1776, /* GL_SINGLE_COLOR */
- 1760, /* GL_SEPARATE_SPECULAR_COLOR */
- 1771, /* GL_SHARED_TEXTURE_PALETTE_EXT */
- 608, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
- 609, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
- 620, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
- 611, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
- 607, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
- 606, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
- 610, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
- 621, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
- 638, /* GL_FRAMEBUFFER_DEFAULT */
- 665, /* GL_FRAMEBUFFER_UNDEFINED */
+ 2325, /* GL_WRAP_BORDER_SUN */
+ 2030, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
+ 840, /* GL_LIGHT_MODEL_COLOR_CONTROL */
+ 1793, /* GL_SINGLE_COLOR */
+ 1777, /* GL_SEPARATE_SPECULAR_COLOR */
+ 1788, /* GL_SHARED_TEXTURE_PALETTE_EXT */
+ 624, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+ 625, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+ 636, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+ 627, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+ 623, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+ 622, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+ 626, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+ 637, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+ 654, /* GL_FRAMEBUFFER_DEFAULT */
+ 681, /* GL_FRAMEBUFFER_UNDEFINED */
432, /* GL_DEPTH_STENCIL_ATTACHMENT */
- 901, /* GL_MAJOR_VERSION */
- 1157, /* GL_MINOR_VERSION */
- 1248, /* GL_NUM_EXTENSIONS */
+ 917, /* GL_MAJOR_VERSION */
+ 1174, /* GL_MINOR_VERSION */
+ 1265, /* GL_NUM_EXTENSIONS */
327, /* GL_CONTEXT_FLAGS */
- 736, /* GL_INDEX */
+ 752, /* GL_INDEX */
410, /* GL_DEPTH_BUFFER */
- 1850, /* GL_STENCIL_BUFFER */
+ 1867, /* GL_STENCIL_BUFFER */
298, /* GL_COMPRESSED_RED */
299, /* GL_COMPRESSED_RG */
- 861, /* GL_LOSE_CONTEXT_ON_RESET_ARB */
- 703, /* GL_GUILTY_CONTEXT_RESET_ARB */
- 751, /* GL_INNOCENT_CONTEXT_RESET_ARB */
- 2167, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
- 1610, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
- 1462, /* GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
- 1245, /* GL_NO_RESET_NOTIFICATION_ARB */
- 2178, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- 2223, /* GL_UNSIGNED_SHORT_5_6_5 */
- 2224, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- 2220, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- 2217, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- 2192, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- 2188, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- 2095, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
- 2096, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
- 2094, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
- 1161, /* GL_MIRRORED_REPEAT */
- 1696, /* GL_RGB_S3TC */
- 1638, /* GL_RGB4_S3TC */
- 1692, /* GL_RGBA_S3TC */
- 1677, /* GL_RGBA4_S3TC */
- 1686, /* GL_RGBA_DXT5_S3TC */
- 1674, /* GL_RGBA4_DXT5_S3TC */
+ 877, /* GL_LOSE_CONTEXT_ON_RESET_ARB */
+ 719, /* GL_GUILTY_CONTEXT_RESET_ARB */
+ 767, /* GL_INNOCENT_CONTEXT_RESET_ARB */
+ 2184, /* GL_UNKNOWN_CONTEXT_RESET_ARB */
+ 1627, /* GL_RESET_NOTIFICATION_STRATEGY_ARB */
+ 1479, /* GL_PROGRAM_BINARY_RETRIEVABLE_HINT */
+ 1262, /* GL_NO_RESET_NOTIFICATION_ARB */
+ 2195, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ 2240, /* GL_UNSIGNED_SHORT_5_6_5 */
+ 2241, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ 2237, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ 2234, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ 2209, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ 2205, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ 2112, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
+ 2113, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
+ 2111, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
+ 1178, /* GL_MIRRORED_REPEAT */
+ 1713, /* GL_RGB_S3TC */
+ 1655, /* GL_RGB4_S3TC */
+ 1709, /* GL_RGBA_S3TC */
+ 1694, /* GL_RGBA4_S3TC */
+ 1703, /* GL_RGBA_DXT5_S3TC */
+ 1691, /* GL_RGBA4_DXT5_S3TC */
309, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */
304, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */
305, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */
306, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */
- 1223, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
- 1222, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
- 832, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
- 583, /* GL_FOG_COORDINATE_SOURCE */
- 575, /* GL_FOG_COORD */
- 599, /* GL_FRAGMENT_DEPTH */
+ 1240, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */
+ 1239, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */
+ 848, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */
+ 599, /* GL_FOG_COORDINATE_SOURCE */
+ 591, /* GL_FOG_COORD */
+ 615, /* GL_FRAGMENT_DEPTH */
364, /* GL_CURRENT_FOG_COORD */
- 582, /* GL_FOG_COORDINATE_ARRAY_TYPE */
- 581, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
- 580, /* GL_FOG_COORDINATE_ARRAY_POINTER */
- 577, /* GL_FOG_COORDINATE_ARRAY */
+ 598, /* GL_FOG_COORDINATE_ARRAY_TYPE */
+ 597, /* GL_FOG_COORDINATE_ARRAY_STRIDE */
+ 596, /* GL_FOG_COORDINATE_ARRAY_POINTER */
+ 593, /* GL_FOG_COORDINATE_ARRAY */
241, /* GL_COLOR_SUM */
385, /* GL_CURRENT_SECONDARY_COLOR */
- 1751, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
- 1753, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
- 1752, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
- 1750, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
- 1747, /* GL_SECONDARY_COLOR_ARRAY */
+ 1768, /* GL_SECONDARY_COLOR_ARRAY_SIZE */
+ 1770, /* GL_SECONDARY_COLOR_ARRAY_TYPE */
+ 1769, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */
+ 1767, /* GL_SECONDARY_COLOR_ARRAY_POINTER */
+ 1764, /* GL_SECONDARY_COLOR_ARRAY */
383, /* GL_CURRENT_RASTER_SECONDARY_COLOR */
29, /* GL_ALIASED_POINT_SIZE_RANGE */
28, /* GL_ALIASED_LINE_WIDTH_RANGE */
- 1904, /* GL_TEXTURE0 */
- 1906, /* GL_TEXTURE1 */
- 1928, /* GL_TEXTURE2 */
- 1950, /* GL_TEXTURE3 */
- 1956, /* GL_TEXTURE4 */
- 1958, /* GL_TEXTURE5 */
- 1960, /* GL_TEXTURE6 */
- 1962, /* GL_TEXTURE7 */
- 1964, /* GL_TEXTURE8 */
- 1966, /* GL_TEXTURE9 */
- 1907, /* GL_TEXTURE10 */
- 1909, /* GL_TEXTURE11 */
- 1911, /* GL_TEXTURE12 */
- 1913, /* GL_TEXTURE13 */
- 1915, /* GL_TEXTURE14 */
- 1917, /* GL_TEXTURE15 */
- 1919, /* GL_TEXTURE16 */
- 1921, /* GL_TEXTURE17 */
- 1923, /* GL_TEXTURE18 */
- 1925, /* GL_TEXTURE19 */
- 1929, /* GL_TEXTURE20 */
- 1931, /* GL_TEXTURE21 */
- 1933, /* GL_TEXTURE22 */
- 1935, /* GL_TEXTURE23 */
- 1937, /* GL_TEXTURE24 */
- 1939, /* GL_TEXTURE25 */
- 1941, /* GL_TEXTURE26 */
- 1943, /* GL_TEXTURE27 */
- 1945, /* GL_TEXTURE28 */
- 1947, /* GL_TEXTURE29 */
- 1951, /* GL_TEXTURE30 */
- 1953, /* GL_TEXTURE31 */
+ 1921, /* GL_TEXTURE0 */
+ 1923, /* GL_TEXTURE1 */
+ 1945, /* GL_TEXTURE2 */
+ 1967, /* GL_TEXTURE3 */
+ 1973, /* GL_TEXTURE4 */
+ 1975, /* GL_TEXTURE5 */
+ 1977, /* GL_TEXTURE6 */
+ 1979, /* GL_TEXTURE7 */
+ 1981, /* GL_TEXTURE8 */
+ 1983, /* GL_TEXTURE9 */
+ 1924, /* GL_TEXTURE10 */
+ 1926, /* GL_TEXTURE11 */
+ 1928, /* GL_TEXTURE12 */
+ 1930, /* GL_TEXTURE13 */
+ 1932, /* GL_TEXTURE14 */
+ 1934, /* GL_TEXTURE15 */
+ 1936, /* GL_TEXTURE16 */
+ 1938, /* GL_TEXTURE17 */
+ 1940, /* GL_TEXTURE18 */
+ 1942, /* GL_TEXTURE19 */
+ 1946, /* GL_TEXTURE20 */
+ 1948, /* GL_TEXTURE21 */
+ 1950, /* GL_TEXTURE22 */
+ 1952, /* GL_TEXTURE23 */
+ 1954, /* GL_TEXTURE24 */
+ 1956, /* GL_TEXTURE25 */
+ 1958, /* GL_TEXTURE26 */
+ 1960, /* GL_TEXTURE27 */
+ 1962, /* GL_TEXTURE28 */
+ 1964, /* GL_TEXTURE29 */
+ 1968, /* GL_TEXTURE30 */
+ 1970, /* GL_TEXTURE31 */
19, /* GL_ACTIVE_TEXTURE */
166, /* GL_CLIENT_ACTIVE_TEXTURE */
- 1122, /* GL_MAX_TEXTURE_UNITS */
- 2150, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- 2153, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- 2155, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- 2147, /* GL_TRANSPOSE_COLOR_MATRIX */
- 1886, /* GL_SUBTRACT */
- 1103, /* GL_MAX_RENDERBUFFER_SIZE */
+ 1139, /* GL_MAX_TEXTURE_UNITS */
+ 2167, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ 2170, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ 2172, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ 2164, /* GL_TRANSPOSE_COLOR_MATRIX */
+ 1903, /* GL_SUBTRACT */
+ 1120, /* GL_MAX_RENDERBUFFER_SIZE */
290, /* GL_COMPRESSED_ALPHA */
294, /* GL_COMPRESSED_LUMINANCE */
295, /* GL_COMPRESSED_LUMINANCE_ALPHA */
292, /* GL_COMPRESSED_INTENSITY */
300, /* GL_COMPRESSED_RGB */
301, /* GL_COMPRESSED_RGBA */
- 2027, /* GL_TEXTURE_COMPRESSION_HINT */
- 2104, /* GL_TEXTURE_RECTANGLE */
- 1992, /* GL_TEXTURE_BINDING_RECTANGLE */
- 1516, /* GL_PROXY_TEXTURE_RECTANGLE */
- 1100, /* GL_MAX_RECTANGLE_TEXTURE_SIZE */
+ 2044, /* GL_TEXTURE_COMPRESSION_HINT */
+ 2121, /* GL_TEXTURE_RECTANGLE */
+ 2009, /* GL_TEXTURE_BINDING_RECTANGLE */
+ 1533, /* GL_PROXY_TEXTURE_RECTANGLE */
+ 1117, /* GL_MAX_RECTANGLE_TEXTURE_SIZE */
431, /* GL_DEPTH_STENCIL */
- 2184, /* GL_UNSIGNED_INT_24_8 */
- 1117, /* GL_MAX_TEXTURE_LOD_BIAS */
- 2093, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
- 1119, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
- 2065, /* GL_TEXTURE_FILTER_CONTROL */
- 2083, /* GL_TEXTURE_LOD_BIAS */
+ 2201, /* GL_UNSIGNED_INT_24_8 */
+ 1134, /* GL_MAX_TEXTURE_LOD_BIAS */
+ 2110, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
+ 1136, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
+ 2082, /* GL_TEXTURE_FILTER_CONTROL */
+ 2100, /* GL_TEXTURE_LOD_BIAS */
274, /* GL_COMBINE4 */
- 1109, /* GL_MAX_SHININESS_NV */
- 1110, /* GL_MAX_SPOT_EXPONENT_NV */
- 734, /* GL_INCR_WRAP */
+ 1126, /* GL_MAX_SHININESS_NV */
+ 1127, /* GL_MAX_SPOT_EXPONENT_NV */
+ 750, /* GL_INCR_WRAP */
396, /* GL_DECR_WRAP */
- 1181, /* GL_MODELVIEW1_ARB */
- 1239, /* GL_NORMAL_MAP */
- 1567, /* GL_REFLECTION_MAP */
- 2037, /* GL_TEXTURE_CUBE_MAP */
- 1989, /* GL_TEXTURE_BINDING_CUBE_MAP */
- 2049, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
- 2039, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
- 2052, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
- 2042, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
- 2055, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
- 2045, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
- 1514, /* GL_PROXY_TEXTURE_CUBE_MAP */
- 1039, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
- 1217, /* GL_MULTISAMPLE_FILTER_HINT_NV */
- 1454, /* GL_PRIMITIVE_RESTART_NV */
- 1453, /* GL_PRIMITIVE_RESTART_INDEX_NV */
- 591, /* GL_FOG_DISTANCE_MODE_NV */
- 538, /* GL_EYE_RADIAL_NV */
- 537, /* GL_EYE_PLANE_ABSOLUTE_NV */
+ 1198, /* GL_MODELVIEW1_ARB */
+ 1256, /* GL_NORMAL_MAP */
+ 1584, /* GL_REFLECTION_MAP */
+ 2054, /* GL_TEXTURE_CUBE_MAP */
+ 2006, /* GL_TEXTURE_BINDING_CUBE_MAP */
+ 2066, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */
+ 2056, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */
+ 2069, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */
+ 2059, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */
+ 2072, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */
+ 2062, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */
+ 1531, /* GL_PROXY_TEXTURE_CUBE_MAP */
+ 1055, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */
+ 1234, /* GL_MULTISAMPLE_FILTER_HINT_NV */
+ 1471, /* GL_PRIMITIVE_RESTART_NV */
+ 1470, /* GL_PRIMITIVE_RESTART_INDEX_NV */
+ 607, /* GL_FOG_DISTANCE_MODE_NV */
+ 554, /* GL_EYE_RADIAL_NV */
+ 553, /* GL_EYE_PLANE_ABSOLUTE_NV */
273, /* GL_COMBINE */
280, /* GL_COMBINE_RGB */
275, /* GL_COMBINE_ALPHA */
- 1697, /* GL_RGB_SCALE */
+ 1714, /* GL_RGB_SCALE */
25, /* GL_ADD_SIGNED */
- 771, /* GL_INTERPOLATE */
+ 787, /* GL_INTERPOLATE */
316, /* GL_CONSTANT */
- 1446, /* GL_PRIMARY_COLOR */
- 1443, /* GL_PREVIOUS */
- 1791, /* GL_SOURCE0_RGB */
- 1797, /* GL_SOURCE1_RGB */
- 1803, /* GL_SOURCE2_RGB */
- 1807, /* GL_SOURCE3_RGB_NV */
- 1788, /* GL_SOURCE0_ALPHA */
- 1794, /* GL_SOURCE1_ALPHA */
- 1800, /* GL_SOURCE2_ALPHA */
- 1806, /* GL_SOURCE3_ALPHA_NV */
- 1282, /* GL_OPERAND0_RGB */
- 1288, /* GL_OPERAND1_RGB */
- 1294, /* GL_OPERAND2_RGB */
- 1298, /* GL_OPERAND3_RGB_NV */
- 1279, /* GL_OPERAND0_ALPHA */
- 1285, /* GL_OPERAND1_ALPHA */
- 1291, /* GL_OPERAND2_ALPHA */
- 1297, /* GL_OPERAND3_ALPHA_NV */
+ 1463, /* GL_PRIMARY_COLOR */
+ 1460, /* GL_PREVIOUS */
+ 1808, /* GL_SOURCE0_RGB */
+ 1814, /* GL_SOURCE1_RGB */
+ 1820, /* GL_SOURCE2_RGB */
+ 1824, /* GL_SOURCE3_RGB_NV */
+ 1805, /* GL_SOURCE0_ALPHA */
+ 1811, /* GL_SOURCE1_ALPHA */
+ 1817, /* GL_SOURCE2_ALPHA */
+ 1823, /* GL_SOURCE3_ALPHA_NV */
+ 1299, /* GL_OPERAND0_RGB */
+ 1305, /* GL_OPERAND1_RGB */
+ 1311, /* GL_OPERAND2_RGB */
+ 1315, /* GL_OPERAND3_RGB_NV */
+ 1296, /* GL_OPERAND0_ALPHA */
+ 1302, /* GL_OPERAND1_ALPHA */
+ 1308, /* GL_OPERAND2_ALPHA */
+ 1314, /* GL_OPERAND3_ALPHA_NV */
137, /* GL_BUFFER_OBJECT_APPLE */
- 2236, /* GL_VERTEX_ARRAY_BINDING */
- 2102, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
- 2103, /* GL_TEXTURE_RANGE_POINTER_APPLE */
- 2313, /* GL_YCBCR_422_APPLE */
- 2225, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- 2227, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- 2114, /* GL_TEXTURE_STORAGE_HINT_APPLE */
- 1877, /* GL_STORAGE_PRIVATE_APPLE */
- 1876, /* GL_STORAGE_CACHED_APPLE */
- 1878, /* GL_STORAGE_SHARED_APPLE */
- 1778, /* GL_SLICE_ACCUM_SUN */
- 1525, /* GL_QUAD_MESH_SUN */
- 2161, /* GL_TRIANGLE_MESH_SUN */
- 2278, /* GL_VERTEX_PROGRAM_ARB */
- 2289, /* GL_VERTEX_STATE_PROGRAM_NV */
- 2263, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- 2271, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- 2273, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- 2275, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ 2253, /* GL_VERTEX_ARRAY_BINDING */
+ 2119, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
+ 2120, /* GL_TEXTURE_RANGE_POINTER_APPLE */
+ 2330, /* GL_YCBCR_422_APPLE */
+ 2242, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ 2244, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ 2131, /* GL_TEXTURE_STORAGE_HINT_APPLE */
+ 1894, /* GL_STORAGE_PRIVATE_APPLE */
+ 1893, /* GL_STORAGE_CACHED_APPLE */
+ 1895, /* GL_STORAGE_SHARED_APPLE */
+ 1795, /* GL_SLICE_ACCUM_SUN */
+ 1542, /* GL_QUAD_MESH_SUN */
+ 2178, /* GL_TRIANGLE_MESH_SUN */
+ 2295, /* GL_VERTEX_PROGRAM_ARB */
+ 2306, /* GL_VERTEX_STATE_PROGRAM_NV */
+ 2280, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ 2288, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ 2290, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ 2292, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
387, /* GL_CURRENT_VERTEX_ATTRIB */
- 1470, /* GL_PROGRAM_LENGTH_ARB */
- 1486, /* GL_PROGRAM_STRING_ARB */
- 1204, /* GL_MODELVIEW_PROJECTION_NV */
- 727, /* GL_IDENTITY_NV */
- 804, /* GL_INVERSE_NV */
- 2152, /* GL_TRANSPOSE_NV */
- 805, /* GL_INVERSE_TRANSPOSE_NV */
- 1084, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
- 1083, /* GL_MAX_PROGRAM_MATRICES_ARB */
- 965, /* GL_MATRIX0_NV */
- 977, /* GL_MATRIX1_NV */
- 989, /* GL_MATRIX2_NV */
- 993, /* GL_MATRIX3_NV */
- 995, /* GL_MATRIX4_NV */
- 997, /* GL_MATRIX5_NV */
- 999, /* GL_MATRIX6_NV */
- 1001, /* GL_MATRIX7_NV */
+ 1487, /* GL_PROGRAM_LENGTH_ARB */
+ 1503, /* GL_PROGRAM_STRING_ARB */
+ 1221, /* GL_MODELVIEW_PROJECTION_NV */
+ 743, /* GL_IDENTITY_NV */
+ 820, /* GL_INVERSE_NV */
+ 2169, /* GL_TRANSPOSE_NV */
+ 821, /* GL_INVERSE_TRANSPOSE_NV */
+ 1101, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
+ 1100, /* GL_MAX_PROGRAM_MATRICES_ARB */
+ 981, /* GL_MATRIX0_NV */
+ 993, /* GL_MATRIX1_NV */
+ 1005, /* GL_MATRIX2_NV */
+ 1009, /* GL_MATRIX3_NV */
+ 1011, /* GL_MATRIX4_NV */
+ 1013, /* GL_MATRIX5_NV */
+ 1015, /* GL_MATRIX6_NV */
+ 1017, /* GL_MATRIX7_NV */
370, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
367, /* GL_CURRENT_MATRIX_ARB */
- 1483, /* GL_PROGRAM_POINT_SIZE */
- 2284, /* GL_VERTEX_PROGRAM_TWO_SIDE */
- 1482, /* GL_PROGRAM_PARAMETER_NV */
- 2269, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
- 1488, /* GL_PROGRAM_TARGET_NV */
- 1485, /* GL_PROGRAM_RESIDENT_NV */
- 2124, /* GL_TRACK_MATRIX_NV */
- 2125, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- 2279, /* GL_VERTEX_PROGRAM_BINDING_NV */
- 1464, /* GL_PROGRAM_ERROR_POSITION_ARB */
+ 1500, /* GL_PROGRAM_POINT_SIZE */
+ 2301, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ 1499, /* GL_PROGRAM_PARAMETER_NV */
+ 2286, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ 1505, /* GL_PROGRAM_TARGET_NV */
+ 1502, /* GL_PROGRAM_RESIDENT_NV */
+ 2141, /* GL_TRACK_MATRIX_NV */
+ 2142, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ 2296, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ 1481, /* GL_PROGRAM_ERROR_POSITION_ARB */
412, /* GL_DEPTH_CLAMP */
- 2244, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- 2251, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- 2252, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- 2253, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- 2254, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- 2255, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- 2256, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- 2257, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- 2258, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- 2259, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- 2245, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- 2246, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- 2247, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- 2248, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- 2249, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- 2250, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- 913, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
- 920, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
- 921, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
- 922, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
- 923, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
- 924, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
- 925, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
- 926, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
- 927, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
- 928, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
- 914, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
- 915, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
- 916, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
- 917, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
- 918, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
- 919, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
- 940, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
- 947, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
- 948, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
- 949, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
- 950, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
- 951, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
- 952, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
- 1463, /* GL_PROGRAM_BINDING_ARB */
- 954, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
- 955, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
- 941, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
- 942, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
- 943, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
- 944, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
- 945, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
- 946, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
- 2025, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
- 2022, /* GL_TEXTURE_COMPRESSED */
- 1246, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
+ 2261, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ 2268, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ 2269, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ 2270, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ 2271, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ 2272, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ 2273, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ 2274, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ 2275, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ 2276, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ 2262, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ 2263, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ 2264, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ 2265, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ 2266, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ 2267, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ 929, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
+ 936, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
+ 937, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
+ 938, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */
+ 939, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */
+ 940, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */
+ 941, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */
+ 942, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */
+ 943, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */
+ 944, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */
+ 930, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */
+ 931, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */
+ 932, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */
+ 933, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */
+ 934, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */
+ 935, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */
+ 956, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */
+ 963, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */
+ 964, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */
+ 965, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */
+ 966, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */
+ 967, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */
+ 968, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */
+ 1480, /* GL_PROGRAM_BINDING_ARB */
+ 970, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */
+ 971, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */
+ 957, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */
+ 958, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */
+ 959, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */
+ 960, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */
+ 961, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */
+ 962, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */
+ 2042, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */
+ 2039, /* GL_TEXTURE_COMPRESSED */
+ 1263, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */
314, /* GL_COMPRESSED_TEXTURE_FORMATS */
- 1144, /* GL_MAX_VERTEX_UNITS_ARB */
+ 1161, /* GL_MAX_VERTEX_UNITS_ARB */
23, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- 2307, /* GL_WEIGHT_SUM_UNITY_ARB */
- 2277, /* GL_VERTEX_BLEND_ARB */
+ 2324, /* GL_WEIGHT_SUM_UNITY_ARB */
+ 2294, /* GL_VERTEX_BLEND_ARB */
389, /* GL_CURRENT_WEIGHT_ARB */
- 2305, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- 2303, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- 2301, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- 2299, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- 2294, /* GL_WEIGHT_ARRAY_ARB */
+ 2322, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ 2320, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ 2318, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ 2316, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ 2311, /* GL_WEIGHT_ARRAY_ARB */
446, /* GL_DOT3_RGB */
447, /* GL_DOT3_RGBA */
308, /* GL_COMPRESSED_RGB_FXT1_3DFX */
303, /* GL_COMPRESSED_RGBA_FXT1_3DFX */
- 1212, /* GL_MULTISAMPLE_3DFX */
- 1736, /* GL_SAMPLE_BUFFERS_3DFX */
- 1727, /* GL_SAMPLES_3DFX */
- 1192, /* GL_MODELVIEW2_ARB */
- 1195, /* GL_MODELVIEW3_ARB */
- 1196, /* GL_MODELVIEW4_ARB */
- 1197, /* GL_MODELVIEW5_ARB */
- 1198, /* GL_MODELVIEW6_ARB */
- 1199, /* GL_MODELVIEW7_ARB */
- 1200, /* GL_MODELVIEW8_ARB */
- 1201, /* GL_MODELVIEW9_ARB */
- 1171, /* GL_MODELVIEW10_ARB */
- 1172, /* GL_MODELVIEW11_ARB */
- 1173, /* GL_MODELVIEW12_ARB */
- 1174, /* GL_MODELVIEW13_ARB */
- 1175, /* GL_MODELVIEW14_ARB */
- 1176, /* GL_MODELVIEW15_ARB */
- 1177, /* GL_MODELVIEW16_ARB */
- 1178, /* GL_MODELVIEW17_ARB */
- 1179, /* GL_MODELVIEW18_ARB */
- 1180, /* GL_MODELVIEW19_ARB */
- 1182, /* GL_MODELVIEW20_ARB */
- 1183, /* GL_MODELVIEW21_ARB */
- 1184, /* GL_MODELVIEW22_ARB */
- 1185, /* GL_MODELVIEW23_ARB */
- 1186, /* GL_MODELVIEW24_ARB */
- 1187, /* GL_MODELVIEW25_ARB */
- 1188, /* GL_MODELVIEW26_ARB */
- 1189, /* GL_MODELVIEW27_ARB */
- 1190, /* GL_MODELVIEW28_ARB */
- 1191, /* GL_MODELVIEW29_ARB */
- 1193, /* GL_MODELVIEW30_ARB */
- 1194, /* GL_MODELVIEW31_ARB */
+ 1229, /* GL_MULTISAMPLE_3DFX */
+ 1753, /* GL_SAMPLE_BUFFERS_3DFX */
+ 1744, /* GL_SAMPLES_3DFX */
+ 1209, /* GL_MODELVIEW2_ARB */
+ 1212, /* GL_MODELVIEW3_ARB */
+ 1213, /* GL_MODELVIEW4_ARB */
+ 1214, /* GL_MODELVIEW5_ARB */
+ 1215, /* GL_MODELVIEW6_ARB */
+ 1216, /* GL_MODELVIEW7_ARB */
+ 1217, /* GL_MODELVIEW8_ARB */
+ 1218, /* GL_MODELVIEW9_ARB */
+ 1188, /* GL_MODELVIEW10_ARB */
+ 1189, /* GL_MODELVIEW11_ARB */
+ 1190, /* GL_MODELVIEW12_ARB */
+ 1191, /* GL_MODELVIEW13_ARB */
+ 1192, /* GL_MODELVIEW14_ARB */
+ 1193, /* GL_MODELVIEW15_ARB */
+ 1194, /* GL_MODELVIEW16_ARB */
+ 1195, /* GL_MODELVIEW17_ARB */
+ 1196, /* GL_MODELVIEW18_ARB */
+ 1197, /* GL_MODELVIEW19_ARB */
+ 1199, /* GL_MODELVIEW20_ARB */
+ 1200, /* GL_MODELVIEW21_ARB */
+ 1201, /* GL_MODELVIEW22_ARB */
+ 1202, /* GL_MODELVIEW23_ARB */
+ 1203, /* GL_MODELVIEW24_ARB */
+ 1204, /* GL_MODELVIEW25_ARB */
+ 1205, /* GL_MODELVIEW26_ARB */
+ 1206, /* GL_MODELVIEW27_ARB */
+ 1207, /* GL_MODELVIEW28_ARB */
+ 1208, /* GL_MODELVIEW29_ARB */
+ 1210, /* GL_MODELVIEW30_ARB */
+ 1211, /* GL_MODELVIEW31_ARB */
451, /* GL_DOT3_RGB_EXT */
- 1460, /* GL_PROGRAM_BINARY_LENGTH */
- 1165, /* GL_MIRROR_CLAMP_EXT */
- 1168, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
- 1207, /* GL_MODULATE_ADD_ATI */
- 1208, /* GL_MODULATE_SIGNED_ADD_ATI */
- 1209, /* GL_MODULATE_SUBTRACT_ATI */
- 2314, /* GL_YCBCR_MESA */
- 1306, /* GL_PACK_INVERT_MESA */
+ 1477, /* GL_PROGRAM_BINARY_LENGTH */
+ 1182, /* GL_MIRROR_CLAMP_EXT */
+ 1185, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */
+ 1224, /* GL_MODULATE_ADD_ATI */
+ 1225, /* GL_MODULATE_SIGNED_ADD_ATI */
+ 1226, /* GL_MODULATE_SUBTRACT_ATI */
+ 2331, /* GL_YCBCR_MESA */
+ 1323, /* GL_PACK_INVERT_MESA */
392, /* GL_DEBUG_OBJECT_MESA */
393, /* GL_DEBUG_PRINT_MESA */
391, /* GL_DEBUG_ASSERT_MESA */
@@ -5701,354 +5735,354 @@ static const unsigned reduced_enums[1564] =
146, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */
144, /* GL_BUMP_NUM_TEX_UNITS_ATI */
148, /* GL_BUMP_TEX_UNITS_ATI */
- 511, /* GL_DUDV_ATI */
- 510, /* GL_DU8DV8_ATI */
+ 527, /* GL_DUDV_ATI */
+ 526, /* GL_DU8DV8_ATI */
143, /* GL_BUMP_ENVMAP_ATI */
147, /* GL_BUMP_TARGET_ATI */
- 1249, /* GL_NUM_PROGRAM_BINARY_FORMATS */
- 1458, /* GL_PROGRAM_BINARY_FORMATS */
- 1840, /* GL_STENCIL_BACK_FUNC */
- 1838, /* GL_STENCIL_BACK_FAIL */
- 1842, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
- 1844, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
- 600, /* GL_FRAGMENT_PROGRAM_ARB */
- 1456, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 1491, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 1490, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
- 1473, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 1479, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 1478, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 1073, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
- 1098, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
- 1097, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
- 1086, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
- 1092, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
- 1091, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
- 1668, /* GL_RGBA32F */
- 1631, /* GL_RGB32F */
- 1659, /* GL_RGBA16F */
- 1623, /* GL_RGB16F */
- 1687, /* GL_RGBA_FLOAT_MODE_ARB */
- 1042, /* GL_MAX_DRAW_BUFFERS */
+ 1266, /* GL_NUM_PROGRAM_BINARY_FORMATS */
+ 1475, /* GL_PROGRAM_BINARY_FORMATS */
+ 1857, /* GL_STENCIL_BACK_FUNC */
+ 1855, /* GL_STENCIL_BACK_FAIL */
+ 1859, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */
+ 1861, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */
+ 616, /* GL_FRAGMENT_PROGRAM_ARB */
+ 1473, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 1508, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 1507, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 1490, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 1496, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 1495, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 1090, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */
+ 1115, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */
+ 1114, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */
+ 1103, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */
+ 1109, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */
+ 1108, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */
+ 1685, /* GL_RGBA32F */
+ 1648, /* GL_RGB32F */
+ 1676, /* GL_RGBA16F */
+ 1640, /* GL_RGB16F */
+ 1704, /* GL_RGBA_FLOAT_MODE_ARB */
+ 1058, /* GL_MAX_DRAW_BUFFERS */
455, /* GL_DRAW_BUFFER0 */
- 458, /* GL_DRAW_BUFFER1 */
- 479, /* GL_DRAW_BUFFER2 */
- 482, /* GL_DRAW_BUFFER3 */
- 485, /* GL_DRAW_BUFFER4 */
- 488, /* GL_DRAW_BUFFER5 */
- 491, /* GL_DRAW_BUFFER6 */
- 494, /* GL_DRAW_BUFFER7 */
- 497, /* GL_DRAW_BUFFER8 */
- 500, /* GL_DRAW_BUFFER9 */
- 459, /* GL_DRAW_BUFFER10 */
- 462, /* GL_DRAW_BUFFER11 */
- 465, /* GL_DRAW_BUFFER12 */
- 468, /* GL_DRAW_BUFFER13 */
- 471, /* GL_DRAW_BUFFER14 */
- 474, /* GL_DRAW_BUFFER15 */
+ 459, /* GL_DRAW_BUFFER1 */
+ 487, /* GL_DRAW_BUFFER2 */
+ 491, /* GL_DRAW_BUFFER3 */
+ 495, /* GL_DRAW_BUFFER4 */
+ 499, /* GL_DRAW_BUFFER5 */
+ 503, /* GL_DRAW_BUFFER6 */
+ 507, /* GL_DRAW_BUFFER7 */
+ 511, /* GL_DRAW_BUFFER8 */
+ 515, /* GL_DRAW_BUFFER9 */
+ 460, /* GL_DRAW_BUFFER10 */
+ 464, /* GL_DRAW_BUFFER11 */
+ 468, /* GL_DRAW_BUFFER12 */
+ 472, /* GL_DRAW_BUFFER13 */
+ 476, /* GL_DRAW_BUFFER14 */
+ 480, /* GL_DRAW_BUFFER15 */
97, /* GL_BLEND_EQUATION_ALPHA */
- 1016, /* GL_MATRIX_PALETTE_ARB */
- 1066, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
- 1069, /* GL_MAX_PALETTE_MATRICES_ARB */
+ 1032, /* GL_MATRIX_PALETTE_ARB */
+ 1083, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */
+ 1086, /* GL_MAX_PALETTE_MATRICES_ARB */
373, /* GL_CURRENT_PALETTE_MATRIX_ARB */
- 1004, /* GL_MATRIX_INDEX_ARRAY_ARB */
+ 1020, /* GL_MATRIX_INDEX_ARRAY_ARB */
368, /* GL_CURRENT_MATRIX_INDEX_ARB */
- 1009, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
- 1013, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
- 1011, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
- 1007, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
- 2060, /* GL_TEXTURE_DEPTH_SIZE */
+ 1025, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */
+ 1029, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */
+ 1027, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */
+ 1023, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */
+ 2077, /* GL_TEXTURE_DEPTH_SIZE */
439, /* GL_DEPTH_TEXTURE_MODE */
- 2017, /* GL_TEXTURE_COMPARE_MODE */
- 2015, /* GL_TEXTURE_COMPARE_FUNC */
+ 2034, /* GL_TEXTURE_COMPARE_MODE */
+ 2032, /* GL_TEXTURE_COMPARE_FUNC */
284, /* GL_COMPARE_REF_TO_TEXTURE */
- 1383, /* GL_POINT_SPRITE */
+ 1400, /* GL_POINT_SPRITE */
347, /* GL_COORD_REPLACE */
- 1388, /* GL_POINT_SPRITE_R_MODE_NV */
- 1531, /* GL_QUERY_COUNTER_BITS */
+ 1405, /* GL_POINT_SPRITE_R_MODE_NV */
+ 1548, /* GL_QUERY_COUNTER_BITS */
376, /* GL_CURRENT_QUERY */
- 1535, /* GL_QUERY_RESULT */
- 1537, /* GL_QUERY_RESULT_AVAILABLE */
- 1136, /* GL_MAX_VERTEX_ATTRIBS */
- 2267, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ 1552, /* GL_QUERY_RESULT */
+ 1554, /* GL_QUERY_RESULT_AVAILABLE */
+ 1153, /* GL_MAX_VERTEX_ATTRIBS */
+ 2284, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
437, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
436, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
- 1113, /* GL_MAX_TEXTURE_COORDS */
- 1115, /* GL_MAX_TEXTURE_IMAGE_UNITS */
- 1466, /* GL_PROGRAM_ERROR_STRING_ARB */
- 1468, /* GL_PROGRAM_FORMAT_ASCII_ARB */
- 1467, /* GL_PROGRAM_FORMAT_ARB */
- 2116, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
+ 1130, /* GL_MAX_TEXTURE_COORDS */
+ 1132, /* GL_MAX_TEXTURE_IMAGE_UNITS */
+ 1483, /* GL_PROGRAM_ERROR_STRING_ARB */
+ 1485, /* GL_PROGRAM_FORMAT_ASCII_ARB */
+ 1484, /* GL_PROGRAM_FORMAT_ARB */
+ 2133, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */
409, /* GL_DEPTH_BOUNDS_TEST_EXT */
408, /* GL_DEPTH_BOUNDS_EXT */
61, /* GL_ARRAY_BUFFER */
- 524, /* GL_ELEMENT_ARRAY_BUFFER */
+ 540, /* GL_ELEMENT_ARRAY_BUFFER */
62, /* GL_ARRAY_BUFFER_BINDING */
- 525, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- 2238, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- 1234, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
+ 541, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
+ 2255, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ 1251, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
190, /* GL_COLOR_ARRAY_BUFFER_BINDING */
- 738, /* GL_INDEX_ARRAY_BUFFER_BINDING */
- 2030, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
- 520, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
- 1748, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
- 578, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- 2295, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- 2260, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- 1469, /* GL_PROGRAM_INSTRUCTIONS_ARB */
- 1079, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
- 1475, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 1088, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
- 1489, /* GL_PROGRAM_TEMPORARIES_ARB */
- 1094, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
- 1477, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 1090, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
- 1481, /* GL_PROGRAM_PARAMETERS_ARB */
- 1093, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
- 1476, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
- 1089, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
- 1457, /* GL_PROGRAM_ATTRIBS_ARB */
- 1074, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
- 1474, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
- 1087, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
- 1455, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
- 1072, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
- 1472, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 1085, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
- 1080, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
- 1076, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
- 1492, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- 2149, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- 1554, /* GL_READ_ONLY */
- 2309, /* GL_WRITE_ONLY */
- 1556, /* GL_READ_WRITE */
+ 754, /* GL_INDEX_ARRAY_BUFFER_BINDING */
+ 2047, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */
+ 536, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
+ 1765, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
+ 594, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
+ 2312, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ 2277, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ 1486, /* GL_PROGRAM_INSTRUCTIONS_ARB */
+ 1096, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
+ 1492, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 1105, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
+ 1506, /* GL_PROGRAM_TEMPORARIES_ARB */
+ 1111, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
+ 1494, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 1107, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */
+ 1498, /* GL_PROGRAM_PARAMETERS_ARB */
+ 1110, /* GL_MAX_PROGRAM_PARAMETERS_ARB */
+ 1493, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 1106, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */
+ 1474, /* GL_PROGRAM_ATTRIBS_ARB */
+ 1091, /* GL_MAX_PROGRAM_ATTRIBS_ARB */
+ 1491, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 1104, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */
+ 1472, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 1089, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */
+ 1489, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 1102, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */
+ 1097, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
+ 1093, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
+ 1509, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
+ 2166, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ 1571, /* GL_READ_ONLY */
+ 2326, /* GL_WRITE_ONLY */
+ 1573, /* GL_READ_WRITE */
124, /* GL_BUFFER_ACCESS */
129, /* GL_BUFFER_MAPPED */
134, /* GL_BUFFER_MAP_POINTER */
- 2123, /* GL_TIME_ELAPSED_EXT */
- 964, /* GL_MATRIX0_ARB */
- 976, /* GL_MATRIX1_ARB */
- 988, /* GL_MATRIX2_ARB */
- 992, /* GL_MATRIX3_ARB */
- 994, /* GL_MATRIX4_ARB */
- 996, /* GL_MATRIX5_ARB */
- 998, /* GL_MATRIX6_ARB */
- 1000, /* GL_MATRIX7_ARB */
- 1002, /* GL_MATRIX8_ARB */
- 1003, /* GL_MATRIX9_ARB */
- 966, /* GL_MATRIX10_ARB */
- 967, /* GL_MATRIX11_ARB */
- 968, /* GL_MATRIX12_ARB */
- 969, /* GL_MATRIX13_ARB */
- 970, /* GL_MATRIX14_ARB */
- 971, /* GL_MATRIX15_ARB */
- 972, /* GL_MATRIX16_ARB */
- 973, /* GL_MATRIX17_ARB */
- 974, /* GL_MATRIX18_ARB */
- 975, /* GL_MATRIX19_ARB */
- 978, /* GL_MATRIX20_ARB */
- 979, /* GL_MATRIX21_ARB */
- 980, /* GL_MATRIX22_ARB */
- 981, /* GL_MATRIX23_ARB */
- 982, /* GL_MATRIX24_ARB */
- 983, /* GL_MATRIX25_ARB */
- 984, /* GL_MATRIX26_ARB */
- 985, /* GL_MATRIX27_ARB */
- 986, /* GL_MATRIX28_ARB */
- 987, /* GL_MATRIX29_ARB */
- 990, /* GL_MATRIX30_ARB */
- 991, /* GL_MATRIX31_ARB */
- 1881, /* GL_STREAM_DRAW */
- 1883, /* GL_STREAM_READ */
- 1879, /* GL_STREAM_COPY */
- 1830, /* GL_STATIC_DRAW */
- 1832, /* GL_STATIC_READ */
- 1828, /* GL_STATIC_COPY */
- 514, /* GL_DYNAMIC_DRAW */
- 516, /* GL_DYNAMIC_READ */
- 512, /* GL_DYNAMIC_COPY */
- 1346, /* GL_PIXEL_PACK_BUFFER */
- 1350, /* GL_PIXEL_UNPACK_BUFFER */
- 1347, /* GL_PIXEL_PACK_BUFFER_BINDING */
- 1351, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
+ 2140, /* GL_TIME_ELAPSED_EXT */
+ 980, /* GL_MATRIX0_ARB */
+ 992, /* GL_MATRIX1_ARB */
+ 1004, /* GL_MATRIX2_ARB */
+ 1008, /* GL_MATRIX3_ARB */
+ 1010, /* GL_MATRIX4_ARB */
+ 1012, /* GL_MATRIX5_ARB */
+ 1014, /* GL_MATRIX6_ARB */
+ 1016, /* GL_MATRIX7_ARB */
+ 1018, /* GL_MATRIX8_ARB */
+ 1019, /* GL_MATRIX9_ARB */
+ 982, /* GL_MATRIX10_ARB */
+ 983, /* GL_MATRIX11_ARB */
+ 984, /* GL_MATRIX12_ARB */
+ 985, /* GL_MATRIX13_ARB */
+ 986, /* GL_MATRIX14_ARB */
+ 987, /* GL_MATRIX15_ARB */
+ 988, /* GL_MATRIX16_ARB */
+ 989, /* GL_MATRIX17_ARB */
+ 990, /* GL_MATRIX18_ARB */
+ 991, /* GL_MATRIX19_ARB */
+ 994, /* GL_MATRIX20_ARB */
+ 995, /* GL_MATRIX21_ARB */
+ 996, /* GL_MATRIX22_ARB */
+ 997, /* GL_MATRIX23_ARB */
+ 998, /* GL_MATRIX24_ARB */
+ 999, /* GL_MATRIX25_ARB */
+ 1000, /* GL_MATRIX26_ARB */
+ 1001, /* GL_MATRIX27_ARB */
+ 1002, /* GL_MATRIX28_ARB */
+ 1003, /* GL_MATRIX29_ARB */
+ 1006, /* GL_MATRIX30_ARB */
+ 1007, /* GL_MATRIX31_ARB */
+ 1898, /* GL_STREAM_DRAW */
+ 1900, /* GL_STREAM_READ */
+ 1896, /* GL_STREAM_COPY */
+ 1847, /* GL_STATIC_DRAW */
+ 1849, /* GL_STATIC_READ */
+ 1845, /* GL_STATIC_COPY */
+ 530, /* GL_DYNAMIC_DRAW */
+ 532, /* GL_DYNAMIC_READ */
+ 528, /* GL_DYNAMIC_COPY */
+ 1363, /* GL_PIXEL_PACK_BUFFER */
+ 1367, /* GL_PIXEL_UNPACK_BUFFER */
+ 1364, /* GL_PIXEL_PACK_BUFFER_BINDING */
+ 1368, /* GL_PIXEL_UNPACK_BUFFER_BINDING */
400, /* GL_DEPTH24_STENCIL8 */
- 2112, /* GL_TEXTURE_STENCIL_SIZE */
- 2058, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
- 1075, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
- 1078, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
- 1082, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
- 1081, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
- 2265, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
- 2262, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
- 1021, /* GL_MAX_ARRAY_TEXTURE_LAYERS */
- 1159, /* GL_MIN_PROGRAM_TEXEL_OFFSET */
- 1095, /* GL_MAX_PROGRAM_TEXEL_OFFSET */
- 1872, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
+ 2129, /* GL_TEXTURE_STENCIL_SIZE */
+ 2075, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */
+ 1092, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */
+ 1095, /* GL_MAX_PROGRAM_IF_DEPTH_NV */
+ 1099, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */
+ 1098, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */
+ 2282, /* GL_VERTEX_ATTRIB_ARRAY_INTEGER */
+ 2279, /* GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB */
+ 1037, /* GL_MAX_ARRAY_TEXTURE_LAYERS */
+ 1176, /* GL_MIN_PROGRAM_TEXEL_OFFSET */
+ 1112, /* GL_MAX_PROGRAM_TEXEL_OFFSET */
+ 1889, /* GL_STENCIL_TEST_TWO_SIDE_EXT */
18, /* GL_ACTIVE_STENCIL_FACE_EXT */
- 1166, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
- 1729, /* GL_SAMPLES_PASSED */
- 693, /* GL_GEOMETRY_VERTICES_OUT */
- 687, /* GL_GEOMETRY_INPUT_TYPE */
- 689, /* GL_GEOMETRY_OUTPUT_TYPE */
- 1720, /* GL_SAMPLER_BINDING */
+ 1183, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */
+ 1746, /* GL_SAMPLES_PASSED */
+ 709, /* GL_GEOMETRY_VERTICES_OUT */
+ 703, /* GL_GEOMETRY_INPUT_TYPE */
+ 705, /* GL_GEOMETRY_OUTPUT_TYPE */
+ 1737, /* GL_SAMPLER_BINDING */
164, /* GL_CLAMP_VERTEX_COLOR_ARB */
156, /* GL_CLAMP_FRAGMENT_COLOR_ARB */
157, /* GL_CLAMP_READ_COLOR */
- 550, /* GL_FIXED_ONLY */
- 1370, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
- 1369, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
- 1368, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
- 1203, /* GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES */
- 1495, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
- 2092, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
+ 566, /* GL_FIXED_ONLY */
+ 1387, /* GL_POINT_SIZE_ARRAY_TYPE_OES */
+ 1386, /* GL_POINT_SIZE_ARRAY_STRIDE_OES */
+ 1385, /* GL_POINT_SIZE_ARRAY_POINTER_OES */
+ 1220, /* GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES */
+ 1512, /* GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES */
+ 2109, /* GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES */
138, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */
128, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */
- 1571, /* GL_RELEASED_APPLE */
- 2292, /* GL_VOLATILE_APPLE */
- 1611, /* GL_RETAINED_APPLE */
- 2166, /* GL_UNDEFINED_APPLE */
- 1519, /* GL_PURGEABLE_APPLE */
- 601, /* GL_FRAGMENT_SHADER */
- 2287, /* GL_VERTEX_SHADER */
- 1480, /* GL_PROGRAM_OBJECT_ARB */
- 1765, /* GL_SHADER_OBJECT_ARB */
- 1050, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
- 1141, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
- 1132, /* GL_MAX_VARYING_COMPONENTS */
- 1139, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
- 1033, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
- 1266, /* GL_OBJECT_TYPE_ARB */
- 1767, /* GL_SHADER_TYPE */
- 566, /* GL_FLOAT_VEC2 */
- 568, /* GL_FLOAT_VEC3 */
- 570, /* GL_FLOAT_VEC4 */
- 792, /* GL_INT_VEC2 */
- 794, /* GL_INT_VEC3 */
- 796, /* GL_INT_VEC4 */
+ 1588, /* GL_RELEASED_APPLE */
+ 2309, /* GL_VOLATILE_APPLE */
+ 1628, /* GL_RETAINED_APPLE */
+ 2183, /* GL_UNDEFINED_APPLE */
+ 1536, /* GL_PURGEABLE_APPLE */
+ 617, /* GL_FRAGMENT_SHADER */
+ 2304, /* GL_VERTEX_SHADER */
+ 1497, /* GL_PROGRAM_OBJECT_ARB */
+ 1782, /* GL_SHADER_OBJECT_ARB */
+ 1067, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
+ 1158, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */
+ 1149, /* GL_MAX_VARYING_COMPONENTS */
+ 1156, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */
+ 1049, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */
+ 1283, /* GL_OBJECT_TYPE_ARB */
+ 1784, /* GL_SHADER_TYPE */
+ 582, /* GL_FLOAT_VEC2 */
+ 584, /* GL_FLOAT_VEC3 */
+ 586, /* GL_FLOAT_VEC4 */
+ 808, /* GL_INT_VEC2 */
+ 810, /* GL_INT_VEC3 */
+ 812, /* GL_INT_VEC4 */
116, /* GL_BOOL */
118, /* GL_BOOL_VEC2 */
120, /* GL_BOOL_VEC3 */
122, /* GL_BOOL_VEC4 */
- 554, /* GL_FLOAT_MAT2 */
- 558, /* GL_FLOAT_MAT3 */
- 562, /* GL_FLOAT_MAT4 */
- 1704, /* GL_SAMPLER_1D */
- 1710, /* GL_SAMPLER_2D */
- 1718, /* GL_SAMPLER_3D */
- 1723, /* GL_SAMPLER_CUBE */
- 1709, /* GL_SAMPLER_1D_SHADOW */
- 1717, /* GL_SAMPLER_2D_SHADOW */
- 1715, /* GL_SAMPLER_2D_RECT */
- 1716, /* GL_SAMPLER_2D_RECT_SHADOW */
- 556, /* GL_FLOAT_MAT2x3 */
- 557, /* GL_FLOAT_MAT2x4 */
- 560, /* GL_FLOAT_MAT3x2 */
- 561, /* GL_FLOAT_MAT3x4 */
- 564, /* GL_FLOAT_MAT4x2 */
- 565, /* GL_FLOAT_MAT4x3 */
+ 570, /* GL_FLOAT_MAT2 */
+ 574, /* GL_FLOAT_MAT3 */
+ 578, /* GL_FLOAT_MAT4 */
+ 1721, /* GL_SAMPLER_1D */
+ 1727, /* GL_SAMPLER_2D */
+ 1735, /* GL_SAMPLER_3D */
+ 1740, /* GL_SAMPLER_CUBE */
+ 1726, /* GL_SAMPLER_1D_SHADOW */
+ 1734, /* GL_SAMPLER_2D_SHADOW */
+ 1732, /* GL_SAMPLER_2D_RECT */
+ 1733, /* GL_SAMPLER_2D_RECT_SHADOW */
+ 572, /* GL_FLOAT_MAT2x3 */
+ 573, /* GL_FLOAT_MAT2x4 */
+ 576, /* GL_FLOAT_MAT3x2 */
+ 577, /* GL_FLOAT_MAT3x4 */
+ 580, /* GL_FLOAT_MAT4x2 */
+ 581, /* GL_FLOAT_MAT4x3 */
398, /* GL_DELETE_STATUS */
289, /* GL_COMPILE_STATUS */
- 853, /* GL_LINK_STATUS */
- 2232, /* GL_VALIDATE_STATUS */
- 750, /* GL_INFO_LOG_LENGTH */
+ 869, /* GL_LINK_STATUS */
+ 2249, /* GL_VALIDATE_STATUS */
+ 766, /* GL_INFO_LOG_LENGTH */
64, /* GL_ATTACHED_SHADERS */
21, /* GL_ACTIVE_UNIFORMS */
22, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */
- 1766, /* GL_SHADER_SOURCE_LENGTH */
+ 1783, /* GL_SHADER_SOURCE_LENGTH */
15, /* GL_ACTIVE_ATTRIBUTES */
16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */
- 603, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
- 1769, /* GL_SHADING_LANGUAGE_VERSION */
+ 619, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */
+ 1786, /* GL_SHADING_LANGUAGE_VERSION */
375, /* GL_CURRENT_PROGRAM */
- 1315, /* GL_PALETTE4_RGB8_OES */
- 1317, /* GL_PALETTE4_RGBA8_OES */
- 1313, /* GL_PALETTE4_R5_G6_B5_OES */
- 1316, /* GL_PALETTE4_RGBA4_OES */
- 1314, /* GL_PALETTE4_RGB5_A1_OES */
- 1320, /* GL_PALETTE8_RGB8_OES */
- 1322, /* GL_PALETTE8_RGBA8_OES */
- 1318, /* GL_PALETTE8_R5_G6_B5_OES */
- 1321, /* GL_PALETTE8_RGBA4_OES */
- 1319, /* GL_PALETTE8_RGB5_A1_OES */
- 731, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */
- 729, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */
- 1367, /* GL_POINT_SIZE_ARRAY_OES */
- 2036, /* GL_TEXTURE_CROP_RECT_OES */
- 1005, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */
- 1366, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
- 2215, /* GL_UNSIGNED_NORMALIZED */
- 1969, /* GL_TEXTURE_1D_ARRAY */
- 1505, /* GL_PROXY_TEXTURE_1D_ARRAY */
- 1972, /* GL_TEXTURE_2D_ARRAY */
- 1509, /* GL_PROXY_TEXTURE_2D_ARRAY */
- 1980, /* GL_TEXTURE_BINDING_1D_ARRAY */
- 1983, /* GL_TEXTURE_BINDING_2D_ARRAY */
- 1057, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS */
- 2000, /* GL_TEXTURE_BUFFER */
- 1111, /* GL_MAX_TEXTURE_BUFFER_SIZE */
- 1987, /* GL_TEXTURE_BINDING_BUFFER */
- 2002, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
- 2004, /* GL_TEXTURE_BUFFER_FORMAT */
- 1542, /* GL_R11F_G11F_B10F */
- 2181, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
- 1654, /* GL_RGB9_E5 */
- 2190, /* GL_UNSIGNED_INT_5_9_9_9_REV */
- 2110, /* GL_TEXTURE_SHARED_SIZE */
- 1822, /* GL_SRGB */
- 1823, /* GL_SRGB8 */
- 1825, /* GL_SRGB_ALPHA */
- 1824, /* GL_SRGB8_ALPHA8 */
- 1782, /* GL_SLUMINANCE_ALPHA */
- 1781, /* GL_SLUMINANCE8_ALPHA8 */
- 1779, /* GL_SLUMINANCE */
- 1780, /* GL_SLUMINANCE8 */
+ 1332, /* GL_PALETTE4_RGB8_OES */
+ 1334, /* GL_PALETTE4_RGBA8_OES */
+ 1330, /* GL_PALETTE4_R5_G6_B5_OES */
+ 1333, /* GL_PALETTE4_RGBA4_OES */
+ 1331, /* GL_PALETTE4_RGB5_A1_OES */
+ 1337, /* GL_PALETTE8_RGB8_OES */
+ 1339, /* GL_PALETTE8_RGBA8_OES */
+ 1335, /* GL_PALETTE8_R5_G6_B5_OES */
+ 1338, /* GL_PALETTE8_RGBA4_OES */
+ 1336, /* GL_PALETTE8_RGB5_A1_OES */
+ 747, /* GL_IMPLEMENTATION_COLOR_READ_TYPE */
+ 745, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT */
+ 1384, /* GL_POINT_SIZE_ARRAY_OES */
+ 2053, /* GL_TEXTURE_CROP_RECT_OES */
+ 1021, /* GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES */
+ 1383, /* GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES */
+ 2232, /* GL_UNSIGNED_NORMALIZED */
+ 1986, /* GL_TEXTURE_1D_ARRAY */
+ 1522, /* GL_PROXY_TEXTURE_1D_ARRAY */
+ 1989, /* GL_TEXTURE_2D_ARRAY */
+ 1526, /* GL_PROXY_TEXTURE_2D_ARRAY */
+ 1997, /* GL_TEXTURE_BINDING_1D_ARRAY */
+ 2000, /* GL_TEXTURE_BINDING_2D_ARRAY */
+ 1074, /* GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS */
+ 2017, /* GL_TEXTURE_BUFFER */
+ 1128, /* GL_MAX_TEXTURE_BUFFER_SIZE */
+ 2004, /* GL_TEXTURE_BINDING_BUFFER */
+ 2019, /* GL_TEXTURE_BUFFER_DATA_STORE_BINDING */
+ 2021, /* GL_TEXTURE_BUFFER_FORMAT */
+ 1559, /* GL_R11F_G11F_B10F */
+ 2198, /* GL_UNSIGNED_INT_10F_11F_11F_REV */
+ 1671, /* GL_RGB9_E5 */
+ 2207, /* GL_UNSIGNED_INT_5_9_9_9_REV */
+ 2127, /* GL_TEXTURE_SHARED_SIZE */
+ 1839, /* GL_SRGB */
+ 1840, /* GL_SRGB8 */
+ 1842, /* GL_SRGB_ALPHA */
+ 1841, /* GL_SRGB8_ALPHA8 */
+ 1799, /* GL_SLUMINANCE_ALPHA */
+ 1798, /* GL_SLUMINANCE8_ALPHA8 */
+ 1796, /* GL_SLUMINANCE */
+ 1797, /* GL_SLUMINANCE8 */
312, /* GL_COMPRESSED_SRGB */
313, /* GL_COMPRESSED_SRGB_ALPHA */
310, /* GL_COMPRESSED_SLUMINANCE */
311, /* GL_COMPRESSED_SLUMINANCE_ALPHA */
- 2145, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
- 2134, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
- 1130, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS */
- 2143, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
- 2139, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
- 2137, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
- 1449, /* GL_PRIMITIVES_GENERATED */
- 2141, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
- 1546, /* GL_RASTERIZER_DISCARD */
- 1126, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS */
- 1128, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS */
- 769, /* GL_INTERLEAVED_ATTRIBS */
- 1758, /* GL_SEPARATE_ATTRIBS */
- 2129, /* GL_TRANSFORM_FEEDBACK_BUFFER */
- 2131, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
- 1385, /* GL_POINT_SPRITE_COORD_ORIGIN */
- 862, /* GL_LOWER_LEFT */
- 2229, /* GL_UPPER_LEFT */
- 1846, /* GL_STENCIL_BACK_REF */
- 1847, /* GL_STENCIL_BACK_VALUE_MASK */
- 1848, /* GL_STENCIL_BACK_WRITEMASK */
- 504, /* GL_DRAW_FRAMEBUFFER_BINDING */
- 1576, /* GL_RENDERBUFFER_BINDING */
- 1550, /* GL_READ_FRAMEBUFFER */
- 503, /* GL_DRAW_FRAMEBUFFER */
- 1551, /* GL_READ_FRAMEBUFFER_BINDING */
- 1595, /* GL_RENDERBUFFER_SAMPLES */
- 617, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
- 614, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
- 629, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
- 624, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
- 627, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
- 635, /* GL_FRAMEBUFFER_COMPLETE */
- 640, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
- 655, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
- 649, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
- 644, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
- 650, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
- 646, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
- 660, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
- 666, /* GL_FRAMEBUFFER_UNSUPPORTED */
- 664, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
- 1029, /* GL_MAX_COLOR_ATTACHMENTS */
+ 2162, /* GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH */
+ 2151, /* GL_TRANSFORM_FEEDBACK_BUFFER_MODE */
+ 1147, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS */
+ 2160, /* GL_TRANSFORM_FEEDBACK_VARYINGS */
+ 2156, /* GL_TRANSFORM_FEEDBACK_BUFFER_START */
+ 2154, /* GL_TRANSFORM_FEEDBACK_BUFFER_SIZE */
+ 1466, /* GL_PRIMITIVES_GENERATED */
+ 2158, /* GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN */
+ 1563, /* GL_RASTERIZER_DISCARD */
+ 1143, /* GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS */
+ 1145, /* GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS */
+ 785, /* GL_INTERLEAVED_ATTRIBS */
+ 1775, /* GL_SEPARATE_ATTRIBS */
+ 2146, /* GL_TRANSFORM_FEEDBACK_BUFFER */
+ 2148, /* GL_TRANSFORM_FEEDBACK_BUFFER_BINDING */
+ 1402, /* GL_POINT_SPRITE_COORD_ORIGIN */
+ 878, /* GL_LOWER_LEFT */
+ 2246, /* GL_UPPER_LEFT */
+ 1863, /* GL_STENCIL_BACK_REF */
+ 1864, /* GL_STENCIL_BACK_VALUE_MASK */
+ 1865, /* GL_STENCIL_BACK_WRITEMASK */
+ 520, /* GL_DRAW_FRAMEBUFFER_BINDING */
+ 1593, /* GL_RENDERBUFFER_BINDING */
+ 1567, /* GL_READ_FRAMEBUFFER */
+ 519, /* GL_DRAW_FRAMEBUFFER */
+ 1568, /* GL_READ_FRAMEBUFFER_BINDING */
+ 1612, /* GL_RENDERBUFFER_SAMPLES */
+ 633, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+ 630, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+ 645, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+ 640, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+ 643, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+ 651, /* GL_FRAMEBUFFER_COMPLETE */
+ 656, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+ 671, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+ 665, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */
+ 660, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */
+ 666, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */
+ 662, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
+ 676, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
+ 682, /* GL_FRAMEBUFFER_UNSUPPORTED */
+ 680, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */
+ 1045, /* GL_MAX_COLOR_ATTACHMENTS */
196, /* GL_COLOR_ATTACHMENT0 */
199, /* GL_COLOR_ATTACHMENT1 */
213, /* GL_COLOR_ATTACHMENT2 */
@@ -6066,184 +6100,184 @@ static const unsigned reduced_enums[1564] =
208, /* GL_COLOR_ATTACHMENT14 */
210, /* GL_COLOR_ATTACHMENT15 */
403, /* GL_DEPTH_ATTACHMENT */
- 1835, /* GL_STENCIL_ATTACHMENT */
- 605, /* GL_FRAMEBUFFER */
- 1573, /* GL_RENDERBUFFER */
- 1599, /* GL_RENDERBUFFER_WIDTH */
- 1586, /* GL_RENDERBUFFER_HEIGHT */
- 1589, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
- 1867, /* GL_STENCIL_INDEX_EXT */
- 1856, /* GL_STENCIL_INDEX1 */
- 1861, /* GL_STENCIL_INDEX4 */
- 1864, /* GL_STENCIL_INDEX8 */
- 1857, /* GL_STENCIL_INDEX16 */
- 1593, /* GL_RENDERBUFFER_RED_SIZE */
- 1584, /* GL_RENDERBUFFER_GREEN_SIZE */
- 1579, /* GL_RENDERBUFFER_BLUE_SIZE */
- 1574, /* GL_RENDERBUFFER_ALPHA_SIZE */
- 1581, /* GL_RENDERBUFFER_DEPTH_SIZE */
- 1597, /* GL_RENDERBUFFER_STENCIL_SIZE */
- 658, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
- 1106, /* GL_MAX_SAMPLES */
- 2072, /* GL_TEXTURE_GEN_STR_OES */
- 705, /* GL_HALF_FLOAT_OES */
- 1640, /* GL_RGB565 */
- 1671, /* GL_RGBA32UI */
- 1634, /* GL_RGB32UI */
+ 1852, /* GL_STENCIL_ATTACHMENT */
+ 621, /* GL_FRAMEBUFFER */
+ 1590, /* GL_RENDERBUFFER */
+ 1616, /* GL_RENDERBUFFER_WIDTH */
+ 1603, /* GL_RENDERBUFFER_HEIGHT */
+ 1606, /* GL_RENDERBUFFER_INTERNAL_FORMAT */
+ 1884, /* GL_STENCIL_INDEX_EXT */
+ 1873, /* GL_STENCIL_INDEX1 */
+ 1878, /* GL_STENCIL_INDEX4 */
+ 1881, /* GL_STENCIL_INDEX8 */
+ 1874, /* GL_STENCIL_INDEX16 */
+ 1610, /* GL_RENDERBUFFER_RED_SIZE */
+ 1601, /* GL_RENDERBUFFER_GREEN_SIZE */
+ 1596, /* GL_RENDERBUFFER_BLUE_SIZE */
+ 1591, /* GL_RENDERBUFFER_ALPHA_SIZE */
+ 1598, /* GL_RENDERBUFFER_DEPTH_SIZE */
+ 1614, /* GL_RENDERBUFFER_STENCIL_SIZE */
+ 674, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+ 1123, /* GL_MAX_SAMPLES */
+ 2089, /* GL_TEXTURE_GEN_STR_OES */
+ 721, /* GL_HALF_FLOAT_OES */
+ 1657, /* GL_RGB565 */
+ 1688, /* GL_RGBA32UI */
+ 1651, /* GL_RGB32UI */
40, /* GL_ALPHA32UI_EXT */
- 761, /* GL_INTENSITY32UI_EXT */
- 879, /* GL_LUMINANCE32UI_EXT */
- 896, /* GL_LUMINANCE_ALPHA32UI_EXT */
- 1662, /* GL_RGBA16UI */
- 1626, /* GL_RGB16UI */
+ 777, /* GL_INTENSITY32UI_EXT */
+ 895, /* GL_LUMINANCE32UI_EXT */
+ 912, /* GL_LUMINANCE_ALPHA32UI_EXT */
+ 1679, /* GL_RGBA16UI */
+ 1643, /* GL_RGB16UI */
37, /* GL_ALPHA16UI_EXT */
- 758, /* GL_INTENSITY16UI_EXT */
- 874, /* GL_LUMINANCE16UI_EXT */
- 894, /* GL_LUMINANCE_ALPHA16UI_EXT */
- 1681, /* GL_RGBA8UI */
- 1649, /* GL_RGB8UI */
+ 774, /* GL_INTENSITY16UI_EXT */
+ 890, /* GL_LUMINANCE16UI_EXT */
+ 910, /* GL_LUMINANCE_ALPHA16UI_EXT */
+ 1698, /* GL_RGBA8UI */
+ 1666, /* GL_RGB8UI */
45, /* GL_ALPHA8UI_EXT */
- 766, /* GL_INTENSITY8UI_EXT */
- 888, /* GL_LUMINANCE8UI_EXT */
- 898, /* GL_LUMINANCE_ALPHA8UI_EXT */
- 1669, /* GL_RGBA32I */
- 1632, /* GL_RGB32I */
+ 782, /* GL_INTENSITY8UI_EXT */
+ 904, /* GL_LUMINANCE8UI_EXT */
+ 914, /* GL_LUMINANCE_ALPHA8UI_EXT */
+ 1686, /* GL_RGBA32I */
+ 1649, /* GL_RGB32I */
39, /* GL_ALPHA32I_EXT */
- 760, /* GL_INTENSITY32I_EXT */
- 878, /* GL_LUMINANCE32I_EXT */
- 895, /* GL_LUMINANCE_ALPHA32I_EXT */
- 1660, /* GL_RGBA16I */
- 1624, /* GL_RGB16I */
+ 776, /* GL_INTENSITY32I_EXT */
+ 894, /* GL_LUMINANCE32I_EXT */
+ 911, /* GL_LUMINANCE_ALPHA32I_EXT */
+ 1677, /* GL_RGBA16I */
+ 1641, /* GL_RGB16I */
36, /* GL_ALPHA16I_EXT */
- 757, /* GL_INTENSITY16I_EXT */
- 873, /* GL_LUMINANCE16I_EXT */
- 893, /* GL_LUMINANCE_ALPHA16I_EXT */
- 1679, /* GL_RGBA8I */
- 1647, /* GL_RGB8I */
+ 773, /* GL_INTENSITY16I_EXT */
+ 889, /* GL_LUMINANCE16I_EXT */
+ 909, /* GL_LUMINANCE_ALPHA16I_EXT */
+ 1696, /* GL_RGBA8I */
+ 1664, /* GL_RGB8I */
44, /* GL_ALPHA8I_EXT */
- 765, /* GL_INTENSITY8I_EXT */
- 887, /* GL_LUMINANCE8I_EXT */
- 897, /* GL_LUMINANCE_ALPHA8I_EXT */
- 1563, /* GL_RED_INTEGER */
- 700, /* GL_GREEN_INTEGER */
+ 781, /* GL_INTENSITY8I_EXT */
+ 903, /* GL_LUMINANCE8I_EXT */
+ 913, /* GL_LUMINANCE_ALPHA8I_EXT */
+ 1580, /* GL_RED_INTEGER */
+ 716, /* GL_GREEN_INTEGER */
113, /* GL_BLUE_INTEGER */
49, /* GL_ALPHA_INTEGER_EXT */
- 1694, /* GL_RGB_INTEGER */
- 1688, /* GL_RGBA_INTEGER */
+ 1711, /* GL_RGB_INTEGER */
+ 1705, /* GL_RGBA_INTEGER */
84, /* GL_BGR_INTEGER */
82, /* GL_BGRA_INTEGER */
- 900, /* GL_LUMINANCE_INTEGER_EXT */
- 899, /* GL_LUMINANCE_ALPHA_INTEGER_EXT */
- 1690, /* GL_RGBA_INTEGER_MODE_EXT */
- 775, /* GL_INT_2_10_10_10_REV */
- 612, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED */
- 653, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS */
- 652, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB */
- 1705, /* GL_SAMPLER_1D_ARRAY */
- 1711, /* GL_SAMPLER_2D_ARRAY */
- 1721, /* GL_SAMPLER_BUFFER */
- 1707, /* GL_SAMPLER_1D_ARRAY_SHADOW */
- 1713, /* GL_SAMPLER_2D_ARRAY_SHADOW */
- 1724, /* GL_SAMPLER_CUBE_SHADOW */
- 2209, /* GL_UNSIGNED_INT_VEC2 */
- 2211, /* GL_UNSIGNED_INT_VEC3 */
- 2213, /* GL_UNSIGNED_INT_VEC4 */
- 776, /* GL_INT_SAMPLER_1D */
- 780, /* GL_INT_SAMPLER_2D */
- 786, /* GL_INT_SAMPLER_3D */
- 790, /* GL_INT_SAMPLER_CUBE */
- 784, /* GL_INT_SAMPLER_2D_RECT */
- 777, /* GL_INT_SAMPLER_1D_ARRAY */
- 781, /* GL_INT_SAMPLER_2D_ARRAY */
- 788, /* GL_INT_SAMPLER_BUFFER */
- 2193, /* GL_UNSIGNED_INT_SAMPLER_1D */
- 2197, /* GL_UNSIGNED_INT_SAMPLER_2D */
- 2203, /* GL_UNSIGNED_INT_SAMPLER_3D */
- 2207, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
- 2201, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
- 2194, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
- 2198, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
- 2205, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
- 691, /* GL_GEOMETRY_SHADER */
- 694, /* GL_GEOMETRY_VERTICES_OUT_ARB */
- 688, /* GL_GEOMETRY_INPUT_TYPE_ARB */
- 690, /* GL_GEOMETRY_OUTPUT_TYPE_ARB */
- 1063, /* GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB */
- 1146, /* GL_MAX_VERTEX_VARYING_COMPONENTS_ARB */
- 1061, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS */
- 1055, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES */
- 1059, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS */
- 863, /* GL_LOW_FLOAT */
- 1148, /* GL_MEDIUM_FLOAT */
- 706, /* GL_HIGH_FLOAT */
- 864, /* GL_LOW_INT */
- 1149, /* GL_MEDIUM_INT */
- 707, /* GL_HIGH_INT */
- 2183, /* GL_UNSIGNED_INT_10_10_10_2_OES */
- 774, /* GL_INT_10_10_10_2_OES */
- 1763, /* GL_SHADER_BINARY_FORMATS */
- 1251, /* GL_NUM_SHADER_BINARY_FORMATS */
- 1764, /* GL_SHADER_COMPILER */
- 1143, /* GL_MAX_VERTEX_UNIFORM_VECTORS */
- 1135, /* GL_MAX_VARYING_VECTORS */
- 1052, /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */
- 1539, /* GL_QUERY_WAIT */
- 1533, /* GL_QUERY_NO_WAIT */
- 1529, /* GL_QUERY_BY_REGION_WAIT */
- 1527, /* GL_QUERY_BY_REGION_NO_WAIT */
- 2127, /* GL_TRANSFORM_FEEDBACK */
- 2136, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
- 2130, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
- 2128, /* GL_TRANSFORM_FEEDBACK_BINDING */
- 1523, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
- 546, /* GL_FIRST_VERTEX_CONVENTION */
- 808, /* GL_LAST_VERTEX_CONVENTION */
- 1497, /* GL_PROVOKING_VERTEX */
+ 916, /* GL_LUMINANCE_INTEGER_EXT */
+ 915, /* GL_LUMINANCE_ALPHA_INTEGER_EXT */
+ 1707, /* GL_RGBA_INTEGER_MODE_EXT */
+ 791, /* GL_INT_2_10_10_10_REV */
+ 628, /* GL_FRAMEBUFFER_ATTACHMENT_LAYERED */
+ 669, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS */
+ 668, /* GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB */
+ 1722, /* GL_SAMPLER_1D_ARRAY */
+ 1728, /* GL_SAMPLER_2D_ARRAY */
+ 1738, /* GL_SAMPLER_BUFFER */
+ 1724, /* GL_SAMPLER_1D_ARRAY_SHADOW */
+ 1730, /* GL_SAMPLER_2D_ARRAY_SHADOW */
+ 1741, /* GL_SAMPLER_CUBE_SHADOW */
+ 2226, /* GL_UNSIGNED_INT_VEC2 */
+ 2228, /* GL_UNSIGNED_INT_VEC3 */
+ 2230, /* GL_UNSIGNED_INT_VEC4 */
+ 792, /* GL_INT_SAMPLER_1D */
+ 796, /* GL_INT_SAMPLER_2D */
+ 802, /* GL_INT_SAMPLER_3D */
+ 806, /* GL_INT_SAMPLER_CUBE */
+ 800, /* GL_INT_SAMPLER_2D_RECT */
+ 793, /* GL_INT_SAMPLER_1D_ARRAY */
+ 797, /* GL_INT_SAMPLER_2D_ARRAY */
+ 804, /* GL_INT_SAMPLER_BUFFER */
+ 2210, /* GL_UNSIGNED_INT_SAMPLER_1D */
+ 2214, /* GL_UNSIGNED_INT_SAMPLER_2D */
+ 2220, /* GL_UNSIGNED_INT_SAMPLER_3D */
+ 2224, /* GL_UNSIGNED_INT_SAMPLER_CUBE */
+ 2218, /* GL_UNSIGNED_INT_SAMPLER_2D_RECT */
+ 2211, /* GL_UNSIGNED_INT_SAMPLER_1D_ARRAY */
+ 2215, /* GL_UNSIGNED_INT_SAMPLER_2D_ARRAY */
+ 2222, /* GL_UNSIGNED_INT_SAMPLER_BUFFER */
+ 707, /* GL_GEOMETRY_SHADER */
+ 710, /* GL_GEOMETRY_VERTICES_OUT_ARB */
+ 704, /* GL_GEOMETRY_INPUT_TYPE_ARB */
+ 706, /* GL_GEOMETRY_OUTPUT_TYPE_ARB */
+ 1080, /* GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB */
+ 1163, /* GL_MAX_VERTEX_VARYING_COMPONENTS_ARB */
+ 1078, /* GL_MAX_GEOMETRY_UNIFORM_COMPONENTS */
+ 1072, /* GL_MAX_GEOMETRY_OUTPUT_VERTICES */
+ 1076, /* GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS */
+ 879, /* GL_LOW_FLOAT */
+ 1165, /* GL_MEDIUM_FLOAT */
+ 722, /* GL_HIGH_FLOAT */
+ 880, /* GL_LOW_INT */
+ 1166, /* GL_MEDIUM_INT */
+ 723, /* GL_HIGH_INT */
+ 2200, /* GL_UNSIGNED_INT_10_10_10_2_OES */
+ 790, /* GL_INT_10_10_10_2_OES */
+ 1780, /* GL_SHADER_BINARY_FORMATS */
+ 1268, /* GL_NUM_SHADER_BINARY_FORMATS */
+ 1781, /* GL_SHADER_COMPILER */
+ 1160, /* GL_MAX_VERTEX_UNIFORM_VECTORS */
+ 1152, /* GL_MAX_VARYING_VECTORS */
+ 1069, /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */
+ 1556, /* GL_QUERY_WAIT */
+ 1550, /* GL_QUERY_NO_WAIT */
+ 1546, /* GL_QUERY_BY_REGION_WAIT */
+ 1544, /* GL_QUERY_BY_REGION_NO_WAIT */
+ 2144, /* GL_TRANSFORM_FEEDBACK */
+ 2153, /* GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */
+ 2147, /* GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */
+ 2145, /* GL_TRANSFORM_FEEDBACK_BINDING */
+ 1540, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */
+ 562, /* GL_FIRST_VERTEX_CONVENTION */
+ 824, /* GL_LAST_VERTEX_CONVENTION */
+ 1514, /* GL_PROVOKING_VERTEX */
354, /* GL_COPY_READ_BUFFER */
355, /* GL_COPY_WRITE_BUFFER */
- 1566, /* GL_RED_SNORM */
- 1701, /* GL_RG_SNORM */
- 1700, /* GL_RGB_SNORM */
- 1693, /* GL_RGBA_SNORM */
- 1545, /* GL_R8_SNORM */
- 1614, /* GL_RG8_SNORM */
- 1653, /* GL_RGB8_SNORM */
- 1685, /* GL_RGBA8_SNORM */
- 1543, /* GL_R16_SNORM */
- 1613, /* GL_RG16_SNORM */
- 1629, /* GL_RGB16_SNORM */
- 1665, /* GL_RGBA16_SNORM */
- 1775, /* GL_SIGNED_NORMALIZED */
- 1451, /* GL_PRIMITIVE_RESTART */
- 1452, /* GL_PRIMITIVE_RESTART_INDEX */
- 1108, /* GL_MAX_SERVER_WAIT_TIMEOUT */
- 1265, /* GL_OBJECT_TYPE */
- 1888, /* GL_SYNC_CONDITION */
- 1893, /* GL_SYNC_STATUS */
- 1890, /* GL_SYNC_FLAGS */
- 1889, /* GL_SYNC_FENCE */
- 1892, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
- 2176, /* GL_UNSIGNALED */
- 1774, /* GL_SIGNALED */
+ 1583, /* GL_RED_SNORM */
+ 1718, /* GL_RG_SNORM */
+ 1717, /* GL_RGB_SNORM */
+ 1710, /* GL_RGBA_SNORM */
+ 1562, /* GL_R8_SNORM */
+ 1631, /* GL_RG8_SNORM */
+ 1670, /* GL_RGB8_SNORM */
+ 1702, /* GL_RGBA8_SNORM */
+ 1560, /* GL_R16_SNORM */
+ 1630, /* GL_RG16_SNORM */
+ 1646, /* GL_RGB16_SNORM */
+ 1682, /* GL_RGBA16_SNORM */
+ 1792, /* GL_SIGNED_NORMALIZED */
+ 1468, /* GL_PRIMITIVE_RESTART */
+ 1469, /* GL_PRIMITIVE_RESTART_INDEX */
+ 1125, /* GL_MAX_SERVER_WAIT_TIMEOUT */
+ 1282, /* GL_OBJECT_TYPE */
+ 1905, /* GL_SYNC_CONDITION */
+ 1910, /* GL_SYNC_STATUS */
+ 1907, /* GL_SYNC_FLAGS */
+ 1906, /* GL_SYNC_FENCE */
+ 1909, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
+ 2193, /* GL_UNSIGNALED */
+ 1791, /* GL_SIGNALED */
54, /* GL_ALREADY_SIGNALED */
- 2122, /* GL_TIMEOUT_EXPIRED */
+ 2139, /* GL_TIMEOUT_EXPIRED */
315, /* GL_CONDITION_SATISFIED */
- 2293, /* GL_WAIT_FAILED */
+ 2310, /* GL_WAIT_FAILED */
126, /* GL_BUFFER_ACCESS_FLAGS */
132, /* GL_BUFFER_MAP_LENGTH */
133, /* GL_BUFFER_MAP_OFFSET */
- 1138, /* GL_MAX_VERTEX_OUTPUT_COMPONENTS */
- 1053, /* GL_MAX_GEOMETRY_INPUT_COMPONENTS */
- 1054, /* GL_MAX_GEOMETRY_OUTPUT_COMPONENTS */
- 1049, /* GL_MAX_FRAGMENT_INPUT_COMPONENTS */
+ 1155, /* GL_MAX_VERTEX_OUTPUT_COMPONENTS */
+ 1070, /* GL_MAX_GEOMETRY_INPUT_COMPONENTS */
+ 1071, /* GL_MAX_GEOMETRY_OUTPUT_COMPONENTS */
+ 1066, /* GL_MAX_FRAGMENT_INPUT_COMPONENTS */
330, /* GL_CONTEXT_PROFILE_MASK */
- 531, /* GL_EVAL_BIT */
- 1548, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
- 855, /* GL_LIST_BIT */
- 1995, /* GL_TEXTURE_BIT */
- 1744, /* GL_SCISSOR_BIT */
+ 547, /* GL_EVAL_BIT */
+ 1565, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
+ 871, /* GL_LIST_BIT */
+ 2012, /* GL_TEXTURE_BIT */
+ 1761, /* GL_SCISSOR_BIT */
30, /* GL_ALL_ATTRIB_BITS */
- 1214, /* GL_MULTISAMPLE_BIT */
+ 1231, /* GL_MULTISAMPLE_BIT */
31, /* GL_ALL_CLIENT_ATTRIB_BITS */
};
diff --git a/mesalib/src/mesa/main/eval.h b/mesalib/src/mesa/main/eval.h
index c6a37c135..5a4203138 100644
--- a/mesalib/src/mesa/main/eval.h
+++ b/mesalib/src/mesa/main/eval.h
@@ -1,111 +1,111 @@
-/**
- * \file eval.h
- * Eval operations.
- *
- * \if subset
- * (No-op)
- *
- * \endif
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 3.5
- *
- * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef EVAL_H
-#define EVAL_H
-
-
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-
-
-#if FEATURE_evaluators
-
-#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \
- do { \
- (vfmt)->EvalCoord1f = impl ## EvalCoord1f; \
- (vfmt)->EvalCoord1fv = impl ## EvalCoord1fv; \
- (vfmt)->EvalCoord2f = impl ## EvalCoord2f; \
- (vfmt)->EvalCoord2fv = impl ## EvalCoord2fv; \
- (vfmt)->EvalPoint1 = impl ## EvalPoint1; \
- (vfmt)->EvalPoint2 = impl ## EvalPoint2; \
- (vfmt)->EvalMesh1 = impl ## EvalMesh1; \
- (vfmt)->EvalMesh2 = impl ## EvalMesh2; \
- } while (0)
-
-extern GLuint _mesa_evaluator_components( GLenum target );
-
-
-extern void gl_free_control_points( struct gl_context *ctx,
- GLenum target, GLfloat *data );
-
-
-extern GLfloat *_mesa_copy_map_points1f( GLenum target,
- GLint ustride, GLint uorder,
- const GLfloat *points );
-
-extern GLfloat *_mesa_copy_map_points1d( GLenum target,
- GLint ustride, GLint uorder,
- const GLdouble *points );
-
-extern GLfloat *_mesa_copy_map_points2f( GLenum target,
- GLint ustride, GLint uorder,
- GLint vstride, GLint vorder,
- const GLfloat *points );
-
-extern GLfloat *_mesa_copy_map_points2d(GLenum target,
- GLint ustride, GLint uorder,
- GLint vstride, GLint vorder,
- const GLdouble *points );
-
-extern void
-_mesa_install_eval_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt);
-
-extern void
-_mesa_init_eval_dispatch(struct _glapi_table *disp);
-
-#else /* FEATURE_evaluators */
-
-#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0)
-
-static INLINE void
-_mesa_install_eval_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt)
-{
-}
-
-static INLINE void
-_mesa_init_eval_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_evaluators */
-
-extern void _mesa_init_eval( struct gl_context *ctx );
-extern void _mesa_free_eval_data( struct gl_context *ctx );
-
-
-#endif /* EVAL_H */
+/**
+ * \file eval.h
+ * Eval operations.
+ *
+ * \if subset
+ * (No-op)
+ *
+ * \endif
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef EVAL_H
+#define EVAL_H
+
+
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+
+
+#if FEATURE_evaluators
+
+#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \
+ do { \
+ (vfmt)->EvalCoord1f = impl ## EvalCoord1f; \
+ (vfmt)->EvalCoord1fv = impl ## EvalCoord1fv; \
+ (vfmt)->EvalCoord2f = impl ## EvalCoord2f; \
+ (vfmt)->EvalCoord2fv = impl ## EvalCoord2fv; \
+ (vfmt)->EvalPoint1 = impl ## EvalPoint1; \
+ (vfmt)->EvalPoint2 = impl ## EvalPoint2; \
+ (vfmt)->EvalMesh1 = impl ## EvalMesh1; \
+ (vfmt)->EvalMesh2 = impl ## EvalMesh2; \
+ } while (0)
+
+extern GLuint _mesa_evaluator_components( GLenum target );
+
+
+extern void gl_free_control_points( struct gl_context *ctx,
+ GLenum target, GLfloat *data );
+
+
+extern GLfloat *_mesa_copy_map_points1f( GLenum target,
+ GLint ustride, GLint uorder,
+ const GLfloat *points );
+
+extern GLfloat *_mesa_copy_map_points1d( GLenum target,
+ GLint ustride, GLint uorder,
+ const GLdouble *points );
+
+extern GLfloat *_mesa_copy_map_points2f( GLenum target,
+ GLint ustride, GLint uorder,
+ GLint vstride, GLint vorder,
+ const GLfloat *points );
+
+extern GLfloat *_mesa_copy_map_points2d(GLenum target,
+ GLint ustride, GLint uorder,
+ GLint vstride, GLint vorder,
+ const GLdouble *points );
+
+extern void
+_mesa_install_eval_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt);
+
+extern void
+_mesa_init_eval_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_evaluators */
+
+#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0)
+
+static inline void
+_mesa_install_eval_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt)
+{
+}
+
+static inline void
+_mesa_init_eval_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_evaluators */
+
+extern void _mesa_init_eval( struct gl_context *ctx );
+extern void _mesa_free_eval_data( struct gl_context *ctx );
+
+
+#endif /* EVAL_H */
diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c
index af1a3ff85..52b928e41 100644
--- a/mesalib/src/mesa/main/extensions.c
+++ b/mesalib/src/mesa/main/extensions.c
@@ -85,7 +85,7 @@ static const struct extension extension_table[] = {
{ "GL_ARB_depth_buffer_float", o(ARB_depth_buffer_float), GL, 2008 },
{ "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 },
{ "GL_ARB_depth_texture", o(ARB_depth_texture), GL, 2001 },
- { "GL_ARB_draw_buffers", o(ARB_draw_buffers), GL, 2002 },
+ { "GL_ARB_draw_buffers", o(dummy_true), GL, 2002 },
{ "GL_ARB_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 },
{ "GL_ARB_draw_elements_base_vertex", o(ARB_draw_elements_base_vertex), GL, 2009 },
{ "GL_ARB_draw_instanced", o(ARB_draw_instanced), GL, 2008 },
@@ -263,7 +263,7 @@ static const struct extension extension_table[] = {
{ "GL_APPLE_packed_pixels", o(APPLE_packed_pixels), GL, 2002 },
{ "GL_APPLE_vertex_array_object", o(APPLE_vertex_array_object), GL, 2002 },
{ "GL_ATI_blend_equation_separate", o(EXT_blend_equation_separate), GL, 2003 },
- { "GL_ATI_draw_buffers", o(ARB_draw_buffers), GL, 2002 },
+ { "GL_ATI_draw_buffers", o(dummy_true), GL, 2002 },
{ "GL_ATI_envmap_bumpmap", o(ATI_envmap_bumpmap), GL, 2001 },
{ "GL_ATI_fragment_shader", o(ATI_fragment_shader), GL, 2001 },
{ "GL_ATI_separate_stencil", o(ATI_separate_stencil), GL, 2006 },
@@ -284,6 +284,8 @@ static const struct extension extension_table[] = {
{ "GL_NV_blend_square", o(NV_blend_square), GL, 1999 },
{ "GL_NV_conditional_render", o(NV_conditional_render), GL, 2008 },
{ "GL_NV_depth_clamp", o(ARB_depth_clamp), GL, 2001 },
+ { "GL_NV_draw_buffers", o(dummy_true), ES2, 2011 },
+ { "GL_NV_fbo_color_attachments", o(EXT_framebuffer_object), ES2, 2010 },
{ "GL_NV_fragment_program", o(NV_fragment_program), GL, 2001 },
{ "GL_NV_fragment_program_option", o(NV_fragment_program_option), GL, 2005 },
{ "GL_NV_light_max_exponent", o(NV_light_max_exponent), GL, 1999 },
@@ -341,7 +343,6 @@ name_to_offset(const char* name)
*/
static const size_t default_extensions[] = {
o(ARB_copy_buffer),
- o(ARB_draw_buffers),
o(ARB_transpose_matrix),
o(ARB_window_pos),
@@ -376,7 +377,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
/*ctx->Extensions.ARB_copy_buffer = GL_TRUE;*/
ctx->Extensions.ARB_depth_clamp = GL_TRUE;
ctx->Extensions.ARB_depth_texture = GL_TRUE;
- /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/
ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
ctx->Extensions.ARB_draw_instanced = GL_TRUE;
ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
@@ -575,7 +575,6 @@ _mesa_enable_1_5_extensions(struct gl_context *ctx)
void
_mesa_enable_2_0_extensions(struct gl_context *ctx)
{
- /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/
#if FEATURE_ARB_fragment_shader
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
#endif
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index fd371aba8..757115584 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -78,7 +78,7 @@ static struct gl_renderbuffer DummyRenderbuffer;
static struct gl_framebuffer IncompleteFramebuffer;
-static INLINE GLboolean
+static inline GLboolean
is_cube_face(GLenum target)
{
return (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X &&
@@ -89,7 +89,7 @@ is_cube_face(GLenum target)
/**
* Is the given FBO a user-created FBO?
*/
-static INLINE GLboolean
+static inline GLboolean
is_user_fbo(const struct gl_framebuffer *fb)
{
return fb->Name != 0;
@@ -99,7 +99,7 @@ is_user_fbo(const struct gl_framebuffer *fb)
/**
* Is the given FBO a window system FBO (like an X window)?
*/
-static INLINE GLboolean
+static inline GLboolean
is_winsys_fbo(const struct gl_framebuffer *fb)
{
return fb->Name == 0;
@@ -194,9 +194,11 @@ get_framebuffer_target(struct gl_context *ctx, GLenum target)
{
switch (target) {
case GL_DRAW_FRAMEBUFFER:
- return ctx->Extensions.EXT_framebuffer_blit ? ctx->DrawBuffer : NULL;
+ return ctx->Extensions.EXT_framebuffer_blit && ctx->API == API_OPENGL
+ ? ctx->DrawBuffer : NULL;
case GL_READ_FRAMEBUFFER:
- return ctx->Extensions.EXT_framebuffer_blit ? ctx->ReadBuffer : NULL;
+ return ctx->Extensions.EXT_framebuffer_blit && ctx->API == API_OPENGL
+ ? ctx->ReadBuffer : NULL;
case GL_FRAMEBUFFER_EXT:
return ctx->DrawBuffer;
default:
@@ -238,18 +240,27 @@ _mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
case GL_COLOR_ATTACHMENT13_EXT:
case GL_COLOR_ATTACHMENT14_EXT:
case GL_COLOR_ATTACHMENT15_EXT:
+ /* Only OpenGL ES 1.x forbids color attachments other than
+ * GL_COLOR_ATTACHMENT0. For all other APIs the limit set by the
+ * hardware is used.
+ */
i = attachment - GL_COLOR_ATTACHMENT0_EXT;
- if (i >= ctx->Const.MaxColorAttachments) {
+ if (i >= ctx->Const.MaxColorAttachments
+ || (i > 0 && ctx->API == API_OPENGLES)) {
return NULL;
}
return &fb->Attachment[BUFFER_COLOR0 + i];
case GL_DEPTH_STENCIL_ATTACHMENT:
+ if (ctx->API != API_OPENGL)
+ return NULL;
/* fall-through */
case GL_DEPTH_BUFFER:
/* fall-through / new in GL 3.0 */
case GL_DEPTH_ATTACHMENT_EXT:
return &fb->Attachment[BUFFER_DEPTH];
case GL_STENCIL_BUFFER:
+ if (ctx->API != API_OPENGL)
+ return NULL;
/* fall-through / new in GL 3.0 */
case GL_STENCIL_ATTACHMENT_EXT:
return &fb->Attachment[BUFFER_STENCIL];
@@ -1220,7 +1231,67 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
return ctx->Extensions.EXT_texture_shared_exponent ? GL_RGB : 0;
case GL_R11F_G11F_B10F:
return ctx->Extensions.EXT_packed_float ? GL_RGB : 0;
- /* XXX add integer formats eventually */
+
+ case GL_RGBA8UI_EXT:
+ case GL_RGBA16UI_EXT:
+ case GL_RGBA32UI_EXT:
+ case GL_RGBA8I_EXT:
+ case GL_RGBA16I_EXT:
+ case GL_RGBA32I_EXT:
+ return ctx->Extensions.EXT_texture_integer ? GL_RGBA : 0;
+
+ case GL_RGB8UI_EXT:
+ case GL_RGB16UI_EXT:
+ case GL_RGB32UI_EXT:
+ case GL_RGB8I_EXT:
+ case GL_RGB16I_EXT:
+ case GL_RGB32I_EXT:
+ return ctx->Extensions.EXT_texture_integer ? GL_RGB : 0;
+
+ case GL_R8UI:
+ case GL_R8I:
+ case GL_R16UI:
+ case GL_R16I:
+ case GL_R32UI:
+ case GL_R32I:
+ return ctx->Extensions.ARB_texture_rg &&
+ ctx->Extensions.EXT_texture_integer ? GL_RED : 0;
+
+ case GL_RG8UI:
+ case GL_RG8I:
+ case GL_RG16UI:
+ case GL_RG16I:
+ case GL_RG32UI:
+ case GL_RG32I:
+ return ctx->Extensions.ARB_texture_rg &&
+ ctx->Extensions.EXT_texture_integer ? GL_RG : 0;
+
+ case GL_INTENSITY8I_EXT:
+ case GL_INTENSITY8UI_EXT:
+ case GL_INTENSITY16I_EXT:
+ case GL_INTENSITY16UI_EXT:
+ case GL_INTENSITY32I_EXT:
+ case GL_INTENSITY32UI_EXT:
+ return ctx->Extensions.EXT_texture_integer &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
+
+ case GL_LUMINANCE8I_EXT:
+ case GL_LUMINANCE8UI_EXT:
+ case GL_LUMINANCE16I_EXT:
+ case GL_LUMINANCE16UI_EXT:
+ case GL_LUMINANCE32I_EXT:
+ case GL_LUMINANCE32UI_EXT:
+ return ctx->Extensions.EXT_texture_integer &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
+
+ case GL_LUMINANCE_ALPHA8I_EXT:
+ case GL_LUMINANCE_ALPHA8UI_EXT:
+ case GL_LUMINANCE_ALPHA16I_EXT:
+ case GL_LUMINANCE_ALPHA16UI_EXT:
+ case GL_LUMINANCE_ALPHA32I_EXT:
+ case GL_LUMINANCE_ALPHA32UI_EXT:
+ return ctx->Extensions.EXT_texture_integer &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
default:
return 0;
}
diff --git a/mesalib/src/mesa/main/fbobject.h b/mesalib/src/mesa/main/fbobject.h
index d9b06b9af..0a70a436d 100644
--- a/mesalib/src/mesa/main/fbobject.h
+++ b/mesalib/src/mesa/main/fbobject.h
@@ -1,195 +1,195 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef FBOBJECT_H
-#define FBOBJECT_H
-
-#include "compiler.h"
-#include "glheader.h"
-
-struct gl_context;
-struct gl_texture_object;
-
-extern void
-_mesa_init_fbobjects(struct gl_context *ctx);
-
-extern struct gl_framebuffer *
-_mesa_get_incomplete_framebuffer(void);
-
-extern struct gl_renderbuffer *
-_mesa_lookup_renderbuffer(struct gl_context *ctx, GLuint id);
-
-extern struct gl_framebuffer *
-_mesa_lookup_framebuffer(struct gl_context *ctx, GLuint id);
-
-extern struct gl_renderbuffer_attachment *
-_mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
- GLenum attachment);
-
-
-/** Return the texture image for a renderbuffer attachment */
-static INLINE struct gl_texture_image *
-_mesa_get_attachment_teximage(struct gl_renderbuffer_attachment *att)
-{
- assert(att->Type == GL_TEXTURE);
- return att->Texture->Image[att->CubeMapFace][att->TextureLevel];
-}
-
-
-/** Return the (const) texture image for a renderbuffer attachment */
-static INLINE const struct gl_texture_image *
-_mesa_get_attachment_teximage_const(const struct gl_renderbuffer_attachment *att)
-{
- assert(att->Type == GL_TEXTURE);
- return att->Texture->Image[att->CubeMapFace][att->TextureLevel];
-}
-
-
-extern void
-_mesa_remove_attachment(struct gl_context *ctx,
- struct gl_renderbuffer_attachment *att);
-
-extern void
-_mesa_set_texture_attachment(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer_attachment *att,
- struct gl_texture_object *texObj,
- GLenum texTarget, GLuint level, GLuint zoffset);
-
-extern void
-_mesa_set_renderbuffer_attachment(struct gl_context *ctx,
- struct gl_renderbuffer_attachment *att,
- struct gl_renderbuffer *rb);
-
-extern void
-_mesa_framebuffer_renderbuffer(struct gl_context *ctx,
- struct gl_framebuffer *fb,
- GLenum attachment, struct gl_renderbuffer *rb);
-
-extern void
-_mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb);
-
-extern void
-_mesa_test_framebuffer_completeness(struct gl_context *ctx,
- struct gl_framebuffer *fb);
-
-extern GLboolean
-_mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat);
-
-extern GLenum
-_mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat);
-
-extern GLboolean GLAPIENTRY
-_mesa_IsRenderbufferEXT(GLuint renderbuffer);
-
-extern void GLAPIENTRY
-_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer);
-
-extern void GLAPIENTRY
-_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers);
-
-extern void GLAPIENTRY
-_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers);
-
-extern void GLAPIENTRY
-_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalformat,
- GLsizei width, GLsizei height);
-
-extern void GLAPIENTRY
-_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
- GLenum internalformat,
- GLsizei width, GLsizei height);
-
-extern void GLAPIENTRY
-_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
- GLsizei width, GLsizei height);
-
-extern void GLAPIENTRY
-_mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
-
-extern void GLAPIENTRY
-_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname,
- GLint *params);
-
-extern GLboolean GLAPIENTRY
-_mesa_IsFramebufferEXT(GLuint framebuffer);
-
-extern void GLAPIENTRY
-_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer);
-
-extern void GLAPIENTRY
-_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers);
-
-extern void GLAPIENTRY
-_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers);
-
-extern GLenum GLAPIENTRY
-_mesa_CheckFramebufferStatusEXT(GLenum target);
-
-extern void GLAPIENTRY
-_mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment,
- GLenum textarget, GLuint texture, GLint level);
-
-extern void GLAPIENTRY
-_mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment,
- GLenum textarget, GLuint texture, GLint level);
-
-extern void GLAPIENTRY
-_mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment,
- GLenum textarget, GLuint texture,
- GLint level, GLint zoffset);
-
-extern void GLAPIENTRY
-_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment,
- GLuint texture, GLint level, GLint layer);
-
-extern void GLAPIENTRY
-_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
- GLenum renderbuffertarget,
- GLuint renderbuffer);
-
-extern void GLAPIENTRY
-_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
- GLenum pname, GLint *params);
-
-extern void GLAPIENTRY
-_mesa_GenerateMipmapEXT(GLenum target);
-
-
-extern void GLAPIENTRY
-_mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter);
-
-extern void GLAPIENTRY
-_mesa_FramebufferTextureARB(GLenum target, GLenum attachment,
- GLuint texture, GLint level);
-
-extern void GLAPIENTRY
-_mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment,
- GLuint texture, GLint level, GLenum face);
-
-
-#endif /* FBOBJECT_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef FBOBJECT_H
+#define FBOBJECT_H
+
+#include "compiler.h"
+#include "glheader.h"
+
+struct gl_context;
+struct gl_texture_object;
+
+extern void
+_mesa_init_fbobjects(struct gl_context *ctx);
+
+extern struct gl_framebuffer *
+_mesa_get_incomplete_framebuffer(void);
+
+extern struct gl_renderbuffer *
+_mesa_lookup_renderbuffer(struct gl_context *ctx, GLuint id);
+
+extern struct gl_framebuffer *
+_mesa_lookup_framebuffer(struct gl_context *ctx, GLuint id);
+
+extern struct gl_renderbuffer_attachment *
+_mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLenum attachment);
+
+
+/** Return the texture image for a renderbuffer attachment */
+static inline struct gl_texture_image *
+_mesa_get_attachment_teximage(struct gl_renderbuffer_attachment *att)
+{
+ assert(att->Type == GL_TEXTURE);
+ return att->Texture->Image[att->CubeMapFace][att->TextureLevel];
+}
+
+
+/** Return the (const) texture image for a renderbuffer attachment */
+static inline const struct gl_texture_image *
+_mesa_get_attachment_teximage_const(const struct gl_renderbuffer_attachment *att)
+{
+ assert(att->Type == GL_TEXTURE);
+ return att->Texture->Image[att->CubeMapFace][att->TextureLevel];
+}
+
+
+extern void
+_mesa_remove_attachment(struct gl_context *ctx,
+ struct gl_renderbuffer_attachment *att);
+
+extern void
+_mesa_set_texture_attachment(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att,
+ struct gl_texture_object *texObj,
+ GLenum texTarget, GLuint level, GLuint zoffset);
+
+extern void
+_mesa_set_renderbuffer_attachment(struct gl_context *ctx,
+ struct gl_renderbuffer_attachment *att,
+ struct gl_renderbuffer *rb);
+
+extern void
+_mesa_framebuffer_renderbuffer(struct gl_context *ctx,
+ struct gl_framebuffer *fb,
+ GLenum attachment, struct gl_renderbuffer *rb);
+
+extern void
+_mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb);
+
+extern void
+_mesa_test_framebuffer_completeness(struct gl_context *ctx,
+ struct gl_framebuffer *fb);
+
+extern GLboolean
+_mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat);
+
+extern GLenum
+_mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsRenderbufferEXT(GLuint renderbuffer);
+
+extern void GLAPIENTRY
+_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer);
+
+extern void GLAPIENTRY
+_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers);
+
+extern void GLAPIENTRY
+_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers);
+
+extern void GLAPIENTRY
+_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalformat,
+ GLsizei width, GLsizei height);
+
+extern void GLAPIENTRY
+_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
+ GLenum internalformat,
+ GLsizei width, GLsizei height);
+
+extern void GLAPIENTRY
+_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
+ GLsizei width, GLsizei height);
+
+extern void GLAPIENTRY
+_mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
+
+extern void GLAPIENTRY
+_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname,
+ GLint *params);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsFramebufferEXT(GLuint framebuffer);
+
+extern void GLAPIENTRY
+_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer);
+
+extern void GLAPIENTRY
+_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers);
+
+extern void GLAPIENTRY
+_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers);
+
+extern GLenum GLAPIENTRY
+_mesa_CheckFramebufferStatusEXT(GLenum target);
+
+extern void GLAPIENTRY
+_mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture, GLint level);
+
+extern void GLAPIENTRY
+_mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture, GLint level);
+
+extern void GLAPIENTRY
+_mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture,
+ GLint level, GLint zoffset);
+
+extern void GLAPIENTRY
+_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment,
+ GLuint texture, GLint level, GLint layer);
+
+extern void GLAPIENTRY
+_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
+ GLenum renderbuffertarget,
+ GLuint renderbuffer);
+
+extern void GLAPIENTRY
+_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
+ GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GenerateMipmapEXT(GLenum target);
+
+
+extern void GLAPIENTRY
+_mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter);
+
+extern void GLAPIENTRY
+_mesa_FramebufferTextureARB(GLenum target, GLenum attachment,
+ GLuint texture, GLint level);
+
+extern void GLAPIENTRY
+_mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment,
+ GLuint texture, GLint level, GLenum face);
+
+
+#endif /* FBOBJECT_H */
diff --git a/mesalib/src/mesa/main/feedback.c b/mesalib/src/mesa/main/feedback.c
index d73aa08fa..cb5f49f67 100644
--- a/mesalib/src/mesa/main/feedback.c
+++ b/mesalib/src/mesa/main/feedback.c
@@ -197,7 +197,7 @@ _mesa_SelectBuffer( GLsizei size, GLuint *buffer )
* Verifies there is free space in the buffer to write the value and
* increments the pointer.
*/
-static INLINE void
+static inline void
write_record(struct gl_context *ctx, GLuint value)
{
if (ctx->Select.BufferCount < ctx->Select.BufferSize) {
diff --git a/mesalib/src/mesa/main/feedback.h b/mesalib/src/mesa/main/feedback.h
index 24ce53af4..6d256ee8f 100644
--- a/mesalib/src/mesa/main/feedback.h
+++ b/mesalib/src/mesa/main/feedback.h
@@ -1,99 +1,99 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-#ifndef FEEDBACK_H
-#define FEEDBACK_H
-
-
-#include "main/mfeatures.h"
-#include "main/mtypes.h"
-
-
-#if FEATURE_feedback
-
-extern void
-_mesa_feedback_vertex( struct gl_context *ctx,
- const GLfloat win[4],
- const GLfloat color[4],
- const GLfloat texcoord[4] );
-
-
-static INLINE void
-_mesa_feedback_token( struct gl_context *ctx, GLfloat token )
-{
- if (ctx->Feedback.Count < ctx->Feedback.BufferSize) {
- ctx->Feedback.Buffer[ctx->Feedback.Count] = token;
- }
- ctx->Feedback.Count++;
-}
-
-
-extern void
-_mesa_update_hitflag( struct gl_context *ctx, GLfloat z );
-
-
-extern void
-_mesa_init_feedback_dispatch(struct _glapi_table *disp);
-
-#else /* FEATURE_feedback */
-
-#include "main/compiler.h"
-
-static INLINE void
-_mesa_feedback_vertex( struct gl_context *ctx,
- const GLfloat win[4],
- const GLfloat color[4],
- const GLfloat texcoord[4] )
-{
- /* render mode is always GL_RENDER */
- ASSERT_NO_FEATURE();
-}
-
-
-static INLINE void
-_mesa_feedback_token( struct gl_context *ctx, GLfloat token )
-{
- /* render mode is always GL_RENDER */
- ASSERT_NO_FEATURE();
-}
-
-static INLINE void
-_mesa_update_hitflag( struct gl_context *ctx, GLfloat z )
-{
- /* render mode is always GL_RENDER */
- ASSERT_NO_FEATURE();
-}
-
-static INLINE void
-_mesa_init_feedback_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_feedback */
-
-extern void
-_mesa_init_feedback( struct gl_context *ctx );
-
-#endif /* FEEDBACK_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+#ifndef FEEDBACK_H
+#define FEEDBACK_H
+
+
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+
+
+#if FEATURE_feedback
+
+extern void
+_mesa_feedback_vertex( struct gl_context *ctx,
+ const GLfloat win[4],
+ const GLfloat color[4],
+ const GLfloat texcoord[4] );
+
+
+static inline void
+_mesa_feedback_token( struct gl_context *ctx, GLfloat token )
+{
+ if (ctx->Feedback.Count < ctx->Feedback.BufferSize) {
+ ctx->Feedback.Buffer[ctx->Feedback.Count] = token;
+ }
+ ctx->Feedback.Count++;
+}
+
+
+extern void
+_mesa_update_hitflag( struct gl_context *ctx, GLfloat z );
+
+
+extern void
+_mesa_init_feedback_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_feedback */
+
+#include "main/compiler.h"
+
+static inline void
+_mesa_feedback_vertex( struct gl_context *ctx,
+ const GLfloat win[4],
+ const GLfloat color[4],
+ const GLfloat texcoord[4] )
+{
+ /* render mode is always GL_RENDER */
+ ASSERT_NO_FEATURE();
+}
+
+
+static inline void
+_mesa_feedback_token( struct gl_context *ctx, GLfloat token )
+{
+ /* render mode is always GL_RENDER */
+ ASSERT_NO_FEATURE();
+}
+
+static inline void
+_mesa_update_hitflag( struct gl_context *ctx, GLfloat z )
+{
+ /* render mode is always GL_RENDER */
+ ASSERT_NO_FEATURE();
+}
+
+static inline void
+_mesa_init_feedback_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_feedback */
+
+extern void
+_mesa_init_feedback( struct gl_context *ctx );
+
+#endif /* FEEDBACK_H */
diff --git a/mesalib/src/mesa/main/format_unpack.c b/mesalib/src/mesa/main/format_unpack.c
index dadff0556..2051f68fb 100644
--- a/mesalib/src/mesa/main/format_unpack.c
+++ b/mesalib/src/mesa/main/format_unpack.c
@@ -34,7 +34,7 @@
* linear RGB value in [0, 1].
* Implemented with a 256-entry lookup table.
*/
-static INLINE GLfloat
+static inline GLfloat
nonlinear_to_linear(GLubyte cs8)
{
static GLfloat table[256];
diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c
index 11d670689..02b20284b 100644
--- a/mesalib/src/mesa/main/formats.c
+++ b/mesalib/src/mesa/main/formats.c
@@ -756,6 +756,251 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
},
/* unnormalized signed int formats */
+ /* unnormalized unsigned int formats */
+ {
+ MESA_FORMAT_ALPHA_UINT8,
+ "MESA_FORMAT_ALPHA_UINT8",
+ GL_ALPHA,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 8,
+ 0, 0, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_ALPHA_UINT16,
+ "MESA_FORMAT_ALPHA_UINT16",
+ GL_ALPHA,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 16,
+ 0, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_ALPHA_UINT32,
+ "MESA_FORMAT_ALPHA_UINT32",
+ GL_ALPHA,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 32,
+ 0, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_ALPHA_INT8,
+ "MESA_FORMAT_ALPHA_INT8",
+ GL_ALPHA,
+ GL_INT,
+ 0, 0, 0, 8,
+ 0, 0, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_ALPHA_INT16,
+ "MESA_FORMAT_ALPHA_INT16",
+ GL_ALPHA,
+ GL_INT,
+ 0, 0, 0, 16,
+ 0, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_ALPHA_INT32,
+ "MESA_FORMAT_ALPHA_INT32",
+ GL_ALPHA,
+ GL_INT,
+ 0, 0, 0, 32,
+ 0, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_INTENSITY_UINT8,
+ "MESA_FORMAT_INTENSITY_UINT8",
+ GL_INTENSITY,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 0,
+ 0, 8, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_INTENSITY_UINT16,
+ "MESA_FORMAT_INTENSITY_UINT16",
+ GL_INTENSITY,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 0,
+ 0, 16, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_INTENSITY_UINT32,
+ "MESA_FORMAT_INTENSITY_UINT32",
+ GL_INTENSITY,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 0,
+ 0, 32, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_INTENSITY_INT8,
+ "MESA_FORMAT_INTENSITY_INT8",
+ GL_INTENSITY,
+ GL_INT,
+ 0, 0, 0, 0,
+ 0, 8, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_INTENSITY_INT16,
+ "MESA_FORMAT_INTENSITY_INT16",
+ GL_INTENSITY,
+ GL_INT,
+ 0, 0, 0, 0,
+ 0, 16, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_INTENSITY_INT32,
+ "MESA_FORMAT_INTENSITY_INT32",
+ GL_INTENSITY,
+ GL_INT,
+ 0, 0, 0, 0,
+ 0, 32, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_LUMINANCE_UINT8,
+ "MESA_FORMAT_LUMINANCE_UINT8",
+ GL_LUMINANCE,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 0,
+ 8, 0, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_LUMINANCE_UINT16,
+ "MESA_FORMAT_LUMINANCE_UINT16",
+ GL_LUMINANCE,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 0,
+ 16, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_LUMINANCE_UINT32,
+ "MESA_FORMAT_LUMINANCE_UINT32",
+ GL_LUMINANCE,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 0,
+ 32, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_LUMINANCE_INT8,
+ "MESA_FORMAT_LUMINANCE_INT8",
+ GL_LUMINANCE,
+ GL_INT,
+ 0, 0, 0, 0,
+ 8, 0, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_LUMINANCE_INT16,
+ "MESA_FORMAT_LUMINANCE_INT16",
+ GL_LUMINANCE,
+ GL_INT,
+ 0, 0, 0, 0,
+ 16, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_LUMINANCE_INT32,
+ "MESA_FORMAT_LUMINANCE_INT32",
+ GL_LUMINANCE,
+ GL_INT,
+ 0, 0, 0, 0,
+ 32, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_UINT8,
+ "MESA_FORMAT_LUMINANCE_ALPHA_UINT8",
+ GL_LUMINANCE_ALPHA,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 8,
+ 8, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_UINT16,
+ "MESA_FORMAT_LUMINANCE_ALPHA_UINT16",
+ GL_LUMINANCE_ALPHA,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 16,
+ 16, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_UINT32,
+ "MESA_FORMAT_LUMINANCE_ALPHA_UINT32",
+ GL_LUMINANCE_ALPHA,
+ GL_UNSIGNED_INT,
+ 0, 0, 0, 32,
+ 32, 0, 0, 0, 0,
+ 1, 1, 8
+ },
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_INT8,
+ "MESA_FORMAT_LUMINANCE_ALPHA_INT8",
+ GL_LUMINANCE_ALPHA,
+ GL_INT,
+ 0, 0, 0, 8,
+ 8, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_INT16,
+ "MESA_FORMAT_LUMINANCE_ALPHA_INT16",
+ GL_LUMINANCE_ALPHA,
+ GL_INT,
+ 0, 0, 0, 16,
+ 16, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_LUMINANCE_ALPHA_INT32,
+ "MESA_FORMAT_LUMINANCE_ALPHA_INT32",
+ GL_LUMINANCE_ALPHA,
+ GL_INT,
+ 0, 0, 0, 32,
+ 32, 0, 0, 0, 0,
+ 1, 1, 8
+ },
+
+ {
+ MESA_FORMAT_R_INT8,
+ "MESA_FORMAT_R_INT8",
+ GL_RED,
+ GL_INT,
+ 8, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_RG_INT8,
+ "MESA_FORMAT_RG_INT8",
+ GL_RG,
+ GL_INT,
+ 8, 8, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_RGB_INT8,
+ "MESA_FORMAT_RGB_INT8",
+ GL_RGB,
+ GL_INT,
+ 8, 8, 8, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 3
+ },
{
MESA_FORMAT_RGBA_INT8,
"MESA_FORMAT_RGBA_INT8",
@@ -766,6 +1011,33 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4
},
{
+ MESA_FORMAT_R_INT16,
+ "MESA_FORMAT_R_INT16",
+ GL_RED,
+ GL_INT,
+ 16, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_RG_INT16,
+ "MESA_FORMAT_RG_INT16",
+ GL_RG,
+ GL_INT,
+ 16, 16, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_RGB_INT16,
+ "MESA_FORMAT_RGB_INT16",
+ GL_RGB,
+ GL_INT,
+ 16, 16, 16, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 6
+ },
+ {
MESA_FORMAT_RGBA_INT16,
"MESA_FORMAT_RGBA_INT16",
GL_RGBA,
@@ -775,6 +1047,33 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 8
},
{
+ MESA_FORMAT_R_INT32,
+ "MESA_FORMAT_R_INT32",
+ GL_RED,
+ GL_INT,
+ 32, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_RG_INT32,
+ "MESA_FORMAT_RG_INT32",
+ GL_RG,
+ GL_INT,
+ 32, 32, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 8
+ },
+ {
+ MESA_FORMAT_RGB_INT32,
+ "MESA_FORMAT_RGB_INT32",
+ GL_RGB,
+ GL_INT,
+ 32, 32, 32, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 12
+ },
+ {
MESA_FORMAT_RGBA_INT32,
"MESA_FORMAT_RGBA_INT32",
GL_RGBA,
@@ -783,8 +1082,33 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
0, 0, 0, 0, 0,
1, 1, 16
},
-
- /* unnormalized unsigned int formats */
+ {
+ MESA_FORMAT_R_UINT8,
+ "MESA_FORMAT_R_UINT8",
+ GL_RED,
+ GL_UNSIGNED_INT,
+ 8, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 1
+ },
+ {
+ MESA_FORMAT_RG_UINT8,
+ "MESA_FORMAT_RG_UINT8",
+ GL_RG,
+ GL_UNSIGNED_INT,
+ 8, 8, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_RGB_UINT8,
+ "MESA_FORMAT_RGB_UINT8",
+ GL_RGB,
+ GL_UNSIGNED_INT,
+ 8, 8, 8, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 3
+ },
{
MESA_FORMAT_RGBA_UINT8,
"MESA_FORMAT_RGBA_UINT8",
@@ -795,6 +1119,33 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4
},
{
+ MESA_FORMAT_R_UINT16,
+ "MESA_FORMAT_R_UINT16",
+ GL_RED,
+ GL_UNSIGNED_INT,
+ 16, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 2
+ },
+ {
+ MESA_FORMAT_RG_UINT16,
+ "MESA_FORMAT_RG_UINT16",
+ GL_RG,
+ GL_UNSIGNED_INT,
+ 16, 16, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_RGB_UINT16,
+ "MESA_FORMAT_RGB_UINT16",
+ GL_RGB,
+ GL_UNSIGNED_INT,
+ 16, 16, 16, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 6
+ },
+ {
MESA_FORMAT_RGBA_UINT16,
"MESA_FORMAT_RGBA_UINT16",
GL_RGBA,
@@ -804,6 +1155,33 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 8
},
{
+ MESA_FORMAT_R_UINT32,
+ "MESA_FORMAT_R_UINT32",
+ GL_RED,
+ GL_UNSIGNED_INT,
+ 32, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 4
+ },
+ {
+ MESA_FORMAT_RG_UINT32,
+ "MESA_FORMAT_RG_UINT32",
+ GL_RG,
+ GL_UNSIGNED_INT,
+ 32, 32, 0, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 8
+ },
+ {
+ MESA_FORMAT_RGB_UINT32,
+ "MESA_FORMAT_RGB_UINT32",
+ GL_RGB,
+ GL_UNSIGNED_INT,
+ 32, 32, 32, 0,
+ 0, 0, 0, 0, 0,
+ 1, 1, 12
+ },
+ {
MESA_FORMAT_RGBA_UINT32,
"MESA_FORMAT_RGBA_UINT32",
GL_RGBA,
@@ -1876,14 +2254,114 @@ _mesa_format_to_type_and_comps(gl_format format,
*comps = 1;
return;
+ case MESA_FORMAT_ALPHA_UINT8:
+ case MESA_FORMAT_LUMINANCE_UINT8:
+ case MESA_FORMAT_INTENSITY_UINT8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_LUMINANCE_ALPHA_UINT8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *comps = 2;
+ return;
+
+ case MESA_FORMAT_ALPHA_UINT16:
+ case MESA_FORMAT_LUMINANCE_UINT16:
+ case MESA_FORMAT_INTENSITY_UINT16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_LUMINANCE_ALPHA_UINT16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *comps = 2;
+ return;
+ case MESA_FORMAT_ALPHA_UINT32:
+ case MESA_FORMAT_LUMINANCE_UINT32:
+ case MESA_FORMAT_INTENSITY_UINT32:
+ *datatype = GL_UNSIGNED_INT;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_LUMINANCE_ALPHA_UINT32:
+ *datatype = GL_UNSIGNED_INT;
+ *comps = 2;
+ return;
+ case MESA_FORMAT_ALPHA_INT8:
+ case MESA_FORMAT_LUMINANCE_INT8:
+ case MESA_FORMAT_INTENSITY_INT8:
+ *datatype = GL_BYTE;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_LUMINANCE_ALPHA_INT8:
+ *datatype = GL_BYTE;
+ *comps = 2;
+ return;
+
+ case MESA_FORMAT_ALPHA_INT16:
+ case MESA_FORMAT_LUMINANCE_INT16:
+ case MESA_FORMAT_INTENSITY_INT16:
+ *datatype = GL_SHORT;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_LUMINANCE_ALPHA_INT16:
+ *datatype = GL_SHORT;
+ *comps = 2;
+ return;
+
+ case MESA_FORMAT_ALPHA_INT32:
+ case MESA_FORMAT_LUMINANCE_INT32:
+ case MESA_FORMAT_INTENSITY_INT32:
+ *datatype = GL_INT;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_LUMINANCE_ALPHA_INT32:
+ *datatype = GL_INT;
+ *comps = 2;
+ return;
+
+ case MESA_FORMAT_R_INT8:
+ *datatype = GL_BYTE;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_RG_INT8:
+ *datatype = GL_BYTE;
+ *comps = 2;
+ return;
+ case MESA_FORMAT_RGB_INT8:
+ *datatype = GL_BYTE;
+ *comps = 3;
+ return;
case MESA_FORMAT_RGBA_INT8:
*datatype = GL_BYTE;
*comps = 4;
return;
+ case MESA_FORMAT_R_INT16:
+ *datatype = GL_SHORT;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_RG_INT16:
+ *datatype = GL_SHORT;
+ *comps = 2;
+ return;
+ case MESA_FORMAT_RGB_INT16:
+ *datatype = GL_SHORT;
+ *comps = 3;
+ return;
case MESA_FORMAT_RGBA_INT16:
*datatype = GL_SHORT;
*comps = 4;
return;
+ case MESA_FORMAT_R_INT32:
+ *datatype = GL_INT;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_RG_INT32:
+ *datatype = GL_INT;
+ *comps = 2;
+ return;
+ case MESA_FORMAT_RGB_INT32:
+ *datatype = GL_INT;
+ *comps = 3;
+ return;
case MESA_FORMAT_RGBA_INT32:
*datatype = GL_INT;
*comps = 4;
@@ -1892,14 +2370,50 @@ _mesa_format_to_type_and_comps(gl_format format,
/**
* \name Non-normalized unsigned integer formats.
*/
+ case MESA_FORMAT_R_UINT8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_RG_UINT8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *comps = 2;
+ return;
+ case MESA_FORMAT_RGB_UINT8:
+ *datatype = GL_UNSIGNED_BYTE;
+ *comps = 3;
+ return;
case MESA_FORMAT_RGBA_UINT8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
+ case MESA_FORMAT_R_UINT16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_RG_UINT16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *comps = 2;
+ return;
+ case MESA_FORMAT_RGB_UINT16:
+ *datatype = GL_UNSIGNED_SHORT;
+ *comps = 3;
+ return;
case MESA_FORMAT_RGBA_UINT16:
*datatype = GL_UNSIGNED_SHORT;
*comps = 4;
return;
+ case MESA_FORMAT_R_UINT32:
+ *datatype = GL_UNSIGNED_INT;
+ *comps = 1;
+ return;
+ case MESA_FORMAT_RG_UINT32:
+ *datatype = GL_UNSIGNED_INT;
+ *comps = 2;
+ return;
+ case MESA_FORMAT_RGB_UINT32:
+ *datatype = GL_UNSIGNED_INT;
+ *comps = 3;
+ return;
case MESA_FORMAT_RGBA_UINT32:
*datatype = GL_UNSIGNED_INT;
*comps = 4;
diff --git a/mesalib/src/mesa/main/formats.h b/mesalib/src/mesa/main/formats.h
index 610204cb3..12758f03e 100644
--- a/mesalib/src/mesa/main/formats.h
+++ b/mesalib/src/mesa/main/formats.h
@@ -152,15 +152,61 @@ typedef enum
* XXX Note: these are just stand-ins for some better hardware
* formats TBD such as BGRA or ARGB.
*/
+ MESA_FORMAT_ALPHA_UINT8,
+ MESA_FORMAT_ALPHA_UINT16,
+ MESA_FORMAT_ALPHA_UINT32,
+ MESA_FORMAT_ALPHA_INT8,
+ MESA_FORMAT_ALPHA_INT16,
+ MESA_FORMAT_ALPHA_INT32,
+
+ MESA_FORMAT_INTENSITY_UINT8,
+ MESA_FORMAT_INTENSITY_UINT16,
+ MESA_FORMAT_INTENSITY_UINT32,
+ MESA_FORMAT_INTENSITY_INT8,
+ MESA_FORMAT_INTENSITY_INT16,
+ MESA_FORMAT_INTENSITY_INT32,
+
+ MESA_FORMAT_LUMINANCE_UINT8,
+ MESA_FORMAT_LUMINANCE_UINT16,
+ MESA_FORMAT_LUMINANCE_UINT32,
+ MESA_FORMAT_LUMINANCE_INT8,
+ MESA_FORMAT_LUMINANCE_INT16,
+ MESA_FORMAT_LUMINANCE_INT32,
+
+ MESA_FORMAT_LUMINANCE_ALPHA_UINT8,
+ MESA_FORMAT_LUMINANCE_ALPHA_UINT16,
+ MESA_FORMAT_LUMINANCE_ALPHA_UINT32,
+ MESA_FORMAT_LUMINANCE_ALPHA_INT8,
+ MESA_FORMAT_LUMINANCE_ALPHA_INT16,
+ MESA_FORMAT_LUMINANCE_ALPHA_INT32,
+
+ MESA_FORMAT_R_INT8,
+ MESA_FORMAT_RG_INT8,
+ MESA_FORMAT_RGB_INT8,
MESA_FORMAT_RGBA_INT8,
+ MESA_FORMAT_R_INT16,
+ MESA_FORMAT_RG_INT16,
+ MESA_FORMAT_RGB_INT16,
MESA_FORMAT_RGBA_INT16,
+ MESA_FORMAT_R_INT32,
+ MESA_FORMAT_RG_INT32,
+ MESA_FORMAT_RGB_INT32,
MESA_FORMAT_RGBA_INT32,
/**
* \name Non-normalized unsigned integer formats.
*/
+ MESA_FORMAT_R_UINT8,
+ MESA_FORMAT_RG_UINT8,
+ MESA_FORMAT_RGB_UINT8,
MESA_FORMAT_RGBA_UINT8,
+ MESA_FORMAT_R_UINT16,
+ MESA_FORMAT_RG_UINT16,
+ MESA_FORMAT_RGB_UINT16,
MESA_FORMAT_RGBA_UINT16,
+ MESA_FORMAT_R_UINT32,
+ MESA_FORMAT_RG_UINT32,
+ MESA_FORMAT_RGB_UINT32,
MESA_FORMAT_RGBA_UINT32,
/* msb <------ TEXEL BITS -----------> lsb */
diff --git a/mesalib/src/mesa/main/framebuffer.h b/mesalib/src/mesa/main/framebuffer.h
index b2b29a7a1..7aef3e02b 100644
--- a/mesalib/src/mesa/main/framebuffer.h
+++ b/mesalib/src/mesa/main/framebuffer.h
@@ -54,7 +54,7 @@ extern void
_mesa_reference_framebuffer_(struct gl_framebuffer **ptr,
struct gl_framebuffer *fb);
-static INLINE void
+static inline void
_mesa_reference_framebuffer(struct gl_framebuffer **ptr,
struct gl_framebuffer *fb)
{
diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c
index 9c1771e16..a869133a1 100644
--- a/mesalib/src/mesa/main/get.c
+++ b/mesalib/src/mesa/main/get.c
@@ -326,6 +326,7 @@ EXTRA_EXT2(ARB_fragment_program, NV_fragment_program);
EXTRA_EXT2(ARB_vertex_program, NV_vertex_program);
EXTRA_EXT2(ARB_vertex_program, ARB_fragment_program);
EXTRA_EXT(ARB_geometry_shader4);
+EXTRA_EXT(ARB_color_buffer_float);
EXTRA_EXT(ARB_copy_buffer);
EXTRA_EXT(EXT_framebuffer_sRGB);
EXTRA_EXT(ARB_texture_buffer_object);
@@ -481,6 +482,11 @@ static const struct value_desc values[] = {
/* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported */
{ GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
+ /* GL_ARB_color_buffer_float */
+ { GL_CLAMP_VERTEX_COLOR, CONTEXT_ENUM(Light.ClampVertexColor), extra_ARB_color_buffer_float },
+ { GL_CLAMP_FRAGMENT_COLOR, CONTEXT_ENUM(Color.ClampFragmentColor), extra_ARB_color_buffer_float },
+ { GL_CLAMP_READ_COLOR, CONTEXT_ENUM(Color.ClampReadColor), extra_ARB_color_buffer_float },
+
/* GL_ARB_copy_buffer */
{ GL_COPY_READ_BUFFER, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_copy_buffer },
{ GL_COPY_WRITE_BUFFER, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_copy_buffer },
@@ -683,6 +689,27 @@ static const struct value_desc values[] = {
/* GL_ARB_draw_buffers */
{ GL_MAX_DRAW_BUFFERS_ARB, CONTEXT_INT(Const.MaxDrawBuffers), NO_EXTRA },
+ /* GL_EXT_framebuffer_object / GL_NV_fbo_color_attachments */
+ { GL_MAX_COLOR_ATTACHMENTS, CONTEXT_INT(Const.MaxColorAttachments),
+ extra_EXT_framebuffer_object },
+
+ /* GL_ARB_draw_buffers / GL_NV_draw_buffers (for ES 2.0) */
+ { GL_DRAW_BUFFER0_ARB, BUFFER_ENUM(ColorDrawBuffer[0]), NO_EXTRA },
+ { GL_DRAW_BUFFER1_ARB, BUFFER_ENUM(ColorDrawBuffer[1]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER2_ARB, BUFFER_ENUM(ColorDrawBuffer[2]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER3_ARB, BUFFER_ENUM(ColorDrawBuffer[3]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER4_ARB, BUFFER_ENUM(ColorDrawBuffer[4]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER5_ARB, BUFFER_ENUM(ColorDrawBuffer[5]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER6_ARB, BUFFER_ENUM(ColorDrawBuffer[6]),
+ extra_valid_draw_buffer },
+ { GL_DRAW_BUFFER7_ARB, BUFFER_ENUM(ColorDrawBuffer[7]),
+ extra_valid_draw_buffer },
+
{ GL_BLEND_COLOR_EXT, LOC_CUSTOM, TYPE_FLOATN_4, 0, extra_new_frag_clamp },
/* GL_ARB_fragment_program */
{ GL_MAX_TEXTURE_IMAGE_UNITS_ARB, /* == GL_MAX_TEXTURE_IMAGE_UNITS_NV */
@@ -1119,23 +1146,6 @@ static const struct value_desc values[] = {
{ GL_DEPTH_CLAMP, CONTEXT_BOOL(Transform.DepthClamp),
extra_ARB_depth_clamp },
- /* GL_ARB_draw_buffers */
- { GL_DRAW_BUFFER0_ARB, BUFFER_ENUM(ColorDrawBuffer[0]), NO_EXTRA },
- { GL_DRAW_BUFFER1_ARB, BUFFER_ENUM(ColorDrawBuffer[1]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER2_ARB, BUFFER_ENUM(ColorDrawBuffer[2]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER3_ARB, BUFFER_ENUM(ColorDrawBuffer[3]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER4_ARB, BUFFER_ENUM(ColorDrawBuffer[4]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER5_ARB, BUFFER_ENUM(ColorDrawBuffer[5]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER6_ARB, BUFFER_ENUM(ColorDrawBuffer[6]),
- extra_valid_draw_buffer },
- { GL_DRAW_BUFFER7_ARB, BUFFER_ENUM(ColorDrawBuffer[7]),
- extra_valid_draw_buffer },
-
/* GL_ATI_fragment_shader */
{ GL_NUM_FRAGMENT_REGISTERS_ATI, CONST(6), extra_ATI_fragment_shader },
{ GL_NUM_FRAGMENT_CONSTANTS_ATI, CONST(8), extra_ATI_fragment_shader },
@@ -1147,10 +1157,6 @@ static const struct value_desc values[] = {
{ GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI,
CONST(3), extra_ATI_fragment_shader },
- /* GL_EXT_framebuffer_object */
- { GL_MAX_COLOR_ATTACHMENTS_EXT, CONTEXT_INT(Const.MaxColorAttachments),
- extra_EXT_framebuffer_object },
-
/* GL_EXT_framebuffer_blit
* NOTE: GL_DRAW_FRAMEBUFFER_BINDING_EXT == GL_FRAMEBUFFER_BINDING_EXT */
{ GL_READ_FRAMEBUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0,
diff --git a/mesalib/src/mesa/main/hash.c b/mesalib/src/mesa/main/hash.c
index 63f5c90fa..4b250ad54 100644
--- a/mesalib/src/mesa/main/hash.c
+++ b/mesalib/src/mesa/main/hash.c
@@ -1,547 +1,547 @@
-/**
- * \file hash.c
- * Generic hash table.
- *
- * Used for display lists, texture objects, vertex/fragment programs,
- * buffer objects, etc. The hash functions are thread-safe.
- *
- * \note key=0 is illegal.
- *
- * \author Brian Paul
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "glapi/glthread.h"
-#include "hash.h"
-
-
-#define TABLE_SIZE 1023 /**< Size of lookup table/array */
-
-#define HASH_FUNC(K) ((K) % TABLE_SIZE)
-
-
-/**
- * An entry in the hash table.
- */
-struct HashEntry {
- GLuint Key; /**< the entry's key */
- void *Data; /**< the entry's data */
- struct HashEntry *Next; /**< pointer to next entry */
-};
-
-
-/**
- * The hash table data structure.
- */
-struct _mesa_HashTable {
- struct HashEntry *Table[TABLE_SIZE]; /**< the lookup table */
- GLuint MaxKey; /**< highest key inserted so far */
- _glthread_Mutex Mutex; /**< mutual exclusion lock */
- _glthread_Mutex WalkMutex; /**< for _mesa_HashWalk() */
- GLboolean InDeleteAll; /**< Debug check */
-};
-
-
-
-/**
- * Create a new hash table.
- *
- * \return pointer to a new, empty hash table.
- */
-struct _mesa_HashTable *
-_mesa_NewHashTable(void)
-{
- struct _mesa_HashTable *table = CALLOC_STRUCT(_mesa_HashTable);
- if (table) {
- _glthread_INIT_MUTEX(table->Mutex);
- _glthread_INIT_MUTEX(table->WalkMutex);
- }
- return table;
-}
-
-
-
-/**
- * Delete a hash table.
- * Frees each entry on the hash table and then the hash table structure itself.
- * Note that the caller should have already traversed the table and deleted
- * the objects in the table (i.e. We don't free the entries' data pointer).
- *
- * \param table the hash table to delete.
- */
-void
-_mesa_DeleteHashTable(struct _mesa_HashTable *table)
-{
- GLuint pos;
- assert(table);
- for (pos = 0; pos < TABLE_SIZE; pos++) {
- struct HashEntry *entry = table->Table[pos];
- while (entry) {
- struct HashEntry *next = entry->Next;
- if (entry->Data) {
- _mesa_problem(NULL,
- "In _mesa_DeleteHashTable, found non-freed data");
- }
- free(entry);
- entry = next;
- }
- }
- _glthread_DESTROY_MUTEX(table->Mutex);
- _glthread_DESTROY_MUTEX(table->WalkMutex);
- free(table);
-}
-
-
-
-/**
- * Lookup an entry in the hash table, without locking.
- * \sa _mesa_HashLookup
- */
-static INLINE void *
-_mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key)
-{
- GLuint pos;
- const struct HashEntry *entry;
-
- assert(table);
- assert(key);
-
- pos = HASH_FUNC(key);
- entry = table->Table[pos];
- while (entry) {
- if (entry->Key == key) {
- return entry->Data;
- }
- entry = entry->Next;
- }
- return NULL;
-}
-
-
-/**
- * Lookup an entry in the hash table.
- *
- * \param table the hash table.
- * \param key the key.
- *
- * \return pointer to user's data or NULL if key not in table
- */
-void *
-_mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
-{
- void *res;
- assert(table);
- _glthread_LOCK_MUTEX(table->Mutex);
- res = _mesa_HashLookup_unlocked(table, key);
- _glthread_UNLOCK_MUTEX(table->Mutex);
- return res;
-}
-
-
-/**
- * Insert a key/pointer pair into the hash table.
- * If an entry with this key already exists we'll replace the existing entry.
- *
- * \param table the hash table.
- * \param key the key (not zero).
- * \param data pointer to user data.
- */
-void
-_mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
-{
- /* search for existing entry with this key */
- GLuint pos;
- struct HashEntry *entry;
-
- assert(table);
- assert(key);
-
- _glthread_LOCK_MUTEX(table->Mutex);
-
- if (key > table->MaxKey)
- table->MaxKey = key;
-
- pos = HASH_FUNC(key);
-
- /* check if replacing an existing entry with same key */
- for (entry = table->Table[pos]; entry; entry = entry->Next) {
- if (entry->Key == key) {
- /* replace entry's data */
-#if 0 /* not sure this check is always valid */
- if (entry->Data) {
- _mesa_problem(NULL, "Memory leak detected in _mesa_HashInsert");
- }
-#endif
- entry->Data = data;
- _glthread_UNLOCK_MUTEX(table->Mutex);
- return;
- }
- }
-
- /* alloc and insert new table entry */
- entry = MALLOC_STRUCT(HashEntry);
- if (entry) {
- entry->Key = key;
- entry->Data = data;
- entry->Next = table->Table[pos];
- table->Table[pos] = entry;
- }
-
- _glthread_UNLOCK_MUTEX(table->Mutex);
-}
-
-
-
-/**
- * Remove an entry from the hash table.
- *
- * \param table the hash table.
- * \param key key of entry to remove.
- *
- * While holding the hash table's lock, searches the entry with the matching
- * key and unlinks it.
- */
-void
-_mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
-{
- GLuint pos;
- struct HashEntry *entry, *prev;
-
- assert(table);
- assert(key);
-
- /* have to check this outside of mutex lock */
- if (table->InDeleteAll) {
- _mesa_problem(NULL, "_mesa_HashRemove illegally called from "
- "_mesa_HashDeleteAll callback function");
- return;
- }
-
- _glthread_LOCK_MUTEX(table->Mutex);
-
- pos = HASH_FUNC(key);
- prev = NULL;
- entry = table->Table[pos];
- while (entry) {
- if (entry->Key == key) {
- /* found it! */
- if (prev) {
- prev->Next = entry->Next;
- }
- else {
- table->Table[pos] = entry->Next;
- }
- free(entry);
- _glthread_UNLOCK_MUTEX(table->Mutex);
- return;
- }
- prev = entry;
- entry = entry->Next;
- }
-
- _glthread_UNLOCK_MUTEX(table->Mutex);
-}
-
-
-
-/**
- * Delete all entries in a hash table, but don't delete the table itself.
- * Invoke the given callback function for each table entry.
- *
- * \param table the hash table to delete
- * \param callback the callback function
- * \param userData arbitrary pointer to pass along to the callback
- * (this is typically a struct gl_context pointer)
- */
-void
-_mesa_HashDeleteAll(struct _mesa_HashTable *table,
- void (*callback)(GLuint key, void *data, void *userData),
- void *userData)
-{
- GLuint pos;
- ASSERT(table);
- ASSERT(callback);
- _glthread_LOCK_MUTEX(table->Mutex);
- table->InDeleteAll = GL_TRUE;
- for (pos = 0; pos < TABLE_SIZE; pos++) {
- struct HashEntry *entry, *next;
- for (entry = table->Table[pos]; entry; entry = next) {
- callback(entry->Key, entry->Data, userData);
- next = entry->Next;
- free(entry);
- }
- table->Table[pos] = NULL;
- }
- table->InDeleteAll = GL_FALSE;
- _glthread_UNLOCK_MUTEX(table->Mutex);
-}
-
-
-/**
- * Walk over all entries in a hash table, calling callback function for each.
- * Note: we use a separate mutex in this function to avoid a recursive
- * locking deadlock (in case the callback calls _mesa_HashRemove()) and to
- * prevent multiple threads/contexts from getting tangled up.
- * A lock-less version of this function could be used when the table will
- * not be modified.
- * \param table the hash table to walk
- * \param callback the callback function
- * \param userData arbitrary pointer to pass along to the callback
- * (this is typically a struct gl_context pointer)
- */
-void
-_mesa_HashWalk(const struct _mesa_HashTable *table,
- void (*callback)(GLuint key, void *data, void *userData),
- void *userData)
-{
- /* cast-away const */
- struct _mesa_HashTable *table2 = (struct _mesa_HashTable *) table;
- GLuint pos;
- ASSERT(table);
- ASSERT(callback);
- _glthread_LOCK_MUTEX(table2->WalkMutex);
- for (pos = 0; pos < TABLE_SIZE; pos++) {
- struct HashEntry *entry, *next;
- for (entry = table->Table[pos]; entry; entry = next) {
- /* save 'next' pointer now in case the callback deletes the entry */
- next = entry->Next;
- callback(entry->Key, entry->Data, userData);
- }
- }
- _glthread_UNLOCK_MUTEX(table2->WalkMutex);
-}
-
-
-/**
- * Return the key of the "first" entry in the hash table.
- * While holding the lock, walks through all table positions until finding
- * the first entry of the first non-empty one.
- *
- * \param table the hash table
- * \return key for the "first" entry in the hash table.
- */
-GLuint
-_mesa_HashFirstEntry(struct _mesa_HashTable *table)
-{
- GLuint pos;
- assert(table);
- _glthread_LOCK_MUTEX(table->Mutex);
- for (pos = 0; pos < TABLE_SIZE; pos++) {
- if (table->Table[pos]) {
- _glthread_UNLOCK_MUTEX(table->Mutex);
- return table->Table[pos]->Key;
- }
- }
- _glthread_UNLOCK_MUTEX(table->Mutex);
- return 0;
-}
-
-
-/**
- * Given a hash table key, return the next key. This is used to walk
- * over all entries in the table. Note that the keys returned during
- * walking won't be in any particular order.
- * \return next hash key or 0 if end of table.
- */
-GLuint
-_mesa_HashNextEntry(const struct _mesa_HashTable *table, GLuint key)
-{
- const struct HashEntry *entry;
- GLuint pos;
-
- assert(table);
- assert(key);
-
- /* Find the entry with given key */
- pos = HASH_FUNC(key);
- for (entry = table->Table[pos]; entry ; entry = entry->Next) {
- if (entry->Key == key) {
- break;
- }
- }
-
- if (!entry) {
- /* the given key was not found, so we can't find the next entry */
- return 0;
- }
-
- if (entry->Next) {
- /* return next in linked list */
- return entry->Next->Key;
- }
- else {
- /* look for next non-empty table slot */
- pos++;
- while (pos < TABLE_SIZE) {
- if (table->Table[pos]) {
- return table->Table[pos]->Key;
- }
- pos++;
- }
- return 0;
- }
-}
-
-
-/**
- * Dump contents of hash table for debugging.
- *
- * \param table the hash table.
- */
-void
-_mesa_HashPrint(const struct _mesa_HashTable *table)
-{
- GLuint pos;
- assert(table);
- for (pos = 0; pos < TABLE_SIZE; pos++) {
- const struct HashEntry *entry = table->Table[pos];
- while (entry) {
- _mesa_debug(NULL, "%u %p\n", entry->Key, entry->Data);
- entry = entry->Next;
- }
- }
-}
-
-
-
-/**
- * Find a block of adjacent unused hash keys.
- *
- * \param table the hash table.
- * \param numKeys number of keys needed.
- *
- * \return Starting key of free block or 0 if failure.
- *
- * If there are enough free keys between the maximum key existing in the table
- * (_mesa_HashTable::MaxKey) and the maximum key possible, then simply return
- * the adjacent key. Otherwise do a full search for a free key block in the
- * allowable key range.
- */
-GLuint
-_mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys)
-{
- const GLuint maxKey = ~((GLuint) 0);
- _glthread_LOCK_MUTEX(table->Mutex);
- if (maxKey - numKeys > table->MaxKey) {
- /* the quick solution */
- _glthread_UNLOCK_MUTEX(table->Mutex);
- return table->MaxKey + 1;
- }
- else {
- /* the slow solution */
- GLuint freeCount = 0;
- GLuint freeStart = 1;
- GLuint key;
- for (key = 1; key != maxKey; key++) {
- if (_mesa_HashLookup_unlocked(table, key)) {
- /* darn, this key is already in use */
- freeCount = 0;
- freeStart = key+1;
- }
- else {
- /* this key not in use, check if we've found enough */
- freeCount++;
- if (freeCount == numKeys) {
- _glthread_UNLOCK_MUTEX(table->Mutex);
- return freeStart;
- }
- }
- }
- /* cannot allocate a block of numKeys consecutive keys */
- _glthread_UNLOCK_MUTEX(table->Mutex);
- return 0;
- }
-}
-
-
-#if 0 /* debug only */
-
-/**
- * Test walking over all the entries in a hash table.
- */
-static void
-test_hash_walking(void)
-{
- struct _mesa_HashTable *t = _mesa_NewHashTable();
- const GLuint limit = 50000;
- GLuint i;
-
- /* create some entries */
- for (i = 0; i < limit; i++) {
- GLuint dummy;
- GLuint k = (rand() % (limit * 10)) + 1;
- while (_mesa_HashLookup(t, k)) {
- /* id already in use, try another */
- k = (rand() % (limit * 10)) + 1;
- }
- _mesa_HashInsert(t, k, &dummy);
- }
-
- /* walk over all entries */
- {
- GLuint k = _mesa_HashFirstEntry(t);
- GLuint count = 0;
- while (k) {
- GLuint knext = _mesa_HashNextEntry(t, k);
- assert(knext != k);
- _mesa_HashRemove(t, k);
- count++;
- k = knext;
- }
- assert(count == limit);
- k = _mesa_HashFirstEntry(t);
- assert(k==0);
- }
-
- _mesa_DeleteHashTable(t);
-}
-
-
-void
-_mesa_test_hash_functions(void)
-{
- int a, b, c;
- struct _mesa_HashTable *t;
-
- t = _mesa_NewHashTable();
- _mesa_HashInsert(t, 501, &a);
- _mesa_HashInsert(t, 10, &c);
- _mesa_HashInsert(t, 0xfffffff8, &b);
- /*_mesa_HashPrint(t);*/
-
- assert(_mesa_HashLookup(t,501));
- assert(!_mesa_HashLookup(t,1313));
- assert(_mesa_HashFindFreeKeyBlock(t, 100));
-
- _mesa_DeleteHashTable(t);
-
- test_hash_walking();
-}
-
-#endif
+/**
+ * \file hash.c
+ * Generic hash table.
+ *
+ * Used for display lists, texture objects, vertex/fragment programs,
+ * buffer objects, etc. The hash functions are thread-safe.
+ *
+ * \note key=0 is illegal.
+ *
+ * \author Brian Paul
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.1
+ *
+ * Copyright (C) 1999-2006 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "glapi/glthread.h"
+#include "hash.h"
+
+
+#define TABLE_SIZE 1023 /**< Size of lookup table/array */
+
+#define HASH_FUNC(K) ((K) % TABLE_SIZE)
+
+
+/**
+ * An entry in the hash table.
+ */
+struct HashEntry {
+ GLuint Key; /**< the entry's key */
+ void *Data; /**< the entry's data */
+ struct HashEntry *Next; /**< pointer to next entry */
+};
+
+
+/**
+ * The hash table data structure.
+ */
+struct _mesa_HashTable {
+ struct HashEntry *Table[TABLE_SIZE]; /**< the lookup table */
+ GLuint MaxKey; /**< highest key inserted so far */
+ _glthread_Mutex Mutex; /**< mutual exclusion lock */
+ _glthread_Mutex WalkMutex; /**< for _mesa_HashWalk() */
+ GLboolean InDeleteAll; /**< Debug check */
+};
+
+
+
+/**
+ * Create a new hash table.
+ *
+ * \return pointer to a new, empty hash table.
+ */
+struct _mesa_HashTable *
+_mesa_NewHashTable(void)
+{
+ struct _mesa_HashTable *table = CALLOC_STRUCT(_mesa_HashTable);
+ if (table) {
+ _glthread_INIT_MUTEX(table->Mutex);
+ _glthread_INIT_MUTEX(table->WalkMutex);
+ }
+ return table;
+}
+
+
+
+/**
+ * Delete a hash table.
+ * Frees each entry on the hash table and then the hash table structure itself.
+ * Note that the caller should have already traversed the table and deleted
+ * the objects in the table (i.e. We don't free the entries' data pointer).
+ *
+ * \param table the hash table to delete.
+ */
+void
+_mesa_DeleteHashTable(struct _mesa_HashTable *table)
+{
+ GLuint pos;
+ assert(table);
+ for (pos = 0; pos < TABLE_SIZE; pos++) {
+ struct HashEntry *entry = table->Table[pos];
+ while (entry) {
+ struct HashEntry *next = entry->Next;
+ if (entry->Data) {
+ _mesa_problem(NULL,
+ "In _mesa_DeleteHashTable, found non-freed data");
+ }
+ free(entry);
+ entry = next;
+ }
+ }
+ _glthread_DESTROY_MUTEX(table->Mutex);
+ _glthread_DESTROY_MUTEX(table->WalkMutex);
+ free(table);
+}
+
+
+
+/**
+ * Lookup an entry in the hash table, without locking.
+ * \sa _mesa_HashLookup
+ */
+static inline void *
+_mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key)
+{
+ GLuint pos;
+ const struct HashEntry *entry;
+
+ assert(table);
+ assert(key);
+
+ pos = HASH_FUNC(key);
+ entry = table->Table[pos];
+ while (entry) {
+ if (entry->Key == key) {
+ return entry->Data;
+ }
+ entry = entry->Next;
+ }
+ return NULL;
+}
+
+
+/**
+ * Lookup an entry in the hash table.
+ *
+ * \param table the hash table.
+ * \param key the key.
+ *
+ * \return pointer to user's data or NULL if key not in table
+ */
+void *
+_mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
+{
+ void *res;
+ assert(table);
+ _glthread_LOCK_MUTEX(table->Mutex);
+ res = _mesa_HashLookup_unlocked(table, key);
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return res;
+}
+
+
+/**
+ * Insert a key/pointer pair into the hash table.
+ * If an entry with this key already exists we'll replace the existing entry.
+ *
+ * \param table the hash table.
+ * \param key the key (not zero).
+ * \param data pointer to user data.
+ */
+void
+_mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
+{
+ /* search for existing entry with this key */
+ GLuint pos;
+ struct HashEntry *entry;
+
+ assert(table);
+ assert(key);
+
+ _glthread_LOCK_MUTEX(table->Mutex);
+
+ if (key > table->MaxKey)
+ table->MaxKey = key;
+
+ pos = HASH_FUNC(key);
+
+ /* check if replacing an existing entry with same key */
+ for (entry = table->Table[pos]; entry; entry = entry->Next) {
+ if (entry->Key == key) {
+ /* replace entry's data */
+#if 0 /* not sure this check is always valid */
+ if (entry->Data) {
+ _mesa_problem(NULL, "Memory leak detected in _mesa_HashInsert");
+ }
+#endif
+ entry->Data = data;
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return;
+ }
+ }
+
+ /* alloc and insert new table entry */
+ entry = MALLOC_STRUCT(HashEntry);
+ if (entry) {
+ entry->Key = key;
+ entry->Data = data;
+ entry->Next = table->Table[pos];
+ table->Table[pos] = entry;
+ }
+
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+}
+
+
+
+/**
+ * Remove an entry from the hash table.
+ *
+ * \param table the hash table.
+ * \param key key of entry to remove.
+ *
+ * While holding the hash table's lock, searches the entry with the matching
+ * key and unlinks it.
+ */
+void
+_mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
+{
+ GLuint pos;
+ struct HashEntry *entry, *prev;
+
+ assert(table);
+ assert(key);
+
+ /* have to check this outside of mutex lock */
+ if (table->InDeleteAll) {
+ _mesa_problem(NULL, "_mesa_HashRemove illegally called from "
+ "_mesa_HashDeleteAll callback function");
+ return;
+ }
+
+ _glthread_LOCK_MUTEX(table->Mutex);
+
+ pos = HASH_FUNC(key);
+ prev = NULL;
+ entry = table->Table[pos];
+ while (entry) {
+ if (entry->Key == key) {
+ /* found it! */
+ if (prev) {
+ prev->Next = entry->Next;
+ }
+ else {
+ table->Table[pos] = entry->Next;
+ }
+ free(entry);
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return;
+ }
+ prev = entry;
+ entry = entry->Next;
+ }
+
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+}
+
+
+
+/**
+ * Delete all entries in a hash table, but don't delete the table itself.
+ * Invoke the given callback function for each table entry.
+ *
+ * \param table the hash table to delete
+ * \param callback the callback function
+ * \param userData arbitrary pointer to pass along to the callback
+ * (this is typically a struct gl_context pointer)
+ */
+void
+_mesa_HashDeleteAll(struct _mesa_HashTable *table,
+ void (*callback)(GLuint key, void *data, void *userData),
+ void *userData)
+{
+ GLuint pos;
+ ASSERT(table);
+ ASSERT(callback);
+ _glthread_LOCK_MUTEX(table->Mutex);
+ table->InDeleteAll = GL_TRUE;
+ for (pos = 0; pos < TABLE_SIZE; pos++) {
+ struct HashEntry *entry, *next;
+ for (entry = table->Table[pos]; entry; entry = next) {
+ callback(entry->Key, entry->Data, userData);
+ next = entry->Next;
+ free(entry);
+ }
+ table->Table[pos] = NULL;
+ }
+ table->InDeleteAll = GL_FALSE;
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+}
+
+
+/**
+ * Walk over all entries in a hash table, calling callback function for each.
+ * Note: we use a separate mutex in this function to avoid a recursive
+ * locking deadlock (in case the callback calls _mesa_HashRemove()) and to
+ * prevent multiple threads/contexts from getting tangled up.
+ * A lock-less version of this function could be used when the table will
+ * not be modified.
+ * \param table the hash table to walk
+ * \param callback the callback function
+ * \param userData arbitrary pointer to pass along to the callback
+ * (this is typically a struct gl_context pointer)
+ */
+void
+_mesa_HashWalk(const struct _mesa_HashTable *table,
+ void (*callback)(GLuint key, void *data, void *userData),
+ void *userData)
+{
+ /* cast-away const */
+ struct _mesa_HashTable *table2 = (struct _mesa_HashTable *) table;
+ GLuint pos;
+ ASSERT(table);
+ ASSERT(callback);
+ _glthread_LOCK_MUTEX(table2->WalkMutex);
+ for (pos = 0; pos < TABLE_SIZE; pos++) {
+ struct HashEntry *entry, *next;
+ for (entry = table->Table[pos]; entry; entry = next) {
+ /* save 'next' pointer now in case the callback deletes the entry */
+ next = entry->Next;
+ callback(entry->Key, entry->Data, userData);
+ }
+ }
+ _glthread_UNLOCK_MUTEX(table2->WalkMutex);
+}
+
+
+/**
+ * Return the key of the "first" entry in the hash table.
+ * While holding the lock, walks through all table positions until finding
+ * the first entry of the first non-empty one.
+ *
+ * \param table the hash table
+ * \return key for the "first" entry in the hash table.
+ */
+GLuint
+_mesa_HashFirstEntry(struct _mesa_HashTable *table)
+{
+ GLuint pos;
+ assert(table);
+ _glthread_LOCK_MUTEX(table->Mutex);
+ for (pos = 0; pos < TABLE_SIZE; pos++) {
+ if (table->Table[pos]) {
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return table->Table[pos]->Key;
+ }
+ }
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return 0;
+}
+
+
+/**
+ * Given a hash table key, return the next key. This is used to walk
+ * over all entries in the table. Note that the keys returned during
+ * walking won't be in any particular order.
+ * \return next hash key or 0 if end of table.
+ */
+GLuint
+_mesa_HashNextEntry(const struct _mesa_HashTable *table, GLuint key)
+{
+ const struct HashEntry *entry;
+ GLuint pos;
+
+ assert(table);
+ assert(key);
+
+ /* Find the entry with given key */
+ pos = HASH_FUNC(key);
+ for (entry = table->Table[pos]; entry ; entry = entry->Next) {
+ if (entry->Key == key) {
+ break;
+ }
+ }
+
+ if (!entry) {
+ /* the given key was not found, so we can't find the next entry */
+ return 0;
+ }
+
+ if (entry->Next) {
+ /* return next in linked list */
+ return entry->Next->Key;
+ }
+ else {
+ /* look for next non-empty table slot */
+ pos++;
+ while (pos < TABLE_SIZE) {
+ if (table->Table[pos]) {
+ return table->Table[pos]->Key;
+ }
+ pos++;
+ }
+ return 0;
+ }
+}
+
+
+/**
+ * Dump contents of hash table for debugging.
+ *
+ * \param table the hash table.
+ */
+void
+_mesa_HashPrint(const struct _mesa_HashTable *table)
+{
+ GLuint pos;
+ assert(table);
+ for (pos = 0; pos < TABLE_SIZE; pos++) {
+ const struct HashEntry *entry = table->Table[pos];
+ while (entry) {
+ _mesa_debug(NULL, "%u %p\n", entry->Key, entry->Data);
+ entry = entry->Next;
+ }
+ }
+}
+
+
+
+/**
+ * Find a block of adjacent unused hash keys.
+ *
+ * \param table the hash table.
+ * \param numKeys number of keys needed.
+ *
+ * \return Starting key of free block or 0 if failure.
+ *
+ * If there are enough free keys between the maximum key existing in the table
+ * (_mesa_HashTable::MaxKey) and the maximum key possible, then simply return
+ * the adjacent key. Otherwise do a full search for a free key block in the
+ * allowable key range.
+ */
+GLuint
+_mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys)
+{
+ const GLuint maxKey = ~((GLuint) 0);
+ _glthread_LOCK_MUTEX(table->Mutex);
+ if (maxKey - numKeys > table->MaxKey) {
+ /* the quick solution */
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return table->MaxKey + 1;
+ }
+ else {
+ /* the slow solution */
+ GLuint freeCount = 0;
+ GLuint freeStart = 1;
+ GLuint key;
+ for (key = 1; key != maxKey; key++) {
+ if (_mesa_HashLookup_unlocked(table, key)) {
+ /* darn, this key is already in use */
+ freeCount = 0;
+ freeStart = key+1;
+ }
+ else {
+ /* this key not in use, check if we've found enough */
+ freeCount++;
+ if (freeCount == numKeys) {
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return freeStart;
+ }
+ }
+ }
+ /* cannot allocate a block of numKeys consecutive keys */
+ _glthread_UNLOCK_MUTEX(table->Mutex);
+ return 0;
+ }
+}
+
+
+#if 0 /* debug only */
+
+/**
+ * Test walking over all the entries in a hash table.
+ */
+static void
+test_hash_walking(void)
+{
+ struct _mesa_HashTable *t = _mesa_NewHashTable();
+ const GLuint limit = 50000;
+ GLuint i;
+
+ /* create some entries */
+ for (i = 0; i < limit; i++) {
+ GLuint dummy;
+ GLuint k = (rand() % (limit * 10)) + 1;
+ while (_mesa_HashLookup(t, k)) {
+ /* id already in use, try another */
+ k = (rand() % (limit * 10)) + 1;
+ }
+ _mesa_HashInsert(t, k, &dummy);
+ }
+
+ /* walk over all entries */
+ {
+ GLuint k = _mesa_HashFirstEntry(t);
+ GLuint count = 0;
+ while (k) {
+ GLuint knext = _mesa_HashNextEntry(t, k);
+ assert(knext != k);
+ _mesa_HashRemove(t, k);
+ count++;
+ k = knext;
+ }
+ assert(count == limit);
+ k = _mesa_HashFirstEntry(t);
+ assert(k==0);
+ }
+
+ _mesa_DeleteHashTable(t);
+}
+
+
+void
+_mesa_test_hash_functions(void)
+{
+ int a, b, c;
+ struct _mesa_HashTable *t;
+
+ t = _mesa_NewHashTable();
+ _mesa_HashInsert(t, 501, &a);
+ _mesa_HashInsert(t, 10, &c);
+ _mesa_HashInsert(t, 0xfffffff8, &b);
+ /*_mesa_HashPrint(t);*/
+
+ assert(_mesa_HashLookup(t,501));
+ assert(!_mesa_HashLookup(t,1313));
+ assert(_mesa_HashFindFreeKeyBlock(t, 100));
+
+ _mesa_DeleteHashTable(t);
+
+ test_hash_walking();
+}
+
+#endif
diff --git a/mesalib/src/mesa/main/histogram.h b/mesalib/src/mesa/main/histogram.h
index f9c7310fe..d97e74abb 100644
--- a/mesalib/src/mesa/main/histogram.h
+++ b/mesalib/src/mesa/main/histogram.h
@@ -1,58 +1,58 @@
-/**
- * \file histogram.h
- * Histogram.
- *
- * \if subset
- * (No-op)
- *
- * \endif
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 5.1
- *
- * Copyright (C) 1999-2003 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef HISTOGRAM_H
-#define HISTOGRAM_H
-
-#include "compiler.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-
-#if FEATURE_histogram
-
-extern void
-_mesa_init_histogram_dispatch(struct _glapi_table *disp);
-
-#else /* FEATURE_histogram */
-
-static INLINE void
-_mesa_init_histogram_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_histogram */
-
-#endif /* HISTOGRAM_H */
+/**
+ * \file histogram.h
+ * Histogram.
+ *
+ * \if subset
+ * (No-op)
+ *
+ * \endif
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 5.1
+ *
+ * Copyright (C) 1999-2003 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef HISTOGRAM_H
+#define HISTOGRAM_H
+
+#include "compiler.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+
+#if FEATURE_histogram
+
+extern void
+_mesa_init_histogram_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_histogram */
+
+static inline void
+_mesa_init_histogram_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_histogram */
+
+#endif /* HISTOGRAM_H */
diff --git a/mesalib/src/mesa/main/image.c b/mesalib/src/mesa/main/image.c
index 15f7812e6..7d95dd6be 100644
--- a/mesalib/src/mesa/main/image.c
+++ b/mesalib/src/mesa/main/image.c
@@ -1756,7 +1756,7 @@ _mesa_clip_to_region(GLint xmin, GLint ymin,
/**
* Clip dst coords against Xmax (or Ymax).
*/
-static INLINE void
+static inline void
clip_right_or_top(GLint *srcX0, GLint *srcX1,
GLint *dstX0, GLint *dstX1,
GLint maxValue)
@@ -1789,7 +1789,7 @@ clip_right_or_top(GLint *srcX0, GLint *srcX1,
/**
* Clip dst coords against Xmin (or Ymin).
*/
-static INLINE void
+static inline void
clip_left_or_bottom(GLint *srcX0, GLint *srcX1,
GLint *dstX0, GLint *dstX1,
GLint minValue)
diff --git a/mesalib/src/mesa/main/imports.h b/mesalib/src/mesa/main/imports.h
index 70defdc43..5fb5581ef 100644
--- a/mesalib/src/mesa/main/imports.h
+++ b/mesalib/src/mesa/main/imports.h
@@ -153,13 +153,13 @@ typedef union { GLfloat f; GLint i; } fi_type;
#endif
#if defined(_MSC_VER)
-static INLINE float truncf(float x) { return x < 0.0f ? ceilf(x) : floorf(x); }
-static INLINE float exp2f(float x) { return powf(2.0f, x); }
-static INLINE float log2f(float x) { return logf(x) * 1.442695041f; }
-static INLINE float asinhf(float x) { return logf(x + sqrtf(x * x + 1.0f)); }
-static INLINE float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); }
-static INLINE float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) / 2.0f; }
-static INLINE int isblank(int ch) { return ch == ' ' || ch == '\t'; }
+static inline float truncf(float x) { return x < 0.0f ? ceilf(x) : floorf(x); }
+static inline float exp2f(float x) { return powf(2.0f, x); }
+static inline float log2f(float x) { return logf(x) * 1.442695041f; }
+static inline float asinhf(float x) { return logf(x + sqrtf(x * x + 1.0f)); }
+static inline float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); }
+static inline float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) / 2.0f; }
+static inline int isblank(int ch) { return ch == ' ' || ch == '\t'; }
#define strtoll(p, e, b) _strtoi64(p, e, b)
#endif
/*@}*/
@@ -172,7 +172,7 @@ static INLINE int isblank(int ch) { return ch == ' ' || ch == '\t'; }
/* This is pretty fast, but not accurate enough (only 2 fractional bits).
* Based on code from http://www.stereopsis.com/log2.html
*/
-static INLINE GLfloat LOG2(GLfloat x)
+static inline GLfloat LOG2(GLfloat x)
{
const GLfloat y = x * x * x * x;
const GLuint ix = *((GLuint *) &y);
@@ -184,7 +184,7 @@ static INLINE GLfloat LOG2(GLfloat x)
/* Pretty fast, and accurate.
* Based on code from http://www.flipcode.com/totd/
*/
-static INLINE GLfloat LOG2(GLfloat val)
+static inline GLfloat LOG2(GLfloat val)
{
fi_type num;
GLint log_2;
@@ -208,7 +208,7 @@ static INLINE GLfloat LOG2(GLfloat val)
*** IS_INF_OR_NAN: test if float is infinite or NaN
***/
#ifdef USE_IEEE
-static INLINE int IS_INF_OR_NAN( float x )
+static inline int IS_INF_OR_NAN( float x )
{
fi_type tmp;
tmp.f = x;
@@ -231,7 +231,7 @@ static INLINE int IS_INF_OR_NAN( float x )
*** IS_NEGATIVE: test if float is negative
***/
#if defined(USE_IEEE)
-static INLINE int GET_FLOAT_BITS( float x )
+static inline int GET_FLOAT_BITS( float x )
{
fi_type fi;
fi.f = x;
@@ -289,7 +289,7 @@ static INLINE int GET_FLOAT_BITS( float x )
*** IROUND: return (as an integer) float rounded to nearest integer
***/
#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
-static INLINE int iround(float f)
+static inline int iround(float f)
{
int r;
__asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st");
@@ -297,7 +297,7 @@ static INLINE int iround(float f)
}
#define IROUND(x) iround(x)
#elif defined(USE_X86_ASM) && defined(_MSC_VER)
-static INLINE int iround(float f)
+static inline int iround(float f)
{
int r;
_asm {
@@ -344,7 +344,7 @@ long iround(float f);
* but uses some IEEE specific tricks for better speed.
* Contributed by Josh Vanderhoof
*/
-static INLINE int ifloor(float f)
+static inline int ifloor(float f)
{
int ai, bi;
double af, bf;
@@ -357,7 +357,7 @@ static INLINE int ifloor(float f)
}
#define IFLOOR(x) ifloor(x)
#elif defined(USE_IEEE)
-static INLINE int ifloor(float f)
+static inline int ifloor(float f)
{
int ai, bi;
double af, bf;
@@ -371,7 +371,7 @@ static INLINE int ifloor(float f)
}
#define IFLOOR(x) ifloor(x)
#else
-static INLINE int ifloor(float f)
+static inline int ifloor(float f)
{
int i = IROUND(f);
return (i > f) ? i - 1 : i;
@@ -391,7 +391,7 @@ static INLINE int ifloor(float f)
* but uses some IEEE specific tricks for better speed.
* Contributed by Josh Vanderhoof
*/
-static INLINE int iceil(float f)
+static inline int iceil(float f)
{
int ai, bi;
double af, bf;
@@ -404,7 +404,7 @@ static INLINE int iceil(float f)
}
#define ICEIL(x) iceil(x)
#elif defined(USE_IEEE)
-static INLINE int iceil(float f)
+static inline int iceil(float f)
{
int ai, bi;
double af, bf;
@@ -417,7 +417,7 @@ static INLINE int iceil(float f)
}
#define ICEIL(x) iceil(x)
#else
-static INLINE int iceil(float f)
+static inline int iceil(float f)
{
int i = IROUND(f);
return (i < f) ? i + 1 : i;
@@ -429,7 +429,7 @@ static INLINE int iceil(float f)
/**
* Is x a power of two?
*/
-static INLINE int
+static inline int
_mesa_is_pow_two(int x)
{
return !(x & (x - 1));
@@ -449,7 +449,7 @@ _mesa_is_pow_two(int x)
* results would be different depending on optimization
* level used for build.
*/
-static INLINE int32_t
+static inline int32_t
_mesa_next_pow_two_32(uint32_t x)
{
#if defined(__GNUC__) && \
@@ -468,7 +468,7 @@ _mesa_next_pow_two_32(uint32_t x)
#endif
}
-static INLINE int64_t
+static inline int64_t
_mesa_next_pow_two_64(uint64_t x)
{
#if defined(__GNUC__) && \
@@ -495,7 +495,7 @@ _mesa_next_pow_two_64(uint64_t x)
/*
* Returns the floor form of binary logarithm for a 32-bit integer.
*/
-static INLINE GLuint
+static inline GLuint
_mesa_logbase2(GLuint n)
{
#if defined(__GNUC__) && \
@@ -516,7 +516,7 @@ _mesa_logbase2(GLuint n)
/**
* Return 1 if this is a little endian machine, 0 if big endian.
*/
-static INLINE GLboolean
+static inline GLboolean
_mesa_little_endian(void)
{
const GLuint ui = 1; /* intentionally not static */
diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c
index 1ead5ee10..c2f922674 100644
--- a/mesalib/src/mesa/main/mipmap.c
+++ b/mesalib/src/mesa/main/mipmap.c
@@ -47,9 +47,9 @@ bytes_per_pixel(GLenum datatype, GLuint comps)
assert(b >= 0);
if (_mesa_type_is_packed(datatype))
- return b;
+ return b;
else
- return b * comps;
+ return b * comps;
}
@@ -1414,8 +1414,6 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border,
const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */
const GLint dstWidthNB = dstWidth - 2 * border;
const GLint dstHeightNB = dstHeight - 2 * border;
- const GLint srcRowBytes = bpt * srcRowStride;
- const GLint dstRowBytes = bpt * dstRowStride;
const GLubyte *srcA, *srcB;
GLubyte *dst;
GLint row, srcRowStep;
@@ -1424,7 +1422,7 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border,
srcA = srcPtr + border * ((srcWidth + 1) * bpt);
if (srcHeight > 1 && srcHeight > dstHeight) {
/* sample from two source rows */
- srcB = srcA + srcRowBytes;
+ srcB = srcA + srcRowStride;
srcRowStep = 2;
}
else {
@@ -1438,9 +1436,9 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border,
for (row = 0; row < dstHeightNB; row++) {
do_row(datatype, comps, srcWidthNB, srcA, srcB,
dstWidthNB, dst);
- srcA += srcRowStep * srcRowBytes;
- srcB += srcRowStep * srcRowBytes;
- dst += dstRowBytes;
+ srcA += srcRowStep * srcRowStride;
+ srcB += srcRowStep * srcRowStride;
+ dst += dstRowStride;
}
/* This is ugly but probably won't be used much */
@@ -1500,9 +1498,9 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border,
static void
make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
GLint srcWidth, GLint srcHeight, GLint srcDepth,
- const GLubyte *srcPtr, GLint srcRowStride,
+ const GLubyte **srcPtr, GLint srcRowStride,
GLint dstWidth, GLint dstHeight, GLint dstDepth,
- GLubyte *dstPtr, GLint dstRowStride)
+ GLubyte **dstPtr, GLint dstRowStride)
{
const GLint bpt = bytes_per_pixel(datatype, comps);
const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */
@@ -1525,7 +1523,7 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
bytesPerDstRow = dstWidth * bpt;
/* Offset between adjacent src images to be averaged together */
- srcImageOffset = (srcDepth == dstDepth) ? 0 : bytesPerSrcImage;
+ srcImageOffset = (srcDepth == dstDepth) ? 0 : 1;
/* Offset between adjacent src rows to be averaged together */
srcRowOffset = (srcHeight == dstHeight) ? 0 : srcWidth * bpt;
@@ -1545,15 +1543,15 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
for (img = 0; img < dstDepthNB; img++) {
/* first source image pointer, skipping border */
- const GLubyte *imgSrcA = srcPtr
- + (bytesPerSrcImage + bytesPerSrcRow + border) * bpt * border
- + img * (bytesPerSrcImage + srcImageOffset);
+ const GLubyte *imgSrcA = srcPtr[img * 2 + border]
+ + bytesPerSrcRow * border + bpt * border;
/* second source image pointer, skipping border */
- const GLubyte *imgSrcB = imgSrcA + srcImageOffset;
+ const GLubyte *imgSrcB = srcPtr[img * 2 + srcImageOffset + border]
+ + bytesPerSrcRow * border + bpt * border;
+
/* address of the dest image, skipping border */
- GLubyte *imgDst = dstPtr
- + (bytesPerDstImage + bytesPerDstRow + border) * bpt * border
- + img * bytesPerDstImage;
+ GLubyte *imgDst = dstPtr[img + border]
+ + bytesPerDstRow * border + bpt * border;
/* setup the four source row pointers and the dest row pointer */
const GLubyte *srcImgARowA = imgSrcA;
@@ -1581,13 +1579,14 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
/* Luckily we can leverage the make_2d_mipmap() function here! */
if (border > 0) {
/* do front border image */
- make_2d_mipmap(datatype, comps, 1, srcWidth, srcHeight, srcPtr, srcRowStride,
- dstWidth, dstHeight, dstPtr, dstRowStride);
+ make_2d_mipmap(datatype, comps, 1,
+ srcWidth, srcHeight, srcPtr[0], srcRowStride,
+ dstWidth, dstHeight, dstPtr[0], dstRowStride);
/* do back border image */
- make_2d_mipmap(datatype, comps, 1, srcWidth, srcHeight,
- srcPtr + bytesPerSrcImage * (srcDepth - 1), srcRowStride,
- dstWidth, dstHeight,
- dstPtr + bytesPerDstImage * (dstDepth - 1), dstRowStride);
+ make_2d_mipmap(datatype, comps, 1,
+ srcWidth, srcHeight, srcPtr[srcDepth - 1], srcRowStride,
+ dstWidth, dstHeight, dstPtr[dstDepth - 1], dstRowStride);
+
/* do four remaining border edges that span the image slices */
if (srcDepth == dstDepth) {
/* just copy border pixels from src to dst */
@@ -1596,29 +1595,23 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
GLubyte *dst;
/* do border along [img][row=0][col=0] */
- src = srcPtr + (img + 1) * bytesPerSrcImage;
- dst = dstPtr + (img + 1) * bytesPerDstImage;
+ src = srcPtr[img * 2];
+ dst = dstPtr[img];
memcpy(dst, src, bpt);
/* do border along [img][row=dstHeight-1][col=0] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (srcHeight - 1) * bytesPerSrcRow;
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (dstHeight - 1) * bytesPerDstRow;
+ src = srcPtr[img * 2] + (srcHeight - 1) * bytesPerSrcRow;
+ dst = dstPtr[img] + (dstHeight - 1) * bytesPerDstRow;
memcpy(dst, src, bpt);
/* do border along [img][row=0][col=dstWidth-1] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (srcWidth - 1) * bpt;
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (dstWidth - 1) * bpt;
+ src = srcPtr[img * 2] + (srcWidth - 1) * bpt;
+ dst = dstPtr[img] + (dstWidth - 1) * bpt;
memcpy(dst, src, bpt);
/* do border along [img][row=dstHeight-1][col=dstWidth-1] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (bytesPerSrcImage - bpt);
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (bytesPerDstImage - bpt);
+ src = srcPtr[img * 2] + (bytesPerSrcImage - bpt);
+ dst = dstPtr[img] + (bytesPerDstImage - bpt);
memcpy(dst, src, bpt);
}
}
@@ -1626,170 +1619,34 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
/* average border pixels from adjacent src image pairs */
ASSERT(srcDepthNB == 2 * dstDepthNB);
for (img = 0; img < dstDepthNB; img++) {
- const GLubyte *src;
+ const GLubyte *srcA, *srcB;
GLubyte *dst;
/* do border along [img][row=0][col=0] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage;
- dst = dstPtr + (img + 1) * bytesPerDstImage;
- do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst);
+ srcA = srcPtr[img * 2 + 0];
+ srcB = srcPtr[img * 2 + srcImageOffset];
+ dst = dstPtr[img];
+ do_row(datatype, comps, 1, srcA, srcB, 1, dst);
/* do border along [img][row=dstHeight-1][col=0] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (srcHeight - 1) * bytesPerSrcRow;
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (dstHeight - 1) * bytesPerDstRow;
- do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst);
+ srcA = srcPtr[img * 2 + 0]
+ + (srcHeight - 1) * bytesPerSrcRow;
+ srcB = srcPtr[img * 2 + srcImageOffset]
+ + (srcHeight - 1) * bytesPerSrcRow;
+ dst = dstPtr[img] + (dstHeight - 1) * bytesPerDstRow;
+ do_row(datatype, comps, 1, srcA, srcB, 1, dst);
/* do border along [img][row=0][col=dstWidth-1] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (srcWidth - 1) * bpt;
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (dstWidth - 1) * bpt;
- do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst);
+ srcA = srcPtr[img * 2 + 0] + (srcWidth - 1) * bpt;
+ srcB = srcPtr[img * 2 + srcImageOffset] + (srcWidth - 1) * bpt;
+ dst = dstPtr[img] + (dstWidth - 1) * bpt;
+ do_row(datatype, comps, 1, srcA, srcB, 1, dst);
/* do border along [img][row=dstHeight-1][col=dstWidth-1] */
- src = srcPtr + (img * 2 + 1) * bytesPerSrcImage
- + (bytesPerSrcImage - bpt);
- dst = dstPtr + (img + 1) * bytesPerDstImage
- + (bytesPerDstImage - bpt);
- do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst);
- }
- }
- }
-}
-
-
-static void
-make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border,
- GLint srcWidth, const GLubyte *srcPtr, GLuint srcRowStride,
- GLint dstWidth, GLint dstHeight,
- GLubyte *dstPtr, GLuint dstRowStride )
-{
- const GLint bpt = bytes_per_pixel(datatype, comps);
- const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */
- const GLint dstWidthNB = dstWidth - 2 * border;
- const GLint dstHeightNB = dstHeight - 2 * border;
- const GLint srcRowBytes = bpt * srcRowStride;
- const GLint dstRowBytes = bpt * dstRowStride;
- const GLubyte *src;
- GLubyte *dst;
- GLint row;
-
- /* Compute src and dst pointers, skipping any border */
- src = srcPtr + border * ((srcWidth + 1) * bpt);
- dst = dstPtr + border * ((dstWidth + 1) * bpt);
-
- for (row = 0; row < dstHeightNB; row++) {
- do_row(datatype, comps, srcWidthNB, src, src,
- dstWidthNB, dst);
- src += srcRowBytes;
- dst += dstRowBytes;
- }
-
- if (border) {
- /* copy left-most pixel from source */
- assert(dstPtr);
- assert(srcPtr);
- memcpy(dstPtr, srcPtr, bpt);
- /* copy right-most pixel from source */
- memcpy(dstPtr + (dstWidth - 1) * bpt,
- srcPtr + (srcWidth - 1) * bpt,
- bpt);
- }
-}
-
-
-/**
- * \bug
- * There is quite a bit of refactoring that could be done with this function
- * and \c make_2d_mipmap.
- */
-static void
-make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border,
- GLint srcWidth, GLint srcHeight,
- const GLubyte *srcPtr, GLint srcRowStride,
- GLint dstWidth, GLint dstHeight, GLint dstDepth,
- GLubyte *dstPtr, GLint dstRowStride)
-{
- const GLint bpt = bytes_per_pixel(datatype, comps);
- const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */
- const GLint dstWidthNB = dstWidth - 2 * border;
- const GLint dstHeightNB = dstHeight - 2 * border;
- const GLint dstDepthNB = dstDepth - 2 * border;
- const GLint srcRowBytes = bpt * srcRowStride;
- const GLint dstRowBytes = bpt * dstRowStride;
- const GLubyte *srcA, *srcB;
- GLubyte *dst;
- GLint layer;
- GLint row;
-
- /* Compute src and dst pointers, skipping any border */
- srcA = srcPtr + border * ((srcWidth + 1) * bpt);
- if (srcHeight > 1)
- srcB = srcA + srcRowBytes;
- else
- srcB = srcA;
- dst = dstPtr + border * ((dstWidth + 1) * bpt);
-
- for (layer = 0; layer < dstDepthNB; layer++) {
- for (row = 0; row < dstHeightNB; row++) {
- do_row(datatype, comps, srcWidthNB, srcA, srcB,
- dstWidthNB, dst);
- srcA += 2 * srcRowBytes;
- srcB += 2 * srcRowBytes;
- dst += dstRowBytes;
- }
-
- /* This is ugly but probably won't be used much */
- if (border > 0) {
- /* fill in dest border */
- /* lower-left border pixel */
- assert(dstPtr);
- assert(srcPtr);
- memcpy(dstPtr, srcPtr, bpt);
- /* lower-right border pixel */
- memcpy(dstPtr + (dstWidth - 1) * bpt,
- srcPtr + (srcWidth - 1) * bpt, bpt);
- /* upper-left border pixel */
- memcpy(dstPtr + dstWidth * (dstHeight - 1) * bpt,
- srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt);
- /* upper-right border pixel */
- memcpy(dstPtr + (dstWidth * dstHeight - 1) * bpt,
- srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt);
- /* lower border */
- do_row(datatype, comps, srcWidthNB,
- srcPtr + bpt,
- srcPtr + bpt,
- dstWidthNB, dstPtr + bpt);
- /* upper border */
- do_row(datatype, comps, srcWidthNB,
- srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt,
- srcPtr + (srcWidth * (srcHeight - 1) + 1) * bpt,
- dstWidthNB,
- dstPtr + (dstWidth * (dstHeight - 1) + 1) * bpt);
- /* left and right borders */
- if (srcHeight == dstHeight) {
- /* copy border pixel from src to dst */
- for (row = 1; row < srcHeight; row++) {
- memcpy(dstPtr + dstWidth * row * bpt,
- srcPtr + srcWidth * row * bpt, bpt);
- memcpy(dstPtr + (dstWidth * row + dstWidth - 1) * bpt,
- srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt);
- }
- }
- else {
- /* average two src pixels each dest pixel */
- for (row = 0; row < dstHeightNB; row += 2) {
- do_row(datatype, comps, 1,
- srcPtr + (srcWidth * (row * 2 + 1)) * bpt,
- srcPtr + (srcWidth * (row * 2 + 2)) * bpt,
- 1, dstPtr + (dstWidth * row + 1) * bpt);
- do_row(datatype, comps, 1,
- srcPtr + (srcWidth * (row * 2 + 1) + srcWidth - 1) * bpt,
- srcPtr + (srcWidth * (row * 2 + 2) + srcWidth - 1) * bpt,
- 1, dstPtr + (dstWidth * row + 1 + dstWidth - 1) * bpt);
- }
+ srcA = srcPtr[img * 2 + 0] + (bytesPerSrcImage - bpt);
+ srcB = srcPtr[img * 2 + srcImageOffset] + (bytesPerSrcImage - bpt);
+ dst = dstPtr[img] + (bytesPerDstImage - bpt);
+ do_row(datatype, comps, 1, srcA, srcB, 1, dst);
}
}
}
@@ -1799,28 +1656,29 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border,
/**
* Down-sample a texture image to produce the next lower mipmap level.
* \param comps components per texel (1, 2, 3 or 4)
- * \param srcRowStride stride between source rows, in texels
- * \param dstRowStride stride between destination rows, in texels
+ * \param srcData array[slice] of pointers to source image slices
+ * \param dstData array[slice] of pointers to dest image slices
+ * \param srcRowStride stride between source rows, in bytes
+ * \param dstRowStride stride between destination rows, in bytes
*/
void
_mesa_generate_mipmap_level(GLenum target,
GLenum datatype, GLuint comps,
GLint border,
GLint srcWidth, GLint srcHeight, GLint srcDepth,
- const GLubyte *srcData,
+ const GLubyte **srcData,
GLint srcRowStride,
GLint dstWidth, GLint dstHeight, GLint dstDepth,
- GLubyte *dstData,
+ GLubyte **dstData,
GLint dstRowStride)
{
- /*
- * We use simple 2x2 averaging to compute the next mipmap level.
- */
+ int i;
+
switch (target) {
case GL_TEXTURE_1D:
make_1d_mipmap(datatype, comps, border,
- srcWidth, srcData,
- dstWidth, dstData);
+ srcWidth, srcData[0],
+ dstWidth, dstData[0]);
break;
case GL_TEXTURE_2D:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
@@ -1830,8 +1688,8 @@ _mesa_generate_mipmap_level(GLenum target,
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
make_2d_mipmap(datatype, comps, border,
- srcWidth, srcHeight, srcData, srcRowStride,
- dstWidth, dstHeight, dstData, dstRowStride);
+ srcWidth, srcHeight, srcData[0], srcRowStride,
+ dstWidth, dstHeight, dstData[0], dstRowStride);
break;
case GL_TEXTURE_3D:
make_3d_mipmap(datatype, comps, border,
@@ -1841,23 +1699,26 @@ _mesa_generate_mipmap_level(GLenum target,
dstData, dstRowStride);
break;
case GL_TEXTURE_1D_ARRAY_EXT:
- make_1d_stack_mipmap(datatype, comps, border,
- srcWidth, srcData, srcRowStride,
- dstWidth, dstHeight,
- dstData, dstRowStride);
+ assert(srcHeight == 1);
+ assert(dstHeight == 1);
+ for (i = 0; i < dstDepth; i++) {
+ make_1d_mipmap(datatype, comps, border,
+ srcWidth, srcData[i],
+ dstWidth, dstData[i]);
+ }
break;
case GL_TEXTURE_2D_ARRAY_EXT:
- make_2d_stack_mipmap(datatype, comps, border,
- srcWidth, srcHeight,
- srcData, srcRowStride,
- dstWidth, dstHeight,
- dstDepth, dstData, dstRowStride);
+ for (i = 0; i < dstDepth; i++) {
+ make_2d_mipmap(datatype, comps, border,
+ srcWidth, srcHeight, srcData[i], srcRowStride,
+ dstWidth, dstHeight, dstData[i], dstRowStride);
+ }
break;
case GL_TEXTURE_RECTANGLE_NV:
/* no mipmaps, do nothing */
break;
default:
- _mesa_problem(NULL, "bad dimensions in _mesa_generate_mipmaps");
+ _mesa_problem(NULL, "bad tex target in _mesa_generate_mipmaps");
return;
}
}
@@ -1919,12 +1780,14 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target,
for (level = texObj->BaseLevel; level < maxLevel; level++) {
/* generate image[level+1] from image[level] */
- const struct gl_texture_image *srcImage;
- struct gl_texture_image *dstImage;
+ struct gl_texture_image *srcImage, *dstImage;
+ GLint srcRowStride, dstRowStride;
GLint srcWidth, srcHeight, srcDepth;
GLint dstWidth, dstHeight, dstDepth;
GLint border;
+ GLint slice;
GLboolean nextLevel;
+ GLubyte **srcMaps, **dstMaps;
/* get src image parameters */
srcImage = _mesa_select_tex_image(ctx, texObj, target, level);
@@ -1950,7 +1813,6 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target,
/* Free old image data */
ctx->Driver.FreeTextureImageBuffer(ctx, dstImage);
- /* initialize new image */
_mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight,
dstDepth, border, srcImage->InternalFormat,
srcImage->TexFormat);
@@ -1967,15 +1829,54 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target,
ASSERT(dstImage->TexFormat);
+ if (target == GL_TEXTURE_1D_ARRAY) {
+ srcDepth = srcHeight;
+ dstDepth = dstHeight;
+ srcHeight = 1;
+ dstHeight = 1;
+ }
+
+ /* Map src texture image slices */
+ srcMaps = (GLubyte **) malloc(srcDepth * sizeof(GLubyte *));
+ for (slice = 0; slice < srcDepth; slice++) {
+ ctx->Driver.MapTextureImage(ctx, srcImage, slice,
+ 0, 0, srcWidth, srcHeight,
+ GL_MAP_READ_BIT,
+ &srcMaps[slice], &srcRowStride);
+ }
+
+ /* Map dst texture image slices */
+ dstMaps = (GLubyte **) malloc(dstDepth * sizeof(GLubyte *));
+ for (slice = 0; slice < dstDepth; slice++) {
+ ctx->Driver.MapTextureImage(ctx, dstImage, slice,
+ 0, 0, dstWidth, dstHeight,
+ GL_MAP_WRITE_BIT,
+ &dstMaps[slice], &dstRowStride);
+ }
+
+ /* generate one mipmap level (for 1D/2D/3D/array/etc texture) */
_mesa_generate_mipmap_level(target, datatype, comps, border,
srcWidth, srcHeight, srcDepth,
- srcImage->Data, srcImage->RowStride,
+ (const GLubyte **) srcMaps, srcRowStride,
dstWidth, dstHeight, dstDepth,
- dstImage->Data, dstImage->RowStride);
+ dstMaps, dstRowStride);
+
+ /* Unmap src image slices */
+ for (slice = 0; slice < srcDepth; slice++) {
+ ctx->Driver.UnmapTextureImage(ctx, srcImage, slice);
+ }
+ free(srcMaps);
+
+ /* Unmap dst image slices */
+ for (slice = 0; slice < dstDepth; slice++) {
+ ctx->Driver.UnmapTextureImage(ctx, dstImage, slice);
+ }
+ free(dstMaps);
} /* loop over mipmap levels */
}
+
static void
generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
struct gl_texture_object *texObj,
@@ -1985,7 +1886,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
GLint level;
gl_format temp_format;
GLint components;
- GLuint temp_src_stride, temp_dst_stride; /* in bytes */
+ GLuint temp_src_stride; /* in bytes */
GLubyte *temp_src = NULL, *temp_dst = NULL;
GLenum temp_datatype;
GLenum temp_base_format;
@@ -2032,9 +1933,10 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
ctx->Pack = ctx->DefaultPacking;
/* Get the uncompressed image */
- ctx->Driver.GetTexImage(ctx, target, texObj->BaseLevel,
+ assert(srcImage->Level == texObj->BaseLevel);
+ ctx->Driver.GetTexImage(ctx,
temp_base_format, temp_datatype,
- temp_src, texObj, srcImage);
+ temp_src, srcImage);
/* restore packing mode */
ctx->Pack = save;
}
@@ -2048,6 +1950,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
GLint dstWidth, dstHeight, dstDepth;
GLint border;
GLboolean nextLevel;
+ GLuint temp_dst_stride; /* in bytes */
/* get src image parameters */
srcImage = _mesa_select_tex_image(ctx, texObj, target, level);
@@ -2084,15 +1987,19 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
_mesa_generate_mipmap_level(target, temp_datatype, components, border,
srcWidth, srcHeight, srcDepth,
- temp_src, temp_src_stride / components,
+ (const GLubyte **) &temp_src,
+ temp_src_stride,
dstWidth, dstHeight, dstDepth,
- temp_dst, temp_dst_stride / components);
+ &temp_dst, temp_dst_stride);
/* initialize new image */
_mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight,
dstDepth, border, srcImage->InternalFormat,
srcImage->TexFormat);
+ /* Free old dest texture image buffer */
+ ctx->Driver.FreeTextureImageBuffer(ctx, dstImage);
+
ctx->Driver.TexImage2D(ctx, target, level + 1,
srcImage->InternalFormat,
dstWidth, dstHeight, border,
@@ -2104,7 +2011,6 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
GLubyte *temp = temp_src;
temp_src = temp_dst;
temp_dst = temp;
-
temp_src_stride = temp_dst_stride;
}
} /* loop over mipmap levels */
diff --git a/mesalib/src/mesa/main/mipmap.h b/mesalib/src/mesa/main/mipmap.h
index 478395021..8b7cd7d5a 100644
--- a/mesalib/src/mesa/main/mipmap.h
+++ b/mesalib/src/mesa/main/mipmap.h
@@ -34,10 +34,10 @@ _mesa_generate_mipmap_level(GLenum target,
GLenum datatype, GLuint comps,
GLint border,
GLint srcWidth, GLint srcHeight, GLint srcDepth,
- const GLubyte *srcData,
+ const GLubyte **srcData,
GLint srcRowStride,
GLint dstWidth, GLint dstHeight, GLint dstDepth,
- GLubyte *dstData,
+ GLubyte **dstData,
GLint dstRowStride);
diff --git a/mesalib/src/mesa/main/mm.c b/mesalib/src/mesa/main/mm.c
index 25a029370..ab32123a4 100644
--- a/mesalib/src/mesa/main/mm.c
+++ b/mesalib/src/mesa/main/mm.c
@@ -211,7 +211,7 @@ mmFindBlock(struct mem_block *heap, unsigned start)
}
-static INLINE int
+static inline int
Join2Blocks(struct mem_block *p)
{
/* XXX there should be some assertions here */
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index be43434c8..67db4df8f 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -330,7 +330,7 @@ typedef enum
* (VERT_RESULT_PSIZ, VERT_RESULT_BFC0, VERT_RESULT_BFC1, and
* VERT_RESULT_EDGE) are converted to a value of -1.
*/
-static INLINE int
+static inline int
_mesa_vert_result_to_frag_attrib(gl_vert_result vert_result)
{
if (vert_result >= VERT_RESULT_CLIP_DIST0)
@@ -350,7 +350,7 @@ _mesa_vert_result_to_frag_attrib(gl_vert_result vert_result)
* gl_frag_attrib values which have no corresponding gl_vert_result
* (FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC) are converted to a value of -1.
*/
-static INLINE int
+static inline int
_mesa_frag_attrib_to_vert_result(gl_frag_attrib frag_attrib)
{
if (frag_attrib <= FRAG_ATTRIB_TEX7)
@@ -1834,11 +1834,6 @@ struct gl_program
/** Numbered local parameters */
GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4];
- /** Vertex/fragment shader varying vars */
- struct gl_program_parameter_list *Varying;
- /** Vertex program user-defined attributes */
- struct gl_program_parameter_list *Attributes;
-
/** Map from sampler unit to texture unit (set by glUniform1i()) */
GLubyte SamplerUnits[MAX_SAMPLERS];
/** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */
@@ -2148,8 +2143,14 @@ struct gl_shader_program
GLuint NumShaders; /**< number of attached shaders */
struct gl_shader **Shaders; /**< List of attached the shaders */
- /** User-defined attribute bindings (glBindAttribLocation) */
- struct gl_program_parameter_list *Attributes;
+ /**
+ * User-defined attribute bindings
+ *
+ * These are set via \c glBindAttribLocation and are used to direct the
+ * GLSL linker. These are \b not the values used in the compiled shader,
+ * and they are \b not the values returned by \c glGetAttribLocation.
+ */
+ struct string_to_uint_map *AttributeBindings;
/** Transform feedback varyings */
struct {
@@ -2751,7 +2752,6 @@ struct gl_extensions
GLboolean ARB_depth_buffer_float;
GLboolean ARB_depth_clamp;
GLboolean ARB_depth_texture;
- GLboolean ARB_draw_buffers;
GLboolean ARB_draw_buffers_blend;
GLboolean ARB_draw_elements_base_vertex;
GLboolean ARB_draw_instanced;
diff --git a/mesalib/src/mesa/main/pack.c b/mesalib/src/mesa/main/pack.c
index 6d6ae59f4..62e352f3f 100644
--- a/mesalib/src/mesa/main/pack.c
+++ b/mesalib/src/mesa/main/pack.c
@@ -2910,35 +2910,35 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
}
-static INLINE GLuint
+static inline GLuint
clamp_byte_to_uint(GLbyte b)
{
return b < 0 ? 0 : b;
}
-static INLINE GLuint
+static inline GLuint
clamp_short_to_uint(GLshort s)
{
return s < 0 ? 0 : s;
}
-static INLINE GLuint
+static inline GLuint
clamp_int_to_uint(GLint i)
{
return i < 0 ? 0 : i;
}
-static INLINE GLuint
+static inline GLuint
clamp_float_to_uint(GLfloat f)
{
return f < 0.0F ? 0 : IROUND(f);
}
-static INLINE GLuint
+static inline GLuint
clamp_half_to_uint(GLhalfARB h)
{
GLfloat f = _mesa_half_to_float(h);
diff --git a/mesalib/src/mesa/main/pixel.c b/mesalib/src/mesa/main/pixel.c
index c87f5e0e9..e73c5a49a 100644
--- a/mesalib/src/mesa/main/pixel.c
+++ b/mesalib/src/mesa/main/pixel.c
@@ -506,7 +506,7 @@ _mesa_GetPixelMapusv( GLenum map, GLushort *values )
* Implements glPixelTransfer[fi] whether called immediately or from a
* display list.
*/
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_PixelTransferf( GLenum pname, GLfloat param )
{
GET_CURRENT_CONTEXT(ctx);
diff --git a/mesalib/src/mesa/main/pixel.h b/mesalib/src/mesa/main/pixel.h
index c54b1fc5e..797b0d9d6 100644
--- a/mesalib/src/mesa/main/pixel.h
+++ b/mesalib/src/mesa/main/pixel.h
@@ -1,72 +1,81 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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 pixel.h
- * Pixel operations.
- */
-
-
-#ifndef PIXEL_H
-#define PIXEL_H
-
-
-#include "compiler.h"
-#include "glheader.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-struct gl_context;
-
-
-#if FEATURE_pixel_transfer
-
-extern void
-_mesa_update_pixel( struct gl_context *ctx, GLuint newstate );
-
-extern void
-_mesa_init_pixel_dispatch( struct _glapi_table * disp );
-
-#else /* FEATURE_pixel_transfer */
-
-static INLINE void
-_mesa_update_pixel(struct gl_context *ctx, GLuint newstate)
-{
-}
-
-static INLINE void
-_mesa_init_pixel_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_pixel_transfer */
-
-
-extern void
-_mesa_init_pixel( struct gl_context * ctx );
-
-/*@}*/
-
-#endif /* PIXEL_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 pixel.h
+ * Pixel operations.
+ */
+
+
+#ifndef PIXEL_H
+#define PIXEL_H
+
+
+#include "compiler.h"
+#include "glheader.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+struct gl_context;
+
+
+#if FEATURE_pixel_transfer
+
+extern void GLAPIENTRY
+_mesa_PixelTransferf(GLenum pname, GLfloat param);
+
+extern void
+_mesa_update_pixel( struct gl_context *ctx, GLuint newstate );
+
+extern void
+_mesa_init_pixel_dispatch( struct _glapi_table * disp );
+
+#else /* FEATURE_pixel_transfer */
+
+static inline void GLAPIENTRY
+_mesa_PixelTransferf(GLenum pname, GLfloat param)
+{
+}
+
+
+static inline void
+_mesa_update_pixel(struct gl_context *ctx, GLuint newstate)
+{
+}
+
+static inline void
+_mesa_init_pixel_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_pixel_transfer */
+
+
+extern void
+_mesa_init_pixel( struct gl_context * ctx );
+
+/*@}*/
+
+#endif /* PIXEL_H */
diff --git a/mesalib/src/mesa/main/queryobj.h b/mesalib/src/mesa/main/queryobj.h
index 16962e55a..e7a133b59 100644
--- a/mesalib/src/mesa/main/queryobj.h
+++ b/mesalib/src/mesa/main/queryobj.h
@@ -34,7 +34,7 @@
#if FEATURE_queryobj
-static INLINE struct gl_query_object *
+static inline struct gl_query_object *
_mesa_lookup_query_object(struct gl_context *ctx, GLuint id)
{
return (struct gl_query_object *)
@@ -50,18 +50,18 @@ _mesa_init_queryobj_dispatch(struct _glapi_table *disp);
#else /* FEATURE_queryobj */
-static INLINE struct gl_query_object *
+static inline struct gl_query_object *
_mesa_lookup_query_object(struct gl_context *ctx, GLuint id)
{
return NULL;
}
-static INLINE void
+static inline void
_mesa_init_query_object_functions(struct dd_function_table *driver)
{
}
-static INLINE void
+static inline void
_mesa_init_queryobj_dispatch(struct _glapi_table *disp)
{
}
diff --git a/mesalib/src/mesa/main/rastpos.h b/mesalib/src/mesa/main/rastpos.h
index a530ddd76..cdd94a66c 100644
--- a/mesalib/src/mesa/main/rastpos.h
+++ b/mesalib/src/mesa/main/rastpos.h
@@ -1,60 +1,60 @@
-/**
- * \file rastpos.h
- * Raster position operations.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 4.1
- *
- * Copyright (C) 1999-2002 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef RASTPOS_H
-#define RASTPOS_H
-
-
-#include "compiler.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-struct gl_context;
-
-#if FEATURE_rastpos
-
-extern void
-_mesa_init_rastpos_dispatch(struct _glapi_table *disp);
-
-#else /* FEATURE_rastpos */
-
-static INLINE void
-_mesa_init_rastpos_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_rastpos */
-
-extern void
-_mesa_init_rastpos(struct gl_context *ctx);
-
-/*@}*/
-
-#endif /* RASTPOS_H */
+/**
+ * \file rastpos.h
+ * Raster position operations.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 4.1
+ *
+ * Copyright (C) 1999-2002 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef RASTPOS_H
+#define RASTPOS_H
+
+
+#include "compiler.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+struct gl_context;
+
+#if FEATURE_rastpos
+
+extern void
+_mesa_init_rastpos_dispatch(struct _glapi_table *disp);
+
+#else /* FEATURE_rastpos */
+
+static inline void
+_mesa_init_rastpos_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_rastpos */
+
+extern void
+_mesa_init_rastpos(struct gl_context *ctx);
+
+/*@}*/
+
+#endif /* RASTPOS_H */
diff --git a/mesalib/src/mesa/main/remap.h b/mesalib/src/mesa/main/remap.h
index ae91a35d9..fa3172487 100644
--- a/mesalib/src/mesa/main/remap.h
+++ b/mesalib/src/mesa/main/remap.h
@@ -1,98 +1,98 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.7
- *
- * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
- *
- * 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS 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.
- */
-
-
-#ifndef REMAP_H
-#define REMAP_H
-
-
-#include "main/compiler.h"
-#include "main/mfeatures.h"
-
-struct gl_function_pool_remap {
- int pool_index;
- int remap_index;
-};
-
-struct gl_function_remap {
- int func_index;
- int dispatch_offset; /* for sanity check */
-};
-
-
-#if FEATURE_remap_table
-
-extern int
-driDispatchRemapTable[];
-
-extern const char *
-_mesa_get_function_spec(int func_index);
-
-extern int
-_mesa_map_function_spec(const char *spec);
-
-extern void
-_mesa_map_function_array(const struct gl_function_remap *func_array);
-
-extern void
-_mesa_map_static_functions(void);
-
-extern void
-_mesa_init_remap_table(void);
-
-#else /* FEATURE_remap_table */
-
-static INLINE const char *
-_mesa_get_function_spec(int func_index)
-{
- return NULL;
-}
-
-static INLINE int
-_mesa_map_function_spec(const char *spec)
-{
- return -1;
-}
-
-static INLINE void
-_mesa_map_function_array(const struct gl_function_remap *func_array)
-{
-}
-
-static INLINE void
-_mesa_map_static_functions(void)
-{
-}
-
-
-static INLINE void
-_mesa_init_remap_table(void)
-{
-}
-
-#endif /* FEATURE_remap_table */
-
-
-#endif /* REMAP_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.7
+ *
+ * Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
+ *
+ * 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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.
+ */
+
+
+#ifndef REMAP_H
+#define REMAP_H
+
+
+#include "main/compiler.h"
+#include "main/mfeatures.h"
+
+struct gl_function_pool_remap {
+ int pool_index;
+ int remap_index;
+};
+
+struct gl_function_remap {
+ int func_index;
+ int dispatch_offset; /* for sanity check */
+};
+
+
+#if FEATURE_remap_table
+
+extern int
+driDispatchRemapTable[];
+
+extern const char *
+_mesa_get_function_spec(int func_index);
+
+extern int
+_mesa_map_function_spec(const char *spec);
+
+extern void
+_mesa_map_function_array(const struct gl_function_remap *func_array);
+
+extern void
+_mesa_map_static_functions(void);
+
+extern void
+_mesa_init_remap_table(void);
+
+#else /* FEATURE_remap_table */
+
+static inline const char *
+_mesa_get_function_spec(int func_index)
+{
+ return NULL;
+}
+
+static inline int
+_mesa_map_function_spec(const char *spec)
+{
+ return -1;
+}
+
+static inline void
+_mesa_map_function_array(const struct gl_function_remap *func_array)
+{
+}
+
+static inline void
+_mesa_map_static_functions(void)
+{
+}
+
+
+static inline void
+_mesa_init_remap_table(void)
+{
+}
+
+#endif /* FEATURE_remap_table */
+
+
+#endif /* REMAP_H */
diff --git a/mesalib/src/mesa/main/remap_helper.h b/mesalib/src/mesa/main/remap_helper.h
index 127266ea7..5ea2bb62c 100644
--- a/mesalib/src/mesa/main/remap_helper.h
+++ b/mesalib/src/mesa/main/remap_helper.h
@@ -4472,612 +4472,613 @@ static const char _mesa_function_pool[] =
"glDrawBuffers\0"
"glDrawBuffersARB\0"
"glDrawBuffersATI\0"
+ "glDrawBuffersNV\0"
"\0"
- /* _mesa_function_pool[31182]: ClearBufferiv (will be remapped) */
+ /* _mesa_function_pool[31198]: ClearBufferiv (will be remapped) */
"iip\0"
"glClearBufferiv\0"
"\0"
- /* _mesa_function_pool[31203]: ProgramLocalParameter4fARB (will be remapped) */
+ /* _mesa_function_pool[31219]: ProgramLocalParameter4fARB (will be remapped) */
"iiffff\0"
"glProgramLocalParameter4fARB\0"
"\0"
- /* _mesa_function_pool[31240]: SpriteParameterivSGIX (dynamic) */
+ /* _mesa_function_pool[31256]: SpriteParameterivSGIX (dynamic) */
"ip\0"
"glSpriteParameterivSGIX\0"
"\0"
- /* _mesa_function_pool[31268]: ProvokingVertexEXT (will be remapped) */
+ /* _mesa_function_pool[31284]: ProvokingVertexEXT (will be remapped) */
"i\0"
"glProvokingVertexEXT\0"
"glProvokingVertex\0"
"\0"
- /* _mesa_function_pool[31310]: MultiTexCoord1fARB (offset 378) */
+ /* _mesa_function_pool[31326]: MultiTexCoord1fARB (offset 378) */
"if\0"
"glMultiTexCoord1f\0"
"glMultiTexCoord1fARB\0"
"\0"
- /* _mesa_function_pool[31353]: LoadName (offset 198) */
+ /* _mesa_function_pool[31369]: LoadName (offset 198) */
"i\0"
"glLoadName\0"
"\0"
- /* _mesa_function_pool[31367]: VertexAttribs4ubvNV (will be remapped) */
+ /* _mesa_function_pool[31383]: VertexAttribs4ubvNV (will be remapped) */
"iip\0"
"glVertexAttribs4ubvNV\0"
"\0"
- /* _mesa_function_pool[31394]: WeightsvARB (dynamic) */
+ /* _mesa_function_pool[31410]: WeightsvARB (dynamic) */
"ip\0"
"glWeightsvARB\0"
"\0"
- /* _mesa_function_pool[31412]: NormalP3ui (will be remapped) */
+ /* _mesa_function_pool[31428]: NormalP3ui (will be remapped) */
"ii\0"
"glNormalP3ui\0"
"\0"
- /* _mesa_function_pool[31429]: VertexAttribP2ui (will be remapped) */
+ /* _mesa_function_pool[31445]: VertexAttribP2ui (will be remapped) */
"iiii\0"
"glVertexAttribP2ui\0"
"\0"
- /* _mesa_function_pool[31454]: Uniform1fvARB (will be remapped) */
+ /* _mesa_function_pool[31470]: Uniform1fvARB (will be remapped) */
"iip\0"
"glUniform1fv\0"
"glUniform1fvARB\0"
"\0"
- /* _mesa_function_pool[31488]: CopyTexSubImage1D (offset 325) */
+ /* _mesa_function_pool[31504]: CopyTexSubImage1D (offset 325) */
"iiiiii\0"
"glCopyTexSubImage1D\0"
"glCopyTexSubImage1DEXT\0"
"\0"
- /* _mesa_function_pool[31539]: CullFace (offset 152) */
+ /* _mesa_function_pool[31555]: CullFace (offset 152) */
"i\0"
"glCullFace\0"
"\0"
- /* _mesa_function_pool[31553]: BindTexture (offset 307) */
+ /* _mesa_function_pool[31569]: BindTexture (offset 307) */
"ii\0"
"glBindTexture\0"
"glBindTextureEXT\0"
"\0"
- /* _mesa_function_pool[31588]: BeginFragmentShaderATI (will be remapped) */
+ /* _mesa_function_pool[31604]: BeginFragmentShaderATI (will be remapped) */
"\0"
"glBeginFragmentShaderATI\0"
"\0"
- /* _mesa_function_pool[31615]: MultiTexCoord4fARB (offset 402) */
+ /* _mesa_function_pool[31631]: MultiTexCoord4fARB (offset 402) */
"iffff\0"
"glMultiTexCoord4f\0"
"glMultiTexCoord4fARB\0"
"\0"
- /* _mesa_function_pool[31661]: VertexAttribs3svNV (will be remapped) */
+ /* _mesa_function_pool[31677]: VertexAttribs3svNV (will be remapped) */
"iip\0"
"glVertexAttribs3svNV\0"
"\0"
- /* _mesa_function_pool[31687]: StencilFunc (offset 243) */
+ /* _mesa_function_pool[31703]: StencilFunc (offset 243) */
"iii\0"
"glStencilFunc\0"
"\0"
- /* _mesa_function_pool[31706]: CopyPixels (offset 255) */
+ /* _mesa_function_pool[31722]: CopyPixels (offset 255) */
"iiiii\0"
"glCopyPixels\0"
"\0"
- /* _mesa_function_pool[31726]: Rectsv (offset 93) */
+ /* _mesa_function_pool[31742]: Rectsv (offset 93) */
"pp\0"
"glRectsv\0"
"\0"
- /* _mesa_function_pool[31739]: ReplacementCodeuivSUN (dynamic) */
+ /* _mesa_function_pool[31755]: ReplacementCodeuivSUN (dynamic) */
"p\0"
"glReplacementCodeuivSUN\0"
"\0"
- /* _mesa_function_pool[31766]: MultiTexCoordP2uiv (will be remapped) */
+ /* _mesa_function_pool[31782]: MultiTexCoordP2uiv (will be remapped) */
"iip\0"
"glMultiTexCoordP2uiv\0"
"\0"
- /* _mesa_function_pool[31792]: EnableVertexAttribArrayARB (will be remapped) */
+ /* _mesa_function_pool[31808]: EnableVertexAttribArrayARB (will be remapped) */
"i\0"
"glEnableVertexAttribArray\0"
"glEnableVertexAttribArrayARB\0"
"\0"
- /* _mesa_function_pool[31850]: NormalPointervINTEL (dynamic) */
+ /* _mesa_function_pool[31866]: NormalPointervINTEL (dynamic) */
"ip\0"
"glNormalPointervINTEL\0"
"\0"
- /* _mesa_function_pool[31876]: CopyConvolutionFilter2D (offset 355) */
+ /* _mesa_function_pool[31892]: CopyConvolutionFilter2D (offset 355) */
"iiiiii\0"
"glCopyConvolutionFilter2D\0"
"glCopyConvolutionFilter2DEXT\0"
"\0"
- /* _mesa_function_pool[31939]: WindowPos3ivMESA (will be remapped) */
+ /* _mesa_function_pool[31955]: WindowPos3ivMESA (will be remapped) */
"p\0"
"glWindowPos3iv\0"
"glWindowPos3ivARB\0"
"glWindowPos3ivMESA\0"
"\0"
- /* _mesa_function_pool[31994]: CopyBufferSubData (will be remapped) */
+ /* _mesa_function_pool[32010]: CopyBufferSubData (will be remapped) */
"iiiii\0"
"glCopyBufferSubData\0"
"\0"
- /* _mesa_function_pool[32021]: NormalPointer (offset 318) */
+ /* _mesa_function_pool[32037]: NormalPointer (offset 318) */
"iip\0"
"glNormalPointer\0"
"\0"
- /* _mesa_function_pool[32042]: TexParameterfv (offset 179) */
+ /* _mesa_function_pool[32058]: TexParameterfv (offset 179) */
"iip\0"
"glTexParameterfv\0"
"\0"
- /* _mesa_function_pool[32064]: IsBufferARB (will be remapped) */
+ /* _mesa_function_pool[32080]: IsBufferARB (will be remapped) */
"i\0"
"glIsBuffer\0"
"glIsBufferARB\0"
"\0"
- /* _mesa_function_pool[32092]: WindowPos4iMESA (will be remapped) */
+ /* _mesa_function_pool[32108]: WindowPos4iMESA (will be remapped) */
"iiii\0"
"glWindowPos4iMESA\0"
"\0"
- /* _mesa_function_pool[32116]: VertexAttrib4uivARB (will be remapped) */
+ /* _mesa_function_pool[32132]: VertexAttrib4uivARB (will be remapped) */
"ip\0"
"glVertexAttrib4uiv\0"
"glVertexAttrib4uivARB\0"
"\0"
- /* _mesa_function_pool[32161]: Tangent3bvEXT (dynamic) */
+ /* _mesa_function_pool[32177]: Tangent3bvEXT (dynamic) */
"p\0"
"glTangent3bvEXT\0"
"\0"
- /* _mesa_function_pool[32180]: VertexAttribI3uivEXT (will be remapped) */
+ /* _mesa_function_pool[32196]: VertexAttribI3uivEXT (will be remapped) */
"ip\0"
"glVertexAttribI3uivEXT\0"
"glVertexAttribI3uiv\0"
"\0"
- /* _mesa_function_pool[32227]: UniformMatrix3x4fv (will be remapped) */
+ /* _mesa_function_pool[32243]: UniformMatrix3x4fv (will be remapped) */
"iiip\0"
"glUniformMatrix3x4fv\0"
"\0"
- /* _mesa_function_pool[32254]: ClipPlane (offset 150) */
+ /* _mesa_function_pool[32270]: ClipPlane (offset 150) */
"ip\0"
"glClipPlane\0"
"\0"
- /* _mesa_function_pool[32270]: Recti (offset 90) */
+ /* _mesa_function_pool[32286]: Recti (offset 90) */
"iiii\0"
"glRecti\0"
"\0"
- /* _mesa_function_pool[32284]: TrackMatrixNV (will be remapped) */
+ /* _mesa_function_pool[32300]: TrackMatrixNV (will be remapped) */
"iiii\0"
"glTrackMatrixNV\0"
"\0"
- /* _mesa_function_pool[32306]: DrawRangeElementsBaseVertex (will be remapped) */
+ /* _mesa_function_pool[32322]: DrawRangeElementsBaseVertex (will be remapped) */
"iiiiipi\0"
"glDrawRangeElementsBaseVertex\0"
"\0"
- /* _mesa_function_pool[32345]: SamplerParameterIuiv (will be remapped) */
+ /* _mesa_function_pool[32361]: SamplerParameterIuiv (will be remapped) */
"iip\0"
"glSamplerParameterIuiv\0"
"\0"
- /* _mesa_function_pool[32373]: TexCoordPointervINTEL (dynamic) */
+ /* _mesa_function_pool[32389]: TexCoordPointervINTEL (dynamic) */
"iip\0"
"glTexCoordPointervINTEL\0"
"\0"
- /* _mesa_function_pool[32402]: DeleteBuffersARB (will be remapped) */
+ /* _mesa_function_pool[32418]: DeleteBuffersARB (will be remapped) */
"ip\0"
"glDeleteBuffers\0"
"glDeleteBuffersARB\0"
"\0"
- /* _mesa_function_pool[32441]: PixelTransformParameterfvEXT (dynamic) */
+ /* _mesa_function_pool[32457]: PixelTransformParameterfvEXT (dynamic) */
"iip\0"
"glPixelTransformParameterfvEXT\0"
"\0"
- /* _mesa_function_pool[32477]: PrimitiveRestartNV (will be remapped) */
+ /* _mesa_function_pool[32493]: PrimitiveRestartNV (will be remapped) */
"\0"
"glPrimitiveRestartNV\0"
"\0"
- /* _mesa_function_pool[32500]: WindowPos4fvMESA (will be remapped) */
+ /* _mesa_function_pool[32516]: WindowPos4fvMESA (will be remapped) */
"p\0"
"glWindowPos4fvMESA\0"
"\0"
- /* _mesa_function_pool[32522]: GetPixelMapuiv (offset 272) */
+ /* _mesa_function_pool[32538]: GetPixelMapuiv (offset 272) */
"ip\0"
"glGetPixelMapuiv\0"
"\0"
- /* _mesa_function_pool[32543]: Rectf (offset 88) */
+ /* _mesa_function_pool[32559]: Rectf (offset 88) */
"ffff\0"
"glRectf\0"
"\0"
- /* _mesa_function_pool[32557]: VertexAttrib1sNV (will be remapped) */
+ /* _mesa_function_pool[32573]: VertexAttrib1sNV (will be remapped) */
"ii\0"
"glVertexAttrib1sNV\0"
"\0"
- /* _mesa_function_pool[32580]: Indexfv (offset 47) */
+ /* _mesa_function_pool[32596]: Indexfv (offset 47) */
"p\0"
"glIndexfv\0"
"\0"
- /* _mesa_function_pool[32593]: ColorP3uiv (will be remapped) */
+ /* _mesa_function_pool[32609]: ColorP3uiv (will be remapped) */
"ip\0"
"glColorP3uiv\0"
"\0"
- /* _mesa_function_pool[32610]: SecondaryColor3svEXT (will be remapped) */
+ /* _mesa_function_pool[32626]: SecondaryColor3svEXT (will be remapped) */
"p\0"
"glSecondaryColor3sv\0"
"glSecondaryColor3svEXT\0"
"\0"
- /* _mesa_function_pool[32656]: LoadTransposeMatrixfARB (will be remapped) */
+ /* _mesa_function_pool[32672]: LoadTransposeMatrixfARB (will be remapped) */
"p\0"
"glLoadTransposeMatrixf\0"
"glLoadTransposeMatrixfARB\0"
"\0"
- /* _mesa_function_pool[32708]: GetPointerv (offset 329) */
+ /* _mesa_function_pool[32724]: GetPointerv (offset 329) */
"ip\0"
"glGetPointerv\0"
"glGetPointervEXT\0"
"\0"
- /* _mesa_function_pool[32743]: Tangent3bEXT (dynamic) */
+ /* _mesa_function_pool[32759]: Tangent3bEXT (dynamic) */
"iii\0"
"glTangent3bEXT\0"
"\0"
- /* _mesa_function_pool[32763]: CombinerParameterfNV (will be remapped) */
+ /* _mesa_function_pool[32779]: CombinerParameterfNV (will be remapped) */
"if\0"
"glCombinerParameterfNV\0"
"\0"
- /* _mesa_function_pool[32790]: IndexMask (offset 212) */
+ /* _mesa_function_pool[32806]: IndexMask (offset 212) */
"i\0"
"glIndexMask\0"
"\0"
- /* _mesa_function_pool[32805]: BindProgramNV (will be remapped) */
+ /* _mesa_function_pool[32821]: BindProgramNV (will be remapped) */
"ii\0"
"glBindProgramARB\0"
"glBindProgramNV\0"
"\0"
- /* _mesa_function_pool[32842]: VertexAttrib4svARB (will be remapped) */
+ /* _mesa_function_pool[32858]: VertexAttrib4svARB (will be remapped) */
"ip\0"
"glVertexAttrib4sv\0"
"glVertexAttrib4svARB\0"
"\0"
- /* _mesa_function_pool[32885]: GetFloatv (offset 262) */
+ /* _mesa_function_pool[32901]: GetFloatv (offset 262) */
"ip\0"
"glGetFloatv\0"
"\0"
- /* _mesa_function_pool[32901]: CreateDebugObjectMESA (dynamic) */
+ /* _mesa_function_pool[32917]: CreateDebugObjectMESA (dynamic) */
"\0"
"glCreateDebugObjectMESA\0"
"\0"
- /* _mesa_function_pool[32927]: GetShaderiv (will be remapped) */
+ /* _mesa_function_pool[32943]: GetShaderiv (will be remapped) */
"iip\0"
"glGetShaderiv\0"
"\0"
- /* _mesa_function_pool[32946]: ClientWaitSync (will be remapped) */
+ /* _mesa_function_pool[32962]: ClientWaitSync (will be remapped) */
"iii\0"
"glClientWaitSync\0"
"\0"
- /* _mesa_function_pool[32968]: TexCoord4s (offset 124) */
+ /* _mesa_function_pool[32984]: TexCoord4s (offset 124) */
"iiii\0"
"glTexCoord4s\0"
"\0"
- /* _mesa_function_pool[32987]: TexCoord3sv (offset 117) */
+ /* _mesa_function_pool[33003]: TexCoord3sv (offset 117) */
"p\0"
"glTexCoord3sv\0"
"\0"
- /* _mesa_function_pool[33004]: BindFragmentShaderATI (will be remapped) */
+ /* _mesa_function_pool[33020]: BindFragmentShaderATI (will be remapped) */
"i\0"
"glBindFragmentShaderATI\0"
"\0"
- /* _mesa_function_pool[33031]: PopAttrib (offset 218) */
+ /* _mesa_function_pool[33047]: PopAttrib (offset 218) */
"\0"
"glPopAttrib\0"
"\0"
- /* _mesa_function_pool[33045]: Fogfv (offset 154) */
+ /* _mesa_function_pool[33061]: Fogfv (offset 154) */
"ip\0"
"glFogfv\0"
"\0"
- /* _mesa_function_pool[33057]: UnmapBufferARB (will be remapped) */
+ /* _mesa_function_pool[33073]: UnmapBufferARB (will be remapped) */
"i\0"
"glUnmapBuffer\0"
"glUnmapBufferARB\0"
"\0"
- /* _mesa_function_pool[33091]: InitNames (offset 197) */
+ /* _mesa_function_pool[33107]: InitNames (offset 197) */
"\0"
"glInitNames\0"
"\0"
- /* _mesa_function_pool[33105]: Normal3sv (offset 61) */
+ /* _mesa_function_pool[33121]: Normal3sv (offset 61) */
"p\0"
"glNormal3sv\0"
"\0"
- /* _mesa_function_pool[33120]: Minmax (offset 368) */
+ /* _mesa_function_pool[33136]: Minmax (offset 368) */
"iii\0"
"glMinmax\0"
"glMinmaxEXT\0"
"\0"
- /* _mesa_function_pool[33146]: TexCoord4d (offset 118) */
+ /* _mesa_function_pool[33162]: TexCoord4d (offset 118) */
"dddd\0"
"glTexCoord4d\0"
"\0"
- /* _mesa_function_pool[33165]: DeformationMap3dSGIX (dynamic) */
+ /* _mesa_function_pool[33181]: DeformationMap3dSGIX (dynamic) */
"iddiiddiiddiip\0"
"glDeformationMap3dSGIX\0"
"\0"
- /* _mesa_function_pool[33204]: TexCoord4f (offset 120) */
+ /* _mesa_function_pool[33220]: TexCoord4f (offset 120) */
"ffff\0"
"glTexCoord4f\0"
"\0"
- /* _mesa_function_pool[33223]: FogCoorddvEXT (will be remapped) */
+ /* _mesa_function_pool[33239]: FogCoorddvEXT (will be remapped) */
"p\0"
"glFogCoorddv\0"
"glFogCoorddvEXT\0"
"\0"
- /* _mesa_function_pool[33255]: FinishTextureSUNX (dynamic) */
+ /* _mesa_function_pool[33271]: FinishTextureSUNX (dynamic) */
"\0"
"glFinishTextureSUNX\0"
"\0"
- /* _mesa_function_pool[33277]: GetFragmentLightfvSGIX (dynamic) */
+ /* _mesa_function_pool[33293]: GetFragmentLightfvSGIX (dynamic) */
"iip\0"
"glGetFragmentLightfvSGIX\0"
"\0"
- /* _mesa_function_pool[33307]: Binormal3fvEXT (dynamic) */
+ /* _mesa_function_pool[33323]: Binormal3fvEXT (dynamic) */
"p\0"
"glBinormal3fvEXT\0"
"\0"
- /* _mesa_function_pool[33327]: GetBooleanv (offset 258) */
+ /* _mesa_function_pool[33343]: GetBooleanv (offset 258) */
"ip\0"
"glGetBooleanv\0"
"\0"
- /* _mesa_function_pool[33345]: ColorFragmentOp3ATI (will be remapped) */
+ /* _mesa_function_pool[33361]: ColorFragmentOp3ATI (will be remapped) */
"iiiiiiiiiiiii\0"
"glColorFragmentOp3ATI\0"
"\0"
- /* _mesa_function_pool[33382]: Hint (offset 158) */
+ /* _mesa_function_pool[33398]: Hint (offset 158) */
"ii\0"
"glHint\0"
"\0"
- /* _mesa_function_pool[33393]: Color4dv (offset 28) */
+ /* _mesa_function_pool[33409]: Color4dv (offset 28) */
"p\0"
"glColor4dv\0"
"\0"
- /* _mesa_function_pool[33407]: VertexAttrib2svARB (will be remapped) */
+ /* _mesa_function_pool[33423]: VertexAttrib2svARB (will be remapped) */
"ip\0"
"glVertexAttrib2sv\0"
"glVertexAttrib2svARB\0"
"\0"
- /* _mesa_function_pool[33450]: AreProgramsResidentNV (will be remapped) */
+ /* _mesa_function_pool[33466]: AreProgramsResidentNV (will be remapped) */
"ipp\0"
"glAreProgramsResidentNV\0"
"\0"
- /* _mesa_function_pool[33479]: WindowPos3svMESA (will be remapped) */
+ /* _mesa_function_pool[33495]: WindowPos3svMESA (will be remapped) */
"p\0"
"glWindowPos3sv\0"
"glWindowPos3svARB\0"
"glWindowPos3svMESA\0"
"\0"
- /* _mesa_function_pool[33534]: CopyColorSubTable (offset 347) */
+ /* _mesa_function_pool[33550]: CopyColorSubTable (offset 347) */
"iiiii\0"
"glCopyColorSubTable\0"
"glCopyColorSubTableEXT\0"
"\0"
- /* _mesa_function_pool[33584]: WeightdvARB (dynamic) */
+ /* _mesa_function_pool[33600]: WeightdvARB (dynamic) */
"ip\0"
"glWeightdvARB\0"
"\0"
- /* _mesa_function_pool[33602]: DeleteRenderbuffersEXT (will be remapped) */
+ /* _mesa_function_pool[33618]: DeleteRenderbuffersEXT (will be remapped) */
"ip\0"
"glDeleteRenderbuffers\0"
"glDeleteRenderbuffersEXT\0"
"\0"
- /* _mesa_function_pool[33653]: VertexAttrib4NubvARB (will be remapped) */
+ /* _mesa_function_pool[33669]: VertexAttrib4NubvARB (will be remapped) */
"ip\0"
"glVertexAttrib4Nubv\0"
"glVertexAttrib4NubvARB\0"
"\0"
- /* _mesa_function_pool[33700]: VertexAttrib3dvNV (will be remapped) */
+ /* _mesa_function_pool[33716]: VertexAttrib3dvNV (will be remapped) */
"ip\0"
"glVertexAttrib3dvNV\0"
"\0"
- /* _mesa_function_pool[33724]: GetObjectParameterfvARB (will be remapped) */
+ /* _mesa_function_pool[33740]: GetObjectParameterfvARB (will be remapped) */
"iip\0"
"glGetObjectParameterfvARB\0"
"\0"
- /* _mesa_function_pool[33755]: Vertex4iv (offset 147) */
+ /* _mesa_function_pool[33771]: Vertex4iv (offset 147) */
"p\0"
"glVertex4iv\0"
"\0"
- /* _mesa_function_pool[33770]: GetProgramEnvParameterdvARB (will be remapped) */
+ /* _mesa_function_pool[33786]: GetProgramEnvParameterdvARB (will be remapped) */
"iip\0"
"glGetProgramEnvParameterdvARB\0"
"\0"
- /* _mesa_function_pool[33805]: TexCoord4dv (offset 119) */
+ /* _mesa_function_pool[33821]: TexCoord4dv (offset 119) */
"p\0"
"glTexCoord4dv\0"
"\0"
- /* _mesa_function_pool[33822]: LockArraysEXT (will be remapped) */
+ /* _mesa_function_pool[33838]: LockArraysEXT (will be remapped) */
"ii\0"
"glLockArraysEXT\0"
"\0"
- /* _mesa_function_pool[33842]: Begin (offset 7) */
+ /* _mesa_function_pool[33858]: Begin (offset 7) */
"i\0"
"glBegin\0"
"\0"
- /* _mesa_function_pool[33853]: LightModeli (offset 165) */
+ /* _mesa_function_pool[33869]: LightModeli (offset 165) */
"ii\0"
"glLightModeli\0"
"\0"
- /* _mesa_function_pool[33871]: VertexAttribI4ivEXT (will be remapped) */
+ /* _mesa_function_pool[33887]: VertexAttribI4ivEXT (will be remapped) */
"ip\0"
"glVertexAttribI4ivEXT\0"
"glVertexAttribI4iv\0"
"\0"
- /* _mesa_function_pool[33916]: Rectfv (offset 89) */
+ /* _mesa_function_pool[33932]: Rectfv (offset 89) */
"pp\0"
"glRectfv\0"
"\0"
- /* _mesa_function_pool[33929]: LightModelf (offset 163) */
+ /* _mesa_function_pool[33945]: LightModelf (offset 163) */
"if\0"
"glLightModelf\0"
"\0"
- /* _mesa_function_pool[33947]: GetTexParameterfv (offset 282) */
+ /* _mesa_function_pool[33963]: GetTexParameterfv (offset 282) */
"iip\0"
"glGetTexParameterfv\0"
"\0"
- /* _mesa_function_pool[33972]: GetLightfv (offset 264) */
+ /* _mesa_function_pool[33988]: GetLightfv (offset 264) */
"iip\0"
"glGetLightfv\0"
"\0"
- /* _mesa_function_pool[33990]: PixelTransformParameterivEXT (dynamic) */
+ /* _mesa_function_pool[34006]: PixelTransformParameterivEXT (dynamic) */
"iip\0"
"glPixelTransformParameterivEXT\0"
"\0"
- /* _mesa_function_pool[34026]: BinormalPointerEXT (dynamic) */
+ /* _mesa_function_pool[34042]: BinormalPointerEXT (dynamic) */
"iip\0"
"glBinormalPointerEXT\0"
"\0"
- /* _mesa_function_pool[34052]: VertexAttrib1dNV (will be remapped) */
+ /* _mesa_function_pool[34068]: VertexAttrib1dNV (will be remapped) */
"id\0"
"glVertexAttrib1dNV\0"
"\0"
- /* _mesa_function_pool[34075]: GetCombinerInputParameterivNV (will be remapped) */
+ /* _mesa_function_pool[34091]: GetCombinerInputParameterivNV (will be remapped) */
"iiiip\0"
"glGetCombinerInputParameterivNV\0"
"\0"
- /* _mesa_function_pool[34114]: Disable (offset 214) */
+ /* _mesa_function_pool[34130]: Disable (offset 214) */
"i\0"
"glDisable\0"
"\0"
- /* _mesa_function_pool[34127]: MultiTexCoord2fvARB (offset 387) */
+ /* _mesa_function_pool[34143]: MultiTexCoord2fvARB (offset 387) */
"ip\0"
"glMultiTexCoord2fv\0"
"glMultiTexCoord2fvARB\0"
"\0"
- /* _mesa_function_pool[34172]: GetRenderbufferParameterivEXT (will be remapped) */
+ /* _mesa_function_pool[34188]: GetRenderbufferParameterivEXT (will be remapped) */
"iip\0"
"glGetRenderbufferParameteriv\0"
"glGetRenderbufferParameterivEXT\0"
"\0"
- /* _mesa_function_pool[34238]: CombinerParameterivNV (will be remapped) */
+ /* _mesa_function_pool[34254]: CombinerParameterivNV (will be remapped) */
"ip\0"
"glCombinerParameterivNV\0"
"\0"
- /* _mesa_function_pool[34266]: GenFragmentShadersATI (will be remapped) */
+ /* _mesa_function_pool[34282]: GenFragmentShadersATI (will be remapped) */
"i\0"
"glGenFragmentShadersATI\0"
"\0"
- /* _mesa_function_pool[34293]: DrawArrays (offset 310) */
+ /* _mesa_function_pool[34309]: DrawArrays (offset 310) */
"iii\0"
"glDrawArrays\0"
"glDrawArraysEXT\0"
"\0"
- /* _mesa_function_pool[34327]: WeightuivARB (dynamic) */
+ /* _mesa_function_pool[34343]: WeightuivARB (dynamic) */
"ip\0"
"glWeightuivARB\0"
"\0"
- /* _mesa_function_pool[34346]: GetVertexAttribIivEXT (will be remapped) */
+ /* _mesa_function_pool[34362]: GetVertexAttribIivEXT (will be remapped) */
"iip\0"
"glGetVertexAttribIivEXT\0"
"glGetVertexAttribIiv\0"
"\0"
- /* _mesa_function_pool[34396]: VertexAttrib2sARB (will be remapped) */
+ /* _mesa_function_pool[34412]: VertexAttrib2sARB (will be remapped) */
"iii\0"
"glVertexAttrib2s\0"
"glVertexAttrib2sARB\0"
"\0"
- /* _mesa_function_pool[34438]: GetnTexImageARB (will be remapped) */
+ /* _mesa_function_pool[34454]: GetnTexImageARB (will be remapped) */
"iiiiip\0"
"glGetnTexImageARB\0"
"\0"
- /* _mesa_function_pool[34464]: ColorMask (offset 210) */
+ /* _mesa_function_pool[34480]: ColorMask (offset 210) */
"iiii\0"
"glColorMask\0"
"\0"
- /* _mesa_function_pool[34482]: GenAsyncMarkersSGIX (dynamic) */
+ /* _mesa_function_pool[34498]: GenAsyncMarkersSGIX (dynamic) */
"i\0"
"glGenAsyncMarkersSGIX\0"
"\0"
- /* _mesa_function_pool[34507]: Tangent3svEXT (dynamic) */
+ /* _mesa_function_pool[34523]: Tangent3svEXT (dynamic) */
"p\0"
"glTangent3svEXT\0"
"\0"
- /* _mesa_function_pool[34526]: GetListParameterivSGIX (dynamic) */
+ /* _mesa_function_pool[34542]: GetListParameterivSGIX (dynamic) */
"iip\0"
"glGetListParameterivSGIX\0"
"\0"
- /* _mesa_function_pool[34556]: BindBufferARB (will be remapped) */
+ /* _mesa_function_pool[34572]: BindBufferARB (will be remapped) */
"ii\0"
"glBindBuffer\0"
"glBindBufferARB\0"
"\0"
- /* _mesa_function_pool[34589]: GetInfoLogARB (will be remapped) */
+ /* _mesa_function_pool[34605]: GetInfoLogARB (will be remapped) */
"iipp\0"
"glGetInfoLogARB\0"
"\0"
- /* _mesa_function_pool[34611]: RasterPos4iv (offset 83) */
+ /* _mesa_function_pool[34627]: RasterPos4iv (offset 83) */
"p\0"
"glRasterPos4iv\0"
"\0"
- /* _mesa_function_pool[34629]: Enable (offset 215) */
+ /* _mesa_function_pool[34645]: Enable (offset 215) */
"i\0"
"glEnable\0"
"\0"
- /* _mesa_function_pool[34641]: LineStipple (offset 167) */
+ /* _mesa_function_pool[34657]: LineStipple (offset 167) */
"ii\0"
"glLineStipple\0"
"\0"
- /* _mesa_function_pool[34659]: VertexAttribs4svNV (will be remapped) */
+ /* _mesa_function_pool[34675]: VertexAttribs4svNV (will be remapped) */
"iip\0"
"glVertexAttribs4svNV\0"
"\0"
- /* _mesa_function_pool[34685]: EdgeFlagPointerListIBM (dynamic) */
+ /* _mesa_function_pool[34701]: EdgeFlagPointerListIBM (dynamic) */
"ipi\0"
"glEdgeFlagPointerListIBM\0"
"\0"
- /* _mesa_function_pool[34715]: UniformMatrix3x2fv (will be remapped) */
+ /* _mesa_function_pool[34731]: UniformMatrix3x2fv (will be remapped) */
"iiip\0"
"glUniformMatrix3x2fv\0"
"\0"
- /* _mesa_function_pool[34742]: GetMinmaxParameterfv (offset 365) */
+ /* _mesa_function_pool[34758]: GetMinmaxParameterfv (offset 365) */
"iip\0"
"glGetMinmaxParameterfv\0"
"glGetMinmaxParameterfvEXT\0"
"\0"
- /* _mesa_function_pool[34796]: VertexAttrib1fvARB (will be remapped) */
+ /* _mesa_function_pool[34812]: VertexAttrib1fvARB (will be remapped) */
"ip\0"
"glVertexAttrib1fv\0"
"glVertexAttrib1fvARB\0"
"\0"
- /* _mesa_function_pool[34839]: GenBuffersARB (will be remapped) */
+ /* _mesa_function_pool[34855]: GenBuffersARB (will be remapped) */
"ip\0"
"glGenBuffers\0"
"glGenBuffersARB\0"
"\0"
- /* _mesa_function_pool[34872]: VertexAttribs1svNV (will be remapped) */
+ /* _mesa_function_pool[34888]: VertexAttribs1svNV (will be remapped) */
"iip\0"
"glVertexAttribs1svNV\0"
"\0"
- /* _mesa_function_pool[34898]: Vertex3fv (offset 137) */
+ /* _mesa_function_pool[34914]: Vertex3fv (offset 137) */
"p\0"
"glVertex3fv\0"
"\0"
- /* _mesa_function_pool[34913]: GetTexBumpParameterivATI (will be remapped) */
+ /* _mesa_function_pool[34929]: GetTexBumpParameterivATI (will be remapped) */
"ip\0"
"glGetTexBumpParameterivATI\0"
"\0"
- /* _mesa_function_pool[34944]: Binormal3bEXT (dynamic) */
+ /* _mesa_function_pool[34960]: Binormal3bEXT (dynamic) */
"iii\0"
"glBinormal3bEXT\0"
"\0"
- /* _mesa_function_pool[34965]: FragmentMaterialivSGIX (dynamic) */
+ /* _mesa_function_pool[34981]: FragmentMaterialivSGIX (dynamic) */
"iip\0"
"glFragmentMaterialivSGIX\0"
"\0"
- /* _mesa_function_pool[34995]: IsRenderbufferEXT (will be remapped) */
+ /* _mesa_function_pool[35011]: IsRenderbufferEXT (will be remapped) */
"i\0"
"glIsRenderbuffer\0"
"glIsRenderbufferEXT\0"
"\0"
- /* _mesa_function_pool[35035]: GenProgramsNV (will be remapped) */
+ /* _mesa_function_pool[35051]: GenProgramsNV (will be remapped) */
"ip\0"
"glGenProgramsARB\0"
"glGenProgramsNV\0"
"\0"
- /* _mesa_function_pool[35072]: VertexAttrib4dvNV (will be remapped) */
+ /* _mesa_function_pool[35088]: VertexAttrib4dvNV (will be remapped) */
"ip\0"
"glVertexAttrib4dvNV\0"
"\0"
- /* _mesa_function_pool[35096]: EndFragmentShaderATI (will be remapped) */
+ /* _mesa_function_pool[35112]: EndFragmentShaderATI (will be remapped) */
"\0"
"glEndFragmentShaderATI\0"
"\0"
- /* _mesa_function_pool[35121]: Binormal3iEXT (dynamic) */
+ /* _mesa_function_pool[35137]: Binormal3iEXT (dynamic) */
"iii\0"
"glBinormal3iEXT\0"
"\0"
- /* _mesa_function_pool[35142]: WindowPos2fMESA (will be remapped) */
+ /* _mesa_function_pool[35158]: WindowPos2fMESA (will be remapped) */
"ff\0"
"glWindowPos2f\0"
"glWindowPos2fARB\0"
@@ -5097,7 +5098,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 5288, GetProgramInfoLog_remap_index },
{ 425, GetProgramiv_remap_index },
{ 7178, GetShaderInfoLog_remap_index },
- { 32927, GetShaderiv_remap_index },
+ { 32943, GetShaderiv_remap_index },
{ 14151, IsProgram_remap_index },
{ 13052, IsShader_remap_index },
{ 10732, StencilFuncSeparate_remap_index },
@@ -5105,14 +5106,14 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 8243, StencilOpSeparate_remap_index },
{ 23832, UniformMatrix2x3fv_remap_index },
{ 3040, UniformMatrix2x4fv_remap_index },
- { 34715, UniformMatrix3x2fv_remap_index },
- { 32227, UniformMatrix3x4fv_remap_index },
+ { 34731, UniformMatrix3x2fv_remap_index },
+ { 32243, UniformMatrix3x4fv_remap_index },
{ 17280, UniformMatrix4x2fv_remap_index },
{ 3531, UniformMatrix4x3fv_remap_index },
{ 5511, ClampColor_remap_index },
{ 19232, ClearBufferfi_remap_index },
{ 18648, ClearBufferfv_remap_index },
- { 31182, ClearBufferiv_remap_index },
+ { 31198, ClearBufferiv_remap_index },
{ 14356, ClearBufferuiv_remap_index },
{ 21354, GetStringi_remap_index },
{ 2981, TexBuffer_remap_index },
@@ -5121,7 +5122,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 10832, GetInteger64i_v_remap_index },
{ 24912, VertexAttribDivisor_remap_index },
{ 10620, LoadTransposeMatrixdARB_remap_index },
- { 32656, LoadTransposeMatrixfARB_remap_index },
+ { 32672, LoadTransposeMatrixfARB_remap_index },
{ 6196, MultTransposeMatrixdARB_remap_index },
{ 25278, MultTransposeMatrixfARB_remap_index },
{ 236, SampleCoverageARB_remap_index },
@@ -5133,8 +5134,8 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 21776, CompressedTexSubImage3DARB_remap_index },
{ 30288, GetCompressedTexImageARB_remap_index },
{ 4123, DisableVertexAttribArrayARB_remap_index },
- { 31792, EnableVertexAttribArrayARB_remap_index },
- { 33770, GetProgramEnvParameterdvARB_remap_index },
+ { 31808, EnableVertexAttribArrayARB_remap_index },
+ { 33786, GetProgramEnvParameterdvARB_remap_index },
{ 25158, GetProgramEnvParameterfvARB_remap_index },
{ 29205, GetProgramLocalParameterdvARB_remap_index },
{ 8719, GetProgramLocalParameterfvARB_remap_index },
@@ -5149,21 +5150,21 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 9594, ProgramEnvParameter4fvARB_remap_index },
{ 4292, ProgramLocalParameter4dARB_remap_index },
{ 13861, ProgramLocalParameter4dvARB_remap_index },
- { 31203, ProgramLocalParameter4fARB_remap_index },
+ { 31219, ProgramLocalParameter4fARB_remap_index },
{ 27568, ProgramLocalParameter4fvARB_remap_index },
{ 30042, ProgramStringARB_remap_index },
{ 21085, VertexAttrib1dARB_remap_index },
{ 16689, VertexAttrib1dvARB_remap_index },
{ 4488, VertexAttrib1fARB_remap_index },
- { 34796, VertexAttrib1fvARB_remap_index },
+ { 34812, VertexAttrib1fvARB_remap_index },
{ 7769, VertexAttrib1sARB_remap_index },
{ 2361, VertexAttrib1svARB_remap_index },
{ 16102, VertexAttrib2dARB_remap_index },
{ 18669, VertexAttrib2dvARB_remap_index },
{ 1693, VertexAttrib2fARB_remap_index },
{ 18782, VertexAttrib2fvARB_remap_index },
- { 34396, VertexAttrib2sARB_remap_index },
- { 33407, VertexAttrib2svARB_remap_index },
+ { 34412, VertexAttrib2sARB_remap_index },
+ { 33423, VertexAttrib2svARB_remap_index },
{ 12036, VertexAttrib3dARB_remap_index },
{ 9261, VertexAttrib3dvARB_remap_index },
{ 1780, VertexAttrib3fARB_remap_index },
@@ -5174,7 +5175,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 19055, VertexAttrib4NivARB_remap_index },
{ 24104, VertexAttrib4NsvARB_remap_index },
{ 25110, VertexAttrib4NubARB_remap_index },
- { 33653, VertexAttrib4NubvARB_remap_index },
+ { 33669, VertexAttrib4NubvARB_remap_index },
{ 20442, VertexAttrib4NuivARB_remap_index },
{ 3361, VertexAttrib4NusvARB_remap_index },
{ 11625, VertexAttrib4bvARB_remap_index },
@@ -5184,22 +5185,22 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 12594, VertexAttrib4fvARB_remap_index },
{ 10975, VertexAttrib4ivARB_remap_index },
{ 18462, VertexAttrib4sARB_remap_index },
- { 32842, VertexAttrib4svARB_remap_index },
+ { 32858, VertexAttrib4svARB_remap_index },
{ 17751, VertexAttrib4ubvARB_remap_index },
- { 32116, VertexAttrib4uivARB_remap_index },
+ { 32132, VertexAttrib4uivARB_remap_index },
{ 21524, VertexAttrib4usvARB_remap_index },
{ 23627, VertexAttribPointerARB_remap_index },
- { 34556, BindBufferARB_remap_index },
+ { 34572, BindBufferARB_remap_index },
{ 7476, BufferDataARB_remap_index },
{ 1531, BufferSubDataARB_remap_index },
- { 32402, DeleteBuffersARB_remap_index },
- { 34839, GenBuffersARB_remap_index },
+ { 32418, DeleteBuffersARB_remap_index },
+ { 34855, GenBuffersARB_remap_index },
{ 18825, GetBufferParameterivARB_remap_index },
{ 17898, GetBufferPointervARB_remap_index },
{ 1484, GetBufferSubDataARB_remap_index },
- { 32064, IsBufferARB_remap_index },
+ { 32080, IsBufferARB_remap_index },
{ 28052, MapBufferARB_remap_index },
- { 33057, UnmapBufferARB_remap_index },
+ { 33073, UnmapBufferARB_remap_index },
{ 332, BeginQueryARB_remap_index },
{ 21180, DeleteQueriesARB_remap_index },
{ 12913, EndQueryARB_remap_index },
@@ -5217,8 +5218,8 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 12658, GetActiveUniformARB_remap_index },
{ 10086, GetAttachedObjectsARB_remap_index },
{ 10393, GetHandleARB_remap_index },
- { 34589, GetInfoLogARB_remap_index },
- { 33724, GetObjectParameterfvARB_remap_index },
+ { 34605, GetInfoLogARB_remap_index },
+ { 33740, GetObjectParameterfvARB_remap_index },
{ 29079, GetObjectParameterivARB_remap_index },
{ 30525, GetShaderSourceARB_remap_index },
{ 29749, GetUniformLocationARB_remap_index },
@@ -5227,7 +5228,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 21569, LinkProgramARB_remap_index },
{ 21627, ShaderSourceARB_remap_index },
{ 8143, Uniform1fARB_remap_index },
- { 31454, Uniform1fvARB_remap_index },
+ { 31470, Uniform1fvARB_remap_index },
{ 23575, Uniform1iARB_remap_index },
{ 22424, Uniform1ivARB_remap_index },
{ 2310, Uniform2fARB_remap_index },
@@ -5264,8 +5265,8 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 29423, TexBufferARB_remap_index },
{ 17418, BindVertexArray_remap_index },
{ 15594, GenVertexArrays_remap_index },
- { 31994, CopyBufferSubData_remap_index },
- { 32946, ClientWaitSync_remap_index },
+ { 32010, CopyBufferSubData_remap_index },
+ { 32962, ClientWaitSync_remap_index },
{ 2802, DeleteSync_remap_index },
{ 7810, FenceSync_remap_index },
{ 16161, GetInteger64v_remap_index },
@@ -5274,7 +5275,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 10017, WaitSync_remap_index },
{ 4091, DrawElementsBaseVertex_remap_index },
{ 19748, DrawElementsInstancedBaseVertex_remap_index },
- { 32306, DrawRangeElementsBaseVertex_remap_index },
+ { 32322, DrawRangeElementsBaseVertex_remap_index },
{ 28083, MultiDrawElementsBaseVertex_remap_index },
{ 17684, BlendEquationSeparateiARB_remap_index },
{ 18918, BlendEquationiARB_remap_index },
@@ -5289,24 +5290,24 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 27191, GetSamplerParameteriv_remap_index },
{ 15139, IsSampler_remap_index },
{ 17371, SamplerParameterIiv_remap_index },
- { 32345, SamplerParameterIuiv_remap_index },
+ { 32361, SamplerParameterIuiv_remap_index },
{ 23884, SamplerParameterf_remap_index },
{ 17545, SamplerParameterfv_remap_index },
{ 23859, SamplerParameteri_remap_index },
{ 19294, SamplerParameteriv_remap_index },
{ 20101, ColorP3ui_remap_index },
- { 32593, ColorP3uiv_remap_index },
+ { 32609, ColorP3uiv_remap_index },
{ 22530, ColorP4ui_remap_index },
{ 4234, ColorP4uiv_remap_index },
{ 26733, MultiTexCoordP1ui_remap_index },
{ 13349, MultiTexCoordP1uiv_remap_index },
{ 1668, MultiTexCoordP2ui_remap_index },
- { 31766, MultiTexCoordP2uiv_remap_index },
+ { 31782, MultiTexCoordP2uiv_remap_index },
{ 14751, MultiTexCoordP3ui_remap_index },
{ 11051, MultiTexCoordP3uiv_remap_index },
{ 23428, MultiTexCoordP4ui_remap_index },
{ 3953, MultiTexCoordP4uiv_remap_index },
- { 31412, NormalP3ui_remap_index },
+ { 31428, NormalP3ui_remap_index },
{ 20277, NormalP3uiv_remap_index },
{ 26436, SecondaryColorP3ui_remap_index },
{ 20295, SecondaryColorP3uiv_remap_index },
@@ -5320,7 +5321,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 5780, TexCoordP4uiv_remap_index },
{ 10502, VertexAttribP1ui_remap_index },
{ 14938, VertexAttribP1uiv_remap_index },
- { 31429, VertexAttribP2ui_remap_index },
+ { 31445, VertexAttribP2ui_remap_index },
{ 5572, VertexAttribP2uiv_remap_index },
{ 3426, VertexAttribP3ui_remap_index },
{ 21036, VertexAttribP3uiv_remap_index },
@@ -5358,7 +5359,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 3153, GetnPixelMapusvARB_remap_index },
{ 1364, GetnPolygonStippleARB_remap_index },
{ 22614, GetnSeparableFilterARB_remap_index },
- { 34438, GetnTexImageARB_remap_index },
+ { 34454, GetnTexImageARB_remap_index },
{ 19723, GetnUniformdvARB_remap_index },
{ 4905, GetnUniformfvARB_remap_index },
{ 10527, GetnUniformivARB_remap_index },
@@ -5381,7 +5382,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 7599, VertexPointerEXT_remap_index },
{ 3867, PointParameterfEXT_remap_index },
{ 8450, PointParameterfvEXT_remap_index },
- { 33822, LockArraysEXT_remap_index },
+ { 33838, LockArraysEXT_remap_index },
{ 15854, UnlockArraysEXT_remap_index },
{ 1272, SecondaryColor3bEXT_remap_index },
{ 8643, SecondaryColor3bvEXT_remap_index },
@@ -5392,7 +5393,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 490, SecondaryColor3iEXT_remap_index },
{ 17136, SecondaryColor3ivEXT_remap_index },
{ 10760, SecondaryColor3sEXT_remap_index },
- { 32610, SecondaryColor3svEXT_remap_index },
+ { 32626, SecondaryColor3svEXT_remap_index },
{ 28915, SecondaryColor3ubEXT_remap_index },
{ 22720, SecondaryColor3ubvEXT_remap_index },
{ 13716, SecondaryColor3uiEXT_remap_index },
@@ -5404,7 +5405,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 22359, MultiDrawElementsEXT_remap_index },
{ 22570, FogCoordPointerEXT_remap_index },
{ 4956, FogCoorddEXT_remap_index },
- { 33223, FogCoorddvEXT_remap_index },
+ { 33239, FogCoorddvEXT_remap_index },
{ 5073, FogCoordfEXT_remap_index },
{ 28838, FogCoordfvEXT_remap_index },
{ 12637, PixelTexGenSGIX_remap_index },
@@ -5413,13 +5414,13 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 5898, VertexArrayRangeNV_remap_index },
{ 29863, CombinerInputNV_remap_index },
{ 2232, CombinerOutputNV_remap_index },
- { 32763, CombinerParameterfNV_remap_index },
+ { 32779, CombinerParameterfNV_remap_index },
{ 5752, CombinerParameterfvNV_remap_index },
{ 23909, CombinerParameteriNV_remap_index },
- { 34238, CombinerParameterivNV_remap_index },
+ { 34254, CombinerParameterivNV_remap_index },
{ 7887, FinalCombinerInputNV_remap_index },
{ 1629, GetCombinerInputParameterfvNV_remap_index },
- { 34075, GetCombinerInputParameterivNV_remap_index },
+ { 34091, GetCombinerInputParameterivNV_remap_index },
{ 14712, GetCombinerOutputParameterfvNV_remap_index },
{ 14540, GetCombinerOutputParameterivNV_remap_index },
{ 7273, GetFinalCombinerInputParameterfvNV_remap_index },
@@ -5427,7 +5428,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 13327, ResizeBuffersMESA_remap_index },
{ 11863, WindowPos2dMESA_remap_index },
{ 1065, WindowPos2dvMESA_remap_index },
- { 35142, WindowPos2fMESA_remap_index },
+ { 35158, WindowPos2fMESA_remap_index },
{ 8588, WindowPos2fvMESA_remap_index },
{ 19366, WindowPos2iMESA_remap_index },
{ 21844, WindowPos2ivMESA_remap_index },
@@ -5438,14 +5439,14 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 536, WindowPos3fMESA_remap_index },
{ 15915, WindowPos3fvMESA_remap_index },
{ 25639, WindowPos3iMESA_remap_index },
- { 31939, WindowPos3ivMESA_remap_index },
+ { 31955, WindowPos3ivMESA_remap_index },
{ 20164, WindowPos3sMESA_remap_index },
- { 33479, WindowPos3svMESA_remap_index },
+ { 33495, WindowPos3svMESA_remap_index },
{ 11814, WindowPos4dMESA_remap_index },
{ 18142, WindowPos4dvMESA_remap_index },
{ 14842, WindowPos4fMESA_remap_index },
- { 32500, WindowPos4fvMESA_remap_index },
- { 32092, WindowPos4iMESA_remap_index },
+ { 32516, WindowPos4fvMESA_remap_index },
+ { 32108, WindowPos4iMESA_remap_index },
{ 13166, WindowPos4ivMESA_remap_index },
{ 20392, WindowPos4sMESA_remap_index },
{ 3451, WindowPos4svMESA_remap_index },
@@ -5458,11 +5459,11 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 8856, IsFenceNV_remap_index },
{ 14467, SetFenceNV_remap_index },
{ 4544, TestFenceNV_remap_index },
- { 33450, AreProgramsResidentNV_remap_index },
- { 32805, BindProgramNV_remap_index },
+ { 33466, AreProgramsResidentNV_remap_index },
+ { 32821, BindProgramNV_remap_index },
{ 27603, DeleteProgramsNV_remap_index },
{ 22938, ExecuteProgramNV_remap_index },
- { 35035, GenProgramsNV_remap_index },
+ { 35051, GenProgramsNV_remap_index },
{ 24938, GetProgramParameterdvNV_remap_index },
{ 11240, GetProgramParameterfvNV_remap_index },
{ 27986, GetProgramStringNV_remap_index },
@@ -5477,12 +5478,12 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 29539, ProgramParameters4dvNV_remap_index },
{ 25946, ProgramParameters4fvNV_remap_index },
{ 22148, RequestResidentProgramsNV_remap_index },
- { 32284, TrackMatrixNV_remap_index },
- { 34052, VertexAttrib1dNV_remap_index },
+ { 32300, TrackMatrixNV_remap_index },
+ { 34068, VertexAttrib1dNV_remap_index },
{ 14378, VertexAttrib1dvNV_remap_index },
{ 30144, VertexAttrib1fNV_remap_index },
{ 2589, VertexAttrib1fvNV_remap_index },
- { 32557, VertexAttrib1sNV_remap_index },
+ { 32573, VertexAttrib1sNV_remap_index },
{ 15988, VertexAttrib1svNV_remap_index },
{ 5264, VertexAttrib2dNV_remap_index },
{ 14271, VertexAttrib2dvNV_remap_index },
@@ -5491,13 +5492,13 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 6567, VertexAttrib2sNV_remap_index },
{ 20218, VertexAttrib2svNV_remap_index },
{ 12011, VertexAttrib3dNV_remap_index },
- { 33700, VertexAttrib3dvNV_remap_index },
+ { 33716, VertexAttrib3dvNV_remap_index },
{ 11026, VertexAttrib3fNV_remap_index },
{ 26338, VertexAttrib3fvNV_remap_index },
{ 23682, VertexAttrib3sNV_remap_index },
{ 25220, VertexAttrib3svNV_remap_index },
{ 30612, VertexAttrib4dNV_remap_index },
- { 35072, VertexAttrib4dvNV_remap_index },
+ { 35088, VertexAttrib4dvNV_remap_index },
{ 5692, VertexAttrib4fNV_remap_index },
{ 10062, VertexAttrib4fvNV_remap_index },
{ 28462, VertexAttrib4sNV_remap_index },
@@ -5507,32 +5508,32 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 23118, VertexAttribPointerNV_remap_index },
{ 2404, VertexAttribs1dvNV_remap_index },
{ 27868, VertexAttribs1fvNV_remap_index },
- { 34872, VertexAttribs1svNV_remap_index },
+ { 34888, VertexAttribs1svNV_remap_index },
{ 11077, VertexAttribs2dvNV_remap_index },
{ 26995, VertexAttribs2fvNV_remap_index },
{ 18738, VertexAttribs2svNV_remap_index },
{ 5800, VertexAttribs3dvNV_remap_index },
{ 2263, VertexAttribs3fvNV_remap_index },
- { 31661, VertexAttribs3svNV_remap_index },
+ { 31677, VertexAttribs3svNV_remap_index },
{ 28552, VertexAttribs4dvNV_remap_index },
{ 5872, VertexAttribs4fvNV_remap_index },
- { 34659, VertexAttribs4svNV_remap_index },
- { 31367, VertexAttribs4ubvNV_remap_index },
+ { 34675, VertexAttribs4svNV_remap_index },
+ { 31383, VertexAttribs4ubvNV_remap_index },
{ 28622, GetTexBumpParameterfvATI_remap_index },
- { 34913, GetTexBumpParameterivATI_remap_index },
+ { 34929, GetTexBumpParameterivATI_remap_index },
{ 19846, TexBumpParameterfvATI_remap_index },
{ 22019, TexBumpParameterivATI_remap_index },
{ 16552, AlphaFragmentOp1ATI_remap_index },
{ 27286, AlphaFragmentOp2ATI_remap_index },
{ 26254, AlphaFragmentOp3ATI_remap_index },
- { 31588, BeginFragmentShaderATI_remap_index },
- { 33004, BindFragmentShaderATI_remap_index },
+ { 31604, BeginFragmentShaderATI_remap_index },
+ { 33020, BindFragmentShaderATI_remap_index },
{ 25349, ColorFragmentOp1ATI_remap_index },
{ 4711, ColorFragmentOp2ATI_remap_index },
- { 33345, ColorFragmentOp3ATI_remap_index },
+ { 33361, ColorFragmentOp3ATI_remap_index },
{ 6038, DeleteFragmentShaderATI_remap_index },
- { 35096, EndFragmentShaderATI_remap_index },
- { 34266, GenFragmentShadersATI_remap_index },
+ { 35112, EndFragmentShaderATI_remap_index },
+ { 34282, GenFragmentShadersATI_remap_index },
{ 27149, PassTexCoordATI_remap_index },
{ 7579, SampleMapATI_remap_index },
{ 28733, SetFragmentShaderConstantATI_remap_index },
@@ -5550,14 +5551,14 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 9528, ProgramNamedParameter4fNV_remap_index },
{ 12502, ProgramNamedParameter4fvNV_remap_index },
{ 18053, PrimitiveRestartIndexNV_remap_index },
- { 32477, PrimitiveRestartNV_remap_index },
+ { 32493, PrimitiveRestartNV_remap_index },
{ 25925, DepthBoundsEXT_remap_index },
{ 1164, BlendEquationSeparateEXT_remap_index },
{ 15689, BindFramebufferEXT_remap_index },
{ 27379, BindRenderbufferEXT_remap_index },
{ 10309, CheckFramebufferStatusEXT_remap_index },
{ 24254, DeleteFramebuffersEXT_remap_index },
- { 33602, DeleteRenderbuffersEXT_remap_index },
+ { 33618, DeleteRenderbuffersEXT_remap_index },
{ 14295, FramebufferRenderbufferEXT_remap_index },
{ 14484, FramebufferTexture1DEXT_remap_index },
{ 12296, FramebufferTexture2DEXT_remap_index },
@@ -5566,9 +5567,9 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 18603, GenRenderbuffersEXT_remap_index },
{ 7315, GenerateMipmapEXT_remap_index },
{ 23211, GetFramebufferAttachmentParameterivEXT_remap_index },
- { 34172, GetRenderbufferParameterivEXT_remap_index },
+ { 34188, GetRenderbufferParameterivEXT_remap_index },
{ 21899, IsFramebufferEXT_remap_index },
- { 34995, IsRenderbufferEXT_remap_index },
+ { 35011, IsRenderbufferEXT_remap_index },
{ 8803, RenderbufferStorageEXT_remap_index },
{ 715, BlitFramebufferEXT_remap_index },
{ 15255, BufferParameteriAPPLE_remap_index },
@@ -5576,7 +5577,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 1912, BindFragDataLocationEXT_remap_index },
{ 26038, GetFragDataLocationEXT_remap_index },
{ 11355, GetUniformuivEXT_remap_index },
- { 34346, GetVertexAttribIivEXT_remap_index },
+ { 34362, GetVertexAttribIivEXT_remap_index },
{ 4561, GetVertexAttribIuivEXT_remap_index },
{ 12774, Uniform1uiEXT_remap_index },
{ 29624, Uniform1uivEXT_remap_index },
@@ -5597,10 +5598,10 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 28254, VertexAttribI3iEXT_remap_index },
{ 26688, VertexAttribI3ivEXT_remap_index },
{ 3608, VertexAttribI3uiEXT_remap_index },
- { 32180, VertexAttribI3uivEXT_remap_index },
+ { 32196, VertexAttribI3uivEXT_remap_index },
{ 23487, VertexAttribI4bvEXT_remap_index },
{ 15548, VertexAttribI4iEXT_remap_index },
- { 33871, VertexAttribI4ivEXT_remap_index },
+ { 33887, VertexAttribI4ivEXT_remap_index },
{ 14198, VertexAttribI4svEXT_remap_index },
{ 17571, VertexAttribI4ubvEXT_remap_index },
{ 17199, VertexAttribI4uiEXT_remap_index },
@@ -5629,7 +5630,7 @@ static const struct gl_function_pool_remap MESA_remap_table_functions[] = {
{ 15170, EndTransformFeedbackEXT_remap_index },
{ 11553, GetTransformFeedbackVaryingEXT_remap_index },
{ 22204, TransformFeedbackVaryingsEXT_remap_index },
- { 31268, ProvokingVertexEXT_remap_index },
+ { 31284, ProvokingVertexEXT_remap_index },
{ 11501, GetTexParameterPointervAPPLE_remap_index },
{ 5528, TextureRangeAPPLE_remap_index },
{ 12368, GetObjectParameterivAPPLE_remap_index },
@@ -5657,7 +5658,7 @@ static const struct gl_function_remap MESA_alt_functions[] = {
{ 11973, _gloffset_BlendEquation },
/* from GL_EXT_color_subtable */
{ 18164, _gloffset_ColorSubTable },
- { 33534, _gloffset_CopyColorSubTable },
+ { 33550, _gloffset_CopyColorSubTable },
/* from GL_EXT_convolution */
{ 277, _gloffset_ConvolutionFilter1D },
{ 2628, _gloffset_CopyConvolutionFilter1D },
@@ -5671,13 +5672,13 @@ static const struct gl_function_remap MESA_alt_functions[] = {
{ 26774, _gloffset_ConvolutionParameterf },
{ 28488, _gloffset_GetConvolutionParameterfv },
{ 29345, _gloffset_GetConvolutionFilter },
- { 31876, _gloffset_CopyConvolutionFilter2D },
+ { 31892, _gloffset_CopyConvolutionFilter2D },
/* from GL_EXT_copy_texture */
{ 16048, _gloffset_CopyTexSubImage3D },
{ 17851, _gloffset_CopyTexImage2D },
{ 26164, _gloffset_CopyTexImage1D },
{ 29026, _gloffset_CopyTexSubImage2D },
- { 31488, _gloffset_CopyTexSubImage1D },
+ { 31504, _gloffset_CopyTexSubImage1D },
/* from GL_EXT_draw_range_elements */
{ 10168, _gloffset_DrawRangeElements },
/* from GL_EXT_histogram */
@@ -5689,8 +5690,8 @@ static const struct gl_function_remap MESA_alt_functions[] = {
{ 28378, _gloffset_ResetMinmax },
{ 29242, _gloffset_GetHistogramParameteriv },
{ 30411, _gloffset_GetHistogram },
- { 33120, _gloffset_Minmax },
- { 34742, _gloffset_GetMinmaxParameterfv },
+ { 33136, _gloffset_Minmax },
+ { 34758, _gloffset_GetMinmaxParameterfv },
/* from GL_EXT_paletted_texture */
{ 9014, _gloffset_ColorTable },
{ 16228, _gloffset_GetColorTable },
@@ -5708,11 +5709,11 @@ static const struct gl_function_remap MESA_alt_functions[] = {
{ 14402, _gloffset_GenTextures },
{ 16759, _gloffset_DeleteTextures },
{ 20988, _gloffset_IsTexture },
- { 31553, _gloffset_BindTexture },
+ { 31569, _gloffset_BindTexture },
/* from GL_EXT_vertex_array */
{ 25865, _gloffset_ArrayElement },
- { 32708, _gloffset_GetPointerv },
- { 34293, _gloffset_DrawArrays },
+ { 32724, _gloffset_GetPointerv },
+ { 34309, _gloffset_DrawArrays },
/* from GL_SGI_color_table */
{ 8292, _gloffset_ColorTableParameteriv },
{ 9014, _gloffset_ColorTable },
@@ -5753,9 +5754,9 @@ static const struct gl_function_remap MESA_alt_functions[] = {
{ 28963, _gloffset_MultiTexCoord2ivARB },
{ 29302, _gloffset_MultiTexCoord1iARB },
{ 30686, _gloffset_MultiTexCoord4svARB },
- { 31310, _gloffset_MultiTexCoord1fARB },
- { 31615, _gloffset_MultiTexCoord4fARB },
- { 34127, _gloffset_MultiTexCoord2fvARB },
+ { 31326, _gloffset_MultiTexCoord1fARB },
+ { 31631, _gloffset_MultiTexCoord4fARB },
+ { 34143, _gloffset_MultiTexCoord2fvARB },
{ -1, -1 }
};
diff --git a/mesalib/src/mesa/main/renderbuffer.h b/mesalib/src/mesa/main/renderbuffer.h
index f9329d55f..de471cd6b 100644
--- a/mesalib/src/mesa/main/renderbuffer.h
+++ b/mesalib/src/mesa/main/renderbuffer.h
@@ -108,7 +108,7 @@ extern void
_mesa_reference_renderbuffer_(struct gl_renderbuffer **ptr,
struct gl_renderbuffer *rb);
-static INLINE void
+static inline void
_mesa_reference_renderbuffer(struct gl_renderbuffer **ptr,
struct gl_renderbuffer *rb)
{
diff --git a/mesalib/src/mesa/main/samplerobj.c b/mesalib/src/mesa/main/samplerobj.c
index 3ee27fb2c..7cf0654ad 100644
--- a/mesalib/src/mesa/main/samplerobj.c
+++ b/mesalib/src/mesa/main/samplerobj.c
@@ -313,7 +313,7 @@ validate_texture_wrap_mode(struct gl_context *ctx, GLenum wrap)
/**
* This is called just prior to changing any sampler object state.
*/
-static INLINE void
+static inline void
flush(struct gl_context *ctx)
{
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
diff --git a/mesalib/src/mesa/main/samplerobj.h b/mesalib/src/mesa/main/samplerobj.h
index a839010b7..fe7d5a7d3 100644
--- a/mesalib/src/mesa/main/samplerobj.h
+++ b/mesalib/src/mesa/main/samplerobj.h
@@ -28,7 +28,7 @@
struct dd_function_table;
-static INLINE struct gl_sampler_object *
+static inline struct gl_sampler_object *
_mesa_get_samplerobj(struct gl_context *ctx, GLuint unit)
{
if (ctx->Texture.Unit[unit].Sampler)
diff --git a/mesalib/src/mesa/main/shader_query.cpp b/mesalib/src/mesa/main/shader_query.cpp
new file mode 100644
index 000000000..bd873a491
--- /dev/null
+++ b/mesalib/src/mesa/main/shader_query.cpp
@@ -0,0 +1,239 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * 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, sublicense,
+ * 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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 shader_query.cpp
+ * C-to-C++ bridge functions to query GLSL shader data
+ *
+ * \author Ian Romanick <ian.d.romanick@intel.com>
+ */
+
+#include "main/core.h"
+#include "glsl_symbol_table.h"
+#include "ir.h"
+#include "shaderobj.h"
+#include "program/hash_table.h"
+#include "../glsl/program.h"
+
+extern "C" {
+#include "shaderapi.h"
+}
+
+void GLAPIENTRY
+_mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
+ const GLcharARB *name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ struct gl_shader_program *const shProg =
+ _mesa_lookup_shader_program_err(ctx, program, "glBindAttribLocation");
+ if (!shProg)
+ return;
+
+ if (!name)
+ return;
+
+ if (strncmp(name, "gl_", 3) == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBindAttribLocation(illegal name)");
+ return;
+ }
+
+ if (index >= ctx->Const.VertexProgram.MaxAttribs) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocation(index)");
+ return;
+ }
+
+ /* Replace the current value if it's already in the list. Add
+ * VERT_ATTRIB_GENERIC0 because that's how the linker differentiates
+ * between built-in attributes and user-defined attributes.
+ */
+ shProg->AttributeBindings->put(index + VERT_ATTRIB_GENERIC0, name);
+
+ /*
+ * Note that this attribute binding won't go into effect until
+ * glLinkProgram is called again.
+ */
+}
+
+void GLAPIENTRY
+_mesa_GetActiveAttribARB(GLhandleARB program, GLuint desired_index,
+ GLsizei maxLength, GLsizei * length, GLint * size,
+ GLenum * type, GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *shProg;
+
+ shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
+ if (!shProg)
+ return;
+
+ if (!shProg->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetActiveAttrib(program not linked)");
+ return;
+ }
+
+ if (shProg->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(no vertex shader)");
+ return;
+ }
+
+ exec_list *const ir = shProg->_LinkedShaders[MESA_SHADER_VERTEX]->ir;
+ unsigned current_index = 0;
+
+ foreach_list(node, ir) {
+ const ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if (var == NULL
+ || var->mode != ir_var_in
+ || var->location == -1
+ || var->location < VERT_ATTRIB_GENERIC0)
+ continue;
+
+ if (current_index == desired_index) {
+ _mesa_copy_string(name, maxLength, length, var->name);
+
+ if (size)
+ *size = (var->type->is_array()) ? var->type->length : 1;
+
+ if (type)
+ *type = var->type->gl_type;
+
+ return;
+ }
+
+ current_index++;
+ }
+
+ /* If the loop did not return early, the caller must have asked for
+ * an index that did not exit. Set an error.
+ */
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)");
+}
+
+GLint GLAPIENTRY
+_mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_shader_program *const shProg =
+ _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
+
+ if (!shProg) {
+ return -1;
+ }
+
+ if (!shProg->LinkStatus) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetAttribLocation(program not linked)");
+ return -1;
+ }
+
+ if (!name)
+ return -1;
+
+ /* Not having a vertex shader is not an error.
+ */
+ if (shProg->_LinkedShaders[MESA_SHADER_VERTEX] == NULL)
+ return -1;
+
+ exec_list *ir = shProg->_LinkedShaders[MESA_SHADER_VERTEX]->ir;
+ foreach_list(node, ir) {
+ const ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ /* The extra check against VERT_ATTRIB_GENERIC0 is because
+ * glGetAttribLocation cannot be used on "conventional" attributes.
+ *
+ * From page 95 of the OpenGL 3.0 spec:
+ *
+ * "If name is not an active attribute, if name is a conventional
+ * attribute, or if an error occurs, -1 will be returned."
+ */
+ if (var == NULL
+ || var->mode != ir_var_in
+ || var->location == -1
+ || var->location < VERT_ATTRIB_GENERIC0)
+ continue;
+
+ if (strcmp(var->name, name) == 0)
+ return var->location - VERT_ATTRIB_GENERIC0;
+ }
+
+ return -1;
+}
+
+
+unsigned
+_mesa_count_active_attribs(struct gl_shader_program *shProg)
+{
+ if (!shProg->LinkStatus
+ || shProg->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
+ return 0;
+ }
+
+ exec_list *const ir = shProg->_LinkedShaders[MESA_SHADER_VERTEX]->ir;
+ unsigned i = 0;
+
+ foreach_list(node, ir) {
+ const ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if (var == NULL
+ || var->mode != ir_var_in
+ || var->location == -1
+ || var->location < VERT_ATTRIB_GENERIC0)
+ continue;
+
+ i++;
+ }
+
+ return i;
+}
+
+
+size_t
+_mesa_longest_attribute_name_length(struct gl_shader_program *shProg)
+{
+ if (!shProg->LinkStatus
+ || shProg->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
+ return 0;
+ }
+
+ exec_list *const ir = shProg->_LinkedShaders[MESA_SHADER_VERTEX]->ir;
+ size_t longest = 0;
+
+ foreach_list(node, ir) {
+ const ir_variable *const var = ((ir_instruction *) node)->as_variable();
+
+ if (var == NULL
+ || var->mode != ir_var_in
+ || var->location == -1
+ || var->location < VERT_ATTRIB_GENERIC0)
+ continue;
+
+ const size_t len = strlen(var->name);
+ if (len >= longest)
+ longest = len + 1;
+ }
+
+ return longest;
+}
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index 3ce14d154..9e0ed9c69 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -324,82 +324,6 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
}
-static GLint
-get_attrib_location(struct gl_context *ctx, GLuint program, const GLchar *name)
-{
- struct gl_shader_program *shProg
- = _mesa_lookup_shader_program_err(ctx, program, "glGetAttribLocation");
-
- if (!shProg) {
- return -1;
- }
-
- if (!shProg->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetAttribLocation(program not linked)");
- return -1;
- }
-
- if (!name)
- return -1;
-
- if (shProg->VertexProgram) {
- const struct gl_program_parameter_list *attribs =
- shProg->VertexProgram->Base.Attributes;
- if (attribs) {
- GLint i = _mesa_lookup_parameter_index(attribs, -1, name);
- if (i >= 0) {
- return attribs->Parameters[i].StateIndexes[0];
- }
- }
- }
- return -1;
-}
-
-
-static void
-bind_attrib_location(struct gl_context *ctx, GLuint program, GLuint index,
- const GLchar *name)
-{
- struct gl_shader_program *shProg;
- const GLint size = -1; /* unknown size */
- GLint i;
- GLenum datatype = GL_FLOAT_VEC4;
-
- shProg = _mesa_lookup_shader_program_err(ctx, program,
- "glBindAttribLocation");
- if (!shProg) {
- return;
- }
-
- if (!name)
- return;
-
- if (strncmp(name, "gl_", 3) == 0) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBindAttribLocation(illegal name)");
- return;
- }
-
- if (index >= ctx->Const.VertexProgram.MaxAttribs) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glBindAttribLocation(index)");
- return;
- }
-
- /* this will replace the current value if it's already in the list */
- i = _mesa_add_attribute(shProg->Attributes, name, size, datatype, index);
- if (i < 0) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindAttribLocation");
- return;
- }
-
- /*
- * Note that this attribute binding won't go into effect until
- * glLinkProgram is called again.
- */
-}
-
-
static void
bind_frag_data_location(struct gl_context *ctx, GLuint program,
GLuint colorNumber, const GLchar *name)
@@ -557,38 +481,6 @@ detach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
}
-static void
-get_active_attrib(struct gl_context *ctx, GLuint program, GLuint index,
- GLsizei maxLength, GLsizei *length, GLint *size,
- GLenum *type, GLchar *nameOut)
-{
- const struct gl_program_parameter_list *attribs = NULL;
- struct gl_shader_program *shProg;
-
- shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
- if (!shProg)
- return;
-
- if (shProg->VertexProgram)
- attribs = shProg->VertexProgram->Base.Attributes;
-
- if (!attribs || index >= attribs->NumParameters) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)");
- return;
- }
-
- _mesa_copy_string(nameOut, maxLength, length,
- attribs->Parameters[index].Name);
-
- if (size)
- *size = attribs->Parameters[index].Size
- / _mesa_sizeof_glsl_type(attribs->Parameters[index].DataType);
-
- if (type)
- *type = attribs->Parameters[index].DataType;
-}
-
-
/**
* Return list of shaders attached to shader program.
*/
@@ -646,7 +538,6 @@ get_handle(struct gl_context *ctx, GLenum pname)
static void
get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *params)
{
- const struct gl_program_parameter_list *attribs;
struct gl_shader_program *shProg
= _mesa_lookup_shader_program(ctx, program);
@@ -655,11 +546,6 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
return;
}
- if (shProg->VertexProgram)
- attribs = shProg->VertexProgram->Base.Attributes;
- else
- attribs = NULL;
-
switch (pname) {
case GL_DELETE_STATUS:
*params = shProg->DeletePending;
@@ -677,10 +563,10 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
*params = shProg->NumShaders;
break;
case GL_ACTIVE_ATTRIBUTES:
- *params = attribs ? attribs->NumParameters : 0;
+ *params = _mesa_count_active_attribs(shProg);
break;
case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
- *params = _mesa_longest_parameter_name(attribs, PROGRAM_INPUT) + 1;
+ *params = _mesa_longest_attribute_name_length(shProg);
break;
case GL_ACTIVE_UNIFORMS:
*params = shProg->Uniforms ? shProg->Uniforms->NumUniforms : 0;
@@ -1161,15 +1047,6 @@ _mesa_AttachShader(GLuint program, GLuint shader)
}
-void GLAPIENTRY
-_mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
- const GLcharARB *name)
-{
- GET_CURRENT_CONTEXT(ctx);
- bind_attrib_location(ctx, program, index, name);
-}
-
-
/* GL_EXT_gpu_shader4, GL3 */
void GLAPIENTRY
_mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
@@ -1289,16 +1166,6 @@ _mesa_DetachShader(GLuint program, GLuint shader)
void GLAPIENTRY
-_mesa_GetActiveAttribARB(GLhandleARB program, GLuint index,
- GLsizei maxLength, GLsizei * length, GLint * size,
- GLenum * type, GLcharARB * name)
-{
- GET_CURRENT_CONTEXT(ctx);
- get_active_attrib(ctx, program, index, maxLength, length, size, type, name);
-}
-
-
-void GLAPIENTRY
_mesa_GetAttachedObjectsARB(GLhandleARB container, GLsizei maxCount,
GLsizei * count, GLhandleARB * obj)
{
@@ -1316,14 +1183,6 @@ _mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
}
-GLint GLAPIENTRY
-_mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name)
-{
- GET_CURRENT_CONTEXT(ctx);
- return get_attrib_location(ctx, program, name);
-}
-
-
/* GL_EXT_gpu_shader4, GL3 */
GLint GLAPIENTRY
_mesa_GetFragDataLocation(GLuint program, const GLchar *name)
diff --git a/mesalib/src/mesa/main/shaderapi.h b/mesalib/src/mesa/main/shaderapi.h
index 15c7c7ae6..bec448dee 100644
--- a/mesalib/src/mesa/main/shaderapi.h
+++ b/mesalib/src/mesa/main/shaderapi.h
@@ -1,193 +1,197 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 2004-2007 Brian Paul All Rights Reserved.
- * Copyright (C) 2010 VMware, Inc. 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS 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.
- */
-
-
-#ifndef SHADERAPI_H
-#define SHADERAPI_H
-
-
-#include "glheader.h"
-
-struct _glapi_table;
-struct gl_context;
-struct gl_shader_program;
-
-extern GLint
-_mesa_sizeof_glsl_type(GLenum type);
-
-extern void
-_mesa_copy_string(GLchar *dst, GLsizei maxLength,
- GLsizei *length, const GLchar *src);
-
-extern void
-_mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg);
-
-extern void
-_mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg,
- const char *caller);
-
-extern void
-_mesa_init_shader_dispatch(struct _glapi_table *exec);
-
-
-
-extern void GLAPIENTRY
-_mesa_AttachObjectARB(GLhandleARB, GLhandleARB);
-
-extern void GLAPIENTRY
-_mesa_CompileShaderARB(GLhandleARB);
-
-extern GLhandleARB GLAPIENTRY
-_mesa_CreateProgramObjectARB(void);
-
-extern GLhandleARB GLAPIENTRY
-_mesa_CreateShaderObjectARB(GLenum type);
-
-extern void GLAPIENTRY
-_mesa_DeleteObjectARB(GLhandleARB obj);
-
-extern void GLAPIENTRY
-_mesa_DetachObjectARB(GLhandleARB, GLhandleARB);
-
-extern void GLAPIENTRY
-_mesa_GetAttachedObjectsARB(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
-
-extern GLint GLAPIENTRY
-_mesa_GetFragDataLocation(GLuint program, const GLchar *name);
-
-extern GLhandleARB GLAPIENTRY
-_mesa_GetHandleARB(GLenum pname);
-
-extern void GLAPIENTRY
-_mesa_GetInfoLogARB(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
-
-extern void GLAPIENTRY
-_mesa_GetObjectParameterfvARB(GLhandleARB, GLenum, GLfloat *);
-
-extern void GLAPIENTRY
-_mesa_GetObjectParameterivARB(GLhandleARB, GLenum, GLint *);
-
-extern void GLAPIENTRY
-_mesa_GetShaderSourceARB(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
-
-extern GLboolean GLAPIENTRY
-_mesa_IsProgram(GLuint name);
-
-extern GLboolean GLAPIENTRY
-_mesa_IsShader(GLuint name);
-
-extern void GLAPIENTRY
-_mesa_LinkProgramARB(GLhandleARB programObj);
-
-extern void GLAPIENTRY
-_mesa_ShaderSourceARB(GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
-
-extern void GLAPIENTRY
-_mesa_UseProgramObjectARB(GLhandleARB);
-
-extern void GLAPIENTRY
-_mesa_ValidateProgramARB(GLhandleARB);
-
-
-extern void GLAPIENTRY
-_mesa_BindAttribLocationARB(GLhandleARB, GLuint, const GLcharARB *);
-
-extern void GLAPIENTRY
-_mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
- const GLchar *name);
-
-extern void GLAPIENTRY
-_mesa_GetActiveAttribARB(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *,
- GLenum *, GLcharARB *);
-
-extern GLint GLAPIENTRY
-_mesa_GetAttribLocationARB(GLhandleARB, const GLcharARB *);
-
-
-
-extern void GLAPIENTRY
-_mesa_AttachShader(GLuint program, GLuint shader);
-
-extern GLuint GLAPIENTRY
-_mesa_CreateShader(GLenum);
-
-extern GLuint GLAPIENTRY
-_mesa_CreateProgram(void);
-
-extern void GLAPIENTRY
-_mesa_DeleteProgram(GLuint program);
-
-extern void GLAPIENTRY
-_mesa_DeleteShader(GLuint shader);
-
-extern void GLAPIENTRY
-_mesa_DetachShader(GLuint program, GLuint shader);
-
-extern void GLAPIENTRY
-_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
- GLsizei *count, GLuint *obj);
-
-extern void GLAPIENTRY
-_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params);
-
-extern void GLAPIENTRY
-_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
- GLsizei *length, GLchar *infoLog);
-
-extern void GLAPIENTRY
-_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params);
-
-extern void GLAPIENTRY
-_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
- GLsizei *length, GLchar *infoLog);
-
-
-extern void GLAPIENTRY
-_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
- GLint *range, GLint *precision);
-
-extern void GLAPIENTRY
-_mesa_ReleaseShaderCompiler(void);
-
-extern void GLAPIENTRY
-_mesa_ShaderBinary(GLint n, const GLuint *shaders, GLenum binaryformat,
- const void* binary, GLint length);
-
-extern void GLAPIENTRY
-_mesa_ProgramParameteriARB(GLuint program, GLenum pname,
- GLint value);
-void
-_mesa_use_shader_program(struct gl_context *ctx, GLenum type,
- struct gl_shader_program *shProg);
-
-extern void GLAPIENTRY
-_mesa_UseShaderProgramEXT(GLenum type, GLuint program);
-
-extern void GLAPIENTRY
-_mesa_ActiveProgramEXT(GLuint program);
-
-extern GLuint GLAPIENTRY
-_mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string);
-
-#endif /* SHADERAPI_H */
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 2004-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2010 VMware, Inc. 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS 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.
+ */
+
+
+#ifndef SHADERAPI_H
+#define SHADERAPI_H
+
+
+#include "glheader.h"
+
+struct _glapi_table;
+struct gl_context;
+struct gl_shader_program;
+
+extern GLint
+_mesa_sizeof_glsl_type(GLenum type);
+
+extern void
+_mesa_copy_string(GLchar *dst, GLsizei maxLength,
+ GLsizei *length, const GLchar *src);
+
+extern void
+_mesa_use_program(struct gl_context *ctx, struct gl_shader_program *shProg);
+
+extern void
+_mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg,
+ const char *caller);
+
+extern void
+_mesa_init_shader_dispatch(struct _glapi_table *exec);
+
+extern unsigned
+_mesa_count_active_attribs(struct gl_shader_program *shProg);
+
+extern size_t
+_mesa_longest_attribute_name_length(struct gl_shader_program *shProg);
+
+extern void GLAPIENTRY
+_mesa_AttachObjectARB(GLhandleARB, GLhandleARB);
+
+extern void GLAPIENTRY
+_mesa_CompileShaderARB(GLhandleARB);
+
+extern GLhandleARB GLAPIENTRY
+_mesa_CreateProgramObjectARB(void);
+
+extern GLhandleARB GLAPIENTRY
+_mesa_CreateShaderObjectARB(GLenum type);
+
+extern void GLAPIENTRY
+_mesa_DeleteObjectARB(GLhandleARB obj);
+
+extern void GLAPIENTRY
+_mesa_DetachObjectARB(GLhandleARB, GLhandleARB);
+
+extern void GLAPIENTRY
+_mesa_GetAttachedObjectsARB(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
+
+extern GLint GLAPIENTRY
+_mesa_GetFragDataLocation(GLuint program, const GLchar *name);
+
+extern GLhandleARB GLAPIENTRY
+_mesa_GetHandleARB(GLenum pname);
+
+extern void GLAPIENTRY
+_mesa_GetInfoLogARB(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+
+extern void GLAPIENTRY
+_mesa_GetObjectParameterfvARB(GLhandleARB, GLenum, GLfloat *);
+
+extern void GLAPIENTRY
+_mesa_GetObjectParameterivARB(GLhandleARB, GLenum, GLint *);
+
+extern void GLAPIENTRY
+_mesa_GetShaderSourceARB(GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsProgram(GLuint name);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsShader(GLuint name);
+
+extern void GLAPIENTRY
+_mesa_LinkProgramARB(GLhandleARB programObj);
+
+extern void GLAPIENTRY
+_mesa_ShaderSourceARB(GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
+
+extern void GLAPIENTRY
+_mesa_UseProgramObjectARB(GLhandleARB);
+
+extern void GLAPIENTRY
+_mesa_ValidateProgramARB(GLhandleARB);
+
+
+extern void GLAPIENTRY
+_mesa_BindAttribLocationARB(GLhandleARB, GLuint, const GLcharARB *);
+
+extern void GLAPIENTRY
+_mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
+ const GLchar *name);
+
+extern void GLAPIENTRY
+_mesa_GetActiveAttribARB(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *,
+ GLenum *, GLcharARB *);
+
+extern GLint GLAPIENTRY
+_mesa_GetAttribLocationARB(GLhandleARB, const GLcharARB *);
+
+
+
+extern void GLAPIENTRY
+_mesa_AttachShader(GLuint program, GLuint shader);
+
+extern GLuint GLAPIENTRY
+_mesa_CreateShader(GLenum);
+
+extern GLuint GLAPIENTRY
+_mesa_CreateProgram(void);
+
+extern void GLAPIENTRY
+_mesa_DeleteProgram(GLuint program);
+
+extern void GLAPIENTRY
+_mesa_DeleteShader(GLuint shader);
+
+extern void GLAPIENTRY
+_mesa_DetachShader(GLuint program, GLuint shader);
+
+extern void GLAPIENTRY
+_mesa_GetAttachedShaders(GLuint program, GLsizei maxCount,
+ GLsizei *count, GLuint *obj);
+
+extern void GLAPIENTRY
+_mesa_GetProgramiv(GLuint program, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GetProgramInfoLog(GLuint program, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog);
+
+extern void GLAPIENTRY
+_mesa_GetShaderiv(GLuint shader, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GetShaderInfoLog(GLuint shader, GLsizei bufSize,
+ GLsizei *length, GLchar *infoLog);
+
+
+extern void GLAPIENTRY
+_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
+ GLint *range, GLint *precision);
+
+extern void GLAPIENTRY
+_mesa_ReleaseShaderCompiler(void);
+
+extern void GLAPIENTRY
+_mesa_ShaderBinary(GLint n, const GLuint *shaders, GLenum binaryformat,
+ const void* binary, GLint length);
+
+extern void GLAPIENTRY
+_mesa_ProgramParameteriARB(GLuint program, GLenum pname,
+ GLint value);
+void
+_mesa_use_shader_program(struct gl_context *ctx, GLenum type,
+ struct gl_shader_program *shProg);
+
+extern void GLAPIENTRY
+_mesa_UseShaderProgramEXT(GLenum type, GLuint program);
+
+extern void GLAPIENTRY
+_mesa_ActiveProgramEXT(GLuint program);
+
+extern GLuint GLAPIENTRY
+_mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string);
+
+#endif /* SHADERAPI_H */
diff --git a/mesalib/src/mesa/main/shaderobj.c b/mesalib/src/mesa/main/shaderobj.c
index f128648f4..1eba75697 100644
--- a/mesalib/src/mesa/main/shaderobj.c
+++ b/mesalib/src/mesa/main/shaderobj.c
@@ -38,6 +38,7 @@
#include "program/program.h"
#include "program/prog_parameter.h"
#include "program/prog_uniform.h"
+#include "program/hash_table.h"
#include "ralloc.h"
/**********************************************************************/
@@ -238,7 +239,9 @@ _mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog
{
prog->Type = GL_SHADER_PROGRAM_MESA;
prog->RefCount = 1;
- prog->Attributes = _mesa_new_parameter_list();
+
+ prog->AttributeBindings = string_to_uint_map_ctor();
+
#if FEATURE_ARB_geometry_shader4
prog->Geom.VerticesOut = 0;
prog->Geom.InputType = GL_TRIANGLES;
@@ -307,9 +310,9 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
_mesa_clear_shader_program_data(ctx, shProg);
- if (shProg->Attributes) {
- _mesa_free_parameter_list(shProg->Attributes);
- shProg->Attributes = NULL;
+ if (shProg->AttributeBindings) {
+ string_to_uint_map_dtor(shProg->AttributeBindings);
+ shProg->AttributeBindings = NULL;
}
/* detach shaders */
diff --git a/mesalib/src/mesa/main/shaderobj.h b/mesalib/src/mesa/main/shaderobj.h
index 881856a02..941841d43 100644
--- a/mesalib/src/mesa/main/shaderobj.h
+++ b/mesalib/src/mesa/main/shaderobj.h
@@ -1,137 +1,137 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 2004-2007 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef SHADEROBJ_H
-#define SHADEROBJ_H
-
-
-#include "main/compiler.h"
-#include "main/glheader.h"
-#include "main/mtypes.h"
-#include "program/ir_to_mesa.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/**
- * Internal functions
- */
-
-extern void
-_mesa_init_shader_state(struct gl_context * ctx);
-
-extern void
-_mesa_free_shader_state(struct gl_context *ctx);
-
-
-extern void
-_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
- struct gl_shader *sh);
-
-extern struct gl_shader *
-_mesa_lookup_shader(struct gl_context *ctx, GLuint name);
-
-extern struct gl_shader *
-_mesa_lookup_shader_err(struct gl_context *ctx, GLuint name, const char *caller);
-
-
-
-extern void
-_mesa_reference_shader_program(struct gl_context *ctx,
- struct gl_shader_program **ptr,
- struct gl_shader_program *shProg);
-extern void
-_mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader);
-
-extern struct gl_shader *
-_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
-
-extern void
-_mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog);
-
-extern struct gl_shader_program *
-_mesa_lookup_shader_program(struct gl_context *ctx, GLuint name);
-
-extern struct gl_shader_program *
-_mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name,
- const char *caller);
-
-extern void
-_mesa_clear_shader_program_data(struct gl_context *ctx,
- struct gl_shader_program *shProg);
-
-extern void
-_mesa_free_shader_program_data(struct gl_context *ctx,
- struct gl_shader_program *shProg);
-
-
-
-extern void
-_mesa_init_shader_object_functions(struct dd_function_table *driver);
-
-extern void
-_mesa_init_shader_state(struct gl_context *ctx);
-
-extern void
-_mesa_free_shader_state(struct gl_context *ctx);
-
-
-static INLINE gl_shader_type
-_mesa_shader_type_to_index(GLenum v)
-{
- switch (v) {
- case GL_VERTEX_SHADER:
- return MESA_SHADER_VERTEX;
- case GL_FRAGMENT_SHADER:
- return MESA_SHADER_FRAGMENT;
- case GL_GEOMETRY_SHADER:
- return MESA_SHADER_GEOMETRY;
- default:
- ASSERT(0 && "bad value in _mesa_shader_type_to_index()");
- return MESA_SHADER_TYPES;
- }
-}
-
-
-static INLINE GLenum
-_mesa_shader_index_to_type(GLuint i)
-{
- static const GLenum enums[MESA_SHADER_TYPES] = {
- GL_VERTEX_SHADER,
- GL_FRAGMENT_SHADER,
- GL_GEOMETRY_SHADER ,
- };
- if (i >= MESA_SHADER_TYPES)
- return 0;
- else
- return enums[i];
-}
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SHADEROBJ_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 2004-2007 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef SHADEROBJ_H
+#define SHADEROBJ_H
+
+
+#include "main/compiler.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "program/ir_to_mesa.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/**
+ * Internal functions
+ */
+
+extern void
+_mesa_init_shader_state(struct gl_context * ctx);
+
+extern void
+_mesa_free_shader_state(struct gl_context *ctx);
+
+
+extern void
+_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
+ struct gl_shader *sh);
+
+extern struct gl_shader *
+_mesa_lookup_shader(struct gl_context *ctx, GLuint name);
+
+extern struct gl_shader *
+_mesa_lookup_shader_err(struct gl_context *ctx, GLuint name, const char *caller);
+
+
+
+extern void
+_mesa_reference_shader_program(struct gl_context *ctx,
+ struct gl_shader_program **ptr,
+ struct gl_shader_program *shProg);
+extern void
+_mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader);
+
+extern struct gl_shader *
+_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);
+
+extern void
+_mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog);
+
+extern struct gl_shader_program *
+_mesa_lookup_shader_program(struct gl_context *ctx, GLuint name);
+
+extern struct gl_shader_program *
+_mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name,
+ const char *caller);
+
+extern void
+_mesa_clear_shader_program_data(struct gl_context *ctx,
+ struct gl_shader_program *shProg);
+
+extern void
+_mesa_free_shader_program_data(struct gl_context *ctx,
+ struct gl_shader_program *shProg);
+
+
+
+extern void
+_mesa_init_shader_object_functions(struct dd_function_table *driver);
+
+extern void
+_mesa_init_shader_state(struct gl_context *ctx);
+
+extern void
+_mesa_free_shader_state(struct gl_context *ctx);
+
+
+static inline gl_shader_type
+_mesa_shader_type_to_index(GLenum v)
+{
+ switch (v) {
+ case GL_VERTEX_SHADER:
+ return MESA_SHADER_VERTEX;
+ case GL_FRAGMENT_SHADER:
+ return MESA_SHADER_FRAGMENT;
+ case GL_GEOMETRY_SHADER:
+ return MESA_SHADER_GEOMETRY;
+ default:
+ ASSERT(0 && "bad value in _mesa_shader_type_to_index()");
+ return MESA_SHADER_TYPES;
+ }
+}
+
+
+static inline GLenum
+_mesa_shader_index_to_type(GLuint i)
+{
+ static const GLenum enums[MESA_SHADER_TYPES] = {
+ GL_VERTEX_SHADER,
+ GL_FRAGMENT_SHADER,
+ GL_GEOMETRY_SHADER ,
+ };
+ if (i >= MESA_SHADER_TYPES)
+ return 0;
+ else
+ return enums[i];
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SHADEROBJ_H */
diff --git a/mesalib/src/mesa/main/state.h b/mesalib/src/mesa/main/state.h
index 7feeb9007..2b5b3d514 100644
--- a/mesalib/src/mesa/main/state.h
+++ b/mesalib/src/mesa/main/state.h
@@ -49,7 +49,7 @@ _mesa_set_vp_override(struct gl_context *ctx, GLboolean flag);
/**
* Is the secondary color needed?
*/
-static INLINE GLboolean
+static inline GLboolean
_mesa_need_secondary_color(const struct gl_context *ctx)
{
if (ctx->Light.Enabled &&
diff --git a/mesalib/src/mesa/main/syncobj.h b/mesalib/src/mesa/main/syncobj.h
index e83ac8b0e..e2e92b0ac 100644
--- a/mesalib/src/mesa/main/syncobj.h
+++ b/mesalib/src/mesa/main/syncobj.h
@@ -1,119 +1,119 @@
-/*
- * Copyright © 2009 Intel Corporation
- *
- * 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, sublicense,
- * 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS 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 syncobj.h
- * Sync object management.
- *
- * \author Ian Romanick <ian.d.romanick@intel.com>
- */
-
-#ifndef SYNCOBJ_H
-#define SYNCOBJ_H
-
-#include "glheader.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-struct dd_function_table;
-struct gl_context;
-struct gl_sync_object;
-
-#if FEATURE_ARB_sync
-
-extern void GLAPIENTRY
-_mesa_init_sync_object_functions(struct dd_function_table *driver);
-
-extern void GLAPIENTRY
-_mesa_init_sync_dispatch(struct _glapi_table *disp);
-
-extern void GLAPIENTRY
-_mesa_init_sync(struct gl_context *);
-
-extern void GLAPIENTRY
-_mesa_free_sync_data(struct gl_context *);
-
-extern void GLAPIENTRY
-_mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj);
-
-extern void GLAPIENTRY
-_mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj);
-
-extern GLboolean GLAPIENTRY
-_mesa_IsSync(GLsync sync);
-
-extern void GLAPIENTRY
-_mesa_DeleteSync(GLsync sync);
-
-extern GLsync GLAPIENTRY
-_mesa_FenceSync(GLenum condition, GLbitfield flags);
-
-extern GLenum GLAPIENTRY
-_mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
-
-extern void GLAPIENTRY
-_mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
-
-extern void GLAPIENTRY
-_mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,
- GLint *values);
-
-#else /* FEATURE_ARB_sync */
-
-#include "main/compiler.h"
-
-static INLINE void
-_mesa_init_sync_object_functions(struct dd_function_table *driver)
-{
-}
-
-static INLINE void
-_mesa_init_sync_dispatch(struct _glapi_table *disp)
-{
-}
-
-static INLINE void
-_mesa_init_sync(struct gl_context *ctx)
-{
-}
-
-static INLINE void
-_mesa_free_sync_data(struct gl_context *ctx)
-{
-}
-
-static INLINE void
-_mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
-{
- ASSERT_NO_FEATURE();
-}
-
-static INLINE void
-_mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
-{
- ASSERT_NO_FEATURE();
-}
-
-#endif /* FEATURE_ARB_sync */
-
-#endif /* SYNCOBJ_H */
+/*
+ * Copyright © 2009 Intel Corporation
+ *
+ * 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, sublicense,
+ * 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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 syncobj.h
+ * Sync object management.
+ *
+ * \author Ian Romanick <ian.d.romanick@intel.com>
+ */
+
+#ifndef SYNCOBJ_H
+#define SYNCOBJ_H
+
+#include "glheader.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+struct dd_function_table;
+struct gl_context;
+struct gl_sync_object;
+
+#if FEATURE_ARB_sync
+
+extern void GLAPIENTRY
+_mesa_init_sync_object_functions(struct dd_function_table *driver);
+
+extern void GLAPIENTRY
+_mesa_init_sync_dispatch(struct _glapi_table *disp);
+
+extern void GLAPIENTRY
+_mesa_init_sync(struct gl_context *);
+
+extern void GLAPIENTRY
+_mesa_free_sync_data(struct gl_context *);
+
+extern void GLAPIENTRY
+_mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj);
+
+extern void GLAPIENTRY
+_mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsSync(GLsync sync);
+
+extern void GLAPIENTRY
+_mesa_DeleteSync(GLsync sync);
+
+extern GLsync GLAPIENTRY
+_mesa_FenceSync(GLenum condition, GLbitfield flags);
+
+extern GLenum GLAPIENTRY
+_mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
+
+extern void GLAPIENTRY
+_mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
+
+extern void GLAPIENTRY
+_mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,
+ GLint *values);
+
+#else /* FEATURE_ARB_sync */
+
+#include "main/compiler.h"
+
+static inline void
+_mesa_init_sync_object_functions(struct dd_function_table *driver)
+{
+}
+
+static inline void
+_mesa_init_sync_dispatch(struct _glapi_table *disp)
+{
+}
+
+static inline void
+_mesa_init_sync(struct gl_context *ctx)
+{
+}
+
+static inline void
+_mesa_free_sync_data(struct gl_context *ctx)
+{
+}
+
+static inline void
+_mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
+{
+ ASSERT_NO_FEATURE();
+}
+
+static inline void
+_mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj)
+{
+ ASSERT_NO_FEATURE();
+}
+
+#endif /* FEATURE_ARB_sync */
+
+#endif /* SYNCOBJ_H */
diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c
index 42dc1ae2f..2cc6e5f4b 100644
--- a/mesalib/src/mesa/main/texcompress_s3tc.c
+++ b/mesalib/src/mesa/main/texcompress_s3tc.c
@@ -70,7 +70,7 @@
* linear RGB value in [0, 1].
* Implemented with a 256-entry lookup table.
*/
-static INLINE GLfloat
+static inline GLfloat
nonlinear_to_linear(GLubyte cs8)
{
static GLfloat table[256];
diff --git a/mesalib/src/mesa/main/texcompress_s3tc.h b/mesalib/src/mesa/main/texcompress_s3tc.h
index 709c35ae7..23793d167 100644
--- a/mesalib/src/mesa/main/texcompress_s3tc.h
+++ b/mesalib/src/mesa/main/texcompress_s3tc.h
@@ -100,7 +100,7 @@ _mesa_init_texture_s3tc(struct gl_context *ctx);
#define _mesa_fetch_texel_2d_f_srgba_dxt3 NULL
#define _mesa_fetch_texel_2d_f_srgba_dxt5 NULL
-static INLINE void
+static inline void
_mesa_init_texture_s3tc(struct gl_context *ctx)
{
}
diff --git a/mesalib/src/mesa/main/texformat.c b/mesalib/src/mesa/main/texformat.c
index b763a689a..ccc3c49f5 100644
--- a/mesalib/src/mesa/main/texformat.c
+++ b/mesalib/src/mesa/main/texformat.c
@@ -609,35 +609,67 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
break;
case GL_RGBA8UI_EXT:
case GL_RGB8UI_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8);
+ break;
case GL_ALPHA8UI_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_UINT8);
+ break;
case GL_INTENSITY8UI_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_UINT8);
+ break;
case GL_LUMINANCE8UI_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_UINT8);
+ break;
case GL_LUMINANCE_ALPHA8UI_EXT:
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_UINT8);
break;
case GL_RGBA32I_EXT:
case GL_RGB32I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32);
+ break;
case GL_ALPHA32I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_INT32);
+ break;
case GL_INTENSITY32I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT32);
+ break;
case GL_LUMINANCE32I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_INT32);
+ break;
case GL_LUMINANCE_ALPHA32I_EXT:
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_INT32);
break;
case GL_RGBA16I_EXT:
case GL_RGB16I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16);
+ break;
case GL_ALPHA16I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_INT16);
+ break;
case GL_INTENSITY16I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT16);
+ break;
case GL_LUMINANCE16I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_INT16);
+ break;
case GL_LUMINANCE_ALPHA16I_EXT:
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_INT16);
break;
case GL_RGBA8I_EXT:
case GL_RGB8I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8);
+ break;
case GL_ALPHA8I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ALPHA_INT8);
+ break;
case GL_INTENSITY8I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT8);
+ break;
case GL_LUMINANCE8I_EXT:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_INT8);
+ break;
case GL_LUMINANCE_ALPHA8I_EXT:
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_LUMINANCE_ALPHA_INT8);
break;
}
}
@@ -703,6 +735,49 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
}
}
+ if (ctx->Extensions.ARB_texture_rg && ctx->Extensions.EXT_texture_integer) {
+ switch (internalFormat) {
+ case GL_R8UI:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT8);
+ break;
+ case GL_RG8UI:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UINT8);
+ break;
+ case GL_R16UI:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT16);
+ break;
+ case GL_RG16UI:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UINT16);
+ break;
+ case GL_R32UI:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT32);
+ break;
+ case GL_RG32UI:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UINT32);
+ break;
+ case GL_R8I:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_INT8);
+ break;
+ case GL_RG8I:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_INT8);
+ break;
+ case GL_R16I:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_INT16);
+ break;
+ case GL_RG16I:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_INT16);
+ break;
+ case GL_R32I:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_INT32);
+ break;
+ case GL_RG32I:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_INT32);
+ break;
+ default:
+ break;
+ }
+ }
+
/* GL_BGRA can be an internal format *only* in OpenGL ES (1.x or 2.0).
*/
if (ctx->API != API_OPENGL) {
diff --git a/mesalib/src/mesa/main/texgen.h b/mesalib/src/mesa/main/texgen.h
index 9160af002..60a9522af 100644
--- a/mesalib/src/mesa/main/texgen.h
+++ b/mesalib/src/mesa/main/texgen.h
@@ -1,85 +1,85 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef TEXGEN_H
-#define TEXGEN_H
-
-
-#include "compiler.h"
-#include "glheader.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-
-
-#if FEATURE_texgen
-
-extern void GLAPIENTRY
-_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
-
-extern void GLAPIENTRY
-_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param );
-
-extern void GLAPIENTRY
-_mesa_TexGeni( GLenum coord, GLenum pname, GLint param );
-
-extern void GLAPIENTRY
-_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
-
-extern void
-_mesa_init_texgen_dispatch(struct _glapi_table *disp);
-
-
-extern void GLAPIENTRY
-_es_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params);
-
-extern void GLAPIENTRY
-_es_TexGenf(GLenum coord, GLenum pname, GLfloat param);
-
-extern void GLAPIENTRY
-_es_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
-
-
-#else /* FEATURE_texgen */
-
-static void
-_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
-{
-}
-
-static void INLINE
-_mesa_TexGeni( GLenum coord, GLenum pname, GLint param )
-{
-}
-
-static INLINE void
-_mesa_init_texgen_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_texgen */
-
-
-#endif /* TEXGEN_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef TEXGEN_H
+#define TEXGEN_H
+
+
+#include "compiler.h"
+#include "glheader.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+
+
+#if FEATURE_texgen
+
+extern void GLAPIENTRY
+_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
+
+extern void GLAPIENTRY
+_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param );
+
+extern void GLAPIENTRY
+_mesa_TexGeni( GLenum coord, GLenum pname, GLint param );
+
+extern void GLAPIENTRY
+_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
+
+extern void
+_mesa_init_texgen_dispatch(struct _glapi_table *disp);
+
+
+extern void GLAPIENTRY
+_es_GetTexGenfv(GLenum coord, GLenum pname, GLfloat *params);
+
+extern void GLAPIENTRY
+_es_TexGenf(GLenum coord, GLenum pname, GLfloat param);
+
+extern void GLAPIENTRY
+_es_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
+
+
+#else /* FEATURE_texgen */
+
+static void
+_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
+{
+}
+
+static void inline
+_mesa_TexGeni( GLenum coord, GLenum pname, GLint param )
+{
+}
+
+static inline void
+_mesa_init_texgen_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_texgen */
+
+
+#endif /* TEXGEN_H */
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c
index d2f25b9f8..f9118860b 100644
--- a/mesalib/src/mesa/main/texgetimage.c
+++ b/mesalib/src/mesa/main/texgetimage.c
@@ -49,7 +49,7 @@
/**
* Can the given type represent negative values?
*/
-static INLINE GLboolean
+static inline GLboolean
type_with_negative_values(GLenum type)
{
switch (type) {
@@ -373,9 +373,9 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions,
static GLboolean
get_tex_memcpy(struct gl_context *ctx, GLenum format, GLenum type,
GLvoid *pixels,
- struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
+ const GLenum target = texImage->TexObject->Target;
GLboolean memCopy = GL_FALSE;
/*
@@ -384,11 +384,11 @@ get_tex_memcpy(struct gl_context *ctx, GLenum format, GLenum type,
* so we don't have to worry about those.
* XXX more format combinations could be supported here.
*/
- if ((texObj->Target == GL_TEXTURE_1D ||
- texObj->Target == GL_TEXTURE_2D ||
- texObj->Target == GL_TEXTURE_RECTANGLE ||
- (texObj->Target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X &&
- texObj->Target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) {
+ if ((target == GL_TEXTURE_1D ||
+ target == GL_TEXTURE_2D ||
+ target == GL_TEXTURE_RECTANGLE ||
+ (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) {
if ((texImage->TexFormat == MESA_FORMAT_ARGB8888 ||
texImage->TexFormat == MESA_FORMAT_SARGB8) &&
format == GL_BGRA &&
@@ -471,14 +471,13 @@ get_tex_memcpy(struct gl_context *ctx, GLenum format, GLenum type,
* unmap with ctx->Driver.UnmapTextureImage().
*/
void
-_mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
+_mesa_get_teximage(struct gl_context *ctx,
GLenum format, GLenum type, GLvoid *pixels,
- struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
GLuint dimensions;
- switch (target) {
+ switch (texImage->TexObject->Target) {
case GL_TEXTURE_1D:
dimensions = 1;
break;
@@ -511,7 +510,7 @@ _mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
pixels = ADD_POINTERS(buf, pixels);
}
- if (get_tex_memcpy(ctx, format, type, pixels, texObj, texImage)) {
+ if (get_tex_memcpy(ctx, format, type, pixels, texImage)) {
/* all done */
}
else if (format == GL_DEPTH_COMPONENT) {
@@ -772,8 +771,7 @@ _mesa_GetnTexImageARB( GLenum target, GLint level, GLenum format,
_mesa_lock_texture(ctx, texObj);
{
- ctx->Driver.GetTexImage(ctx, target, level, format, type, pixels,
- texObj, texImage);
+ ctx->Driver.GetTexImage(ctx, format, type, pixels, texImage);
}
_mesa_unlock_texture(ctx, texObj);
}
diff --git a/mesalib/src/mesa/main/texgetimage.h b/mesalib/src/mesa/main/texgetimage.h
index 8612705ca..02b1cf459 100644
--- a/mesalib/src/mesa/main/texgetimage.h
+++ b/mesalib/src/mesa/main/texgetimage.h
@@ -34,9 +34,8 @@ struct gl_texture_image;
struct gl_texture_object;
extern void
-_mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level,
+_mesa_get_teximage(struct gl_context *ctx,
GLenum format, GLenum type, GLvoid *pixels,
- struct gl_texture_object *texObj,
struct gl_texture_image *texImage);
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index daa71fd7b..8efe715fe 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -2253,7 +2253,7 @@ update_fbo_texture(struct gl_context *ctx, struct gl_texture_object *texObj,
* changed the texture base level image, regenerate the rest of the
* mipmap levels now.
*/
-static INLINE void
+static inline void
check_gen_mipmap(struct gl_context *ctx, GLenum target,
struct gl_texture_object *texObj, GLint level)
{
diff --git a/mesalib/src/mesa/main/teximage.h b/mesalib/src/mesa/main/teximage.h
index 8ef1d4560..6ce0fe92c 100644
--- a/mesalib/src/mesa/main/teximage.h
+++ b/mesalib/src/mesa/main/teximage.h
@@ -136,7 +136,7 @@ _mesa_get_texture_dimensions(GLenum target);
/**
* Lock a texture for updating. See also _mesa_lock_context_textures().
*/
-static INLINE void
+static inline void
_mesa_lock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
{
_glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
@@ -144,7 +144,7 @@ _mesa_lock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
(void) texObj;
}
-static INLINE void
+static inline void
_mesa_unlock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
{
(void) texObj;
diff --git a/mesalib/src/mesa/main/texobj.h b/mesalib/src/mesa/main/texobj.h
index 1faae6f7e..9ca7a4c9e 100644
--- a/mesalib/src/mesa/main/texobj.h
+++ b/mesalib/src/mesa/main/texobj.h
@@ -68,7 +68,7 @@ extern void
_mesa_reference_texobj_(struct gl_texture_object **ptr,
struct gl_texture_object *tex);
-static INLINE void
+static inline void
_mesa_reference_texobj(struct gl_texture_object **ptr,
struct gl_texture_object *tex)
{
diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c
index f232cfc86..dc5ee33a2 100644
--- a/mesalib/src/mesa/main/texparam.c
+++ b/mesalib/src/mesa/main/texparam.c
@@ -180,7 +180,7 @@ set_swizzle_component(GLuint *swizzle, GLuint comp, GLuint swz)
* This is called just prior to changing any texture object state which
* will not effect texture completeness.
*/
-static INLINE void
+static inline void
flush(struct gl_context *ctx)
{
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
@@ -195,7 +195,7 @@ flush(struct gl_context *ctx)
* state flag and then mark the texture object as 'incomplete' so that any
* per-texture derived state gets recomputed.
*/
-static INLINE void
+static inline void
incomplete(struct gl_context *ctx, struct gl_texture_object *texObj)
{
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
diff --git a/mesalib/src/mesa/main/texstate.h b/mesalib/src/mesa/main/texstate.h
index 1258a0705..7dc6dc6a2 100644
--- a/mesalib/src/mesa/main/texstate.h
+++ b/mesalib/src/mesa/main/texstate.h
@@ -1,92 +1,92 @@
-/**
- * \file texstate.h
- * Texture state management.
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef TEXSTATE_H
-#define TEXSTATE_H
-
-
-#include "compiler.h"
-#include "mtypes.h"
-
-
-/**
- * Return pointer to current texture unit.
- * This the texture unit set by glActiveTexture(), not glClientActiveTexture().
- */
-static INLINE struct gl_texture_unit *
-_mesa_get_current_tex_unit(struct gl_context *ctx)
-{
- ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->Texture.Unit));
- return &(ctx->Texture.Unit[ctx->Texture.CurrentUnit]);
-}
-
-
-extern void
-_mesa_copy_texture_state( const struct gl_context *src, struct gl_context *dst );
-
-extern void
-_mesa_print_texunit_state( struct gl_context *ctx, GLuint unit );
-
-
-
-/**
- * \name Called from API
- */
-/*@{*/
-
-extern void GLAPIENTRY
-_mesa_ActiveTextureARB( GLenum target );
-
-extern void GLAPIENTRY
-_mesa_ClientActiveTextureARB( GLenum target );
-
-/*@}*/
-
-
-/**
- * \name Initialization, state maintenance
- */
-/*@{*/
-
-extern void
-_mesa_update_texture( struct gl_context *ctx, GLuint new_state );
-
-extern GLboolean
-_mesa_init_texture( struct gl_context *ctx );
-
-extern void
-_mesa_free_texture_data( struct gl_context *ctx );
-
-extern void
-_mesa_update_default_objects_texture(struct gl_context *ctx);
-
-/*@}*/
-
-#endif
+/**
+ * \file texstate.h
+ * Texture state management.
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef TEXSTATE_H
+#define TEXSTATE_H
+
+
+#include "compiler.h"
+#include "mtypes.h"
+
+
+/**
+ * Return pointer to current texture unit.
+ * This the texture unit set by glActiveTexture(), not glClientActiveTexture().
+ */
+static inline struct gl_texture_unit *
+_mesa_get_current_tex_unit(struct gl_context *ctx)
+{
+ ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->Texture.Unit));
+ return &(ctx->Texture.Unit[ctx->Texture.CurrentUnit]);
+}
+
+
+extern void
+_mesa_copy_texture_state( const struct gl_context *src, struct gl_context *dst );
+
+extern void
+_mesa_print_texunit_state( struct gl_context *ctx, GLuint unit );
+
+
+
+/**
+ * \name Called from API
+ */
+/*@{*/
+
+extern void GLAPIENTRY
+_mesa_ActiveTextureARB( GLenum target );
+
+extern void GLAPIENTRY
+_mesa_ClientActiveTextureARB( GLenum target );
+
+/*@}*/
+
+
+/**
+ * \name Initialization, state maintenance
+ */
+/*@{*/
+
+extern void
+_mesa_update_texture( struct gl_context *ctx, GLuint new_state );
+
+extern GLboolean
+_mesa_init_texture( struct gl_context *ctx );
+
+extern void
+_mesa_free_texture_data( struct gl_context *ctx );
+
+extern void
+_mesa_update_default_objects_texture(struct gl_context *ctx);
+
+/*@}*/
+
+#endif
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c
index cbed26cd4..d70cb8ac7 100644
--- a/mesalib/src/mesa/main/texstore.c
+++ b/mesalib/src/mesa/main/texstore.c
@@ -458,6 +458,7 @@ make_temp_uint_image(struct gl_context *ctx, GLuint dims,
textureBaseFormat == GL_RED ||
textureBaseFormat == GL_LUMINANCE_ALPHA ||
textureBaseFormat == GL_LUMINANCE ||
+ textureBaseFormat == GL_INTENSITY ||
textureBaseFormat == GL_ALPHA);
tempImage = (GLuint *) malloc(srcWidth * srcHeight * srcDepth
@@ -3636,7 +3637,14 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS)
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
const GLint components = _mesa_components_in_format(baseFormat);
- ASSERT(dstFormat == MESA_FORMAT_RGBA_INT8);
+ ASSERT(dstFormat == MESA_FORMAT_R_INT8 ||
+ dstFormat == MESA_FORMAT_RG_INT8 ||
+ dstFormat == MESA_FORMAT_RGB_INT8 ||
+ dstFormat == MESA_FORMAT_RGBA_INT8 ||
+ dstFormat == MESA_FORMAT_ALPHA_INT8 ||
+ dstFormat == MESA_FORMAT_INTENSITY_INT8 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_INT8 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT8);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_ALPHA ||
@@ -3701,7 +3709,14 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS)
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
const GLint components = _mesa_components_in_format(baseFormat);
- ASSERT(dstFormat == MESA_FORMAT_RGBA_INT16);
+ ASSERT(dstFormat == MESA_FORMAT_R_INT16 ||
+ dstFormat == MESA_FORMAT_RG_INT16 ||
+ dstFormat == MESA_FORMAT_RGB_INT16 ||
+ dstFormat == MESA_FORMAT_RGBA_INT16 ||
+ dstFormat == MESA_FORMAT_ALPHA_INT16 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_INT16 ||
+ dstFormat == MESA_FORMAT_INTENSITY_INT16 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT16);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_ALPHA ||
@@ -3766,7 +3781,14 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS)
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
const GLint components = _mesa_components_in_format(baseFormat);
- ASSERT(dstFormat == MESA_FORMAT_RGBA_INT32);
+ ASSERT(dstFormat == MESA_FORMAT_R_INT32 ||
+ dstFormat == MESA_FORMAT_RG_INT32 ||
+ dstFormat == MESA_FORMAT_RGB_INT32 ||
+ dstFormat == MESA_FORMAT_RGBA_INT32 ||
+ dstFormat == MESA_FORMAT_ALPHA_INT32 ||
+ dstFormat == MESA_FORMAT_INTENSITY_INT32 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_INT32 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT32);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_ALPHA ||
@@ -3831,7 +3853,14 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS)
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
const GLint components = _mesa_components_in_format(baseFormat);
- ASSERT(dstFormat == MESA_FORMAT_RGBA_UINT8);
+ ASSERT(dstFormat == MESA_FORMAT_R_UINT8 ||
+ dstFormat == MESA_FORMAT_RG_UINT8 ||
+ dstFormat == MESA_FORMAT_RGB_UINT8 ||
+ dstFormat == MESA_FORMAT_RGBA_UINT8 ||
+ dstFormat == MESA_FORMAT_ALPHA_UINT8 ||
+ dstFormat == MESA_FORMAT_INTENSITY_UINT8 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_UINT8 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT8);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_ALPHA ||
@@ -3894,7 +3923,14 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS)
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
const GLint components = _mesa_components_in_format(baseFormat);
- ASSERT(dstFormat == MESA_FORMAT_RGBA_UINT16);
+ ASSERT(dstFormat == MESA_FORMAT_R_UINT16 ||
+ dstFormat == MESA_FORMAT_RG_UINT16 ||
+ dstFormat == MESA_FORMAT_RGB_UINT16 ||
+ dstFormat == MESA_FORMAT_RGBA_UINT16 ||
+ dstFormat == MESA_FORMAT_ALPHA_UINT16 ||
+ dstFormat == MESA_FORMAT_INTENSITY_UINT16 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_UINT16 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT16);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_ALPHA ||
@@ -3957,7 +3993,14 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS)
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
const GLint components = _mesa_components_in_format(baseFormat);
- ASSERT(dstFormat == MESA_FORMAT_RGBA_UINT32);
+ ASSERT(dstFormat == MESA_FORMAT_R_UINT32 ||
+ dstFormat == MESA_FORMAT_RG_UINT32 ||
+ dstFormat == MESA_FORMAT_RGB_UINT32 ||
+ dstFormat == MESA_FORMAT_RGBA_UINT32 ||
+ dstFormat == MESA_FORMAT_ALPHA_UINT32 ||
+ dstFormat == MESA_FORMAT_INTENSITY_UINT32 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_UINT32 ||
+ dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT32);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_ALPHA ||
@@ -4307,145 +4350,6 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
return GL_TRUE;
}
-
-/**
- * Table mapping MESA_FORMAT_* to _mesa_texstore_*()
- * XXX this is somewhat temporary.
- */
-static const struct {
- gl_format Name;
- StoreTexImageFunc Store;
-}
-texstore_funcs[MESA_FORMAT_COUNT] =
-{
- { MESA_FORMAT_NONE, NULL },
- { MESA_FORMAT_RGBA8888, _mesa_texstore_rgba8888 },
- { MESA_FORMAT_RGBA8888_REV, _mesa_texstore_rgba8888 },
- { MESA_FORMAT_ARGB8888, _mesa_texstore_argb8888 },
- { MESA_FORMAT_ARGB8888_REV, _mesa_texstore_argb8888 },
- { MESA_FORMAT_XRGB8888, _mesa_texstore_argb8888 },
- { MESA_FORMAT_XRGB8888_REV, _mesa_texstore_argb8888 },
- { MESA_FORMAT_RGB888, _mesa_texstore_rgb888 },
- { MESA_FORMAT_BGR888, _mesa_texstore_bgr888 },
- { MESA_FORMAT_RGB565, _mesa_texstore_rgb565 },
- { MESA_FORMAT_RGB565_REV, _mesa_texstore_rgb565 },
- { MESA_FORMAT_ARGB4444, _mesa_texstore_argb4444 },
- { MESA_FORMAT_ARGB4444_REV, _mesa_texstore_argb4444 },
- { MESA_FORMAT_RGBA5551, _mesa_texstore_rgba5551 },
- { MESA_FORMAT_ARGB1555, _mesa_texstore_argb1555 },
- { MESA_FORMAT_ARGB1555_REV, _mesa_texstore_argb1555 },
- { MESA_FORMAT_AL44, _mesa_texstore_unorm44 },
- { MESA_FORMAT_AL88, _mesa_texstore_unorm88 },
- { MESA_FORMAT_AL88_REV, _mesa_texstore_unorm88 },
- { MESA_FORMAT_AL1616, _mesa_texstore_unorm1616 },
- { MESA_FORMAT_AL1616_REV, _mesa_texstore_unorm1616 },
- { MESA_FORMAT_RGB332, _mesa_texstore_rgb332 },
- { MESA_FORMAT_A8, _mesa_texstore_unorm8 },
- { MESA_FORMAT_A16, _mesa_texstore_unorm16 },
- { MESA_FORMAT_L8, _mesa_texstore_unorm8 },
- { MESA_FORMAT_L16, _mesa_texstore_unorm16 },
- { MESA_FORMAT_I8, _mesa_texstore_unorm8 },
- { MESA_FORMAT_I16, _mesa_texstore_unorm16 },
- { MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr },
- { MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr },
- { MESA_FORMAT_R8, _mesa_texstore_unorm8 },
- { MESA_FORMAT_RG88, _mesa_texstore_unorm88 },
- { MESA_FORMAT_RG88_REV, _mesa_texstore_unorm88 },
- { MESA_FORMAT_R16, _mesa_texstore_unorm16 },
- { MESA_FORMAT_RG1616, _mesa_texstore_unorm1616 },
- { MESA_FORMAT_RG1616_REV, _mesa_texstore_unorm1616 },
- { MESA_FORMAT_ARGB2101010, _mesa_texstore_argb2101010 },
- { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 },
- { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 },
- { MESA_FORMAT_Z16, _mesa_texstore_z16 },
- { MESA_FORMAT_X8_Z24, _mesa_texstore_x8_z24 },
- { MESA_FORMAT_Z24_X8, _mesa_texstore_z24_x8 },
- { MESA_FORMAT_Z32, _mesa_texstore_z32 },
- { MESA_FORMAT_S8, _mesa_texstore_s8 },
- { MESA_FORMAT_SRGB8, _mesa_texstore_srgb8 },
- { MESA_FORMAT_SRGBA8, _mesa_texstore_srgba8 },
- { MESA_FORMAT_SARGB8, _mesa_texstore_sargb8 },
- { MESA_FORMAT_SL8, _mesa_texstore_sl8 },
- { MESA_FORMAT_SLA8, _mesa_texstore_sla8 },
- { MESA_FORMAT_SRGB_DXT1, _mesa_texstore_rgb_dxt1 },
- { MESA_FORMAT_SRGBA_DXT1, _mesa_texstore_rgba_dxt1 },
- { MESA_FORMAT_SRGBA_DXT3, _mesa_texstore_rgba_dxt3 },
- { MESA_FORMAT_SRGBA_DXT5, _mesa_texstore_rgba_dxt5 },
- { MESA_FORMAT_RGB_FXT1, _mesa_texstore_rgb_fxt1 },
- { MESA_FORMAT_RGBA_FXT1, _mesa_texstore_rgba_fxt1 },
- { MESA_FORMAT_RGB_DXT1, _mesa_texstore_rgb_dxt1 },
- { MESA_FORMAT_RGBA_DXT1, _mesa_texstore_rgba_dxt1 },
- { MESA_FORMAT_RGBA_DXT3, _mesa_texstore_rgba_dxt3 },
- { MESA_FORMAT_RGBA_DXT5, _mesa_texstore_rgba_dxt5 },
- { MESA_FORMAT_RGBA_FLOAT32, _mesa_texstore_rgba_float32 },
- { MESA_FORMAT_RGBA_FLOAT16, _mesa_texstore_rgba_float16 },
- { MESA_FORMAT_RGB_FLOAT32, _mesa_texstore_rgba_float32 },
- { MESA_FORMAT_RGB_FLOAT16, _mesa_texstore_rgba_float16 },
- { MESA_FORMAT_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 },
- { MESA_FORMAT_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 },
- { MESA_FORMAT_LUMINANCE_FLOAT32, _mesa_texstore_rgba_float32 },
- { MESA_FORMAT_LUMINANCE_FLOAT16, _mesa_texstore_rgba_float16 },
- { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 },
- { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 },
- { MESA_FORMAT_INTENSITY_FLOAT32, _mesa_texstore_rgba_float32 },
- { MESA_FORMAT_INTENSITY_FLOAT16, _mesa_texstore_rgba_float16 },
- { MESA_FORMAT_R_FLOAT32, _mesa_texstore_rgba_float32 },
- { MESA_FORMAT_R_FLOAT16, _mesa_texstore_rgba_float16 },
- { MESA_FORMAT_RG_FLOAT32, _mesa_texstore_rgba_float32 },
- { MESA_FORMAT_RG_FLOAT16, _mesa_texstore_rgba_float16 },
-
- { MESA_FORMAT_RGBA_INT8, _mesa_texstore_rgba_int8 },
- { MESA_FORMAT_RGBA_INT16, _mesa_texstore_rgba_int16 },
- { MESA_FORMAT_RGBA_INT32, _mesa_texstore_rgba_int32 },
- { MESA_FORMAT_RGBA_UINT8, _mesa_texstore_rgba_uint8 },
- { MESA_FORMAT_RGBA_UINT16, _mesa_texstore_rgba_uint16 },
- { MESA_FORMAT_RGBA_UINT32, _mesa_texstore_rgba_uint32 },
-
- { MESA_FORMAT_DUDV8, _mesa_texstore_dudv8 },
-
- { MESA_FORMAT_SIGNED_R8, _mesa_texstore_snorm8 },
- { MESA_FORMAT_SIGNED_RG88_REV, _mesa_texstore_snorm88 },
- { MESA_FORMAT_SIGNED_RGBX8888, _mesa_texstore_signed_rgbx8888 },
-
- { MESA_FORMAT_SIGNED_RGBA8888, _mesa_texstore_signed_rgba8888 },
- { MESA_FORMAT_SIGNED_RGBA8888_REV, _mesa_texstore_signed_rgba8888 },
-
- { MESA_FORMAT_SIGNED_R16, _mesa_texstore_snorm16 },
- { MESA_FORMAT_SIGNED_GR1616, _mesa_texstore_snorm1616 },
- { MESA_FORMAT_SIGNED_RGB_16, _mesa_texstore_signed_rgba_16 },
- { MESA_FORMAT_SIGNED_RGBA_16, _mesa_texstore_signed_rgba_16 },
- { MESA_FORMAT_RGBA_16, _mesa_texstore_rgba_16 },
-
- { MESA_FORMAT_RED_RGTC1, _mesa_texstore_red_rgtc1 },
- { MESA_FORMAT_SIGNED_RED_RGTC1, _mesa_texstore_signed_red_rgtc1 },
- { MESA_FORMAT_RG_RGTC2, _mesa_texstore_rg_rgtc2 },
- { MESA_FORMAT_SIGNED_RG_RGTC2, _mesa_texstore_signed_rg_rgtc2 },
-
- /* Re-use the R/RG texstore functions.
- * The code is generic enough to handle LATC too. */
- { MESA_FORMAT_L_LATC1, _mesa_texstore_red_rgtc1 },
- { MESA_FORMAT_SIGNED_L_LATC1, _mesa_texstore_signed_red_rgtc1 },
- { MESA_FORMAT_LA_LATC2, _mesa_texstore_rg_rgtc2 },
- { MESA_FORMAT_SIGNED_LA_LATC2, _mesa_texstore_signed_rg_rgtc2 },
-
- { MESA_FORMAT_SIGNED_A8, _mesa_texstore_snorm8 },
- { MESA_FORMAT_SIGNED_L8, _mesa_texstore_snorm8 },
- { MESA_FORMAT_SIGNED_AL88, _mesa_texstore_snorm88 },
- { MESA_FORMAT_SIGNED_I8, _mesa_texstore_snorm8 },
-
- { MESA_FORMAT_SIGNED_A16, _mesa_texstore_snorm16 },
- { MESA_FORMAT_SIGNED_L16, _mesa_texstore_snorm16 },
- { MESA_FORMAT_SIGNED_AL1616, _mesa_texstore_snorm1616 },
- { MESA_FORMAT_SIGNED_I16, _mesa_texstore_snorm16 },
-
- { MESA_FORMAT_RGB9_E5_FLOAT, _mesa_texstore_rgb9_e5 },
- { MESA_FORMAT_R11_G11_B10_FLOAT, _mesa_texstore_r11_g11_b10f },
-
- { MESA_FORMAT_Z32_FLOAT, _mesa_texstore_z32 },
- { MESA_FORMAT_Z32_FLOAT_X24S8, _mesa_texstore_z32f_x24s8 },
-};
-
-
static GLboolean
_mesa_texstore_null(TEXSTORE_PARAMS)
{
@@ -4472,18 +4376,177 @@ _mesa_texstore_null(TEXSTORE_PARAMS)
static StoreTexImageFunc
_mesa_get_texstore_func(gl_format format)
{
-#ifdef DEBUG
- GLuint i;
- for (i = 0; i < MESA_FORMAT_COUNT; i++) {
- ASSERT(texstore_funcs[i].Name == i);
+ static StoreTexImageFunc table[MESA_FORMAT_COUNT];
+ static GLboolean initialized = GL_FALSE;
+
+ if (!initialized) {
+ table[MESA_FORMAT_NONE] = _mesa_texstore_null;
+
+ table[MESA_FORMAT_RGBA8888] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_RGBA8888_REV] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_ARGB8888] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_ARGB8888_REV] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_XRGB8888] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_XRGB8888_REV] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_RGB888] = _mesa_texstore_rgb888;
+ table[MESA_FORMAT_BGR888] = _mesa_texstore_bgr888;
+ table[MESA_FORMAT_RGB565] = _mesa_texstore_rgb565;
+ table[MESA_FORMAT_RGB565_REV] = _mesa_texstore_rgb565;
+ table[MESA_FORMAT_ARGB4444] = _mesa_texstore_argb4444;
+ table[MESA_FORMAT_ARGB4444_REV] = _mesa_texstore_argb4444;
+ table[MESA_FORMAT_RGBA5551] = _mesa_texstore_rgba5551;
+ table[MESA_FORMAT_ARGB1555] = _mesa_texstore_argb1555;
+ table[MESA_FORMAT_ARGB1555_REV] = _mesa_texstore_argb1555;
+ table[MESA_FORMAT_AL44] = _mesa_texstore_unorm44;
+ table[MESA_FORMAT_AL88] = _mesa_texstore_unorm88;
+ table[MESA_FORMAT_AL88_REV] = _mesa_texstore_unorm88;
+ table[MESA_FORMAT_AL1616] = _mesa_texstore_unorm1616;
+ table[MESA_FORMAT_AL1616_REV] = _mesa_texstore_unorm1616;
+ table[MESA_FORMAT_RGB332] = _mesa_texstore_rgb332;
+ table[MESA_FORMAT_A8] = _mesa_texstore_unorm8;
+ table[MESA_FORMAT_A16] = _mesa_texstore_unorm16;
+ table[MESA_FORMAT_L8] = _mesa_texstore_unorm8;
+ table[MESA_FORMAT_L16] = _mesa_texstore_unorm16;
+ table[MESA_FORMAT_I8] = _mesa_texstore_unorm8;
+ table[MESA_FORMAT_I16] = _mesa_texstore_unorm16;
+ table[MESA_FORMAT_YCBCR] = _mesa_texstore_ycbcr;
+ table[MESA_FORMAT_YCBCR_REV] = _mesa_texstore_ycbcr;
+ table[MESA_FORMAT_R8] = _mesa_texstore_unorm8;
+ table[MESA_FORMAT_RG88] = _mesa_texstore_unorm88;
+ table[MESA_FORMAT_RG88_REV] = _mesa_texstore_unorm88;
+ table[MESA_FORMAT_R16] = _mesa_texstore_unorm16;
+ table[MESA_FORMAT_RG1616] = _mesa_texstore_unorm1616;
+ table[MESA_FORMAT_RG1616_REV] = _mesa_texstore_unorm1616;
+ table[MESA_FORMAT_ARGB2101010] = _mesa_texstore_argb2101010;
+ table[MESA_FORMAT_Z24_S8] = _mesa_texstore_z24_s8;
+ table[MESA_FORMAT_S8_Z24] = _mesa_texstore_s8_z24;
+ table[MESA_FORMAT_Z16] = _mesa_texstore_z16;
+ table[MESA_FORMAT_X8_Z24] = _mesa_texstore_x8_z24;
+ table[MESA_FORMAT_Z24_X8] = _mesa_texstore_z24_x8;
+ table[MESA_FORMAT_Z32] = _mesa_texstore_z32;
+ table[MESA_FORMAT_S8] = _mesa_texstore_s8;
+ table[MESA_FORMAT_SRGB8] = _mesa_texstore_srgb8;
+ table[MESA_FORMAT_SRGBA8] = _mesa_texstore_srgba8;
+ table[MESA_FORMAT_SARGB8] = _mesa_texstore_sargb8;
+ table[MESA_FORMAT_SL8] = _mesa_texstore_sl8;
+ table[MESA_FORMAT_SLA8] = _mesa_texstore_sla8;
+ table[MESA_FORMAT_SRGB_DXT1] = _mesa_texstore_rgb_dxt1;
+ table[MESA_FORMAT_SRGBA_DXT1] = _mesa_texstore_rgba_dxt1;
+ table[MESA_FORMAT_SRGBA_DXT3] = _mesa_texstore_rgba_dxt3;
+ table[MESA_FORMAT_SRGBA_DXT5] = _mesa_texstore_rgba_dxt5;
+ table[MESA_FORMAT_RGB_FXT1] = _mesa_texstore_rgb_fxt1;
+ table[MESA_FORMAT_RGBA_FXT1] = _mesa_texstore_rgba_fxt1;
+ table[MESA_FORMAT_RGB_DXT1] = _mesa_texstore_rgb_dxt1;
+ table[MESA_FORMAT_RGBA_DXT1] = _mesa_texstore_rgba_dxt1;
+ table[MESA_FORMAT_RGBA_DXT3] = _mesa_texstore_rgba_dxt3;
+ table[MESA_FORMAT_RGBA_DXT5] = _mesa_texstore_rgba_dxt5;
+ table[MESA_FORMAT_RGBA_FLOAT32] = _mesa_texstore_rgba_float32;
+ table[MESA_FORMAT_RGBA_FLOAT16] = _mesa_texstore_rgba_float16;
+ table[MESA_FORMAT_RGB_FLOAT32] = _mesa_texstore_rgba_float32;
+ table[MESA_FORMAT_RGB_FLOAT16] = _mesa_texstore_rgba_float16;
+ table[MESA_FORMAT_ALPHA_FLOAT32] = _mesa_texstore_rgba_float32;
+ table[MESA_FORMAT_ALPHA_FLOAT16] = _mesa_texstore_rgba_float16;
+ table[MESA_FORMAT_LUMINANCE_FLOAT32] = _mesa_texstore_rgba_float32;
+ table[MESA_FORMAT_LUMINANCE_FLOAT16] = _mesa_texstore_rgba_float16;
+ table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32] = _mesa_texstore_rgba_float32;
+ table[MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16] = _mesa_texstore_rgba_float16;
+ table[MESA_FORMAT_INTENSITY_FLOAT32] = _mesa_texstore_rgba_float32;
+ table[MESA_FORMAT_INTENSITY_FLOAT16] = _mesa_texstore_rgba_float16;
+ table[MESA_FORMAT_R_FLOAT32] = _mesa_texstore_rgba_float32;
+ table[MESA_FORMAT_R_FLOAT16] = _mesa_texstore_rgba_float16;
+ table[MESA_FORMAT_RG_FLOAT32] = _mesa_texstore_rgba_float32;
+ table[MESA_FORMAT_RG_FLOAT16] = _mesa_texstore_rgba_float16;
+ table[MESA_FORMAT_DUDV8] = _mesa_texstore_dudv8;
+ table[MESA_FORMAT_SIGNED_R8] = _mesa_texstore_snorm8;
+ table[MESA_FORMAT_SIGNED_RG88_REV] = _mesa_texstore_snorm88;
+ table[MESA_FORMAT_SIGNED_RGBX8888] = _mesa_texstore_signed_rgbx8888;
+ table[MESA_FORMAT_SIGNED_RGBA8888] = _mesa_texstore_signed_rgba8888;
+ table[MESA_FORMAT_SIGNED_RGBA8888_REV] = _mesa_texstore_signed_rgba8888;
+ table[MESA_FORMAT_SIGNED_R16] = _mesa_texstore_snorm16;
+ table[MESA_FORMAT_SIGNED_GR1616] = _mesa_texstore_snorm1616;
+ table[MESA_FORMAT_SIGNED_RGB_16] = _mesa_texstore_signed_rgba_16;
+ table[MESA_FORMAT_SIGNED_RGBA_16] = _mesa_texstore_signed_rgba_16;
+ table[MESA_FORMAT_RGBA_16] = _mesa_texstore_rgba_16;
+ table[MESA_FORMAT_RED_RGTC1] = _mesa_texstore_red_rgtc1;
+ table[MESA_FORMAT_SIGNED_RED_RGTC1] = _mesa_texstore_signed_red_rgtc1;
+ table[MESA_FORMAT_RG_RGTC2] = _mesa_texstore_rg_rgtc2;
+ table[MESA_FORMAT_SIGNED_RG_RGTC2] = _mesa_texstore_signed_rg_rgtc2;
+ table[MESA_FORMAT_L_LATC1] = _mesa_texstore_red_rgtc1;
+ table[MESA_FORMAT_SIGNED_L_LATC1] = _mesa_texstore_signed_red_rgtc1;
+ table[MESA_FORMAT_LA_LATC2] = _mesa_texstore_rg_rgtc2;
+ table[MESA_FORMAT_SIGNED_LA_LATC2] = _mesa_texstore_signed_rg_rgtc2;
+ table[MESA_FORMAT_SIGNED_A8] = _mesa_texstore_snorm8;
+ table[MESA_FORMAT_SIGNED_L8] = _mesa_texstore_snorm8;
+ table[MESA_FORMAT_SIGNED_AL88] = _mesa_texstore_snorm88;
+ table[MESA_FORMAT_SIGNED_I8] = _mesa_texstore_snorm8;
+ table[MESA_FORMAT_SIGNED_A16] = _mesa_texstore_snorm16;
+ table[MESA_FORMAT_SIGNED_L16] = _mesa_texstore_snorm16;
+ table[MESA_FORMAT_SIGNED_AL1616] = _mesa_texstore_snorm1616;
+ table[MESA_FORMAT_SIGNED_I16] = _mesa_texstore_snorm16;
+ table[MESA_FORMAT_RGB9_E5_FLOAT] = _mesa_texstore_rgb9_e5;
+ table[MESA_FORMAT_R11_G11_B10_FLOAT] = _mesa_texstore_r11_g11_b10f;
+ table[MESA_FORMAT_Z32_FLOAT] = _mesa_texstore_z32;
+ table[MESA_FORMAT_Z32_FLOAT_X24S8] = _mesa_texstore_z32f_x24s8;
+
+ table[MESA_FORMAT_ALPHA_UINT8] = _mesa_texstore_rgba_uint8;
+ table[MESA_FORMAT_ALPHA_UINT16] = _mesa_texstore_rgba_uint16;
+ table[MESA_FORMAT_ALPHA_UINT32] = _mesa_texstore_rgba_uint32;
+ table[MESA_FORMAT_ALPHA_INT8] = _mesa_texstore_rgba_int8;
+ table[MESA_FORMAT_ALPHA_INT16] = _mesa_texstore_rgba_int16;
+ table[MESA_FORMAT_ALPHA_INT32] = _mesa_texstore_rgba_int32;
+
+ table[MESA_FORMAT_INTENSITY_UINT8] = _mesa_texstore_rgba_uint8;
+ table[MESA_FORMAT_INTENSITY_UINT16] = _mesa_texstore_rgba_uint16;
+ table[MESA_FORMAT_INTENSITY_UINT32] = _mesa_texstore_rgba_uint32;
+ table[MESA_FORMAT_INTENSITY_INT8] = _mesa_texstore_rgba_int8;
+ table[MESA_FORMAT_INTENSITY_INT16] = _mesa_texstore_rgba_int16;
+ table[MESA_FORMAT_INTENSITY_INT32] = _mesa_texstore_rgba_int32;
+
+ table[MESA_FORMAT_LUMINANCE_UINT8] = _mesa_texstore_rgba_uint8;
+ table[MESA_FORMAT_LUMINANCE_UINT16] = _mesa_texstore_rgba_uint16;
+ table[MESA_FORMAT_LUMINANCE_UINT32] = _mesa_texstore_rgba_uint32;
+ table[MESA_FORMAT_LUMINANCE_INT8] = _mesa_texstore_rgba_int8;
+ table[MESA_FORMAT_LUMINANCE_INT16] = _mesa_texstore_rgba_int16;
+ table[MESA_FORMAT_LUMINANCE_INT32] = _mesa_texstore_rgba_int32;
+
+ table[MESA_FORMAT_LUMINANCE_ALPHA_UINT8] = _mesa_texstore_rgba_uint8;
+ table[MESA_FORMAT_LUMINANCE_ALPHA_UINT16] = _mesa_texstore_rgba_uint16;
+ table[MESA_FORMAT_LUMINANCE_ALPHA_UINT32] = _mesa_texstore_rgba_uint32;
+ table[MESA_FORMAT_LUMINANCE_ALPHA_INT8] = _mesa_texstore_rgba_int8;
+ table[MESA_FORMAT_LUMINANCE_ALPHA_INT16] = _mesa_texstore_rgba_int16;
+ table[MESA_FORMAT_LUMINANCE_ALPHA_INT32] = _mesa_texstore_rgba_int32;
+
+ table[MESA_FORMAT_R_INT8] = _mesa_texstore_rgba_int8;
+ table[MESA_FORMAT_RG_INT8] = _mesa_texstore_rgba_int8;
+ table[MESA_FORMAT_RGB_INT8] = _mesa_texstore_rgba_int8;
+ table[MESA_FORMAT_RGBA_INT8] = _mesa_texstore_rgba_int8;
+ table[MESA_FORMAT_R_INT16] = _mesa_texstore_rgba_int16;
+ table[MESA_FORMAT_RG_INT16] = _mesa_texstore_rgba_int16;
+ table[MESA_FORMAT_RGB_INT16] = _mesa_texstore_rgba_int16;
+ table[MESA_FORMAT_RGBA_INT16] = _mesa_texstore_rgba_int16;
+ table[MESA_FORMAT_R_INT32] = _mesa_texstore_rgba_int32;
+ table[MESA_FORMAT_RG_INT32] = _mesa_texstore_rgba_int32;
+ table[MESA_FORMAT_RGB_INT32] = _mesa_texstore_rgba_int32;
+ table[MESA_FORMAT_RGBA_INT32] = _mesa_texstore_rgba_int32;
+
+ table[MESA_FORMAT_R_UINT8] = _mesa_texstore_rgba_uint8;
+ table[MESA_FORMAT_RG_UINT8] = _mesa_texstore_rgba_uint8;
+ table[MESA_FORMAT_RGB_UINT8] = _mesa_texstore_rgba_uint8;
+ table[MESA_FORMAT_RGBA_UINT8] = _mesa_texstore_rgba_uint8;
+ table[MESA_FORMAT_R_UINT16] = _mesa_texstore_rgba_uint16;
+ table[MESA_FORMAT_RG_UINT16] = _mesa_texstore_rgba_uint16;
+ table[MESA_FORMAT_RGB_UINT16] = _mesa_texstore_rgba_uint16;
+ table[MESA_FORMAT_RGBA_UINT16] = _mesa_texstore_rgba_uint16;
+ table[MESA_FORMAT_R_UINT32] = _mesa_texstore_rgba_uint32;
+ table[MESA_FORMAT_RG_UINT32] = _mesa_texstore_rgba_uint32;
+ table[MESA_FORMAT_RGB_UINT32] = _mesa_texstore_rgba_uint32;
+ table[MESA_FORMAT_RGBA_UINT32] = _mesa_texstore_rgba_uint32;
+
+ initialized = GL_TRUE;
}
-#endif
- ASSERT(texstore_funcs[format].Name == format);
- if (texstore_funcs[format].Store)
- return texstore_funcs[format].Store;
- else
- return _mesa_texstore_null;
+ ASSERT(table[format]);
+ return table[format];
}
@@ -4626,22 +4689,53 @@ _mesa_store_teximage2d(struct gl_context *ctx, GLenum target, GLint level,
return;
}
- /* Map dest texture buffer (write to whole region) */
- ctx->Driver.MapTextureImage(ctx, texImage, 0,
- 0, 0, width, height,
- rwMode,
- &dstMap, &dstRowStride);
- assert(dstMap);
- success = _mesa_texstore(ctx, 2, texImage->_BaseFormat,
- texImage->TexFormat,
- dstMap,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- &zeroImageOffset,
- width, height, 1,
- format, type, pixels, packing);
-
- ctx->Driver.UnmapTextureImage(ctx, texImage, 0);
+ if (target == GL_TEXTURE_1D_ARRAY) {
+ const GLint srcStride =
+ _mesa_image_row_stride(packing, width, format, type);
+ int y;
+
+ success = GL_TRUE;
+
+ for (y = 0; y < height; y++) {
+ /* Map dest texture buffer (write to whole region) */
+ ctx->Driver.MapTextureImage(ctx, texImage, y,
+ 0, 0, width, 1,
+ rwMode,
+ &dstMap, &dstRowStride);
+ assert(dstMap);
+ success = _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat,
+ dstMap,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ &zeroImageOffset,
+ width, 1, 1,
+ format, type, pixels, packing);
+ ctx->Driver.UnmapTextureImage(ctx, texImage, y);
+
+ if (!success)
+ break;
+
+ pixels = (const GLubyte *) pixels + srcStride;
+ }
+ } else {
+ /* Map dest texture buffer (write to whole region) */
+ ctx->Driver.MapTextureImage(ctx, texImage, 0,
+ 0, 0, width, height,
+ rwMode,
+ &dstMap, &dstRowStride);
+ assert(dstMap);
+ success = _mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat,
+ dstMap,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ &zeroImageOffset,
+ width, height, 1,
+ format, type, pixels, packing);
+
+ ctx->Driver.UnmapTextureImage(ctx, texImage, 0);
+ }
if (!success)
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
@@ -4691,6 +4785,11 @@ _mesa_store_teximage3d(struct gl_context *ctx, GLenum target, GLint level,
return;
}
+ if (target == GL_TEXTURE_1D_ARRAY) {
+ depth = height;
+ height = 1;
+ }
+
sliceMaps = (GLubyte **) malloc(depth * sizeof(GLubyte *));
dstImageOffsets = (GLuint *) malloc(depth * sizeof(GLuint));
diff --git a/mesalib/src/mesa/main/transformfeedback.h b/mesalib/src/mesa/main/transformfeedback.h
index add8d22d6..9447effa9 100644
--- a/mesalib/src/mesa/main/transformfeedback.h
+++ b/mesalib/src/mesa/main/transformfeedback.h
@@ -1,137 +1,137 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 2010 VMware, Inc. 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS 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.
- */
-
-
-#ifndef TRANSFORM_FEEDBACK_H
-#define TRANSFORM_FEEDBACK_H
-
-#include "compiler.h"
-#include "glheader.h"
-#include "mfeatures.h"
-
-struct _glapi_table;
-struct dd_function_table;
-struct gl_context;
-
-extern void
-_mesa_init_transform_feedback(struct gl_context *ctx);
-
-extern void
-_mesa_free_transform_feedback(struct gl_context *ctx);
-
-#if FEATURE_EXT_transform_feedback
-
-extern GLboolean
-_mesa_validate_primitive_mode(struct gl_context *ctx, GLenum mode);
-
-extern GLboolean
-_mesa_validate_transform_feedback_buffers(struct gl_context *ctx);
-
-
-extern void
-_mesa_init_transform_feedback_functions(struct dd_function_table *driver);
-
-extern void
-_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp);
-
-
-/*** GL_EXT_transform_feedback ***/
-
-extern void GLAPIENTRY
-_mesa_BeginTransformFeedback(GLenum mode);
-
-extern void GLAPIENTRY
-_mesa_EndTransformFeedback(void);
-
-extern void GLAPIENTRY
-_mesa_BindBufferRange(GLenum target, GLuint index,
- GLuint buffer, GLintptr offset, GLsizeiptr size);
-
-extern void GLAPIENTRY
-_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer);
-
-extern void GLAPIENTRY
-_mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer,
- GLintptr offset);
-
-extern void GLAPIENTRY
-_mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
- const GLchar **varyings, GLenum bufferMode);
-
-extern void GLAPIENTRY
-_mesa_GetTransformFeedbackVarying(GLuint program, GLuint index,
- GLsizei bufSize, GLsizei *length,
- GLsizei *size, GLenum *type, GLchar *name);
-
-
-
-/*** GL_ARB_transform_feedback2 ***/
-
-extern void GLAPIENTRY
-_mesa_GenTransformFeedbacks(GLsizei n, GLuint *names);
-
-extern GLboolean GLAPIENTRY
-_mesa_IsTransformFeedback(GLuint name);
-
-extern void GLAPIENTRY
-_mesa_BindTransformFeedback(GLenum target, GLuint name);
-
-extern void GLAPIENTRY
-_mesa_DeleteTransformFeedbacks(GLsizei n, const GLuint *names);
-
-extern void GLAPIENTRY
-_mesa_PauseTransformFeedback(void);
-
-extern void GLAPIENTRY
-_mesa_ResumeTransformFeedback(void);
-
-extern void GLAPIENTRY
-_mesa_DrawTransformFeedback(GLenum mode, GLuint name);
-
-#else /* FEATURE_EXT_transform_feedback */
-
-static INLINE GLboolean
-_mesa_validate_primitive_mode(struct gl_context *ctx, GLenum mode)
-{
- return GL_TRUE;
-}
-
-static INLINE GLboolean
-_mesa_validate_transform_feedback_buffers(struct gl_context *ctx)
-{
- return GL_TRUE;
-}
-
-static INLINE void
-_mesa_init_transform_feedback_functions(struct dd_function_table *driver)
-{
-}
-
-static INLINE void
-_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp)
-{
-}
-
-#endif /* FEATURE_EXT_transform_feedback */
-
-#endif /* TRANSFORM_FEEDBACK_H */
+/*
+ * Mesa 3-D graphics library
+ *
+ * Copyright (C) 2010 VMware, Inc. 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS 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.
+ */
+
+
+#ifndef TRANSFORM_FEEDBACK_H
+#define TRANSFORM_FEEDBACK_H
+
+#include "compiler.h"
+#include "glheader.h"
+#include "mfeatures.h"
+
+struct _glapi_table;
+struct dd_function_table;
+struct gl_context;
+
+extern void
+_mesa_init_transform_feedback(struct gl_context *ctx);
+
+extern void
+_mesa_free_transform_feedback(struct gl_context *ctx);
+
+#if FEATURE_EXT_transform_feedback
+
+extern GLboolean
+_mesa_validate_primitive_mode(struct gl_context *ctx, GLenum mode);
+
+extern GLboolean
+_mesa_validate_transform_feedback_buffers(struct gl_context *ctx);
+
+
+extern void
+_mesa_init_transform_feedback_functions(struct dd_function_table *driver);
+
+extern void
+_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp);
+
+
+/*** GL_EXT_transform_feedback ***/
+
+extern void GLAPIENTRY
+_mesa_BeginTransformFeedback(GLenum mode);
+
+extern void GLAPIENTRY
+_mesa_EndTransformFeedback(void);
+
+extern void GLAPIENTRY
+_mesa_BindBufferRange(GLenum target, GLuint index,
+ GLuint buffer, GLintptr offset, GLsizeiptr size);
+
+extern void GLAPIENTRY
+_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer);
+
+extern void GLAPIENTRY
+_mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer,
+ GLintptr offset);
+
+extern void GLAPIENTRY
+_mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
+ const GLchar **varyings, GLenum bufferMode);
+
+extern void GLAPIENTRY
+_mesa_GetTransformFeedbackVarying(GLuint program, GLuint index,
+ GLsizei bufSize, GLsizei *length,
+ GLsizei *size, GLenum *type, GLchar *name);
+
+
+
+/*** GL_ARB_transform_feedback2 ***/
+
+extern void GLAPIENTRY
+_mesa_GenTransformFeedbacks(GLsizei n, GLuint *names);
+
+extern GLboolean GLAPIENTRY
+_mesa_IsTransformFeedback(GLuint name);
+
+extern void GLAPIENTRY
+_mesa_BindTransformFeedback(GLenum target, GLuint name);
+
+extern void GLAPIENTRY
+_mesa_DeleteTransformFeedbacks(GLsizei n, const GLuint *names);
+
+extern void GLAPIENTRY
+_mesa_PauseTransformFeedback(void);
+
+extern void GLAPIENTRY
+_mesa_ResumeTransformFeedback(void);
+
+extern void GLAPIENTRY
+_mesa_DrawTransformFeedback(GLenum mode, GLuint name);
+
+#else /* FEATURE_EXT_transform_feedback */
+
+static inline GLboolean
+_mesa_validate_primitive_mode(struct gl_context *ctx, GLenum mode)
+{
+ return GL_TRUE;
+}
+
+static inline GLboolean
+_mesa_validate_transform_feedback_buffers(struct gl_context *ctx)
+{
+ return GL_TRUE;
+}
+
+static inline void
+_mesa_init_transform_feedback_functions(struct dd_function_table *driver)
+{
+}
+
+static inline void
+_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_EXT_transform_feedback */
+
+#endif /* TRANSFORM_FEEDBACK_H */
diff --git a/mesalib/src/mesa/main/varray.h b/mesalib/src/mesa/main/varray.h
index 1c423200f..6fcc0a336 100644
--- a/mesalib/src/mesa/main/varray.h
+++ b/mesalib/src/mesa/main/varray.h
@@ -41,7 +41,7 @@ struct gl_context;
* The array->_MaxElement field will be updated.
* Later in glDrawArrays/Elements/etc we can do some bounds checking.
*/
-static INLINE void
+static inline void
_mesa_update_array_max_element(struct gl_client_array *array)
{
assert(array->Enabled);
diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c
index ff9b09e29..fbe211182 100644
--- a/mesalib/src/mesa/main/version.c
+++ b/mesalib/src/mesa/main/version.c
@@ -104,7 +104,6 @@ compute_version(struct gl_context *ctx)
ctx->Extensions.ARB_occlusion_query &&
ctx->Extensions.EXT_shadow_funcs);
const GLboolean ver_2_0 = (ver_1_5 &&
- ctx->Extensions.ARB_draw_buffers &&
ctx->Extensions.ARB_point_sprite &&
ctx->Extensions.ARB_shader_objects &&
ctx->Extensions.ARB_vertex_shader &&
diff --git a/mesalib/src/mesa/main/vtxfmt.h b/mesalib/src/mesa/main/vtxfmt.h
index d403669c2..aac656879 100644
--- a/mesalib/src/mesa/main/vtxfmt.h
+++ b/mesalib/src/mesa/main/vtxfmt.h
@@ -1,59 +1,59 @@
-/**
- * \file vtxfmt.h
- *
- * \author Keith Whitwell <keith@tungstengraphics.com>
- * \author Gareth Hughes
- */
-
-/*
- * Mesa 3-D graphics library
- * Version: 6.1
- *
- * Copyright (C) 1999-2004 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#ifndef _VTXFMT_H_
-#define _VTXFMT_H_
-
-#include "compiler.h"
-#include "mfeatures.h"
-#include "mtypes.h"
-
-#if FEATURE_beginend
-
-extern void _mesa_install_exec_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt );
-extern void _mesa_install_save_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt );
-
-#else /* FEATURE_beginend */
-
-static INLINE void
-_mesa_install_exec_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt )
-{
-}
-
-static INLINE void
-_mesa_install_save_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt )
-{
-}
-
-#endif /* FEATURE_beginend */
-
-#endif /* _VTXFMT_H_ */
+/**
+ * \file vtxfmt.h
+ *
+ * \author Keith Whitwell <keith@tungstengraphics.com>
+ * \author Gareth Hughes
+ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.1
+ *
+ * Copyright (C) 1999-2004 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#ifndef _VTXFMT_H_
+#define _VTXFMT_H_
+
+#include "compiler.h"
+#include "mfeatures.h"
+#include "mtypes.h"
+
+#if FEATURE_beginend
+
+extern void _mesa_install_exec_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt );
+extern void _mesa_install_save_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt );
+
+#else /* FEATURE_beginend */
+
+static inline void
+_mesa_install_exec_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt )
+{
+}
+
+static inline void
+_mesa_install_save_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt )
+{
+}
+
+#endif /* FEATURE_beginend */
+
+#endif /* _VTXFMT_H_ */
diff --git a/mesalib/src/mesa/program/hash_table.c b/mesalib/src/mesa/program/hash_table.c
index 877a9e2ff..dc8563a33 100644
--- a/mesalib/src/mesa/program/hash_table.c
+++ b/mesalib/src/mesa/program/hash_table.c
@@ -108,8 +108,8 @@ hash_table_clear(struct hash_table *ht)
}
-void *
-hash_table_find(struct hash_table *ht, const void *key)
+static struct hash_node *
+get_node(struct hash_table *ht, const void *key)
{
const unsigned hash_value = (*ht->hash)(key);
const unsigned bucket = hash_value % ht->num_buckets;
@@ -119,13 +119,20 @@ hash_table_find(struct hash_table *ht, const void *key)
struct hash_node *hn = (struct hash_node *) node;
if ((*ht->compare)(hn->key, key) == 0) {
- return hn->data;
+ return hn;
}
}
return NULL;
}
+void *
+hash_table_find(struct hash_table *ht, const void *key)
+{
+ struct hash_node *hn = get_node(ht, key);
+
+ return (hn == NULL) ? NULL : hn->data;
+}
void
hash_table_insert(struct hash_table *ht, void *data, const void *key)
@@ -143,21 +150,39 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key)
}
void
-hash_table_remove(struct hash_table *ht, const void *key)
+hash_table_replace(struct hash_table *ht, void *data, const void *key)
{
const unsigned hash_value = (*ht->hash)(key);
const unsigned bucket = hash_value % ht->num_buckets;
struct node *node;
+ struct hash_node *hn;
foreach(node, & ht->buckets[bucket]) {
- struct hash_node *hn = (struct hash_node *) node;
+ hn = (struct hash_node *) node;
if ((*ht->compare)(hn->key, key) == 0) {
- remove_from_list(node);
- free(node);
+ hn->data = data;
return;
}
}
+
+ hn = calloc(1, sizeof(*hn));
+
+ hn->data = data;
+ hn->key = key;
+
+ insert_at_head(& ht->buckets[bucket], & hn->link);
+}
+
+void
+hash_table_remove(struct hash_table *ht, const void *key)
+{
+ struct node *node = (struct node *) get_node(ht, key);
+ if (node != NULL) {
+ remove_from_list(node);
+ free(node);
+ return;
+ }
}
void
diff --git a/mesalib/src/mesa/program/hash_table.h b/mesalib/src/mesa/program/hash_table.h
index e715bb1cc..bfe221b24 100644
--- a/mesalib/src/mesa/program/hash_table.h
+++ b/mesalib/src/mesa/program/hash_table.h
@@ -31,7 +31,13 @@
#ifndef HASH_TABLE_H
#define HASH_TABLE_H
+#include <string.h>
+#include <stdint.h>
+#include <limits.h>
+#include <assert.h>
+
struct hash_table;
+struct string_to_uint_map;
typedef unsigned (*hash_func_t)(const void *key);
typedef int (*hash_compare_func_t)(const void *key1, const void *key2);
@@ -88,11 +94,31 @@ extern void *hash_table_find(struct hash_table *ht, const void *key);
/**
* Add an element to a hash table
+ *
+ * \warning
+ * If \c key is already in the hash table, it will be added again. Future
+ * calls to \c hash_table_find and \c hash_table_remove will return or remove,
+ * repsectively, the most recently added instance of \c key.
+ *
+ * \sa hash_table_replace
*/
extern void hash_table_insert(struct hash_table *ht, void *data,
const void *key);
/**
+ * Add an element to a hash table with replacement
+ *
+ * \warning
+ * If \c key is already in the hash table, \c data will \b replace the most
+ * recently inserted \c data (see the warning in \c hash_table_insert) for
+ * that key.
+ *
+ * \sa hash_table_insert
+ */
+extern void hash_table_replace(struct hash_table *ht, void *data,
+ const void *key);
+
+/**
* Remove a specific element from a hash table.
*/
extern void hash_table_remove(struct hash_table *ht, const void *key);
@@ -151,7 +177,78 @@ hash_table_call_foreach(struct hash_table *ht,
void *closure),
void *closure);
+struct string_to_uint_map *
+string_to_uint_map_ctor();
+
+void
+string_to_uint_map_dtor(struct string_to_uint_map *);
+
+
#ifdef __cplusplus
}
-#endif
+
+/**
+ * Map from a string (name) to an unsigned integer value
+ *
+ * \note
+ * Because of the way this class interacts with the \c hash_table
+ * implementation, values of \c UINT_MAX cannot be stored in the map.
+ */
+struct string_to_uint_map {
+public:
+ string_to_uint_map()
+ {
+ this->ht = hash_table_ctor(0, hash_table_string_hash,
+ hash_table_string_compare);
+ }
+
+ ~string_to_uint_map()
+ {
+ hash_table_dtor(this->ht);
+ }
+
+ /**
+ * Get the value associated with a particular key
+ *
+ * \return
+ * If \c key is found in the map, \c true is returned. Otherwise \c false
+ * is returned.
+ *
+ * \note
+ * If \c key is not found in the table, \c value is not modified.
+ */
+ bool get(unsigned &value, const char *key)
+ {
+ const intptr_t v =
+ (intptr_t) hash_table_find(this->ht, (const void *) key);
+
+ if (v == 0)
+ return false;
+
+ value = (unsigned)(v - 1);
+ return true;
+ }
+
+ void put(unsigned value, const char *key)
+ {
+ /* The low-level hash table structure returns NULL if key is not in the
+ * hash table. However, users of this map might want to store zero as a
+ * valid value in the table. Bias the value by +1 so that a
+ * user-specified zero is stored as 1. This enables ::get to tell the
+ * difference between a user-specified zero (returned as 1 by
+ * hash_table_find) and the key not in the table (returned as 0 by
+ * hash_table_find).
+ *
+ * The net effect is that we can't store UINT_MAX in the table. This is
+ * because UINT_MAX+1 = 0.
+ */
+ assert(value != UINT_MAX);
+ hash_table_replace(ht, (void *) (intptr_t) (value + 1), key);
+ }
+
+private:
+ struct hash_table *ht;
+};
+
+#endif /* __cplusplus */
#endif /* HASH_TABLE_H */
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp
index c5b71b3f0..2e1b8fba3 100644
--- a/mesalib/src/mesa/program/ir_to_mesa.cpp
+++ b/mesalib/src/mesa/program/ir_to_mesa.cpp
@@ -1261,8 +1261,11 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
break;
case ir_binop_div:
assert(!"not reached: should be handled by ir_div_to_mul_rcp");
+ break;
case ir_binop_mod:
- assert(!"ir_binop_mod should have been converted to b * fract(a/b)");
+ /* Floating point should be lowered by MOD_TO_FRACT in the compiler. */
+ assert(ir->type->is_integer());
+ emit(ir, OPCODE_MUL, result_dst, op[0], op[1]);
break;
case ir_binop_less:
@@ -1556,14 +1559,6 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
entry = new(mem_ctx) variable_storage(var,
PROGRAM_INPUT,
var->location);
- if (this->prog->Target == GL_VERTEX_PROGRAM_ARB &&
- var->location >= VERT_ATTRIB_GENERIC0) {
- _mesa_add_attribute(this->prog->Attributes,
- var->name,
- _mesa_sizeof_glsl_type(var->type->gl_type),
- var->type->gl_type,
- var->location - VERT_ATTRIB_GENERIC0);
- }
break;
case ir_var_out:
assert(var->location != -1);
@@ -3045,8 +3040,6 @@ get_mesa_program(struct gl_context *ctx,
if (!prog)
return NULL;
prog->Parameters = _mesa_new_parameter_list();
- prog->Varying = _mesa_new_parameter_list();
- prog->Attributes = _mesa_new_parameter_list();
v.ctx = ctx;
v.prog = prog;
v.shader_program = shader_program;
@@ -3434,7 +3427,6 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
}
}
- prog->Varying = _mesa_new_parameter_list();
_mesa_reference_vertprog(ctx, &prog->VertexProgram, NULL);
_mesa_reference_fragprog(ctx, &prog->FragmentProgram, NULL);
_mesa_reference_geomprog(ctx, &prog->GeometryProgram, NULL);
diff --git a/mesalib/src/mesa/program/prog_execute.c b/mesalib/src/mesa/program/prog_execute.c
index 77f842a16..848c2fec1 100644
--- a/mesalib/src/mesa/program/prog_execute.c
+++ b/mesalib/src/mesa/program/prog_execute.c
@@ -84,7 +84,7 @@ static const GLfloat ZeroVec[4] = { 0.0F, 0.0F, 0.0F, 0.0F };
* Return TRUE for +0 and other positive values, FALSE otherwise.
* Used for RCC opcode.
*/
-static INLINE GLboolean
+static inline GLboolean
positive(float x)
{
fi_type fi;
@@ -100,7 +100,7 @@ positive(float x)
* Return a pointer to the 4-element float vector specified by the given
* source register.
*/
-static INLINE const GLfloat *
+static inline const GLfloat *
get_src_register_pointer(const struct prog_src_register *source,
const struct gl_program_machine *machine)
{
@@ -176,7 +176,7 @@ get_src_register_pointer(const struct prog_src_register *source,
* Return a pointer to the 4-element float vector specified by the given
* destination register.
*/
-static INLINE GLfloat *
+static inline GLfloat *
get_dst_register_pointer(const struct prog_dst_register *dest,
struct gl_program_machine *machine)
{
@@ -383,7 +383,7 @@ fetch_vector1ui(const struct prog_src_register *source,
/**
* Fetch texel from texture. Use partial derivatives when possible.
*/
-static INLINE void
+static inline void
fetch_texel(struct gl_context *ctx,
const struct gl_program_machine *machine,
const struct prog_instruction *inst,
@@ -413,7 +413,7 @@ fetch_texel(struct gl_context *ctx,
/**
* Test value against zero and return GT, LT, EQ or UN if NaN.
*/
-static INLINE GLuint
+static inline GLuint
generate_cc(float value)
{
if (value != value)
@@ -430,7 +430,7 @@ generate_cc(float value)
* Test if the ccMaskRule is satisfied by the given condition code.
* Used to mask destination writes according to the current condition code.
*/
-static INLINE GLboolean
+static inline GLboolean
test_cc(GLuint condCode, GLuint ccMaskRule)
{
switch (ccMaskRule) {
@@ -451,7 +451,7 @@ test_cc(GLuint condCode, GLuint ccMaskRule)
* Evaluate the 4 condition codes against a predicate and return GL_TRUE
* or GL_FALSE to indicate result.
*/
-static INLINE GLboolean
+static inline GLboolean
eval_condition(const struct gl_program_machine *machine,
const struct prog_instruction *inst)
{
diff --git a/mesalib/src/mesa/program/prog_parameter.c b/mesalib/src/mesa/program/prog_parameter.c
index 49b3ffbdd..2018fa520 100644
--- a/mesalib/src/mesa/program/prog_parameter.c
+++ b/mesalib/src/mesa/program/prog_parameter.c
@@ -640,28 +640,6 @@ _mesa_combine_parameter_lists(const struct gl_program_parameter_list *listA,
}
-
-/**
- * Find longest name of all uniform parameters in list.
- */
-GLuint
-_mesa_longest_parameter_name(const struct gl_program_parameter_list *list,
- gl_register_file type)
-{
- GLuint i, maxLen = 0;
- if (!list)
- return 0;
- for (i = 0; i < list->NumParameters; i++) {
- if (list->Parameters[i].Type == type) {
- GLuint len = strlen(list->Parameters[i].Name);
- if (len > maxLen)
- maxLen = len;
- }
- }
- return maxLen;
-}
-
-
/**
* Count the number of parameters in the last that match the given type.
*/
diff --git a/mesalib/src/mesa/program/prog_parameter.h b/mesalib/src/mesa/program/prog_parameter.h
index 4c2773a62..a6793d0d8 100644
--- a/mesalib/src/mesa/program/prog_parameter.h
+++ b/mesalib/src/mesa/program/prog_parameter.h
@@ -114,7 +114,7 @@ extern struct gl_program_parameter_list *
_mesa_combine_parameter_lists(const struct gl_program_parameter_list *a,
const struct gl_program_parameter_list *b);
-static INLINE GLuint
+static inline GLuint
_mesa_num_parameters(const struct gl_program_parameter_list *list)
{
return list ? list->NumParameters : 0;
@@ -174,10 +174,6 @@ _mesa_lookup_parameter_constant(const struct gl_program_parameter_list *list,
GLint *posOut, GLuint *swizzleOut);
extern GLuint
-_mesa_longest_parameter_name(const struct gl_program_parameter_list *list,
- gl_register_file type);
-
-extern GLuint
_mesa_num_parameters_of_type(const struct gl_program_parameter_list *list,
gl_register_file type);
diff --git a/mesalib/src/mesa/program/prog_statevars.c b/mesalib/src/mesa/program/prog_statevars.c
index 6aa2409e8..f34a6d360 100644
--- a/mesalib/src/mesa/program/prog_statevars.c
+++ b/mesalib/src/mesa/program/prog_statevars.c
@@ -664,10 +664,13 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
{
switch (state[0]) {
case STATE_MATERIAL:
+ case STATE_LIGHTPROD:
+ case STATE_LIGHTMODEL_SCENECOLOR:
+ /* these can be effected by glColor when colormaterial mode is used */
+ return _NEW_LIGHT | _NEW_CURRENT_ATTRIB;
+
case STATE_LIGHT:
case STATE_LIGHTMODEL_AMBIENT:
- case STATE_LIGHTMODEL_SCENECOLOR:
- case STATE_LIGHTPROD:
return _NEW_LIGHT;
case STATE_TEXGEN:
diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c
index ecff2344a..4d6c60b9d 100644
--- a/mesalib/src/mesa/program/program.c
+++ b/mesalib/src/mesa/program/program.c
@@ -394,12 +394,6 @@ _mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
if (prog->Parameters) {
_mesa_free_parameter_list(prog->Parameters);
}
- if (prog->Varying) {
- _mesa_free_parameter_list(prog->Varying);
- }
- if (prog->Attributes) {
- _mesa_free_parameter_list(prog->Attributes);
- }
free(prog);
}
@@ -522,10 +516,6 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
if (prog->Parameters)
clone->Parameters = _mesa_clone_parameter_list(prog->Parameters);
memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
- if (prog->Varying)
- clone->Varying = _mesa_clone_parameter_list(prog->Varying);
- if (prog->Attributes)
- clone->Attributes = _mesa_clone_parameter_list(prog->Attributes);
memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
clone->IndirectRegisterFiles = prog->IndirectRegisterFiles;
clone->NumInstructions = prog->NumInstructions;
diff --git a/mesalib/src/mesa/program/program.h b/mesalib/src/mesa/program/program.h
index 0f32a6af7..9cd1780b8 100644
--- a/mesalib/src/mesa/program/program.h
+++ b/mesalib/src/mesa/program/program.h
@@ -93,7 +93,7 @@ _mesa_reference_program_(struct gl_context *ctx,
struct gl_program **ptr,
struct gl_program *prog);
-static INLINE void
+static inline void
_mesa_reference_program(struct gl_context *ctx,
struct gl_program **ptr,
struct gl_program *prog)
@@ -102,7 +102,7 @@ _mesa_reference_program(struct gl_context *ctx,
_mesa_reference_program_(ctx, ptr, prog);
}
-static INLINE void
+static inline void
_mesa_reference_vertprog(struct gl_context *ctx,
struct gl_vertex_program **ptr,
struct gl_vertex_program *prog)
@@ -111,7 +111,7 @@ _mesa_reference_vertprog(struct gl_context *ctx,
(struct gl_program *) prog);
}
-static INLINE void
+static inline void
_mesa_reference_fragprog(struct gl_context *ctx,
struct gl_fragment_program **ptr,
struct gl_fragment_program *prog)
@@ -120,7 +120,7 @@ _mesa_reference_fragprog(struct gl_context *ctx,
(struct gl_program *) prog);
}
-static INLINE void
+static inline void
_mesa_reference_geomprog(struct gl_context *ctx,
struct gl_geometry_program **ptr,
struct gl_geometry_program *prog)
@@ -132,21 +132,21 @@ _mesa_reference_geomprog(struct gl_context *ctx,
extern struct gl_program *
_mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog);
-static INLINE struct gl_vertex_program *
+static inline struct gl_vertex_program *
_mesa_clone_vertex_program(struct gl_context *ctx,
const struct gl_vertex_program *prog)
{
return (struct gl_vertex_program *) _mesa_clone_program(ctx, &prog->Base);
}
-static INLINE struct gl_geometry_program *
+static inline struct gl_geometry_program *
_mesa_clone_geometry_program(struct gl_context *ctx,
const struct gl_geometry_program *prog)
{
return (struct gl_geometry_program *) _mesa_clone_program(ctx, &prog->Base);
}
-static INLINE struct gl_fragment_program *
+static inline struct gl_fragment_program *
_mesa_clone_fragment_program(struct gl_context *ctx,
const struct gl_fragment_program *prog)
{
@@ -185,7 +185,7 @@ _mesa_postprocess_program(struct gl_context *ctx, struct gl_program *prog);
/* keep these in the same order as TGSI_PROCESSOR_* */
-static INLINE GLuint
+static inline GLuint
_mesa_program_target_to_index(GLenum v)
{
switch(v)
@@ -202,7 +202,7 @@ _mesa_program_target_to_index(GLenum v)
}
}
-static INLINE GLenum
+static inline GLenum
_mesa_program_index_to_target(GLuint i)
{
GLenum enums[MESA_SHADER_TYPES] = {
diff --git a/mesalib/src/mesa/program/sampler.cpp b/mesalib/src/mesa/program/sampler.cpp
index e8d34c670..3b459d59c 100644
--- a/mesalib/src/mesa/program/sampler.cpp
+++ b/mesalib/src/mesa/program/sampler.cpp
@@ -26,6 +26,7 @@
#include "ir.h"
#include "glsl_types.h"
#include "ir_visitor.h"
+#include "../glsl/program.h"
extern "C" {
#include "main/compiler.h"
@@ -33,18 +34,6 @@ extern "C" {
#include "program/prog_parameter.h"
}
-static void fail_link(struct gl_shader_program *prog, const char *fmt, ...) PRINTFLIKE(2, 3);
-
-static void fail_link(struct gl_shader_program *prog, const char *fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- ralloc_vasprintf_append(&prog->InfoLog, fmt, args);
- va_end(args);
-
- prog->LinkStatus = GL_FALSE;
-}
-
class get_sampler_name : public ir_hierarchical_visitor
{
public:
@@ -125,8 +114,8 @@ _mesa_get_sampler_uniform_value(class ir_dereference *sampler,
getname.name);
if (index < 0) {
- fail_link(shader_program,
- "failed to find sampler named %s.\n", getname.name);
+ linker_error(shader_program,
+ "failed to find sampler named %s.\n", getname.name);
return 0;
}
diff --git a/mesalib/src/mesa/program/string_to_uint_map.cpp b/mesalib/src/mesa/program/string_to_uint_map.cpp
new file mode 100644
index 000000000..cfa73abe0
--- /dev/null
+++ b/mesalib/src/mesa/program/string_to_uint_map.cpp
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * 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, sublicense,
+ * 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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 string_to_uint_map.cpp
+ * \brief Dumb wrapprs so that C code can create and destroy maps.
+ *
+ * \author Ian Romanick <ian.d.romanick@intel.com>
+ */
+#include "hash_table.h"
+
+extern "C" struct string_to_uint_map *
+string_to_uint_map_ctor()
+{
+ return new string_to_uint_map;
+}
+
+extern "C" void
+string_to_uint_map_dtor(struct string_to_uint_map *map)
+{
+ delete map;
+}
diff --git a/mesalib/src/mesa/sources.mak b/mesalib/src/mesa/sources.mak
index da5d90ec4..f29213ec0 100644
--- a/mesalib/src/mesa/sources.mak
+++ b/mesalib/src/mesa/sources.mak
@@ -104,7 +104,8 @@ MAIN_SOURCES = \
$(MAIN_ES_SOURCES)
MAIN_CXX_SOURCES = \
- main/ff_fragment_shader.cpp
+ main/ff_fragment_shader.cpp \
+ main/shader_query.cpp
MATH_SOURCES = \
math/m_debug_clip.c \
@@ -266,7 +267,8 @@ PROGRAM_SOURCES = \
SHADER_CXX_SOURCES = \
program/ir_to_mesa.cpp \
- program/sampler.cpp
+ program/sampler.cpp \
+ program/string_to_uint_map.cpp
ASM_C_SOURCES = \
x86/common_x86.c \
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index 260df09f5..76bf78bbf 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -460,6 +460,91 @@ guess_and_alloc_texture(struct st_context *st,
/**
+ * Called via ctx->Driver.AllocTextureImageBuffer().
+ * If the texture object/buffer already has space for the indicated image,
+ * we're done. Otherwise, allocate memory for the new texture image.
+ * XXX This function and st_TexImage() have some duplicated code. That
+ * can be cleaned up in the future.
+ */
+static GLboolean
+st_AllocTextureImageBuffer(struct gl_context *ctx,
+ struct gl_texture_image *texImage,
+ gl_format format, GLsizei width,
+ GLsizei height, GLsizei depth)
+{
+ struct st_context *st = st_context(ctx);
+ struct st_texture_image *stImage = st_texture_image(texImage);
+ struct st_texture_object *stObj = st_texture_object(texImage->TexObject);
+ const GLuint level = texImage->Level;
+
+ DBG("%s\n", __FUNCTION__);
+
+ assert(width > 0);
+ assert(height > 0);
+ assert(depth > 0);
+ assert(!texImage->Data);
+ assert(!stImage->pt); /* xxx this might be wrong */
+
+ /* Look if the parent texture object has space for this image */
+ if (stObj->pt &&
+ level <= stObj->pt->last_level &&
+ st_texture_match_image(stObj->pt, texImage)) {
+ /* this image will fit in the existing texture object's memory */
+ pipe_resource_reference(&stImage->pt, stObj->pt);
+ return GL_TRUE;
+ }
+
+ /* The parent texture object does not have space for this image */
+
+ pipe_resource_reference(&stObj->pt, NULL);
+ pipe_sampler_view_reference(&stObj->sampler_view, NULL);
+
+ if (!guess_and_alloc_texture(st, stObj, stImage)) {
+ /* Probably out of memory.
+ * Try flushing any pending rendering, then retry.
+ */
+ st_finish(st);
+ if (!guess_and_alloc_texture(st, stObj, stImage)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
+ return GL_FALSE;
+ }
+ }
+
+ if (stObj->pt &&
+ st_texture_match_image(stObj->pt, texImage)) {
+ /* The image will live in the object's mipmap memory */
+ pipe_resource_reference(&stImage->pt, stObj->pt);
+ assert(stImage->pt);
+ return GL_TRUE;
+ }
+ else {
+ /* Create a new, temporary texture/resource/buffer to hold this
+ * one texture image.
+ */
+ enum pipe_format format =
+ st_mesa_format_to_pipe_format(texImage->TexFormat);
+ GLuint bindings = default_bindings(st, format);
+ GLuint ptWidth, ptHeight, ptDepth, ptLayers;
+
+ st_gl_texture_dims_to_pipe_dims(stObj->base.Target,
+ width, height, depth,
+ &ptWidth, &ptHeight, &ptDepth, &ptLayers);
+
+ stImage->pt = st_texture_create(st,
+ gl_target_to_pipe(stObj->base.Target),
+ format,
+ 0, /* lastLevel */
+ ptWidth,
+ ptHeight,
+ ptDepth,
+ ptLayers,
+ bindings);
+ return stImage->pt != NULL;
+ }
+}
+
+
+/**
* Adjust pixel unpack params and image dimensions to strip off the
* texture border.
* Gallium doesn't support texture borders. They've seldem been used
@@ -815,15 +900,14 @@ st_CompressedTexImage2D(struct gl_context *ctx, GLenum target, GLint level,
* a textured quad. Store the results in the user's buffer.
*/
static void
-decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level,
+decompress_with_blit(struct gl_context * ctx,
GLenum format, GLenum type, GLvoid *pixels,
- struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
struct st_context *st = st_context(ctx);
struct pipe_context *pipe = st->pipe;
struct st_texture_image *stImage = st_texture_image(texImage);
- struct st_texture_object *stObj = st_texture_object(texObj);
+ struct st_texture_object *stObj = st_texture_object(texImage->TexObject);
struct pipe_sampler_view *src_view =
st_get_texture_sampler_view(stObj, pipe);
const GLuint width = texImage->Width;
@@ -848,7 +932,7 @@ decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level,
}
/* Choose the source mipmap level */
- src_view->u.tex.first_level = src_view->u.tex.last_level = level;
+ src_view->u.tex.first_level = src_view->u.tex.last_level = texImage->Level;
/* blit/render/decompress */
util_blit_pixels_tex(st->blit,
@@ -925,9 +1009,8 @@ decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level,
* Called via ctx->Driver.GetTexImage()
*/
static void
-st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
+st_GetTexImage(struct gl_context * ctx,
GLenum format, GLenum type, GLvoid * pixels,
- struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
struct st_texture_image *stImage = st_texture_image(texImage);
@@ -938,12 +1021,10 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
* faster than using the fallback code in texcompress.c.
* Note that we only expect RGBA formats (no Z/depth formats).
*/
- decompress_with_blit(ctx, target, level, format, type, pixels,
- texObj, texImage);
+ decompress_with_blit(ctx, format, type, pixels, texImage);
}
else {
- _mesa_get_teximage(ctx, target, level, format, type, pixels,
- texObj, texImage);
+ _mesa_get_teximage(ctx, format, type, pixels, texImage);
}
}
@@ -1841,6 +1922,7 @@ st_init_texture_functions(struct dd_function_table *functions)
functions->NewTextureImage = st_NewTextureImage;
functions->DeleteTextureImage = st_DeleteTextureImage;
functions->DeleteTexture = st_DeleteTextureObject;
+ functions->AllocTextureImageBuffer = st_AllocTextureImageBuffer;
functions->FreeTextureImageBuffer = st_FreeTextureImageBuffer;
functions->MapTextureImage = st_MapTextureImage;
functions->UnmapTextureImage = st_UnmapTextureImage;
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c
index 27fff39a8..6707fcae1 100644
--- a/mesalib/src/mesa/state_tracker/st_extensions.c
+++ b/mesalib/src/mesa/state_tracker/st_extensions.c
@@ -90,11 +90,13 @@ void st_init_limits(struct st_context *st)
= screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
c->MaxTextureImageUnits
- = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
+ = _min(screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
+ PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
MAX_TEXTURE_IMAGE_UNITS);
c->MaxVertexTextureImageUnits
- = _min(screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS),
+ = _min(screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
+ PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
MAX_VERTEX_TEXTURE_IMAGE_UNITS);
c->MaxCombinedTextureImageUnits
@@ -305,10 +307,6 @@ void st_init_extensions(struct st_context *st)
/*
* Extensions that depend on the driver/hardware:
*/
- if (screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS) > 0) {
- ctx->Extensions.ARB_draw_buffers = GL_TRUE;
- }
-
if (screen->get_param(screen, PIPE_CAP_TEXTURE_SWIZZLE) > 0) {
ctx->Extensions.EXT_texture_swizzle = GL_TRUE;
}
@@ -499,7 +497,7 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
}
- if (st->pipe->render_condition) {
+ if (screen->get_param(screen, PIPE_CAP_CONDITIONAL_RENDER)) {
ctx->Extensions.NV_conditional_render = GL_TRUE;
}
@@ -609,7 +607,7 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.ARB_sync = GL_TRUE;
}
- if (st->pipe->texture_barrier) {
+ if (screen->get_param(screen, PIPE_CAP_TEXTURE_BARRIER)) {
ctx->Extensions.NV_texture_barrier = GL_TRUE;
}
diff --git a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
index e53da5fd4..36fea3d7f 100644
--- a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c
@@ -106,209 +106,6 @@ st_render_mipmap(struct st_context *st,
return TRUE;
}
-
-/**
- * Helper function to decompress an image. The result is a 32-bpp RGBA
- * image with stride==width.
- */
-static void
-decompress_image(enum pipe_format format, int datatype,
- const uint8_t *src, void *dst,
- unsigned width, unsigned height, unsigned src_stride)
-{
- const struct util_format_description *desc = util_format_description(format);
- const uint bw = util_format_get_blockwidth(format);
- const uint bh = util_format_get_blockheight(format);
- uint dst_stride = 4 * MAX2(width, bw);
-
- if (datatype == GL_FLOAT) {
- desc->unpack_rgba_float((float *)dst, dst_stride * sizeof(GLfloat), src, src_stride, width, height);
- if (width < bw || height < bh) {
- float *dst_p = (float *)dst;
- /* We're decompressing an image smaller than the compression
- * block size. We don't want garbage pixel values in the region
- * outside (width x height) so replicate pixels from the (width
- * x height) region to fill out the (bw x bh) block size.
- */
- uint x, y;
- for (y = 0; y < bh; y++) {
- for (x = 0; x < bw; x++) {
- if (x >= width || y >= height) {
- uint p = (y * bw + x) * 4;
- dst_p[p + 0] = dst_p[0];
- dst_p[p + 1] = dst_p[1];
- dst_p[p + 2] = dst_p[2];
- dst_p[p + 3] = dst_p[3];
- }
- }
- }
- }
- } else {
- desc->unpack_rgba_8unorm((uint8_t *)dst, dst_stride, src, src_stride, width, height);
- if (width < bw || height < bh) {
- uint8_t *dst_p = (uint8_t *)dst;
- /* We're decompressing an image smaller than the compression
- * block size. We don't want garbage pixel values in the region
- * outside (width x height) so replicate pixels from the (width
- * x height) region to fill out the (bw x bh) block size.
- */
- uint x, y;
- for (y = 0; y < bh; y++) {
- for (x = 0; x < bw; x++) {
- if (x >= width || y >= height) {
- uint p = (y * bw + x) * 4;
- dst_p[p + 0] = dst_p[0];
- dst_p[p + 1] = dst_p[1];
- dst_p[p + 2] = dst_p[2];
- dst_p[p + 3] = dst_p[3];
- }
- }
- }
- }
- }
-}
-
-/**
- * Helper function to compress an image. The source is a 32-bpp RGBA image
- * with stride==width.
- */
-static void
-compress_image(enum pipe_format format, int datatype,
- const void *src, uint8_t *dst,
- unsigned width, unsigned height, unsigned dst_stride)
-{
- const struct util_format_description *desc = util_format_description(format);
- const uint src_stride = 4 * width;
-
- if (datatype == GL_FLOAT)
- desc->pack_rgba_float(dst, dst_stride, (GLfloat *)src, src_stride * sizeof(GLfloat), width, height);
- else
- desc->pack_rgba_8unorm(dst, dst_stride, (uint8_t *)src, src_stride, width, height);
-}
-
-
-/**
- * Software fallback for generate mipmap levels.
- */
-static void
-fallback_generate_mipmap(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *texObj)
-{
- struct pipe_context *pipe = st_context(ctx)->pipe;
- struct pipe_resource *pt = st_get_texobj_resource(texObj);
- const uint baseLevel = texObj->BaseLevel;
- const uint lastLevel = pt->last_level;
- const uint face = _mesa_tex_target_to_face(target);
- uint dstLevel;
- GLenum datatype;
- GLuint comps;
- GLboolean compressed;
-
- if (ST_DEBUG & DEBUG_FALLBACK)
- debug_printf("%s: fallback processing\n", __FUNCTION__);
-
- assert(target != GL_TEXTURE_3D); /* not done yet */
-
- compressed =
- _mesa_is_format_compressed(texObj->Image[face][baseLevel]->TexFormat);
-
- if (compressed) {
- GLenum type =
- _mesa_get_format_datatype(texObj->Image[face][baseLevel]->TexFormat);
-
- datatype = type == GL_UNSIGNED_NORMALIZED ? GL_UNSIGNED_BYTE : GL_FLOAT;
- comps = 4;
- }
- else {
- _mesa_format_to_type_and_comps(texObj->Image[face][baseLevel]->TexFormat,
- &datatype, &comps);
- assert(comps > 0 && "bad texture format in fallback_generate_mipmap()");
- }
-
- for (dstLevel = baseLevel + 1; dstLevel <= lastLevel; dstLevel++) {
- const uint srcLevel = dstLevel - 1;
- const uint srcWidth = u_minify(pt->width0, srcLevel);
- const uint srcHeight = u_minify(pt->height0, srcLevel);
- const uint srcDepth = u_minify(pt->depth0, srcLevel);
- const uint dstWidth = u_minify(pt->width0, dstLevel);
- const uint dstHeight = u_minify(pt->height0, dstLevel);
- const uint dstDepth = u_minify(pt->depth0, dstLevel);
- struct pipe_transfer *srcTrans, *dstTrans;
- const ubyte *srcData;
- ubyte *dstData;
- int srcStride, dstStride;
-
- srcTrans = pipe_get_transfer(pipe, pt, srcLevel,
- face,
- PIPE_TRANSFER_READ, 0, 0,
- srcWidth, srcHeight);
-
- dstTrans = pipe_get_transfer(pipe, pt, dstLevel,
- face,
- PIPE_TRANSFER_WRITE, 0, 0,
- dstWidth, dstHeight);
-
- srcData = (ubyte *) pipe_transfer_map(pipe, srcTrans);
- dstData = (ubyte *) pipe_transfer_map(pipe, dstTrans);
-
- srcStride = srcTrans->stride / util_format_get_blocksize(srcTrans->resource->format);
- dstStride = dstTrans->stride / util_format_get_blocksize(dstTrans->resource->format);
-
- /* this cannot work correctly for 3d since it does
- not respect layerStride. */
- if (compressed) {
- const enum pipe_format format = pt->format;
- const uint bw = util_format_get_blockwidth(format);
- const uint bh = util_format_get_blockheight(format);
- const uint srcWidth2 = align(srcWidth, bw);
- const uint srcHeight2 = align(srcHeight, bh);
- const uint dstWidth2 = align(dstWidth, bw);
- const uint dstHeight2 = align(dstHeight, bh);
- uint8_t *srcTemp, *dstTemp;
-
- assert(comps == 4);
-
- srcTemp = malloc(srcWidth2 * srcHeight2 * comps * (datatype == GL_FLOAT ? 4 : 1));
- dstTemp = malloc(dstWidth2 * dstHeight2 * comps * (datatype == GL_FLOAT ? 4 : 1));
-
- /* decompress the src image: srcData -> srcTemp */
- decompress_image(format, datatype, srcData, srcTemp, srcWidth2, srcHeight2, srcTrans->stride);
-
- _mesa_generate_mipmap_level(target, datatype, comps,
- 0 /*border*/,
- srcWidth2, srcHeight2, srcDepth,
- srcTemp,
- srcWidth2, /* stride in texels */
- dstWidth2, dstHeight2, dstDepth,
- dstTemp,
- dstWidth2); /* stride in texels */
-
- /* compress the new image: dstTemp -> dstData */
- compress_image(format, datatype, dstTemp, dstData, dstWidth2, dstHeight2, dstTrans->stride);
-
- free(srcTemp);
- free(dstTemp);
- }
- else {
- _mesa_generate_mipmap_level(target, datatype, comps,
- 0 /*border*/,
- srcWidth, srcHeight, srcDepth,
- srcData,
- srcStride, /* stride in texels */
- dstWidth, dstHeight, dstDepth,
- dstData,
- dstStride); /* stride in texels */
- }
-
- pipe_transfer_unmap(pipe, srcTrans);
- pipe_transfer_unmap(pipe, dstTrans);
-
- pipe->transfer_destroy(pipe, srcTrans);
- pipe->transfer_destroy(pipe, dstTrans);
- }
-}
-
-
/**
* Compute the expected number of mipmap levels in the texture given
* the width/height/depth of the base image and the GL_TEXTURE_BASE_LEVEL/
@@ -422,7 +219,7 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
if (!st_render_mipmap(st, target, stObj, baseLevel, lastLevel)) {
/* since the util code actually also has a fallback, should
probably make it never fail and kill this */
- fallback_generate_mipmap(ctx, target, texObj);
+ _mesa_generate_mipmap(ctx, target, texObj);
}
/* Fill in the Mesa gl_texture_image fields */
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index f68270d0f..d8ef8a3ce 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1933,14 +1933,6 @@ glsl_to_tgsi_visitor::visit(ir_dereference_variable *ir)
entry = new(mem_ctx) variable_storage(var,
PROGRAM_INPUT,
var->location);
- if (this->prog->Target == GL_VERTEX_PROGRAM_ARB &&
- var->location >= VERT_ATTRIB_GENERIC0) {
- _mesa_add_attribute(this->prog->Attributes,
- var->name,
- _mesa_sizeof_glsl_type(var->type->gl_type),
- var->type->gl_type,
- var->location - VERT_ATTRIB_GENERIC0);
- }
break;
case ir_var_out:
assert(var->location != -1);
@@ -3986,8 +3978,6 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp,
/* Make modifications to fragment program info. */
prog->Parameters = _mesa_combine_parameter_lists(params,
original->prog->Parameters);
- prog->Attributes = _mesa_clone_parameter_list(original->prog->Attributes);
- prog->Varying = _mesa_clone_parameter_list(original->prog->Varying);
_mesa_free_parameter_list(params);
count_resources(v, prog);
fp->glsl_to_tgsi = v;
@@ -4062,8 +4052,6 @@ get_bitmap_visitor(struct st_fragment_program *fp,
/* Make modifications to fragment program info. */
prog->Parameters = _mesa_clone_parameter_list(original->prog->Parameters);
- prog->Attributes = _mesa_clone_parameter_list(original->prog->Attributes);
- prog->Varying = _mesa_clone_parameter_list(original->prog->Varying);
count_resources(v, prog);
fp->glsl_to_tgsi = v;
}
@@ -4969,8 +4957,6 @@ get_mesa_program(struct gl_context *ctx,
if (!prog)
return NULL;
prog->Parameters = _mesa_new_parameter_list();
- prog->Varying = _mesa_new_parameter_list();
- prog->Attributes = _mesa_new_parameter_list();
v->ctx = ctx;
v->prog = prog;
v->shader_program = shader_program;
diff --git a/mesalib/src/mesa/swrast/s_aaline.c b/mesalib/src/mesa/swrast/s_aaline.c
index be817f326..d4b1805d9 100644
--- a/mesalib/src/mesa/swrast/s_aaline.c
+++ b/mesalib/src/mesa/swrast/s_aaline.c
@@ -1,492 +1,492 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#include "main/glheader.h"
-#include "main/imports.h"
-#include "main/macros.h"
-#include "main/mtypes.h"
-#include "swrast/s_aaline.h"
-#include "swrast/s_context.h"
-#include "swrast/s_span.h"
-#include "swrast/swrast.h"
-
-
-#define SUB_PIXEL 4
-
-
-/*
- * Info about the AA line we're rendering
- */
-struct LineInfo
-{
- GLfloat x0, y0; /* start */
- GLfloat x1, y1; /* end */
- GLfloat dx, dy; /* direction vector */
- GLfloat len; /* length */
- GLfloat halfWidth; /* half of line width */
- GLfloat xAdj, yAdj; /* X and Y adjustment for quad corners around line */
- /* for coverage computation */
- GLfloat qx0, qy0; /* quad vertices */
- GLfloat qx1, qy1;
- GLfloat qx2, qy2;
- GLfloat qx3, qy3;
- GLfloat ex0, ey0; /* quad edge vectors */
- GLfloat ex1, ey1;
- GLfloat ex2, ey2;
- GLfloat ex3, ey3;
-
- /* DO_Z */
- GLfloat zPlane[4];
- /* DO_RGBA - always enabled */
- GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4];
- /* DO_ATTRIBS */
- GLfloat wPlane[4];
- GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4];
- GLfloat lambda[FRAG_ATTRIB_MAX];
- GLfloat texWidth[FRAG_ATTRIB_MAX];
- GLfloat texHeight[FRAG_ATTRIB_MAX];
-
- SWspan span;
-};
-
-
-
-/*
- * Compute the equation of a plane used to interpolate line fragment data
- * such as color, Z, texture coords, etc.
- * Input: (x0, y0) and (x1,y1) are the endpoints of the line.
- * z0, and z1 are the end point values to interpolate.
- * Output: plane - the plane equation.
- *
- * Note: we don't really have enough parameters to specify a plane.
- * We take the endpoints of the line and compute a plane such that
- * the cross product of the line vector and the plane normal is
- * parallel to the projection plane.
- */
-static void
-compute_plane(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1,
- GLfloat z0, GLfloat z1, GLfloat plane[4])
-{
-#if 0
- /* original */
- const GLfloat px = x1 - x0;
- const GLfloat py = y1 - y0;
- const GLfloat pz = z1 - z0;
- const GLfloat qx = -py;
- const GLfloat qy = px;
- const GLfloat qz = 0;
- const GLfloat a = py * qz - pz * qy;
- const GLfloat b = pz * qx - px * qz;
- const GLfloat c = px * qy - py * qx;
- const GLfloat d = -(a * x0 + b * y0 + c * z0);
- plane[0] = a;
- plane[1] = b;
- plane[2] = c;
- plane[3] = d;
-#else
- /* simplified */
- const GLfloat px = x1 - x0;
- const GLfloat py = y1 - y0;
- const GLfloat pz = z0 - z1;
- const GLfloat a = pz * px;
- const GLfloat b = pz * py;
- const GLfloat c = px * px + py * py;
- const GLfloat d = -(a * x0 + b * y0 + c * z0);
- if (a == 0.0 && b == 0.0 && c == 0.0 && d == 0.0) {
- plane[0] = 0.0;
- plane[1] = 0.0;
- plane[2] = 1.0;
- plane[3] = 0.0;
- }
- else {
- plane[0] = a;
- plane[1] = b;
- plane[2] = c;
- plane[3] = d;
- }
-#endif
-}
-
-
-static INLINE void
-constant_plane(GLfloat value, GLfloat plane[4])
-{
- plane[0] = 0.0;
- plane[1] = 0.0;
- plane[2] = -1.0;
- plane[3] = value;
-}
-
-
-static INLINE GLfloat
-solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4])
-{
- const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
- return z;
-}
-
-#define SOLVE_PLANE(X, Y, PLANE) \
- ((PLANE[3] + PLANE[0] * (X) + PLANE[1] * (Y)) / -PLANE[2])
-
-
-/*
- * Return 1 / solve_plane().
- */
-static INLINE GLfloat
-solve_plane_recip(GLfloat x, GLfloat y, const GLfloat plane[4])
-{
- const GLfloat denom = plane[3] + plane[0] * x + plane[1] * y;
- if (denom == 0.0)
- return 0.0;
- else
- return -plane[2] / denom;
-}
-
-
-/*
- * Solve plane and return clamped GLchan value.
- */
-static INLINE GLchan
-solve_plane_chan(GLfloat x, GLfloat y, const GLfloat plane[4])
-{
- const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
-#if CHAN_TYPE == GL_FLOAT
- return CLAMP(z, 0.0F, CHAN_MAXF);
-#else
- if (z < 0)
- return 0;
- else if (z > CHAN_MAX)
- return CHAN_MAX;
- return (GLchan) IROUND_POS(z);
-#endif
-}
-
-
-/*
- * Compute mipmap level of detail.
- */
-static INLINE GLfloat
-compute_lambda(const GLfloat sPlane[4], const GLfloat tPlane[4],
- GLfloat invQ, GLfloat width, GLfloat height)
-{
- GLfloat dudx = sPlane[0] / sPlane[2] * invQ * width;
- GLfloat dudy = sPlane[1] / sPlane[2] * invQ * width;
- GLfloat dvdx = tPlane[0] / tPlane[2] * invQ * height;
- GLfloat dvdy = tPlane[1] / tPlane[2] * invQ * height;
- GLfloat r1 = dudx * dudx + dudy * dudy;
- GLfloat r2 = dvdx * dvdx + dvdy * dvdy;
- GLfloat rho2 = r1 + r2;
- /* return log base 2 of rho */
- if (rho2 == 0.0F)
- return 0.0;
- else
- return (GLfloat) (LOGF(rho2) * 1.442695 * 0.5);/* 1.442695 = 1/log(2) */
-}
-
-
-
-
-/*
- * Fill in the samples[] array with the (x,y) subpixel positions of
- * xSamples * ySamples sample positions.
- * Note that the four corner samples are put into the first four
- * positions of the array. This allows us to optimize for the common
- * case of all samples being inside the polygon.
- */
-static void
-make_sample_table(GLint xSamples, GLint ySamples, GLfloat samples[][2])
-{
- const GLfloat dx = 1.0F / (GLfloat) xSamples;
- const GLfloat dy = 1.0F / (GLfloat) ySamples;
- GLint x, y;
- GLint i;
-
- i = 4;
- for (x = 0; x < xSamples; x++) {
- for (y = 0; y < ySamples; y++) {
- GLint j;
- if (x == 0 && y == 0) {
- /* lower left */
- j = 0;
- }
- else if (x == xSamples - 1 && y == 0) {
- /* lower right */
- j = 1;
- }
- else if (x == 0 && y == ySamples - 1) {
- /* upper left */
- j = 2;
- }
- else if (x == xSamples - 1 && y == ySamples - 1) {
- /* upper right */
- j = 3;
- }
- else {
- j = i++;
- }
- samples[j][0] = x * dx + 0.5F * dx;
- samples[j][1] = y * dy + 0.5F * dy;
- }
- }
-}
-
-
-
-/*
- * Compute how much of the given pixel's area is inside the rectangle
- * defined by vertices v0, v1, v2, v3.
- * Vertices MUST be specified in counter-clockwise order.
- * Return: coverage in [0, 1].
- */
-static GLfloat
-compute_coveragef(const struct LineInfo *info,
- GLint winx, GLint winy)
-{
- static GLfloat samples[SUB_PIXEL * SUB_PIXEL][2];
- static GLboolean haveSamples = GL_FALSE;
- const GLfloat x = (GLfloat) winx;
- const GLfloat y = (GLfloat) winy;
- GLint stop = 4, i;
- GLfloat insideCount = SUB_PIXEL * SUB_PIXEL;
-
- if (!haveSamples) {
- make_sample_table(SUB_PIXEL, SUB_PIXEL, samples);
- haveSamples = GL_TRUE;
- }
-
-#if 0 /*DEBUG*/
- {
- const GLfloat area = dx0 * dy1 - dx1 * dy0;
- assert(area >= 0.0);
- }
-#endif
-
- for (i = 0; i < stop; i++) {
- const GLfloat sx = x + samples[i][0];
- const GLfloat sy = y + samples[i][1];
- const GLfloat fx0 = sx - info->qx0;
- const GLfloat fy0 = sy - info->qy0;
- const GLfloat fx1 = sx - info->qx1;
- const GLfloat fy1 = sy - info->qy1;
- const GLfloat fx2 = sx - info->qx2;
- const GLfloat fy2 = sy - info->qy2;
- const GLfloat fx3 = sx - info->qx3;
- const GLfloat fy3 = sy - info->qy3;
- /* cross product determines if sample is inside or outside each edge */
- GLfloat cross0 = (info->ex0 * fy0 - info->ey0 * fx0);
- GLfloat cross1 = (info->ex1 * fy1 - info->ey1 * fx1);
- GLfloat cross2 = (info->ex2 * fy2 - info->ey2 * fx2);
- GLfloat cross3 = (info->ex3 * fy3 - info->ey3 * fx3);
- /* Check if the sample is exactly on an edge. If so, let cross be a
- * positive or negative value depending on the direction of the edge.
- */
- if (cross0 == 0.0F)
- cross0 = info->ex0 + info->ey0;
- if (cross1 == 0.0F)
- cross1 = info->ex1 + info->ey1;
- if (cross2 == 0.0F)
- cross2 = info->ex2 + info->ey2;
- if (cross3 == 0.0F)
- cross3 = info->ex3 + info->ey3;
- if (cross0 < 0.0F || cross1 < 0.0F || cross2 < 0.0F || cross3 < 0.0F) {
- /* point is outside quadrilateral */
- insideCount -= 1.0F;
- stop = SUB_PIXEL * SUB_PIXEL;
- }
- }
- if (stop == 4)
- return 1.0F;
- else
- return insideCount * (1.0F / (SUB_PIXEL * SUB_PIXEL));
-}
-
-
-typedef void (*plot_func)(struct gl_context *ctx, struct LineInfo *line,
- int ix, int iy);
-
-
-
-/*
- * Draw an AA line segment (called many times per line when stippling)
- */
-static void
-segment(struct gl_context *ctx,
- struct LineInfo *line,
- plot_func plot,
- GLfloat t0, GLfloat t1)
-{
- const GLfloat absDx = (line->dx < 0.0F) ? -line->dx : line->dx;
- const GLfloat absDy = (line->dy < 0.0F) ? -line->dy : line->dy;
- /* compute the actual segment's endpoints */
- const GLfloat x0 = line->x0 + t0 * line->dx;
- const GLfloat y0 = line->y0 + t0 * line->dy;
- const GLfloat x1 = line->x0 + t1 * line->dx;
- const GLfloat y1 = line->y0 + t1 * line->dy;
-
- /* compute vertices of the line-aligned quadrilateral */
- line->qx0 = x0 - line->yAdj;
- line->qy0 = y0 + line->xAdj;
- line->qx1 = x0 + line->yAdj;
- line->qy1 = y0 - line->xAdj;
- line->qx2 = x1 + line->yAdj;
- line->qy2 = y1 - line->xAdj;
- line->qx3 = x1 - line->yAdj;
- line->qy3 = y1 + line->xAdj;
- /* compute the quad's edge vectors (for coverage calc) */
- line->ex0 = line->qx1 - line->qx0;
- line->ey0 = line->qy1 - line->qy0;
- line->ex1 = line->qx2 - line->qx1;
- line->ey1 = line->qy2 - line->qy1;
- line->ex2 = line->qx3 - line->qx2;
- line->ey2 = line->qy3 - line->qy2;
- line->ex3 = line->qx0 - line->qx3;
- line->ey3 = line->qy0 - line->qy3;
-
- if (absDx > absDy) {
- /* X-major line */
- GLfloat dydx = line->dy / line->dx;
- GLfloat xLeft, xRight, yBot, yTop;
- GLint ix, ixRight;
- if (x0 < x1) {
- xLeft = x0 - line->halfWidth;
- xRight = x1 + line->halfWidth;
- if (line->dy >= 0.0) {
- yBot = y0 - 3.0F * line->halfWidth;
- yTop = y0 + line->halfWidth;
- }
- else {
- yBot = y0 - line->halfWidth;
- yTop = y0 + 3.0F * line->halfWidth;
- }
- }
- else {
- xLeft = x1 - line->halfWidth;
- xRight = x0 + line->halfWidth;
- if (line->dy <= 0.0) {
- yBot = y1 - 3.0F * line->halfWidth;
- yTop = y1 + line->halfWidth;
- }
- else {
- yBot = y1 - line->halfWidth;
- yTop = y1 + 3.0F * line->halfWidth;
- }
- }
-
- /* scan along the line, left-to-right */
- ixRight = (GLint) (xRight + 1.0F);
-
- /*printf("avg span height: %g\n", yTop - yBot);*/
- for (ix = (GLint) xLeft; ix < ixRight; ix++) {
- const GLint iyBot = (GLint) yBot;
- const GLint iyTop = (GLint) (yTop + 1.0F);
- GLint iy;
- /* scan across the line, bottom-to-top */
- for (iy = iyBot; iy < iyTop; iy++) {
- (*plot)(ctx, line, ix, iy);
- }
- yBot += dydx;
- yTop += dydx;
- }
- }
- else {
- /* Y-major line */
- GLfloat dxdy = line->dx / line->dy;
- GLfloat yBot, yTop, xLeft, xRight;
- GLint iy, iyTop;
- if (y0 < y1) {
- yBot = y0 - line->halfWidth;
- yTop = y1 + line->halfWidth;
- if (line->dx >= 0.0) {
- xLeft = x0 - 3.0F * line->halfWidth;
- xRight = x0 + line->halfWidth;
- }
- else {
- xLeft = x0 - line->halfWidth;
- xRight = x0 + 3.0F * line->halfWidth;
- }
- }
- else {
- yBot = y1 - line->halfWidth;
- yTop = y0 + line->halfWidth;
- if (line->dx <= 0.0) {
- xLeft = x1 - 3.0F * line->halfWidth;
- xRight = x1 + line->halfWidth;
- }
- else {
- xLeft = x1 - line->halfWidth;
- xRight = x1 + 3.0F * line->halfWidth;
- }
- }
-
- /* scan along the line, bottom-to-top */
- iyTop = (GLint) (yTop + 1.0F);
-
- /*printf("avg span width: %g\n", xRight - xLeft);*/
- for (iy = (GLint) yBot; iy < iyTop; iy++) {
- const GLint ixLeft = (GLint) xLeft;
- const GLint ixRight = (GLint) (xRight + 1.0F);
- GLint ix;
- /* scan across the line, left-to-right */
- for (ix = ixLeft; ix < ixRight; ix++) {
- (*plot)(ctx, line, ix, iy);
- }
- xLeft += dxdy;
- xRight += dxdy;
- }
- }
-}
-
-
-#define NAME(x) aa_rgba_##x
-#define DO_Z
-#include "s_aalinetemp.h"
-
-
-#define NAME(x) aa_general_rgba_##x
-#define DO_Z
-#define DO_ATTRIBS
-#include "s_aalinetemp.h"
-
-
-
-void
-_swrast_choose_aa_line_function(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- ASSERT(ctx->Line.SmoothFlag);
-
- if (ctx->Texture._EnabledCoordUnits != 0
- || ctx->FragmentProgram._Current
- || (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
- || ctx->Fog.ColorSumEnabled
- || swrast->_FogEnabled) {
- swrast->Line = aa_general_rgba_line;
- }
- else {
- swrast->Line = aa_rgba_line;
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "swrast/s_aaline.h"
+#include "swrast/s_context.h"
+#include "swrast/s_span.h"
+#include "swrast/swrast.h"
+
+
+#define SUB_PIXEL 4
+
+
+/*
+ * Info about the AA line we're rendering
+ */
+struct LineInfo
+{
+ GLfloat x0, y0; /* start */
+ GLfloat x1, y1; /* end */
+ GLfloat dx, dy; /* direction vector */
+ GLfloat len; /* length */
+ GLfloat halfWidth; /* half of line width */
+ GLfloat xAdj, yAdj; /* X and Y adjustment for quad corners around line */
+ /* for coverage computation */
+ GLfloat qx0, qy0; /* quad vertices */
+ GLfloat qx1, qy1;
+ GLfloat qx2, qy2;
+ GLfloat qx3, qy3;
+ GLfloat ex0, ey0; /* quad edge vectors */
+ GLfloat ex1, ey1;
+ GLfloat ex2, ey2;
+ GLfloat ex3, ey3;
+
+ /* DO_Z */
+ GLfloat zPlane[4];
+ /* DO_RGBA - always enabled */
+ GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4];
+ /* DO_ATTRIBS */
+ GLfloat wPlane[4];
+ GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4];
+ GLfloat lambda[FRAG_ATTRIB_MAX];
+ GLfloat texWidth[FRAG_ATTRIB_MAX];
+ GLfloat texHeight[FRAG_ATTRIB_MAX];
+
+ SWspan span;
+};
+
+
+
+/*
+ * Compute the equation of a plane used to interpolate line fragment data
+ * such as color, Z, texture coords, etc.
+ * Input: (x0, y0) and (x1,y1) are the endpoints of the line.
+ * z0, and z1 are the end point values to interpolate.
+ * Output: plane - the plane equation.
+ *
+ * Note: we don't really have enough parameters to specify a plane.
+ * We take the endpoints of the line and compute a plane such that
+ * the cross product of the line vector and the plane normal is
+ * parallel to the projection plane.
+ */
+static void
+compute_plane(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1,
+ GLfloat z0, GLfloat z1, GLfloat plane[4])
+{
+#if 0
+ /* original */
+ const GLfloat px = x1 - x0;
+ const GLfloat py = y1 - y0;
+ const GLfloat pz = z1 - z0;
+ const GLfloat qx = -py;
+ const GLfloat qy = px;
+ const GLfloat qz = 0;
+ const GLfloat a = py * qz - pz * qy;
+ const GLfloat b = pz * qx - px * qz;
+ const GLfloat c = px * qy - py * qx;
+ const GLfloat d = -(a * x0 + b * y0 + c * z0);
+ plane[0] = a;
+ plane[1] = b;
+ plane[2] = c;
+ plane[3] = d;
+#else
+ /* simplified */
+ const GLfloat px = x1 - x0;
+ const GLfloat py = y1 - y0;
+ const GLfloat pz = z0 - z1;
+ const GLfloat a = pz * px;
+ const GLfloat b = pz * py;
+ const GLfloat c = px * px + py * py;
+ const GLfloat d = -(a * x0 + b * y0 + c * z0);
+ if (a == 0.0 && b == 0.0 && c == 0.0 && d == 0.0) {
+ plane[0] = 0.0;
+ plane[1] = 0.0;
+ plane[2] = 1.0;
+ plane[3] = 0.0;
+ }
+ else {
+ plane[0] = a;
+ plane[1] = b;
+ plane[2] = c;
+ plane[3] = d;
+ }
+#endif
+}
+
+
+static inline void
+constant_plane(GLfloat value, GLfloat plane[4])
+{
+ plane[0] = 0.0;
+ plane[1] = 0.0;
+ plane[2] = -1.0;
+ plane[3] = value;
+}
+
+
+static inline GLfloat
+solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4])
+{
+ const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
+ return z;
+}
+
+#define SOLVE_PLANE(X, Y, PLANE) \
+ ((PLANE[3] + PLANE[0] * (X) + PLANE[1] * (Y)) / -PLANE[2])
+
+
+/*
+ * Return 1 / solve_plane().
+ */
+static inline GLfloat
+solve_plane_recip(GLfloat x, GLfloat y, const GLfloat plane[4])
+{
+ const GLfloat denom = plane[3] + plane[0] * x + plane[1] * y;
+ if (denom == 0.0)
+ return 0.0;
+ else
+ return -plane[2] / denom;
+}
+
+
+/*
+ * Solve plane and return clamped GLchan value.
+ */
+static inline GLchan
+solve_plane_chan(GLfloat x, GLfloat y, const GLfloat plane[4])
+{
+ const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
+#if CHAN_TYPE == GL_FLOAT
+ return CLAMP(z, 0.0F, CHAN_MAXF);
+#else
+ if (z < 0)
+ return 0;
+ else if (z > CHAN_MAX)
+ return CHAN_MAX;
+ return (GLchan) IROUND_POS(z);
+#endif
+}
+
+
+/*
+ * Compute mipmap level of detail.
+ */
+static inline GLfloat
+compute_lambda(const GLfloat sPlane[4], const GLfloat tPlane[4],
+ GLfloat invQ, GLfloat width, GLfloat height)
+{
+ GLfloat dudx = sPlane[0] / sPlane[2] * invQ * width;
+ GLfloat dudy = sPlane[1] / sPlane[2] * invQ * width;
+ GLfloat dvdx = tPlane[0] / tPlane[2] * invQ * height;
+ GLfloat dvdy = tPlane[1] / tPlane[2] * invQ * height;
+ GLfloat r1 = dudx * dudx + dudy * dudy;
+ GLfloat r2 = dvdx * dvdx + dvdy * dvdy;
+ GLfloat rho2 = r1 + r2;
+ /* return log base 2 of rho */
+ if (rho2 == 0.0F)
+ return 0.0;
+ else
+ return (GLfloat) (LOGF(rho2) * 1.442695 * 0.5);/* 1.442695 = 1/log(2) */
+}
+
+
+
+
+/*
+ * Fill in the samples[] array with the (x,y) subpixel positions of
+ * xSamples * ySamples sample positions.
+ * Note that the four corner samples are put into the first four
+ * positions of the array. This allows us to optimize for the common
+ * case of all samples being inside the polygon.
+ */
+static void
+make_sample_table(GLint xSamples, GLint ySamples, GLfloat samples[][2])
+{
+ const GLfloat dx = 1.0F / (GLfloat) xSamples;
+ const GLfloat dy = 1.0F / (GLfloat) ySamples;
+ GLint x, y;
+ GLint i;
+
+ i = 4;
+ for (x = 0; x < xSamples; x++) {
+ for (y = 0; y < ySamples; y++) {
+ GLint j;
+ if (x == 0 && y == 0) {
+ /* lower left */
+ j = 0;
+ }
+ else if (x == xSamples - 1 && y == 0) {
+ /* lower right */
+ j = 1;
+ }
+ else if (x == 0 && y == ySamples - 1) {
+ /* upper left */
+ j = 2;
+ }
+ else if (x == xSamples - 1 && y == ySamples - 1) {
+ /* upper right */
+ j = 3;
+ }
+ else {
+ j = i++;
+ }
+ samples[j][0] = x * dx + 0.5F * dx;
+ samples[j][1] = y * dy + 0.5F * dy;
+ }
+ }
+}
+
+
+
+/*
+ * Compute how much of the given pixel's area is inside the rectangle
+ * defined by vertices v0, v1, v2, v3.
+ * Vertices MUST be specified in counter-clockwise order.
+ * Return: coverage in [0, 1].
+ */
+static GLfloat
+compute_coveragef(const struct LineInfo *info,
+ GLint winx, GLint winy)
+{
+ static GLfloat samples[SUB_PIXEL * SUB_PIXEL][2];
+ static GLboolean haveSamples = GL_FALSE;
+ const GLfloat x = (GLfloat) winx;
+ const GLfloat y = (GLfloat) winy;
+ GLint stop = 4, i;
+ GLfloat insideCount = SUB_PIXEL * SUB_PIXEL;
+
+ if (!haveSamples) {
+ make_sample_table(SUB_PIXEL, SUB_PIXEL, samples);
+ haveSamples = GL_TRUE;
+ }
+
+#if 0 /*DEBUG*/
+ {
+ const GLfloat area = dx0 * dy1 - dx1 * dy0;
+ assert(area >= 0.0);
+ }
+#endif
+
+ for (i = 0; i < stop; i++) {
+ const GLfloat sx = x + samples[i][0];
+ const GLfloat sy = y + samples[i][1];
+ const GLfloat fx0 = sx - info->qx0;
+ const GLfloat fy0 = sy - info->qy0;
+ const GLfloat fx1 = sx - info->qx1;
+ const GLfloat fy1 = sy - info->qy1;
+ const GLfloat fx2 = sx - info->qx2;
+ const GLfloat fy2 = sy - info->qy2;
+ const GLfloat fx3 = sx - info->qx3;
+ const GLfloat fy3 = sy - info->qy3;
+ /* cross product determines if sample is inside or outside each edge */
+ GLfloat cross0 = (info->ex0 * fy0 - info->ey0 * fx0);
+ GLfloat cross1 = (info->ex1 * fy1 - info->ey1 * fx1);
+ GLfloat cross2 = (info->ex2 * fy2 - info->ey2 * fx2);
+ GLfloat cross3 = (info->ex3 * fy3 - info->ey3 * fx3);
+ /* Check if the sample is exactly on an edge. If so, let cross be a
+ * positive or negative value depending on the direction of the edge.
+ */
+ if (cross0 == 0.0F)
+ cross0 = info->ex0 + info->ey0;
+ if (cross1 == 0.0F)
+ cross1 = info->ex1 + info->ey1;
+ if (cross2 == 0.0F)
+ cross2 = info->ex2 + info->ey2;
+ if (cross3 == 0.0F)
+ cross3 = info->ex3 + info->ey3;
+ if (cross0 < 0.0F || cross1 < 0.0F || cross2 < 0.0F || cross3 < 0.0F) {
+ /* point is outside quadrilateral */
+ insideCount -= 1.0F;
+ stop = SUB_PIXEL * SUB_PIXEL;
+ }
+ }
+ if (stop == 4)
+ return 1.0F;
+ else
+ return insideCount * (1.0F / (SUB_PIXEL * SUB_PIXEL));
+}
+
+
+typedef void (*plot_func)(struct gl_context *ctx, struct LineInfo *line,
+ int ix, int iy);
+
+
+
+/*
+ * Draw an AA line segment (called many times per line when stippling)
+ */
+static void
+segment(struct gl_context *ctx,
+ struct LineInfo *line,
+ plot_func plot,
+ GLfloat t0, GLfloat t1)
+{
+ const GLfloat absDx = (line->dx < 0.0F) ? -line->dx : line->dx;
+ const GLfloat absDy = (line->dy < 0.0F) ? -line->dy : line->dy;
+ /* compute the actual segment's endpoints */
+ const GLfloat x0 = line->x0 + t0 * line->dx;
+ const GLfloat y0 = line->y0 + t0 * line->dy;
+ const GLfloat x1 = line->x0 + t1 * line->dx;
+ const GLfloat y1 = line->y0 + t1 * line->dy;
+
+ /* compute vertices of the line-aligned quadrilateral */
+ line->qx0 = x0 - line->yAdj;
+ line->qy0 = y0 + line->xAdj;
+ line->qx1 = x0 + line->yAdj;
+ line->qy1 = y0 - line->xAdj;
+ line->qx2 = x1 + line->yAdj;
+ line->qy2 = y1 - line->xAdj;
+ line->qx3 = x1 - line->yAdj;
+ line->qy3 = y1 + line->xAdj;
+ /* compute the quad's edge vectors (for coverage calc) */
+ line->ex0 = line->qx1 - line->qx0;
+ line->ey0 = line->qy1 - line->qy0;
+ line->ex1 = line->qx2 - line->qx1;
+ line->ey1 = line->qy2 - line->qy1;
+ line->ex2 = line->qx3 - line->qx2;
+ line->ey2 = line->qy3 - line->qy2;
+ line->ex3 = line->qx0 - line->qx3;
+ line->ey3 = line->qy0 - line->qy3;
+
+ if (absDx > absDy) {
+ /* X-major line */
+ GLfloat dydx = line->dy / line->dx;
+ GLfloat xLeft, xRight, yBot, yTop;
+ GLint ix, ixRight;
+ if (x0 < x1) {
+ xLeft = x0 - line->halfWidth;
+ xRight = x1 + line->halfWidth;
+ if (line->dy >= 0.0) {
+ yBot = y0 - 3.0F * line->halfWidth;
+ yTop = y0 + line->halfWidth;
+ }
+ else {
+ yBot = y0 - line->halfWidth;
+ yTop = y0 + 3.0F * line->halfWidth;
+ }
+ }
+ else {
+ xLeft = x1 - line->halfWidth;
+ xRight = x0 + line->halfWidth;
+ if (line->dy <= 0.0) {
+ yBot = y1 - 3.0F * line->halfWidth;
+ yTop = y1 + line->halfWidth;
+ }
+ else {
+ yBot = y1 - line->halfWidth;
+ yTop = y1 + 3.0F * line->halfWidth;
+ }
+ }
+
+ /* scan along the line, left-to-right */
+ ixRight = (GLint) (xRight + 1.0F);
+
+ /*printf("avg span height: %g\n", yTop - yBot);*/
+ for (ix = (GLint) xLeft; ix < ixRight; ix++) {
+ const GLint iyBot = (GLint) yBot;
+ const GLint iyTop = (GLint) (yTop + 1.0F);
+ GLint iy;
+ /* scan across the line, bottom-to-top */
+ for (iy = iyBot; iy < iyTop; iy++) {
+ (*plot)(ctx, line, ix, iy);
+ }
+ yBot += dydx;
+ yTop += dydx;
+ }
+ }
+ else {
+ /* Y-major line */
+ GLfloat dxdy = line->dx / line->dy;
+ GLfloat yBot, yTop, xLeft, xRight;
+ GLint iy, iyTop;
+ if (y0 < y1) {
+ yBot = y0 - line->halfWidth;
+ yTop = y1 + line->halfWidth;
+ if (line->dx >= 0.0) {
+ xLeft = x0 - 3.0F * line->halfWidth;
+ xRight = x0 + line->halfWidth;
+ }
+ else {
+ xLeft = x0 - line->halfWidth;
+ xRight = x0 + 3.0F * line->halfWidth;
+ }
+ }
+ else {
+ yBot = y1 - line->halfWidth;
+ yTop = y0 + line->halfWidth;
+ if (line->dx <= 0.0) {
+ xLeft = x1 - 3.0F * line->halfWidth;
+ xRight = x1 + line->halfWidth;
+ }
+ else {
+ xLeft = x1 - line->halfWidth;
+ xRight = x1 + 3.0F * line->halfWidth;
+ }
+ }
+
+ /* scan along the line, bottom-to-top */
+ iyTop = (GLint) (yTop + 1.0F);
+
+ /*printf("avg span width: %g\n", xRight - xLeft);*/
+ for (iy = (GLint) yBot; iy < iyTop; iy++) {
+ const GLint ixLeft = (GLint) xLeft;
+ const GLint ixRight = (GLint) (xRight + 1.0F);
+ GLint ix;
+ /* scan across the line, left-to-right */
+ for (ix = ixLeft; ix < ixRight; ix++) {
+ (*plot)(ctx, line, ix, iy);
+ }
+ xLeft += dxdy;
+ xRight += dxdy;
+ }
+ }
+}
+
+
+#define NAME(x) aa_rgba_##x
+#define DO_Z
+#include "s_aalinetemp.h"
+
+
+#define NAME(x) aa_general_rgba_##x
+#define DO_Z
+#define DO_ATTRIBS
+#include "s_aalinetemp.h"
+
+
+
+void
+_swrast_choose_aa_line_function(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ ASSERT(ctx->Line.SmoothFlag);
+
+ if (ctx->Texture._EnabledCoordUnits != 0
+ || ctx->FragmentProgram._Current
+ || (ctx->Light.Enabled &&
+ ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)
+ || ctx->Fog.ColorSumEnabled
+ || swrast->_FogEnabled) {
+ swrast->Line = aa_general_rgba_line;
+ }
+ else {
+ swrast->Line = aa_rgba_line;
+ }
+}
diff --git a/mesalib/src/mesa/swrast/s_aatriangle.c b/mesalib/src/mesa/swrast/s_aatriangle.c
index ad068d0c0..c68fdf63b 100644
--- a/mesalib/src/mesa/swrast/s_aatriangle.c
+++ b/mesalib/src/mesa/swrast/s_aatriangle.c
@@ -1,312 +1,312 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-/*
- * Antialiased Triangle rasterizers
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/colormac.h"
-#include "main/macros.h"
-#include "main/imports.h"
-#include "main/state.h"
-#include "s_aatriangle.h"
-#include "s_context.h"
-#include "s_span.h"
-
-
-/*
- * Compute coefficients of a plane using the X,Y coords of the v0, v1, v2
- * vertices and the given Z values.
- * A point (x,y,z) lies on plane iff a*x+b*y+c*z+d = 0.
- */
-static INLINE void
-compute_plane(const GLfloat v0[], const GLfloat v1[], const GLfloat v2[],
- GLfloat z0, GLfloat z1, GLfloat z2, GLfloat plane[4])
-{
- const GLfloat px = v1[0] - v0[0];
- const GLfloat py = v1[1] - v0[1];
- const GLfloat pz = z1 - z0;
-
- const GLfloat qx = v2[0] - v0[0];
- const GLfloat qy = v2[1] - v0[1];
- const GLfloat qz = z2 - z0;
-
- /* Crossproduct "(a,b,c):= dv1 x dv2" is orthogonal to plane. */
- const GLfloat a = py * qz - pz * qy;
- const GLfloat b = pz * qx - px * qz;
- const GLfloat c = px * qy - py * qx;
- /* Point on the plane = "r*(a,b,c) + w", with fixed "r" depending
- on the distance of plane from origin and arbitrary "w" parallel
- to the plane. */
- /* The scalar product "(r*(a,b,c)+w)*(a,b,c)" is "r*(a^2+b^2+c^2)",
- which is equal to "-d" below. */
- const GLfloat d = -(a * v0[0] + b * v0[1] + c * z0);
-
- plane[0] = a;
- plane[1] = b;
- plane[2] = c;
- plane[3] = d;
-}
-
-
-/*
- * Compute coefficients of a plane with a constant Z value.
- */
-static INLINE void
-constant_plane(GLfloat value, GLfloat plane[4])
-{
- plane[0] = 0.0;
- plane[1] = 0.0;
- plane[2] = -1.0;
- plane[3] = value;
-}
-
-#define CONSTANT_PLANE(VALUE, PLANE) \
-do { \
- PLANE[0] = 0.0F; \
- PLANE[1] = 0.0F; \
- PLANE[2] = -1.0F; \
- PLANE[3] = VALUE; \
-} while (0)
-
-
-
-/*
- * Solve plane equation for Z at (X,Y).
- */
-static INLINE GLfloat
-solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4])
-{
- ASSERT(plane[2] != 0.0F);
- return (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
-}
-
-
-#define SOLVE_PLANE(X, Y, PLANE) \
- ((PLANE[3] + PLANE[0] * (X) + PLANE[1] * (Y)) / -PLANE[2])
-
-
-/*
- * Return 1 / solve_plane().
- */
-static INLINE GLfloat
-solve_plane_recip(GLfloat x, GLfloat y, const GLfloat plane[4])
-{
- const GLfloat denom = plane[3] + plane[0] * x + plane[1] * y;
- if (denom == 0.0F)
- return 0.0F;
- else
- return -plane[2] / denom;
-}
-
-
-/*
- * Solve plane and return clamped GLchan value.
- */
-static INLINE GLchan
-solve_plane_chan(GLfloat x, GLfloat y, const GLfloat plane[4])
-{
- const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
-#if CHAN_TYPE == GL_FLOAT
- return CLAMP(z, 0.0F, CHAN_MAXF);
-#else
- if (z < 0)
- return 0;
- else if (z > CHAN_MAX)
- return CHAN_MAX;
- return (GLchan) IROUND_POS(z);
-#endif
-}
-
-
-static INLINE GLfloat
-plane_dx(const GLfloat plane[4])
-{
- return -plane[0] / plane[2];
-}
-
-static INLINE GLfloat
-plane_dy(const GLfloat plane[4])
-{
- return -plane[1] / plane[2];
-}
-
-
-
-/*
- * Compute how much (area) of the given pixel is inside the triangle.
- * Vertices MUST be specified in counter-clockwise order.
- * Return: coverage in [0, 1].
- */
-static GLfloat
-compute_coveragef(const GLfloat v0[3], const GLfloat v1[3],
- const GLfloat v2[3], GLint winx, GLint winy)
-{
- /* Given a position [0,3]x[0,3] return the sub-pixel sample position.
- * Contributed by Ray Tice.
- *
- * Jitter sample positions -
- * - average should be .5 in x & y for each column
- * - each of the 16 rows and columns should be used once
- * - the rectangle formed by the first four points
- * should contain the other points
- * - the distrubition should be fairly even in any given direction
- *
- * The pattern drawn below isn't optimal, but it's better than a regular
- * grid. In the drawing, the center of each subpixel is surrounded by
- * four dots. The "x" marks the jittered position relative to the
- * subpixel center.
- */
-#define POS(a, b) (0.5+a*4+b)/16
- static const GLfloat samples[16][2] = {
- /* start with the four corners */
- { POS(0, 2), POS(0, 0) },
- { POS(3, 3), POS(0, 2) },
- { POS(0, 0), POS(3, 1) },
- { POS(3, 1), POS(3, 3) },
- /* continue with interior samples */
- { POS(1, 1), POS(0, 1) },
- { POS(2, 0), POS(0, 3) },
- { POS(0, 3), POS(1, 3) },
- { POS(1, 2), POS(1, 0) },
- { POS(2, 3), POS(1, 2) },
- { POS(3, 2), POS(1, 1) },
- { POS(0, 1), POS(2, 2) },
- { POS(1, 0), POS(2, 1) },
- { POS(2, 1), POS(2, 3) },
- { POS(3, 0), POS(2, 0) },
- { POS(1, 3), POS(3, 0) },
- { POS(2, 2), POS(3, 2) }
- };
-
- const GLfloat x = (GLfloat) winx;
- const GLfloat y = (GLfloat) winy;
- const GLfloat dx0 = v1[0] - v0[0];
- const GLfloat dy0 = v1[1] - v0[1];
- const GLfloat dx1 = v2[0] - v1[0];
- const GLfloat dy1 = v2[1] - v1[1];
- const GLfloat dx2 = v0[0] - v2[0];
- const GLfloat dy2 = v0[1] - v2[1];
- GLint stop = 4, i;
- GLfloat insideCount = 16.0F;
-
- ASSERT(dx0 * dy1 - dx1 * dy0 >= 0.0); /* area >= 0.0 */
-
- for (i = 0; i < stop; i++) {
- const GLfloat sx = x + samples[i][0];
- const GLfloat sy = y + samples[i][1];
- /* cross product determines if sample is inside or outside each edge */
- GLfloat cross = (dx0 * (sy - v0[1]) - dy0 * (sx - v0[0]));
- /* Check if the sample is exactly on an edge. If so, let cross be a
- * positive or negative value depending on the direction of the edge.
- */
- if (cross == 0.0F)
- cross = dx0 + dy0;
- if (cross < 0.0F) {
- /* sample point is outside first edge */
- insideCount -= 1.0F;
- stop = 16;
- }
- else {
- /* sample point is inside first edge */
- cross = (dx1 * (sy - v1[1]) - dy1 * (sx - v1[0]));
- if (cross == 0.0F)
- cross = dx1 + dy1;
- if (cross < 0.0F) {
- /* sample point is outside second edge */
- insideCount -= 1.0F;
- stop = 16;
- }
- else {
- /* sample point is inside first and second edges */
- cross = (dx2 * (sy - v2[1]) - dy2 * (sx - v2[0]));
- if (cross == 0.0F)
- cross = dx2 + dy2;
- if (cross < 0.0F) {
- /* sample point is outside third edge */
- insideCount -= 1.0F;
- stop = 16;
- }
- }
- }
- }
- if (stop == 4)
- return 1.0F;
- else
- return insideCount * (1.0F / 16.0F);
-}
-
-
-
-static void
-rgba_aa_tri(struct gl_context *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2)
-{
-#define DO_Z
-#include "s_aatritemp.h"
-}
-
-
-static void
-general_aa_tri(struct gl_context *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2)
-{
-#define DO_Z
-#define DO_ATTRIBS
-#include "s_aatritemp.h"
-}
-
-
-
-/*
- * Examine GL state and set swrast->Triangle to an
- * appropriate antialiased triangle rasterizer function.
- */
-void
-_swrast_set_aa_triangle_function(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- ASSERT(ctx->Polygon.SmoothFlag);
-
- if (ctx->Texture._EnabledCoordUnits != 0
- || ctx->FragmentProgram._Current
- || swrast->_FogEnabled
- || _mesa_need_secondary_color(ctx)) {
- SWRAST_CONTEXT(ctx)->Triangle = general_aa_tri;
- }
- else {
- SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri;
- }
-
- ASSERT(SWRAST_CONTEXT(ctx)->Triangle);
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.3
+ *
+ * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+/*
+ * Antialiased Triangle rasterizers
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/state.h"
+#include "s_aatriangle.h"
+#include "s_context.h"
+#include "s_span.h"
+
+
+/*
+ * Compute coefficients of a plane using the X,Y coords of the v0, v1, v2
+ * vertices and the given Z values.
+ * A point (x,y,z) lies on plane iff a*x+b*y+c*z+d = 0.
+ */
+static inline void
+compute_plane(const GLfloat v0[], const GLfloat v1[], const GLfloat v2[],
+ GLfloat z0, GLfloat z1, GLfloat z2, GLfloat plane[4])
+{
+ const GLfloat px = v1[0] - v0[0];
+ const GLfloat py = v1[1] - v0[1];
+ const GLfloat pz = z1 - z0;
+
+ const GLfloat qx = v2[0] - v0[0];
+ const GLfloat qy = v2[1] - v0[1];
+ const GLfloat qz = z2 - z0;
+
+ /* Crossproduct "(a,b,c):= dv1 x dv2" is orthogonal to plane. */
+ const GLfloat a = py * qz - pz * qy;
+ const GLfloat b = pz * qx - px * qz;
+ const GLfloat c = px * qy - py * qx;
+ /* Point on the plane = "r*(a,b,c) + w", with fixed "r" depending
+ on the distance of plane from origin and arbitrary "w" parallel
+ to the plane. */
+ /* The scalar product "(r*(a,b,c)+w)*(a,b,c)" is "r*(a^2+b^2+c^2)",
+ which is equal to "-d" below. */
+ const GLfloat d = -(a * v0[0] + b * v0[1] + c * z0);
+
+ plane[0] = a;
+ plane[1] = b;
+ plane[2] = c;
+ plane[3] = d;
+}
+
+
+/*
+ * Compute coefficients of a plane with a constant Z value.
+ */
+static inline void
+constant_plane(GLfloat value, GLfloat plane[4])
+{
+ plane[0] = 0.0;
+ plane[1] = 0.0;
+ plane[2] = -1.0;
+ plane[3] = value;
+}
+
+#define CONSTANT_PLANE(VALUE, PLANE) \
+do { \
+ PLANE[0] = 0.0F; \
+ PLANE[1] = 0.0F; \
+ PLANE[2] = -1.0F; \
+ PLANE[3] = VALUE; \
+} while (0)
+
+
+
+/*
+ * Solve plane equation for Z at (X,Y).
+ */
+static inline GLfloat
+solve_plane(GLfloat x, GLfloat y, const GLfloat plane[4])
+{
+ ASSERT(plane[2] != 0.0F);
+ return (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
+}
+
+
+#define SOLVE_PLANE(X, Y, PLANE) \
+ ((PLANE[3] + PLANE[0] * (X) + PLANE[1] * (Y)) / -PLANE[2])
+
+
+/*
+ * Return 1 / solve_plane().
+ */
+static inline GLfloat
+solve_plane_recip(GLfloat x, GLfloat y, const GLfloat plane[4])
+{
+ const GLfloat denom = plane[3] + plane[0] * x + plane[1] * y;
+ if (denom == 0.0F)
+ return 0.0F;
+ else
+ return -plane[2] / denom;
+}
+
+
+/*
+ * Solve plane and return clamped GLchan value.
+ */
+static inline GLchan
+solve_plane_chan(GLfloat x, GLfloat y, const GLfloat plane[4])
+{
+ const GLfloat z = (plane[3] + plane[0] * x + plane[1] * y) / -plane[2];
+#if CHAN_TYPE == GL_FLOAT
+ return CLAMP(z, 0.0F, CHAN_MAXF);
+#else
+ if (z < 0)
+ return 0;
+ else if (z > CHAN_MAX)
+ return CHAN_MAX;
+ return (GLchan) IROUND_POS(z);
+#endif
+}
+
+
+static inline GLfloat
+plane_dx(const GLfloat plane[4])
+{
+ return -plane[0] / plane[2];
+}
+
+static inline GLfloat
+plane_dy(const GLfloat plane[4])
+{
+ return -plane[1] / plane[2];
+}
+
+
+
+/*
+ * Compute how much (area) of the given pixel is inside the triangle.
+ * Vertices MUST be specified in counter-clockwise order.
+ * Return: coverage in [0, 1].
+ */
+static GLfloat
+compute_coveragef(const GLfloat v0[3], const GLfloat v1[3],
+ const GLfloat v2[3], GLint winx, GLint winy)
+{
+ /* Given a position [0,3]x[0,3] return the sub-pixel sample position.
+ * Contributed by Ray Tice.
+ *
+ * Jitter sample positions -
+ * - average should be .5 in x & y for each column
+ * - each of the 16 rows and columns should be used once
+ * - the rectangle formed by the first four points
+ * should contain the other points
+ * - the distrubition should be fairly even in any given direction
+ *
+ * The pattern drawn below isn't optimal, but it's better than a regular
+ * grid. In the drawing, the center of each subpixel is surrounded by
+ * four dots. The "x" marks the jittered position relative to the
+ * subpixel center.
+ */
+#define POS(a, b) (0.5+a*4+b)/16
+ static const GLfloat samples[16][2] = {
+ /* start with the four corners */
+ { POS(0, 2), POS(0, 0) },
+ { POS(3, 3), POS(0, 2) },
+ { POS(0, 0), POS(3, 1) },
+ { POS(3, 1), POS(3, 3) },
+ /* continue with interior samples */
+ { POS(1, 1), POS(0, 1) },
+ { POS(2, 0), POS(0, 3) },
+ { POS(0, 3), POS(1, 3) },
+ { POS(1, 2), POS(1, 0) },
+ { POS(2, 3), POS(1, 2) },
+ { POS(3, 2), POS(1, 1) },
+ { POS(0, 1), POS(2, 2) },
+ { POS(1, 0), POS(2, 1) },
+ { POS(2, 1), POS(2, 3) },
+ { POS(3, 0), POS(2, 0) },
+ { POS(1, 3), POS(3, 0) },
+ { POS(2, 2), POS(3, 2) }
+ };
+
+ const GLfloat x = (GLfloat) winx;
+ const GLfloat y = (GLfloat) winy;
+ const GLfloat dx0 = v1[0] - v0[0];
+ const GLfloat dy0 = v1[1] - v0[1];
+ const GLfloat dx1 = v2[0] - v1[0];
+ const GLfloat dy1 = v2[1] - v1[1];
+ const GLfloat dx2 = v0[0] - v2[0];
+ const GLfloat dy2 = v0[1] - v2[1];
+ GLint stop = 4, i;
+ GLfloat insideCount = 16.0F;
+
+ ASSERT(dx0 * dy1 - dx1 * dy0 >= 0.0); /* area >= 0.0 */
+
+ for (i = 0; i < stop; i++) {
+ const GLfloat sx = x + samples[i][0];
+ const GLfloat sy = y + samples[i][1];
+ /* cross product determines if sample is inside or outside each edge */
+ GLfloat cross = (dx0 * (sy - v0[1]) - dy0 * (sx - v0[0]));
+ /* Check if the sample is exactly on an edge. If so, let cross be a
+ * positive or negative value depending on the direction of the edge.
+ */
+ if (cross == 0.0F)
+ cross = dx0 + dy0;
+ if (cross < 0.0F) {
+ /* sample point is outside first edge */
+ insideCount -= 1.0F;
+ stop = 16;
+ }
+ else {
+ /* sample point is inside first edge */
+ cross = (dx1 * (sy - v1[1]) - dy1 * (sx - v1[0]));
+ if (cross == 0.0F)
+ cross = dx1 + dy1;
+ if (cross < 0.0F) {
+ /* sample point is outside second edge */
+ insideCount -= 1.0F;
+ stop = 16;
+ }
+ else {
+ /* sample point is inside first and second edges */
+ cross = (dx2 * (sy - v2[1]) - dy2 * (sx - v2[0]));
+ if (cross == 0.0F)
+ cross = dx2 + dy2;
+ if (cross < 0.0F) {
+ /* sample point is outside third edge */
+ insideCount -= 1.0F;
+ stop = 16;
+ }
+ }
+ }
+ }
+ if (stop == 4)
+ return 1.0F;
+ else
+ return insideCount * (1.0F / 16.0F);
+}
+
+
+
+static void
+rgba_aa_tri(struct gl_context *ctx,
+ const SWvertex *v0,
+ const SWvertex *v1,
+ const SWvertex *v2)
+{
+#define DO_Z
+#include "s_aatritemp.h"
+}
+
+
+static void
+general_aa_tri(struct gl_context *ctx,
+ const SWvertex *v0,
+ const SWvertex *v1,
+ const SWvertex *v2)
+{
+#define DO_Z
+#define DO_ATTRIBS
+#include "s_aatritemp.h"
+}
+
+
+
+/*
+ * Examine GL state and set swrast->Triangle to an
+ * appropriate antialiased triangle rasterizer function.
+ */
+void
+_swrast_set_aa_triangle_function(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ ASSERT(ctx->Polygon.SmoothFlag);
+
+ if (ctx->Texture._EnabledCoordUnits != 0
+ || ctx->FragmentProgram._Current
+ || swrast->_FogEnabled
+ || _mesa_need_secondary_color(ctx)) {
+ SWRAST_CONTEXT(ctx)->Triangle = general_aa_tri;
+ }
+ else {
+ SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri;
+ }
+
+ ASSERT(SWRAST_CONTEXT(ctx)->Triangle);
+}
diff --git a/mesalib/src/mesa/swrast/s_blit.c b/mesalib/src/mesa/swrast/s_blit.c
index 7f53f19eb..f094be898 100644
--- a/mesalib/src/mesa/swrast/s_blit.c
+++ b/mesalib/src/mesa/swrast/s_blit.c
@@ -243,7 +243,7 @@ blit_nearest(struct gl_context *ctx,
#define LERP(T, A, B) ( (A) + (T) * ((B) - (A)) )
-static INLINE GLfloat
+static inline GLfloat
lerp_2d(GLfloat a, GLfloat b,
GLfloat v00, GLfloat v10, GLfloat v01, GLfloat v11)
{
diff --git a/mesalib/src/mesa/swrast/s_context.c b/mesalib/src/mesa/swrast/s_context.c
index a4acac233..5287671d7 100644
--- a/mesalib/src/mesa/swrast/s_context.c
+++ b/mesalib/src/mesa/swrast/s_context.c
@@ -780,17 +780,6 @@ _swrast_CreateContext( struct gl_context *ctx )
swrast->PointSpan.facing = 0;
swrast->PointSpan.array = swrast->SpanArrays;
- /* TexelBuffer is also global and normally shared by all SWspan instances;
- * when running with multiple threads, create one per thread.
- */
- swrast->TexelBuffer = (GLfloat *) MALLOC(ctx->Const.MaxTextureImageUnits * maxThreads *
- MAX_WIDTH * 4 * sizeof(GLfloat));
- if (!swrast->TexelBuffer) {
- FREE(swrast->SpanArrays);
- FREE(swrast);
- return GL_FALSE;
- }
-
init_program_native_limits(&ctx->Const.VertexProgram);
init_program_native_limits(&ctx->Const.GeometryProgram);
init_program_native_limits(&ctx->Const.FragmentProgram);
diff --git a/mesalib/src/mesa/swrast/s_context.h b/mesalib/src/mesa/swrast/s_context.h
index 1e0bfc0f9..12ad688b0 100644
--- a/mesalib/src/mesa/swrast/s_context.h
+++ b/mesalib/src/mesa/swrast/s_context.h
@@ -163,14 +163,14 @@ struct swrast_texture_image
/** cast wrapper */
-static INLINE struct swrast_texture_image *
+static inline struct swrast_texture_image *
swrast_texture_image(struct gl_texture_image *img)
{
return (struct swrast_texture_image *) img;
}
/** cast wrapper */
-static INLINE const struct swrast_texture_image *
+static inline const struct swrast_texture_image *
swrast_texture_image_const(const struct gl_texture_image *img)
{
return (const struct swrast_texture_image *) img;
@@ -308,14 +308,14 @@ _swrast_update_texture_samplers(struct gl_context *ctx);
/** Return SWcontext for the given struct gl_context */
-static INLINE SWcontext *
+static inline SWcontext *
SWRAST_CONTEXT(struct gl_context *ctx)
{
return (SWcontext *) ctx->swrast_context;
}
/** const version of above */
-static INLINE const SWcontext *
+static inline const SWcontext *
CONST_SWRAST_CONTEXT(const struct gl_context *ctx)
{
return (const SWcontext *) ctx->swrast_context;
@@ -327,7 +327,7 @@ CONST_SWRAST_CONTEXT(const struct gl_context *ctx)
* For drivers that rely on swrast for fallback rendering, this is the
* driver's opportunity to map renderbuffers and textures.
*/
-static INLINE void
+static inline void
swrast_render_start(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -337,7 +337,7 @@ swrast_render_start(struct gl_context *ctx)
/** Called after framebuffer reading/writing */
-static INLINE void
+static inline void
swrast_render_finish(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
diff --git a/mesalib/src/mesa/swrast/s_fragprog.c b/mesalib/src/mesa/swrast/s_fragprog.c
index 9513b1c46..7f205a200 100644
--- a/mesalib/src/mesa/swrast/s_fragprog.c
+++ b/mesalib/src/mesa/swrast/s_fragprog.c
@@ -35,7 +35,7 @@
* Apply texture object's swizzle (X/Y/Z/W/0/1) to incoming 'texel'
* and return results in 'colorOut'.
*/
-static INLINE void
+static inline void
swizzle_texel(const GLfloat texel[4], GLfloat colorOut[4], GLuint swizzle)
{
if (swizzle == SWIZZLE_NOOP) {
diff --git a/mesalib/src/mesa/swrast/s_logic.c b/mesalib/src/mesa/swrast/s_logic.c
index 2f0c0ea7c..80ee46c24 100644
--- a/mesalib/src/mesa/swrast/s_logic.c
+++ b/mesalib/src/mesa/swrast/s_logic.c
@@ -1,219 +1,219 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.2
- *
- * Copyright (C) 1999-2006 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/imports.h"
-#include "main/macros.h"
-
-#include "s_context.h"
-#include "s_logic.h"
-#include "s_span.h"
-
-
-/**
- * We do all logic ops on 4-byte GLuints.
- * Depending on bytes per pixel, the mask array elements correspond to
- * 1, 2 or 4 GLuints.
- */
-#define LOGIC_OP_LOOP(MODE, MASKSTRIDE) \
-do { \
- GLuint i; \
- switch (MODE) { \
- case GL_CLEAR: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = 0; \
- } \
- } \
- break; \
- case GL_SET: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = ~0; \
- } \
- } \
- break; \
- case GL_COPY: \
- /* do nothing */ \
- break; \
- case GL_COPY_INVERTED: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = ~src[i]; \
- } \
- } \
- break; \
- case GL_NOOP: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = dest[i]; \
- } \
- } \
- break; \
- case GL_INVERT: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = ~dest[i]; \
- } \
- } \
- break; \
- case GL_AND: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] &= dest[i]; \
- } \
- } \
- break; \
- case GL_NAND: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = ~(src[i] & dest[i]); \
- } \
- } \
- break; \
- case GL_OR: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] |= dest[i]; \
- } \
- } \
- break; \
- case GL_NOR: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = ~(src[i] | dest[i]); \
- } \
- } \
- break; \
- case GL_XOR: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] ^= dest[i]; \
- } \
- } \
- break; \
- case GL_EQUIV: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = ~(src[i] ^ dest[i]); \
- } \
- } \
- break; \
- case GL_AND_REVERSE: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = src[i] & ~dest[i]; \
- } \
- } \
- break; \
- case GL_AND_INVERTED: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = ~src[i] & dest[i]; \
- } \
- } \
- break; \
- case GL_OR_REVERSE: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = src[i] | ~dest[i]; \
- } \
- } \
- break; \
- case GL_OR_INVERTED: \
- for (i = 0; i < n; i++) { \
- if (mask[i / MASKSTRIDE]) { \
- src[i] = ~src[i] | dest[i]; \
- } \
- } \
- break; \
- default: \
- _mesa_problem(ctx, "bad logicop mode");\
- } \
-} while (0)
-
-
-
-static INLINE void
-logicop_uint1(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[],
- const GLubyte mask[])
-{
- LOGIC_OP_LOOP(ctx->Color.LogicOp, 1);
-}
-
-
-static INLINE void
-logicop_uint2(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[],
- const GLubyte mask[])
-{
- LOGIC_OP_LOOP(ctx->Color.LogicOp, 2);
-}
-
-
-static INLINE void
-logicop_uint4(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[],
- const GLubyte mask[])
-{
- LOGIC_OP_LOOP(ctx->Color.LogicOp, 4);
-}
-
-
-
-/**
- * Apply the current logic operator to a span of RGBA pixels.
- * We can handle horizontal runs of pixels (spans) or arrays of x/y
- * pixel coordinates.
- */
-void
-_swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
- SWspan *span)
-{
- void *rbPixels;
-
- ASSERT(span->end < MAX_WIDTH);
- ASSERT(span->arrayMask & SPAN_RGBA);
- ASSERT(rb->DataType == span->array->ChanType);
-
- rbPixels = _swrast_get_dest_rgba(ctx, rb, span);
-
- if (span->array->ChanType == GL_UNSIGNED_BYTE) {
- /* treat 4*GLubyte as GLuint */
- logicop_uint1(ctx, span->end,
- (GLuint *) span->array->rgba8,
- (const GLuint *) rbPixels, span->array->mask);
- }
- else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
- /* treat 2*GLushort as GLuint */
- logicop_uint2(ctx, 2 * span->end,
- (GLuint *) span->array->rgba16,
- (const GLuint *) rbPixels, span->array->mask);
- }
- else {
- logicop_uint4(ctx, 4 * span->end,
- (GLuint *) span->array->attribs[FRAG_ATTRIB_COL0],
- (const GLuint *) rbPixels, span->array->mask);
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/macros.h"
+
+#include "s_context.h"
+#include "s_logic.h"
+#include "s_span.h"
+
+
+/**
+ * We do all logic ops on 4-byte GLuints.
+ * Depending on bytes per pixel, the mask array elements correspond to
+ * 1, 2 or 4 GLuints.
+ */
+#define LOGIC_OP_LOOP(MODE, MASKSTRIDE) \
+do { \
+ GLuint i; \
+ switch (MODE) { \
+ case GL_CLEAR: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = 0; \
+ } \
+ } \
+ break; \
+ case GL_SET: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = ~0; \
+ } \
+ } \
+ break; \
+ case GL_COPY: \
+ /* do nothing */ \
+ break; \
+ case GL_COPY_INVERTED: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = ~src[i]; \
+ } \
+ } \
+ break; \
+ case GL_NOOP: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = dest[i]; \
+ } \
+ } \
+ break; \
+ case GL_INVERT: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = ~dest[i]; \
+ } \
+ } \
+ break; \
+ case GL_AND: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] &= dest[i]; \
+ } \
+ } \
+ break; \
+ case GL_NAND: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = ~(src[i] & dest[i]); \
+ } \
+ } \
+ break; \
+ case GL_OR: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] |= dest[i]; \
+ } \
+ } \
+ break; \
+ case GL_NOR: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = ~(src[i] | dest[i]); \
+ } \
+ } \
+ break; \
+ case GL_XOR: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] ^= dest[i]; \
+ } \
+ } \
+ break; \
+ case GL_EQUIV: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = ~(src[i] ^ dest[i]); \
+ } \
+ } \
+ break; \
+ case GL_AND_REVERSE: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = src[i] & ~dest[i]; \
+ } \
+ } \
+ break; \
+ case GL_AND_INVERTED: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = ~src[i] & dest[i]; \
+ } \
+ } \
+ break; \
+ case GL_OR_REVERSE: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = src[i] | ~dest[i]; \
+ } \
+ } \
+ break; \
+ case GL_OR_INVERTED: \
+ for (i = 0; i < n; i++) { \
+ if (mask[i / MASKSTRIDE]) { \
+ src[i] = ~src[i] | dest[i]; \
+ } \
+ } \
+ break; \
+ default: \
+ _mesa_problem(ctx, "bad logicop mode");\
+ } \
+} while (0)
+
+
+
+static inline void
+logicop_uint1(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[],
+ const GLubyte mask[])
+{
+ LOGIC_OP_LOOP(ctx->Color.LogicOp, 1);
+}
+
+
+static inline void
+logicop_uint2(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[],
+ const GLubyte mask[])
+{
+ LOGIC_OP_LOOP(ctx->Color.LogicOp, 2);
+}
+
+
+static inline void
+logicop_uint4(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[],
+ const GLubyte mask[])
+{
+ LOGIC_OP_LOOP(ctx->Color.LogicOp, 4);
+}
+
+
+
+/**
+ * Apply the current logic operator to a span of RGBA pixels.
+ * We can handle horizontal runs of pixels (spans) or arrays of x/y
+ * pixel coordinates.
+ */
+void
+_swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ SWspan *span)
+{
+ void *rbPixels;
+
+ ASSERT(span->end < MAX_WIDTH);
+ ASSERT(span->arrayMask & SPAN_RGBA);
+ ASSERT(rb->DataType == span->array->ChanType);
+
+ rbPixels = _swrast_get_dest_rgba(ctx, rb, span);
+
+ if (span->array->ChanType == GL_UNSIGNED_BYTE) {
+ /* treat 4*GLubyte as GLuint */
+ logicop_uint1(ctx, span->end,
+ (GLuint *) span->array->rgba8,
+ (const GLuint *) rbPixels, span->array->mask);
+ }
+ else if (span->array->ChanType == GL_UNSIGNED_SHORT) {
+ /* treat 2*GLushort as GLuint */
+ logicop_uint2(ctx, 2 * span->end,
+ (GLuint *) span->array->rgba16,
+ (const GLuint *) rbPixels, span->array->mask);
+ }
+ else {
+ logicop_uint4(ctx, 4 * span->end,
+ (GLuint *) span->array->attribs[FRAG_ATTRIB_COL0],
+ (const GLuint *) rbPixels, span->array->mask);
+ }
+}
diff --git a/mesalib/src/mesa/swrast/s_points.c b/mesalib/src/mesa/swrast/s_points.c
index a46be8f58..11b7ef7b1 100644
--- a/mesalib/src/mesa/swrast/s_points.c
+++ b/mesalib/src/mesa/swrast/s_points.c
@@ -1,572 +1,572 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-
-#include "main/glheader.h"
-#include "main/colormac.h"
-#include "main/macros.h"
-#include "s_context.h"
-#include "s_feedback.h"
-#include "s_points.h"
-#include "s_span.h"
-
-
-/**
- * Used to cull points with invalid coords
- */
-#define CULL_INVALID(V) \
- do { \
- float tmp = (V)->attrib[FRAG_ATTRIB_WPOS][0] \
- + (V)->attrib[FRAG_ATTRIB_WPOS][1]; \
- if (IS_INF_OR_NAN(tmp)) \
- return; \
- } while(0)
-
-
-
-/**
- * Get/compute the point size.
- * The size may come from a vertex shader, or computed with attentuation
- * or just the glPointSize value.
- * Must also clamp to user-defined range and implmentation limits.
- */
-static INLINE GLfloat
-get_size(const struct gl_context *ctx, const SWvertex *vert, GLboolean smoothed)
-{
- GLfloat size;
-
- if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
- /* use vertex's point size */
- size = vert->pointSize;
- }
- else {
- /* use constant point size */
- size = ctx->Point.Size;
- }
- /* always clamp to user-specified limits */
- size = CLAMP(size, ctx->Point.MinSize, ctx->Point.MaxSize);
- /* clamp to implementation limits */
- if (smoothed)
- size = CLAMP(size, ctx->Const.MinPointSizeAA, ctx->Const.MaxPointSizeAA);
- else
- size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
-
- return size;
-}
-
-
-/**
- * Draw a point sprite
- */
-static void
-sprite_point(struct gl_context *ctx, const SWvertex *vert)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- SWspan span;
- GLfloat size;
- GLuint tCoords[MAX_TEXTURE_COORD_UNITS + 1];
- GLuint numTcoords = 0;
- GLfloat t0, dtdy;
-
- CULL_INVALID(vert);
-
- /* z coord */
- if (ctx->DrawBuffer->Visual.depthBits <= 16)
- span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
- else
- span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
- span.zStep = 0;
-
- size = get_size(ctx, vert, GL_FALSE);
-
- /* span init */
- INIT_SPAN(span, GL_POINT);
- span.interpMask = SPAN_Z | SPAN_RGBA;
-
- span.facing = swrast->PointLineFacing;
-
- span.red = ChanToFixed(vert->color[0]);
- span.green = ChanToFixed(vert->color[1]);
- span.blue = ChanToFixed(vert->color[2]);
- span.alpha = ChanToFixed(vert->color[3]);
- span.redStep = 0;
- span.greenStep = 0;
- span.blueStep = 0;
- span.alphaStep = 0;
-
- /* need these for fragment programs */
- span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
- span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
- span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
-
- {
- GLfloat s, r, dsdx;
-
- /* texcoord / pointcoord interpolants */
- s = 0.0F;
- dsdx = 1.0F / size;
- if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) {
- dtdy = 1.0F / size;
- t0 = 0.5F * dtdy;
- }
- else {
- /* GL_UPPER_LEFT */
- dtdy = -1.0F / size;
- t0 = 1.0F + 0.5F * dtdy;
- }
-
- ATTRIB_LOOP_BEGIN
- if (attr >= FRAG_ATTRIB_TEX0 && attr <= FRAG_ATTRIB_TEX7) {
- /* a texcoord attribute */
- const GLuint u = attr - FRAG_ATTRIB_TEX0;
- ASSERT(u < Elements(ctx->Point.CoordReplace));
- if (ctx->Point.CoordReplace[u]) {
- tCoords[numTcoords++] = attr;
-
- if (ctx->Point.SpriteRMode == GL_ZERO)
- r = 0.0F;
- else if (ctx->Point.SpriteRMode == GL_S)
- r = vert->attrib[attr][0];
- else /* GL_R */
- r = vert->attrib[attr][2];
-
- span.attrStart[attr][0] = s;
- span.attrStart[attr][1] = 0.0; /* overwritten below */
- span.attrStart[attr][2] = r;
- span.attrStart[attr][3] = 1.0;
-
- span.attrStepX[attr][0] = dsdx;
- span.attrStepX[attr][1] = 0.0;
- span.attrStepX[attr][2] = 0.0;
- span.attrStepX[attr][3] = 0.0;
-
- span.attrStepY[attr][0] = 0.0;
- span.attrStepY[attr][1] = dtdy;
- span.attrStepY[attr][2] = 0.0;
- span.attrStepY[attr][3] = 0.0;
-
- continue;
- }
- }
- else if (attr == FRAG_ATTRIB_PNTC) {
- /* GLSL gl_PointCoord.xy (.zw undefined) */
- span.attrStart[FRAG_ATTRIB_PNTC][0] = 0.0;
- span.attrStart[FRAG_ATTRIB_PNTC][1] = 0.0; /* t0 set below */
- span.attrStepX[FRAG_ATTRIB_PNTC][0] = dsdx;
- span.attrStepX[FRAG_ATTRIB_PNTC][1] = 0.0;
- span.attrStepY[FRAG_ATTRIB_PNTC][0] = 0.0;
- span.attrStepY[FRAG_ATTRIB_PNTC][1] = dtdy;
- tCoords[numTcoords++] = FRAG_ATTRIB_PNTC;
- continue;
- }
- /* use vertex's texcoord/attrib */
- COPY_4V(span.attrStart[attr], vert->attrib[attr]);
- ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
- ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
- ATTRIB_LOOP_END;
- }
-
- /* compute pos, bounds and render */
- {
- const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
- const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
- GLint iSize = (GLint) (size + 0.5F);
- GLint xmin, xmax, ymin, ymax, iy;
- GLint iRadius;
- GLfloat tcoord = t0;
-
- iSize = MAX2(1, iSize);
- iRadius = iSize / 2;
-
- if (iSize & 1) {
- /* odd size */
- xmin = (GLint) (x - iRadius);
- xmax = (GLint) (x + iRadius);
- ymin = (GLint) (y - iRadius);
- ymax = (GLint) (y + iRadius);
- }
- else {
- /* even size */
- /* 0.501 factor allows conformance to pass */
- xmin = (GLint) (x + 0.501) - iRadius;
- xmax = xmin + iSize - 1;
- ymin = (GLint) (y + 0.501) - iRadius;
- ymax = ymin + iSize - 1;
- }
-
- /* render spans */
- for (iy = ymin; iy <= ymax; iy++) {
- GLuint i;
- /* setup texcoord T for this row */
- for (i = 0; i < numTcoords; i++) {
- span.attrStart[tCoords[i]][1] = tcoord;
- }
-
- /* these might get changed by span clipping */
- span.x = xmin;
- span.y = iy;
- span.end = xmax - xmin + 1;
-
- _swrast_write_rgba_span(ctx, &span);
-
- tcoord += dtdy;
- }
- }
-}
-
-
-/**
- * Draw smooth/antialiased point. RGB or CI mode.
- */
-static void
-smooth_point(struct gl_context *ctx, const SWvertex *vert)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- SWspan span;
- GLfloat size, alphaAtten;
-
- CULL_INVALID(vert);
-
- /* z coord */
- if (ctx->DrawBuffer->Visual.depthBits <= 16)
- span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
- else
- span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
- span.zStep = 0;
-
- size = get_size(ctx, vert, GL_TRUE);
-
- /* alpha attenuation / fade factor */
- if (ctx->Multisample._Enabled) {
- if (vert->pointSize >= ctx->Point.Threshold) {
- alphaAtten = 1.0F;
- }
- else {
- GLfloat dsize = vert->pointSize / ctx->Point.Threshold;
- alphaAtten = dsize * dsize;
- }
- }
- else {
- alphaAtten = 1.0;
- }
- (void) alphaAtten; /* not used */
-
- /* span init */
- INIT_SPAN(span, GL_POINT);
- span.interpMask = SPAN_Z | SPAN_RGBA;
- span.arrayMask = SPAN_COVERAGE | SPAN_MASK;
-
- span.facing = swrast->PointLineFacing;
-
- span.red = ChanToFixed(vert->color[0]);
- span.green = ChanToFixed(vert->color[1]);
- span.blue = ChanToFixed(vert->color[2]);
- span.alpha = ChanToFixed(vert->color[3]);
- span.redStep = 0;
- span.greenStep = 0;
- span.blueStep = 0;
- span.alphaStep = 0;
-
- /* need these for fragment programs */
- span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
- span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
- span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
-
- ATTRIB_LOOP_BEGIN
- COPY_4V(span.attrStart[attr], vert->attrib[attr]);
- ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
- ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
- ATTRIB_LOOP_END
-
- /* compute pos, bounds and render */
- {
- const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
- const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
- const GLfloat radius = 0.5F * size;
- const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */
- const GLfloat rmax = radius + 0.7071F;
- const GLfloat rmin2 = MAX2(0.0F, rmin * rmin);
- const GLfloat rmax2 = rmax * rmax;
- const GLfloat cscale = 1.0F / (rmax2 - rmin2);
- const GLint xmin = (GLint) (x - radius);
- const GLint xmax = (GLint) (x + radius);
- const GLint ymin = (GLint) (y - radius);
- const GLint ymax = (GLint) (y + radius);
- GLint ix, iy;
-
- for (iy = ymin; iy <= ymax; iy++) {
-
- /* these might get changed by span clipping */
- span.x = xmin;
- span.y = iy;
- span.end = xmax - xmin + 1;
-
- /* compute coverage for each pixel in span */
- for (ix = xmin; ix <= xmax; ix++) {
- const GLfloat dx = ix - x + 0.5F;
- const GLfloat dy = iy - y + 0.5F;
- const GLfloat dist2 = dx * dx + dy * dy;
- GLfloat coverage;
-
- if (dist2 < rmax2) {
- if (dist2 >= rmin2) {
- /* compute partial coverage */
- coverage = 1.0F - (dist2 - rmin2) * cscale;
- }
- else {
- /* full coverage */
- coverage = 1.0F;
- }
- span.array->mask[ix - xmin] = 1;
- }
- else {
- /* zero coverage - fragment outside the radius */
- coverage = 0.0;
- span.array->mask[ix - xmin] = 0;
- }
- span.array->coverage[ix - xmin] = coverage;
- }
-
- /* render span */
- _swrast_write_rgba_span(ctx, &span);
-
- }
- }
-}
-
-
-/**
- * Draw large (size >= 1) non-AA point. RGB or CI mode.
- */
-static void
-large_point(struct gl_context *ctx, const SWvertex *vert)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- SWspan span;
- GLfloat size;
-
- CULL_INVALID(vert);
-
- /* z coord */
- if (ctx->DrawBuffer->Visual.depthBits <= 16)
- span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
- else
- span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
- span.zStep = 0;
-
- size = get_size(ctx, vert, GL_FALSE);
-
- /* span init */
- INIT_SPAN(span, GL_POINT);
- span.arrayMask = SPAN_XY;
- span.facing = swrast->PointLineFacing;
-
- span.interpMask = SPAN_Z | SPAN_RGBA;
- span.red = ChanToFixed(vert->color[0]);
- span.green = ChanToFixed(vert->color[1]);
- span.blue = ChanToFixed(vert->color[2]);
- span.alpha = ChanToFixed(vert->color[3]);
- span.redStep = 0;
- span.greenStep = 0;
- span.blueStep = 0;
- span.alphaStep = 0;
-
- /* need these for fragment programs */
- span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
- span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
- span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
-
- ATTRIB_LOOP_BEGIN
- COPY_4V(span.attrStart[attr], vert->attrib[attr]);
- ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
- ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
- ATTRIB_LOOP_END
-
- /* compute pos, bounds and render */
- {
- const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
- const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
- GLint iSize = (GLint) (size + 0.5F);
- GLint xmin, xmax, ymin, ymax, ix, iy;
- GLint iRadius;
-
- iSize = MAX2(1, iSize);
- iRadius = iSize / 2;
-
- if (iSize & 1) {
- /* odd size */
- xmin = (GLint) (x - iRadius);
- xmax = (GLint) (x + iRadius);
- ymin = (GLint) (y - iRadius);
- ymax = (GLint) (y + iRadius);
- }
- else {
- /* even size */
- /* 0.501 factor allows conformance to pass */
- xmin = (GLint) (x + 0.501) - iRadius;
- xmax = xmin + iSize - 1;
- ymin = (GLint) (y + 0.501) - iRadius;
- ymax = ymin + iSize - 1;
- }
-
- /* generate fragments */
- span.end = 0;
- for (iy = ymin; iy <= ymax; iy++) {
- for (ix = xmin; ix <= xmax; ix++) {
- span.array->x[span.end] = ix;
- span.array->y[span.end] = iy;
- span.end++;
- }
- }
- assert(span.end <= MAX_WIDTH);
- _swrast_write_rgba_span(ctx, &span);
- }
-}
-
-
-/**
- * Draw size=1, single-pixel point
- */
-static void
-pixel_point(struct gl_context *ctx, const SWvertex *vert)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- /*
- * Note that unlike the other functions, we put single-pixel points
- * into a special span array in order to render as many points as
- * possible with a single _swrast_write_rgba_span() call.
- */
- SWspan *span = &(swrast->PointSpan);
- GLuint count;
-
- CULL_INVALID(vert);
-
- /* Span init */
- span->interpMask = 0;
- span->arrayMask = SPAN_XY | SPAN_Z;
- span->arrayMask |= SPAN_RGBA;
- /*span->arrayMask |= SPAN_LAMBDA;*/
- span->arrayAttribs = swrast->_ActiveAttribMask; /* we'll produce these vals */
-
- /* need these for fragment programs */
- span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
- span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
- span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
-
- /* check if we need to flush */
- if (span->end >= MAX_WIDTH ||
- (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT)) ||
- span->facing != swrast->PointLineFacing) {
- if (span->end > 0) {
- _swrast_write_rgba_span(ctx, span);
- span->end = 0;
- }
- }
-
- count = span->end;
-
- span->facing = swrast->PointLineFacing;
-
- /* fragment attributes */
- span->array->rgba[count][RCOMP] = vert->color[0];
- span->array->rgba[count][GCOMP] = vert->color[1];
- span->array->rgba[count][BCOMP] = vert->color[2];
- span->array->rgba[count][ACOMP] = vert->color[3];
-
- ATTRIB_LOOP_BEGIN
- COPY_4V(span->array->attribs[attr][count], vert->attrib[attr]);
- ATTRIB_LOOP_END
-
- /* fragment position */
- span->array->x[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0];
- span->array->y[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1];
- span->array->z[count] = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
-
- span->end = count + 1;
- ASSERT(span->end <= MAX_WIDTH);
-}
-
-
-/**
- * Add specular color to primary color, draw point, restore original
- * primary color.
- */
-void
-_swrast_add_spec_terms_point(struct gl_context *ctx, const SWvertex *v0)
-{
- SWvertex *ncv0 = (SWvertex *) v0; /* cast away const */
- GLfloat rSum, gSum, bSum;
- GLchan cSave[4];
-
- /* save */
- COPY_CHAN4(cSave, ncv0->color);
- /* sum */
- rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0];
- gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1];
- bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2];
- UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
- UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
- UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);
- /* draw */
- SWRAST_CONTEXT(ctx)->SpecPoint(ctx, ncv0);
- /* restore */
- COPY_CHAN4(ncv0->color, cSave);
-}
-
-
-/**
- * Examine current state to determine which point drawing function to use.
- */
-void
-_swrast_choose_point(struct gl_context *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLfloat size = CLAMP(ctx->Point.Size,
- ctx->Point.MinSize,
- ctx->Point.MaxSize);
-
- if (ctx->RenderMode == GL_RENDER) {
- if (ctx->Point.PointSprite) {
- swrast->Point = sprite_point;
- }
- else if (ctx->Point.SmoothFlag) {
- swrast->Point = smooth_point;
- }
- else if (size > 1.0 ||
- ctx->Point._Attenuated ||
- ctx->VertexProgram.PointSizeEnabled) {
- swrast->Point = large_point;
- }
- else {
- swrast->Point = pixel_point;
- }
- }
- else if (ctx->RenderMode == GL_FEEDBACK) {
- swrast->Point = _swrast_feedback_point;
- }
- else {
- /* GL_SELECT mode */
- swrast->Point = _swrast_select_point;
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2007 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/macros.h"
+#include "s_context.h"
+#include "s_feedback.h"
+#include "s_points.h"
+#include "s_span.h"
+
+
+/**
+ * Used to cull points with invalid coords
+ */
+#define CULL_INVALID(V) \
+ do { \
+ float tmp = (V)->attrib[FRAG_ATTRIB_WPOS][0] \
+ + (V)->attrib[FRAG_ATTRIB_WPOS][1]; \
+ if (IS_INF_OR_NAN(tmp)) \
+ return; \
+ } while(0)
+
+
+
+/**
+ * Get/compute the point size.
+ * The size may come from a vertex shader, or computed with attentuation
+ * or just the glPointSize value.
+ * Must also clamp to user-defined range and implmentation limits.
+ */
+static inline GLfloat
+get_size(const struct gl_context *ctx, const SWvertex *vert, GLboolean smoothed)
+{
+ GLfloat size;
+
+ if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
+ /* use vertex's point size */
+ size = vert->pointSize;
+ }
+ else {
+ /* use constant point size */
+ size = ctx->Point.Size;
+ }
+ /* always clamp to user-specified limits */
+ size = CLAMP(size, ctx->Point.MinSize, ctx->Point.MaxSize);
+ /* clamp to implementation limits */
+ if (smoothed)
+ size = CLAMP(size, ctx->Const.MinPointSizeAA, ctx->Const.MaxPointSizeAA);
+ else
+ size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
+
+ return size;
+}
+
+
+/**
+ * Draw a point sprite
+ */
+static void
+sprite_point(struct gl_context *ctx, const SWvertex *vert)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ SWspan span;
+ GLfloat size;
+ GLuint tCoords[MAX_TEXTURE_COORD_UNITS + 1];
+ GLuint numTcoords = 0;
+ GLfloat t0, dtdy;
+
+ CULL_INVALID(vert);
+
+ /* z coord */
+ if (ctx->DrawBuffer->Visual.depthBits <= 16)
+ span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ else
+ span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ span.zStep = 0;
+
+ size = get_size(ctx, vert, GL_FALSE);
+
+ /* span init */
+ INIT_SPAN(span, GL_POINT);
+ span.interpMask = SPAN_Z | SPAN_RGBA;
+
+ span.facing = swrast->PointLineFacing;
+
+ span.red = ChanToFixed(vert->color[0]);
+ span.green = ChanToFixed(vert->color[1]);
+ span.blue = ChanToFixed(vert->color[2]);
+ span.alpha = ChanToFixed(vert->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+
+ /* need these for fragment programs */
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
+ span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
+
+ {
+ GLfloat s, r, dsdx;
+
+ /* texcoord / pointcoord interpolants */
+ s = 0.0F;
+ dsdx = 1.0F / size;
+ if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) {
+ dtdy = 1.0F / size;
+ t0 = 0.5F * dtdy;
+ }
+ else {
+ /* GL_UPPER_LEFT */
+ dtdy = -1.0F / size;
+ t0 = 1.0F + 0.5F * dtdy;
+ }
+
+ ATTRIB_LOOP_BEGIN
+ if (attr >= FRAG_ATTRIB_TEX0 && attr <= FRAG_ATTRIB_TEX7) {
+ /* a texcoord attribute */
+ const GLuint u = attr - FRAG_ATTRIB_TEX0;
+ ASSERT(u < Elements(ctx->Point.CoordReplace));
+ if (ctx->Point.CoordReplace[u]) {
+ tCoords[numTcoords++] = attr;
+
+ if (ctx->Point.SpriteRMode == GL_ZERO)
+ r = 0.0F;
+ else if (ctx->Point.SpriteRMode == GL_S)
+ r = vert->attrib[attr][0];
+ else /* GL_R */
+ r = vert->attrib[attr][2];
+
+ span.attrStart[attr][0] = s;
+ span.attrStart[attr][1] = 0.0; /* overwritten below */
+ span.attrStart[attr][2] = r;
+ span.attrStart[attr][3] = 1.0;
+
+ span.attrStepX[attr][0] = dsdx;
+ span.attrStepX[attr][1] = 0.0;
+ span.attrStepX[attr][2] = 0.0;
+ span.attrStepX[attr][3] = 0.0;
+
+ span.attrStepY[attr][0] = 0.0;
+ span.attrStepY[attr][1] = dtdy;
+ span.attrStepY[attr][2] = 0.0;
+ span.attrStepY[attr][3] = 0.0;
+
+ continue;
+ }
+ }
+ else if (attr == FRAG_ATTRIB_PNTC) {
+ /* GLSL gl_PointCoord.xy (.zw undefined) */
+ span.attrStart[FRAG_ATTRIB_PNTC][0] = 0.0;
+ span.attrStart[FRAG_ATTRIB_PNTC][1] = 0.0; /* t0 set below */
+ span.attrStepX[FRAG_ATTRIB_PNTC][0] = dsdx;
+ span.attrStepX[FRAG_ATTRIB_PNTC][1] = 0.0;
+ span.attrStepY[FRAG_ATTRIB_PNTC][0] = 0.0;
+ span.attrStepY[FRAG_ATTRIB_PNTC][1] = dtdy;
+ tCoords[numTcoords++] = FRAG_ATTRIB_PNTC;
+ continue;
+ }
+ /* use vertex's texcoord/attrib */
+ COPY_4V(span.attrStart[attr], vert->attrib[attr]);
+ ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
+ ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
+ ATTRIB_LOOP_END;
+ }
+
+ /* compute pos, bounds and render */
+ {
+ const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
+ const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
+ GLint iSize = (GLint) (size + 0.5F);
+ GLint xmin, xmax, ymin, ymax, iy;
+ GLint iRadius;
+ GLfloat tcoord = t0;
+
+ iSize = MAX2(1, iSize);
+ iRadius = iSize / 2;
+
+ if (iSize & 1) {
+ /* odd size */
+ xmin = (GLint) (x - iRadius);
+ xmax = (GLint) (x + iRadius);
+ ymin = (GLint) (y - iRadius);
+ ymax = (GLint) (y + iRadius);
+ }
+ else {
+ /* even size */
+ /* 0.501 factor allows conformance to pass */
+ xmin = (GLint) (x + 0.501) - iRadius;
+ xmax = xmin + iSize - 1;
+ ymin = (GLint) (y + 0.501) - iRadius;
+ ymax = ymin + iSize - 1;
+ }
+
+ /* render spans */
+ for (iy = ymin; iy <= ymax; iy++) {
+ GLuint i;
+ /* setup texcoord T for this row */
+ for (i = 0; i < numTcoords; i++) {
+ span.attrStart[tCoords[i]][1] = tcoord;
+ }
+
+ /* these might get changed by span clipping */
+ span.x = xmin;
+ span.y = iy;
+ span.end = xmax - xmin + 1;
+
+ _swrast_write_rgba_span(ctx, &span);
+
+ tcoord += dtdy;
+ }
+ }
+}
+
+
+/**
+ * Draw smooth/antialiased point. RGB or CI mode.
+ */
+static void
+smooth_point(struct gl_context *ctx, const SWvertex *vert)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ SWspan span;
+ GLfloat size, alphaAtten;
+
+ CULL_INVALID(vert);
+
+ /* z coord */
+ if (ctx->DrawBuffer->Visual.depthBits <= 16)
+ span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ else
+ span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ span.zStep = 0;
+
+ size = get_size(ctx, vert, GL_TRUE);
+
+ /* alpha attenuation / fade factor */
+ if (ctx->Multisample._Enabled) {
+ if (vert->pointSize >= ctx->Point.Threshold) {
+ alphaAtten = 1.0F;
+ }
+ else {
+ GLfloat dsize = vert->pointSize / ctx->Point.Threshold;
+ alphaAtten = dsize * dsize;
+ }
+ }
+ else {
+ alphaAtten = 1.0;
+ }
+ (void) alphaAtten; /* not used */
+
+ /* span init */
+ INIT_SPAN(span, GL_POINT);
+ span.interpMask = SPAN_Z | SPAN_RGBA;
+ span.arrayMask = SPAN_COVERAGE | SPAN_MASK;
+
+ span.facing = swrast->PointLineFacing;
+
+ span.red = ChanToFixed(vert->color[0]);
+ span.green = ChanToFixed(vert->color[1]);
+ span.blue = ChanToFixed(vert->color[2]);
+ span.alpha = ChanToFixed(vert->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+
+ /* need these for fragment programs */
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
+ span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
+
+ ATTRIB_LOOP_BEGIN
+ COPY_4V(span.attrStart[attr], vert->attrib[attr]);
+ ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
+ ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
+ ATTRIB_LOOP_END
+
+ /* compute pos, bounds and render */
+ {
+ const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
+ const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
+ const GLfloat radius = 0.5F * size;
+ const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */
+ const GLfloat rmax = radius + 0.7071F;
+ const GLfloat rmin2 = MAX2(0.0F, rmin * rmin);
+ const GLfloat rmax2 = rmax * rmax;
+ const GLfloat cscale = 1.0F / (rmax2 - rmin2);
+ const GLint xmin = (GLint) (x - radius);
+ const GLint xmax = (GLint) (x + radius);
+ const GLint ymin = (GLint) (y - radius);
+ const GLint ymax = (GLint) (y + radius);
+ GLint ix, iy;
+
+ for (iy = ymin; iy <= ymax; iy++) {
+
+ /* these might get changed by span clipping */
+ span.x = xmin;
+ span.y = iy;
+ span.end = xmax - xmin + 1;
+
+ /* compute coverage for each pixel in span */
+ for (ix = xmin; ix <= xmax; ix++) {
+ const GLfloat dx = ix - x + 0.5F;
+ const GLfloat dy = iy - y + 0.5F;
+ const GLfloat dist2 = dx * dx + dy * dy;
+ GLfloat coverage;
+
+ if (dist2 < rmax2) {
+ if (dist2 >= rmin2) {
+ /* compute partial coverage */
+ coverage = 1.0F - (dist2 - rmin2) * cscale;
+ }
+ else {
+ /* full coverage */
+ coverage = 1.0F;
+ }
+ span.array->mask[ix - xmin] = 1;
+ }
+ else {
+ /* zero coverage - fragment outside the radius */
+ coverage = 0.0;
+ span.array->mask[ix - xmin] = 0;
+ }
+ span.array->coverage[ix - xmin] = coverage;
+ }
+
+ /* render span */
+ _swrast_write_rgba_span(ctx, &span);
+
+ }
+ }
+}
+
+
+/**
+ * Draw large (size >= 1) non-AA point. RGB or CI mode.
+ */
+static void
+large_point(struct gl_context *ctx, const SWvertex *vert)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ SWspan span;
+ GLfloat size;
+
+ CULL_INVALID(vert);
+
+ /* z coord */
+ if (ctx->DrawBuffer->Visual.depthBits <= 16)
+ span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ else
+ span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ span.zStep = 0;
+
+ size = get_size(ctx, vert, GL_FALSE);
+
+ /* span init */
+ INIT_SPAN(span, GL_POINT);
+ span.arrayMask = SPAN_XY;
+ span.facing = swrast->PointLineFacing;
+
+ span.interpMask = SPAN_Z | SPAN_RGBA;
+ span.red = ChanToFixed(vert->color[0]);
+ span.green = ChanToFixed(vert->color[1]);
+ span.blue = ChanToFixed(vert->color[2]);
+ span.alpha = ChanToFixed(vert->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+
+ /* need these for fragment programs */
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
+ span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
+
+ ATTRIB_LOOP_BEGIN
+ COPY_4V(span.attrStart[attr], vert->attrib[attr]);
+ ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
+ ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
+ ATTRIB_LOOP_END
+
+ /* compute pos, bounds and render */
+ {
+ const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
+ const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
+ GLint iSize = (GLint) (size + 0.5F);
+ GLint xmin, xmax, ymin, ymax, ix, iy;
+ GLint iRadius;
+
+ iSize = MAX2(1, iSize);
+ iRadius = iSize / 2;
+
+ if (iSize & 1) {
+ /* odd size */
+ xmin = (GLint) (x - iRadius);
+ xmax = (GLint) (x + iRadius);
+ ymin = (GLint) (y - iRadius);
+ ymax = (GLint) (y + iRadius);
+ }
+ else {
+ /* even size */
+ /* 0.501 factor allows conformance to pass */
+ xmin = (GLint) (x + 0.501) - iRadius;
+ xmax = xmin + iSize - 1;
+ ymin = (GLint) (y + 0.501) - iRadius;
+ ymax = ymin + iSize - 1;
+ }
+
+ /* generate fragments */
+ span.end = 0;
+ for (iy = ymin; iy <= ymax; iy++) {
+ for (ix = xmin; ix <= xmax; ix++) {
+ span.array->x[span.end] = ix;
+ span.array->y[span.end] = iy;
+ span.end++;
+ }
+ }
+ assert(span.end <= MAX_WIDTH);
+ _swrast_write_rgba_span(ctx, &span);
+ }
+}
+
+
+/**
+ * Draw size=1, single-pixel point
+ */
+static void
+pixel_point(struct gl_context *ctx, const SWvertex *vert)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ /*
+ * Note that unlike the other functions, we put single-pixel points
+ * into a special span array in order to render as many points as
+ * possible with a single _swrast_write_rgba_span() call.
+ */
+ SWspan *span = &(swrast->PointSpan);
+ GLuint count;
+
+ CULL_INVALID(vert);
+
+ /* Span init */
+ span->interpMask = 0;
+ span->arrayMask = SPAN_XY | SPAN_Z;
+ span->arrayMask |= SPAN_RGBA;
+ /*span->arrayMask |= SPAN_LAMBDA;*/
+ span->arrayAttribs = swrast->_ActiveAttribMask; /* we'll produce these vals */
+
+ /* need these for fragment programs */
+ span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
+ span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
+ span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
+
+ /* check if we need to flush */
+ if (span->end >= MAX_WIDTH ||
+ (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT)) ||
+ span->facing != swrast->PointLineFacing) {
+ if (span->end > 0) {
+ _swrast_write_rgba_span(ctx, span);
+ span->end = 0;
+ }
+ }
+
+ count = span->end;
+
+ span->facing = swrast->PointLineFacing;
+
+ /* fragment attributes */
+ span->array->rgba[count][RCOMP] = vert->color[0];
+ span->array->rgba[count][GCOMP] = vert->color[1];
+ span->array->rgba[count][BCOMP] = vert->color[2];
+ span->array->rgba[count][ACOMP] = vert->color[3];
+
+ ATTRIB_LOOP_BEGIN
+ COPY_4V(span->array->attribs[attr][count], vert->attrib[attr]);
+ ATTRIB_LOOP_END
+
+ /* fragment position */
+ span->array->x[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0];
+ span->array->y[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1];
+ span->array->z[count] = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+
+ span->end = count + 1;
+ ASSERT(span->end <= MAX_WIDTH);
+}
+
+
+/**
+ * Add specular color to primary color, draw point, restore original
+ * primary color.
+ */
+void
+_swrast_add_spec_terms_point(struct gl_context *ctx, const SWvertex *v0)
+{
+ SWvertex *ncv0 = (SWvertex *) v0; /* cast away const */
+ GLfloat rSum, gSum, bSum;
+ GLchan cSave[4];
+
+ /* save */
+ COPY_CHAN4(cSave, ncv0->color);
+ /* sum */
+ rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0];
+ gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1];
+ bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2];
+ UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
+ UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
+ UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);
+ /* draw */
+ SWRAST_CONTEXT(ctx)->SpecPoint(ctx, ncv0);
+ /* restore */
+ COPY_CHAN4(ncv0->color, cSave);
+}
+
+
+/**
+ * Examine current state to determine which point drawing function to use.
+ */
+void
+_swrast_choose_point(struct gl_context *ctx)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLfloat size = CLAMP(ctx->Point.Size,
+ ctx->Point.MinSize,
+ ctx->Point.MaxSize);
+
+ if (ctx->RenderMode == GL_RENDER) {
+ if (ctx->Point.PointSprite) {
+ swrast->Point = sprite_point;
+ }
+ else if (ctx->Point.SmoothFlag) {
+ swrast->Point = smooth_point;
+ }
+ else if (size > 1.0 ||
+ ctx->Point._Attenuated ||
+ ctx->VertexProgram.PointSizeEnabled) {
+ swrast->Point = large_point;
+ }
+ else {
+ swrast->Point = pixel_point;
+ }
+ }
+ else if (ctx->RenderMode == GL_FEEDBACK) {
+ swrast->Point = _swrast_feedback_point;
+ }
+ else {
+ /* GL_SELECT mode */
+ swrast->Point = _swrast_select_point;
+ }
+}
diff --git a/mesalib/src/mesa/swrast/s_span.c b/mesalib/src/mesa/swrast/s_span.c
index 4631ff3d5..1aa20f9d7 100644
--- a/mesalib/src/mesa/swrast/s_span.c
+++ b/mesalib/src/mesa/swrast/s_span.c
@@ -162,7 +162,7 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan *span)
* Perspective correction will be done. The point/line/triangle function
* should have computed attrStart/Step values for FRAG_ATTRIB_WPOS[3]!
*/
-static INLINE void
+static inline void
interpolate_active_attribs(struct gl_context *ctx, SWspan *span, GLbitfield attrMask)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -209,7 +209,7 @@ interpolate_active_attribs(struct gl_context *ctx, SWspan *span, GLbitfield attr
* Interpolate primary colors to fill in the span->array->rgba8 (or rgb16)
* color array.
*/
-static INLINE void
+static inline void
interpolate_int_colors(struct gl_context *ctx, SWspan *span)
{
#if CHAN_BITS != 32
@@ -309,7 +309,7 @@ interpolate_int_colors(struct gl_context *ctx, SWspan *span)
/**
* Populate the FRAG_ATTRIB_COL0 array.
*/
-static INLINE void
+static inline void
interpolate_float_colors(SWspan *span)
{
GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
@@ -611,7 +611,7 @@ interpolate_texcoords(struct gl_context *ctx, SWspan *span)
/**
* Fill in the arrays->attribs[FRAG_ATTRIB_WPOS] array.
*/
-static INLINE void
+static inline void
interpolate_wpos(struct gl_context *ctx, SWspan *span)
{
GLfloat (*wpos)[4] = span->array->attribs[FRAG_ATTRIB_WPOS];
@@ -645,7 +645,7 @@ interpolate_wpos(struct gl_context *ctx, SWspan *span)
/**
* Apply the current polygon stipple pattern to a span of pixels.
*/
-static INLINE void
+static inline void
stipple_polygon_span(struct gl_context *ctx, SWspan *span)
{
GLubyte *mask = span->array->mask;
@@ -690,7 +690,7 @@ stipple_polygon_span(struct gl_context *ctx, SWspan *span)
* Return: GL_TRUE some pixels still visible
* GL_FALSE nothing visible
*/
-static INLINE GLuint
+static inline GLuint
clip_span( struct gl_context *ctx, SWspan *span )
{
const GLint xmin = ctx->DrawBuffer->_Xmin;
@@ -817,7 +817,7 @@ clip_span( struct gl_context *ctx, SWspan *span )
* Only called during fixed-function operation.
* Result is float color array (FRAG_ATTRIB_COL0).
*/
-static INLINE void
+static inline void
add_specular(struct gl_context *ctx, SWspan *span)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -866,7 +866,7 @@ add_specular(struct gl_context *ctx, SWspan *span)
/**
* Apply antialiasing coverage value to alpha values.
*/
-static INLINE void
+static inline void
apply_aa_coverage(SWspan *span)
{
const GLfloat *coverage = span->array->coverage;
@@ -900,7 +900,7 @@ apply_aa_coverage(SWspan *span)
/**
* Clamp span's float colors to [0,1]
*/
-static INLINE void
+static inline void
clamp_colors(SWspan *span)
{
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0];
@@ -921,7 +921,7 @@ clamp_colors(SWspan *span)
* program that writes to gl_FragData[1] or higher.
* \param output which fragment program color output is being processed
*/
-static INLINE void
+static inline void
convert_color_type(SWspan *span, GLenum newType, GLuint output)
{
GLvoid *src, *dst;
@@ -961,7 +961,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output)
/**
* Apply fragment shader, fragment program or normal texturing to span.
*/
-static INLINE void
+static inline void
shade_texture_span(struct gl_context *ctx, SWspan *span)
{
if (ctx->FragmentProgram._Current ||
diff --git a/mesalib/src/mesa/swrast/s_stencil.c b/mesalib/src/mesa/swrast/s_stencil.c
index fa5093a34..e713e2393 100644
--- a/mesalib/src/mesa/swrast/s_stencil.c
+++ b/mesalib/src/mesa/swrast/s_stencil.c
@@ -391,7 +391,7 @@ do_stencil_test( struct gl_context *ctx, GLuint face, GLuint n, GLstencil stenci
* Compute the zpass/zfail masks by comparing the pre- and post-depth test
* masks.
*/
-static INLINE void
+static inline void
compute_pass_fail_masks(GLuint n, const GLubyte origMask[],
const GLubyte newMask[],
GLubyte passMask[], GLubyte failMask[])
diff --git a/mesalib/src/mesa/swrast/s_texcombine.c b/mesalib/src/mesa/swrast/s_texcombine.c
index 80b9dff3c..c67c356c1 100644
--- a/mesalib/src/mesa/swrast/s_texcombine.c
+++ b/mesalib/src/mesa/swrast/s_texcombine.c
@@ -45,7 +45,7 @@ typedef float (*float4_array)[4];
/**
* Return array of texels for given unit.
*/
-static INLINE float4_array
+static inline float4_array
get_texel_array(SWcontext *swrast, GLuint unit)
{
#ifdef _OPENMP
@@ -590,6 +590,26 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
float4_array primary_rgba;
GLuint unit;
+ if (!swrast->TexelBuffer) {
+#ifdef _OPENMP
+ const GLint maxThreads = omp_get_max_threads();
+#else
+ const GLint maxThreads = 1;
+#endif
+
+ /* TexelBuffer is also global and normally shared by all SWspan
+ * instances; when running with multiple threads, create one per
+ * thread.
+ */
+ swrast->TexelBuffer =
+ (GLfloat *) MALLOC(ctx->Const.MaxTextureImageUnits * maxThreads *
+ MAX_WIDTH * 4 * sizeof(GLfloat));
+ if (!swrast->TexelBuffer) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine");
+ return;
+ }
+ }
+
primary_rgba = (float4_array) malloc(span->end * 4 * sizeof(GLfloat));
if (!primary_rgba) {
diff --git a/mesalib/src/mesa/swrast/s_texfetch.c b/mesalib/src/mesa/swrast/s_texfetch.c
index ed17b4bda..73b5af319 100644
--- a/mesalib/src/mesa/swrast/s_texfetch.c
+++ b/mesalib/src/mesa/swrast/s_texfetch.c
@@ -51,7 +51,7 @@
* linear RGB value in [0, 1].
* Implemented with a 256-entry lookup table.
*/
-static INLINE GLfloat
+static inline GLfloat
nonlinear_to_linear(GLubyte cs8)
{
static GLfloat table[256];
diff --git a/mesalib/src/mesa/swrast/s_texfilter.c b/mesalib/src/mesa/swrast/s_texfilter.c
index dd3761986..ca9133b21 100644
--- a/mesalib/src/mesa/swrast/s_texfilter.c
+++ b/mesalib/src/mesa/swrast/s_texfilter.c
@@ -57,7 +57,7 @@
* optimization! If we find that's not true on some systems, convert
* to a macro.
*/
-static INLINE GLfloat
+static inline GLfloat
lerp_2d(GLfloat a, GLfloat b,
GLfloat v00, GLfloat v10, GLfloat v01, GLfloat v11)
{
@@ -71,7 +71,7 @@ lerp_2d(GLfloat a, GLfloat b,
* Do 3D/trilinear interpolation of float values.
* \sa lerp_2d
*/
-static INLINE GLfloat
+static inline GLfloat
lerp_3d(GLfloat a, GLfloat b, GLfloat c,
GLfloat v000, GLfloat v100, GLfloat v010, GLfloat v110,
GLfloat v001, GLfloat v101, GLfloat v011, GLfloat v111)
@@ -89,7 +89,7 @@ lerp_3d(GLfloat a, GLfloat b, GLfloat c,
/**
* Do linear interpolation of colors.
*/
-static INLINE void
+static inline void
lerp_rgba(GLfloat result[4], GLfloat t, const GLfloat a[4], const GLfloat b[4])
{
result[0] = LERP(t, a[0], b[0]);
@@ -102,7 +102,7 @@ lerp_rgba(GLfloat result[4], GLfloat t, const GLfloat a[4], const GLfloat b[4])
/**
* Do bilinear interpolation of colors.
*/
-static INLINE void
+static inline void
lerp_rgba_2d(GLfloat result[4], GLfloat a, GLfloat b,
const GLfloat t00[4], const GLfloat t10[4],
const GLfloat t01[4], const GLfloat t11[4])
@@ -117,7 +117,7 @@ lerp_rgba_2d(GLfloat result[4], GLfloat a, GLfloat b,
/**
* Do trilinear interpolation of colors.
*/
-static INLINE void
+static inline void
lerp_rgba_3d(GLfloat result[4], GLfloat a, GLfloat b, GLfloat c,
const GLfloat t000[4], const GLfloat t100[4],
const GLfloat t010[4], const GLfloat t110[4],
@@ -153,7 +153,7 @@ lerp_rgba_3d(GLfloat result[4], GLfloat a, GLfloat b, GLfloat c,
* i0, i1 = returns two nearest texel indexes
* weight = returns blend factor between texels
*/
-static INLINE void
+static inline void
linear_texel_locations(GLenum wrapMode,
const struct gl_texture_image *img,
GLint size, GLfloat s,
@@ -281,7 +281,7 @@ linear_texel_locations(GLenum wrapMode,
/**
* Used to compute texel location for nearest sampling.
*/
-static INLINE GLint
+static inline GLint
nearest_texel_location(GLenum wrapMode,
const struct gl_texture_image *img,
GLint size, GLfloat s)
@@ -406,7 +406,7 @@ nearest_texel_location(GLenum wrapMode,
/* Power of two image sizes only */
-static INLINE void
+static inline void
linear_repeat_texel_location(GLuint size, GLfloat s,
GLint *i0, GLint *i1, GLfloat *weight)
{
@@ -420,7 +420,7 @@ linear_repeat_texel_location(GLuint size, GLfloat s,
/**
* Do clamp/wrap for a texture rectangle coord, GL_NEAREST filter mode.
*/
-static INLINE GLint
+static inline GLint
clamp_rect_coord_nearest(GLenum wrapMode, GLfloat coord, GLint max)
{
switch (wrapMode) {
@@ -440,7 +440,7 @@ clamp_rect_coord_nearest(GLenum wrapMode, GLfloat coord, GLint max)
/**
* As above, but GL_LINEAR filtering.
*/
-static INLINE void
+static inline void
clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max,
GLint *i0out, GLint *i1out, GLfloat *weight)
{
@@ -481,7 +481,7 @@ clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max,
/**
* Compute slice/image to use for 1D or 2D array texture.
*/
-static INLINE GLint
+static inline GLint
tex_array_slice(GLfloat coord, GLsizei size)
{
GLint slice = IFLOOR(coord + 0.5f);
@@ -494,7 +494,7 @@ tex_array_slice(GLfloat coord, GLsizei size)
* Compute nearest integer texcoords for given texobj and coordinate.
* NOTE: only used for depth texture sampling.
*/
-static INLINE void
+static inline void
nearest_texcoord(const struct gl_texture_object *texObj,
GLuint level,
const GLfloat texcoord[4],
@@ -541,7 +541,7 @@ nearest_texcoord(const struct gl_texture_object *texObj,
* Compute linear integer texcoords for given texobj and coordinate.
* NOTE: only used for depth texture sampling.
*/
-static INLINE void
+static inline void
linear_texcoord(const struct gl_texture_object *texObj,
GLuint level,
const GLfloat texcoord[4],
@@ -598,7 +598,7 @@ linear_texcoord(const struct gl_texture_object *texObj,
* For linear interpolation between mipmap levels N and N+1, this function
* computes N.
*/
-static INLINE GLint
+static inline GLint
linear_mipmap_level(const struct gl_texture_object *tObj, GLfloat lambda)
{
if (lambda < 0.0F)
@@ -613,7 +613,7 @@ linear_mipmap_level(const struct gl_texture_object *tObj, GLfloat lambda)
/**
* Compute the nearest mipmap level to take texels from.
*/
-static INLINE GLint
+static inline GLint
nearest_mipmap_level(const struct gl_texture_object *tObj, GLfloat lambda)
{
GLfloat l;
@@ -649,7 +649,7 @@ nearest_mipmap_level(const struct gl_texture_object *tObj, GLfloat lambda)
* will be minified, magnified, or split between the two. This function
* determines the subranges in [0, n-1] that are to be minified or magnified.
*/
-static INLINE void
+static inline void
compute_min_mag_ranges(const struct gl_texture_object *tObj,
GLuint n, const GLfloat lambda[],
GLuint *minStart, GLuint *minEnd,
@@ -758,7 +758,7 @@ compute_min_mag_ranges(const struct gl_texture_object *tObj,
* the base texture format. Ex: if the texture base format it GL_ALPHA,
* we return (0,0,0,BorderAlpha).
*/
-static INLINE void
+static inline void
get_border_color(const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
GLfloat rgba[4])
@@ -798,7 +798,7 @@ get_border_color(const struct gl_texture_object *tObj,
/**
* Return the texture sample for coordinate (s) using GL_NEAREST filter.
*/
-static INLINE void
+static inline void
sample_1d_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
@@ -823,7 +823,7 @@ sample_1d_nearest(struct gl_context *ctx,
/**
* Return the texture sample for coordinate (s) using GL_LINEAR filter.
*/
-static INLINE void
+static inline void
sample_1d_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
@@ -1057,7 +1057,7 @@ sample_lambda_1d( struct gl_context *ctx,
/**
* Return the texture sample for coordinate (s,t) using GL_NEAREST filter.
*/
-static INLINE void
+static inline void
sample_2d_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
@@ -1091,7 +1091,7 @@ sample_2d_nearest(struct gl_context *ctx,
* Return the texture sample for coordinate (s,t) using GL_LINEAR filter.
* New sampling code contributed by Lynn Quam <quam@ai.sri.com>.
*/
-static INLINE void
+static inline void
sample_2d_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
@@ -1156,7 +1156,7 @@ sample_2d_linear(struct gl_context *ctx,
* As above, but we know WRAP_S == REPEAT and WRAP_T == REPEAT.
* We don't have to worry about the texture border.
*/
-static INLINE void
+static inline void
sample_2d_linear_repeat(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
@@ -1760,7 +1760,7 @@ sample_2d_footprint(struct gl_context *ctx,
* Returns the index of the specified texture object in the
* gl_context texture unit array.
*/
-static INLINE GLuint
+static inline GLuint
texture_unit_index(const struct gl_context *ctx,
const struct gl_texture_object *tObj)
{
@@ -1941,7 +1941,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx,
/**
* Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter.
*/
-static INLINE void
+static inline void
sample_3d_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
@@ -3282,7 +3282,7 @@ sample_lambda_1d_array(struct gl_context *ctx,
/**
* Compare texcoord against depth sample. Return 1.0 or the ambient value.
*/
-static INLINE GLfloat
+static inline GLfloat
shadow_compare(GLenum function, GLfloat coord, GLfloat depthSample,
GLfloat ambient)
{
@@ -3315,7 +3315,7 @@ shadow_compare(GLenum function, GLfloat coord, GLfloat depthSample,
/**
* Compare texcoord against four depth samples.
*/
-static INLINE GLfloat
+static inline GLfloat
shadow_compare4(GLenum function, GLfloat coord,
GLfloat depth00, GLfloat depth01,
GLfloat depth10, GLfloat depth11,
diff --git a/mesalib/src/mesa/swrast/s_texture.c b/mesalib/src/mesa/swrast/s_texture.c
index aa073753f..36b429cfa 100644
--- a/mesalib/src/mesa/swrast/s_texture.c
+++ b/mesalib/src/mesa/swrast/s_texture.c
@@ -177,6 +177,13 @@ _swrast_map_teximage(struct gl_context *ctx,
1);
assert(slice < texImage->Depth);
map += slice * sliceSize;
+ } else if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
+ GLuint sliceSize = _mesa_format_image_size(texImage->TexFormat,
+ texImage->Width,
+ 1,
+ 1);
+ assert(slice < texImage->Height);
+ map += slice * sliceSize;
}
/* apply x/y offset to map address */
diff --git a/mesalib/src/mesa/swrast/s_triangle.c b/mesalib/src/mesa/swrast/s_triangle.c
index 77bd2a359..839c4fd08 100644
--- a/mesalib/src/mesa/swrast/s_triangle.c
+++ b/mesalib/src/mesa/swrast/s_triangle.c
@@ -237,13 +237,13 @@ struct affine_info
};
-static INLINE GLint
+static inline GLint
ilerp(GLint t, GLint a, GLint b)
{
return a + ((t * (b - a)) >> FIXED_SHIFT);
}
-static INLINE GLint
+static inline GLint
ilerp_2d(GLint ia, GLint ib, GLint v00, GLint v10, GLint v01, GLint v11)
{
const GLint temp0 = ilerp(ia, v00, v10);
@@ -256,7 +256,7 @@ ilerp_2d(GLint ia, GLint ib, GLint v00, GLint v10, GLint v01, GLint v11)
* textures with GL_REPLACE, GL_MODULATE, GL_BLEND, GL_DECAL or GL_ADD
* texture env modes.
*/
-static INLINE void
+static inline void
affine_span(struct gl_context *ctx, SWspan *span,
struct affine_info *info)
{
@@ -591,7 +591,7 @@ struct persp_info
};
-static INLINE void
+static inline void
fast_persp_span(struct gl_context *ctx, SWspan *span,
struct persp_info *info)
{
diff --git a/mesalib/src/mesa/swrast/s_zoom.c b/mesalib/src/mesa/swrast/s_zoom.c
index 3b99bf754..3fb784847 100644
--- a/mesalib/src/mesa/swrast/s_zoom.c
+++ b/mesalib/src/mesa/swrast/s_zoom.c
@@ -1,433 +1,433 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.1
- *
- * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-#include "main/glheader.h"
-#include "main/macros.h"
-#include "main/imports.h"
-#include "main/colormac.h"
-
-#include "s_context.h"
-#include "s_span.h"
-#include "s_stencil.h"
-#include "s_zoom.h"
-
-
-/**
- * Compute the bounds of the region resulting from zooming a pixel span.
- * The resulting region will be entirely inside the window/scissor bounds
- * so no additional clipping is needed.
- * \param imageX, imageY position of the mage being drawn (gl WindowPos)
- * \param spanX, spanY position of span being drawing
- * \param width number of pixels in span
- * \param x0, x1 returned X bounds of zoomed region [x0, x1)
- * \param y0, y1 returned Y bounds of zoomed region [y0, y1)
- * \return GL_TRUE if any zoomed pixels visible, GL_FALSE if totally clipped
- */
-static GLboolean
-compute_zoomed_bounds(struct gl_context *ctx, GLint imageX, GLint imageY,
- GLint spanX, GLint spanY, GLint width,
- GLint *x0, GLint *x1, GLint *y0, GLint *y1)
-{
- const struct gl_framebuffer *fb = ctx->DrawBuffer;
- GLint c0, c1, r0, r1;
-
- ASSERT(spanX >= imageX);
- ASSERT(spanY >= imageY);
-
- /*
- * Compute destination columns: [c0, c1)
- */
- c0 = imageX + (GLint) ((spanX - imageX) * ctx->Pixel.ZoomX);
- c1 = imageX + (GLint) ((spanX + width - imageX) * ctx->Pixel.ZoomX);
- if (c1 < c0) {
- /* swap */
- GLint tmp = c1;
- c1 = c0;
- c0 = tmp;
- }
- c0 = CLAMP(c0, fb->_Xmin, fb->_Xmax);
- c1 = CLAMP(c1, fb->_Xmin, fb->_Xmax);
- if (c0 == c1) {
- return GL_FALSE; /* no width */
- }
-
- /*
- * Compute destination rows: [r0, r1)
- */
- r0 = imageY + (GLint) ((spanY - imageY) * ctx->Pixel.ZoomY);
- r1 = imageY + (GLint) ((spanY + 1 - imageY) * ctx->Pixel.ZoomY);
- if (r1 < r0) {
- /* swap */
- GLint tmp = r1;
- r1 = r0;
- r0 = tmp;
- }
- r0 = CLAMP(r0, fb->_Ymin, fb->_Ymax);
- r1 = CLAMP(r1, fb->_Ymin, fb->_Ymax);
- if (r0 == r1) {
- return GL_FALSE; /* no height */
- }
-
- *x0 = c0;
- *x1 = c1;
- *y0 = r0;
- *y1 = r1;
-
- return GL_TRUE;
-}
-
-
-/**
- * Convert a zoomed x image coordinate back to an unzoomed x coord.
- * 'zx' is screen position of a pixel in the zoomed image, who's left edge
- * is at 'imageX'.
- * return corresponding x coord in the original, unzoomed image.
- * This can use this for unzooming X or Y values.
- */
-static INLINE GLint
-unzoom_x(GLfloat zoomX, GLint imageX, GLint zx)
-{
- /*
- zx = imageX + (x - imageX) * zoomX;
- zx - imageX = (x - imageX) * zoomX;
- (zx - imageX) / zoomX = x - imageX;
- */
- GLint x;
- if (zoomX < 0.0)
- zx++;
- x = imageX + (GLint) ((zx - imageX) / zoomX);
- return x;
-}
-
-
-
-/**
- * Helper function called from _swrast_write_zoomed_rgba/rgb/
- * index/depth_span().
- */
-static void
-zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
- const GLvoid *src, GLenum format )
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- SWspan zoomed;
- GLint x0, x1, y0, y1;
- GLint zoomedWidth;
-
- if (!compute_zoomed_bounds(ctx, imgX, imgY, span->x, span->y, span->end,
- &x0, &x1, &y0, &y1)) {
- return; /* totally clipped */
- }
-
- if (!swrast->ZoomedArrays) {
- /* allocate on demand */
- swrast->ZoomedArrays = (SWspanarrays *) CALLOC(sizeof(SWspanarrays));
- if (!swrast->ZoomedArrays)
- return;
- }
-
- zoomedWidth = x1 - x0;
- ASSERT(zoomedWidth > 0);
- ASSERT(zoomedWidth <= MAX_WIDTH);
-
- /* no pixel arrays! must be horizontal spans. */
- ASSERT((span->arrayMask & SPAN_XY) == 0);
- ASSERT(span->primitive == GL_BITMAP);
-
- INIT_SPAN(zoomed, GL_BITMAP);
- zoomed.x = x0;
- zoomed.end = zoomedWidth;
- zoomed.array = swrast->ZoomedArrays;
- zoomed.array->ChanType = span->array->ChanType;
- if (zoomed.array->ChanType == GL_UNSIGNED_BYTE)
- zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba8;
- else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT)
- zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba16;
- else
- zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->attribs[FRAG_ATTRIB_COL0];
-
- COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]);
- COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]);
- COPY_4V(zoomed.attrStepY[FRAG_ATTRIB_WPOS], span->attrStepY[FRAG_ATTRIB_WPOS]);
-
- zoomed.attrStart[FRAG_ATTRIB_FOGC][0] = span->attrStart[FRAG_ATTRIB_FOGC][0];
- zoomed.attrStepX[FRAG_ATTRIB_FOGC][0] = span->attrStepX[FRAG_ATTRIB_FOGC][0];
- zoomed.attrStepY[FRAG_ATTRIB_FOGC][0] = span->attrStepY[FRAG_ATTRIB_FOGC][0];
-
- if (format == GL_RGBA || format == GL_RGB) {
- /* copy Z info */
- zoomed.z = span->z;
- zoomed.zStep = span->zStep;
- /* we'll generate an array of colorss */
- zoomed.interpMask = span->interpMask & ~SPAN_RGBA;
- zoomed.arrayMask |= SPAN_RGBA;
- zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */
- ASSERT(span->arrayMask & SPAN_RGBA);
- }
- else if (format == GL_DEPTH_COMPONENT) {
- /* Copy color info */
- zoomed.red = span->red;
- zoomed.green = span->green;
- zoomed.blue = span->blue;
- zoomed.alpha = span->alpha;
- zoomed.redStep = span->redStep;
- zoomed.greenStep = span->greenStep;
- zoomed.blueStep = span->blueStep;
- zoomed.alphaStep = span->alphaStep;
- /* we'll generate an array of depth values */
- zoomed.interpMask = span->interpMask & ~SPAN_Z;
- zoomed.arrayMask |= SPAN_Z;
- ASSERT(span->arrayMask & SPAN_Z);
- }
- else {
- _mesa_problem(ctx, "Bad format in zoom_span");
- return;
- }
-
- /* zoom the span horizontally */
- if (format == GL_RGBA) {
- if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) {
- const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) src;
- GLint i;
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
- COPY_4UBV(zoomed.array->rgba8[i], rgba[j]);
- }
- }
- else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) {
- const GLushort (*rgba)[4] = (const GLushort (*)[4]) src;
- GLint i;
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
- COPY_4V(zoomed.array->rgba16[i], rgba[j]);
- }
- }
- else {
- const GLfloat (*rgba)[4] = (const GLfloat (*)[4]) src;
- GLint i;
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < span->end);
- COPY_4V(zoomed.array->attribs[FRAG_ATTRIB_COL0][i], rgba[j]);
- }
- }
- }
- else if (format == GL_RGB) {
- if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) {
- const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) src;
- GLint i;
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
- zoomed.array->rgba8[i][0] = rgb[j][0];
- zoomed.array->rgba8[i][1] = rgb[j][1];
- zoomed.array->rgba8[i][2] = rgb[j][2];
- zoomed.array->rgba8[i][3] = 0xff;
- }
- }
- else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) {
- const GLushort (*rgb)[3] = (const GLushort (*)[3]) src;
- GLint i;
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
- zoomed.array->rgba16[i][0] = rgb[j][0];
- zoomed.array->rgba16[i][1] = rgb[j][1];
- zoomed.array->rgba16[i][2] = rgb[j][2];
- zoomed.array->rgba16[i][3] = 0xffff;
- }
- }
- else {
- const GLfloat (*rgb)[3] = (const GLfloat (*)[3]) src;
- GLint i;
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < span->end);
- zoomed.array->attribs[FRAG_ATTRIB_COL0][i][0] = rgb[j][0];
- zoomed.array->attribs[FRAG_ATTRIB_COL0][i][1] = rgb[j][1];
- zoomed.array->attribs[FRAG_ATTRIB_COL0][i][2] = rgb[j][2];
- zoomed.array->attribs[FRAG_ATTRIB_COL0][i][3] = 1.0F;
- }
- }
- }
- else if (format == GL_DEPTH_COMPONENT) {
- const GLuint *zValues = (const GLuint *) src;
- GLint i;
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
- ASSERT(j >= 0);
- ASSERT(j < (GLint) span->end);
- zoomed.array->z[i] = zValues[j];
- }
- /* Now, fall into the RGB path below */
- format = GL_RGBA;
- }
-
- /* write the span in rows [r0, r1) */
- if (format == GL_RGBA || format == GL_RGB) {
- /* Writing the span may modify the colors, so make a backup now if we're
- * going to call _swrast_write_zoomed_span() more than once.
- * Also, clipping may change the span end value, so store it as well.
- */
- const GLint end = zoomed.end; /* save */
- GLuint rgbaSave[MAX_WIDTH][4];
- const GLint pixelSize =
- (zoomed.array->ChanType == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) :
- ((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort)
- : 4 * sizeof(GLfloat));
- if (y1 - y0 > 1) {
- memcpy(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize);
- }
- for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) {
- _swrast_write_rgba_span(ctx, &zoomed);
- zoomed.end = end; /* restore */
- if (y1 - y0 > 1) {
- /* restore the colors */
- memcpy(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize);
- }
- }
- }
-}
-
-
-void
-_swrast_write_zoomed_rgba_span(struct gl_context *ctx, GLint imgX, GLint imgY,
- const SWspan *span, const GLvoid *rgba)
-{
- zoom_span(ctx, imgX, imgY, span, rgba, GL_RGBA);
-}
-
-
-void
-_swrast_write_zoomed_rgb_span(struct gl_context *ctx, GLint imgX, GLint imgY,
- const SWspan *span, const GLvoid *rgb)
-{
- zoom_span(ctx, imgX, imgY, span, rgb, GL_RGB);
-}
-
-
-void
-_swrast_write_zoomed_depth_span(struct gl_context *ctx, GLint imgX, GLint imgY,
- const SWspan *span)
-{
- zoom_span(ctx, imgX, imgY, span,
- (const GLvoid *) span->array->z, GL_DEPTH_COMPONENT);
-}
-
-
-/**
- * Zoom/write stencil values.
- * No per-fragment operations are applied.
- */
-void
-_swrast_write_zoomed_stencil_span(struct gl_context *ctx, GLint imgX, GLint imgY,
- GLint width, GLint spanX, GLint spanY,
- const GLstencil stencil[])
-{
- GLstencil zoomedVals[MAX_WIDTH];
- GLint x0, x1, y0, y1, y;
- GLint i, zoomedWidth;
-
- if (!compute_zoomed_bounds(ctx, imgX, imgY, spanX, spanY, width,
- &x0, &x1, &y0, &y1)) {
- return; /* totally clipped */
- }
-
- zoomedWidth = x1 - x0;
- ASSERT(zoomedWidth > 0);
- ASSERT(zoomedWidth <= MAX_WIDTH);
-
- /* zoom the span horizontally */
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
- ASSERT(j >= 0);
- ASSERT(j < width);
- zoomedVals[i] = stencil[j];
- }
-
- /* write the zoomed spans */
- for (y = y0; y < y1; y++) {
- _swrast_write_stencil_span(ctx, zoomedWidth, x0, y, zoomedVals);
- }
-}
-
-
-/**
- * Zoom/write z values (16 or 32-bit).
- * No per-fragment operations are applied.
- */
-void
-_swrast_write_zoomed_z_span(struct gl_context *ctx, GLint imgX, GLint imgY,
- GLint width, GLint spanX, GLint spanY,
- const GLvoid *z)
-{
- struct gl_renderbuffer *rb = ctx->DrawBuffer->_DepthBuffer;
- GLushort zoomedVals16[MAX_WIDTH];
- GLuint zoomedVals32[MAX_WIDTH];
- GLint x0, x1, y0, y1, y;
- GLint i, zoomedWidth;
-
- if (!compute_zoomed_bounds(ctx, imgX, imgY, spanX, spanY, width,
- &x0, &x1, &y0, &y1)) {
- return; /* totally clipped */
- }
-
- zoomedWidth = x1 - x0;
- ASSERT(zoomedWidth > 0);
- ASSERT(zoomedWidth <= MAX_WIDTH);
-
- /* zoom the span horizontally */
- if (rb->DataType == GL_UNSIGNED_SHORT) {
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
- ASSERT(j >= 0);
- ASSERT(j < width);
- zoomedVals16[i] = ((GLushort *) z)[j];
- }
- z = zoomedVals16;
- }
- else {
- ASSERT(rb->DataType == GL_UNSIGNED_INT);
- for (i = 0; i < zoomedWidth; i++) {
- GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
- ASSERT(j >= 0);
- ASSERT(j < width);
- zoomedVals32[i] = ((GLuint *) z)[j];
- }
- z = zoomedVals32;
- }
-
- /* write the zoomed spans */
- for (y = y0; y < y1; y++) {
- rb->PutRow(ctx, rb, zoomedWidth, x0, y, z, NULL);
- }
-}
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.1
+ *
+ * Copyright (C) 1999-2008 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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.
+ */
+
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/colormac.h"
+
+#include "s_context.h"
+#include "s_span.h"
+#include "s_stencil.h"
+#include "s_zoom.h"
+
+
+/**
+ * Compute the bounds of the region resulting from zooming a pixel span.
+ * The resulting region will be entirely inside the window/scissor bounds
+ * so no additional clipping is needed.
+ * \param imageX, imageY position of the mage being drawn (gl WindowPos)
+ * \param spanX, spanY position of span being drawing
+ * \param width number of pixels in span
+ * \param x0, x1 returned X bounds of zoomed region [x0, x1)
+ * \param y0, y1 returned Y bounds of zoomed region [y0, y1)
+ * \return GL_TRUE if any zoomed pixels visible, GL_FALSE if totally clipped
+ */
+static GLboolean
+compute_zoomed_bounds(struct gl_context *ctx, GLint imageX, GLint imageY,
+ GLint spanX, GLint spanY, GLint width,
+ GLint *x0, GLint *x1, GLint *y0, GLint *y1)
+{
+ const struct gl_framebuffer *fb = ctx->DrawBuffer;
+ GLint c0, c1, r0, r1;
+
+ ASSERT(spanX >= imageX);
+ ASSERT(spanY >= imageY);
+
+ /*
+ * Compute destination columns: [c0, c1)
+ */
+ c0 = imageX + (GLint) ((spanX - imageX) * ctx->Pixel.ZoomX);
+ c1 = imageX + (GLint) ((spanX + width - imageX) * ctx->Pixel.ZoomX);
+ if (c1 < c0) {
+ /* swap */
+ GLint tmp = c1;
+ c1 = c0;
+ c0 = tmp;
+ }
+ c0 = CLAMP(c0, fb->_Xmin, fb->_Xmax);
+ c1 = CLAMP(c1, fb->_Xmin, fb->_Xmax);
+ if (c0 == c1) {
+ return GL_FALSE; /* no width */
+ }
+
+ /*
+ * Compute destination rows: [r0, r1)
+ */
+ r0 = imageY + (GLint) ((spanY - imageY) * ctx->Pixel.ZoomY);
+ r1 = imageY + (GLint) ((spanY + 1 - imageY) * ctx->Pixel.ZoomY);
+ if (r1 < r0) {
+ /* swap */
+ GLint tmp = r1;
+ r1 = r0;
+ r0 = tmp;
+ }
+ r0 = CLAMP(r0, fb->_Ymin, fb->_Ymax);
+ r1 = CLAMP(r1, fb->_Ymin, fb->_Ymax);
+ if (r0 == r1) {
+ return GL_FALSE; /* no height */
+ }
+
+ *x0 = c0;
+ *x1 = c1;
+ *y0 = r0;
+ *y1 = r1;
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Convert a zoomed x image coordinate back to an unzoomed x coord.
+ * 'zx' is screen position of a pixel in the zoomed image, who's left edge
+ * is at 'imageX'.
+ * return corresponding x coord in the original, unzoomed image.
+ * This can use this for unzooming X or Y values.
+ */
+static inline GLint
+unzoom_x(GLfloat zoomX, GLint imageX, GLint zx)
+{
+ /*
+ zx = imageX + (x - imageX) * zoomX;
+ zx - imageX = (x - imageX) * zoomX;
+ (zx - imageX) / zoomX = x - imageX;
+ */
+ GLint x;
+ if (zoomX < 0.0)
+ zx++;
+ x = imageX + (GLint) ((zx - imageX) / zoomX);
+ return x;
+}
+
+
+
+/**
+ * Helper function called from _swrast_write_zoomed_rgba/rgb/
+ * index/depth_span().
+ */
+static void
+zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
+ const GLvoid *src, GLenum format )
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ SWspan zoomed;
+ GLint x0, x1, y0, y1;
+ GLint zoomedWidth;
+
+ if (!compute_zoomed_bounds(ctx, imgX, imgY, span->x, span->y, span->end,
+ &x0, &x1, &y0, &y1)) {
+ return; /* totally clipped */
+ }
+
+ if (!swrast->ZoomedArrays) {
+ /* allocate on demand */
+ swrast->ZoomedArrays = (SWspanarrays *) CALLOC(sizeof(SWspanarrays));
+ if (!swrast->ZoomedArrays)
+ return;
+ }
+
+ zoomedWidth = x1 - x0;
+ ASSERT(zoomedWidth > 0);
+ ASSERT(zoomedWidth <= MAX_WIDTH);
+
+ /* no pixel arrays! must be horizontal spans. */
+ ASSERT((span->arrayMask & SPAN_XY) == 0);
+ ASSERT(span->primitive == GL_BITMAP);
+
+ INIT_SPAN(zoomed, GL_BITMAP);
+ zoomed.x = x0;
+ zoomed.end = zoomedWidth;
+ zoomed.array = swrast->ZoomedArrays;
+ zoomed.array->ChanType = span->array->ChanType;
+ if (zoomed.array->ChanType == GL_UNSIGNED_BYTE)
+ zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba8;
+ else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT)
+ zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba16;
+ else
+ zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->attribs[FRAG_ATTRIB_COL0];
+
+ COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]);
+ COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]);
+ COPY_4V(zoomed.attrStepY[FRAG_ATTRIB_WPOS], span->attrStepY[FRAG_ATTRIB_WPOS]);
+
+ zoomed.attrStart[FRAG_ATTRIB_FOGC][0] = span->attrStart[FRAG_ATTRIB_FOGC][0];
+ zoomed.attrStepX[FRAG_ATTRIB_FOGC][0] = span->attrStepX[FRAG_ATTRIB_FOGC][0];
+ zoomed.attrStepY[FRAG_ATTRIB_FOGC][0] = span->attrStepY[FRAG_ATTRIB_FOGC][0];
+
+ if (format == GL_RGBA || format == GL_RGB) {
+ /* copy Z info */
+ zoomed.z = span->z;
+ zoomed.zStep = span->zStep;
+ /* we'll generate an array of colorss */
+ zoomed.interpMask = span->interpMask & ~SPAN_RGBA;
+ zoomed.arrayMask |= SPAN_RGBA;
+ zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */
+ ASSERT(span->arrayMask & SPAN_RGBA);
+ }
+ else if (format == GL_DEPTH_COMPONENT) {
+ /* Copy color info */
+ zoomed.red = span->red;
+ zoomed.green = span->green;
+ zoomed.blue = span->blue;
+ zoomed.alpha = span->alpha;
+ zoomed.redStep = span->redStep;
+ zoomed.greenStep = span->greenStep;
+ zoomed.blueStep = span->blueStep;
+ zoomed.alphaStep = span->alphaStep;
+ /* we'll generate an array of depth values */
+ zoomed.interpMask = span->interpMask & ~SPAN_Z;
+ zoomed.arrayMask |= SPAN_Z;
+ ASSERT(span->arrayMask & SPAN_Z);
+ }
+ else {
+ _mesa_problem(ctx, "Bad format in zoom_span");
+ return;
+ }
+
+ /* zoom the span horizontally */
+ if (format == GL_RGBA) {
+ if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) {
+ const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < (GLint) span->end);
+ COPY_4UBV(zoomed.array->rgba8[i], rgba[j]);
+ }
+ }
+ else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) {
+ const GLushort (*rgba)[4] = (const GLushort (*)[4]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < (GLint) span->end);
+ COPY_4V(zoomed.array->rgba16[i], rgba[j]);
+ }
+ }
+ else {
+ const GLfloat (*rgba)[4] = (const GLfloat (*)[4]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < span->end);
+ COPY_4V(zoomed.array->attribs[FRAG_ATTRIB_COL0][i], rgba[j]);
+ }
+ }
+ }
+ else if (format == GL_RGB) {
+ if (zoomed.array->ChanType == GL_UNSIGNED_BYTE) {
+ const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < (GLint) span->end);
+ zoomed.array->rgba8[i][0] = rgb[j][0];
+ zoomed.array->rgba8[i][1] = rgb[j][1];
+ zoomed.array->rgba8[i][2] = rgb[j][2];
+ zoomed.array->rgba8[i][3] = 0xff;
+ }
+ }
+ else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) {
+ const GLushort (*rgb)[3] = (const GLushort (*)[3]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < (GLint) span->end);
+ zoomed.array->rgba16[i][0] = rgb[j][0];
+ zoomed.array->rgba16[i][1] = rgb[j][1];
+ zoomed.array->rgba16[i][2] = rgb[j][2];
+ zoomed.array->rgba16[i][3] = 0xffff;
+ }
+ }
+ else {
+ const GLfloat (*rgb)[3] = (const GLfloat (*)[3]) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < span->end);
+ zoomed.array->attribs[FRAG_ATTRIB_COL0][i][0] = rgb[j][0];
+ zoomed.array->attribs[FRAG_ATTRIB_COL0][i][1] = rgb[j][1];
+ zoomed.array->attribs[FRAG_ATTRIB_COL0][i][2] = rgb[j][2];
+ zoomed.array->attribs[FRAG_ATTRIB_COL0][i][3] = 1.0F;
+ }
+ }
+ }
+ else if (format == GL_DEPTH_COMPONENT) {
+ const GLuint *zValues = (const GLuint *) src;
+ GLint i;
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
+ ASSERT(j >= 0);
+ ASSERT(j < (GLint) span->end);
+ zoomed.array->z[i] = zValues[j];
+ }
+ /* Now, fall into the RGB path below */
+ format = GL_RGBA;
+ }
+
+ /* write the span in rows [r0, r1) */
+ if (format == GL_RGBA || format == GL_RGB) {
+ /* Writing the span may modify the colors, so make a backup now if we're
+ * going to call _swrast_write_zoomed_span() more than once.
+ * Also, clipping may change the span end value, so store it as well.
+ */
+ const GLint end = zoomed.end; /* save */
+ GLuint rgbaSave[MAX_WIDTH][4];
+ const GLint pixelSize =
+ (zoomed.array->ChanType == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) :
+ ((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort)
+ : 4 * sizeof(GLfloat));
+ if (y1 - y0 > 1) {
+ memcpy(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize);
+ }
+ for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) {
+ _swrast_write_rgba_span(ctx, &zoomed);
+ zoomed.end = end; /* restore */
+ if (y1 - y0 > 1) {
+ /* restore the colors */
+ memcpy(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize);
+ }
+ }
+ }
+}
+
+
+void
+_swrast_write_zoomed_rgba_span(struct gl_context *ctx, GLint imgX, GLint imgY,
+ const SWspan *span, const GLvoid *rgba)
+{
+ zoom_span(ctx, imgX, imgY, span, rgba, GL_RGBA);
+}
+
+
+void
+_swrast_write_zoomed_rgb_span(struct gl_context *ctx, GLint imgX, GLint imgY,
+ const SWspan *span, const GLvoid *rgb)
+{
+ zoom_span(ctx, imgX, imgY, span, rgb, GL_RGB);
+}
+
+
+void
+_swrast_write_zoomed_depth_span(struct gl_context *ctx, GLint imgX, GLint imgY,
+ const SWspan *span)
+{
+ zoom_span(ctx, imgX, imgY, span,
+ (const GLvoid *) span->array->z, GL_DEPTH_COMPONENT);
+}
+
+
+/**
+ * Zoom/write stencil values.
+ * No per-fragment operations are applied.
+ */
+void
+_swrast_write_zoomed_stencil_span(struct gl_context *ctx, GLint imgX, GLint imgY,
+ GLint width, GLint spanX, GLint spanY,
+ const GLstencil stencil[])
+{
+ GLstencil zoomedVals[MAX_WIDTH];
+ GLint x0, x1, y0, y1, y;
+ GLint i, zoomedWidth;
+
+ if (!compute_zoomed_bounds(ctx, imgX, imgY, spanX, spanY, width,
+ &x0, &x1, &y0, &y1)) {
+ return; /* totally clipped */
+ }
+
+ zoomedWidth = x1 - x0;
+ ASSERT(zoomedWidth > 0);
+ ASSERT(zoomedWidth <= MAX_WIDTH);
+
+ /* zoom the span horizontally */
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
+ ASSERT(j >= 0);
+ ASSERT(j < width);
+ zoomedVals[i] = stencil[j];
+ }
+
+ /* write the zoomed spans */
+ for (y = y0; y < y1; y++) {
+ _swrast_write_stencil_span(ctx, zoomedWidth, x0, y, zoomedVals);
+ }
+}
+
+
+/**
+ * Zoom/write z values (16 or 32-bit).
+ * No per-fragment operations are applied.
+ */
+void
+_swrast_write_zoomed_z_span(struct gl_context *ctx, GLint imgX, GLint imgY,
+ GLint width, GLint spanX, GLint spanY,
+ const GLvoid *z)
+{
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_DepthBuffer;
+ GLushort zoomedVals16[MAX_WIDTH];
+ GLuint zoomedVals32[MAX_WIDTH];
+ GLint x0, x1, y0, y1, y;
+ GLint i, zoomedWidth;
+
+ if (!compute_zoomed_bounds(ctx, imgX, imgY, spanX, spanY, width,
+ &x0, &x1, &y0, &y1)) {
+ return; /* totally clipped */
+ }
+
+ zoomedWidth = x1 - x0;
+ ASSERT(zoomedWidth > 0);
+ ASSERT(zoomedWidth <= MAX_WIDTH);
+
+ /* zoom the span horizontally */
+ if (rb->DataType == GL_UNSIGNED_SHORT) {
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
+ ASSERT(j >= 0);
+ ASSERT(j < width);
+ zoomedVals16[i] = ((GLushort *) z)[j];
+ }
+ z = zoomedVals16;
+ }
+ else {
+ ASSERT(rb->DataType == GL_UNSIGNED_INT);
+ for (i = 0; i < zoomedWidth; i++) {
+ GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - spanX;
+ ASSERT(j >= 0);
+ ASSERT(j < width);
+ zoomedVals32[i] = ((GLuint *) z)[j];
+ }
+ z = zoomedVals32;
+ }
+
+ /* write the zoomed spans */
+ for (y = y0; y < y1; y++) {
+ rb->PutRow(ctx, rb, zoomedWidth, x0, y, z, NULL);
+ }
+}
diff --git a/mesalib/src/mesa/tnl/t_vb_program.c b/mesalib/src/mesa/tnl/t_vb_program.c
index 4b1a212fd..cc5e85634 100644
--- a/mesalib/src/mesa/tnl/t_vb_program.c
+++ b/mesalib/src/mesa/tnl/t_vb_program.c
@@ -1,574 +1,572 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.6
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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 tnl/t_vb_program.c
- * \brief Pipeline stage for executing vertex programs.
- * \author Brian Paul, Keith Whitwell
- */
-
-
-#include "main/glheader.h"
-#include "main/colormac.h"
-#include "main/macros.h"
-#include "main/imports.h"
-#include "math/m_xform.h"
-#include "program/prog_instruction.h"
-#include "program/prog_statevars.h"
-#include "program/prog_execute.h"
-#include "swrast/s_context.h"
-
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-
-
-#ifdef NAN_CHECK
-/** Check for NaNs and very large values */
-static INLINE void
-check_float(float x)
-{
- assert(!IS_INF_OR_NAN(x));
- assert(1.0e-15 <= x && x <= 1.0e15);
-}
-#endif
-
-
-/*!
- * Private storage for the vertex program pipeline stage.
- */
-struct vp_stage_data {
- /** The results of running the vertex program go into these arrays. */
- GLvector4f results[VERT_RESULT_MAX];
-
- GLvector4f ndcCoords; /**< normalized device coords */
- GLubyte *clipmask; /**< clip flags */
- GLubyte ormask, andmask; /**< for clipping */
-
- struct gl_program_machine machine;
-};
-
-
-#define VP_STAGE_DATA(stage) ((struct vp_stage_data *)(stage->privatePtr))
-
-
-static void
-userclip( struct gl_context *ctx,
- GLvector4f *clip,
- GLubyte *clipmask,
- GLubyte *clipormask,
- GLubyte *clipandmask )
-{
- GLuint p;
-
- for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
- if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
- GLuint nr, i;
- const GLfloat a = ctx->Transform._ClipUserPlane[p][0];
- const GLfloat b = ctx->Transform._ClipUserPlane[p][1];
- const GLfloat c = ctx->Transform._ClipUserPlane[p][2];
- const GLfloat d = ctx->Transform._ClipUserPlane[p][3];
- GLfloat *coord = (GLfloat *)clip->data;
- GLuint stride = clip->stride;
- GLuint count = clip->count;
-
- for (nr = 0, i = 0 ; i < count ; i++) {
- GLfloat dp = (coord[0] * a +
- coord[1] * b +
- coord[2] * c +
- coord[3] * d);
-
- if (dp < 0) {
- nr++;
- clipmask[i] |= CLIP_USER_BIT;
- }
-
- STRIDE_F(coord, stride);
- }
-
- if (nr > 0) {
- *clipormask |= CLIP_USER_BIT;
- if (nr == count) {
- *clipandmask |= CLIP_USER_BIT;
- return;
- }
- }
- }
- }
-}
-
-
-static GLboolean
-do_ndc_cliptest(struct gl_context *ctx, struct vp_stage_data *store)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- /* Cliptest and perspective divide. Clip functions must clear
- * the clipmask.
- */
- store->ormask = 0;
- store->andmask = CLIP_FRUSTUM_BITS;
-
- tnl_clip_prepare(ctx);
-
- if (tnl->NeedNdcCoords) {
- VB->NdcPtr =
- _mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr,
- &store->ndcCoords,
- store->clipmask,
- &store->ormask,
- &store->andmask,
- !ctx->Transform.DepthClamp );
- }
- else {
- VB->NdcPtr = NULL;
- _mesa_clip_np_tab[VB->ClipPtr->size]( VB->ClipPtr,
- NULL,
- store->clipmask,
- &store->ormask,
- &store->andmask,
- !ctx->Transform.DepthClamp );
- }
-
- if (store->andmask) {
- /* All vertices are outside the frustum */
- return GL_FALSE;
- }
-
- /* Test userclip planes. This contributes to VB->ClipMask.
- */
- /** XXX NEW_SLANG _Enabled ??? */
- if (ctx->Transform.ClipPlanesEnabled && (!ctx->VertexProgram._Enabled ||
- ctx->VertexProgram.Current->IsPositionInvariant)) {
- userclip( ctx,
- VB->ClipPtr,
- store->clipmask,
- &store->ormask,
- &store->andmask );
-
- if (store->andmask) {
- return GL_FALSE;
- }
- }
-
- VB->ClipAndMask = store->andmask;
- VB->ClipOrMask = store->ormask;
- VB->ClipMask = store->clipmask;
-
- return GL_TRUE;
-}
-
-
-/**
- * XXX the texture sampling code in this module is a bit of a hack.
- * The texture sampling code is in swrast, though it doesn't have any
- * real dependencies on the rest of swrast. It should probably be
- * moved into main/ someday.
- */
-static void
-vp_fetch_texel(struct gl_context *ctx, const GLfloat texcoord[4], GLfloat lambda,
- GLuint unit, GLfloat color[4])
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
-
- /* XXX use a float-valued TextureSample routine here!!! */
- swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current,
- 1, (const GLfloat (*)[4]) texcoord,
- &lambda, (GLfloat (*)[4]) color);
-}
-
-
-/**
- * Called via ctx->Driver.ProgramStringNotify() after a new vertex program
- * string has been parsed.
- */
-GLboolean
-_tnl_program_string(struct gl_context *ctx, GLenum target, struct gl_program *program)
-{
- /* No-op.
- * If we had derived anything from the program that was private to this
- * stage we'd recompute/validate it here.
- */
- return GL_TRUE;
-}
-
-
-/**
- * Initialize virtual machine state prior to executing vertex program.
- */
-static void
-init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
- GLuint instID)
-{
- /* Input registers get initialized from the current vertex attribs */
- memcpy(machine->VertAttribs, ctx->Current.Attrib,
- MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat));
-
- if (ctx->VertexProgram._Current->IsNVProgram) {
- GLuint i;
- /* Output/result regs are initialized to [0,0,0,1] */
- for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) {
- ASSIGN_4V(machine->Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F);
- }
- /* Temp regs are initialized to [0,0,0,0] */
- for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) {
- ASSIGN_4V(machine->Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F);
- }
- for (i = 0; i < MAX_VERTEX_PROGRAM_ADDRESS_REGS; i++) {
- ASSIGN_4V(machine->AddressReg[i], 0, 0, 0, 0);
- }
- }
-
- machine->NumDeriv = 0;
-
- /* init condition codes */
- machine->CondCodes[0] = COND_EQ;
- machine->CondCodes[1] = COND_EQ;
- machine->CondCodes[2] = COND_EQ;
- machine->CondCodes[3] = COND_EQ;
-
- /* init call stack */
- machine->StackDepth = 0;
-
- machine->FetchTexelLod = vp_fetch_texel;
- machine->FetchTexelDeriv = NULL; /* not used by vertex programs */
-
- machine->Samplers = ctx->VertexProgram._Current->Base.SamplerUnits;
-
- machine->SystemValues[SYSTEM_VALUE_INSTANCE_ID][0] = (GLfloat) instID;
-}
-
-
-/**
- * Map the texture images which the vertex program will access (if any).
- */
-static void
-map_textures(struct gl_context *ctx, const struct gl_vertex_program *vp)
-{
- GLuint u;
-
- if (!ctx->Driver.MapTexture)
- return;
-
- for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) {
- if (vp->Base.TexturesUsed[u]) {
- /* Note: _Current *should* correspond to the target indicated
- * in TexturesUsed[u].
- */
- ctx->Driver.MapTexture(ctx, ctx->Texture.Unit[u]._Current);
- }
- }
-}
-
-
-/**
- * Unmap the texture images which were used by the vertex program (if any).
- */
-static void
-unmap_textures(struct gl_context *ctx, const struct gl_vertex_program *vp)
-{
- GLuint u;
-
- if (!ctx->Driver.MapTexture)
- return;
-
- for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) {
- if (vp->Base.TexturesUsed[u]) {
- /* Note: _Current *should* correspond to the target indicated
- * in TexturesUsed[u].
- */
- ctx->Driver.UnmapTexture(ctx, ctx->Texture.Unit[u]._Current);
- }
- }
-}
-
-
-/**
- * This function executes vertex programs
- */
-static GLboolean
-run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vp_stage_data *store = VP_STAGE_DATA(stage);
- struct vertex_buffer *VB = &tnl->vb;
- struct gl_vertex_program *program = ctx->VertexProgram._Current;
- struct gl_program_machine *machine = &store->machine;
- GLuint outputs[VERT_RESULT_MAX], numOutputs;
- GLuint i, j;
-
- if (!program)
- return GL_TRUE;
-
- if (program->IsNVProgram) {
- _mesa_load_tracked_matrices(ctx);
- }
- else {
- /* ARB program or vertex shader */
- _mesa_load_state_parameters(ctx, program->Base.Parameters);
- }
-
- /* make list of outputs to save some time below */
- numOutputs = 0;
- for (i = 0; i < VERT_RESULT_MAX; i++) {
- if (program->Base.OutputsWritten & BITFIELD64_BIT(i)) {
- outputs[numOutputs++] = i;
- }
- }
-
- map_textures(ctx, program);
-
- for (i = 0; i < VB->Count; i++) {
- GLuint attr;
-
- init_machine(ctx, machine, tnl->CurInstance);
-
-#if 0
- printf("Input %d: %f, %f, %f, %f\n", i,
- VB->AttribPtr[0]->data[i][0],
- VB->AttribPtr[0]->data[i][1],
- VB->AttribPtr[0]->data[i][2],
- VB->AttribPtr[0]->data[i][3]);
- printf(" color: %f, %f, %f, %f\n",
- VB->AttribPtr[3]->data[i][0],
- VB->AttribPtr[3]->data[i][1],
- VB->AttribPtr[3]->data[i][2],
- VB->AttribPtr[3]->data[i][3]);
- printf(" normal: %f, %f, %f, %f\n",
- VB->AttribPtr[2]->data[i][0],
- VB->AttribPtr[2]->data[i][1],
- VB->AttribPtr[2]->data[i][2],
- VB->AttribPtr[2]->data[i][3]);
-#endif
-
- /* the vertex array case */
- for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
- if (program->Base.InputsRead & (1 << attr)) {
- const GLubyte *ptr = (const GLubyte*) VB->AttribPtr[attr]->data;
- const GLuint size = VB->AttribPtr[attr]->size;
- const GLuint stride = VB->AttribPtr[attr]->stride;
- const GLfloat *data = (GLfloat *) (ptr + stride * i);
-#ifdef NAN_CHECK
- check_float(data[0]);
- check_float(data[1]);
- check_float(data[2]);
- check_float(data[3]);
-#endif
- COPY_CLEAN_4V(machine->VertAttribs[attr], size, data);
- }
- }
-
- /* execute the program */
- _mesa_execute_program(ctx, &program->Base, machine);
-
- /* copy the output registers into the VB->attribs arrays */
- for (j = 0; j < numOutputs; j++) {
- const GLuint attr = outputs[j];
-#ifdef NAN_CHECK
- check_float(machine->Outputs[attr][0]);
- check_float(machine->Outputs[attr][1]);
- check_float(machine->Outputs[attr][2]);
- check_float(machine->Outputs[attr][3]);
-#endif
- COPY_4V(store->results[attr].data[i], machine->Outputs[attr]);
- }
-
- /* FOGC is a special case. Fragment shader expects (f,0,0,1) */
- if (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_FOGC)) {
- store->results[VERT_RESULT_FOGC].data[i][1] = 0.0;
- store->results[VERT_RESULT_FOGC].data[i][2] = 0.0;
- store->results[VERT_RESULT_FOGC].data[i][3] = 1.0;
- }
-#ifdef NAN_CHECK
- ASSERT(machine->Outputs[0][3] != 0.0F);
-#endif
-#if 0
- printf("HPOS: %f %f %f %f\n",
- machine->Outputs[0][0],
- machine->Outputs[0][1],
- machine->Outputs[0][2],
- machine->Outputs[0][3]);
-#endif
- }
-
- unmap_textures(ctx, program);
-
- /* Fixup fog and point size results if needed */
- if (program->IsNVProgram) {
- if (ctx->Fog.Enabled &&
- (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_FOGC)) == 0) {
- for (i = 0; i < VB->Count; i++) {
- store->results[VERT_RESULT_FOGC].data[i][0] = 1.0;
- }
- }
-
- if (ctx->VertexProgram.PointSizeEnabled &&
- (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) == 0) {
- for (i = 0; i < VB->Count; i++) {
- store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size;
- }
- }
- }
-
- if (program->IsPositionInvariant) {
- /* We need the exact same transform as in the fixed function path here
- * to guarantee invariance, depending on compiler optimization flags
- * results could be different otherwise.
- */
- VB->ClipPtr = TransformRaw( &store->results[0],
- &ctx->_ModelProjectMatrix,
- VB->AttribPtr[0] );
-
- /* Drivers expect this to be clean to element 4...
- */
- switch (VB->ClipPtr->size) {
- case 1:
- /* impossible */
- case 2:
- _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 );
- /* fall-through */
- case 3:
- _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 3 );
- /* fall-through */
- case 4:
- break;
- }
- }
- else {
- /* Setup the VB pointers so that the next pipeline stages get
- * their data from the right place (the program output arrays).
- */
- VB->ClipPtr = &store->results[VERT_RESULT_HPOS];
- VB->ClipPtr->size = 4;
- VB->ClipPtr->count = VB->Count;
- }
-
- VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0];
- VB->AttribPtr[VERT_ATTRIB_COLOR1] = &store->results[VERT_RESULT_COL1];
- VB->AttribPtr[VERT_ATTRIB_FOG] = &store->results[VERT_RESULT_FOGC];
- VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->results[VERT_RESULT_PSIZ];
- VB->BackfaceColorPtr = &store->results[VERT_RESULT_BFC0];
- VB->BackfaceSecondaryColorPtr = &store->results[VERT_RESULT_BFC1];
-
- for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
- VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]
- = &store->results[VERT_RESULT_TEX0 + i];
- }
-
- for (i = 0; i < ctx->Const.MaxVarying; i++) {
- if (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_VAR0 + i)) {
- /* Note: varying results get put into the generic attributes */
- VB->AttribPtr[VERT_ATTRIB_GENERIC0+i]
- = &store->results[VERT_RESULT_VAR0 + i];
- }
- }
-
-
- /* Perform NDC and cliptest operations:
- */
- return do_ndc_cliptest(ctx, store);
-}
-
-
-/**
- * Called the first time stage->run is called. In effect, don't
- * allocate data until the first time the stage is run.
- */
-static GLboolean
-init_vp(struct gl_context *ctx, struct tnl_pipeline_stage *stage)
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &(tnl->vb);
- struct vp_stage_data *store;
- const GLuint size = VB->Size;
- GLuint i;
-
- stage->privatePtr = CALLOC(sizeof(*store));
- store = VP_STAGE_DATA(stage);
- if (!store)
- return GL_FALSE;
-
- /* Allocate arrays of vertex output values */
- for (i = 0; i < VERT_RESULT_MAX; i++) {
- _mesa_vector4f_alloc( &store->results[i], 0, size, 32 );
- store->results[i].size = 4;
- }
-
- /* a few other misc allocations */
- _mesa_vector4f_alloc( &store->ndcCoords, 0, size, 32 );
- store->clipmask = (GLubyte *) _mesa_align_malloc(sizeof(GLubyte)*size, 32 );
-
- return GL_TRUE;
-}
-
-
-/**
- * Destructor for this pipeline stage.
- */
-static void
-dtr(struct tnl_pipeline_stage *stage)
-{
- struct vp_stage_data *store = VP_STAGE_DATA(stage);
-
- if (store) {
- GLuint i;
-
- /* free the vertex program result arrays */
- for (i = 0; i < VERT_RESULT_MAX; i++)
- _mesa_vector4f_free( &store->results[i] );
-
- /* free misc arrays */
- _mesa_vector4f_free( &store->ndcCoords );
- _mesa_align_free( store->clipmask );
-
- FREE( store );
- stage->privatePtr = NULL;
- }
-}
-
-
-static void
-validate_vp_stage(struct gl_context *ctx, struct tnl_pipeline_stage *stage)
-{
- if (ctx->VertexProgram._Current) {
- _swrast_update_texture_samplers(ctx);
- }
-}
-
-
-
-/**
- * Public description of this pipeline stage.
- */
-const struct tnl_pipeline_stage _tnl_vertex_program_stage =
-{
- "vertex-program",
- NULL, /* private_data */
- init_vp, /* create */
- dtr, /* destroy */
- validate_vp_stage, /* validate */
- run_vp /* run -- initially set to ctr */
-};
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.6
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 tnl/t_vb_program.c
+ * \brief Pipeline stage for executing vertex programs.
+ * \author Brian Paul, Keith Whitwell
+ */
+
+
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "math/m_xform.h"
+#include "program/prog_instruction.h"
+#include "program/prog_statevars.h"
+#include "program/prog_execute.h"
+#include "swrast/s_context.h"
+
+#include "tnl/tnl.h"
+#include "tnl/t_context.h"
+#include "tnl/t_pipeline.h"
+
+
+#ifdef NAN_CHECK
+/** Check for NaNs and very large values */
+static inline void
+check_float(float x)
+{
+ assert(!IS_INF_OR_NAN(x));
+ assert(1.0e-15 <= x && x <= 1.0e15);
+}
+#endif
+
+
+/*!
+ * Private storage for the vertex program pipeline stage.
+ */
+struct vp_stage_data {
+ /** The results of running the vertex program go into these arrays. */
+ GLvector4f results[VERT_RESULT_MAX];
+
+ GLvector4f ndcCoords; /**< normalized device coords */
+ GLubyte *clipmask; /**< clip flags */
+ GLubyte ormask, andmask; /**< for clipping */
+
+ struct gl_program_machine machine;
+};
+
+
+#define VP_STAGE_DATA(stage) ((struct vp_stage_data *)(stage->privatePtr))
+
+
+static void
+userclip( struct gl_context *ctx,
+ GLvector4f *clip,
+ GLubyte *clipmask,
+ GLubyte *clipormask,
+ GLubyte *clipandmask )
+{
+ GLuint p;
+
+ for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
+ GLuint nr, i;
+ const GLfloat a = ctx->Transform._ClipUserPlane[p][0];
+ const GLfloat b = ctx->Transform._ClipUserPlane[p][1];
+ const GLfloat c = ctx->Transform._ClipUserPlane[p][2];
+ const GLfloat d = ctx->Transform._ClipUserPlane[p][3];
+ GLfloat *coord = (GLfloat *)clip->data;
+ GLuint stride = clip->stride;
+ GLuint count = clip->count;
+
+ for (nr = 0, i = 0 ; i < count ; i++) {
+ GLfloat dp = (coord[0] * a +
+ coord[1] * b +
+ coord[2] * c +
+ coord[3] * d);
+
+ if (dp < 0) {
+ nr++;
+ clipmask[i] |= CLIP_USER_BIT;
+ }
+
+ STRIDE_F(coord, stride);
+ }
+
+ if (nr > 0) {
+ *clipormask |= CLIP_USER_BIT;
+ if (nr == count) {
+ *clipandmask |= CLIP_USER_BIT;
+ return;
+ }
+ }
+ }
+ }
+}
+
+
+static GLboolean
+do_ndc_cliptest(struct gl_context *ctx, struct vp_stage_data *store)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ /* Cliptest and perspective divide. Clip functions must clear
+ * the clipmask.
+ */
+ store->ormask = 0;
+ store->andmask = CLIP_FRUSTUM_BITS;
+
+ tnl_clip_prepare(ctx);
+
+ if (tnl->NeedNdcCoords) {
+ VB->NdcPtr =
+ _mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr,
+ &store->ndcCoords,
+ store->clipmask,
+ &store->ormask,
+ &store->andmask,
+ !ctx->Transform.DepthClamp );
+ }
+ else {
+ VB->NdcPtr = NULL;
+ _mesa_clip_np_tab[VB->ClipPtr->size]( VB->ClipPtr,
+ NULL,
+ store->clipmask,
+ &store->ormask,
+ &store->andmask,
+ !ctx->Transform.DepthClamp );
+ }
+
+ if (store->andmask) {
+ /* All vertices are outside the frustum */
+ return GL_FALSE;
+ }
+
+ /* Test userclip planes. This contributes to VB->ClipMask.
+ */
+ /** XXX NEW_SLANG _Enabled ??? */
+ if (ctx->Transform.ClipPlanesEnabled && (!ctx->VertexProgram._Enabled ||
+ ctx->VertexProgram.Current->IsPositionInvariant)) {
+ userclip( ctx,
+ VB->ClipPtr,
+ store->clipmask,
+ &store->ormask,
+ &store->andmask );
+
+ if (store->andmask) {
+ return GL_FALSE;
+ }
+ }
+
+ VB->ClipAndMask = store->andmask;
+ VB->ClipOrMask = store->ormask;
+ VB->ClipMask = store->clipmask;
+
+ return GL_TRUE;
+}
+
+
+/**
+ * XXX the texture sampling code in this module is a bit of a hack.
+ * The texture sampling code is in swrast, though it doesn't have any
+ * real dependencies on the rest of swrast. It should probably be
+ * moved into main/ someday.
+ */
+static void
+vp_fetch_texel(struct gl_context *ctx, const GLfloat texcoord[4], GLfloat lambda,
+ GLuint unit, GLfloat color[4])
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ /* XXX use a float-valued TextureSample routine here!!! */
+ swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current,
+ 1, (const GLfloat (*)[4]) texcoord,
+ &lambda, (GLfloat (*)[4]) color);
+}
+
+
+/**
+ * Called via ctx->Driver.ProgramStringNotify() after a new vertex program
+ * string has been parsed.
+ */
+GLboolean
+_tnl_program_string(struct gl_context *ctx, GLenum target, struct gl_program *program)
+{
+ /* No-op.
+ * If we had derived anything from the program that was private to this
+ * stage we'd recompute/validate it here.
+ */
+ return GL_TRUE;
+}
+
+
+/**
+ * Initialize virtual machine state prior to executing vertex program.
+ */
+static void
+init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
+ GLuint instID)
+{
+ /* Input registers get initialized from the current vertex attribs */
+ memcpy(machine->VertAttribs, ctx->Current.Attrib,
+ MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat));
+
+ if (ctx->VertexProgram._Current->IsNVProgram) {
+ GLuint i;
+ /* Output/result regs are initialized to [0,0,0,1] */
+ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) {
+ ASSIGN_4V(machine->Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F);
+ }
+ /* Temp regs are initialized to [0,0,0,0] */
+ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) {
+ ASSIGN_4V(machine->Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F);
+ }
+ for (i = 0; i < MAX_VERTEX_PROGRAM_ADDRESS_REGS; i++) {
+ ASSIGN_4V(machine->AddressReg[i], 0, 0, 0, 0);
+ }
+ }
+
+ machine->NumDeriv = 0;
+
+ /* init condition codes */
+ machine->CondCodes[0] = COND_EQ;
+ machine->CondCodes[1] = COND_EQ;
+ machine->CondCodes[2] = COND_EQ;
+ machine->CondCodes[3] = COND_EQ;
+
+ /* init call stack */
+ machine->StackDepth = 0;
+
+ machine->FetchTexelLod = vp_fetch_texel;
+ machine->FetchTexelDeriv = NULL; /* not used by vertex programs */
+
+ machine->Samplers = ctx->VertexProgram._Current->Base.SamplerUnits;
+
+ machine->SystemValues[SYSTEM_VALUE_INSTANCE_ID][0] = (GLfloat) instID;
+}
+
+
+/**
+ * Map the texture images which the vertex program will access (if any).
+ */
+static void
+map_textures(struct gl_context *ctx, const struct gl_vertex_program *vp)
+{
+ GLuint u;
+
+ if (!ctx->Driver.MapTexture)
+ return;
+
+ for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) {
+ if (vp->Base.TexturesUsed[u]) {
+ /* Note: _Current *should* correspond to the target indicated
+ * in TexturesUsed[u].
+ */
+ ctx->Driver.MapTexture(ctx, ctx->Texture.Unit[u]._Current);
+ }
+ }
+}
+
+
+/**
+ * Unmap the texture images which were used by the vertex program (if any).
+ */
+static void
+unmap_textures(struct gl_context *ctx, const struct gl_vertex_program *vp)
+{
+ GLuint u;
+
+ if (!ctx->Driver.MapTexture)
+ return;
+
+ for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) {
+ if (vp->Base.TexturesUsed[u]) {
+ /* Note: _Current *should* correspond to the target indicated
+ * in TexturesUsed[u].
+ */
+ ctx->Driver.UnmapTexture(ctx, ctx->Texture.Unit[u]._Current);
+ }
+ }
+}
+
+
+/**
+ * This function executes vertex programs
+ */
+static GLboolean
+run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vp_stage_data *store = VP_STAGE_DATA(stage);
+ struct vertex_buffer *VB = &tnl->vb;
+ struct gl_vertex_program *program = ctx->VertexProgram._Current;
+ struct gl_program_machine *machine = &store->machine;
+ GLuint outputs[VERT_RESULT_MAX], numOutputs;
+ GLuint i, j;
+
+ if (!program)
+ return GL_TRUE;
+
+ if (program->IsNVProgram) {
+ _mesa_load_tracked_matrices(ctx);
+ }
+ else {
+ /* ARB program or vertex shader */
+ _mesa_load_state_parameters(ctx, program->Base.Parameters);
+ }
+
+ /* make list of outputs to save some time below */
+ numOutputs = 0;
+ for (i = 0; i < VERT_RESULT_MAX; i++) {
+ if (program->Base.OutputsWritten & BITFIELD64_BIT(i)) {
+ outputs[numOutputs++] = i;
+
+ if (!store->results[i].data) {
+ _mesa_vector4f_alloc( &store->results[i], 0, VB->Size, 32 );
+ store->results[i].size = 4;
+ }
+ }
+ }
+
+ map_textures(ctx, program);
+
+ for (i = 0; i < VB->Count; i++) {
+ GLuint attr;
+
+ init_machine(ctx, machine, tnl->CurInstance);
+
+#if 0
+ printf("Input %d: %f, %f, %f, %f\n", i,
+ VB->AttribPtr[0]->data[i][0],
+ VB->AttribPtr[0]->data[i][1],
+ VB->AttribPtr[0]->data[i][2],
+ VB->AttribPtr[0]->data[i][3]);
+ printf(" color: %f, %f, %f, %f\n",
+ VB->AttribPtr[3]->data[i][0],
+ VB->AttribPtr[3]->data[i][1],
+ VB->AttribPtr[3]->data[i][2],
+ VB->AttribPtr[3]->data[i][3]);
+ printf(" normal: %f, %f, %f, %f\n",
+ VB->AttribPtr[2]->data[i][0],
+ VB->AttribPtr[2]->data[i][1],
+ VB->AttribPtr[2]->data[i][2],
+ VB->AttribPtr[2]->data[i][3]);
+#endif
+
+ /* the vertex array case */
+ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
+ if (program->Base.InputsRead & (1 << attr)) {
+ const GLubyte *ptr = (const GLubyte*) VB->AttribPtr[attr]->data;
+ const GLuint size = VB->AttribPtr[attr]->size;
+ const GLuint stride = VB->AttribPtr[attr]->stride;
+ const GLfloat *data = (GLfloat *) (ptr + stride * i);
+#ifdef NAN_CHECK
+ check_float(data[0]);
+ check_float(data[1]);
+ check_float(data[2]);
+ check_float(data[3]);
+#endif
+ COPY_CLEAN_4V(machine->VertAttribs[attr], size, data);
+ }
+ }
+
+ /* execute the program */
+ _mesa_execute_program(ctx, &program->Base, machine);
+
+ /* copy the output registers into the VB->attribs arrays */
+ for (j = 0; j < numOutputs; j++) {
+ const GLuint attr = outputs[j];
+#ifdef NAN_CHECK
+ check_float(machine->Outputs[attr][0]);
+ check_float(machine->Outputs[attr][1]);
+ check_float(machine->Outputs[attr][2]);
+ check_float(machine->Outputs[attr][3]);
+#endif
+ COPY_4V(store->results[attr].data[i], machine->Outputs[attr]);
+ }
+
+ /* FOGC is a special case. Fragment shader expects (f,0,0,1) */
+ if (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_FOGC)) {
+ store->results[VERT_RESULT_FOGC].data[i][1] = 0.0;
+ store->results[VERT_RESULT_FOGC].data[i][2] = 0.0;
+ store->results[VERT_RESULT_FOGC].data[i][3] = 1.0;
+ }
+#ifdef NAN_CHECK
+ ASSERT(machine->Outputs[0][3] != 0.0F);
+#endif
+#if 0
+ printf("HPOS: %f %f %f %f\n",
+ machine->Outputs[0][0],
+ machine->Outputs[0][1],
+ machine->Outputs[0][2],
+ machine->Outputs[0][3]);
+#endif
+ }
+
+ unmap_textures(ctx, program);
+
+ /* Fixup fog and point size results if needed */
+ if (program->IsNVProgram) {
+ if (ctx->Fog.Enabled &&
+ (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_FOGC)) == 0) {
+ for (i = 0; i < VB->Count; i++) {
+ store->results[VERT_RESULT_FOGC].data[i][0] = 1.0;
+ }
+ }
+
+ if (ctx->VertexProgram.PointSizeEnabled &&
+ (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) == 0) {
+ for (i = 0; i < VB->Count; i++) {
+ store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size;
+ }
+ }
+ }
+
+ if (program->IsPositionInvariant) {
+ /* We need the exact same transform as in the fixed function path here
+ * to guarantee invariance, depending on compiler optimization flags
+ * results could be different otherwise.
+ */
+ VB->ClipPtr = TransformRaw( &store->results[0],
+ &ctx->_ModelProjectMatrix,
+ VB->AttribPtr[0] );
+
+ /* Drivers expect this to be clean to element 4...
+ */
+ switch (VB->ClipPtr->size) {
+ case 1:
+ /* impossible */
+ case 2:
+ _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 );
+ /* fall-through */
+ case 3:
+ _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 3 );
+ /* fall-through */
+ case 4:
+ break;
+ }
+ }
+ else {
+ /* Setup the VB pointers so that the next pipeline stages get
+ * their data from the right place (the program output arrays).
+ */
+ VB->ClipPtr = &store->results[VERT_RESULT_HPOS];
+ VB->ClipPtr->size = 4;
+ VB->ClipPtr->count = VB->Count;
+ }
+
+ VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0];
+ VB->AttribPtr[VERT_ATTRIB_COLOR1] = &store->results[VERT_RESULT_COL1];
+ VB->AttribPtr[VERT_ATTRIB_FOG] = &store->results[VERT_RESULT_FOGC];
+ VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->results[VERT_RESULT_PSIZ];
+ VB->BackfaceColorPtr = &store->results[VERT_RESULT_BFC0];
+ VB->BackfaceSecondaryColorPtr = &store->results[VERT_RESULT_BFC1];
+
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
+ VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]
+ = &store->results[VERT_RESULT_TEX0 + i];
+ }
+
+ for (i = 0; i < ctx->Const.MaxVarying; i++) {
+ if (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_VAR0 + i)) {
+ /* Note: varying results get put into the generic attributes */
+ VB->AttribPtr[VERT_ATTRIB_GENERIC0+i]
+ = &store->results[VERT_RESULT_VAR0 + i];
+ }
+ }
+
+
+ /* Perform NDC and cliptest operations:
+ */
+ return do_ndc_cliptest(ctx, store);
+}
+
+
+/**
+ * Called the first time stage->run is called. In effect, don't
+ * allocate data until the first time the stage is run.
+ */
+static GLboolean
+init_vp(struct gl_context *ctx, struct tnl_pipeline_stage *stage)
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &(tnl->vb);
+ struct vp_stage_data *store;
+ const GLuint size = VB->Size;
+
+ stage->privatePtr = CALLOC(sizeof(*store));
+ store = VP_STAGE_DATA(stage);
+ if (!store)
+ return GL_FALSE;
+
+ /* a few other misc allocations */
+ _mesa_vector4f_alloc( &store->ndcCoords, 0, size, 32 );
+ store->clipmask = (GLubyte *) _mesa_align_malloc(sizeof(GLubyte)*size, 32 );
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Destructor for this pipeline stage.
+ */
+static void
+dtr(struct tnl_pipeline_stage *stage)
+{
+ struct vp_stage_data *store = VP_STAGE_DATA(stage);
+
+ if (store) {
+ GLuint i;
+
+ /* free the vertex program result arrays */
+ for (i = 0; i < VERT_RESULT_MAX; i++)
+ _mesa_vector4f_free( &store->results[i] );
+
+ /* free misc arrays */
+ _mesa_vector4f_free( &store->ndcCoords );
+ _mesa_align_free( store->clipmask );
+
+ FREE( store );
+ stage->privatePtr = NULL;
+ }
+}
+
+
+static void
+validate_vp_stage(struct gl_context *ctx, struct tnl_pipeline_stage *stage)
+{
+ if (ctx->VertexProgram._Current) {
+ _swrast_update_texture_samplers(ctx);
+ }
+}
+
+
+
+/**
+ * Public description of this pipeline stage.
+ */
+const struct tnl_pipeline_stage _tnl_vertex_program_stage =
+{
+ "vertex-program",
+ NULL, /* private_data */
+ init_vp, /* create */
+ dtr, /* destroy */
+ validate_vp_stage, /* validate */
+ run_vp /* run -- initially set to ctr */
+};
diff --git a/mesalib/src/mesa/tnl/t_vertex_generic.c b/mesalib/src/mesa/tnl/t_vertex_generic.c
index 9dcecdd57..7b7f511ce 100644
--- a/mesalib/src/mesa/tnl/t_vertex_generic.c
+++ b/mesalib/src/mesa/tnl/t_vertex_generic.c
@@ -47,7 +47,7 @@
* NDC->Viewport mapping and store the results at 'v'.
*/
-static INLINE void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
@@ -59,7 +59,7 @@ static INLINE void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLu
out[3] = in[3];
}
-static INLINE void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
@@ -71,7 +71,7 @@ static INLINE void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLu
out[3] = 1;
}
-static INLINE void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
@@ -83,7 +83,7 @@ static INLINE void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLu
out[3] = 1;
}
-static INLINE void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
@@ -95,7 +95,7 @@ static INLINE void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLu
out[3] = 1;
}
-static INLINE void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
@@ -106,7 +106,7 @@ static INLINE void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLu
out[2] = vp[10] * in[2] + vp[14];
}
-static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
@@ -117,7 +117,7 @@ static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLu
out[2] = vp[14];
}
-static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
@@ -128,7 +128,7 @@ static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLu
out[2] = vp[14];
}
-static INLINE void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
@@ -138,7 +138,7 @@ static INLINE void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLu
out[1] = vp[5] * in[1] + vp[13];
}
-static INLINE void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLfloat *out = (GLfloat *)v;
@@ -153,7 +153,7 @@ static INLINE void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLu
* These functions do the same as above, except for the viewport mapping.
*/
-static INLINE void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -164,7 +164,7 @@ static INLINE void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v,
out[3] = in[3];
}
-static INLINE void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -175,7 +175,7 @@ static INLINE void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v,
out[3] = 1;
}
-static INLINE void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -186,7 +186,7 @@ static INLINE void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v,
out[3] = 1;
}
-static INLINE void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -197,7 +197,7 @@ static INLINE void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
out[3] = 1;
}
-static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -207,14 +207,14 @@ static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte
out[2] = in[3];
}
-static INLINE void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
(void) a; (void) v; (void) in;
DEBUG_INSERT;
exit(1);
}
-static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -224,7 +224,7 @@ static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v,
out[2] = in[2];
}
-static INLINE void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -234,7 +234,7 @@ static INLINE void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v,
out[2] = 0;
}
-static INLINE void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -245,7 +245,7 @@ static INLINE void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
}
-static INLINE void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -254,7 +254,7 @@ static INLINE void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v,
out[1] = in[1];
}
-static INLINE void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -263,7 +263,7 @@ static INLINE void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
out[1] = 0;
}
-static INLINE void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
GLfloat *out = (GLfloat *)(v);
(void) a;
@@ -271,13 +271,13 @@ static INLINE void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
out[0] = in[0];
}
-static INLINE void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+static inline void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
{
DEBUG_INSERT;
(void) a; (void) v; (void) in;
}
-static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
@@ -289,7 +289,7 @@ static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, G
UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]);
}
-static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
@@ -301,7 +301,7 @@ static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, G
c[3] = CHAN_MAX;
}
-static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
@@ -313,7 +313,7 @@ static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, G
c[3] = CHAN_MAX;
}
-static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
GLchan *c = (GLchan *)v;
@@ -325,7 +325,7 @@ static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, G
c[3] = CHAN_MAX;
}
-static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -336,7 +336,7 @@ static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLu
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
}
-static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -347,7 +347,7 @@ static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLu
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -358,7 +358,7 @@ static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLu
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -369,7 +369,7 @@ static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLu
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -380,7 +380,7 @@ static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLu
UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
}
-static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -391,7 +391,7 @@ static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLu
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -402,7 +402,7 @@ static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLu
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -413,7 +413,7 @@ static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLu
v[3] = 0xff;
}
-static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -424,7 +424,7 @@ static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLu
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
}
-static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -435,7 +435,7 @@ static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLu
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -446,7 +446,7 @@ static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLu
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -457,7 +457,7 @@ static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLu
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -468,7 +468,7 @@ static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLu
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
}
-static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -479,7 +479,7 @@ static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLu
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -490,7 +490,7 @@ static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLu
v[0] = 0xff;
}
-static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -501,7 +501,7 @@ static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLu
v[0] = 0xff;
}
-static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -511,7 +511,7 @@ static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLub
UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
}
-static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -521,7 +521,7 @@ static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLub
v[2] = 0;
}
-static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -531,7 +531,7 @@ static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLub
v[2] = 0;
}
-static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -541,7 +541,7 @@ static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLub
UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
}
-static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -551,7 +551,7 @@ static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLub
v[0] = 0;
}
-static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
@@ -562,7 +562,7 @@ static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLub
}
-static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+static inline void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
const GLfloat *in )
{
DEBUG_INSERT;
diff --git a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
index e1023834a..0bf5c9165 100644
--- a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
+++ b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
@@ -59,12 +59,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define MAT_ATTR( A, N, V ) ATTR( A, N, (V)[0], (V)[1], (V)[2], (V)[3] )
-static INLINE float conv_ui10_to_norm_float(unsigned ui10)
+static inline float conv_ui10_to_norm_float(unsigned ui10)
{
return (float)(ui10) / 1023.0;
}
-static INLINE float conv_ui2_to_norm_float(unsigned ui2)
+static inline float conv_ui2_to_norm_float(unsigned ui2)
{
return (float)(ui2) / 3.0;
}
@@ -91,28 +91,28 @@ static INLINE float conv_ui2_to_norm_float(unsigned ui2)
struct attr_bits_10 {signed int x:10;};
struct attr_bits_2 {signed int x:2;};
-static INLINE float conv_i10_to_i(int i10)
+static inline float conv_i10_to_i(int i10)
{
struct attr_bits_10 val;
val.x = i10;
return (float)val.x;
}
-static INLINE float conv_i2_to_i(int i2)
+static inline float conv_i2_to_i(int i2)
{
struct attr_bits_2 val;
val.x = i2;
return (float)val.x;
}
-static INLINE float conv_i10_to_norm_float(int i10)
+static inline float conv_i10_to_norm_float(int i10)
{
struct attr_bits_10 val;
val.x = i10;
return (2.0F * (float)val.x + 1.0F) * (1.0F / 511.0F);
}
-static INLINE float conv_i2_to_norm_float(int i2)
+static inline float conv_i2_to_norm_float(int i2)
{
struct attr_bits_2 val;
val.x = i2;
diff --git a/mesalib/src/mesa/vbo/vbo_context.h b/mesalib/src/mesa/vbo/vbo_context.h
index df1d8c041..ef8a2a2b6 100644
--- a/mesalib/src/mesa/vbo/vbo_context.h
+++ b/mesalib/src/mesa/vbo/vbo_context.h
@@ -1,113 +1,113 @@
-/*
- * mesa 3-D graphics library
- * Version: 6.5
- *
- * Copyright (C) 1999-2006 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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 vbo_context.h
- * \brief VBO builder module datatypes and definitions.
- * \author Keith Whitwell
- */
-
-
-/**
- * \mainpage The VBO builder module
- *
- * This module hooks into the GL dispatch table and catches all vertex
- * building and drawing commands, such as glVertex3f, glBegin and
- * glDrawArrays. The module stores all incoming vertex data as arrays
- * in GL vertex buffer objects (VBOs), and translates all drawing
- * commands into calls to a driver supplied DrawPrimitives() callback.
- *
- * The module captures both immediate mode and display list drawing,
- * and manages the allocation, reference counting and deallocation of
- * vertex buffer objects itself.
- *
- * The DrawPrimitives() callback can be either implemented by the
- * driver itself or hooked to the tnl module's _tnl_draw_primitives()
- * function for hardware without tnl capablilties or during fallbacks.
- */
-
-
-#ifndef _VBO_CONTEXT_H
-#define _VBO_CONTEXT_H
-
-#include "main/mfeatures.h"
-#include "vbo.h"
-#include "vbo_attrib.h"
-#include "vbo_exec.h"
-#include "vbo_save.h"
-
-
-struct vbo_context {
- struct gl_client_array currval[VBO_ATTRIB_MAX];
-
- /* These point into the above. TODO: remove.
- */
- struct gl_client_array *legacy_currval;
- struct gl_client_array *generic_currval;
- struct gl_client_array *mat_currval;
-
- GLuint map_vp_none[VERT_ATTRIB_MAX];
- GLuint map_vp_arb[VERT_ATTRIB_MAX];
-
- GLfloat *current[VBO_ATTRIB_MAX]; /* points into ctx->Current, ctx->Light.Material */
- GLfloat CurrentFloatEdgeFlag;
-
-
- struct vbo_exec_context exec;
-#if FEATURE_dlist
- struct vbo_save_context save;
-#endif
-
- /* Callback into the driver. This must always succeed, the driver
- * is responsible for initiating any fallback actions required:
- */
- vbo_draw_func draw_prims;
-};
-
-
-static INLINE struct vbo_context *vbo_context(struct gl_context *ctx)
-{
- return (struct vbo_context *)(ctx->swtnl_im);
-}
-
-
-/**
- * Return VP_x token to indicate whether we're running fixed-function
- * vertex transformation, an NV vertex program or ARB vertex program/shader.
- */
-static INLINE enum vp_mode
-get_program_mode( struct gl_context *ctx )
-{
- if (!ctx->VertexProgram._Current)
- return VP_NONE;
- else if (ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram)
- return VP_NONE;
- else if (ctx->VertexProgram._Current->IsNVProgram)
- return VP_NV;
- else
- return VP_ARB;
-}
-
-
-#endif
+/*
+ * mesa 3-D graphics library
+ * Version: 6.5
+ *
+ * Copyright (C) 1999-2006 Brian Paul 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, sublicense,
+ * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL 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 vbo_context.h
+ * \brief VBO builder module datatypes and definitions.
+ * \author Keith Whitwell
+ */
+
+
+/**
+ * \mainpage The VBO builder module
+ *
+ * This module hooks into the GL dispatch table and catches all vertex
+ * building and drawing commands, such as glVertex3f, glBegin and
+ * glDrawArrays. The module stores all incoming vertex data as arrays
+ * in GL vertex buffer objects (VBOs), and translates all drawing
+ * commands into calls to a driver supplied DrawPrimitives() callback.
+ *
+ * The module captures both immediate mode and display list drawing,
+ * and manages the allocation, reference counting and deallocation of
+ * vertex buffer objects itself.
+ *
+ * The DrawPrimitives() callback can be either implemented by the
+ * driver itself or hooked to the tnl module's _tnl_draw_primitives()
+ * function for hardware without tnl capablilties or during fallbacks.
+ */
+
+
+#ifndef _VBO_CONTEXT_H
+#define _VBO_CONTEXT_H
+
+#include "main/mfeatures.h"
+#include "vbo.h"
+#include "vbo_attrib.h"
+#include "vbo_exec.h"
+#include "vbo_save.h"
+
+
+struct vbo_context {
+ struct gl_client_array currval[VBO_ATTRIB_MAX];
+
+ /* These point into the above. TODO: remove.
+ */
+ struct gl_client_array *legacy_currval;
+ struct gl_client_array *generic_currval;
+ struct gl_client_array *mat_currval;
+
+ GLuint map_vp_none[VERT_ATTRIB_MAX];
+ GLuint map_vp_arb[VERT_ATTRIB_MAX];
+
+ GLfloat *current[VBO_ATTRIB_MAX]; /* points into ctx->Current, ctx->Light.Material */
+ GLfloat CurrentFloatEdgeFlag;
+
+
+ struct vbo_exec_context exec;
+#if FEATURE_dlist
+ struct vbo_save_context save;
+#endif
+
+ /* Callback into the driver. This must always succeed, the driver
+ * is responsible for initiating any fallback actions required:
+ */
+ vbo_draw_func draw_prims;
+};
+
+
+static inline struct vbo_context *vbo_context(struct gl_context *ctx)
+{
+ return (struct vbo_context *)(ctx->swtnl_im);
+}
+
+
+/**
+ * Return VP_x token to indicate whether we're running fixed-function
+ * vertex transformation, an NV vertex program or ARB vertex program/shader.
+ */
+static inline enum vp_mode
+get_program_mode( struct gl_context *ctx )
+{
+ if (!ctx->VertexProgram._Current)
+ return VP_NONE;
+ else if (ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram)
+ return VP_NONE;
+ else if (ctx->VertexProgram._Current->IsNVProgram)
+ return VP_NV;
+ else
+ return VP_ARB;
+}
+
+
+#endif
diff --git a/mesalib/src/mesa/vbo/vbo_exec.h b/mesalib/src/mesa/vbo/vbo_exec.h
index d52a557e0..9a1b5a127 100644
--- a/mesalib/src/mesa/vbo/vbo_exec.h
+++ b/mesalib/src/mesa/vbo/vbo_exec.h
@@ -179,12 +179,12 @@ void vbo_exec_vtx_map( struct vbo_exec_context *exec );
#else /* FEATURE_beginend */
-static INLINE void
+static inline void
vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
{
}
-static INLINE void
+static inline void
vbo_exec_vtx_map( struct vbo_exec_context *exec )
{
}
diff --git a/mesalib/src/mesa/vbo/vbo_rebase.c b/mesalib/src/mesa/vbo/vbo_rebase.c
index a1eab752a..97c8d1297 100644
--- a/mesalib/src/mesa/vbo/vbo_rebase.c
+++ b/mesalib/src/mesa/vbo/vbo_rebase.c
@@ -78,7 +78,8 @@ GLboolean vbo_all_varyings_in_vbos( const struct gl_client_array *arrays[] )
GLuint i;
for (i = 0; i < VERT_ATTRIB_MAX; i++)
- if (arrays[i]->BufferObj->Name == 0)
+ if (arrays[i]->StrideB &&
+ arrays[i]->BufferObj->Name == 0)
return GL_FALSE;
return GL_TRUE;
diff --git a/mesalib/src/mesa/vbo/vbo_save.h b/mesalib/src/mesa/vbo/vbo_save.h
index 45cd29979..a064090cf 100644
--- a/mesalib/src/mesa/vbo/vbo_save.h
+++ b/mesalib/src/mesa/vbo/vbo_save.h
@@ -187,12 +187,12 @@ void vbo_save_api_init( struct vbo_save_context *save );
#else /* FEATURE_dlist */
-static INLINE void
+static inline void
vbo_save_init( struct gl_context *ctx )
{
}
-static INLINE void
+static inline void
vbo_save_destroy( struct gl_context *ctx )
{
}
diff --git a/mkfontscale/list.c b/mkfontscale/list.c
index a10b5ed4c..2854e181c 100644
--- a/mkfontscale/list.c
+++ b/mkfontscale/list.c
@@ -59,7 +59,7 @@ listAdjoin(char *car, ListPtr cdr)
}
char *
-dsprintf(char *f, ...)
+dsprintf(const char *f, ...)
{
va_list args;
char *string;
diff --git a/mkfontscale/list.h b/mkfontscale/list.h
index 686fd9b09..7403bc0f8 100644
--- a/mkfontscale/list.h
+++ b/mkfontscale/list.h
@@ -25,7 +25,7 @@
#include <X11/Xfuncproto.h> /* for _X_ATTRIBUTE_PRINTF */
-char *dsprintf(char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
+char *dsprintf(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
typedef struct _List {
char *value;
diff --git a/mkfontscale/mkfontscale.c b/mkfontscale/mkfontscale.c
index 31553cb5d..49bbe77a3 100644
--- a/mkfontscale/mkfontscale.c
+++ b/mkfontscale/mkfontscale.c
@@ -426,6 +426,8 @@ t1Weight(char *weight)
return NULL;
if(strcmp(weight, "Thin") == 0)
return "thin";
+ if(strcmp(weight, "ExtraLight") == 0) /* FontForge uses this for 200*/
+ return "extralight";
if(strcmp(weight, "Light") == 0)
return "light";
if(strcmp(weight, "Regular") == 0)
@@ -446,6 +448,8 @@ t1Weight(char *weight)
return "semibold";
else if(strcmp(weight, "Bold") == 0)
return "bold";
+ else if(strcmp(weight, "Heavy") == 0) /* FontForge uses this for 800*/
+ return "extrabold";
else if(strcmp(weight, "Black") == 0)
return "black";
else {
diff --git a/pixman/test/scaling-helpers-test.c b/pixman/test/scaling-helpers-test.c
index a8b94b0c7..33ec47c85 100644
--- a/pixman/test/scaling-helpers-test.c
+++ b/pixman/test/scaling-helpers-test.c
@@ -1,4 +1,3 @@
-#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
diff --git a/xorg-server/Xext/xcmisc.c b/xorg-server/Xext/xcmisc.c
index 8e3c9cd80..745135ed5 100644
--- a/xorg-server/Xext/xcmisc.c
+++ b/xorg-server/Xext/xcmisc.c
@@ -40,12 +40,7 @@ from The Open Group.
#include <X11/extensions/xcmiscproto.h>
#include "modinit.h"
-#if HAVE_STDINT_H
#include <stdint.h>
-#elif !defined(UINT32_MAX)
-#define UINT32_MAX 0xffffffffU
-#endif
-
static int
ProcXCMiscGetVersion(ClientPtr client)
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index f12ffa811..ea393d224 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -776,12 +776,9 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event)
for (i = 0; i <= last_valuator && i < v->numAxes; i++)
{
+ /* XXX: Relative/Absolute mode */
if (BitIsOn(&event->valuators.mask, i))
- {
- /* XXX: Relative/Absolute mode */
v->axisVal[i] = event->valuators.data[i];
- v->axisVal[i] += (event->valuators.data_frac[i] * 1.0f / (1 << 16) / (1 << 16));
- }
}
if (event->type == ET_KeyPress) {
@@ -1074,16 +1071,16 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev)
*
* @see InitValuatorClassDeviceStruct
*/
-void
+Bool
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval,
int resolution, int min_res, int max_res, int mode)
{
AxisInfoPtr ax;
- if (!dev || !dev->valuator || minval > maxval)
- return;
+ if (!dev || !dev->valuator || (minval > maxval && mode == Absolute))
+ return FALSE;
if (axnum >= dev->valuator->numAxes)
- return;
+ return FALSE;
ax = dev->valuator->axes + axnum;
@@ -1097,6 +1094,57 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int
if (mode & OutOfProximity)
dev->proximity->in_proximity = FALSE;
+
+ return SetScrollValuator(dev, axnum, SCROLL_TYPE_NONE, 0, SCROLL_FLAG_NONE);
+}
+
+/**
+ * Set the given axis number as a scrolling valuator.
+ */
+Bool
+SetScrollValuator(DeviceIntPtr dev, int axnum, enum ScrollType type, double increment, int flags)
+{
+ AxisInfoPtr ax;
+ int *current_ax;
+
+ if (!dev || !dev->valuator || axnum >= dev->valuator->numAxes)
+ return FALSE;
+
+ switch (type)
+ {
+ case SCROLL_TYPE_VERTICAL:
+ current_ax = &dev->valuator->v_scroll_axis;
+ break;
+ case SCROLL_TYPE_HORIZONTAL:
+ current_ax = &dev->valuator->h_scroll_axis;
+ break;
+ case SCROLL_TYPE_NONE:
+ ax = &dev->valuator->axes[axnum];
+ ax->scroll.type = type;
+ return TRUE;
+ default:
+ return FALSE;
+ }
+
+ if (increment == 0.0)
+ return FALSE;
+
+ if (*current_ax != -1 && axnum != *current_ax)
+ {
+ ax = &dev->valuator->axes[*current_ax];
+ if (ax->scroll.type == type &&
+ (flags & SCROLL_FLAG_PREFERRED) && (ax->scroll.flags & SCROLL_FLAG_PREFERRED))
+ return FALSE;
+ }
+ *current_ax = axnum;
+
+ ax = &dev->valuator->axes[axnum];
+ ax->scroll.type = type;
+ ax->scroll.increment = increment;
+ ax->scroll.flags = flags;
+ /* FIXME: generate DeviceChanged Events */
+
+ return TRUE;
}
static void
diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c
index fa0d81188..14f1491b6 100644
--- a/xorg-server/Xi/xiproperty.c
+++ b/xorg-server/Xi/xiproperty.c
@@ -52,11 +52,14 @@ static struct dev_properties
} dev_properties[] = {
{0, XI_PROP_ENABLED},
{0, XI_PROP_XTEST_DEVICE},
+
{0, XATOM_FLOAT},
+
{0, ACCEL_PROP_PROFILE_NUMBER},
{0, ACCEL_PROP_CONSTANT_DECELERATION},
{0, ACCEL_PROP_ADAPTIVE_DECELERATION},
{0, ACCEL_PROP_VELOCITY_SCALING},
+
{0, AXIS_LABEL_PROP},
{0, AXIS_LABEL_PROP_REL_X},
{0, AXIS_LABEL_PROP_REL_Y},
@@ -68,6 +71,8 @@ static struct dev_properties
{0, AXIS_LABEL_PROP_REL_DIAL},
{0, AXIS_LABEL_PROP_REL_WHEEL},
{0, AXIS_LABEL_PROP_REL_MISC},
+ {0, AXIS_LABEL_PROP_REL_VSCROLL},
+ {0, AXIS_LABEL_PROP_REL_HSCROLL},
{0, AXIS_LABEL_PROP_ABS_X},
{0, AXIS_LABEL_PROP_ABS_Y},
{0, AXIS_LABEL_PROP_ABS_Z},
diff --git a/xorg-server/Xi/xiquerydevice.c b/xorg-server/Xi/xiquerydevice.c
index 902eb918c..9961d1b6f 100644
--- a/xorg-server/Xi/xiquerydevice.c
+++ b/xorg-server/Xi/xiquerydevice.c
@@ -229,7 +229,16 @@ SizeDeviceClasses(DeviceIntPtr dev)
}
if (dev->valuator)
- len += sizeof(xXIValuatorInfo) * dev->valuator->numAxes;
+ {
+ int i;
+ len += (sizeof(xXIValuatorInfo)) * dev->valuator->numAxes;
+
+ for (i = 0; i < dev->valuator->numAxes; i++) {
+ if (dev->valuator->axes[i].scroll.type != SCROLL_TYPE_NONE)
+ len += sizeof(xXIScrollInfo);
+ }
+ }
+
return len;
}
@@ -369,6 +378,56 @@ SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info)
swaps(&info->sourceid);
}
+int
+ListScrollInfo(DeviceIntPtr dev, xXIScrollInfo *info, int axisnumber)
+{
+ ValuatorClassPtr v = dev->valuator;
+ AxisInfoPtr axis = &v->axes[axisnumber];
+
+ if (axis->scroll.type == SCROLL_TYPE_NONE)
+ return 0;
+
+ info->type = XIScrollClass;
+ info->length = sizeof(xXIScrollInfo)/4;
+ info->number = axisnumber;
+ switch(axis->scroll.type)
+ {
+ case SCROLL_TYPE_VERTICAL:
+ info->scroll_type = XIScrollTypeVertical;
+ break;
+ case SCROLL_TYPE_HORIZONTAL:
+ info->scroll_type = XIScrollTypeHorizontal;
+ break;
+ default:
+ ErrorF("[Xi] Unknown scroll type %d. This is a bug.\n", axis->scroll.type);
+ break;
+ }
+ info->increment.integral = (int)axis->scroll.increment;
+ info->increment.frac = (unsigned int)(axis->scroll.increment * (1UL << 16) * (1UL << 16));
+ info->sourceid = v->sourceid;
+
+ info->flags = 0;
+
+ if (axis->scroll.flags & SCROLL_FLAG_DONT_EMULATE)
+ info->flags |= XIScrollFlagNoEmulation;
+ if (axis->scroll.flags & SCROLL_FLAG_PREFERRED)
+ info->flags |= XIScrollFlagPreferred;
+
+ return info->length * 4;
+}
+
+static void
+SwapScrollInfo(DeviceIntPtr dev, xXIScrollInfo* info)
+{
+ swaps(&info->type);
+ swaps(&info->length);
+ swaps(&info->number);
+ swaps(&info->sourceid);
+ swaps(&info->scroll_type);
+ swapl(&info->increment.integral);
+ swapl(&info->increment.frac);
+}
+
int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
{
DeviceIntPtr master = GetMaster(dev, MASTER_ATTACHED);
@@ -458,6 +517,15 @@ ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
total_len += len;
}
+ for (i = 0; dev->valuator && i < dev->valuator->numAxes; i++)
+ {
+ len = ListScrollInfo(dev, (xXIScrollInfo*)any, i);
+ if (len)
+ (*nclasses)++;
+ any += len;
+ total_len += len;
+ }
+
return total_len;
}
@@ -484,6 +552,9 @@ SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
case XIValuatorClass:
SwapValuatorInfo(dev, (xXIValuatorInfo*)any);
break;
+ case XIScrollClass:
+ SwapScrollInfo(dev, (xXIScrollInfo*)any);
+ break;
}
any += len * 4;
diff --git a/xorg-server/Xi/xiquerydevice.h b/xorg-server/Xi/xiquerydevice.h
index 02f06591e..9db6aa293 100644
--- a/xorg-server/Xi/xiquerydevice.h
+++ b/xorg-server/Xi/xiquerydevice.h
@@ -44,4 +44,5 @@ int ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState);
int ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info);
int ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info,
int axisnumber, Bool reportState);
+int ListScrollInfo(DeviceIntPtr dev, xXIScrollInfo* info, int axisnumber);
#endif /* QUERYDEV_H */
diff --git a/xorg-server/Xi/xiwarppointer.c b/xorg-server/Xi/xiwarppointer.c
index 8fcb4d16b..11ab241b5 100644
--- a/xorg-server/Xi/xiwarppointer.c
+++ b/xorg-server/Xi/xiwarppointer.c
@@ -190,8 +190,6 @@ ProcXIWarpPointer(ClientPtr client)
/* if we don't update the device, we get a jump next time it moves */
pDev->last.valuators[0] = x;
pDev->last.valuators[1] = y;
- pDev->last.remainder[0] = 0;
- pDev->last.remainder[1] = 0;
miPointerUpdateSprite(pDev);
/* FIXME: XWarpPointer is supposed to generate an event. It doesn't do it
diff --git a/xorg-server/config/Makefile.am b/xorg-server/config/Makefile.am
index 72d22346b..69bdcf730 100644
--- a/xorg-server/config/Makefile.am
+++ b/xorg-server/config/Makefile.am
@@ -1,41 +1,47 @@
-AM_CFLAGS = $(DIX_CFLAGS)
-
-noinst_LTLIBRARIES = libconfig.la
-libconfig_la_SOURCES = config.c config-backends.h
-
-if CONFIG_UDEV
-
-AM_CFLAGS += $(UDEV_CFLAGS)
-libconfig_la_SOURCES += udev.c
-libconfig_la_LIBADD = $(UDEV_LIBS)
-
-if XORG
-xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR)
-xorgconfd_DATA = 10-evdev.conf
-endif
-
-else
-
-if CONFIG_NEED_DBUS
-AM_CFLAGS += $(DBUS_CFLAGS)
-libconfig_la_SOURCES += dbus-core.c
-libconfig_la_LIBADD = $(DBUS_LIBS)
-
-if CONFIG_DBUS_API
-dbusconfigdir = $(sysconfdir)/dbus-1/system.d
-dbusconfig_DATA = xorg-server.conf
-
-libconfig_la_SOURCES += dbus.c
-endif
-
-if CONFIG_HAL
-AM_CFLAGS += $(HAL_CFLAGS)
-libconfig_la_SOURCES += hal.c
-libconfig_la_LIBADD += $(HAL_LIBS)
-endif
-
-endif # CONFIG_NEED_DBUS
-
-endif # !CONFIG_UDEV
-
-EXTRA_DIST = xorg-server.conf x11-input.fdi 10-evdev.conf fdi2iclass.py
+AM_CFLAGS = $(DIX_CFLAGS)
+
+noinst_LTLIBRARIES = libconfig.la
+libconfig_la_SOURCES = config.c config-backends.h
+
+if CONFIG_UDEV
+
+AM_CFLAGS += $(UDEV_CFLAGS)
+libconfig_la_SOURCES += udev.c
+libconfig_la_LIBADD = $(UDEV_LIBS)
+
+if XORG
+xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR)
+xorgconfd_DATA = 10-evdev.conf
+endif
+
+else
+
+if CONFIG_NEED_DBUS
+AM_CFLAGS += $(DBUS_CFLAGS)
+libconfig_la_SOURCES += dbus-core.c
+libconfig_la_LIBADD = $(DBUS_LIBS)
+
+if CONFIG_DBUS_API
+dbusconfigdir = $(sysconfdir)/dbus-1/system.d
+dbusconfig_DATA = xorg-server.conf
+
+libconfig_la_SOURCES += dbus.c
+endif
+
+if CONFIG_HAL
+AM_CFLAGS += $(HAL_CFLAGS)
+libconfig_la_SOURCES += hal.c
+libconfig_la_LIBADD += $(HAL_LIBS)
+endif
+
+else
+
+if CONFIG_WSCONS
+libconfig_la_SOURCES += wscons.c
+endif # CONFIG_WSCONS
+
+endif # CONFIG_NEED_DBUS
+
+endif # !CONFIG_UDEV
+
+EXTRA_DIST = xorg-server.conf x11-input.fdi 10-evdev.conf fdi2iclass.py
diff --git a/xorg-server/config/config-backends.h b/xorg-server/config/config-backends.h
index 35ab8a044..10743c38a 100644
--- a/xorg-server/config/config-backends.h
+++ b/xorg-server/config/config-backends.h
@@ -68,3 +68,8 @@ int config_hal_init(void);
void config_hal_fini(void);
# endif
#endif
+
+#ifdef CONFIG_WSCONS
+int config_wscons_init(void);
+void config_wscons_fini(void);
+#endif
diff --git a/xorg-server/config/config.c b/xorg-server/config/config.c
index 9c28785c6..0dae3ad68 100644
--- a/xorg-server/config/config.c
+++ b/xorg-server/config/config.c
@@ -52,6 +52,9 @@ config_init(void)
else {
ErrorF("[config] failed to initialise D-Bus core\n");
}
+#elif defined(CONFIG_WSCONS)
+ if (!config_wscons_init())
+ ErrorF("[config] failed to initialise wscons\n");
#endif
}
@@ -68,6 +71,8 @@ config_fini(void)
config_dbus_fini();
# endif
config_dbus_core_fini();
+#elif defined(CONFIG_WSCONS)
+ config_wscons_fini();
#endif
}
diff --git a/xorg-server/config/udev.c b/xorg-server/config/udev.c
index 1ba0d500d..e2b3726cc 100644
--- a/xorg-server/config/udev.c
+++ b/xorg-server/config/udev.c
@@ -285,8 +285,10 @@ config_udev_init(void)
udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "input", NULL);
udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL); /* For Wacom serial devices */
+#ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
if (SeatId && strcmp(SeatId, "seat0"))
udev_monitor_filter_add_match_tag(udev_monitor, SeatId);
+#endif
if (udev_monitor_enable_receiving(udev_monitor)) {
ErrorF("config/udev: failed to bind the udev monitor\n");
@@ -300,8 +302,10 @@ config_udev_init(void)
udev_enumerate_add_match_subsystem(enumerate, "input");
udev_enumerate_add_match_subsystem(enumerate, "tty");
+#ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
if (SeatId && strcmp(SeatId, "seat0"))
udev_enumerate_add_match_tag(enumerate, SeatId);
+#endif
udev_enumerate_scan_devices(enumerate);
devices = udev_enumerate_get_list_entry(enumerate);
diff --git a/xorg-server/config/wscons.c b/xorg-server/config/wscons.c
new file mode 100644
index 000000000..27c1f6348
--- /dev/null
+++ b/xorg-server/config/wscons.c
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2011 Matthieu Herrb
+ *
+ * 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, sublicense,
+ * 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wsksymdef.h>
+
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "input.h"
+#include "inputstr.h"
+#include "os.h"
+#include "config-backends.h"
+
+#define WSCONS_KBD_DEVICE "/dev/wskbd"
+#define WSCONS_MOUSE_PREFIX "/dev/wsmouse"
+
+#define KB_OVRENC \
+ { KB_UK, "gb" }, \
+ { KB_SV, "se" }, \
+ { KB_SG, "ch" }, \
+ { KB_SF, "ch" }, \
+ { KB_LA, "latam" }, \
+ { KB_CF, "ca" }
+
+struct nameint {
+ int val;
+ char *name;
+} kbdenc[] = { KB_OVRENC, KB_ENCTAB, { 0 } };
+
+struct nameint kbdvar[] = {
+ { KB_NODEAD | KB_SG, "de_nodeadkeys" },
+ { KB_NODEAD | KB_SF, "fr_nodeadkeys" },
+ { KB_SF, "fr" },
+ { KB_DVORAK | KB_CF, "fr-dvorak" },
+ { KB_DVORAK | KB_FR, "bepo" },
+ { KB_DVORAK, "dvorak" },
+ { KB_CF, "fr-legacy" },
+ { KB_NODEAD, "nodeadkeys" },
+ { 0 }
+};
+
+struct nameint kbdopt[] = {
+ { KB_SWAPCTRLCAPS, "ctrl:swapcaps" },
+ { 0 }
+};
+
+struct nameint kbdmodel[] = {
+ { WSKBD_TYPE_ZAURUS, "zaurus" },
+ { 0 }
+};
+
+static void
+wscons_add_keyboard(void)
+{
+ InputAttributes attrs = {};
+ DeviceIntPtr dev = NULL;
+ InputOption *input_options = NULL;
+ char *config_info = NULL;
+ int fd, i, rc;
+ unsigned int type;
+ kbd_t wsenc = 0;
+
+ /* Find keyboard configuration */
+ fd = open(WSCONS_KBD_DEVICE, O_RDWR | O_NONBLOCK | O_EXCL);
+ if (fd == -1) {
+ LogMessage(X_ERROR, "wskbd: open %s: %s\n",
+ WSCONS_KBD_DEVICE, strerror(errno));
+ return;
+ }
+ if (ioctl(fd, WSKBDIO_GETENCODING, &wsenc) == -1) {
+ LogMessage(X_WARNING, "wskbd: ioctl(WSKBDIO_GETENCODING) "
+ "failed: %s\n", strerror(errno));
+ close(fd);
+ return;
+ }
+ if (ioctl(fd, WSKBDIO_GTYPE, &type) == -1) {
+ LogMessage(X_WARNING, "wskbd: ioctl(WSKBDIO_GTYPE) "
+ "failed: %s\n", strerror(errno));
+ close(fd);
+ return;
+ }
+ close (fd);
+
+ input_options = input_option_new(input_options, "_source",
+ "server/wscons");
+ if (input_options == NULL)
+ return;
+
+ LogMessage(X_INFO, "config/wscons: checking input device %s\n",
+ WSCONS_KBD_DEVICE);
+ input_options = input_option_new(input_options, "name",
+ WSCONS_KBD_DEVICE);
+ input_options = input_option_new(input_options, "driver", "kbd");
+
+ config_info = Xprintf("wscons:%s", WSCONS_KBD_DEVICE);
+ if (!config_info)
+ goto unwind;
+ if (KB_ENCODING(wsenc) == KB_USER) {
+ /* Ignore wscons "user" layout */
+ LogMessageVerb(X_INFO, 3, "wskbd: ignoring \"user\" layout\n");
+ goto kbd_config_done;
+ }
+ for (i = 0; kbdenc[i].val; i++)
+ if(KB_ENCODING(wsenc) == kbdenc[i].val) {
+ LogMessageVerb(X_INFO, 3, "wskbd: using layout %s\n",
+ kbdenc[i].name);
+ input_options = input_option_new(input_options,
+ "xkb_layout", kbdenc[i].name);
+ break;
+ }
+ for (i = 0; kbdvar[i].val; i++)
+ if (wsenc == kbdvar[i].val ||
+ KB_VARIANT(wsenc) == kbdvar[i].val) {
+ LogMessageVerb(X_INFO, 3, "wskbd: using variant %s\n",
+ kbdvar[i].name);
+ input_options = input_option_new(input_options,
+ "xkb_variant", kbdvar[i].name);
+ break;
+ }
+ for (i = 0; kbdopt[i].val; i++)
+ if (KB_VARIANT(wsenc) == kbdopt[i].val) {
+ LogMessageVerb(X_INFO, 3, "wskbd: using option %s\n",
+ kbdopt[i].name);
+ input_options = input_option_new(input_options,
+ "xkb_options", kbdopt[i].name);
+ break;
+ }
+ for (i = 0; kbdmodel[i].val; i++)
+ if (type == kbdmodel[i].val) {
+ LogMessageVerb(X_INFO, 3, "wskbd: using model %s\n",
+ kbdmodel[i].name);
+ input_options = input_option_new(input_options,
+ "xkb_model", kbdmodel[i].name);
+ break;
+ }
+
+kbd_config_done:
+ attrs.flags |= ATTR_KEYBOARD;
+ rc = NewInputDeviceRequest(input_options, &attrs, &dev);
+ if (rc != Success)
+ goto unwind;
+
+ for (; dev; dev = dev->next) {
+ free(dev->config_info);
+ dev->config_info = strdup(config_info);
+ }
+unwind:
+ input_option_free_list(&input_options);
+}
+
+static void
+wscons_add_pointer(const char *path, const char *driver, int flags)
+{
+ InputAttributes attrs = {};
+ DeviceIntPtr dev = NULL;
+ InputOption *input_options = NULL;
+ char *config_info = NULL;
+ int rc;
+
+ config_info = Xprintf("wscons:%s", path);
+ if (!config_info)
+ return;
+
+ input_options = input_option_new(input_options, "_source",
+ "server/wscons");
+ if (input_options == NULL)
+ return;
+
+ input_options = input_option_new(input_options, "name",
+ strdup(path));
+ input_options = input_option_new(input_options, "driver",
+ strdup(driver));
+ input_options = input_option_new(input_options, "device",
+ strdup(path));
+ LogMessage(X_INFO, "config/wscons: checking input device %s\n", path);
+ attrs.flags |= flags;
+ rc = NewInputDeviceRequest(input_options, &attrs, &dev);
+ if (rc != Success)
+ goto unwind;
+
+ for (; dev; dev = dev->next) {
+ free(dev->config_info);
+ dev->config_info = strdup(config_info);
+ }
+unwind:
+ input_option_free_list(&input_options);
+}
+
+static void
+wscons_add_pointers(void)
+{
+ char devname[256];
+ int fd, i, wsmouse_type;
+
+ /* Check pointing devices */
+ for (i = 0; i < 4; i++) {
+ snprintf(devname, sizeof(devname), "%s%d",
+ WSCONS_MOUSE_PREFIX, i);
+ LogMessageVerb(X_INFO, 10, "wsmouse: checking %s\n", devname);
+ fd = open_device(devnamem O_RDWR | O_NONBLOCK | O_EXCL);
+ if (fd == -1) {
+ LogMessageVerb(X_WARNING, 10, "%s: %s\n", devname,
+ strerror(errno));
+ continue;
+ }
+ if (ioctl(fd, WSMOUSEIO_GTYPE, &wsmouse_type) != 0) {
+ LogMessageVerb(X_WARNING, 10,
+ "%s: WSMOUSEIO_GTYPE failed\n", devname);
+ close(fd);
+ continue;
+ }
+ close(fd);
+ switch (wsmouse_type) {
+ case WSMOUSE_TYPE_SYNAPTICS:
+ wscons_add_pointer(devname, "synaptics",
+ ATTR_TOUCHPAD);
+ break;
+ case WSMOUSE_TYPE_TPANEL:
+ wscons_add_pointer(devname, "ws", ATTR_TOUCHSCREEN);
+ break;
+ default:
+ break;
+ }
+ }
+ /* Add a default entry catching all other mux elements as "mouse" */
+ wscons_add_pointer(WSCONS_MOUSE_PREFIX, "mouse", ATTR_POINTER);
+}
+
+int
+config_wscons_init(void)
+{
+ wscons_add_keyboard();
+ wscons_add_pointers();
+ return 1;
+}
+
+void
+config_wscons_fini(void)
+{
+ /* Not much to do ? */
+}
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
index b0d26435a..67a683620 100644
--- a/xorg-server/configure.ac
+++ b/xorg-server/configure.ac
@@ -629,6 +629,7 @@ AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS exten
AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto])
AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no])
AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
+AC_ARG_ENABLE(config-wscons, AS_HELP_STRING([--enable-config-wscons], [Build wscons config support (default: auto)]), [CONFIG_WSCONS=$enableval], [CONFIG_WSCONS=auto])
AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
AC_ARG_ENABLE(xaa, AS_HELP_STRING([--enable-xaa], [Build XAA (default: enabled)]), [XAA=$enableval], [XAA=yes])
AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes])
@@ -723,7 +724,7 @@ case $host_os in
AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework Carbon"
- AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}],
+ AC_LINK_IFELSE([AC_LANG_SOURCE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}])],
[xorg_cv_Carbon_framework=yes],
[xorg_cv_Carbon_framework=no])
LDFLAGS=$save_LDFLAGS])
@@ -778,7 +779,7 @@ WINDOWSWMPROTO="windowswmproto"
APPLEWMPROTO="applewmproto >= 1.4"
dnl Core modules for most extensions, et al.
-SDK_REQUIRED_MODULES="[xproto >= 7.0.22] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto"
+SDK_REQUIRED_MODULES="[xproto >= 7.0.22] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 2.0.99.1] [kbproto >= 1.0.3] fontsproto"
# Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
AC_SUBST(SDK_REQUIRED_MODULES)
@@ -822,6 +823,15 @@ if test "x$CONFIG_UDEV" = xyes; then
AC_MSG_ERROR([udev configuration API requested, but libudev is not installed])
fi
AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug])
+
+ SAVE_LIBS=$LIBS
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS=$UDEV_CFLAGS
+ LIBS=$UDEV_LIBS
+ AC_CHECK_FUNCS([udev_monitor_filter_add_match_tag])
+ AC_CHECK_FUNCS([udev_enumerate_add_match_tag])
+ LIBS=$SAVE_LIBS
+ CFLAGS=$SAVE_CFLAGS
fi
dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
@@ -865,6 +875,21 @@ if test "x$CONFIG_NEED_DBUS" = xyes; then
fi
AM_CONDITIONAL(CONFIG_NEED_DBUS, [test "x$CONFIG_NEED_DBUS" = xyes])
+if test "x$CONFIG_WSCONS" = xauto; then
+ case $host_os in
+ *openbsd*)
+ CONFIG_WSCONS=yes;
+ ;;
+ *)
+ CONFIG_WSCONS=no;
+ ;;
+ esac
+fi
+AM_CONDITIONAL(CONFIG_WSCONS, [test "x$CONFIG_WSCONS" = xyes])
+if test "x$CONFIG_WSCONS" = xyes; then
+ AC_DEFINE(CONFIG_WSCONS, 1, [Use wscons for input auto configuration])
+fi
+
if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then
USE_SIGIO_BY_DEFAULT_VALUE=TRUE
else
@@ -874,12 +899,12 @@ AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE],
[Use SIGIO handlers for input device events by default])
AC_MSG_CHECKING([for glibc...])
-AC_PREPROC_IFELSE([
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#include <features.h>
#ifndef __GLIBC__
#error
#endif
-], glibc=yes, glibc=no)
+])], glibc=yes, glibc=no)
AC_MSG_RESULT([$glibc])
AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes],
@@ -903,7 +928,7 @@ if ! test "x$have_clock_gettime" = xno; then
CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
fi
- AC_RUN_IFELSE([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([
#include <time.h>
int main(int argc, char *argv[[]]) {
@@ -914,7 +939,7 @@ int main(int argc, char *argv[[]]) {
else
return 1;
}
- ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
+ ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
[MONOTONIC_CLOCK="cross compiling"])
LIBS="$LIBS_SAVE"
diff --git a/xorg-server/dbe/dbe.c b/xorg-server/dbe/dbe.c
index 86d8220b8..a46867676 100644
--- a/xorg-server/dbe/dbe.c
+++ b/xorg-server/dbe/dbe.c
@@ -38,12 +38,7 @@
#endif
#include <string.h>
-#if HAVE_STDINT_H
#include <stdint.h>
-#elif !defined(UINT32_MAX)
-#define UINT32_MAX 0xffffffffU
-#endif
-
#include <X11/X.h>
#include <X11/Xproto.h>
#include "scrnintstr.h"
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index b6f7ea697..73c4d1460 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -264,6 +264,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
offsetof(DeviceIntRec, devPrivates), PRIVATE_DEVICE);
if (!dev)
return (DeviceIntPtr)NULL;
+
+ dev->last.scroll = NULL;
dev->id = devid;
dev->public.processInputProc = ProcessOtherEvent;
dev->public.realInputProc = ProcessOtherEvent;
@@ -943,6 +945,7 @@ CloseDevice(DeviceIntPtr dev)
free(dev->deviceGrab.sync.event);
free(dev->config_info); /* Allocated in xf86ActivateDevice. */
+ free(dev->last.scroll);
dev->config_info = NULL;
dixFreeObjectWithPrivates(dev, PRIVATE_DEVICE);
}
@@ -1285,10 +1288,19 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
if (!valc)
return FALSE;
+ dev->last.scroll = valuator_mask_new(numAxes);
+ if (!dev->last.scroll)
+ {
+ free(valc);
+ return FALSE;
+ }
+
valc->sourceid = dev->id;
valc->motion = NULL;
valc->first_motion = 0;
valc->last_motion = 0;
+ valc->h_scroll_axis = -1;
+ valc->v_scroll_axis = -1;
valc->numMotionEvents = numMotionEvents;
valc->motionHintWindow = NullWindow;
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c
index 45655de78..efc3c09ce 100644
--- a/xorg-server/dix/dixfonts.c
+++ b/xorg-server/dix/dixfonts.c
@@ -1332,31 +1332,30 @@ doPolyText(ClientPtr client, PTclosurePtr c)
goto bail;
}
*new_closure = *c;
- c = new_closure;
- len = c->endReq - c->pElt;
- c->data = malloc(len);
- if (!c->data)
+ len = new_closure->endReq - new_closure->pElt;
+ new_closure->data = malloc(len);
+ if (!new_closure->data)
{
- free(c);
+ free(new_closure);
err = BadAlloc;
goto bail;
}
- memmove(c->data, c->pElt, len);
- c->pElt = c->data;
- c->endReq = c->pElt + len;
+ memmove(new_closure->data, new_closure->pElt, len);
+ new_closure->pElt = new_closure->data;
+ new_closure->endReq = new_closure->pElt + len;
/* Step 2 */
- pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
+ pGC = GetScratchGC(new_closure->pGC->depth, new_closure->pGC->pScreen);
if (!pGC)
{
- free(c->data);
- free(c);
+ free(new_closure->data);
+ free(new_closure);
err = BadAlloc;
goto bail;
}
- if ((err = CopyGC(c->pGC, pGC, GCFunction |
+ if ((err = CopyGC(new_closure->pGC, pGC, GCFunction |
GCPlaneMask | GCForeground |
GCBackground | GCFillStyle |
GCTile | GCStipple |
@@ -1367,15 +1366,16 @@ doPolyText(ClientPtr client, PTclosurePtr c)
Success)
{
FreeScratchGC(pGC);
- free(c->data);
- free(c);
+ free(new_closure->data);
+ free(new_closure);
err = BadAlloc;
goto bail;
}
+ c = new_closure;
origGC = c->pGC;
c->pGC = pGC;
ValidateGC(c->pDraw, c->pGC);
-
+
ClientSleep(client, (ClientSleepProcPtr)doPolyText, c);
/* Set up to perform steps 3 and 4 */
diff --git a/xorg-server/dix/eventconvert.c b/xorg-server/dix/eventconvert.c
index dafe94207..47108fd70 100644
--- a/xorg-server/dix/eventconvert.c
+++ b/xorg-server/dix/eventconvert.c
@@ -605,6 +605,7 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
xde->root_x = FP1616(ev->root_x, ev->root_x_frac);
xde->root_y = FP1616(ev->root_y, ev->root_y_frac);
+ xde->flags = ev->flags;
if (ev->key_repeat)
xde->flags |= XIKeyRepeat;
@@ -632,8 +633,9 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
if (BitIsOn(ev->valuators.mask, i))
{
SetBit(ptr, i);
- axisval->integral = ev->valuators.data[i];
- axisval->frac = ev->valuators.data_frac[i];
+ axisval->integral = trunc(ev->valuators.data[i]);
+ axisval->frac = (ev->valuators.data[i] - axisval->integral) *
+ (1 << 16) * (1 << 16);
axisval++;
}
}
@@ -648,7 +650,7 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
int vallen, nvals;
int i, len = sizeof(xXIRawEvent);
char *ptr;
- FP3232 *axisval;
+ FP3232 *axisval, *axisval_raw;
nvals = count_bits(ev->valuators.mask, sizeof(ev->valuators.mask));
len += nvals * sizeof(FP3232) * 2; /* 8 byte per valuator, once
@@ -666,19 +668,25 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
raw->detail = ev->detail.button;
raw->deviceid = ev->deviceid;
raw->valuators_len = vallen;
+ raw->flags = ev->flags;
ptr = (char*)&raw[1];
axisval = (FP3232*)(ptr + raw->valuators_len * 4);
+ axisval_raw = axisval + nvals;
for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
{
if (BitIsOn(ev->valuators.mask, i))
{
SetBit(ptr, i);
- axisval->integral = ev->valuators.data[i];
- axisval->frac = ev->valuators.data_frac[i];
- (axisval + nvals)->integral = ev->valuators.data_raw[i];
- (axisval + nvals)->frac = ev->valuators.data_raw_frac[i];
+ axisval->integral = trunc(ev->valuators.data[i]);
+ axisval->frac = (ev->valuators.data[i] - axisval->integral) *
+ (1 << 16) * (1 << 16);
+ axisval_raw->integral = trunc(ev->valuators.data_raw[i]);
+ axisval_raw->frac =
+ (ev->valuators.data_raw[i] - axisval_raw->integral) *
+ (1 << 16) * (1 << 16);
axisval++;
+ axisval_raw++;
}
}
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index 97fae6923..c5f435c11 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -2271,33 +2271,93 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
return nondeliveries;
}
+/**
+ * Filter out raw events for XI 2.0 and XI 2.1 clients.
+ *
+ * If there is a grab on the device, 2.0 clients only get raw events if they
+ * have the grab. 2.1+ clients get raw events in all cases.
+ *
+ * @return TRUE if the event should be discarded, FALSE otherwise.
+ */
+static BOOL
+FilterRawEvents(const ClientPtr client, const GrabPtr grab)
+{
+ XIClientPtr client_xi_version;
+ int cmp;
+
+ /* device not grabbed -> don't filter */
+ if (!grab)
+ return FALSE;
+
+ client_xi_version = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
+
+ cmp = version_compare(client_xi_version->major_version,
+ client_xi_version->minor_version, 2, 0);
+ /* XI 2.0: if device is grabbed, skip
+ XI 2.1: if device is grabbed by us, skip, we've already delivered */
+ return (cmp == 0) ? TRUE : SameClient(grab, client);
+}
+
+/**
+ * Deliver a raw event to the grab owner (if any) and to all root windows.
+ *
+ * Raw event delivery differs between XI 2.0 and XI 2.1.
+ * XI 2.0: events delivered to the grabbing client (if any) OR to all root
+ * windows
+ * XI 2.1: events delivered to all root windows, regardless of grabbing
+ * state.
+ */
void
DeliverRawEvent(RawDeviceEvent *ev, DeviceIntPtr device)
{
GrabPtr grab = device->deviceGrab.grab;
+ xEvent *xi;
+ int i, rc;
+ int filter;
+
+ rc = EventToXI2((InternalEvent*)ev, (xEvent**)&xi);
+ if (rc != Success)
+ {
+ ErrorF("[Xi] %s: XI2 conversion failed in %s (%d)\n",
+ __FUNCTION__, device->name, rc);
+ return;
+ }
if (grab)
DeliverGrabbedEvent((InternalEvent*)ev, device, FALSE);
- else { /* deliver to all root windows */
- xEvent *xi;
- int i;
- int filter;
- i = EventToXI2((InternalEvent*)ev, (xEvent**)&xi);
- if (i != Success)
- {
- ErrorF("[Xi] %s: XI2 conversion failed in %s (%d)\n",
- __FUNCTION__, device->name, i);
- return;
- }
+ filter = GetEventFilter(device, xi);
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ {
+ WindowPtr root;
+ InputClients *inputclients;
- filter = GetEventFilter(device, xi);
+ root = screenInfo.screens[i]->root;
+ if (!GetClientsForDelivery(device, root, xi, filter, &inputclients))
+ continue;
- for (i = 0; i < screenInfo.numScreens; i++)
- DeliverEventsToWindow(device, screenInfo.screens[i]->root, xi, 1,
- filter, NullGrab);
- free(xi);
+ for (; inputclients; inputclients = inputclients->next)
+ {
+ ClientPtr c; /* unused */
+ Mask m; /* unused */
+ InputClients ic = *inputclients;
+
+ /* Because we run through the list manually, copy the actual
+ * list, shorten the copy to only have one client and then pass
+ * that down to DeliverEventToInputClients. This way we avoid
+ * double events on XI 2.1 clients that have a grab on the
+ * device.
+ */
+ ic.next = NULL;
+
+ if (!FilterRawEvents(rClient(&ic), grab))
+ DeliverEventToInputClients(device, &ic, root, xi, 1,
+ filter, NULL, &c, &m);
+ }
}
+
+ free(xi);
}
/* If the event goes to dontClient, don't send it and return 0. if
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c
index 6208a63af..374843f68 100644
--- a/xorg-server/dix/getevents.c
+++ b/xorg-server/dix/getevents.c
@@ -2,6 +2,7 @@
* Copyright © 2006 Nokia Corporation
* Copyright © 2006-2007 Daniel Stone
* Copyright © 2008 Red Hat, Inc.
+ * Copyright © 2011 The Chromium Authors
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -58,6 +59,7 @@
#endif
#include <X11/extensions/XI.h>
+#include <X11/extensions/XI2.h>
#include <X11/extensions/XIproto.h>
#include <pixman.h>
#include "exglobals.h"
@@ -182,7 +184,7 @@ init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail)
}
static void
-set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask, int32_t* data)
+set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask, double* data)
{
int i;
@@ -191,7 +193,7 @@ set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask, int32_t* data)
if (valuator_mask_isset(mask, i))
{
SetBit(event->valuators.mask, i);
- data[i] = valuator_mask_get(mask, i);
+ data[i] = valuator_mask_get_double(mask, i);
}
}
}
@@ -211,9 +213,7 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask)
SetBit(event->valuators.mask, i);
if (valuator_get_mode(dev, i) == Absolute)
SetBit(event->valuators.mode, i);
- event->valuators.data[i] = valuator_mask_get(mask, i);
- event->valuators.data_frac[i] =
- dev->last.remainder[i] * (1 << 16) * (1 << 16);
+ event->valuators.data[i] = valuator_mask_get_double(mask, i);
}
else if (valuator_get_mode(dev, i) == Absolute)
event->valuators.data[i] = dev->valuator->axisVal[i];
@@ -270,39 +270,29 @@ CreateClassesChangedEvent(InternalEvent* event,
/**
* Rescale the coord between the two axis ranges.
*/
-static int
-rescaleValuatorAxis(int coord, float remainder, float *remainder_return, AxisInfoPtr from, AxisInfoPtr to,
- int defmax)
+static double
+rescaleValuatorAxis(double coord, AxisInfoPtr from, AxisInfoPtr to,
+ double defmax)
{
- int fmin = 0, tmin = 0, fmax = defmax, tmax = defmax, coord_return;
- float value;
+ double fmin = 0.0, fmax = defmax;
+ double tmin = 0.0, tmax = defmax;
- if(from && from->min_value < from->max_value) {
+ if (from && from->min_value < from->max_value) {
fmin = from->min_value;
fmax = from->max_value;
}
- if(to && to->min_value < to->max_value) {
+ if (to && to->min_value < to->max_value) {
tmin = to->min_value;
tmax = to->max_value;
}
- if(fmin == tmin && fmax == tmax) {
- if (remainder_return)
- *remainder_return = remainder;
+ if (fmin == tmin && fmax == tmax)
return coord;
- }
- if(fmax == fmin) { /* avoid division by 0 */
- if (remainder_return)
- *remainder_return = 0.0;
- return 0;
- }
+ if (fmax == fmin) /* avoid division by 0 */
+ return 0.0;
- value = (coord + remainder - fmin) * (tmax - tmin) / (fmax - fmin) + tmin;
- coord_return = lroundf(value);
- if (remainder_return)
- *remainder_return = value - coord_return;
- return coord_return;
+ return (coord - fmin) * (tmax - tmin) / (fmax - fmin) + tmin;
}
/**
@@ -324,19 +314,25 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
* position of the pointer */
pDev->last.valuators[0] = master->last.valuators[0];
pDev->last.valuators[1] = master->last.valuators[1];
- pDev->last.remainder[0] = master->last.remainder[0];
- pDev->last.remainder[1] = master->last.remainder[1];
if (!pDev->valuator)
return;
/* scale back to device coordinates */
if(pDev->valuator->numAxes > 0)
- pDev->last.valuators[0] = rescaleValuatorAxis(pDev->last.valuators[0], pDev->last.remainder[0],
- &pDev->last.remainder[0], NULL, pDev->valuator->axes + 0, scr->width);
+ {
+ pDev->last.valuators[0] = rescaleValuatorAxis(pDev->last.valuators[0],
+ NULL,
+ pDev->valuator->axes + 0,
+ scr->width);
+ }
if(pDev->valuator->numAxes > 1)
- pDev->last.valuators[1] = rescaleValuatorAxis(pDev->last.valuators[1], pDev->last.remainder[1],
- &pDev->last.remainder[1], NULL, pDev->valuator->axes + 1, scr->height);
+ {
+ pDev->last.valuators[1] = rescaleValuatorAxis(pDev->last.valuators[1],
+ NULL,
+ pDev->valuator->axes + 1,
+ scr->height);
+ }
/* calculate the other axis as well based on info from the old
* slave-device. If the old slave had less axes than this one,
@@ -347,16 +343,13 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
if (i >= lastSlave->valuator->numAxes)
{
pDev->last.valuators[i] = 0;
- pDev->last.remainder[i] = 0;
}
else
{
- pDev->last.valuators[i] =
- rescaleValuatorAxis(pDev->last.valuators[i],
- pDev->last.remainder[i],
- &pDev->last.remainder[i],
- lastSlave->valuator->axes + i,
- pDev->valuator->axes + i, 0);
+ double val = pDev->last.valuators[i];
+ val = rescaleValuatorAxis(val, lastSlave->valuator->axes + i,
+ pDev->valuator->axes + i, 0);
+ pDev->last.valuators[i] = val;
}
}
}
@@ -467,7 +460,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start,
/* scale to screen coords */
to = &core_axis;
to->max_value = pScreen->width;
- coord = rescaleValuatorAxis(coord, 0.0, NULL, &from, to, pScreen->width);
+ coord = rescaleValuatorAxis(coord, &from, to, pScreen->width);
memcpy(corebuf, &coord, sizeof(INT16));
corebuf++;
@@ -478,7 +471,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start,
memcpy(&coord, icbuf++, sizeof(INT32));
to->max_value = pScreen->height;
- coord = rescaleValuatorAxis(coord, 0.0, NULL, &from, to, pScreen->height);
+ coord = rescaleValuatorAxis(coord, &from, to, pScreen->height);
memcpy(corebuf, &coord, sizeof(INT16));
} else if (IsMaster(pDev))
@@ -506,7 +499,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start,
from.max_value = pScreen->height;
/* scale from stored range into current range */
- coord = rescaleValuatorAxis(coord, 0.0, NULL, &from, to, 0);
+ coord = rescaleValuatorAxis(coord, &from, to, 0);
memcpy(ocbuf, &coord, sizeof(INT32));
ocbuf++;
}
@@ -540,7 +533,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start,
*/
static void
updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
- int *valuators)
+ double *valuators)
{
char *buff = (char *) pDev->valuator->motion;
ValuatorClassPtr v;
@@ -562,6 +555,7 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
for (i = 0; i < v->numAxes; i++)
{
+ int val;
/* XI1 doesn't support mixed mode devices */
if (valuator_get_mode(pDev, i) != valuator_get_mode(pDev, 0))
break;
@@ -574,7 +568,8 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
buff += sizeof(INT32);
memcpy(buff, &v->axes[i].max_value, sizeof(INT32));
buff += sizeof(INT32);
- memcpy(buff, &valuators[i], sizeof(INT32));
+ val = valuators[i];
+ memcpy(buff, &val, sizeof(INT32));
buff += sizeof(INT32);
}
} else
@@ -590,12 +585,14 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
for (i = 0; i < MAX_VALUATORS; i++)
{
+ int val;
if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i))
{
buff += sizeof(INT32);
continue;
}
- memcpy(buff, &valuators[i], sizeof(INT32));
+ val = valuators[i];
+ memcpy(buff, &val, sizeof(INT32));
buff += sizeof(INT32);
}
}
@@ -622,8 +619,10 @@ GetMaximumEventsNum(void) {
/* One raw event
* One device event
* One possible device changed event
+ * Lots of possible separate button scroll events (horiz + vert)
+ * Lots of possible separate raw button scroll events (horiz + vert)
*/
- return 3;
+ return 100;
}
@@ -632,7 +631,7 @@ GetMaximumEventsNum(void) {
* InitValuatorAxisClassStruct.
*/
static void
-clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
+clipAxis(DeviceIntPtr pDev, int axisNum, double *val)
{
AxisInfoPtr axis;
@@ -662,9 +661,9 @@ clipValuators(DeviceIntPtr pDev, ValuatorMask *mask)
for (i = 0; i < valuator_mask_size(mask); i++)
if (valuator_mask_isset(mask, i))
{
- int val = valuator_mask_get(mask, i);
+ double val = valuator_mask_get_double(mask, i);
clipAxis(pDev, i, &val);
- valuator_mask_set(mask, i, val);
+ valuator_mask_set_double(mask, i, val);
}
}
@@ -705,85 +704,52 @@ UpdateFromMaster(InternalEvent* events, DeviceIntPtr dev, int type, int *num_eve
/**
* Move the device's pointer to the position given in the valuators.
*
- * @param dev The device which's pointer is to be moved.
- * @param x Returns the x position of the pointer after the move.
- * @param y Returns the y position of the pointer after the move.
- * @param mask Bit mask of valid valuators.
- * @param valuators Valuator data for each axis between @first and
- * @first+@num.
+ * @param dev The device whose pointer is to be moved.
+ * @param mask Valuator data for this event.
*/
static void
-moveAbsolute(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
+moveAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
{
int i;
- if (valuator_mask_isset(mask, 0))
- *x = valuator_mask_get(mask, 0);
- else
- *x = dev->last.valuators[0];
-
- if (valuator_mask_isset(mask, 1))
- *y = valuator_mask_get(mask, 1);
- else
- *y = dev->last.valuators[1];
-
- clipAxis(dev, 0, x);
- clipAxis(dev, 1, y);
-
- for (i = 2; i < valuator_mask_size(mask); i++)
+ for (i = 0; i < valuator_mask_size(mask); i++)
{
- if (valuator_mask_isset(mask, i))
- {
- dev->last.valuators[i] = valuator_mask_get(mask, i);
- clipAxis(dev, i, &dev->last.valuators[i]);
- }
+ double val;
+
+ if (!valuator_mask_isset(mask, i))
+ continue;
+ val = valuator_mask_get_double(mask, i);
+ clipAxis(dev, i, &val);
+ valuator_mask_set_double(mask, i, val);
}
}
/**
* Move the device's pointer by the values given in @valuators.
*
- * @param dev The device which's pointer is to be moved.
- * @param x Returns the x position of the pointer after the move.
- * @param y Returns the y position of the pointer after the move.
- * @param mask Bit mask of valid valuators.
- * @param valuators Valuator data for each axis between @first and
- * @first+@num.
+ * @param dev The device whose pointer is to be moved.
+ * @param mask Valuator data for this event.
*/
static void
-moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
+moveRelative(DeviceIntPtr dev, ValuatorMask *mask)
{
int i;
-
- *x = dev->last.valuators[0];
- *y = dev->last.valuators[1];
-
- if (valuator_mask_isset(mask, 0))
- *x += valuator_mask_get(mask, 0);
-
- if (valuator_mask_isset(mask, 1))
- *y += valuator_mask_get(mask, 1);
-
- /* if attached, clip both x and y to the defined limits (usually
- * co-ord space limit). If it is attached, we need x/y to go over the
- * limits to be able to change screens. */
- if (dev->valuator && (IsMaster(dev) || !IsFloating(dev))) {
- if (valuator_get_mode(dev, 0) == Absolute)
- clipAxis(dev, 0, x);
- if (valuator_get_mode(dev, 1) == Absolute)
- clipAxis(dev, 1, y);
- }
+ Bool clip_xy = IsMaster(dev) || !IsFloating(dev);
/* calc other axes, clip, drop back into valuators */
- for (i = 2; i < valuator_mask_size(mask); i++)
+ for (i = 0; i < valuator_mask_size(mask); i++)
{
- if (valuator_mask_isset(mask, i))
- {
- dev->last.valuators[i] += valuator_mask_get(mask, i);
- if (valuator_get_mode(dev, i) == Absolute)
- clipAxis(dev, i, &dev->last.valuators[i]);
- valuator_mask_set(mask, i, dev->last.valuators[i]);
- }
+ double val = dev->last.valuators[i];
+
+ if (!valuator_mask_isset(mask, i))
+ continue;
+ val += valuator_mask_get_double(mask, i);
+ /* x & y need to go over the limits to cross screens if the SD
+ * isn't currently attached; otherwise, clip to screen bounds. */
+ if (valuator_get_mode(dev, i) == Absolute &&
+ ((i != 0 && i != 1) || clip_xy))
+ clipAxis(dev, i, &val);
+ valuator_mask_set_double(mask, i, val);
}
}
@@ -814,89 +780,68 @@ accelPointer(DeviceIntPtr dev, ValuatorMask* valuators, CARD32 ms)
*
* @param dev The device to be moved.
* @param mode Movement mode (Absolute or Relative)
- * @param x Pointer to current x-axis value, may be modified.
- * @param y Pointer to current y-axis value, may be modified.
- * @param x_frac Fractional part of current x-axis value, may be modified.
- * @param y_frac Fractional part of current y-axis value, may be modified.
* @param scr Screen the device's sprite is currently on.
+ * @param mask Mask of axis values for this event
* @param screenx Screen x coordinate the sprite is on after the update.
* @param screeny Screen y coordinate the sprite is on after the update.
- * @param screenx_frac Fractional part of screen x coordinate, as above.
- * @param screeny_frac Fractional part of screen y coordinate, as above.
*/
static void
-positionSprite(DeviceIntPtr dev, int mode,
- int *x, int *y, float x_frac, float y_frac,
- ScreenPtr scr, int *screenx, int *screeny, float *screenx_frac, float *screeny_frac)
+positionSprite(DeviceIntPtr dev, int mode, ScreenPtr scr, ValuatorMask *mask,
+ double *screenx, double *screeny)
{
- int old_screenx, old_screeny;
+ int isx, isy; /* screen {x, y}, in int */
+ double x, y;
- /* scale x&y to screen */
- if (dev->valuator && dev->valuator->numAxes > 0) {
- *screenx = rescaleValuatorAxis(*x, x_frac, screenx_frac,
- dev->valuator->axes + 0, NULL, scr->width);
- } else {
- *screenx = dev->last.valuators[0];
- *screenx_frac = dev->last.remainder[0];
- }
+ if (!dev->valuator || dev->valuator->numAxes < 2)
+ return;
- if (dev->valuator && dev->valuator->numAxes > 1) {
- *screeny = rescaleValuatorAxis(*y, y_frac, screeny_frac,
- dev->valuator->axes + 1, NULL, scr->height);
- } else {
- *screeny = dev->last.valuators[1];
- *screeny_frac = dev->last.remainder[1];
- }
+ if (valuator_mask_isset(mask, 0))
+ x = valuator_mask_get_double(mask, 0);
+ else
+ x = dev->last.valuators[0];
+ if (valuator_mask_isset(mask, 1))
+ y = valuator_mask_get_double(mask, 1);
+ else
+ y = dev->last.valuators[1];
- /* Hit the left screen edge? */
- if (*screenx <= 0 && *screenx_frac < 0.0f)
+ /* scale x&y to screen */
+ *screenx = rescaleValuatorAxis(x, dev->valuator->axes + 0, NULL,
+ scr->width);
+ *screeny = rescaleValuatorAxis(y, dev->valuator->axes + 1, NULL,
+ scr->height);
+
+ /* miPointerSetPosition takes care of crossing screens for us, as well as
+ * clipping to the current screen. In the event we actually change screen,
+ * we just drop the float component on the floor, then convert from
+ * screenx back into device co-ordinates. */
+ isx = trunc(*screenx);
+ isy = trunc(*screeny);
+ miPointerSetPosition(dev, mode, &isx, &isy);
+ scr = miPointerGetScreen(dev);
+ if (isx != trunc(*screenx))
{
- *screenx_frac = 0.0f;
- x_frac = 0.0f;
+ *screenx -= trunc(*screenx) - isx;
+ x = rescaleValuatorAxis(*screenx, NULL, dev->valuator->axes + 0,
+ scr->width);
}
- if (*screeny <= 0 && *screeny_frac < 0.0f)
+ if (isy != trunc(*screeny))
{
- *screeny_frac = 0.0f;
- y_frac = 0.0f;
+ *screeny -= trunc(*screeny) - isy;
+ y = rescaleValuatorAxis(*screeny, NULL, dev->valuator->axes + 1,
+ scr->height);
}
-
- old_screenx = *screenx;
- old_screeny = *screeny;
- /* This takes care of crossing screens for us, as well as clipping
- * to the current screen. */
- miPointerSetPosition(dev, mode, screenx, screeny);
-
- if(!IsMaster(dev) && !IsFloating(dev)) {
+ /* Update the MD's co-ordinates, which are always in screen space. */
+ if (!IsMaster(dev) || !IsFloating(dev)) {
DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
master->last.valuators[0] = *screenx;
master->last.valuators[1] = *screeny;
- master->last.remainder[0] = *screenx_frac;
- master->last.remainder[1] = *screeny_frac;
- }
-
- if (dev->valuator)
- {
- /* Crossed screen? Scale back to device coordiantes */
- if(*screenx != old_screenx)
- {
- scr = miPointerGetScreen(dev);
- *x = rescaleValuatorAxis(*screenx, *screenx_frac, &x_frac, NULL,
- dev->valuator->axes + 0, scr->width);
- }
- if(*screeny != old_screeny)
- {
- scr = miPointerGetScreen(dev);
- *y = rescaleValuatorAxis(*screeny, *screeny_frac, &y_frac, NULL,
- dev->valuator->axes + 1, scr->height);
- }
}
- /* dropy x/y (device coordinates) back into valuators for next event */
- dev->last.valuators[0] = *x;
- dev->last.valuators[1] = *y;
- dev->last.remainder[0] = x_frac;
- dev->last.remainder[1] = y_frac;
+ if (valuator_mask_isset(mask, 0))
+ valuator_mask_set_double(mask, 0, x);
+ if (valuator_mask_isset(mask, 1))
+ valuator_mask_set_double(mask, 1, y);
}
/**
@@ -1060,7 +1005,7 @@ FreeEventList(InternalEvent *list, int num_events)
* back into x/y.
*/
static void
-transform(struct pixman_f_transform *m, int *x, int *y)
+transform(struct pixman_f_transform *m, double *x, double *y)
{
struct pixman_f_vector p;
@@ -1071,27 +1016,32 @@ transform(struct pixman_f_transform *m, int *x, int *y)
pixman_f_transform_point(m, &p);
- *x = lround(p.v[0]);
- *y = lround(p.v[1]);
+ *x = p.v[0];
+ *y = p.v[1];
}
static void
transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
{
- int x, y, ox, oy;
+ double x, y, ox, oy;
+
+ if (valuator_mask_isset(mask, 0))
+ ox = x = valuator_mask_get_double(mask, 0);
+ else
+ ox = x = dev->last.valuators[0];
- ox = x = valuator_mask_isset(mask, 0) ? valuator_mask_get(mask, 0) :
- dev->last.valuators[0];
- oy = y = valuator_mask_isset(mask, 1) ? valuator_mask_get(mask, 1) :
- dev->last.valuators[1];
+ if (valuator_mask_isset(mask, 1))
+ oy = y = valuator_mask_get_double(mask, 1);
+ else
+ oy = y = dev->last.valuators[1];
transform(&dev->transform, &x, &y);
if (valuator_mask_isset(mask, 0) || ox != x)
- valuator_mask_set(mask, 0, x);
+ valuator_mask_set_double(mask, 0, x);
if (valuator_mask_isset(mask, 1) || oy != y)
- valuator_mask_set(mask, 1, y);
+ valuator_mask_set_double(mask, 1, y);
}
/**
@@ -1118,42 +1068,25 @@ QueuePointerEvents(DeviceIntPtr device, int type,
}
/**
- * Generate a series of InternalEvents representing pointer motion, or
- * button presses.
- *
- * The DDX is responsible for allocating the events in the first
- * place via InitEventList() and GetMaximumEventsNum(), and for freeing it.
- *
- * In the generated events rootX/Y will be in absolute screen coords and
- * the valuator information in the absolute or relative device coords.
- *
- * last.valuators[x] of the device is always in absolute device coords.
- * last.valuators[x] of the master device is in absolute screen coords.
+ * Helper function for GetPointerEvents, which only generates motion and
+ * raw motion events for the slave device: does not update the master device.
*
- * master->last.valuators[x] for x > 2 is undefined.
+ * Should not be called by anyone other than GetPointerEvents.
*
* @return the number of events written into events.
*/
-int
-GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons,
- int flags, const ValuatorMask *mask_in) {
- int num_events = 1;
- CARD32 ms;
+static int
+fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
+ int buttons, CARD32 ms, int flags,
+ const ValuatorMask *mask_in)
+{
+ int num_events = 1, i;
DeviceEvent *event;
- RawDeviceEvent *raw;
- int x = 0, y = 0, /* device coords */
- cx, cy; /* only screen coordinates */
- float x_frac = 0.0, y_frac = 0.0, cx_frac, cy_frac;
+ RawDeviceEvent *raw;
+ double screenx = 0.0, screeny = 0.0;
ScreenPtr scr = miPointerGetScreen(pDev);
ValuatorMask mask;
- /* refuse events from disabled devices */
- if (!pDev->enabled)
- return 0;
-
- if (!scr)
- return 0;
-
switch (type)
{
case MotionNotify:
@@ -1169,10 +1102,6 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
return 0;
}
- ms = GetTimeInMillis(); /* before pointer update to help precision */
-
- events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
-
valuator_mask_copy(&mask, mask_in);
if ((flags & POINTER_NORAW) == 0)
@@ -1182,61 +1111,54 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
num_events++;
init_raw(pDev, raw, ms, type, buttons);
- set_raw_valuators(raw, &mask, raw->valuators.data_raw);
+ set_raw_valuators(raw, &mask, raw->valuators.data_raw);
}
if (flags & POINTER_ABSOLUTE)
{
if (flags & POINTER_SCREEN) /* valuators are in screen coords */
{
- int scaled;
+ double scaled;
if (valuator_mask_isset(&mask, 0))
{
- scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 0),
- 0.0, &x_frac, NULL,
- pDev->valuator->axes + 0,
+ scaled = rescaleValuatorAxis(valuator_mask_get_double(&mask, 0),
+ NULL, pDev->valuator->axes + 0,
scr->width);
- valuator_mask_set(&mask, 0, scaled);
+ valuator_mask_set_double(&mask, 0, scaled);
}
if (valuator_mask_isset(&mask, 1))
{
- scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 1),
- 0.0, &y_frac, NULL,
- pDev->valuator->axes + 1,
+ scaled = rescaleValuatorAxis(valuator_mask_get_double(&mask, 1),
+ NULL, pDev->valuator->axes + 1,
scr->height);
- valuator_mask_set(&mask, 1, scaled);
+ valuator_mask_set_double(&mask, 1, scaled);
}
}
transformAbsolute(pDev, &mask);
- moveAbsolute(pDev, &x, &y, &mask);
+ moveAbsolute(pDev, &mask);
} else {
- if (flags & POINTER_ACCELERATE) {
+ if (flags & POINTER_ACCELERATE)
accelPointer(pDev, &mask, ms);
- /* The pointer acceleration code modifies the fractional part
- * in-place, so we need to extract this information first */
- x_frac = pDev->last.remainder[0];
- y_frac = pDev->last.remainder[1];
- }
- moveRelative(pDev, &x, &y, &mask);
+ moveRelative(pDev, &mask);
}
if ((flags & POINTER_NORAW) == 0)
- set_raw_valuators(raw, &mask, raw->valuators.data);
+ set_raw_valuators(raw, &mask, raw->valuators.data);
- positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
- &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
+ positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative, scr,
+ &mask, &screenx, &screeny);
updateHistory(pDev, &mask, ms);
- /* Update the valuators with the true value sent to the client*/
- if (valuator_mask_isset(&mask, 0))
- valuator_mask_set(&mask, 0, x);
- if (valuator_mask_isset(&mask, 1))
- valuator_mask_set(&mask, 1, y);
-
clipValuators(pDev, &mask);
+ for (i = 0; i < valuator_mask_size(&mask); i++)
+ {
+ if (valuator_mask_isset(&mask, i))
+ pDev->last.valuators[i] = valuator_mask_get_double(&mask, i);
+ }
+
event = &events->device_event;
init_device_event(event, pDev, ms);
@@ -1256,10 +1178,16 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
event->detail.button = buttons;
}
- event->root_x = cx; /* root_x/y always in screen coords */
- event->root_y = cy;
- event->root_x_frac = cx_frac;
- event->root_y_frac = cy_frac;
+ /* root_x and root_y must be in screen co-ordinates */
+ event->root_x = trunc(screenx);
+ event->root_y = trunc(screeny);
+ event->root_x_frac = screenx - trunc(screenx);
+ event->root_y_frac = screeny - trunc(screeny);
+
+ if (flags & POINTER_EMULATED) {
+ raw->flags = XIPointerEmulated;
+ event->flags = XIPointerEmulated;
+ }
set_valuators(pDev, event, &mask);
@@ -1267,6 +1195,204 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
}
/**
+ * Generate events for each scroll axis that changed between before/after
+ * for the device.
+ *
+ * @param events The pointer to the event list to fill the events
+ * @param dev The device to generate the events for
+ * @param axis The axis number to generate events for
+ * @param mask State before this event in absolute coords
+ * @param[in,out] last Last scroll state posted in absolute coords (modified
+ * in-place)
+ * @param ms Current time in ms
+ * @param max_events Max number of events to be generated
+ * @return The number of events generated
+ */
+static int
+emulate_scroll_button_events(InternalEvent *events,
+ DeviceIntPtr dev,
+ int axis,
+ const ValuatorMask *mask,
+ ValuatorMask *last,
+ CARD32 ms,
+ int max_events)
+{
+ AxisInfoPtr ax;
+ double delta;
+ double incr;
+ int num_events = 0;
+ double total;
+ int b;
+
+ if (dev->valuator->axes[axis].scroll.type == SCROLL_TYPE_NONE)
+ return 0;
+
+ if (!valuator_mask_isset(mask, axis))
+ return 0;
+
+ ax = &dev->valuator->axes[axis];
+ incr = ax->scroll.increment;
+
+ if (!valuator_mask_isset(last, axis))
+ valuator_mask_set_double(last, axis, 0);
+
+ delta = valuator_mask_get_double(mask, axis) - valuator_mask_get_double(last, axis);
+ total = delta;
+ b = (ax->scroll.type == SCROLL_TYPE_VERTICAL) ? 5 : 7;
+
+ if ((incr > 0 && delta < 0) ||
+ (incr < 0 && delta > 0))
+ b--; /* we're scrolling up or left → button 4 or 6 */
+
+ while (fabs(delta) >= fabs(incr))
+ {
+ int nev_tmp;
+
+ if (delta > 0)
+ delta -= fabs(incr);
+ else if (delta < 0)
+ delta += fabs(incr);
+
+ /* fill_pointer_events() generates four events: one normal and one raw
+ * event for button press and button release.
+ * We may get a bigger scroll delta than we can generate events
+ * for. In that case, we keep decreasing delta, but skip events.
+ */
+ if (num_events + 4 < max_events)
+ {
+ nev_tmp = fill_pointer_events(events, dev, ButtonPress, b, ms,
+ POINTER_EMULATED, NULL);
+ events += nev_tmp;
+ num_events += nev_tmp;
+ nev_tmp = fill_pointer_events(events, dev, ButtonRelease, b, ms,
+ POINTER_EMULATED, NULL);
+ events += nev_tmp;
+ num_events += nev_tmp;
+ }
+ }
+
+ /* We emulated, update last.scroll */
+ if (total != delta)
+ {
+ total -= delta;
+ valuator_mask_set_double(last, axis,
+ valuator_mask_get_double(last, axis) + total);
+ }
+
+ return num_events;
+}
+
+
+/**
+ * Generate a complete series of InternalEvents (filled into the EventList)
+ * representing pointer motion, or button presses. If the device is a slave
+ * device, also potentially generate a DeviceClassesChangedEvent to update
+ * the master device.
+ *
+ * events is not NULL-terminated; the return value is the number of events.
+ * The DDX is responsible for allocating the event structure in the first
+ * place via InitEventList() and GetMaximumEventsNum(), and for freeing it.
+ *
+ * In the generated events rootX/Y will be in absolute screen coords and
+ * the valuator information in the absolute or relative device coords.
+ *
+ * last.valuators[x] of the device is always in absolute device coords.
+ * last.valuators[x] of the master device is in absolute screen coords.
+ *
+ * master->last.valuators[x] for x > 2 is undefined.
+ */
+int
+GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
+ int buttons, int flags, const ValuatorMask *mask_in)
+{
+ CARD32 ms = GetTimeInMillis();
+ int num_events = 0, nev_tmp;
+ int h_scroll_axis = pDev->valuator->h_scroll_axis;
+ int v_scroll_axis = pDev->valuator->v_scroll_axis;
+ ValuatorMask mask;
+ ValuatorMask scroll;
+ int i;
+
+ /* refuse events from disabled devices */
+ if (!pDev->enabled)
+ return 0;
+
+ if (!miPointerGetScreen(pDev))
+ return 0;
+
+ events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT,
+ &num_events);
+
+ valuator_mask_copy(&mask, mask_in);
+
+ /* Turn a scroll button press into a smooth-scrolling event if
+ * necessary. This only needs to cater for the XIScrollFlagPreferred
+ * axis (if more than one scrolling axis is present) */
+ if (type == ButtonPress)
+ {
+ double val, adj;
+ int axis;
+
+ switch (buttons) {
+ case 4:
+ adj = 1.0;
+ axis = v_scroll_axis;
+ break;
+ case 5:
+ adj = -1.0;
+ axis = v_scroll_axis;
+ break;
+ case 6:
+ adj = 1.0;
+ axis = h_scroll_axis;
+ break;
+ case 7:
+ adj = -1.0;
+ axis = h_scroll_axis;
+ break;
+ default:
+ adj = 0.0;
+ axis = -1;
+ break;
+ }
+
+ if (adj != 0.0 && axis != -1)
+ {
+ adj *= pDev->valuator->axes[axis].scroll.increment;
+ val = valuator_mask_get_double(&mask, axis) + adj;
+ valuator_mask_set_double(&mask, axis, val);
+ type = MotionNotify;
+ buttons = 0;
+ }
+ }
+
+ /* First fill out the original event set, with smooth-scrolling axes. */
+ nev_tmp = fill_pointer_events(events, pDev, type, buttons, ms, flags,
+ &mask);
+ events += nev_tmp;
+ num_events += nev_tmp;
+
+ valuator_mask_zero(&scroll);
+
+ /* Now turn the smooth-scrolling axes back into emulated button presses
+ * for legacy clients, based on the integer delta between before and now */
+ for (i = 0; i < valuator_mask_size(&mask); i++) {
+ if (!valuator_mask_isset(&mask, i))
+ continue;
+
+ valuator_mask_set_double(&scroll, i, pDev->last.valuators[i]);
+
+ nev_tmp = emulate_scroll_button_events(events, pDev, i, &scroll,
+ pDev->last.scroll, ms,
+ GetMaximumEventsNum() - num_events);
+ events += nev_tmp;
+ num_events += nev_tmp;
+ }
+
+ return num_events;
+}
+
+/**
* Generate internal events representing this proximity event and enqueue
* them on the event queue.
*
diff --git a/xorg-server/dix/inpututils.c b/xorg-server/dix/inpututils.c
index 7aeb1e516..0a3d3d8b4 100644
--- a/xorg-server/dix/inpututils.c
+++ b/xorg-server/dix/inpututils.c
@@ -497,10 +497,10 @@ valuator_mask_isset(const ValuatorMask *mask, int valuator)
}
/**
- * Set the valuator to the given data.
+ * Set the valuator to the given floating-point data.
*/
void
-valuator_mask_set(ValuatorMask *mask, int valuator, int data)
+valuator_mask_set_double(ValuatorMask *mask, int valuator, double data)
{
mask->last_bit = max(valuator, mask->last_bit);
SetBit(mask->mask, valuator);
@@ -508,13 +508,33 @@ valuator_mask_set(ValuatorMask *mask, int valuator, int data)
}
/**
- * Return the requested valuator value. If the mask bit is not set for the
- * given valuator, the returned value is undefined.
+ * Set the valuator to the given integer data.
+ */
+void
+valuator_mask_set(ValuatorMask *mask, int valuator, int data)
+{
+ valuator_mask_set_double(mask, valuator, data);
+}
+
+/**
+ * Return the requested valuator value as a double. If the mask bit is not
+ * set for the given valuator, the returned value is undefined.
+ */
+double
+valuator_mask_get_double(const ValuatorMask *mask, int valuator)
+{
+ return mask->valuators[valuator];
+}
+
+/**
+ * Return the requested valuator value as an integer, rounding towards zero.
+ * If the mask bit is not set for the given valuator, the returned value is
+ * undefined.
*/
int
valuator_mask_get(const ValuatorMask *mask, int valuator)
{
- return mask->valuators[valuator];
+ return trunc(valuator_mask_get_double(mask, valuator));
}
/**
@@ -527,7 +547,7 @@ valuator_mask_unset(ValuatorMask *mask, int valuator)
int i, lastbit = -1;
ClearBit(mask->mask, valuator);
- mask->valuators[valuator] = 0;
+ mask->valuators[valuator] = 0.0;
for (i = 0; i <= mask->last_bit; i++)
if (valuator_mask_isset(mask, i))
diff --git a/xorg-server/dix/ptrveloc.c b/xorg-server/dix/ptrveloc.c
index fe655d5f4..fc5cf49b8 100644
--- a/xorg-server/dix/ptrveloc.c
+++ b/xorg-server/dix/ptrveloc.c
@@ -72,9 +72,9 @@
/* fwds */
int
SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
-static float
-SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, float velocity,
- float threshold, float acc);
+static double
+SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity,
+ double threshold, double acc);
static PointerAccelerationProfileFunc
GetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
static BOOL
@@ -487,14 +487,10 @@ DoGetDirection(int dx, int dy){
else
dir = UNDEFINED; /* shouldn't happen */
} else { /* compute angle and set appropriate flags */
- float r;
+ double r;
int i1, i2;
-#ifdef _ISOC99_SOURCE
- r = atan2f(dy, dx);
-#else
r = atan2(dy, dx);
-#endif
/* find direction.
*
* Add 360° to avoid r become negative since C has no well-defined
@@ -533,8 +529,7 @@ static int
GetDirection(int dx, int dy){
static int cache[DIRECTION_CACHE_SIZE][DIRECTION_CACHE_SIZE];
int dir;
- if (abs(dx) <= DIRECTION_CACHE_RANGE &&
- abs(dy) <= DIRECTION_CACHE_RANGE) {
+ if (abs(dx) <= DIRECTION_CACHE_RANGE && abs(dy) <= DIRECTION_CACHE_RANGE) {
/* cacheable */
dir = cache[DIRECTION_CACHE_RANGE+dx][DIRECTION_CACHE_RANGE+dy];
if(dir == 0) {
@@ -562,7 +557,7 @@ GetDirection(int dx, int dy){
* 0/0 and set it as the current one.
*/
static inline void
-FeedTrackers(DeviceVelocityPtr vel, int dx, int dy, int cur_t)
+FeedTrackers(DeviceVelocityPtr vel, double dx, double dy, int cur_t)
{
int n;
for(n = 0; n < vel->num_tracker; n++){
@@ -570,8 +565,8 @@ FeedTrackers(DeviceVelocityPtr vel, int dx, int dy, int cur_t)
vel->tracker[n].dy += dy;
}
n = (vel->cur_tracker + 1) % vel->num_tracker;
- vel->tracker[n].dx = 0;
- vel->tracker[n].dy = 0;
+ vel->tracker[n].dx = 0.0;
+ vel->tracker[n].dy = 0.0;
vel->tracker[n].time = cur_t;
vel->tracker[n].dir = GetDirection(dx, dy);
DebugAccelF("(dix prtacc) motion [dx: %i dy: %i dir:%i diff: %i]\n",
@@ -585,9 +580,9 @@ FeedTrackers(DeviceVelocityPtr vel, int dx, int dy, int cur_t)
* velocity scaling.
* This assumes linear motion.
*/
-static float
+static double
CalcTracker(const MotionTracker *tracker, int cur_t){
- float dist = sqrt(tracker->dx * tracker->dx + tracker->dy * tracker->dy);
+ double dist = sqrt(tracker->dx * tracker->dx + tracker->dy * tracker->dy);
int dtime = cur_t - tracker->time;
if(dtime > 0)
return dist / dtime;
@@ -602,16 +597,16 @@ CalcTracker(const MotionTracker *tracker, int cur_t){
*
* @return The tracker's velocity or 0 if the above conditions are unmet
*/
-static float
+static double
QueryTrackers(DeviceVelocityPtr vel, int cur_t){
int offset, dir = UNDEFINED, used_offset = -1, age_ms;
/* initial velocity: a low-offset, valid velocity */
- float initial_velocity = 0, result = 0, velocity_diff;
- float velocity_factor = vel->corr_mul * vel->const_acceleration; /* premultiply */
+ double initial_velocity = 0, result = 0, velocity_diff;
+ double velocity_factor = vel->corr_mul * vel->const_acceleration; /* premultiply */
/* loop from current to older data */
for(offset = 1; offset < vel->num_tracker; offset++){
MotionTracker *tracker = TRACKER(vel, offset);
- float tracker_velocity;
+ double tracker_velocity;
age_ms = cur_t - tracker->time;
@@ -683,11 +678,11 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t){
BOOL
ProcessVelocityData2D(
DeviceVelocityPtr vel,
- int dx,
- int dy,
+ double dx,
+ double dy,
int time)
{
- float velocity;
+ double velocity;
vel->last_velocity = vel->velocity;
@@ -703,12 +698,12 @@ ProcessVelocityData2D(
* this flattens significant ( > 1) mickeys a little bit for more steady
* constant-velocity response
*/
-static inline float
-ApplySimpleSoftening(int prev_delta, int delta)
+static inline double
+ApplySimpleSoftening(double prev_delta, double delta)
{
- float result = delta;
+ double result = delta;
- if (delta < -1 || delta > 1) {
+ if (delta < -1.0 || delta > 1.0) {
if (delta > prev_delta)
result -= 0.5;
else if (delta < prev_delta)
@@ -727,8 +722,8 @@ ApplySimpleSoftening(int prev_delta, int delta)
static void
ApplySoftening(
DeviceVelocityPtr vel,
- float* fdx,
- float* fdy)
+ double* fdx,
+ double* fdy)
{
if (vel->use_softening) {
*fdx = ApplySimpleSoftening(vel->last_dx, *fdx);
@@ -737,7 +732,7 @@ ApplySoftening(
}
static void
-ApplyConstantDeceleration(DeviceVelocityPtr vel, float *fdx, float *fdy)
+ApplyConstantDeceleration(DeviceVelocityPtr vel, double *fdx, double *fdy)
{
*fdx *= vel->const_acceleration;
*fdy *= vel->const_acceleration;
@@ -746,15 +741,15 @@ ApplyConstantDeceleration(DeviceVelocityPtr vel, float *fdx, float *fdy)
/*
* compute the acceleration for given velocity and enforce min_acceleartion
*/
-float
+double
BasicComputeAcceleration(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float velocity,
- float threshold,
- float acc){
+ double velocity,
+ double threshold,
+ double acc){
- float result;
+ double result;
result = vel->Profile(dev, vel, velocity, threshold, acc);
/* enforce min_acceleration */
@@ -768,13 +763,13 @@ BasicComputeAcceleration(
* If the velocity has changed, an average is taken of 6 velocity factors:
* current velocity, last velocity and 4 times the average between the two.
*/
-static float
+static double
ComputeAcceleration(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float threshold,
- float acc){
- float result;
+ double threshold,
+ double acc){
+ double result;
if(vel->velocity <= 0){
DebugAccelF("(dix ptracc) profile skipped\n");
@@ -817,13 +812,13 @@ ComputeAcceleration(
/**
* Polynomial function similar previous one, but with f(1) = 1
*/
-static float
+static double
PolynomialAccelerationProfile(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float velocity,
- float ignored,
- float acc)
+ double velocity,
+ double ignored,
+ double acc)
{
return pow(velocity, (acc - 1.0) * 0.5);
}
@@ -833,13 +828,13 @@ PolynomialAccelerationProfile(
* returns acceleration for velocity.
* This profile selects the two functions like the old scheme did
*/
-static float
+static double
ClassicProfile(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float velocity,
- float threshold,
- float acc)
+ double velocity,
+ double threshold,
+ double acc)
{
if (threshold > 0) {
return SimpleSmoothProfile (dev,
@@ -865,15 +860,15 @@ ClassicProfile(
* This has the expense of overall response dependency on min-acceleration.
* In effect, min_acceleration mimics const_acceleration in this profile.
*/
-static float
+static double
PowerProfile(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float velocity,
- float threshold,
- float acc)
+ double velocity,
+ double threshold,
+ double acc)
{
- float vel_dist;
+ double vel_dist;
acc = (acc-1.0) * 0.1f + 1.0; /* without this, acc of 2 is unuseable */
@@ -891,11 +886,11 @@ PowerProfile(
* - starts faster than a sinoid
* - smoothness C1 (Cinf if you dare to ignore endpoints)
*/
-static inline float
-CalcPenumbralGradient(float x){
+static inline double
+CalcPenumbralGradient(double x){
x *= 2.0f;
x -= 1.0f;
- return 0.5f + (x * sqrt(1.0f - x*x) + asin(x))/M_PI;
+ return 0.5f + (x * sqrt(1.0 - x*x) + asin(x))/M_PI;
}
@@ -903,13 +898,13 @@ CalcPenumbralGradient(float x){
* acceleration function similar to classic accelerated/unaccelerated,
* but with smooth transition in between (and towards zero for adaptive dec.).
*/
-static float
+static double
SimpleSmoothProfile(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float velocity,
- float threshold,
- float acc)
+ double velocity,
+ double threshold,
+ double acc)
{
if(velocity < 1.0f)
return CalcPenumbralGradient(0.5 + velocity*0.5) * 2.0f - 1.0f;
@@ -929,15 +924,15 @@ SimpleSmoothProfile(
* This profile uses the first half of the penumbral gradient as a start
* and then scales linearly.
*/
-static float
+static double
SmoothLinearProfile(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float velocity,
- float threshold,
- float acc)
+ double velocity,
+ double threshold,
+ double acc)
{
- float res, nv;
+ double res, nv;
if(acc > 1.0f)
acc -= 1.0f; /*this is so acc = 1 is no acceleration */
@@ -964,15 +959,15 @@ SmoothLinearProfile(
* From 0 to threshold, the response graduates smoothly from min_accel to
* acceleration. Beyond threshold it is exactly the specified acceleration.
*/
-static float
+static double
SmoothLimitedProfile(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float velocity,
- float threshold,
- float acc)
+ double velocity,
+ double threshold,
+ double acc)
{
- float res;
+ double res;
if(velocity >= threshold || threshold == 0.0f)
return acc;
@@ -985,24 +980,24 @@ SmoothLimitedProfile(
}
-static float
+static double
LinearProfile(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float velocity,
- float threshold,
- float acc)
+ double velocity,
+ double threshold,
+ double acc)
{
return acc * velocity;
}
-static float
+static double
NoProfile(
DeviceIntPtr dev,
DeviceVelocityPtr vel,
- float velocity,
- float threshold,
- float acc)
+ double velocity,
+ double threshold,
+ double acc)
{
return 1.0f;
}
@@ -1128,11 +1123,11 @@ acceleratePointerPredictable(
ValuatorMask* val,
CARD32 evtime)
{
- int dx = 0, dy = 0, tmpi;
+ double dx = 0, dy = 0;
DeviceVelocityPtr velocitydata = GetDevicePredictableAccelData(dev);
Bool soften = TRUE;
- if (!velocitydata)
+ if (valuator_mask_num_valuators(val) == 0 || !velocitydata)
return;
if (velocitydata->statistics.profile_number == AccelProfileNone &&
@@ -1141,59 +1136,39 @@ acceleratePointerPredictable(
}
if (valuator_mask_isset(val, 0)) {
- dx = valuator_mask_get(val, 0);
+ dx = valuator_mask_get_double(val, 0);
}
if (valuator_mask_isset(val, 1)) {
- dy = valuator_mask_get(val, 1);
+ dy = valuator_mask_get_double(val, 1);
}
- if (dx || dy){
+ if (dx != 0.0 || dy != 0.0) {
/* reset non-visible state? */
if (ProcessVelocityData2D(velocitydata, dx , dy, evtime)) {
soften = FALSE;
}
if (dev->ptrfeed && dev->ptrfeed->ctrl.num) {
- float mult;
+ double mult;
/* invoke acceleration profile to determine acceleration */
mult = ComputeAcceleration (dev, velocitydata,
- dev->ptrfeed->ctrl.threshold,
- (float)dev->ptrfeed->ctrl.num /
- (float)dev->ptrfeed->ctrl.den);
+ dev->ptrfeed->ctrl.threshold,
+ (double)dev->ptrfeed->ctrl.num /
+ (double)dev->ptrfeed->ctrl.den);
if(mult != 1.0f || velocitydata->const_acceleration != 1.0f) {
- float fdx = dx,
- fdy = dy;
-
if (mult > 1.0f && soften)
- ApplySoftening(velocitydata, &fdx, &fdy);
- ApplyConstantDeceleration(velocitydata, &fdx, &fdy);
-
- /* Calculate the new delta (with accel) and drop it back
- * into the valuator masks */
- if (dx) {
- float tmp;
- tmp = mult * fdx + dev->last.remainder[0];
- /* Since it may not be apparent: lrintf() does not offer
- * strong statements about rounding; however because we
- * process each axis conditionally, there's no danger
- * of a toggling remainder. Its lack of guarantees likely
- * makes it faster on the average target. */
- tmpi = lrintf(tmp);
- valuator_mask_set(val, 0, tmpi);
- dev->last.remainder[0] = tmp - (float)tmpi;
- }
- if (dy) {
- float tmp;
- tmp = mult * fdy + dev->last.remainder[1];
- tmpi = lrintf(tmp);
- valuator_mask_set(val, 1, tmpi);
- dev->last.remainder[1] = tmp - (float)tmpi;
- }
- DebugAccelF("pos (%i | %i) remainders x: %.3f y: %.3f delta x:%.3f y:%.3f\n",
- *px, *py, dev->last.remainder[0], dev->last.remainder[1], fdx, fdy);
+ ApplySoftening(velocitydata, &dx, &dy);
+ ApplyConstantDeceleration(velocitydata, &dx, &dy);
+
+ if (dx != 0.0)
+ valuator_mask_set_double(val, 0, mult * dx);
+ if (dy != 0.0)
+ valuator_mask_set_double(val, 1, mult * dy);
+ DebugAccelF("pos (%i | %i) delta x:%.3f y:%.3f\n", mult * dx,
+ mult * dy);
}
}
}
@@ -1214,8 +1189,8 @@ acceleratePointerLightweight(
ValuatorMask* val,
CARD32 ignored)
{
- float mult = 0.0, tmpf;
- int dx = 0, dy = 0, tmpi;
+ double mult = 0.0, tmpf;
+ double dx = 0.0, dy = 0.0;
if (valuator_mask_isset(val, 0)) {
dx = valuator_mask_get(val, 0);
@@ -1225,53 +1200,35 @@ acceleratePointerLightweight(
dy = valuator_mask_get(val, 1);
}
- if (!dx && !dy)
+ if (valuator_mask_num_valuators(val) == 0)
return;
if (dev->ptrfeed && dev->ptrfeed->ctrl.num) {
/* modeled from xf86Events.c */
if (dev->ptrfeed->ctrl.threshold) {
- if ((abs(dx) + abs(dy)) >= dev->ptrfeed->ctrl.threshold) {
- tmpf = ((float)dx *
- (float)(dev->ptrfeed->ctrl.num)) /
- (float)(dev->ptrfeed->ctrl.den) +
- dev->last.remainder[0];
- if (dx) {
- tmpi = (int) tmpf;
- valuator_mask_set(val, 0, tmpi);
- dev->last.remainder[0] = tmpf - (float)tmpi;
+ if ((fabs(dx) + fabs(dy)) >= dev->ptrfeed->ctrl.threshold) {
+ if (dx != 0.0) {
+ tmpf = (dx * (double)(dev->ptrfeed->ctrl.num)) /
+ (double)(dev->ptrfeed->ctrl.den);
+ valuator_mask_set_double(val, 0, tmpf);
}
- tmpf = ((float)dy *
- (float)(dev->ptrfeed->ctrl.num)) /
- (float)(dev->ptrfeed->ctrl.den) +
- dev->last.remainder[1];
- if (dy) {
- tmpi = (int) tmpf;
- valuator_mask_set(val, 1, tmpi);
- dev->last.remainder[1] = tmpf - (float)tmpi;
+ if (dy != 0.0) {
+ tmpf = (dy * (double)(dev->ptrfeed->ctrl.num)) /
+ (double)(dev->ptrfeed->ctrl.den);
+ valuator_mask_set_double(val, 1, tmpf);
}
}
}
else {
- mult = pow((float)dx * (float)dx + (float)dy * (float)dy,
- ((float)(dev->ptrfeed->ctrl.num) /
- (float)(dev->ptrfeed->ctrl.den) - 1.0) /
+ mult = pow(dx * dx + dy * dy,
+ ((double)(dev->ptrfeed->ctrl.num) /
+ (double)(dev->ptrfeed->ctrl.den) - 1.0) /
2.0) / 2.0;
- if (dx) {
- tmpf = mult * (float)dx +
- dev->last.remainder[0];
- tmpi = (int) tmpf;
- valuator_mask_set(val, 0, tmpi);
- dev->last.remainder[0] = tmpf - (float)tmpi;
- }
- if (dy) {
- tmpf = mult * (float)dy +
- dev->last.remainder[1];
- tmpi = (int)tmpf;
- valuator_mask_set(val, 1, tmpi);
- dev->last.remainder[1] = tmpf - (float)tmpi;
- }
+ if (dx != 0.0)
+ valuator_mask_set_double(val, 0, mult * dx);
+ if (dy != 0.0)
+ valuator_mask_set_double(val, 1, mult * dy);
}
}
}
diff --git a/xorg-server/doc/Xinput.xml b/xorg-server/doc/Xinput.xml
index 1ae7afe7b..0a7ec8dc0 100644
--- a/xorg-server/doc/Xinput.xml
+++ b/xorg-server/doc/Xinput.xml
@@ -1,30 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"[
+ <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
+]>
<!-- lifted from troff+ms+XMan by doclifter -->
<book id="porting">
<bookinfo>
<title>X11 Input Extension Porting Document</title>
- <releaseinfo>X Version 11, Release 6.7</releaseinfo>
<authorgroup>
<author>
<firstname>George</firstname><surname>Sachs</surname>
<affiliation><orgname>Hewlett-Packard</orgname></affiliation>
</author>
</authorgroup>
- <corpname>X Consortium Standard</corpname>
- <copyright><year>1989</year><holder>Hewlett-Packard Company</holder></copyright>
- <copyright><year>1990</year><holder>Hewlett-Packard Company</holder></copyright>
- <copyright><year>1991</year><holder>Hewlett-Packard Company</holder></copyright>
-
- <copyright><year>1989</year><holder>X Consortium</holder></copyright>
- <copyright><year>1990</year><holder>X Consortium</holder></copyright>
- <copyright><year>1991</year><holder>X Consortium</holder></copyright>
- <affiliation><orgname>X Consortium</orgname></affiliation>
- <productnumber>X Version 11, Release 6.7</productnumber>
+ <releaseinfo>X server version &xserver.version;</releaseinfo>
+ <copyright><year>1989</year><year>1990</year><year>1991</year>
+ <holder>Hewlett-Packard Company</holder>
+ </copyright>
<legalnotice>
@@ -36,11 +30,11 @@ Hewlett-Packard makes no representations about the suitability for any purpose o
document. It is provided "as is" without express or implied warranty. This document is only a draft stan-
dard of the X Consortium and is therefore subject to change.
</para>
+</legalnotice>
+<legalnotice>
+<para role="multiLicensing">Copyright © 1989, 1990, 1991 X Consortium</para>
<para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &ldquo;Software&rdquo;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 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:</para>
-
-<para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &ldquo;Software&rdquo;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 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:</para>
-
<para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
<para>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 NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM 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.</para>
diff --git a/xorg-server/doc/Xserver-spec.xml b/xorg-server/doc/Xserver-spec.xml
index b14e4897e..37fd2b29a 100644
--- a/xorg-server/doc/Xserver-spec.xml
+++ b/xorg-server/doc/Xserver-spec.xml
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+ <!ENTITY % xorg-defs SYSTEM "defs.ent"> %xorg-defs;
<!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
]>
<article>
<articleinfo>
+ <title>Definition of the Porting Layer for the X v11 Sample Server</title>
+ <titleabbrev>X Porting Layer</titleabbrev>
<author>
<firstname>Susan</firstname><surname>Angebranndt</surname>
<affiliation><orgname>Digital Equipment Corporation</orgname></affiliation>
@@ -39,10 +42,17 @@
<affiliation><orgname>X.org Foundation and Hewlett Packard</orgname></affiliation>
</author>
<publisher><publishername>The X.Org Foundation</publishername></publisher>
- <pubdate>&xserver.reldate;</pubdate>
+ <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
<releaseinfo>X server version &xserver.version;</releaseinfo>
- <title>Definition of the Porting Layer for the X v11 Sample Server</title>
- <titleabbrev>X Porting Layer</titleabbrev>
+ <copyright><year>1994</year><holder>X Consortium, Inc.</holder></copyright>
+ <copyright><year>2004</year><holder>X.org Foundation, Inc.</holder></copyright>
+ <legalnotice>
+ <para>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, sublicense, 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:</para>
+ <para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
+ <para>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 NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM 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.</para>
+ <para>LK201 and DEC are trademarks of Digital Equipment Corporation. Macintosh and Apple are trademarks of Apple Computer, Inc. PostScript is a trademark of Adobe Systems, Inc. Ethernet is a trademark of Xerox Corporation. X Window System is a trademark of the X.org Foundation, Inc. Cray is a trademark of Cray Research, Inc.</para>
+ </legalnotice>
+ <pubdate>&xserver.reldate;</pubdate>
<revhistory>
<revision>
<revnumber>1.0</revnumber>
@@ -100,13 +110,6 @@
and 1.8 CreateNewResourceType changes</revremark>
</revision>
</revhistory>
- <legalnotice>
- <para>Copyright &#xA9; 1994 X Consortium, Inc., 2004 X.org Foundation, Inc.</para>
- <para>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, sublicense, 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:</para>
- <para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
- <para>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 NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM 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.</para>
- <para>LK201 and DEC are trademarks of Digital Equipment Corporation. Macintosh and Apple are trademarks of Apple Computer, Inc. PostScript is a trademark of Adobe Systems, Inc. Ethernet is a trademark of Xerox Corporation. X Window System is a trademark of the X.org Foundation, Inc. Cray is a trademark of Cray Research, Inc.</para>
- </legalnotice>
<abstract>
<para>The following document explains the structure of the X Window System display server and the interfaces among the larger pieces. It is intended as a reference for programmers who are implementing an X Display Server on their workstation hardware. It is included with the X Window System source tape, along with the document "Strategies for Porting the X v11 Sample Server." The order in which you should read these documents is:
<orderedlist>
diff --git a/xorg-server/doc/dtrace/Xserver-DTrace.xml b/xorg-server/doc/dtrace/Xserver-DTrace.xml
index 72b8f4fa6..fa8bc809a 100644
--- a/xorg-server/doc/dtrace/Xserver-DTrace.xml
+++ b/xorg-server/doc/dtrace/Xserver-DTrace.xml
@@ -1,578 +1,578 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
- <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
-]>
-
-<article id="Xserver-DTrace">
- <articleinfo>
- <title>Xserver provider for DTrace</title>
- <author>
- <firstname>Alan</firstname><surname>Coopersmith</surname>
- <affiliation>
- <orgname>Oracle Corporation</orgname>
- <orgdiv>Solaris Engineering</orgdiv>
- </affiliation>
- </author>
- <releaseinfo>X.Org Xserver version &xserver.version;</releaseinfo>
- <legalnotice>
- <para>
-Copyright (c) 2005, 2006, 2007, 2010, Oracle and/or its affiliates.
-All rights reserved.
- </para><para>
-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, sublicense,
-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:
- </para><para>
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
- </para><para>
-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 NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS OR COPYRIGHT HOLDERS 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.
- </para>
- </legalnotice>
- </articleinfo>
-
- <sect1 id="introduction">
- <title>Introduction</title>
- <para>
- This page provides details on a
- <ulink url="http://wikis.sun.com/display/DTrace/Statically+Defined+Tracing+for+User+Applications">statically defined user application tracing provider</ulink>
- for the
- <ulink url="http://hub.opensolaris.org/bin/view/Community+Group+dtrace/">DTrace</ulink>
- facility in <productname>Solaris</productname> 10,
- <productname>MacOS X</productname> 10.5, and later releases. This
- provider instruments various points in the X server, to allow
- tracing what client applications are up to.
- </para>
-
- <para>
- The provider was integrated into the X.Org git master repository
- with Solaris 10 &amp; OpenSolaris support for the Xserver 1.4 release,
- released in 2007 with X11R7.3. Support for DTrace on MacOS X
- was added in Xserver 1.7.
- </para>
-
- <para>
- These probes expose the request and reply structure of the X protocol
- between clients and the X server, so an understanding of that basic
- nature will aid in learning how to use these probes.
- </para>
- </sect1>
-
- <sect1 id="probes">
- <title>Available probes</title>
-
- <para>
- Due to the way User-Defined DTrace probes work, arguments to
- these probes all bear undistinguished names of
- <parameter>arg0</parameter>, <parameter>arg1</parameter>,
- <parameter>arg2</parameter>, etc. These tables should help you
- determine what the real data is for each of the probe arguments.
-
- <table>
- <title>Probes and their arguments</title>
- <tgroup cols='7'>
- <colspec colname="probe" colwidth="2*"/>
- <colspec colname="desc" colwidth="3*"/>
- <colspec colname="arg0" colwidth="1*"/>
- <colspec colname="arg1" colwidth="1*"/>
- <colspec colname="arg2" colwidth="1*"/>
- <colspec colname="arg3" colwidth="1*"/>
- <colspec colname="arg4" colwidth="1*"/>
- <spanspec spanname="all" namest="probe" nameend="arg4"/>
- <thead>
- <row>
- <entry>Probe name</entry>
- <entry>Description</entry>
- <entry>arg0</entry>
- <entry>arg1</entry>
- <entry>arg2</entry>
- <entry>arg3</entry>
- <entry>arg4</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry spanname="all" class="grouphead">Request Probes</entry>
- </row>
- <row>
- <entry>request-start</entry>
- <entry>Called just before processing each client request.</entry>
- <entry><parameter>requestName</parameter></entry>
- <entry><parameter>requestCode</parameter></entry>
- <entry><parameter>requestLength</parameter></entry>
- <entry><parameter>clientId</parameter></entry>
- <entry><parameter>requestBuffer</parameter></entry>
- </row>
- <row>
- <entry>request-done</entry>
- <entry>Called just after processing each client request.</entry>
- <entry><parameter>requestName</parameter></entry>
- <entry><parameter>requestCode</parameter></entry>
- <entry><parameter>sequenceNumber</parameter></entry>
- <entry><parameter>clientId</parameter></entry>
- <entry><parameter>resultCode</parameter></entry>
- </row>
- <row>
- <entry spanname="all" class="grouphead">Event Probes</entry>
- </row>
- <row>
- <entry>send-event</entry>
- <entry>Called just before send each event to a client.</entry>
- <entry><parameter>clientId</parameter></entry>
- <entry><parameter>eventCode</parameter></entry>
- <entry><parameter>eventBuffer</parameter></entry>
- <entry nameend="arg4" class="unused"/>
- </row>
- <row>
- <entry spanname="all" class="grouphead">Client Connection Probes</entry>
- </row>
- <row>
- <entry>client-connect</entry>
- <entry>Called when a new connection is opened from a client</entry>
- <entry><parameter>clientId</parameter></entry>
- <entry><parameter>clientFD</parameter></entry>
- <entry nameend="arg4" class="unused"/>
- </row>
- <row>
- <entry>client-auth</entry>
- <entry>Called when client authenticates (normally just after connection opened)</entry>
- <entry><parameter>clientId</parameter></entry>
- <entry><parameter>clientAddr</parameter></entry>
- <entry><parameter>clientPid</parameter></entry>
- <entry><parameter>clientZoneId</parameter></entry>
- <entry nameend="arg4" class="unused"/>
- </row>
- <row>
- <entry>client-disconnect</entry>
- <entry>Called when a client connection is closed</entry>
- <entry><parameter>clientId</parameter></entry>
- <entry nameend="arg4" class="unused"/>
- </row>
- <row>
- <entry spanname="all" class="grouphead">Resource Allocation Probes</entry>
- </row>
- <row>
- <entry>resource-alloc</entry>
- <entry>Called when a new resource (pixmap, gc, colormap, etc.) is allocated</entry>
- <entry><parameter>resourceId</parameter></entry>
- <entry><parameter>resourceTypeId</parameter></entry>
- <entry><parameter>resourceValue</parameter></entry>
- <entry><parameter>resourceTypeName</parameter></entry>
- <entry nameend="arg4" class="unused"/>
- </row>
- <row>
- <entry>resource-free</entry>
- <entry>Called when a resource is freed</entry>
- <entry><parameter>resourceId</parameter></entry>
- <entry><parameter>resourceTypeId</parameter></entry>
- <entry><parameter>resourceValue</parameter></entry>
- <entry><parameter>resourceTypeName</parameter></entry>
- <entry nameend="arg4" class="unused"/>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- </sect1>
-
- <sect1 id="arguments">
- <title>Data Available in Probe Arguments</title>
-
- <para>
- To access data in arguments of type <type>string</type>, you will need
- to use <ulink url="http://wikis.sun.com/display/DTrace/Actions+and+Subroutines#ActionsandSubroutines-{{copyinstr}}"><function>copyinstr()</function></ulink>.
- To access data buffers referenced via <type>uintptr_t</type>'s, you will
- need to use <ulink url="http://wikis.sun.com/display/DTrace/Actions+and+Subroutines#ActionsandSubroutines-{{copyin}}"><function>copyin()</function></ulink>.
-
- <table>
- <title>Probe Arguments</title>
- <tgroup cols='3'>
- <colspec colname="arg" colwidth="2*"/>
- <colspec colname="type" colwidth="1*"/>
- <colspec colname="desc" colwidth="7*"/>
- <thead>
- <row>
- <entry>Argument name</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><parameter>clientAddr</parameter></entry>
- <entry><type>string</type></entry>
- <entry>String representing address client connected from</entry>
- </row>
- <row>
- <entry><parameter>clientFD</parameter></entry>
- <entry><type>int</type></entry>
- <entry>X server's file descriptor for server side of each connection</entry>
- </row>
- <row>
- <entry><parameter>clientId</parameter></entry>
- <entry><type>int</type></entry>
- <entry>Unique integer identifier for each connection to the
- X server</entry>
- </row>
- <row>
- <entry><parameter>clientPid</parameter></entry>
- <entry><type>pid_t</type></entry>
- <entry>Process id of client, if connection is local
- (from <function>getpeerucred()</function>)</entry>
- </row>
- <row>
- <entry><parameter>clientZoneId</parameter></entry>
- <entry><type>zoneid_t</type></entry>
- <entry>Solaris: Zone id of client, if connection is local
- (from <function>getpeerucred()</function>)</entry>
- </row>
- <row>
- <entry><parameter>eventBuffer</parameter></entry>
- <entry><type>uintptr_t</type></entry>
- <entry>Pointer to buffer containing X event - decode using
- structures in
- &lt;<ulink url="http://cgit.freedesktop.org/xorg/proto/xproto/tree/Xproto.h"><filename class="headerfile">X11/Xproto.h</filename></ulink>&gt;
- and similar headers for each extension</entry>
- </row>
- <row>
- <entry><parameter>eventCode</parameter></entry>
- <entry><type>uint8_t</type></entry>
- <entry>Event number of X event</entry>
- </row>
- <row>
- <entry><parameter>resourceId</parameter></entry>
- <entry><type>uint32_t</type></entry>
- <entry>X resource id (XID)</entry>
- </row>
- <row>
- <entry><parameter>resourceTypeId</parameter></entry>
- <entry><type>uint32_t</type></entry>
- <entry>Resource type id</entry>
- </row>
- <row>
- <entry><parameter>resourceTypeName</parameter></entry>
- <entry><type>string</type></entry>
- <entry>String representing X resource type
- (<literal>"PIXMAP"</literal>, etc.)</entry>
- </row>
- <row>
- <entry><parameter>resourceValue</parameter></entry>
- <entry><type>uintptr_t</type></entry>
- <entry>Pointer to data for X resource</entry>
- </row>
- <row>
- <entry><parameter>resultCode</parameter></entry>
- <entry><type>int</type></entry>
- <entry>Integer code representing result status of request</entry>
- </row>
- <row>
- <entry><parameter>requestBuffer</parameter></entry>
- <entry><type>uintptr_t</type></entry>
- <entry>Pointer to buffer containing X request - decode using
- structures in
- &lt;<ulink url="http://cgit.freedesktop.org/xorg/proto/xproto/tree/Xproto.h"><filename class="headerfile">X11/Xproto.h</filename></ulink>&gt;
- and similar headers for each extension</entry>
- </row>
- <row>
- <entry><parameter>requestCode</parameter></entry>
- <entry><type>uint8_t</type></entry>
- <entry>Request number of X request or Extension</entry>
- </row>
- <row>
- <entry><parameter>requestName</parameter></entry>
- <entry><type>string</type></entry>
- <entry>Name of X request or Extension</entry>
- </row>
- <row>
- <entry><parameter>requestLength</parameter></entry>
- <entry><type>uint16_t</type></entry>
- <entry>Length of X request</entry>
- </row>
- <row>
- <entry><parameter>sequenceNumber</parameter></entry>
- <entry><type>uint32_t</type></entry>
- <entry>Number of X request in in this connection</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- </sect1>
-
- <sect1 id="examples">
- <title>Examples</title>
-
- <example>
- <title>Counting requests by request name</title>
-
- <para>
- This script simply increments a counter for each different request
- made, and when you exit the script (such as by hitting
- <keycombo action='simul'><keycap>Control</keycap><keycap>C</keycap>
- </keycombo>) prints the counts.
-
- <programlisting>
-#!/usr/sbin/dtrace -s
-
-Xserver*:::request-start
-{
- @counts[copyinstr(arg0)] = count();
-}
- </programlisting>
-
- The output from a short run may appear as:
- <screen>
- QueryPointer 1
- CreatePixmap 2
- FreePixmap 2
- PutImage 2
- ChangeGC 10
- CopyArea 10
- CreateGC 14
- FreeGC 14
- RENDER 28
- SetClipRectangles 40
- </screen>
- </para>
-
- <para>
- This can be rewritten slightly to cache the string containing the name
- of the request since it will be reused many times, instead of copying
- it over and over from the kernel:
-
- <programlisting>
-#!/usr/sbin/dtrace -s
-
-string Xrequest[uintptr_t];
-
-Xserver*:::request-start
-/Xrequest[arg0] == ""/
-{
- Xrequest[arg0] = copyinstr(arg0);
-}
-
-Xserver*:::request-start
-{
- @counts[Xrequest[arg0]] = count();
-}
- </programlisting>
- </para>
- </example>
-
- <example>
- <title>Get average CPU time per request</title>
-
- <para>This script records the CPU time used between the probes at
- the start and end of each request and aggregates it per request type.
-
- <programlisting>
-#!/usr/sbin/dtrace -s
-
-Xserver*:::request-start
-{
- reqstart = vtimestamp;
-}
-
-Xserver*:::request-done
-{
- @times[copyinstr(arg0)] = avg(vtimestamp - reqstart);
-}
- </programlisting>
-
- The output from a sample run might look like:
-
- <screen>
- ChangeGC 889
- MapWindow 907
- SetClipRectangles 1319
- PolyPoint 1413
- PolySegment 1434
- PolyRectangle 1828
- FreeCursor 1895
- FreeGC 1950
- CreateGC 2244
- FreePixmap 2246
- GetInputFocus 2249
- TranslateCoords 8508
- QueryTree 8846
- GetGeometry 9948
- CreatePixmap 12111
- AllowEvents 14090
- GrabServer 14791
- MIT-SCREEN-SAVER 16747
- ConfigureWindow 22917
- SetInputFocus 28521
- PutImage 240841
-
- </screen>
- </para>
- </example>
-
- <example>
- <title>Monitoring clients that connect and disconnect</title>
-
- <para>
- This script simply prints information about each client that
- connects or disconnects from the server while it is running.
- Since the provider is specified as <code>Xserver$1</code> instead
- of <code>Xserver*</code> like previous examples, it won't monitor
- all Xserver processes running on the machine, but instead expects
- the process id of the X server to monitor to be specified as the
- argument to the script.
-
- <programlisting>
-#!/usr/sbin/dtrace -s
-
-Xserver$1:::client-connect
-{
- printf("** Client Connect: id %d\n", arg0);
-}
-
-Xserver$1:::client-auth
-{
- printf("** Client auth'ed: id %d =&gt; %s pid %d\n",
- arg0, copyinstr(arg1), arg2);
-}
-
-Xserver$1:::client-disconnect
-{
- printf("** Client Disconnect: id %d\n", arg0);
-}
- </programlisting>
-
- A sample run:
-
- <screen>
-<prompt>#</prompt> <userinput>./foo.d 5790</userinput>
-<computeroutput>dtrace: script './foo.d' matched 4 probes
-CPU ID FUNCTION:NAME
- 0 15774 CloseDownClient:client-disconnect ** Client Disconnect: id 65
-
- 2 15774 CloseDownClient:client-disconnect ** Client Disconnect: id 64
-
- 0 15773 EstablishNewConnections:client-connect ** Client Connect: id 64
-
- 0 15772 AuthAudit:client-auth ** Client auth'ed: id 64 =&gt; local host pid 2034
-
- 0 15773 EstablishNewConnections:client-connect ** Client Connect: id 65
-
- 0 15772 AuthAudit:client-auth ** Client auth'ed: id 65 =&gt; local host pid 2034
-
- 0 15774 CloseDownClient:client-disconnect ** Client Disconnect: id 64
- </computeroutput>
- </screen>
-
- </para>
- </example>
-
- <example>
- <title>Monitoring clients creating Pixmaps</title>
-
- <para>
- This script can be used to determine which clients are creating
- pixmaps in the X server, printing information about each client
- as it connects to help trace it back to the program on the other
- end of the X connection.
-
- <programlisting>
-#!/usr/sbin/dtrace -qs
-
-string Xrequest[uintptr_t];
-string Xrestype[uintptr_t];
-
-Xserver$1:::request-start
-/Xrequest[arg0] == ""/
-{
- Xrequest[arg0] = copyinstr(arg0);
-}
-
-Xserver$1:::resource-alloc
-/arg3 != 0 &amp;&amp; Xrestype[arg3] == ""/
-{
- Xrestype[arg3] = copyinstr(arg3);
-}
-
-
-Xserver$1:::request-start
-/Xrequest[arg0] == "X_CreatePixmap"/
-{
- printf("-&gt; %s: client %d\n", Xrequest[arg0], arg3);
-}
-
-Xserver$1:::request-done
-/Xrequest[arg0] == "X_CreatePixmap"/
-{
- printf("&lt;- %s: client %d\n", Xrequest[arg0], arg3);
-}
-
-Xserver$1:::resource-alloc
-/Xrestype[arg3] == "PIXMAP"/
-{
- printf("** Pixmap alloc: %08x\n", arg0);
-}
-
-
-Xserver$1:::resource-free
-/Xrestype[arg3] == "PIXMAP"/
-{
- printf("** Pixmap free: %08x\n", arg0);
-}
-
-Xserver$1:::client-connect
-{
- printf("** Client Connect: id %d\n", arg0);
-}
-
-Xserver$1:::client-auth
-{
- printf("** Client auth'ed: id %d =&gt; %s pid %d\n",
- arg0, copyinstr(arg1), arg2);
-}
-
-Xserver$1:::client-disconnect
-{
- printf("** Client Disconnect: id %d\n", arg0);
-}
- </programlisting>
-
- Sample output from a run of this script:
- <screen><computeroutput>
-** Client Connect: id 17
-** Client auth'ed: id 17 =&gt; local host pid 20273
--&gt; X_CreatePixmap: client 17
-** Pixmap alloc: 02200009
-&lt;- X_CreatePixmap: client 17
--&gt; X_CreatePixmap: client 15
-** Pixmap alloc: 01e00180
-&lt;- X_CreatePixmap: client 15
--&gt; X_CreatePixmap: client 15
-** Pixmap alloc: 01e00181
-&lt;- X_CreatePixmap: client 15
--&gt; X_CreatePixmap: client 14
-** Pixmap alloc: 01c004c8
-&lt;- X_CreatePixmap: client 14
-** Pixmap free: 02200009
-** Client Disconnect: id 17
-** Pixmap free: 01e00180
-** Pixmap free: 01e00181
- </computeroutput></screen>
-
- </para>
-
- </example>
-
-
- </sect1>
-
-</article>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+ <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
+]>
+
+<article id="Xserver-DTrace">
+ <articleinfo>
+ <title>Xserver Provider for DTrace</title>
+ <author>
+ <firstname>Alan</firstname><surname>Coopersmith</surname>
+ <affiliation>
+ <orgname>Oracle Corporation</orgname>
+ <orgdiv>Solaris Engineering</orgdiv>
+ </affiliation>
+ </author>
+ <releaseinfo>X.Org Xserver version &xserver.version;</releaseinfo>
+ <copyright><year>2005</year><year>2006</year><year>2007</year><year>2010</year>
+ <holder>Oracle and/or its affiliates. All rights reserved.</holder>
+ </copyright>
+ <legalnotice id="copyright">
+ <para>
+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, sublicense,
+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:
+ </para><para>
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+ </para><para>
+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 NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS 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.
+ </para>
+ </legalnotice>
+ </articleinfo>
+
+ <sect1 id="introduction">
+ <title>Introduction</title>
+ <para>
+ This page provides details on a
+ <ulink url="http://wikis.sun.com/display/DTrace/Statically+Defined+Tracing+for+User+Applications">statically defined user application tracing provider</ulink>
+ for the
+ <ulink url="http://hub.opensolaris.org/bin/view/Community+Group+dtrace/">DTrace</ulink>
+ facility in <productname>Solaris</productname> 10,
+ <productname>MacOS X</productname> 10.5, and later releases. This
+ provider instruments various points in the X server, to allow
+ tracing what client applications are up to.
+ </para>
+
+ <para>
+ The provider was integrated into the X.Org git master repository
+ with Solaris 10 &amp; OpenSolaris support for the Xserver 1.4 release,
+ released in 2007 with X11R7.3. Support for DTrace on MacOS X
+ was added in Xserver 1.7.
+ </para>
+
+ <para>
+ These probes expose the request and reply structure of the X protocol
+ between clients and the X server, so an understanding of that basic
+ nature will aid in learning how to use these probes.
+ </para>
+ </sect1>
+
+ <sect1 id="probes">
+ <title>Available probes</title>
+
+ <para>
+ Due to the way User-Defined DTrace probes work, arguments to
+ these probes all bear undistinguished names of
+ <parameter>arg0</parameter>, <parameter>arg1</parameter>,
+ <parameter>arg2</parameter>, etc. These tables should help you
+ determine what the real data is for each of the probe arguments.
+
+ <table id="Probes_and_their_arguments">
+ <title>Probes and their arguments</title>
+ <tgroup cols='7'>
+ <colspec colname="probe" colwidth="2*"/>
+ <colspec colname="desc" colwidth="3*"/>
+ <colspec colname="arg0" colwidth="1*"/>
+ <colspec colname="arg1" colwidth="1*"/>
+ <colspec colname="arg2" colwidth="1*"/>
+ <colspec colname="arg3" colwidth="1*"/>
+ <colspec colname="arg4" colwidth="1*"/>
+ <spanspec spanname="all" namest="probe" nameend="arg4"/>
+ <thead>
+ <row>
+ <entry>Probe name</entry>
+ <entry>Description</entry>
+ <entry>arg0</entry>
+ <entry>arg1</entry>
+ <entry>arg2</entry>
+ <entry>arg3</entry>
+ <entry>arg4</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry spanname="all" class="grouphead">Request Probes</entry>
+ </row>
+ <row>
+ <entry>request-start</entry>
+ <entry>Called just before processing each client request.</entry>
+ <entry><parameter>requestName</parameter></entry>
+ <entry><parameter>requestCode</parameter></entry>
+ <entry><parameter>requestLength</parameter></entry>
+ <entry><parameter>clientId</parameter></entry>
+ <entry><parameter>requestBuffer</parameter></entry>
+ </row>
+ <row>
+ <entry>request-done</entry>
+ <entry>Called just after processing each client request.</entry>
+ <entry><parameter>requestName</parameter></entry>
+ <entry><parameter>requestCode</parameter></entry>
+ <entry><parameter>sequenceNumber</parameter></entry>
+ <entry><parameter>clientId</parameter></entry>
+ <entry><parameter>resultCode</parameter></entry>
+ </row>
+ <row>
+ <entry spanname="all" class="grouphead">Event Probes</entry>
+ </row>
+ <row>
+ <entry>send-event</entry>
+ <entry>Called just before send each event to a client.</entry>
+ <entry><parameter>clientId</parameter></entry>
+ <entry><parameter>eventCode</parameter></entry>
+ <entry><parameter>eventBuffer</parameter></entry>
+ <entry nameend="arg4" class="unused"/>
+ </row>
+ <row>
+ <entry spanname="all" class="grouphead">Client Connection Probes</entry>
+ </row>
+ <row>
+ <entry>client-connect</entry>
+ <entry>Called when a new connection is opened from a client</entry>
+ <entry><parameter>clientId</parameter></entry>
+ <entry><parameter>clientFD</parameter></entry>
+ <entry nameend="arg4" class="unused"/>
+ </row>
+ <row>
+ <entry>client-auth</entry>
+ <entry>Called when client authenticates (normally just after connection opened)</entry>
+ <entry><parameter>clientId</parameter></entry>
+ <entry><parameter>clientAddr</parameter></entry>
+ <entry><parameter>clientPid</parameter></entry>
+ <entry><parameter>clientZoneId</parameter></entry>
+ <entry nameend="arg4" class="unused"/>
+ </row>
+ <row>
+ <entry>client-disconnect</entry>
+ <entry>Called when a client connection is closed</entry>
+ <entry><parameter>clientId</parameter></entry>
+ <entry nameend="arg4" class="unused"/>
+ </row>
+ <row>
+ <entry spanname="all" class="grouphead">Resource Allocation Probes</entry>
+ </row>
+ <row>
+ <entry>resource-alloc</entry>
+ <entry>Called when a new resource (pixmap, gc, colormap, etc.) is allocated</entry>
+ <entry><parameter>resourceId</parameter></entry>
+ <entry><parameter>resourceTypeId</parameter></entry>
+ <entry><parameter>resourceValue</parameter></entry>
+ <entry><parameter>resourceTypeName</parameter></entry>
+ <entry nameend="arg4" class="unused"/>
+ </row>
+ <row>
+ <entry>resource-free</entry>
+ <entry>Called when a resource is freed</entry>
+ <entry><parameter>resourceId</parameter></entry>
+ <entry><parameter>resourceTypeId</parameter></entry>
+ <entry><parameter>resourceValue</parameter></entry>
+ <entry><parameter>resourceTypeName</parameter></entry>
+ <entry nameend="arg4" class="unused"/>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ </sect1>
+
+ <sect1 id="arguments">
+ <title>Data Available in Probe Arguments</title>
+
+ <para>
+ To access data in arguments of type <type>string</type>, you will need
+ to use <ulink url="http://wikis.sun.com/display/DTrace/Actions+and+Subroutines#ActionsandSubroutines-{{copyinstr}}"><function>copyinstr()</function></ulink>.
+ To access data buffers referenced via <type>uintptr_t</type>'s, you will
+ need to use <ulink url="http://wikis.sun.com/display/DTrace/Actions+and+Subroutines#ActionsandSubroutines-{{copyin}}"><function>copyin()</function></ulink>.
+
+ <table id="Probe_Arguments">
+ <title>Probe Arguments</title>
+ <tgroup cols='3'>
+ <colspec colname="arg" colwidth="2*"/>
+ <colspec colname="type" colwidth="1*"/>
+ <colspec colname="desc" colwidth="7*"/>
+ <thead>
+ <row>
+ <entry>Argument name</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><parameter>clientAddr</parameter></entry>
+ <entry><type>string</type></entry>
+ <entry>String representing address client connected from</entry>
+ </row>
+ <row>
+ <entry><parameter>clientFD</parameter></entry>
+ <entry><type>int</type></entry>
+ <entry>X server's file descriptor for server side of each connection</entry>
+ </row>
+ <row>
+ <entry><parameter>clientId</parameter></entry>
+ <entry><type>int</type></entry>
+ <entry>Unique integer identifier for each connection to the
+ X server</entry>
+ </row>
+ <row>
+ <entry><parameter>clientPid</parameter></entry>
+ <entry><type>pid_t</type></entry>
+ <entry>Process id of client, if connection is local
+ (from <function>getpeerucred()</function>)</entry>
+ </row>
+ <row>
+ <entry><parameter>clientZoneId</parameter></entry>
+ <entry><type>zoneid_t</type></entry>
+ <entry>Solaris: Zone id of client, if connection is local
+ (from <function>getpeerucred()</function>)</entry>
+ </row>
+ <row>
+ <entry><parameter>eventBuffer</parameter></entry>
+ <entry><type>uintptr_t</type></entry>
+ <entry>Pointer to buffer containing X event - decode using
+ structures in
+ &lt;<ulink url="http://cgit.freedesktop.org/xorg/proto/xproto/tree/Xproto.h"><filename class="headerfile">X11/Xproto.h</filename></ulink>&gt;
+ and similar headers for each extension</entry>
+ </row>
+ <row>
+ <entry><parameter>eventCode</parameter></entry>
+ <entry><type>uint8_t</type></entry>
+ <entry>Event number of X event</entry>
+ </row>
+ <row>
+ <entry><parameter>resourceId</parameter></entry>
+ <entry><type>uint32_t</type></entry>
+ <entry>X resource id (XID)</entry>
+ </row>
+ <row>
+ <entry><parameter>resourceTypeId</parameter></entry>
+ <entry><type>uint32_t</type></entry>
+ <entry>Resource type id</entry>
+ </row>
+ <row>
+ <entry><parameter>resourceTypeName</parameter></entry>
+ <entry><type>string</type></entry>
+ <entry>String representing X resource type
+ (<literal>"PIXMAP"</literal>, etc.)</entry>
+ </row>
+ <row>
+ <entry><parameter>resourceValue</parameter></entry>
+ <entry><type>uintptr_t</type></entry>
+ <entry>Pointer to data for X resource</entry>
+ </row>
+ <row>
+ <entry><parameter>resultCode</parameter></entry>
+ <entry><type>int</type></entry>
+ <entry>Integer code representing result status of request</entry>
+ </row>
+ <row>
+ <entry><parameter>requestBuffer</parameter></entry>
+ <entry><type>uintptr_t</type></entry>
+ <entry>Pointer to buffer containing X request - decode using
+ structures in
+ &lt;<ulink url="http://cgit.freedesktop.org/xorg/proto/xproto/tree/Xproto.h"><filename class="headerfile">X11/Xproto.h</filename></ulink>&gt;
+ and similar headers for each extension</entry>
+ </row>
+ <row>
+ <entry><parameter>requestCode</parameter></entry>
+ <entry><type>uint8_t</type></entry>
+ <entry>Request number of X request or Extension</entry>
+ </row>
+ <row>
+ <entry><parameter>requestName</parameter></entry>
+ <entry><type>string</type></entry>
+ <entry>Name of X request or Extension</entry>
+ </row>
+ <row>
+ <entry><parameter>requestLength</parameter></entry>
+ <entry><type>uint16_t</type></entry>
+ <entry>Length of X request</entry>
+ </row>
+ <row>
+ <entry><parameter>sequenceNumber</parameter></entry>
+ <entry><type>uint32_t</type></entry>
+ <entry>Number of X request in in this connection</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ </sect1>
+
+ <sect1 id="examples">
+ <title>Examples</title>
+
+ <example id="Counting_requests_by_request_name">
+ <title>Counting requests by request name</title>
+
+ <para>
+ This script simply increments a counter for each different request
+ made, and when you exit the script (such as by hitting
+ <keycombo action='simul'><keycap>Control</keycap><keycap>C</keycap>
+ </keycombo>) prints the counts.
+
+ <programlisting>
+#!/usr/sbin/dtrace -s
+
+Xserver*:::request-start
+{
+ @counts[copyinstr(arg0)] = count();
+}
+ </programlisting>
+
+ The output from a short run may appear as:
+ <screen>
+ QueryPointer 1
+ CreatePixmap 2
+ FreePixmap 2
+ PutImage 2
+ ChangeGC 10
+ CopyArea 10
+ CreateGC 14
+ FreeGC 14
+ RENDER 28
+ SetClipRectangles 40
+ </screen>
+ </para>
+
+ <para>
+ This can be rewritten slightly to cache the string containing the name
+ of the request since it will be reused many times, instead of copying
+ it over and over from the kernel:
+
+ <programlisting>
+#!/usr/sbin/dtrace -s
+
+string Xrequest[uintptr_t];
+
+Xserver*:::request-start
+/Xrequest[arg0] == ""/
+{
+ Xrequest[arg0] = copyinstr(arg0);
+}
+
+Xserver*:::request-start
+{
+ @counts[Xrequest[arg0]] = count();
+}
+ </programlisting>
+ </para>
+ </example>
+
+ <example id="Get_average_CPU_time_per_request">
+ <title>Get average CPU time per request</title>
+
+ <para>This script records the CPU time used between the probes at
+ the start and end of each request and aggregates it per request type.
+
+ <programlisting>
+#!/usr/sbin/dtrace -s
+
+Xserver*:::request-start
+{
+ reqstart = vtimestamp;
+}
+
+Xserver*:::request-done
+{
+ @times[copyinstr(arg0)] = avg(vtimestamp - reqstart);
+}
+ </programlisting>
+
+ The output from a sample run might look like:
+
+ <screen>
+ ChangeGC 889
+ MapWindow 907
+ SetClipRectangles 1319
+ PolyPoint 1413
+ PolySegment 1434
+ PolyRectangle 1828
+ FreeCursor 1895
+ FreeGC 1950
+ CreateGC 2244
+ FreePixmap 2246
+ GetInputFocus 2249
+ TranslateCoords 8508
+ QueryTree 8846
+ GetGeometry 9948
+ CreatePixmap 12111
+ AllowEvents 14090
+ GrabServer 14791
+ MIT-SCREEN-SAVER 16747
+ ConfigureWindow 22917
+ SetInputFocus 28521
+ PutImage 240841
+
+ </screen>
+ </para>
+ </example>
+
+ <example id="Monitoring_clients_that_connect_and_disconnect">
+ <title>Monitoring clients that connect and disconnect</title>
+
+ <para>
+ This script simply prints information about each client that
+ connects or disconnects from the server while it is running.
+ Since the provider is specified as <code>Xserver$1</code> instead
+ of <code>Xserver*</code> like previous examples, it won't monitor
+ all Xserver processes running on the machine, but instead expects
+ the process id of the X server to monitor to be specified as the
+ argument to the script.
+
+ <programlisting>
+#!/usr/sbin/dtrace -s
+
+Xserver$1:::client-connect
+{
+ printf("** Client Connect: id %d\n", arg0);
+}
+
+Xserver$1:::client-auth
+{
+ printf("** Client auth'ed: id %d =&gt; %s pid %d\n",
+ arg0, copyinstr(arg1), arg2);
+}
+
+Xserver$1:::client-disconnect
+{
+ printf("** Client Disconnect: id %d\n", arg0);
+}
+ </programlisting>
+
+ A sample run:
+
+ <screen>
+<prompt>#</prompt> <userinput>./foo.d 5790</userinput>
+<computeroutput>dtrace: script './foo.d' matched 4 probes
+CPU ID FUNCTION:NAME
+ 0 15774 CloseDownClient:client-disconnect ** Client Disconnect: id 65
+
+ 2 15774 CloseDownClient:client-disconnect ** Client Disconnect: id 64
+
+ 0 15773 EstablishNewConnections:client-connect ** Client Connect: id 64
+
+ 0 15772 AuthAudit:client-auth ** Client auth'ed: id 64 =&gt; local host pid 2034
+
+ 0 15773 EstablishNewConnections:client-connect ** Client Connect: id 65
+
+ 0 15772 AuthAudit:client-auth ** Client auth'ed: id 65 =&gt; local host pid 2034
+
+ 0 15774 CloseDownClient:client-disconnect ** Client Disconnect: id 64
+ </computeroutput>
+ </screen>
+
+ </para>
+ </example>
+
+ <example id="Monitoring_clients_creating_Pixmaps">
+ <title>Monitoring clients creating Pixmaps</title>
+
+ <para>
+ This script can be used to determine which clients are creating
+ pixmaps in the X server, printing information about each client
+ as it connects to help trace it back to the program on the other
+ end of the X connection.
+
+ <programlisting>
+#!/usr/sbin/dtrace -qs
+
+string Xrequest[uintptr_t];
+string Xrestype[uintptr_t];
+
+Xserver$1:::request-start
+/Xrequest[arg0] == ""/
+{
+ Xrequest[arg0] = copyinstr(arg0);
+}
+
+Xserver$1:::resource-alloc
+/arg3 != 0 &amp;&amp; Xrestype[arg3] == ""/
+{
+ Xrestype[arg3] = copyinstr(arg3);
+}
+
+
+Xserver$1:::request-start
+/Xrequest[arg0] == "X_CreatePixmap"/
+{
+ printf("-&gt; %s: client %d\n", Xrequest[arg0], arg3);
+}
+
+Xserver$1:::request-done
+/Xrequest[arg0] == "X_CreatePixmap"/
+{
+ printf("&lt;- %s: client %d\n", Xrequest[arg0], arg3);
+}
+
+Xserver$1:::resource-alloc
+/Xrestype[arg3] == "PIXMAP"/
+{
+ printf("** Pixmap alloc: %08x\n", arg0);
+}
+
+
+Xserver$1:::resource-free
+/Xrestype[arg3] == "PIXMAP"/
+{
+ printf("** Pixmap free: %08x\n", arg0);
+}
+
+Xserver$1:::client-connect
+{
+ printf("** Client Connect: id %d\n", arg0);
+}
+
+Xserver$1:::client-auth
+{
+ printf("** Client auth'ed: id %d =&gt; %s pid %d\n",
+ arg0, copyinstr(arg1), arg2);
+}
+
+Xserver$1:::client-disconnect
+{
+ printf("** Client Disconnect: id %d\n", arg0);
+}
+ </programlisting>
+
+ Sample output from a run of this script:
+ <screen><computeroutput>
+** Client Connect: id 17
+** Client auth'ed: id 17 =&gt; local host pid 20273
+-&gt; X_CreatePixmap: client 17
+** Pixmap alloc: 02200009
+&lt;- X_CreatePixmap: client 17
+-&gt; X_CreatePixmap: client 15
+** Pixmap alloc: 01e00180
+&lt;- X_CreatePixmap: client 15
+-&gt; X_CreatePixmap: client 15
+** Pixmap alloc: 01e00181
+&lt;- X_CreatePixmap: client 15
+-&gt; X_CreatePixmap: client 14
+** Pixmap alloc: 01c004c8
+&lt;- X_CreatePixmap: client 14
+** Pixmap free: 02200009
+** Client Disconnect: id 17
+** Pixmap free: 01e00180
+** Pixmap free: 01e00181
+ </computeroutput></screen>
+
+ </para>
+
+ </example>
+
+
+ </sect1>
+
+</article>
diff --git a/xorg-server/fb/fbpict.c b/xorg-server/fb/fbpict.c
index d1fd0cbbd..57c93fd06 100644
--- a/xorg-server/fb/fbpict.c
+++ b/xorg-server/fb/fbpict.c
@@ -163,7 +163,9 @@ create_bits_picture (PicturePtr pict,
(pixman_format_code_t)pict->format,
pixmap->drawable.width, pixmap->drawable.height,
(uint32_t *)bits, stride * sizeof (FbStride));
-
+
+ if (!image)
+ return NULL;
#ifdef FB_ACCESS_WRAPPER
#if FB_SHIFT==5
diff --git a/xorg-server/hw/kdrive/src/kinfo.c b/xorg-server/hw/kdrive/src/kinfo.c
index 7055fbf4a..0055b16db 100644
--- a/xorg-server/hw/kdrive/src/kinfo.c
+++ b/xorg-server/hw/kdrive/src/kinfo.c
@@ -134,19 +134,9 @@ KdNewPointer (void)
void
KdFreePointer(KdPointerInfo *pi)
{
- InputOption *option, *prev = NULL;
-
free(pi->name);
free(pi->path);
-
- for (option = pi->options; option; option = option->next) {
- free(prev);
- free(option->key);
- free(option->value);
- prev = option;
- }
-
- free(prev);
+ input_option_free_list(&pi->options);
free(pi);
}
diff --git a/xorg-server/hw/xfree86/Makefile.am b/xorg-server/hw/xfree86/Makefile.am
index e3ef14fc1..4f0877290 100644
--- a/xorg-server/hw/xfree86/Makefile.am
+++ b/xorg-server/hw/xfree86/Makefile.am
@@ -111,7 +111,7 @@ CLEANFILES = sdksyms.c sdksyms.dep
EXTRA_DIST += sdksyms.sh
sdksyms.dep sdksyms.c: sdksyms.sh
- CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES)
+ CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES)
SDKSYMS_DEP = sdksyms.dep
include $(SDKSYMS_DEP)
diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c
index e6c4d8f9f..f8c1b6567 100644
--- a/xorg-server/hw/xfree86/common/xf86Config.c
+++ b/xorg-server/hw/xfree86/common/xf86Config.c
@@ -670,7 +670,6 @@ typedef enum {
FLAG_DISABLEVIDMODE,
FLAG_ALLOWNONLOCAL,
FLAG_ALLOWMOUSEOPENFAIL,
- FLAG_VTSYSREQ,
FLAG_SAVER_BLANKTIME,
FLAG_DPMS_STANDBYTIME,
FLAG_DPMS_SUSPENDTIME,
@@ -711,8 +710,6 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
{ FLAG_ALLOWMOUSEOPENFAIL, "AllowMouseOpenFail", OPTV_BOOLEAN,
{0}, FALSE },
- { FLAG_VTSYSREQ, "VTSysReq", OPTV_BOOLEAN,
- {0}, FALSE },
{ FLAG_SAVER_BLANKTIME, "BlankTime" , OPTV_INTEGER,
{0}, FALSE },
{ FLAG_DPMS_STANDBYTIME, "StandbyTime", OPTV_INTEGER,
@@ -850,16 +847,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
if (xf86GetOptValBool(FlagOptions, FLAG_ALLOWMOUSEOPENFAIL, &value))
xf86Info.allowMouseOpenFail = value;
- if (xf86GetOptValBool(FlagOptions, FLAG_VTSYSREQ, &value)) {
-#ifdef USE_VT_SYSREQ
- xf86Info.vtSysreq = value;
- xf86Msg(X_CONFIG, "VTSysReq %s\n", value ? "enabled" : "disabled");
-#else
- if (value)
- xf86Msg(X_WARNING, "VTSysReq is not supported on this OS\n");
-#endif
- }
-
xf86Info.pmFlag = TRUE;
if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value))
xf86Info.pmFlag = !value;
@@ -1331,12 +1318,14 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
}
if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
+#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
const char *config_backend;
#if defined(CONFIG_HAL)
config_backend = "HAL";
-#else
+#elif defined(CONFIG_UDEV)
config_backend = "udev";
+#else
+ config_backend = "wscons";
#endif
xf86Msg(X_INFO, "The server relies on %s to provide the list of "
"input devices.\n\tIf no devices become available, "
diff --git a/xorg-server/hw/xfree86/common/xf86Globals.c b/xorg-server/hw/xfree86/common/xf86Globals.c
index 93533ec80..f46799615 100644
--- a/xorg-server/hw/xfree86/common/xf86Globals.c
+++ b/xorg-server/hw/xfree86/common/xf86Globals.c
@@ -96,7 +96,6 @@ InputInfoPtr xf86InputDevs = NULL;
xf86InfoRec xf86Info = {
.consoleFd = -1,
.vtno = -1,
- .vtSysreq = FALSE,
.lastEventTime = -1,
.vtRequestsPending = FALSE,
#ifdef sun
@@ -111,7 +110,6 @@ xf86InfoRec xf86Info = {
.caughtSignal = FALSE,
.currentScreen = NULL,
#ifdef CSRG_BASED
- .screenFd = -1,
.consType = -1,
#endif
.allowMouseOpenFail = FALSE,
@@ -125,7 +123,7 @@ xf86InfoRec xf86Info = {
.log = LogNone,
.disableRandR = FALSE,
.randRFrom = X_DEFAULT,
-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
+#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
.forceInputDevices = FALSE,
.autoAddDevices = TRUE,
.autoEnableDevices = TRUE
diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h
index 3038c0404..330d87ae8 100644
--- a/xorg-server/hw/xfree86/common/xf86Module.h
+++ b/xorg-server/hw/xfree86/common/xf86Module.h
@@ -83,7 +83,7 @@ typedef enum {
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(11, 0)
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(13, 0)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(14, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(6, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
diff --git a/xorg-server/hw/xfree86/common/xf86Privstr.h b/xorg-server/hw/xfree86/common/xf86Privstr.h
index 14cd56a26..79bc8a084 100644
--- a/xorg-server/hw/xfree86/common/xf86Privstr.h
+++ b/xorg-server/hw/xfree86/common/xf86Privstr.h
@@ -57,7 +57,6 @@ typedef enum {
typedef struct {
int consoleFd;
int vtno;
- Bool vtSysreq;
/* event handler part */
int lastEventTime;
@@ -76,8 +75,6 @@ typedef struct {
/* graphics part */
ScreenPtr currentScreen;
#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
- int screenFd; /* fd for memory mapped access to
- * vga card */
int consType; /* Which console driver? */
#endif
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c
index 9fbcba9d5..ea1f92761 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.c
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.c
@@ -936,7 +936,8 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
if (strcmp(input_option_get_key(option), "_source") == 0 &&
(strcmp(input_option_get_value(option), "server/hal") == 0 ||
- strcmp(input_option_get_value(option), "server/udev") == 0)) {
+ strcmp(input_option_get_value(option), "server/udev") == 0 ||
+ strcmp(input_option_get_value(option), "server/wscons") == 0)) {
is_auto = 1;
if (!xf86Info.autoAddDevices) {
rval = BadMatch;
@@ -1363,15 +1364,15 @@ xf86XInputSetScreen(InputInfoPtr pInfo,
}
-void
+Bool
xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval,
int resolution, int min_res, int max_res, int mode)
{
if (!dev || !dev->valuator)
- return;
+ return FALSE;
- InitValuatorAxisStruct(dev, axnum, label, minval, maxval, resolution, min_res,
- max_res, mode);
+ return InitValuatorAxisStruct(dev, axnum, label, minval, maxval, resolution, min_res,
+ max_res, mode);
}
/*
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.h b/xorg-server/hw/xfree86/common/xf86Xinput.h
index a4d9e58a5..189f7abaf 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.h
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.h
@@ -145,7 +145,7 @@ extern _X_EXPORT InputInfoPtr xf86FirstLocalDevice(void);
extern _X_EXPORT int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min);
extern _X_EXPORT void xf86XInputSetScreen(InputInfoPtr pInfo, int screen_number, int x, int y);
extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, XF86OptionPtr options);
-extern _X_EXPORT void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
+extern _X_EXPORT Bool xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
int maxval, int resolution, int min_res,
int max_res, int mode);
extern _X_EXPORT void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum);
diff --git a/xorg-server/hw/xfree86/doc/ddxDesign.xml b/xorg-server/hw/xfree86/doc/ddxDesign.xml
index bc25c56d8..a4baad557 100644
--- a/xorg-server/hw/xfree86/doc/ddxDesign.xml
+++ b/xorg-server/hw/xfree86/doc/ddxDesign.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+ <!ENTITY % xorg-defs SYSTEM "defs.ent"> %xorg-defs;
<!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
<!-- config file keyword markup -->
<!-- specific config file keywords -->
@@ -19,13 +20,11 @@
<article id="ddxDesign">
<articleinfo>
- <title>XFree86 DDX Design (Xorg server version &xserver.version;)</title>
+ <title>XFree86 DDX Design</title>
<authorgroup>
- <corpauthor><ulink url="http://www.xfree86.org/">
- The XFree86 Project, Inc.</ulink></corpauthor>
- <corpauthor><ulink url="http://www.x.org/">
- The X.Org Foundation, Inc.</ulink></corpauthor>
+ <corpauthor>The XFree86 Project</corpauthor>
+ <corpauthor>The X.Org Foundation</corpauthor>
<othercredit>
<firstname>Jim</firstname><surname>Gettys</surname>
@@ -34,6 +33,7 @@
</authorgroup>
<pubdate>&xserver.reldate;</pubdate>
+ <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
<releaseinfo>Xorg server version &xserver.version;</releaseinfo>
</articleinfo>
diff --git a/xorg-server/hw/xfree86/man/xorg.conf.man b/xorg-server/hw/xfree86/man/xorg.conf.man
index 62c491cb2..7f98851b6 100644
--- a/xorg-server/hw/xfree86/man/xorg.conf.man
+++ b/xorg-server/hw/xfree86/man/xorg.conf.man
@@ -560,18 +560,6 @@ drivers to not report failure if the mouse device can't be opened/initialised.
It has no effect on the evdev(__drivermansuffix__) or other drivers.
Default: false.
.TP 7
-.BI "Option \*qVTSysReq\*q \*q" boolean \*q
-enables the SYSV\-style VT switch sequence for non\-SYSV systems
-which support VT switching.
-This sequence is
-.B Alt\-SysRq
-followed by a function key
-.RB ( Fn ).
-This prevents the __xservername__ server trapping the
-keys used for the default VT switch sequence, which means that clients can
-access them.
-Default: off.
-.TP 7
.BI "Option \*qBlankTime\*q \*q" time \*q
sets the inactivity timeout for the
.B blank
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c
index 1f43ab9a6..3fae039ed 100644
--- a/xorg-server/hw/xfree86/modes/xf86Crtc.c
+++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c
@@ -1,3237 +1,3238 @@
-/*
- * Copyright © 2006 Keith Packard
- * Copyright © 2008 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#else
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#endif
-
-#include <stddef.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "xf86.h"
-#include "xf86DDC.h"
-#include "xf86Crtc.h"
-#include "xf86Modes.h"
-#include "xf86Priv.h"
-#include "xf86RandR12.h"
-#include "X11/extensions/render.h"
-#include "X11/extensions/dpmsconst.h"
-#include "X11/Xatom.h"
-#include "picturestr.h"
-
-#include "xf86xv.h"
-
-#define NO_OUTPUT_DEFAULT_WIDTH 1024
-#define NO_OUTPUT_DEFAULT_HEIGHT 768
-/*
- * Initialize xf86CrtcConfig structure
- */
-
-int xf86CrtcConfigPrivateIndex = -1;
-
-void
-xf86CrtcConfigInit (ScrnInfoPtr scrn,
- const xf86CrtcConfigFuncsRec *funcs)
-{
- xf86CrtcConfigPtr config;
-
- if (xf86CrtcConfigPrivateIndex == -1)
- xf86CrtcConfigPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
- config = xnfcalloc (1, sizeof (xf86CrtcConfigRec));
-
- config->funcs = funcs;
-
- scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config;
-}
-
-void
-xf86CrtcSetSizeRange (ScrnInfoPtr scrn,
- int minWidth, int minHeight,
- int maxWidth, int maxHeight)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-
- config->minWidth = minWidth;
- config->minHeight = minHeight;
- config->maxWidth = maxWidth;
- config->maxHeight = maxHeight;
-}
-
-/*
- * Crtc functions
- */
-xf86CrtcPtr
-xf86CrtcCreate (ScrnInfoPtr scrn,
- const xf86CrtcFuncsRec *funcs)
-{
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
- xf86CrtcPtr crtc, *crtcs;
-
- crtc = calloc(sizeof (xf86CrtcRec), 1);
- if (!crtc)
- return NULL;
- crtc->version = XF86_CRTC_VERSION;
- crtc->scrn = scrn;
- crtc->funcs = funcs;
-#ifdef RANDR_12_INTERFACE
- crtc->randr_crtc = NULL;
-#endif
- crtc->rotation = RR_Rotate_0;
- crtc->desiredRotation = RR_Rotate_0;
- pixman_transform_init_identity (&crtc->crtc_to_framebuffer);
- pixman_f_transform_init_identity (&crtc->f_crtc_to_framebuffer);
- pixman_f_transform_init_identity (&crtc->f_framebuffer_to_crtc);
- crtc->filter = NULL;
- crtc->params = NULL;
- crtc->nparams = 0;
- crtc->filter_width = 0;
- crtc->filter_height = 0;
- crtc->transform_in_use = FALSE;
- crtc->transformPresent = FALSE;
- crtc->desiredTransformPresent = FALSE;
- memset (&crtc->bounds, '\0', sizeof (crtc->bounds));
-
- /* Preallocate gamma at a sensible size. */
- crtc->gamma_size = 256;
- crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof (CARD16));
- if (!crtc->gamma_red) {
- free(crtc);
- return NULL;
- }
- crtc->gamma_green = crtc->gamma_red + crtc->gamma_size;
- crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size;
-
- if (xf86_config->crtc)
- crtcs = realloc(xf86_config->crtc,
- (xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
- else
- crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
- if (!crtcs)
- {
- free(crtc);
- return NULL;
- }
- xf86_config->crtc = crtcs;
- xf86_config->crtc[xf86_config->num_crtc++] = crtc;
- return crtc;
-}
-
-void
-xf86CrtcDestroy (xf86CrtcPtr crtc)
-{
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
- int c;
-
- (*crtc->funcs->destroy) (crtc);
- for (c = 0; c < xf86_config->num_crtc; c++)
- if (xf86_config->crtc[c] == crtc)
- {
- memmove (&xf86_config->crtc[c],
- &xf86_config->crtc[c+1],
- ((xf86_config->num_crtc - (c + 1)) * sizeof(void*)));
- xf86_config->num_crtc--;
- break;
- }
- free(crtc->params);
- free(crtc->gamma_red);
- free(crtc);
-}
-
-
-/**
- * Return whether any outputs are connected to the specified pipe
- */
-
-Bool
-xf86CrtcInUse (xf86CrtcPtr crtc)
-{
- ScrnInfoPtr pScrn = crtc->scrn;
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- int o;
-
- for (o = 0; o < xf86_config->num_output; o++)
- if (xf86_config->output[o]->crtc == crtc)
- return TRUE;
- return FALSE;
-}
-
-void
-xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen)
-{
- int subpixel_order = SubPixelUnknown;
- Bool has_none = FALSE;
- ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
- int c, o;
-
- for (c = 0; c < xf86_config->num_crtc; c++)
- {
- xf86CrtcPtr crtc = xf86_config->crtc[c];
-
- for (o = 0; o < xf86_config->num_output; o++)
- {
- xf86OutputPtr output = xf86_config->output[o];
-
- if (output->crtc == crtc)
- {
- switch (output->subpixel_order) {
- case SubPixelNone:
- has_none = TRUE;
- break;
- case SubPixelUnknown:
- break;
- default:
- subpixel_order = output->subpixel_order;
- break;
- }
- }
- if (subpixel_order != SubPixelUnknown)
- break;
- }
- if (subpixel_order != SubPixelUnknown)
- {
- static const int circle[4] = {
- SubPixelHorizontalRGB,
- SubPixelVerticalRGB,
- SubPixelHorizontalBGR,
- SubPixelVerticalBGR,
- };
- int rotate;
- int c;
- for (rotate = 0; rotate < 4; rotate++)
- if (crtc->rotation & (1 << rotate))
- break;
- for (c = 0; c < 4; c++)
- if (circle[c] == subpixel_order)
- break;
- c = (c + rotate) & 0x3;
- if ((crtc->rotation & RR_Reflect_X) && !(c & 1))
- c ^= 2;
- if ((crtc->rotation & RR_Reflect_Y) && (c & 1))
- c ^= 2;
- subpixel_order = circle[c];
- break;
- }
- }
- if (subpixel_order == SubPixelUnknown && has_none)
- subpixel_order = SubPixelNone;
- PictureSetSubpixelOrder (pScreen, subpixel_order);
-}
-
-/**
- * Sets the given video mode on the given crtc
- */
-Bool
-xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
- RRTransformPtr transform, int x, int y)
-{
- ScrnInfoPtr scrn = crtc->scrn;
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
- int i;
- Bool ret = FALSE;
- Bool didLock = FALSE;
- DisplayModePtr adjusted_mode;
- DisplayModeRec saved_mode;
- int saved_x, saved_y;
- Rotation saved_rotation;
- RRTransformRec saved_transform;
- Bool saved_transform_present;
-
- crtc->enabled = xf86CrtcInUse (crtc);
-
- /* We only hit this if someone explicitly sends a "disabled" modeset. */
- if (!crtc->enabled)
- {
- /* Check everything for stuff that should be off. */
- xf86DisableUnusedFunctions(scrn);
- return TRUE;
- }
-
- adjusted_mode = xf86DuplicateMode(mode);
-
-
- saved_mode = crtc->mode;
- saved_x = crtc->x;
- saved_y = crtc->y;
- saved_rotation = crtc->rotation;
- if (crtc->transformPresent) {
- RRTransformInit (&saved_transform);
- RRTransformCopy (&saved_transform, &crtc->transform);
- }
- saved_transform_present = crtc->transformPresent;
-
- /* Update crtc values up front so the driver can rely on them for mode
- * setting.
- */
- crtc->mode = *mode;
- crtc->x = x;
- crtc->y = y;
- crtc->rotation = rotation;
- if (transform) {
- RRTransformCopy (&crtc->transform, transform);
- crtc->transformPresent = TRUE;
- } else
- crtc->transformPresent = FALSE;
-
- if (crtc->funcs->set_mode_major) {
- ret = crtc->funcs->set_mode_major(crtc, mode, rotation, x, y);
- goto done;
- }
-
- didLock = crtc->funcs->lock (crtc);
- /* Pass our mode to the outputs and the CRTC to give them a chance to
- * adjust it according to limitations or output properties, and also
- * a chance to reject the mode entirely.
- */
- for (i = 0; i < xf86_config->num_output; i++) {
- xf86OutputPtr output = xf86_config->output[i];
-
- if (output->crtc != crtc)
- continue;
-
- if (!output->funcs->mode_fixup(output, mode, adjusted_mode)) {
- goto done;
- }
- }
-
- if (!crtc->funcs->mode_fixup(crtc, mode, adjusted_mode)) {
- goto done;
- }
-
- if (!xf86CrtcRotate (crtc))
- goto done;
-
- /* Prepare the outputs and CRTCs before setting the mode. */
- for (i = 0; i < xf86_config->num_output; i++) {
- xf86OutputPtr output = xf86_config->output[i];
-
- if (output->crtc != crtc)
- continue;
-
- /* Disable the output as the first thing we do. */
- output->funcs->prepare(output);
- }
-
- crtc->funcs->prepare(crtc);
-
- /* Set up the DPLL and any output state that needs to adjust or depend
- * on the DPLL.
- */
- crtc->funcs->mode_set(crtc, mode, adjusted_mode, crtc->x, crtc->y);
- for (i = 0; i < xf86_config->num_output; i++)
- {
- xf86OutputPtr output = xf86_config->output[i];
- if (output->crtc == crtc)
- output->funcs->mode_set(output, mode, adjusted_mode);
- }
-
- /* Only upload when needed, to avoid unneeded delays. */
- if (!crtc->active && crtc->funcs->gamma_set)
- crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green,
- crtc->gamma_blue, crtc->gamma_size);
-
- /* Now, enable the clocks, plane, pipe, and outputs that we set up. */
- crtc->funcs->commit(crtc);
- for (i = 0; i < xf86_config->num_output; i++)
- {
- xf86OutputPtr output = xf86_config->output[i];
- if (output->crtc == crtc)
- output->funcs->commit(output);
- }
-
- ret = TRUE;
-
-done:
- if (ret) {
- crtc->active = TRUE;
- if (scrn->pScreen)
- xf86CrtcSetScreenSubpixelOrder (scrn->pScreen);
- if (scrn->ModeSet)
- scrn->ModeSet(scrn);
- } else {
- crtc->x = saved_x;
- crtc->y = saved_y;
- crtc->rotation = saved_rotation;
- crtc->mode = saved_mode;
- if (saved_transform_present)
- RRTransformCopy (&crtc->transform, &saved_transform);
- crtc->transformPresent = saved_transform_present;
- }
-
- free(adjusted_mode->name);
- free(adjusted_mode);
-
- if (didLock)
- crtc->funcs->unlock (crtc);
-
- return ret;
-}
-
-/**
- * Sets the given video mode on the given crtc, but without providing
- * a transform
- */
-Bool
-xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
- int x, int y)
-{
- return xf86CrtcSetModeTransform (crtc, mode, rotation, NULL, x, y);
-}
-
-/**
- * Pans the screen, does not change the mode
- */
-void
-xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y)
-{
- ScrnInfoPtr scrn = crtc->scrn;
-
- crtc->x = x;
- crtc->y = y;
- if (crtc->funcs->set_origin) {
- if (!xf86CrtcRotate (crtc))
- return;
- crtc->funcs->set_origin (crtc, x, y);
- if (scrn->ModeSet)
- scrn->ModeSet(scrn);
- }
- else
- xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y);
-}
-
-/*
- * Output functions
- */
-
-extern XF86ConfigPtr xf86configptr;
-
-typedef enum {
- OPTION_PREFERRED_MODE,
- OPTION_POSITION,
- OPTION_BELOW,
- OPTION_RIGHT_OF,
- OPTION_ABOVE,
- OPTION_LEFT_OF,
- OPTION_ENABLE,
- OPTION_DISABLE,
- OPTION_MIN_CLOCK,
- OPTION_MAX_CLOCK,
- OPTION_IGNORE,
- OPTION_ROTATE,
- OPTION_PANNING,
- OPTION_PRIMARY,
- OPTION_DEFAULT_MODES,
-} OutputOpts;
-
-static OptionInfoRec xf86OutputOptions[] = {
- {OPTION_PREFERRED_MODE, "PreferredMode", OPTV_STRING, {0}, FALSE },
- {OPTION_POSITION, "Position", OPTV_STRING, {0}, FALSE },
- {OPTION_BELOW, "Below", OPTV_STRING, {0}, FALSE },
- {OPTION_RIGHT_OF, "RightOf", OPTV_STRING, {0}, FALSE },
- {OPTION_ABOVE, "Above", OPTV_STRING, {0}, FALSE },
- {OPTION_LEFT_OF, "LeftOf", OPTV_STRING, {0}, FALSE },
- {OPTION_ENABLE, "Enable", OPTV_BOOLEAN, {0}, FALSE },
- {OPTION_DISABLE, "Disable", OPTV_BOOLEAN, {0}, FALSE },
- {OPTION_MIN_CLOCK, "MinClock", OPTV_FREQ, {0}, FALSE },
- {OPTION_MAX_CLOCK, "MaxClock", OPTV_FREQ, {0}, FALSE },
- {OPTION_IGNORE, "Ignore", OPTV_BOOLEAN, {0}, FALSE },
- {OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE },
- {OPTION_PANNING, "Panning", OPTV_STRING, {0}, FALSE },
- {OPTION_PRIMARY, "Primary", OPTV_BOOLEAN, {0}, FALSE },
- {OPTION_DEFAULT_MODES, "DefaultModes", OPTV_BOOLEAN, {0}, FALSE },
- {-1, NULL, OPTV_NONE, {0}, FALSE },
-};
-
-enum {
- OPTION_MODEDEBUG,
-};
-
-static OptionInfoRec xf86DeviceOptions[] = {
- {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE },
- {-1, NULL, OPTV_NONE, {0}, FALSE },
-};
-
-static void
-xf86OutputSetMonitor (xf86OutputPtr output)
-{
- char *option_name;
- char *monitor;
-
- if (!output->name)
- return;
-
- free(output->options);
-
- output->options = xnfalloc (sizeof (xf86OutputOptions));
- memcpy (output->options, xf86OutputOptions, sizeof (xf86OutputOptions));
-
- XNFasprintf(&option_name, "monitor-%s", output->name);
- monitor = xf86findOptionValue (output->scrn->options, option_name);
- if (!monitor)
- monitor = output->name;
- else
- xf86MarkOptionUsedByName (output->scrn->options, option_name);
- free(option_name);
- output->conf_monitor = xf86findMonitor (monitor,
- xf86configptr->conf_monitor_lst);
- /*
- * Find the monitor section of the screen and use that
- */
- if (!output->conf_monitor && output->use_screen_monitor)
- output->conf_monitor = xf86findMonitor (output->scrn->monitor->id,
- xf86configptr->conf_monitor_lst);
- if (output->conf_monitor)
- {
- xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
- "Output %s using monitor section %s\n",
- output->name, output->conf_monitor->mon_identifier);
- xf86ProcessOptions (output->scrn->scrnIndex,
- output->conf_monitor->mon_option_lst,
- output->options);
- }
- else
- xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
- "Output %s has no monitor section\n",
- output->name);
-}
-
-static Bool
-xf86OutputEnabled (xf86OutputPtr output, Bool strict)
-{
- Bool enable, disable;
-
- /* check to see if this output was enabled in the config file */
- if (xf86GetOptValBool (output->options, OPTION_ENABLE, &enable) && enable)
- {
- xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
- "Output %s enabled by config file\n", output->name);
- return TRUE;
- }
- /* or if this output was disabled in the config file */
- if (xf86GetOptValBool (output->options, OPTION_DISABLE, &disable) && disable)
- {
- xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
- "Output %s disabled by config file\n", output->name);
- return FALSE;
- }
-
- /* If not, try to only light up the ones we know are connected */
- if (strict) {
- enable = output->status == XF86OutputStatusConnected;
- }
- /* But if that fails, try to light up even outputs we're unsure of */
- else {
- enable = output->status != XF86OutputStatusDisconnected;
- }
-
- xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
- "Output %s %sconnected\n", output->name, enable ? "" : "dis");
- return enable;
-}
-
-static Bool
-xf86OutputIgnored (xf86OutputPtr output)
-{
- return xf86ReturnOptValBool (output->options, OPTION_IGNORE, FALSE);
-}
-
-static char *direction[4] = {
- "normal",
- "left",
- "inverted",
- "right"
-};
-
-static Rotation
-xf86OutputInitialRotation (xf86OutputPtr output)
-{
- char *rotate_name = xf86GetOptValString (output->options,
- OPTION_ROTATE);
- int i;
-
- if (!rotate_name) {
- if (output->initial_rotation)
- return output->initial_rotation;
- return RR_Rotate_0;
- }
-
- for (i = 0; i < 4; i++)
- if (xf86nameCompare (direction[i], rotate_name) == 0)
- return 1 << i;
- return RR_Rotate_0;
-}
-
-xf86OutputPtr
-xf86OutputCreate (ScrnInfoPtr scrn,
- const xf86OutputFuncsRec *funcs,
- const char *name)
-{
- xf86OutputPtr output, *outputs;
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
- int len;
- Bool primary;
-
- if (name)
- len = strlen (name) + 1;
- else
- len = 0;
-
- output = calloc(sizeof (xf86OutputRec) + len, 1);
- if (!output)
- return NULL;
- output->scrn = scrn;
- output->funcs = funcs;
- if (name)
- {
- output->name = (char *) (output + 1);
- strcpy (output->name, name);
- }
- output->subpixel_order = SubPixelUnknown;
- /*
- * Use the old per-screen monitor section for the first output
- */
- output->use_screen_monitor = (xf86_config->num_output == 0);
-#ifdef RANDR_12_INTERFACE
- output->randr_output = NULL;
-#endif
- if (name)
- {
- xf86OutputSetMonitor (output);
- if (xf86OutputIgnored (output))
- {
- free(output);
- return FALSE;
- }
- }
-
-
- if (xf86_config->output)
- outputs = realloc(xf86_config->output,
- (xf86_config->num_output + 1) * sizeof (xf86OutputPtr));
- else
- outputs = malloc((xf86_config->num_output + 1) * sizeof (xf86OutputPtr));
- if (!outputs)
- {
- free(output);
- return NULL;
- }
-
- xf86_config->output = outputs;
-
- if (xf86GetOptValBool (output->options, OPTION_PRIMARY, &primary) && primary)
- {
- memmove(xf86_config->output + 1, xf86_config->output,
- xf86_config->num_output * sizeof (xf86OutputPtr));
- xf86_config->output[0] = output;
- }
- else
- {
- xf86_config->output[xf86_config->num_output] = output;
- }
-
- xf86_config->num_output++;
-
- return output;
-}
-
-Bool
-xf86OutputRename (xf86OutputPtr output, const char *name)
-{
- char *newname = strdup(name);
-
- if (!newname)
- return FALSE; /* so sorry... */
-
- if (output->name && output->name != (char *) (output + 1))
- free(output->name);
- output->name = newname;
- xf86OutputSetMonitor (output);
- if (xf86OutputIgnored (output))
- return FALSE;
- return TRUE;
-}
-
-void
-xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor)
-{
- if (use_screen_monitor != output->use_screen_monitor)
- {
- output->use_screen_monitor = use_screen_monitor;
- xf86OutputSetMonitor (output);
- }
-}
-
-void
-xf86OutputDestroy (xf86OutputPtr output)
-{
- ScrnInfoPtr scrn = output->scrn;
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
- int o;
-
- (*output->funcs->destroy) (output);
- while (output->probed_modes)
- xf86DeleteMode (&output->probed_modes, output->probed_modes);
- for (o = 0; o < xf86_config->num_output; o++)
- if (xf86_config->output[o] == output)
- {
- memmove (&xf86_config->output[o],
- &xf86_config->output[o+1],
- ((xf86_config->num_output - (o + 1)) * sizeof(void*)));
- xf86_config->num_output--;
- break;
- }
- if (output->name && output->name != (char *) (output + 1))
- free(output->name);
- free(output);
-}
-
-/*
- * Called during CreateScreenResources to hook up RandR
- */
-static Bool
-xf86CrtcCreateScreenResources (ScreenPtr screen)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-
- screen->CreateScreenResources = config->CreateScreenResources;
-
- if (!(*screen->CreateScreenResources)(screen))
- return FALSE;
-
- if (!xf86RandR12CreateScreenResources (screen))
- return FALSE;
-
- return TRUE;
-}
-
-/*
- * Clean up config on server reset
- */
-static Bool
-xf86CrtcCloseScreen (int index, ScreenPtr screen)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int o, c;
-
- screen->CloseScreen = config->CloseScreen;
-
- xf86RotateCloseScreen (screen);
-
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
-
- output->randr_output = NULL;
- }
- for (c = 0; c < config->num_crtc; c++)
- {
- xf86CrtcPtr crtc = config->crtc[c];
-
- crtc->randr_crtc = NULL;
- }
- xf86RandR12CloseScreen (screen);
-
- return screen->CloseScreen (index, screen);
-}
-
-/*
- * Called at ScreenInit time to set up
- */
-#ifdef RANDR_13_INTERFACE
-int
-#else
-Bool
-#endif
-xf86CrtcScreenInit (ScreenPtr screen)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int c;
-
- /* Rotation */
- xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n");
- xf86DisableRandR(); /* Disable old RandR extension support */
- xf86RandR12Init (screen);
-
- /* support all rotations if every crtc has the shadow alloc funcs */
- for (c = 0; c < config->num_crtc; c++)
- {
- xf86CrtcPtr crtc = config->crtc[c];
- if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create)
- break;
- }
- if (c == config->num_crtc)
- {
- xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 |
- RR_Rotate_180 | RR_Rotate_270 |
- RR_Reflect_X | RR_Reflect_Y);
- xf86RandR12SetTransformSupport (screen, TRUE);
- }
- else
- {
- xf86RandR12SetRotations (screen, RR_Rotate_0);
- xf86RandR12SetTransformSupport (screen, FALSE);
- }
-
- /* Wrap CreateScreenResources so we can initialize the RandR code */
- config->CreateScreenResources = screen->CreateScreenResources;
- screen->CreateScreenResources = xf86CrtcCreateScreenResources;
-
- config->CloseScreen = screen->CloseScreen;
- screen->CloseScreen = xf86CrtcCloseScreen;
-
-#ifdef XFreeXDGA
- _xf86_di_dga_init_internal(screen);
-#endif
-#ifdef RANDR_13_INTERFACE
- return RANDR_INTERFACE_VERSION;
-#else
- return TRUE;
-#endif
-}
-
-static DisplayModePtr
-xf86DefaultMode (xf86OutputPtr output, int width, int height)
-{
- DisplayModePtr target_mode = NULL;
- DisplayModePtr mode;
- int target_diff = 0;
- int target_preferred = 0;
- int mm_height;
-
- mm_height = output->mm_height;
- if (!mm_height)
- mm_height = (768 * 25.4) / DEFAULT_DPI;
- /*
- * Pick a mode closest to DEFAULT_DPI
- */
- for (mode = output->probed_modes; mode; mode = mode->next)
- {
- int dpi;
- int preferred = (((mode->type & M_T_PREFERRED) != 0) +
- ((mode->type & M_T_USERPREF) != 0));
- int diff;
-
- if (xf86ModeWidth (mode, output->initial_rotation) > width ||
- xf86ModeHeight (mode, output->initial_rotation) > height)
- continue;
-
- /* yes, use VDisplay here, not xf86ModeHeight */
- dpi = (mode->VDisplay * 254) / (mm_height * 10);
- diff = dpi - DEFAULT_DPI;
- diff = diff < 0 ? -diff : diff;
- if (target_mode == NULL || (preferred > target_preferred) ||
- (preferred == target_preferred && diff < target_diff))
- {
- target_mode = mode;
- target_diff = diff;
- target_preferred = preferred;
- }
- }
- return target_mode;
-}
-
-static DisplayModePtr
-xf86ClosestMode (xf86OutputPtr output,
- DisplayModePtr match, Rotation match_rotation,
- int width, int height)
-{
- DisplayModePtr target_mode = NULL;
- DisplayModePtr mode;
- int target_diff = 0;
-
- /*
- * Pick a mode closest to the specified mode
- */
- for (mode = output->probed_modes; mode; mode = mode->next)
- {
- int dx, dy;
- int diff;
-
- if (xf86ModeWidth (mode, output->initial_rotation) > width ||
- xf86ModeHeight (mode, output->initial_rotation) > height)
- continue;
-
- /* exact matches are preferred */
- if (output->initial_rotation == match_rotation &&
- xf86ModesEqual (mode, match))
- return mode;
-
- dx = xf86ModeWidth (match, match_rotation) - xf86ModeWidth (mode, output->initial_rotation);
- dy = xf86ModeHeight (match, match_rotation) - xf86ModeHeight (mode, output->initial_rotation);
- diff = dx * dx + dy * dy;
- if (target_mode == NULL || diff < target_diff)
- {
- target_mode = mode;
- target_diff = diff;
- }
- }
- return target_mode;
-}
-
-static DisplayModePtr
-xf86OutputHasPreferredMode (xf86OutputPtr output, int width, int height)
-{
- DisplayModePtr mode;
-
- for (mode = output->probed_modes; mode; mode = mode->next)
- {
- if (xf86ModeWidth (mode, output->initial_rotation) > width ||
- xf86ModeHeight (mode, output->initial_rotation) > height)
- continue;
-
- if (mode->type & M_T_PREFERRED)
- return mode;
- }
- return NULL;
-}
-
-static DisplayModePtr
-xf86OutputHasUserPreferredMode (xf86OutputPtr output)
-{
- DisplayModePtr mode, first = output->probed_modes;
-
- for (mode = first; mode && mode->next != first; mode = mode->next)
- if (mode->type & M_T_USERPREF)
- return mode;
-
- return NULL;
-}
-
-static int
-xf86PickCrtcs (ScrnInfoPtr scrn,
- xf86CrtcPtr *best_crtcs,
- DisplayModePtr *modes,
- int n,
- int width,
- int height)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int c, o;
- xf86OutputPtr output;
- xf86CrtcPtr crtc;
- xf86CrtcPtr *crtcs;
- xf86CrtcPtr best_crtc;
- int best_score;
- int score;
- int my_score;
-
- if (n == config->num_output)
- return 0;
- output = config->output[n];
-
- /*
- * Compute score with this output disabled
- */
- best_crtcs[n] = NULL;
- best_crtc = NULL;
- best_score = xf86PickCrtcs (scrn, best_crtcs, modes, n+1, width, height);
- if (modes[n] == NULL)
- return best_score;
-
- crtcs = malloc(config->num_output * sizeof (xf86CrtcPtr));
- if (!crtcs)
- return best_score;
-
- my_score = 1;
- /* Score outputs that are known to be connected higher */
- if (output->status == XF86OutputStatusConnected)
- my_score++;
- /* Score outputs with preferred modes higher */
- if (xf86OutputHasPreferredMode (output, width, height))
- my_score++;
- /*
- * Select a crtc for this output and
- * then attempt to configure the remaining
- * outputs
- */
- for (c = 0; c < config->num_crtc; c++)
- {
- if ((output->possible_crtcs & (1 << c)) == 0)
- continue;
-
- crtc = config->crtc[c];
- /*
- * Check to see if some other output is
- * using this crtc
- */
- for (o = 0; o < n; o++)
- if (best_crtcs[o] == crtc)
- break;
- if (o < n)
- {
- /*
- * If the two outputs desire the same mode,
- * see if they can be cloned
- */
- if (xf86ModesEqual (modes[o], modes[n]) &&
- config->output[o]->initial_rotation == config->output[n]->initial_rotation &&
- config->output[o]->initial_x == config->output[n]->initial_x &&
- config->output[o]->initial_y == config->output[n]->initial_y)
- {
- if ((output->possible_clones & (1 << o)) == 0)
- continue; /* nope, try next CRTC */
- }
- else
- continue; /* different modes, can't clone */
- }
- crtcs[n] = crtc;
- memcpy (crtcs, best_crtcs, n * sizeof (xf86CrtcPtr));
- score = my_score + xf86PickCrtcs (scrn, crtcs, modes, n+1, width, height);
- if (score > best_score)
- {
- best_crtc = crtc;
- best_score = score;
- memcpy (best_crtcs, crtcs, config->num_output * sizeof (xf86CrtcPtr));
- }
- }
- free(crtcs);
- return best_score;
-}
-
-
-/*
- * Compute the virtual size necessary to place all of the available
- * crtcs in the specified configuration.
- *
- * canGrow indicates that the driver can make the screen larger than its initial
- * configuration. If FALSE, this function will enlarge the screen to include
- * the largest available mode.
- */
-
-static void
-xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp,
- Bool canGrow)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int width = 0, height = 0;
- int o;
- int c;
- int s;
-
- for (c = 0; c < config->num_crtc; c++)
- {
- int crtc_width = 0, crtc_height = 0;
- xf86CrtcPtr crtc = config->crtc[c];
-
- if (crtc->enabled)
- {
- crtc_width = crtc->desiredX + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation);
- crtc_height = crtc->desiredY + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation);
- }
- if (!canGrow) {
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
-
- for (s = 0; s < config->num_crtc; s++)
- if (output->possible_crtcs & (1 << s))
- {
- DisplayModePtr mode;
- for (mode = output->probed_modes; mode; mode = mode->next)
- {
- if (mode->HDisplay > crtc_width)
- crtc_width = mode->HDisplay;
- if (mode->VDisplay > crtc_width)
- crtc_width = mode->VDisplay;
- if (mode->VDisplay > crtc_height)
- crtc_height = mode->VDisplay;
- if (mode->HDisplay > crtc_height)
- crtc_height = mode->HDisplay;
- }
- }
- }
- }
- if (crtc_width > width)
- width = crtc_width;
- if (crtc_height > height)
- height = crtc_height;
- }
- if (config->maxWidth && width > config->maxWidth) width = config->maxWidth;
- if (config->maxHeight && height > config->maxHeight) height = config->maxHeight;
- if (config->minWidth && width < config->minWidth) width = config->minWidth;
- if (config->minHeight && height < config->minHeight) height = config->minHeight;
- *widthp = width;
- *heightp = height;
-}
-
-#define POSITION_UNSET -100000
-
-/*
- * check if the user configured any outputs at all
- * with either a position or a relative setting or a mode.
- */
-static Bool
-xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int o;
- Bool user_conf = FALSE;
-
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
- char *position;
- char *relative_name;
- OutputOpts relation;
- int r;
- static const OutputOpts relations[] = {
- OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF
- };
-
- position = xf86GetOptValString (output->options,
- OPTION_POSITION);
- if (position)
- user_conf = TRUE;
-
- relation = 0;
- relative_name = NULL;
- for (r = 0; r < 4; r++)
- {
- relation = relations[r];
- relative_name = xf86GetOptValString (output->options,
- relation);
- if (relative_name)
- break;
- }
- if (relative_name)
- user_conf = TRUE;
-
- modes[o] = xf86OutputHasUserPreferredMode(output);
- if (modes[o])
- user_conf = TRUE;
- }
-
- return user_conf;
-}
-
-static Bool
-xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int o;
- int min_x, min_y;
-
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
-
- output->initial_x = output->initial_y = POSITION_UNSET;
- }
-
- /*
- * Loop until all outputs are set
- */
- for (;;)
- {
- Bool any_set = FALSE;
- Bool keep_going = FALSE;
-
- for (o = 0; o < config->num_output; o++)
- {
- static const OutputOpts relations[] = {
- OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF
- };
- xf86OutputPtr output = config->output[o];
- xf86OutputPtr relative;
- char *relative_name;
- char *position;
- OutputOpts relation;
- int r;
-
- if (output->initial_x != POSITION_UNSET)
- continue;
- position = xf86GetOptValString (output->options,
- OPTION_POSITION);
- /*
- * Absolute position wins
- */
- if (position)
- {
- int x, y;
- if (sscanf (position, "%d %d", &x, &y) == 2)
- {
- output->initial_x = x;
- output->initial_y = y;
- }
- else
- {
- xf86DrvMsg (scrn->scrnIndex, X_ERROR,
- "Output %s position not of form \"x y\"\n",
- output->name);
- output->initial_x = output->initial_y = 0;
- }
- any_set = TRUE;
- continue;
- }
- /*
- * Next comes relative positions
- */
- relation = 0;
- relative_name = NULL;
- for (r = 0; r < 4; r++)
- {
- relation = relations[r];
- relative_name = xf86GetOptValString (output->options,
- relation);
- if (relative_name)
- break;
- }
- if (relative_name)
- {
- int or;
- relative = NULL;
- for (or = 0; or < config->num_output; or++)
- {
- xf86OutputPtr out_rel = config->output[or];
- XF86ConfMonitorPtr rel_mon = out_rel->conf_monitor;
-
- if (rel_mon)
- {
- if (xf86nameCompare (rel_mon->mon_identifier,
- relative_name) == 0)
- {
- relative = config->output[or];
- break;
- }
- }
- if (strcmp (out_rel->name, relative_name) == 0)
- {
- relative = config->output[or];
- break;
- }
- }
- if (!relative)
- {
- xf86DrvMsg (scrn->scrnIndex, X_ERROR,
- "Cannot position output %s relative to unknown output %s\n",
- output->name, relative_name);
- output->initial_x = 0;
- output->initial_y = 0;
- any_set = TRUE;
- continue;
- }
- if (!modes[or])
- {
- xf86DrvMsg (scrn->scrnIndex, X_ERROR,
- "Cannot position output %s relative to output %s without modes\n",
- output->name, relative_name);
- output->initial_x = 0;
- output->initial_y = 0;
- any_set = TRUE;
- continue;
- }
- if (relative->initial_x == POSITION_UNSET)
- {
- keep_going = TRUE;
- continue;
- }
- output->initial_x = relative->initial_x;
- output->initial_y = relative->initial_y;
- switch (relation) {
- case OPTION_BELOW:
- output->initial_y += xf86ModeHeight (modes[or], relative->initial_rotation);
- break;
- case OPTION_RIGHT_OF:
- output->initial_x += xf86ModeWidth (modes[or], relative->initial_rotation);
- break;
- case OPTION_ABOVE:
- if (modes[o])
- output->initial_y -= xf86ModeHeight (modes[o], output->initial_rotation);
- break;
- case OPTION_LEFT_OF:
- if (modes[o])
- output->initial_x -= xf86ModeWidth (modes[o], output->initial_rotation);
- break;
- default:
- break;
- }
- any_set = TRUE;
- continue;
- }
-
- /* Nothing set, just stick them at 0,0 */
- output->initial_x = 0;
- output->initial_y = 0;
- any_set = TRUE;
- }
- if (!keep_going)
- break;
- if (!any_set)
- {
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
- if (output->initial_x == POSITION_UNSET)
- {
- xf86DrvMsg (scrn->scrnIndex, X_ERROR,
- "Output position loop. Moving %s to 0,0\n",
- output->name);
- output->initial_x = output->initial_y = 0;
- break;
- }
- }
- }
- }
-
- /*
- * normalize positions
- */
- min_x = 1000000;
- min_y = 1000000;
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
-
- if (output->initial_x < min_x)
- min_x = output->initial_x;
- if (output->initial_y < min_y)
- min_y = output->initial_y;
- }
-
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
-
- output->initial_x -= min_x;
- output->initial_y -= min_y;
- }
- return TRUE;
-}
-
-static void
-xf86InitialPanning (ScrnInfoPtr scrn)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int o;
-
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
- char *panning = xf86GetOptValString (output->options, OPTION_PANNING);
- int width, height, left, top;
- int track_width, track_height, track_left, track_top;
- int brdr[4];
-
- memset (&output->initialTotalArea, 0, sizeof(BoxRec));
- memset (&output->initialTrackingArea, 0, sizeof(BoxRec));
- memset (output->initialBorder, 0, 4*sizeof(INT16));
-
- if (! panning)
- continue;
-
- switch (sscanf (panning, "%dx%d+%d+%d/%dx%d+%d+%d/%d/%d/%d/%d",
- &width, &height, &left, &top,
- &track_width, &track_height, &track_left, &track_top,
- &brdr[0], &brdr[1], &brdr[2], &brdr[3])) {
- case 12:
- output->initialBorder[0] = brdr[0];
- output->initialBorder[1] = brdr[1];
- output->initialBorder[2] = brdr[2];
- output->initialBorder[3] = brdr[3];
- /* fall through */
- case 8:
- output->initialTrackingArea.x1 = track_left;
- output->initialTrackingArea.y1 = track_top;
- output->initialTrackingArea.x2 = track_left + track_width;
- output->initialTrackingArea.y2 = track_top + track_height;
- /* fall through */
- case 4:
- output->initialTotalArea.x1 = left;
- output->initialTotalArea.y1 = top;
- /* fall through */
- case 2:
- output->initialTotalArea.x2 = output->initialTotalArea.x1 + width;
- output->initialTotalArea.y2 = output->initialTotalArea.y1 + height;
- break;
- default:
- xf86DrvMsg (scrn->scrnIndex, X_ERROR,
- "Broken panning specification '%s' for output %s in config file\n",
- panning, output->name);
- }
- }
-}
-
-/** Return - 0 + if a should be earlier, same or later than b in list
- */
-static int
-xf86ModeCompare (DisplayModePtr a, DisplayModePtr b)
-{
- int diff;
-
- diff = ((b->type & M_T_PREFERRED) != 0) - ((a->type & M_T_PREFERRED) != 0);
- if (diff)
- return diff;
- diff = b->HDisplay * b->VDisplay - a->HDisplay * a->VDisplay;
- if (diff)
- return diff;
- diff = b->Clock - a->Clock;
- return diff;
-}
-
-/**
- * Insertion sort input in-place and return the resulting head
- */
-static DisplayModePtr
-xf86SortModes (DisplayModePtr input)
-{
- DisplayModePtr output = NULL, i, o, n, *op, prev;
-
- /* sort by preferred status and pixel area */
- while (input)
- {
- i = input;
- input = input->next;
- for (op = &output; (o = *op); op = &o->next)
- if (xf86ModeCompare (o, i) > 0)
- break;
- i->next = *op;
- *op = i;
- }
- /* prune identical modes */
- for (o = output; o && (n = o->next); o = n)
- {
- if (!strcmp (o->name, n->name) && xf86ModesEqual (o, n))
- {
- o->next = n->next;
- free(n->name);
- free(n);
- n = o;
- }
- }
- /* hook up backward links */
- prev = NULL;
- for (o = output; o; o = o->next)
- {
- o->prev = prev;
- prev = o;
- }
- return output;
-}
-
-static char *
-preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output)
-{
- char *preferred_mode = NULL;
-
- /* Check for a configured preference for a particular mode */
- preferred_mode = xf86GetOptValString (output->options,
- OPTION_PREFERRED_MODE);
- if (preferred_mode)
- return preferred_mode;
-
- if (pScrn->display->modes && *pScrn->display->modes)
- preferred_mode = *pScrn->display->modes;
-
- return preferred_mode;
-}
-
-static void
-GuessRangeFromModes(MonPtr mon, DisplayModePtr mode)
-{
- if (!mon || !mode)
- return;
-
- mon->nHsync = 1;
- mon->hsync[0].lo = 1024.0;
- mon->hsync[0].hi = 0.0;
-
- mon->nVrefresh = 1;
- mon->vrefresh[0].lo = 1024.0;
- mon->vrefresh[0].hi = 0.0;
-
- while (mode) {
- if (!mode->HSync)
- mode->HSync = ((float) mode->Clock ) / ((float) mode->HTotal);
-
- if (!mode->VRefresh)
- mode->VRefresh = (1000.0 * ((float) mode->Clock)) /
- ((float) (mode->HTotal * mode->VTotal));
-
- if (mode->HSync < mon->hsync[0].lo)
- mon->hsync[0].lo = mode->HSync;
-
- if (mode->HSync > mon->hsync[0].hi)
- mon->hsync[0].hi = mode->HSync;
-
- if (mode->VRefresh < mon->vrefresh[0].lo)
- mon->vrefresh[0].lo = mode->VRefresh;
-
- if (mode->VRefresh > mon->vrefresh[0].hi)
- mon->vrefresh[0].hi = mode->VRefresh;
-
- mode = mode->next;
- }
-
- /* stretch out the bottom to fit 640x480@60 */
- if (mon->hsync[0].lo > 31.0)
- mon->hsync[0].lo = 31.0;
- if (mon->vrefresh[0].lo > 58.0)
- mon->vrefresh[0].lo = 58.0;
-}
-
-enum det_monrec_source {
- sync_config, sync_edid, sync_default
-};
-
-struct det_monrec_parameter {
- MonRec *mon_rec;
- int *max_clock;
- Bool set_hsync;
- Bool set_vrefresh;
- enum det_monrec_source *sync_source;
-};
-
-static void handle_detailed_monrec(struct detailed_monitor_section *det_mon,
- void *data)
-{
- struct det_monrec_parameter *p;
- p = (struct det_monrec_parameter *)data;
-
- if (det_mon->type == DS_RANGES) {
- struct monitor_ranges *ranges = &det_mon->section.ranges;
- if (p->set_hsync && ranges->max_h) {
- p->mon_rec->hsync[p->mon_rec->nHsync].lo = ranges->min_h;
- p->mon_rec->hsync[p->mon_rec->nHsync].hi = ranges->max_h;
- p->mon_rec->nHsync++;
- if (*p->sync_source == sync_default)
- *p->sync_source = sync_edid;
- }
- if (p->set_vrefresh && ranges->max_v) {
- p->mon_rec->vrefresh[p->mon_rec->nVrefresh].lo = ranges->min_v;
- p->mon_rec->vrefresh[p->mon_rec->nVrefresh].hi = ranges->max_v;
- p->mon_rec->nVrefresh++;
- if (*p->sync_source == sync_default)
- *p->sync_source = sync_edid;
- }
- if (ranges->max_clock * 1000 > *p->max_clock)
- *p->max_clock = ranges->max_clock * 1000;
- }
-}
-
-void
-xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int o;
-
- /* When canGrow was TRUE in the initial configuration we have to
- * compare against the maximum values so that we don't drop modes.
- * When canGrow was FALSE, the maximum values would have been clamped
- * anyway.
- */
- if (maxX == 0 || maxY == 0) {
- maxX = config->maxWidth;
- maxY = config->maxHeight;
- }
-
- /* Probe the list of modes for each output. */
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
- DisplayModePtr mode;
- DisplayModePtr config_modes = NULL, output_modes, default_modes = NULL;
- char *preferred_mode;
- xf86MonPtr edid_monitor;
- XF86ConfMonitorPtr conf_monitor;
- MonRec mon_rec;
- int min_clock = 0;
- int max_clock = 0;
- double clock;
- Bool add_default_modes;
- Bool debug_modes = config->debug_modes ||
- xf86Initialising;
- enum det_monrec_source sync_source = sync_default;
-
- while (output->probed_modes != NULL)
- xf86DeleteMode(&output->probed_modes, output->probed_modes);
-
- /*
- * Check connection status
- */
- output->status = (*output->funcs->detect)(output);
-
- if (output->status == XF86OutputStatusDisconnected &&
- !xf86ReturnOptValBool(output->options, OPTION_ENABLE, FALSE))
- {
- xf86OutputSetEDID (output, NULL);
- continue;
- }
-
- memset (&mon_rec, '\0', sizeof (mon_rec));
-
- conf_monitor = output->conf_monitor;
-
- if (conf_monitor)
- {
- int i;
-
- for (i = 0; i < conf_monitor->mon_n_hsync; i++)
- {
- mon_rec.hsync[mon_rec.nHsync].lo = conf_monitor->mon_hsync[i].lo;
- mon_rec.hsync[mon_rec.nHsync].hi = conf_monitor->mon_hsync[i].hi;
- mon_rec.nHsync++;
- sync_source = sync_config;
- }
- for (i = 0; i < conf_monitor->mon_n_vrefresh; i++)
- {
- mon_rec.vrefresh[mon_rec.nVrefresh].lo = conf_monitor->mon_vrefresh[i].lo;
- mon_rec.vrefresh[mon_rec.nVrefresh].hi = conf_monitor->mon_vrefresh[i].hi;
- mon_rec.nVrefresh++;
- sync_source = sync_config;
- }
- config_modes = xf86GetMonitorModes (scrn, conf_monitor);
- }
-
- output_modes = (*output->funcs->get_modes) (output);
-
- /*
- * If the user has a preference, respect it.
- * Otherwise, don't second-guess the driver.
- */
- if (!xf86GetOptValBool(output->options, OPTION_DEFAULT_MODES,
- &add_default_modes))
- add_default_modes = (output_modes == NULL);
-
- edid_monitor = output->MonInfo;
-
- if (edid_monitor)
- {
- struct det_monrec_parameter p;
- struct disp_features *features = &edid_monitor->features;
-
- /* if display is not continuous-frequency, don't add default modes */
- if (!GTF_SUPPORTED(features->msc))
- add_default_modes = FALSE;
-
- p.mon_rec = &mon_rec;
- p.max_clock = &max_clock;
- p.set_hsync = mon_rec.nHsync == 0;
- p.set_vrefresh = mon_rec.nVrefresh == 0;
- p.sync_source = &sync_source;
-
- xf86ForEachDetailedBlock(edid_monitor,
- handle_detailed_monrec,
- &p);
- }
-
- if (xf86GetOptValFreq (output->options, OPTION_MIN_CLOCK,
- OPTUNITS_KHZ, &clock))
- min_clock = (int) clock;
- if (xf86GetOptValFreq (output->options, OPTION_MAX_CLOCK,
- OPTUNITS_KHZ, &clock))
- max_clock = (int) clock;
-
- /* If we still don't have a sync range, guess wildly */
- if (!mon_rec.nHsync || !mon_rec.nVrefresh)
- GuessRangeFromModes(&mon_rec, output_modes);
-
- /*
- * These limits will end up setting a 1024x768@60Hz mode by default,
- * which seems like a fairly good mode to use when nothing else is
- * specified
- */
- if (mon_rec.nHsync == 0)
- {
- mon_rec.hsync[0].lo = 31.0;
- mon_rec.hsync[0].hi = 55.0;
- mon_rec.nHsync = 1;
- }
- if (mon_rec.nVrefresh == 0)
- {
- mon_rec.vrefresh[0].lo = 58.0;
- mon_rec.vrefresh[0].hi = 62.0;
- mon_rec.nVrefresh = 1;
- }
-
- if (add_default_modes)
- default_modes = xf86GetDefaultModes ();
-
- /*
- * If this is not an RB monitor, remove RB modes from the default
- * pool. RB modes from the config or the monitor itself are fine.
- */
- if (!mon_rec.reducedblanking)
- xf86ValidateModesReducedBlanking (scrn, default_modes);
-
- if (sync_source == sync_config)
- {
- /*
- * Check output and config modes against sync range from config file
- */
- xf86ValidateModesSync (scrn, output_modes, &mon_rec);
- xf86ValidateModesSync (scrn, config_modes, &mon_rec);
- }
- /*
- * Check default modes against sync range
- */
- xf86ValidateModesSync (scrn, default_modes, &mon_rec);
- /*
- * Check default modes against monitor max clock
- */
- if (max_clock) {
- xf86ValidateModesClocks(scrn, default_modes,
- &min_clock, &max_clock, 1);
- xf86ValidateModesClocks(scrn, output_modes,
- &min_clock, &max_clock, 1);
- }
-
- output->probed_modes = NULL;
- output->probed_modes = xf86ModesAdd (output->probed_modes, config_modes);
- output->probed_modes = xf86ModesAdd (output->probed_modes, output_modes);
- output->probed_modes = xf86ModesAdd (output->probed_modes, default_modes);
-
- /*
- * Check all modes against max size, interlace, and doublescan
- */
- if (maxX && maxY)
- xf86ValidateModesSize (scrn, output->probed_modes,
- maxX, maxY, 0);
-
- {
- int flags = (output->interlaceAllowed ? V_INTERLACE : 0) |
- (output->doubleScanAllowed ? V_DBLSCAN : 0);
- xf86ValidateModesFlags (scrn, output->probed_modes, flags);
- }
-
- /*
- * Check all modes against output
- */
- for (mode = output->probed_modes; mode != NULL; mode = mode->next)
- if (mode->status == MODE_OK)
- mode->status = (*output->funcs->mode_valid)(output, mode);
-
- xf86PruneInvalidModes(scrn, &output->probed_modes, debug_modes);
-
- output->probed_modes = xf86SortModes (output->probed_modes);
-
- /* Check for a configured preference for a particular mode */
- preferred_mode = preferredMode(scrn, output);
-
- if (preferred_mode)
- {
- for (mode = output->probed_modes; mode; mode = mode->next)
- {
- if (!strcmp (preferred_mode, mode->name))
- {
- if (mode != output->probed_modes)
- {
- if (mode->prev)
- mode->prev->next = mode->next;
- if (mode->next)
- mode->next->prev = mode->prev;
- mode->next = output->probed_modes;
- output->probed_modes->prev = mode;
- mode->prev = NULL;
- output->probed_modes = mode;
- }
- mode->type |= (M_T_PREFERRED|M_T_USERPREF);
- break;
- }
- }
- }
-
- output->initial_rotation = xf86OutputInitialRotation (output);
-
- if (debug_modes) {
- if (output->probed_modes != NULL) {
- xf86DrvMsg(scrn->scrnIndex, X_INFO,
- "Printing probed modes for output %s\n",
- output->name);
- } else {
- xf86DrvMsg(scrn->scrnIndex, X_INFO,
- "No remaining probed modes for output %s\n",
- output->name);
- }
- }
- for (mode = output->probed_modes; mode != NULL; mode = mode->next)
- {
- /* The code to choose the best mode per pipe later on will require
- * VRefresh to be set.
- */
- mode->VRefresh = xf86ModeVRefresh(mode);
- xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
-
- if (debug_modes)
- xf86PrintModeline(scrn->scrnIndex, mode);
- }
- }
-}
-
-
-/**
- * Copy one of the output mode lists to the ScrnInfo record
- */
-
-/* XXX where does this function belong? Here? */
-void
-xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y);
-
-static DisplayModePtr
-biggestMode(DisplayModePtr a, DisplayModePtr b)
-{
- int A, B;
-
- if (!a)
- return b;
- if (!b)
- return a;
-
- A = a->HDisplay * a->VDisplay;
- B = b->HDisplay * b->VDisplay;
-
- if (A > B)
- return a;
-
- return b;
-}
-
-static xf86OutputPtr
-SetCompatOutput(xf86CrtcConfigPtr config)
-{
- xf86OutputPtr output = NULL, test = NULL;
- DisplayModePtr maxmode = NULL, testmode, mode;
- int o, compat = -1, count, mincount = 0;
-
- /* Look for one that's definitely connected */
- for (o = 0; o < config->num_output; o++)
- {
- test = config->output[o];
- if (!test->crtc)
- continue;
- if (test->status != XF86OutputStatusConnected)
- continue;
- if (!test->probed_modes)
- continue;
-
- testmode = mode = test->probed_modes;
- for (count = 0; mode; mode = mode->next, count++)
- testmode = biggestMode(testmode, mode);
-
- if (!output) {
- output = test;
- compat = o;
- maxmode = testmode;
- mincount = count;
- } else if (maxmode == biggestMode(maxmode, testmode)) {
- output = test;
- compat = o;
- maxmode = testmode;
- mincount = count;
- } else if ((maxmode->HDisplay == testmode->HDisplay) &&
- (maxmode->VDisplay == testmode->VDisplay) &&
- count <= mincount) {
- output = test;
- compat = o;
- maxmode = testmode;
- mincount = count;
- }
- }
-
- /* If we didn't find one, take anything we can get */
- if (!output)
- {
- for (o = 0; o < config->num_output; o++)
- {
- test = config->output[o];
- if (!test->crtc)
- continue;
- if (!test->probed_modes)
- continue;
-
- if (!output) {
- output = test;
- compat = o;
- } else if (test->probed_modes->HDisplay < output->probed_modes->HDisplay) {
- output = test;
- compat = o;
- }
- }
- }
-
- if (compat >= 0) {
- config->compat_output = compat;
- } else {
- /* Don't change the compat output when no valid outputs found */
- output = config->output[config->compat_output];
- }
-
- return output;
-}
-
-void
-xf86SetScrnInfoModes (ScrnInfoPtr scrn)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- xf86OutputPtr output;
- xf86CrtcPtr crtc;
- DisplayModePtr last, mode = NULL;
-
- output = SetCompatOutput(config);
-
- if (!output)
- return; /* punt */
-
- crtc = output->crtc;
-
- /* Clear any existing modes from scrn->modes */
- while (scrn->modes != NULL)
- xf86DeleteMode(&scrn->modes, scrn->modes);
-
- /* Set scrn->modes to the mode list for the 'compat' output */
- scrn->modes = xf86DuplicateModes(scrn, output->probed_modes);
-
- if (crtc) {
- for (mode = scrn->modes; mode; mode = mode->next)
- if (xf86ModesEqual (mode, &crtc->desiredMode))
- break;
- }
-
- if (scrn->modes != NULL) {
- /* For some reason, scrn->modes is circular, unlike the other mode
- * lists. How great is that?
- */
- for (last = scrn->modes; last && last->next; last = last->next)
- ;
- last->next = scrn->modes;
- scrn->modes->prev = last;
- if (mode) {
- while (scrn->modes != mode)
- scrn->modes = scrn->modes->next;
- }
- }
- scrn->currentMode = scrn->modes;
-#ifdef XFreeXDGA
- if (scrn->pScreen)
- _xf86_di_dga_reinit_internal(scrn->pScreen);
-#endif
-}
-
-static Bool
-xf86CollectEnabledOutputs(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
- Bool *enabled)
-{
- Bool any_enabled = FALSE;
- int o;
-
- for (o = 0; o < config->num_output; o++)
- any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], TRUE);
-
- if (!any_enabled) {
- xf86DrvMsg(scrn->scrnIndex, X_WARNING,
- "No outputs definitely connected, trying again...\n");
-
- for (o = 0; o < config->num_output; o++)
- any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], FALSE);
- }
-
- return any_enabled;
-}
-
-static Bool
-nextEnabledOutput(xf86CrtcConfigPtr config, Bool *enabled, int *index)
-{
- int o = *index;
-
- for (o++; o < config->num_output; o++) {
- if (enabled[o]) {
- *index = o;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-static Bool
-aspectMatch(float a, float b)
-{
- return fabs(1 - (a / b)) < 0.05;
-}
-
-static DisplayModePtr
-nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect)
-{
- DisplayModePtr m = NULL;
-
- if (!o)
- return NULL;
-
- if (!last)
- m = o->probed_modes;
- else
- m = last->next;
-
- for (; m; m = m->next)
- if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay))
- return m;
-
- return NULL;
-}
-
-static DisplayModePtr
-bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
-{
- int o = -1, p;
- DisplayModePtr mode = NULL, test = NULL, match = NULL;
-
- if (!nextEnabledOutput(config, enabled, &o))
- return NULL;
- while ((mode = nextAspectMode(config->output[o], mode, aspect))) {
- test = mode;
- for (p = o; nextEnabledOutput(config, enabled, &p); ) {
- test = xf86OutputFindClosestMode(config->output[p], mode);
- if (!test)
- break;
- if (test->HDisplay != mode->HDisplay ||
- test->VDisplay != mode->VDisplay) {
- test = NULL;
- break;
- }
- }
-
- /* if we didn't match it on all outputs, try the next one */
- if (!test)
- continue;
-
- /* if it's bigger than the last one, save it */
- if (!match || (test->HDisplay > match->HDisplay))
- match = test;
- }
-
- /* return the biggest one found */
- return match;
-}
-
-static Bool
-xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
- DisplayModePtr *modes, Bool *enabled,
- int width, int height)
-{
- int o, p;
- int max_pref_width = 0, max_pref_height = 0;
- DisplayModePtr *preferred, *preferred_match;
- Bool ret = FALSE;
-
- preferred = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
- preferred_match = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
-
- /* Check if the preferred mode is available on all outputs */
- for (p = -1; nextEnabledOutput(config, enabled, &p); ) {
- Rotation r = config->output[p]->initial_rotation;
- DisplayModePtr mode;
- if ((preferred[p] = xf86OutputHasPreferredMode(config->output[p],
- width, height))) {
- int pref_width = xf86ModeWidth(preferred[p], r);
- int pref_height = xf86ModeHeight(preferred[p], r);
- Bool all_match = TRUE;
-
- for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
- Bool match = FALSE;
- xf86OutputPtr output = config->output[o];
- if (o == p)
- continue;
-
- for (mode = output->probed_modes; mode; mode = mode->next) {
- Rotation r = output->initial_rotation;
- if (xf86ModeWidth(mode, r) == pref_width &&
- xf86ModeHeight(mode, r) == pref_height) {
- preferred[o] = mode;
- match = TRUE;
- }
- }
-
- all_match &= match;
- }
-
- if (all_match &&
- (pref_width*pref_height > max_pref_width*max_pref_height)) {
- for (o = -1; nextEnabledOutput(config, enabled, &o); )
- preferred_match[o] = preferred[o];
- max_pref_width = pref_width;
- max_pref_height = pref_height;
- ret = TRUE;
- }
- }
- }
-
- /*
- * If there's no preferred mode, but only one monitor, pick the
- * biggest mode for its aspect ratio, assuming one exists.
- */
- if (!ret) do {
- int i = 0;
- float aspect = 0.0;
-
- /* count the number of enabled outputs */
- for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ;
-
- if (i != 1)
- break;
-
- p = -1;
- nextEnabledOutput(config, enabled, &p);
- if (config->output[p]->mm_height)
- aspect = (float)config->output[p]->mm_width /
- (float)config->output[p]->mm_height;
-
- if (aspect)
- preferred_match[p] = bestModeForAspect(config, enabled, aspect);
-
- if (preferred_match[p])
- ret = TRUE;
-
- } while (0);
-
- if (ret) {
- /* oh good, there is a match. stash the selected modes and return. */
- memcpy(modes, preferred_match,
- config->num_output * sizeof(DisplayModePtr));
- }
-
- free(preferred);
- free(preferred_match);
- return ret;
-}
-
-static Bool
-xf86TargetAspect(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
- DisplayModePtr *modes, Bool *enabled,
- int width, int height)
-{
- int o;
- float aspect = 0.0, *aspects;
- xf86OutputPtr output;
- Bool ret = FALSE;
- DisplayModePtr guess = NULL, aspect_guess = NULL, base_guess = NULL;
-
- aspects = xnfcalloc(config->num_output, sizeof(float));
-
- /* collect the aspect ratios */
- for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
- output = config->output[o];
- if (output->mm_height)
- aspects[o] = (float)output->mm_width / (float)output->mm_height;
- else
- aspects[o] = 4.0 / 3.0;
- }
-
- /* check that they're all the same */
- for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
- output = config->output[o];
- if (!aspect) {
- aspect = aspects[o];
- } else if (!aspectMatch(aspect, aspects[o])) {
- goto no_aspect_match;
- }
- }
-
- /* if they're all 4:3, just skip ahead and save effort */
- if (!aspectMatch(aspect, 4.0/3.0))
- aspect_guess = bestModeForAspect(config, enabled, aspect);
-
-no_aspect_match:
- base_guess = bestModeForAspect(config, enabled, 4.0/3.0);
-
- guess = biggestMode(base_guess, aspect_guess);
-
- if (!guess)
- goto out;
-
- /* found a mode that works everywhere, now apply it */
- for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
- modes[o] = xf86OutputFindClosestMode(config->output[o], guess);
- }
- ret = TRUE;
-
-out:
- free(aspects);
- return ret;
-}
-
-static Bool
-xf86TargetFallback(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
- DisplayModePtr *modes, Bool *enabled,
- int width, int height)
-{
- DisplayModePtr target_mode = NULL;
- Rotation target_rotation = RR_Rotate_0;
- DisplayModePtr default_mode;
- int default_preferred, target_preferred = 0, o;
-
- /* User preferred > preferred > other modes */
- for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
- default_mode = xf86DefaultMode (config->output[o], width, height);
- if (!default_mode)
- continue;
-
- default_preferred = (((default_mode->type & M_T_PREFERRED) != 0) +
- ((default_mode->type & M_T_USERPREF) != 0));
-
- if (default_preferred > target_preferred || !target_mode) {
- target_mode = default_mode;
- target_preferred = default_preferred;
- target_rotation = config->output[o]->initial_rotation;
- config->compat_output = o;
- }
- }
-
- if (target_mode)
- modes[config->compat_output] = target_mode;
-
- /* Fill in other output modes */
- for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
- if (!modes[o])
- modes[o] = xf86ClosestMode(config->output[o], target_mode,
- target_rotation, width, height);
- }
-
- return target_mode != NULL;
-}
-
-static Bool
-xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
- DisplayModePtr *modes, Bool *enabled,
- int width, int height)
-{
- int o;
-
- if (xf86UserConfiguredOutputs(scrn, modes))
- return xf86TargetFallback(scrn, config, modes, enabled, width, height);
-
- for (o = -1; nextEnabledOutput(config, enabled, &o); )
- if (xf86OutputHasUserPreferredMode(config->output[o]))
- return
- xf86TargetFallback(scrn, config, modes, enabled, width, height);
-
- return FALSE;
-}
-
-static Bool
-xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green,
- float gamma_blue)
-{
- int i, size = 256;
- CARD16 *red, *green, *blue;
-
- red = malloc(3 * size * sizeof(CARD16));
- green = red + size;
- blue = green + size;
-
- /* Only cause warning if user wanted gamma to be set. */
- if (!crtc->funcs->gamma_set && (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0)) {
- free(red);
- return FALSE;
- } else if (!crtc->funcs->gamma_set) {
- free(red);
- return TRUE;
- }
-
- /* At this early stage none of the randr-interface stuff is up.
- * So take the default gamma size for lack of something better.
- */
- for (i = 0; i < size; i++) {
- if (gamma_red == 1.0)
- red[i] = i << 8;
- else
- red[i] = (CARD16)(pow((double)i/(double)(size - 1),
- 1. / (double)gamma_red) * (double)(size - 1) * 256);
-
- if (gamma_green == 1.0)
- green[i] = i << 8;
- else
- green[i] = (CARD16)(pow((double)i/(double)(size - 1),
- 1. / (double)gamma_green) * (double)(size - 1) * 256);
-
- if (gamma_blue == 1.0)
- blue[i] = i << 8;
- else
- blue[i] = (CARD16)(pow((double)i/(double)(size - 1),
- 1. / (double)gamma_blue) * (double)(size - 1) * 256);
- }
-
- /* Default size is 256, so anything else is failure. */
- if (size != crtc->gamma_size) {
- free(red);
- return FALSE;
- }
-
- crtc->gamma_size = size;
- memcpy (crtc->gamma_red, red, crtc->gamma_size * sizeof (CARD16));
- memcpy (crtc->gamma_green, green, crtc->gamma_size * sizeof (CARD16));
- memcpy (crtc->gamma_blue, blue, crtc->gamma_size * sizeof (CARD16));
-
- /* Do not set gamma now, delay until the crtc is activated. */
-
- free(red);
-
- return TRUE;
-}
-
-static Bool
-xf86OutputSetInitialGamma(xf86OutputPtr output)
-{
- XF86ConfMonitorPtr mon = output->conf_monitor;
- float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0;
-
- if (!mon)
- return TRUE;
-
- if (!output->crtc)
- return FALSE;
-
- /* Get configured values, where they exist. */
- if (mon->mon_gamma_red >= GAMMA_MIN &&
- mon->mon_gamma_red <= GAMMA_MAX)
- gamma_red = mon->mon_gamma_red;
-
- if (mon->mon_gamma_green >= GAMMA_MIN &&
- mon->mon_gamma_green <= GAMMA_MAX)
- gamma_green = mon->mon_gamma_green;
-
- if (mon->mon_gamma_blue >= GAMMA_MIN &&
- mon->mon_gamma_blue <= GAMMA_MAX)
- gamma_blue = mon->mon_gamma_blue;
-
- /* This avoids setting gamma 1.0 in case another cloned output on this crtc has a specific gamma. */
- if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) {
- xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", output->name, gamma_red, gamma_green, gamma_blue);
- return xf86CrtcSetInitialGamma(output->crtc, gamma_red, gamma_green, gamma_blue);
- }else
- return TRUE;
-}
-
-/**
- * Construct default screen configuration
- *
- * Given auto-detected (and, eventually, configured) values,
- * construct a usable configuration for the system
- *
- * canGrow indicates that the driver can resize the screen to larger than its
- * initially configured size via the config->funcs->resize hook. If TRUE, this
- * function will set virtualX and virtualY to match the initial configuration
- * and leave config->max{Width,Height} alone. If FALSE, it will bloat
- * virtual[XY] to include the largest modes and set config->max{Width,Height}
- * accordingly.
- */
-
-Bool
-xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int o, c;
- xf86CrtcPtr *crtcs;
- DisplayModePtr *modes;
- Bool *enabled;
- int width, height;
- int i = scrn->scrnIndex;
- Bool have_outputs = TRUE;
- Bool ret;
- Bool success = FALSE;
-
- /* Set up the device options */
- config->options = xnfalloc (sizeof (xf86DeviceOptions));
- memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions));
- xf86ProcessOptions (scrn->scrnIndex,
- scrn->options,
- config->options);
- config->debug_modes = xf86ReturnOptValBool (config->options,
- OPTION_MODEDEBUG, FALSE);
-
- if (scrn->display->virtualX)
- width = scrn->display->virtualX;
- else
- width = config->maxWidth;
- if (scrn->display->virtualY)
- height = scrn->display->virtualY;
- else
- height = config->maxHeight;
-
- xf86ProbeOutputModes (scrn, width, height);
-
- crtcs = xnfcalloc (config->num_output, sizeof (xf86CrtcPtr));
- modes = xnfcalloc (config->num_output, sizeof (DisplayModePtr));
- enabled = xnfcalloc (config->num_output, sizeof (Bool));
-
- ret = xf86CollectEnabledOutputs(scrn, config, enabled);
- if (ret == FALSE && canGrow) {
- xf86DrvMsg(i, X_WARNING, "Unable to find connected outputs - setting %dx%d initial framebuffer\n",
- NO_OUTPUT_DEFAULT_WIDTH, NO_OUTPUT_DEFAULT_HEIGHT);
- have_outputs = FALSE;
- } else {
- if (xf86TargetUserpref(scrn, config, modes, enabled, width, height))
- xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n");
- else if (xf86TargetPreferred(scrn, config, modes, enabled, width, height))
- xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n");
- else if (xf86TargetAspect(scrn, config, modes, enabled, width, height))
- xf86DrvMsg(i, X_INFO, "Using fuzzy aspect match for initial modes\n");
- else if (xf86TargetFallback(scrn, config, modes, enabled, width, height))
- xf86DrvMsg(i, X_INFO, "Using sloppy heuristic for initial modes\n");
- else
- xf86DrvMsg(i, X_WARNING, "Unable to find initial modes\n");
- }
-
- for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
- if (!modes[o])
- xf86DrvMsg (scrn->scrnIndex, X_ERROR,
- "Output %s enabled but has no modes\n",
- config->output[o]->name);
- else
- xf86DrvMsg (scrn->scrnIndex, X_INFO,
- "Output %s using initial mode %s\n",
- config->output[o]->name, modes[o]->name);
- }
-
- /*
- * Set the position of each output
- */
- if (!xf86InitialOutputPositions (scrn, modes))
- goto bailout;
-
- /*
- * Set initial panning of each output
- */
- xf86InitialPanning (scrn);
-
- /*
- * Assign CRTCs to fit output configuration
- */
- if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, height))
- goto bailout;
-
- /* XXX override xf86 common frame computation code */
-
- scrn->display->frameX0 = 0;
- scrn->display->frameY0 = 0;
-
- for (c = 0; c < config->num_crtc; c++)
- {
- xf86CrtcPtr crtc = config->crtc[c];
-
- crtc->enabled = FALSE;
- memset (&crtc->desiredMode, '\0', sizeof (crtc->desiredMode));
- /* Set default gamma for all crtc's. */
- /* This is done to avoid problems later on with cloned outputs. */
- xf86CrtcSetInitialGamma(crtc, 1.0, 1.0, 1.0);
- }
-
- if (xf86_crtc_supports_gamma(scrn))
- xf86DrvMsg(scrn->scrnIndex, X_INFO, "Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.\n");
-
- /*
- * Set initial configuration
- */
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
- DisplayModePtr mode = modes[o];
- xf86CrtcPtr crtc = crtcs[o];
-
- if (mode && crtc)
- {
- crtc->desiredMode = *mode;
- crtc->desiredRotation = output->initial_rotation;
- crtc->desiredX = output->initial_x;
- crtc->desiredY = output->initial_y;
- crtc->desiredTransformPresent = FALSE;
- crtc->enabled = TRUE;
- memcpy (&crtc->panningTotalArea, &output->initialTotalArea, sizeof(BoxRec));
- memcpy (&crtc->panningTrackingArea, &output->initialTrackingArea, sizeof(BoxRec));
- memcpy (crtc->panningBorder, output->initialBorder, 4*sizeof(INT16));
- output->crtc = crtc;
- if (!xf86OutputSetInitialGamma(output))
- xf86DrvMsg (scrn->scrnIndex, X_WARNING, "Initial gamma correction for output %s: failed.\n", output->name);
- } else {
- output->crtc = NULL;
- }
- }
-
- if (scrn->display->virtualX == 0)
- {
- /*
- * Expand virtual size to cover the current config and potential mode
- * switches, if the driver can't enlarge the screen later.
- */
- xf86DefaultScreenLimits (scrn, &width, &height, canGrow);
-
- if (have_outputs == FALSE) {
- if (width < NO_OUTPUT_DEFAULT_WIDTH && height < NO_OUTPUT_DEFAULT_HEIGHT) {
- width = NO_OUTPUT_DEFAULT_WIDTH;
- height = NO_OUTPUT_DEFAULT_HEIGHT;
- }
- }
-
- scrn->display->virtualX = width;
- scrn->display->virtualY = height;
- }
-
- if (width > scrn->virtualX)
- scrn->virtualX = width;
- if (height > scrn->virtualY)
- scrn->virtualY = height;
-
- /*
- * Make sure the configuration isn't too small.
- */
- if (width < config->minWidth || height < config->minHeight)
- goto bailout;
-
- /*
- * Limit the crtc config to virtual[XY] if the driver can't grow the
- * desktop.
- */
- if (!canGrow)
- {
- xf86CrtcSetSizeRange (scrn, config->minWidth, config->minHeight,
- width, height);
- }
-
- if (have_outputs) {
- /* Mirror output modes to scrn mode list */
- xf86SetScrnInfoModes (scrn);
- } else {
- /* Clear any existing modes from scrn->modes */
- while (scrn->modes != NULL)
- xf86DeleteMode(&scrn->modes, scrn->modes);
- scrn->modes = xf86ModesAdd(scrn->modes,
- xf86CVTMode(width, height, 60, 0, 0));
- }
-
- success = TRUE;
- bailout:
- free(crtcs);
- free(modes);
- free(enabled);
- return success;
-}
-
-/*
- * Check the CRTC we're going to map each output to vs. it's current
- * CRTC. If they don't match, we have to disable the output and the CRTC
- * since the driver will have to re-route things.
- */
-static void
-xf86PrepareOutputs (ScrnInfoPtr scrn)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int o;
-
- for (o = 0; o < config->num_output; o++) {
- xf86OutputPtr output = config->output[o];
-#if RANDR_GET_CRTC_INTERFACE
- /* Disable outputs that are unused or will be re-routed */
- if (!output->funcs->get_crtc ||
- output->crtc != (*output->funcs->get_crtc)(output) ||
- output->crtc == NULL)
-#endif
- (*output->funcs->dpms)(output, DPMSModeOff);
- }
-}
-
-static void
-xf86PrepareCrtcs (ScrnInfoPtr scrn)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int c;
-
- for (c = 0; c < config->num_crtc; c++) {
-#if RANDR_GET_CRTC_INTERFACE
- xf86CrtcPtr crtc = config->crtc[c];
- xf86OutputPtr output = NULL;
- uint32_t desired_outputs = 0, current_outputs = 0;
- int o;
-
- for (o = 0; o < config->num_output; o++) {
- output = config->output[o];
- if (output->crtc == crtc)
- desired_outputs |= (1<<o);
- /* If we can't tell where it's mapped, force it off */
- if (!output->funcs->get_crtc) {
- desired_outputs = 0;
- break;
- }
- if ((*output->funcs->get_crtc)(output) == crtc)
- current_outputs |= (1<<o);
- }
-
- /*
- * If mappings are different or the CRTC is unused,
- * we need to disable it
- */
- if (desired_outputs != current_outputs ||
- !desired_outputs)
- (*crtc->funcs->dpms)(crtc, DPMSModeOff);
-#else
- (*crtc->funcs->dpms)(crtc, DPMSModeOff);
-#endif
- }
-}
-
-/*
- * Using the desired mode information in each crtc, set
- * modes (used in EnterVT functions, or at server startup)
- */
-
-Bool
-xf86SetDesiredModes (ScrnInfoPtr scrn)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- xf86CrtcPtr crtc = config->crtc[0];
- int c;
-
- /* A driver with this hook will take care of this */
- if (!crtc->funcs->set_mode_major) {
- xf86PrepareOutputs(scrn);
- xf86PrepareCrtcs(scrn);
- }
-
- for (c = 0; c < config->num_crtc; c++)
- {
- xf86OutputPtr output = NULL;
- int o;
- RRTransformPtr transform;
-
- crtc = config->crtc[c];
-
- /* Skip disabled CRTCs */
- if (!crtc->enabled)
- continue;
-
- if (xf86CompatOutput(scrn) && xf86CompatCrtc(scrn) == crtc)
- output = xf86CompatOutput(scrn);
- else
- {
- for (o = 0; o < config->num_output; o++)
- if (config->output[o]->crtc == crtc)
- {
- output = config->output[o];
- break;
- }
- }
- /* paranoia */
- if (!output)
- continue;
-
- /* Mark that we'll need to re-set the mode for sure */
- memset(&crtc->mode, 0, sizeof(crtc->mode));
- if (!crtc->desiredMode.CrtcHDisplay)
- {
- DisplayModePtr mode = xf86OutputFindClosestMode (output, scrn->currentMode);
-
- if (!mode)
- return FALSE;
- crtc->desiredMode = *mode;
- crtc->desiredRotation = RR_Rotate_0;
- crtc->desiredTransformPresent = FALSE;
- crtc->desiredX = 0;
- crtc->desiredY = 0;
- }
-
- if (crtc->desiredTransformPresent)
- transform = &crtc->desiredTransform;
- else
- transform = NULL;
- if (!xf86CrtcSetModeTransform (crtc, &crtc->desiredMode, crtc->desiredRotation,
- transform, crtc->desiredX, crtc->desiredY))
- return FALSE;
- }
-
- xf86DisableUnusedFunctions(scrn);
- return TRUE;
-}
-
-/**
- * In the current world order, there are lists of modes per output, which may
- * or may not include the mode that was asked to be set by XFree86's mode
- * selection. Find the closest one, in the following preference order:
- *
- * - Equality
- * - Closer in size to the requested mode, but no larger
- * - Closer in refresh rate to the requested mode.
- */
-
-DisplayModePtr
-xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired)
-{
- DisplayModePtr best = NULL, scan = NULL;
-
- for (scan = output->probed_modes; scan != NULL; scan = scan->next)
- {
- /* If there's an exact match, we're done. */
- if (xf86ModesEqual(scan, desired)) {
- best = desired;
- break;
- }
-
- /* Reject if it's larger than the desired mode. */
- if (scan->HDisplay > desired->HDisplay ||
- scan->VDisplay > desired->VDisplay)
- {
- continue;
- }
-
- /*
- * If we haven't picked a best mode yet, use the first
- * one in the size range
- */
- if (best == NULL)
- {
- best = scan;
- continue;
- }
-
- /* Find if it's closer to the right size than the current best
- * option.
- */
- if ((scan->HDisplay > best->HDisplay &&
- scan->VDisplay >= best->VDisplay) ||
- (scan->HDisplay >= best->HDisplay &&
- scan->VDisplay > best->VDisplay))
- {
- best = scan;
- continue;
- }
-
- /* Find if it's still closer to the right refresh than the current
- * best resolution.
- */
- if (scan->HDisplay == best->HDisplay &&
- scan->VDisplay == best->VDisplay &&
- (fabs(scan->VRefresh - desired->VRefresh) <
- fabs(best->VRefresh - desired->VRefresh))) {
- best = scan;
- }
- }
- return best;
-}
-
-/**
- * When setting a mode through XFree86-VidModeExtension or XFree86-DGA,
- * take the specified mode and apply it to the crtc connected to the compat
- * output. Then, find similar modes for the other outputs, as with the
- * InitialConfiguration code above. The goal is to clone the desired
- * mode across all outputs that are currently active.
- */
-
-Bool
-xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
- Bool ok = TRUE;
- xf86OutputPtr compat_output;
- DisplayModePtr compat_mode = NULL;
- int c;
-
- /*
- * Let the compat output drive the final mode selection
- */
- compat_output = xf86CompatOutput(pScrn);
- if (compat_output)
- compat_mode = xf86OutputFindClosestMode (compat_output, desired);
- if (compat_mode)
- desired = compat_mode;
-
- for (c = 0; c < config->num_crtc; c++)
- {
- xf86CrtcPtr crtc = config->crtc[c];
- DisplayModePtr crtc_mode = NULL;
- int o;
-
- if (!crtc->enabled)
- continue;
-
- for (o = 0; o < config->num_output; o++)
- {
- xf86OutputPtr output = config->output[o];
- DisplayModePtr output_mode;
-
- /* skip outputs not on this crtc */
- if (output->crtc != crtc)
- continue;
-
- if (crtc_mode)
- {
- output_mode = xf86OutputFindClosestMode (output, crtc_mode);
- if (output_mode != crtc_mode)
- output->crtc = NULL;
- }
- else
- crtc_mode = xf86OutputFindClosestMode (output, desired);
- }
- if (!crtc_mode)
- {
- crtc->enabled = FALSE;
- continue;
- }
- if (!xf86CrtcSetModeTransform (crtc, crtc_mode, rotation, NULL, 0, 0))
- ok = FALSE;
- else
- {
- crtc->desiredMode = *crtc_mode;
- crtc->desiredRotation = rotation;
- crtc->desiredTransformPresent = FALSE;
- crtc->desiredX = 0;
- crtc->desiredY = 0;
- }
- }
- xf86DisableUnusedFunctions(pScrn);
-#ifdef RANDR_12_INTERFACE
- xf86RandR12TellChanged (pScrn->pScreen);
-#endif
- return ok;
-}
-
-
-/**
- * Set the DPMS power mode of all outputs and CRTCs.
- *
- * If the new mode is off, it will turn off outputs and then CRTCs.
- * Otherwise, it will affect CRTCs before outputs.
- */
-void
-xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags)
-{
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- int i;
-
- if (!scrn->vtSema)
- return;
-
- if (mode == DPMSModeOff) {
- for (i = 0; i < config->num_output; i++) {
- xf86OutputPtr output = config->output[i];
- if (output->crtc != NULL)
- (*output->funcs->dpms) (output, mode);
- }
- }
-
- for (i = 0; i < config->num_crtc; i++) {
- xf86CrtcPtr crtc = config->crtc[i];
- if (crtc->enabled)
- (*crtc->funcs->dpms) (crtc, mode);
- }
-
- if (mode != DPMSModeOff) {
- for (i = 0; i < config->num_output; i++) {
- xf86OutputPtr output = config->output[i];
- if (output->crtc != NULL)
- (*output->funcs->dpms) (output, mode);
- }
- }
-}
-
-/**
- * Implement the screensaver by just calling down into the driver DPMS hooks.
- *
- * Even for monitors with no DPMS support, by the definition of our DPMS hooks,
- * the outputs will still get disabled (blanked).
- */
-Bool
-xf86SaveScreen(ScreenPtr pScreen, int mode)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-
- if (xf86IsUnblank(mode))
- xf86DPMSSet(pScrn, DPMSModeOn, 0);
- else
- xf86DPMSSet(pScrn, DPMSModeOff, 0);
-
- return TRUE;
-}
-
-/**
- * Disable all inactive crtcs and outputs
- */
-void
-xf86DisableUnusedFunctions(ScrnInfoPtr pScrn)
-{
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- int o, c;
-
- for (o = 0; o < xf86_config->num_output; o++)
- {
- xf86OutputPtr output = xf86_config->output[o];
- if (!output->crtc)
- (*output->funcs->dpms)(output, DPMSModeOff);
- }
-
- for (c = 0; c < xf86_config->num_crtc; c++)
- {
- xf86CrtcPtr crtc = xf86_config->crtc[c];
-
- if (!crtc->enabled)
- {
- crtc->funcs->dpms(crtc, DPMSModeOff);
- memset(&crtc->mode, 0, sizeof(crtc->mode));
- xf86RotateDestroy(crtc);
- crtc->active = FALSE;
- }
- }
- if (pScrn->pScreen)
- xf86_crtc_notify(pScrn->pScreen);
- if (pScrn->ModeSet)
- pScrn->ModeSet(pScrn);
-}
-
-#ifdef RANDR_12_INTERFACE
-
-#define EDID_ATOM_NAME "EDID"
-
-/**
- * Set the RandR EDID property
- */
-static void
-xf86OutputSetEDIDProperty (xf86OutputPtr output, void *data, int data_len)
-{
- Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME) - 1, TRUE);
-
- /* This may get called before the RandR resources have been created */
- if (output->randr_output == NULL)
- return;
-
- if (data_len != 0) {
- RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8,
- PropModeReplace, data_len, data, FALSE, TRUE);
- } else {
- RRDeleteOutputProperty(output->randr_output, edid_atom);
- }
-}
-
-#endif
-
-/* Pull out a phyiscal size from a detailed timing if available. */
-struct det_phySize_parameter {
- xf86OutputPtr output;
- ddc_quirk_t quirks;
- Bool ret;
-};
-
-static void handle_detailed_physical_size(struct detailed_monitor_section
- *det_mon, void *data)
-{
- struct det_phySize_parameter *p;
- p = (struct det_phySize_parameter *)data;
-
- if (p->ret == TRUE )
- return ;
-
- xf86DetTimingApplyQuirks(det_mon, p->quirks,
- p->output->MonInfo->features.hsize,
- p->output->MonInfo->features.vsize);
- if (det_mon->type == DT &&
- det_mon->section.d_timings.h_size != 0 &&
- det_mon->section.d_timings.v_size != 0) {
-
- p->output->mm_width = det_mon->section.d_timings.h_size;
- p->output->mm_height = det_mon->section.d_timings.v_size;
- p->ret = TRUE;
- }
-}
-
-/**
- * Set the EDID information for the specified output
- */
-void
-xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon)
-{
- ScrnInfoPtr scrn = output->scrn;
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- Bool debug_modes = config->debug_modes || xf86Initialising;
-#ifdef RANDR_12_INTERFACE
- int size;
-#endif
-
- free(output->MonInfo);
-
- output->MonInfo = edid_mon;
- output->mm_width = 0;
- output->mm_height = 0;
-
- if (debug_modes) {
- xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n",
- output->name);
- xf86PrintEDID(edid_mon);
- }
-
- /* Set the DDC properties for the 'compat' output */
- if (output == xf86CompatOutput(scrn))
- xf86SetDDCproperties(scrn, edid_mon);
-
-#ifdef RANDR_12_INTERFACE
- /* Set the RandR output properties */
- size = 0;
- if (edid_mon)
- {
- if (edid_mon->ver.version == 1) {
- size = 128;
- if (edid_mon->flags & EDID_COMPLETE_RAWDATA)
- size += edid_mon->no_sections * 128;
- } else if (edid_mon->ver.version == 2)
- size = 256;
- }
- xf86OutputSetEDIDProperty (output, edid_mon ? edid_mon->rawData : NULL, size);
-#endif
-
- if (edid_mon) {
-
- struct det_phySize_parameter p;
- p.output = output;
- p.quirks = xf86DDCDetectQuirks(scrn->scrnIndex,edid_mon, FALSE);
- p.ret = FALSE;
- xf86ForEachDetailedBlock(edid_mon,
- handle_detailed_physical_size, &p);
-
- /* if no mm size is available from a detailed timing, check the max size field */
- if ((!output->mm_width || !output->mm_height) &&
- (edid_mon->features.hsize && edid_mon->features.vsize))
- {
- output->mm_width = edid_mon->features.hsize * 10;
- output->mm_height = edid_mon->features.vsize * 10;
- }
- }
-}
-
-/**
- * Return the list of modes supported by the EDID information
- * stored in 'output'
- */
-DisplayModePtr
-xf86OutputGetEDIDModes (xf86OutputPtr output)
-{
- ScrnInfoPtr scrn = output->scrn;
- xf86MonPtr edid_mon = output->MonInfo;
-
- if (!edid_mon)
- return NULL;
- return xf86DDCGetModes(scrn->scrnIndex, edid_mon);
-}
-
-/* maybe we should care about DDC1? meh. */
-xf86MonPtr
-xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus)
-{
- ScrnInfoPtr scrn = output->scrn;
- xf86MonPtr mon;
-
- mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE);
- if (mon)
- xf86DDCApplyQuirks(scrn->scrnIndex, mon);
-
- return mon;
-}
-
-static char *_xf86ConnectorNames[] = {
- "None", "VGA", "DVI-I", "DVI-D",
- "DVI-A", "Composite", "S-Video",
- "Component", "LFP", "Proprietary",
- "HDMI", "DisplayPort",
- };
-char *
-xf86ConnectorGetName(xf86ConnectorType connector)
-{
- return _xf86ConnectorNames[connector];
-}
-
-static void
-x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
-{
- dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
- dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2;
- dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1;
- dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2;
-
- if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2)
- dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0;
-}
-
-static void
-x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box)
-{
- if (crtc->enabled) {
- crtc_box->x1 = crtc->x;
- crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation);
- crtc_box->y1 = crtc->y;
- crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation);
- } else
- crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
-}
-
-static int
-xf86_crtc_box_area(BoxPtr box)
-{
- return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
-}
-
-/*
- * Return the crtc covering 'box'. If two crtcs cover a portion of
- * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
- * with greater coverage
- */
-
-static xf86CrtcPtr
-xf86_covering_crtc(ScrnInfoPtr pScrn,
- BoxPtr box,
- xf86CrtcPtr desired,
- BoxPtr crtc_box_ret)
-{
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- xf86CrtcPtr crtc, best_crtc;
- int coverage, best_coverage;
- int c;
- BoxRec crtc_box, cover_box;
-
- best_crtc = NULL;
- best_coverage = 0;
- crtc_box_ret->x1 = 0;
- crtc_box_ret->x2 = 0;
- crtc_box_ret->y1 = 0;
- crtc_box_ret->y2 = 0;
- for (c = 0; c < xf86_config->num_crtc; c++) {
- crtc = xf86_config->crtc[c];
- x86_crtc_box(crtc, &crtc_box);
- x86_crtc_box_intersect(&cover_box, &crtc_box, box);
- coverage = xf86_crtc_box_area(&cover_box);
- if (coverage && crtc == desired) {
- *crtc_box_ret = crtc_box;
- return crtc;
- } else if (coverage > best_coverage) {
- *crtc_box_ret = crtc_box;
- best_crtc = crtc;
- best_coverage = coverage;
- }
- }
- return best_crtc;
-}
-
-/*
- * For overlay video, compute the relevant CRTC and
- * clip video to that.
- *
- * returning FALSE means there was a memory failure of some kind,
- * not that the video shouldn't be displayed
- */
-
-Bool
-xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
- xf86CrtcPtr *crtc_ret,
- xf86CrtcPtr desired_crtc,
- BoxPtr dst,
- INT32 *xa,
- INT32 *xb,
- INT32 *ya,
- INT32 *yb,
- RegionPtr reg,
- INT32 width,
- INT32 height)
-{
- Bool ret;
- RegionRec crtc_region_local;
- RegionPtr crtc_region = reg;
-
- if (crtc_ret) {
- BoxRec crtc_box;
- xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst,
- desired_crtc,
- &crtc_box);
-
- if (crtc) {
- RegionInit(&crtc_region_local, &crtc_box, 1);
- crtc_region = &crtc_region_local;
- RegionIntersect(crtc_region, crtc_region, reg);
- }
- *crtc_ret = crtc;
- }
-
- ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb,
- crtc_region, width, height);
-
- if (crtc_region != reg)
- RegionUninit(&crtc_region_local);
-
- return ret;
-}
-
-xf86_crtc_notify_proc_ptr
-xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new)
-{
- if (xf86CrtcConfigPrivateIndex != -1)
- {
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- xf86_crtc_notify_proc_ptr old;
-
- old = config->xf86_crtc_notify;
- config->xf86_crtc_notify = new;
- return old;
- }
- return NULL;
-}
-
-void
-xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old)
-{
- if (xf86CrtcConfigPrivateIndex != -1)
- {
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-
- config->xf86_crtc_notify = old;
- }
-}
-
-void
-xf86_crtc_notify(ScreenPtr screen)
-{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-
- if (config->xf86_crtc_notify)
- config->xf86_crtc_notify(screen);
-}
-
-Bool
-xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
-{
- if (xf86CrtcConfigPrivateIndex != -1) {
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- xf86CrtcPtr crtc;
-
- /* for multiple drivers loaded we need this */
- if (!xf86_config)
- return FALSE;
- if (xf86_config->num_crtc == 0)
- return FALSE;
- crtc = xf86_config->crtc[0];
-
- return crtc->funcs->gamma_set != NULL;
- }
-
- return FALSE;
-}
+/*
+ * Copyright © 2006 Keith Packard
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#else
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#endif
+
+#include <stddef.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "xf86.h"
+#include "xf86DDC.h"
+#include "xf86Crtc.h"
+#include "xf86Modes.h"
+#include "xf86Priv.h"
+#include "xf86RandR12.h"
+#include "X11/extensions/render.h"
+#include "X11/extensions/dpmsconst.h"
+#include "X11/Xatom.h"
+#include "picturestr.h"
+
+#include "xf86xv.h"
+
+#define NO_OUTPUT_DEFAULT_WIDTH 1024
+#define NO_OUTPUT_DEFAULT_HEIGHT 768
+/*
+ * Initialize xf86CrtcConfig structure
+ */
+
+int xf86CrtcConfigPrivateIndex = -1;
+
+void
+xf86CrtcConfigInit (ScrnInfoPtr scrn,
+ const xf86CrtcConfigFuncsRec *funcs)
+{
+ xf86CrtcConfigPtr config;
+
+ if (xf86CrtcConfigPrivateIndex == -1)
+ xf86CrtcConfigPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
+ config = xnfcalloc (1, sizeof (xf86CrtcConfigRec));
+
+ config->funcs = funcs;
+
+ scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config;
+}
+
+void
+xf86CrtcSetSizeRange (ScrnInfoPtr scrn,
+ int minWidth, int minHeight,
+ int maxWidth, int maxHeight)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ config->minWidth = minWidth;
+ config->minHeight = minHeight;
+ config->maxWidth = maxWidth;
+ config->maxHeight = maxHeight;
+}
+
+/*
+ * Crtc functions
+ */
+xf86CrtcPtr
+xf86CrtcCreate (ScrnInfoPtr scrn,
+ const xf86CrtcFuncsRec *funcs)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86CrtcPtr crtc, *crtcs;
+
+ crtc = calloc(sizeof (xf86CrtcRec), 1);
+ if (!crtc)
+ return NULL;
+ crtc->version = XF86_CRTC_VERSION;
+ crtc->scrn = scrn;
+ crtc->funcs = funcs;
+#ifdef RANDR_12_INTERFACE
+ crtc->randr_crtc = NULL;
+#endif
+ crtc->rotation = RR_Rotate_0;
+ crtc->desiredRotation = RR_Rotate_0;
+ pixman_transform_init_identity (&crtc->crtc_to_framebuffer);
+ pixman_f_transform_init_identity (&crtc->f_crtc_to_framebuffer);
+ pixman_f_transform_init_identity (&crtc->f_framebuffer_to_crtc);
+ crtc->filter = NULL;
+ crtc->params = NULL;
+ crtc->nparams = 0;
+ crtc->filter_width = 0;
+ crtc->filter_height = 0;
+ crtc->transform_in_use = FALSE;
+ crtc->transformPresent = FALSE;
+ crtc->desiredTransformPresent = FALSE;
+ memset (&crtc->bounds, '\0', sizeof (crtc->bounds));
+
+ /* Preallocate gamma at a sensible size. */
+ crtc->gamma_size = 256;
+ crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof (CARD16));
+ if (!crtc->gamma_red) {
+ free(crtc);
+ return NULL;
+ }
+ crtc->gamma_green = crtc->gamma_red + crtc->gamma_size;
+ crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size;
+
+ if (xf86_config->crtc)
+ crtcs = realloc(xf86_config->crtc,
+ (xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
+ else
+ crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr));
+ if (!crtcs)
+ {
+ free(crtc->gamma_red);
+ free(crtc);
+ return NULL;
+ }
+ xf86_config->crtc = crtcs;
+ xf86_config->crtc[xf86_config->num_crtc++] = crtc;
+ return crtc;
+}
+
+void
+xf86CrtcDestroy (xf86CrtcPtr crtc)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+ int c;
+
+ (*crtc->funcs->destroy) (crtc);
+ for (c = 0; c < xf86_config->num_crtc; c++)
+ if (xf86_config->crtc[c] == crtc)
+ {
+ memmove (&xf86_config->crtc[c],
+ &xf86_config->crtc[c+1],
+ ((xf86_config->num_crtc - (c + 1)) * sizeof(void*)));
+ xf86_config->num_crtc--;
+ break;
+ }
+ free(crtc->params);
+ free(crtc->gamma_red);
+ free(crtc);
+}
+
+
+/**
+ * Return whether any outputs are connected to the specified pipe
+ */
+
+Bool
+xf86CrtcInUse (xf86CrtcPtr crtc)
+{
+ ScrnInfoPtr pScrn = crtc->scrn;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int o;
+
+ for (o = 0; o < xf86_config->num_output; o++)
+ if (xf86_config->output[o]->crtc == crtc)
+ return TRUE;
+ return FALSE;
+}
+
+void
+xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen)
+{
+ int subpixel_order = SubPixelUnknown;
+ Bool has_none = FALSE;
+ ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c, o;
+
+ for (c = 0; c < xf86_config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+ for (o = 0; o < xf86_config->num_output; o++)
+ {
+ xf86OutputPtr output = xf86_config->output[o];
+
+ if (output->crtc == crtc)
+ {
+ switch (output->subpixel_order) {
+ case SubPixelNone:
+ has_none = TRUE;
+ break;
+ case SubPixelUnknown:
+ break;
+ default:
+ subpixel_order = output->subpixel_order;
+ break;
+ }
+ }
+ if (subpixel_order != SubPixelUnknown)
+ break;
+ }
+ if (subpixel_order != SubPixelUnknown)
+ {
+ static const int circle[4] = {
+ SubPixelHorizontalRGB,
+ SubPixelVerticalRGB,
+ SubPixelHorizontalBGR,
+ SubPixelVerticalBGR,
+ };
+ int rotate;
+ int c;
+ for (rotate = 0; rotate < 4; rotate++)
+ if (crtc->rotation & (1 << rotate))
+ break;
+ for (c = 0; c < 4; c++)
+ if (circle[c] == subpixel_order)
+ break;
+ c = (c + rotate) & 0x3;
+ if ((crtc->rotation & RR_Reflect_X) && !(c & 1))
+ c ^= 2;
+ if ((crtc->rotation & RR_Reflect_Y) && (c & 1))
+ c ^= 2;
+ subpixel_order = circle[c];
+ break;
+ }
+ }
+ if (subpixel_order == SubPixelUnknown && has_none)
+ subpixel_order = SubPixelNone;
+ PictureSetSubpixelOrder (pScreen, subpixel_order);
+}
+
+/**
+ * Sets the given video mode on the given crtc
+ */
+Bool
+xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ RRTransformPtr transform, int x, int y)
+{
+ ScrnInfoPtr scrn = crtc->scrn;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int i;
+ Bool ret = FALSE;
+ Bool didLock = FALSE;
+ DisplayModePtr adjusted_mode;
+ DisplayModeRec saved_mode;
+ int saved_x, saved_y;
+ Rotation saved_rotation;
+ RRTransformRec saved_transform;
+ Bool saved_transform_present;
+
+ crtc->enabled = xf86CrtcInUse (crtc);
+
+ /* We only hit this if someone explicitly sends a "disabled" modeset. */
+ if (!crtc->enabled)
+ {
+ /* Check everything for stuff that should be off. */
+ xf86DisableUnusedFunctions(scrn);
+ return TRUE;
+ }
+
+ adjusted_mode = xf86DuplicateMode(mode);
+
+
+ saved_mode = crtc->mode;
+ saved_x = crtc->x;
+ saved_y = crtc->y;
+ saved_rotation = crtc->rotation;
+ if (crtc->transformPresent) {
+ RRTransformInit (&saved_transform);
+ RRTransformCopy (&saved_transform, &crtc->transform);
+ }
+ saved_transform_present = crtc->transformPresent;
+
+ /* Update crtc values up front so the driver can rely on them for mode
+ * setting.
+ */
+ crtc->mode = *mode;
+ crtc->x = x;
+ crtc->y = y;
+ crtc->rotation = rotation;
+ if (transform) {
+ RRTransformCopy (&crtc->transform, transform);
+ crtc->transformPresent = TRUE;
+ } else
+ crtc->transformPresent = FALSE;
+
+ if (crtc->funcs->set_mode_major) {
+ ret = crtc->funcs->set_mode_major(crtc, mode, rotation, x, y);
+ goto done;
+ }
+
+ didLock = crtc->funcs->lock (crtc);
+ /* Pass our mode to the outputs and the CRTC to give them a chance to
+ * adjust it according to limitations or output properties, and also
+ * a chance to reject the mode entirely.
+ */
+ for (i = 0; i < xf86_config->num_output; i++) {
+ xf86OutputPtr output = xf86_config->output[i];
+
+ if (output->crtc != crtc)
+ continue;
+
+ if (!output->funcs->mode_fixup(output, mode, adjusted_mode)) {
+ goto done;
+ }
+ }
+
+ if (!crtc->funcs->mode_fixup(crtc, mode, adjusted_mode)) {
+ goto done;
+ }
+
+ if (!xf86CrtcRotate (crtc))
+ goto done;
+
+ /* Prepare the outputs and CRTCs before setting the mode. */
+ for (i = 0; i < xf86_config->num_output; i++) {
+ xf86OutputPtr output = xf86_config->output[i];
+
+ if (output->crtc != crtc)
+ continue;
+
+ /* Disable the output as the first thing we do. */
+ output->funcs->prepare(output);
+ }
+
+ crtc->funcs->prepare(crtc);
+
+ /* Set up the DPLL and any output state that needs to adjust or depend
+ * on the DPLL.
+ */
+ crtc->funcs->mode_set(crtc, mode, adjusted_mode, crtc->x, crtc->y);
+ for (i = 0; i < xf86_config->num_output; i++)
+ {
+ xf86OutputPtr output = xf86_config->output[i];
+ if (output->crtc == crtc)
+ output->funcs->mode_set(output, mode, adjusted_mode);
+ }
+
+ /* Only upload when needed, to avoid unneeded delays. */
+ if (!crtc->active && crtc->funcs->gamma_set)
+ crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green,
+ crtc->gamma_blue, crtc->gamma_size);
+
+ /* Now, enable the clocks, plane, pipe, and outputs that we set up. */
+ crtc->funcs->commit(crtc);
+ for (i = 0; i < xf86_config->num_output; i++)
+ {
+ xf86OutputPtr output = xf86_config->output[i];
+ if (output->crtc == crtc)
+ output->funcs->commit(output);
+ }
+
+ ret = TRUE;
+
+done:
+ if (ret) {
+ crtc->active = TRUE;
+ if (scrn->pScreen)
+ xf86CrtcSetScreenSubpixelOrder (scrn->pScreen);
+ if (scrn->ModeSet)
+ scrn->ModeSet(scrn);
+ } else {
+ crtc->x = saved_x;
+ crtc->y = saved_y;
+ crtc->rotation = saved_rotation;
+ crtc->mode = saved_mode;
+ if (saved_transform_present)
+ RRTransformCopy (&crtc->transform, &saved_transform);
+ crtc->transformPresent = saved_transform_present;
+ }
+
+ free(adjusted_mode->name);
+ free(adjusted_mode);
+
+ if (didLock)
+ crtc->funcs->unlock (crtc);
+
+ return ret;
+}
+
+/**
+ * Sets the given video mode on the given crtc, but without providing
+ * a transform
+ */
+Bool
+xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ int x, int y)
+{
+ return xf86CrtcSetModeTransform (crtc, mode, rotation, NULL, x, y);
+}
+
+/**
+ * Pans the screen, does not change the mode
+ */
+void
+xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y)
+{
+ ScrnInfoPtr scrn = crtc->scrn;
+
+ crtc->x = x;
+ crtc->y = y;
+ if (crtc->funcs->set_origin) {
+ if (!xf86CrtcRotate (crtc))
+ return;
+ crtc->funcs->set_origin (crtc, x, y);
+ if (scrn->ModeSet)
+ scrn->ModeSet(scrn);
+ }
+ else
+ xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y);
+}
+
+/*
+ * Output functions
+ */
+
+extern XF86ConfigPtr xf86configptr;
+
+typedef enum {
+ OPTION_PREFERRED_MODE,
+ OPTION_POSITION,
+ OPTION_BELOW,
+ OPTION_RIGHT_OF,
+ OPTION_ABOVE,
+ OPTION_LEFT_OF,
+ OPTION_ENABLE,
+ OPTION_DISABLE,
+ OPTION_MIN_CLOCK,
+ OPTION_MAX_CLOCK,
+ OPTION_IGNORE,
+ OPTION_ROTATE,
+ OPTION_PANNING,
+ OPTION_PRIMARY,
+ OPTION_DEFAULT_MODES,
+} OutputOpts;
+
+static OptionInfoRec xf86OutputOptions[] = {
+ {OPTION_PREFERRED_MODE, "PreferredMode", OPTV_STRING, {0}, FALSE },
+ {OPTION_POSITION, "Position", OPTV_STRING, {0}, FALSE },
+ {OPTION_BELOW, "Below", OPTV_STRING, {0}, FALSE },
+ {OPTION_RIGHT_OF, "RightOf", OPTV_STRING, {0}, FALSE },
+ {OPTION_ABOVE, "Above", OPTV_STRING, {0}, FALSE },
+ {OPTION_LEFT_OF, "LeftOf", OPTV_STRING, {0}, FALSE },
+ {OPTION_ENABLE, "Enable", OPTV_BOOLEAN, {0}, FALSE },
+ {OPTION_DISABLE, "Disable", OPTV_BOOLEAN, {0}, FALSE },
+ {OPTION_MIN_CLOCK, "MinClock", OPTV_FREQ, {0}, FALSE },
+ {OPTION_MAX_CLOCK, "MaxClock", OPTV_FREQ, {0}, FALSE },
+ {OPTION_IGNORE, "Ignore", OPTV_BOOLEAN, {0}, FALSE },
+ {OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE },
+ {OPTION_PANNING, "Panning", OPTV_STRING, {0}, FALSE },
+ {OPTION_PRIMARY, "Primary", OPTV_BOOLEAN, {0}, FALSE },
+ {OPTION_DEFAULT_MODES, "DefaultModes", OPTV_BOOLEAN, {0}, FALSE },
+ {-1, NULL, OPTV_NONE, {0}, FALSE },
+};
+
+enum {
+ OPTION_MODEDEBUG,
+};
+
+static OptionInfoRec xf86DeviceOptions[] = {
+ {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE },
+ {-1, NULL, OPTV_NONE, {0}, FALSE },
+};
+
+static void
+xf86OutputSetMonitor (xf86OutputPtr output)
+{
+ char *option_name;
+ char *monitor;
+
+ if (!output->name)
+ return;
+
+ free(output->options);
+
+ output->options = xnfalloc (sizeof (xf86OutputOptions));
+ memcpy (output->options, xf86OutputOptions, sizeof (xf86OutputOptions));
+
+ XNFasprintf(&option_name, "monitor-%s", output->name);
+ monitor = xf86findOptionValue (output->scrn->options, option_name);
+ if (!monitor)
+ monitor = output->name;
+ else
+ xf86MarkOptionUsedByName (output->scrn->options, option_name);
+ free(option_name);
+ output->conf_monitor = xf86findMonitor (monitor,
+ xf86configptr->conf_monitor_lst);
+ /*
+ * Find the monitor section of the screen and use that
+ */
+ if (!output->conf_monitor && output->use_screen_monitor)
+ output->conf_monitor = xf86findMonitor (output->scrn->monitor->id,
+ xf86configptr->conf_monitor_lst);
+ if (output->conf_monitor)
+ {
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s using monitor section %s\n",
+ output->name, output->conf_monitor->mon_identifier);
+ xf86ProcessOptions (output->scrn->scrnIndex,
+ output->conf_monitor->mon_option_lst,
+ output->options);
+ }
+ else
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s has no monitor section\n",
+ output->name);
+}
+
+static Bool
+xf86OutputEnabled (xf86OutputPtr output, Bool strict)
+{
+ Bool enable, disable;
+
+ /* check to see if this output was enabled in the config file */
+ if (xf86GetOptValBool (output->options, OPTION_ENABLE, &enable) && enable)
+ {
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s enabled by config file\n", output->name);
+ return TRUE;
+ }
+ /* or if this output was disabled in the config file */
+ if (xf86GetOptValBool (output->options, OPTION_DISABLE, &disable) && disable)
+ {
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s disabled by config file\n", output->name);
+ return FALSE;
+ }
+
+ /* If not, try to only light up the ones we know are connected */
+ if (strict) {
+ enable = output->status == XF86OutputStatusConnected;
+ }
+ /* But if that fails, try to light up even outputs we're unsure of */
+ else {
+ enable = output->status != XF86OutputStatusDisconnected;
+ }
+
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s %sconnected\n", output->name, enable ? "" : "dis");
+ return enable;
+}
+
+static Bool
+xf86OutputIgnored (xf86OutputPtr output)
+{
+ return xf86ReturnOptValBool (output->options, OPTION_IGNORE, FALSE);
+}
+
+static char *direction[4] = {
+ "normal",
+ "left",
+ "inverted",
+ "right"
+};
+
+static Rotation
+xf86OutputInitialRotation (xf86OutputPtr output)
+{
+ char *rotate_name = xf86GetOptValString (output->options,
+ OPTION_ROTATE);
+ int i;
+
+ if (!rotate_name) {
+ if (output->initial_rotation)
+ return output->initial_rotation;
+ return RR_Rotate_0;
+ }
+
+ for (i = 0; i < 4; i++)
+ if (xf86nameCompare (direction[i], rotate_name) == 0)
+ return 1 << i;
+ return RR_Rotate_0;
+}
+
+xf86OutputPtr
+xf86OutputCreate (ScrnInfoPtr scrn,
+ const xf86OutputFuncsRec *funcs,
+ const char *name)
+{
+ xf86OutputPtr output, *outputs;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int len;
+ Bool primary;
+
+ if (name)
+ len = strlen (name) + 1;
+ else
+ len = 0;
+
+ output = calloc(sizeof (xf86OutputRec) + len, 1);
+ if (!output)
+ return NULL;
+ output->scrn = scrn;
+ output->funcs = funcs;
+ if (name)
+ {
+ output->name = (char *) (output + 1);
+ strcpy (output->name, name);
+ }
+ output->subpixel_order = SubPixelUnknown;
+ /*
+ * Use the old per-screen monitor section for the first output
+ */
+ output->use_screen_monitor = (xf86_config->num_output == 0);
+#ifdef RANDR_12_INTERFACE
+ output->randr_output = NULL;
+#endif
+ if (name)
+ {
+ xf86OutputSetMonitor (output);
+ if (xf86OutputIgnored (output))
+ {
+ free(output);
+ return FALSE;
+ }
+ }
+
+
+ if (xf86_config->output)
+ outputs = realloc(xf86_config->output,
+ (xf86_config->num_output + 1) * sizeof (xf86OutputPtr));
+ else
+ outputs = malloc((xf86_config->num_output + 1) * sizeof (xf86OutputPtr));
+ if (!outputs)
+ {
+ free(output);
+ return NULL;
+ }
+
+ xf86_config->output = outputs;
+
+ if (xf86GetOptValBool (output->options, OPTION_PRIMARY, &primary) && primary)
+ {
+ memmove(xf86_config->output + 1, xf86_config->output,
+ xf86_config->num_output * sizeof (xf86OutputPtr));
+ xf86_config->output[0] = output;
+ }
+ else
+ {
+ xf86_config->output[xf86_config->num_output] = output;
+ }
+
+ xf86_config->num_output++;
+
+ return output;
+}
+
+Bool
+xf86OutputRename (xf86OutputPtr output, const char *name)
+{
+ char *newname = strdup(name);
+
+ if (!newname)
+ return FALSE; /* so sorry... */
+
+ if (output->name && output->name != (char *) (output + 1))
+ free(output->name);
+ output->name = newname;
+ xf86OutputSetMonitor (output);
+ if (xf86OutputIgnored (output))
+ return FALSE;
+ return TRUE;
+}
+
+void
+xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor)
+{
+ if (use_screen_monitor != output->use_screen_monitor)
+ {
+ output->use_screen_monitor = use_screen_monitor;
+ xf86OutputSetMonitor (output);
+ }
+}
+
+void
+xf86OutputDestroy (xf86OutputPtr output)
+{
+ ScrnInfoPtr scrn = output->scrn;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+
+ (*output->funcs->destroy) (output);
+ while (output->probed_modes)
+ xf86DeleteMode (&output->probed_modes, output->probed_modes);
+ for (o = 0; o < xf86_config->num_output; o++)
+ if (xf86_config->output[o] == output)
+ {
+ memmove (&xf86_config->output[o],
+ &xf86_config->output[o+1],
+ ((xf86_config->num_output - (o + 1)) * sizeof(void*)));
+ xf86_config->num_output--;
+ break;
+ }
+ if (output->name && output->name != (char *) (output + 1))
+ free(output->name);
+ free(output);
+}
+
+/*
+ * Called during CreateScreenResources to hook up RandR
+ */
+static Bool
+xf86CrtcCreateScreenResources (ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ screen->CreateScreenResources = config->CreateScreenResources;
+
+ if (!(*screen->CreateScreenResources)(screen))
+ return FALSE;
+
+ if (!xf86RandR12CreateScreenResources (screen))
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
+ * Clean up config on server reset
+ */
+static Bool
+xf86CrtcCloseScreen (int index, ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o, c;
+
+ screen->CloseScreen = config->CloseScreen;
+
+ xf86RotateCloseScreen (screen);
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ output->randr_output = NULL;
+ }
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+
+ crtc->randr_crtc = NULL;
+ }
+ xf86RandR12CloseScreen (screen);
+
+ return screen->CloseScreen (index, screen);
+}
+
+/*
+ * Called at ScreenInit time to set up
+ */
+#ifdef RANDR_13_INTERFACE
+int
+#else
+Bool
+#endif
+xf86CrtcScreenInit (ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c;
+
+ /* Rotation */
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n");
+ xf86DisableRandR(); /* Disable old RandR extension support */
+ xf86RandR12Init (screen);
+
+ /* support all rotations if every crtc has the shadow alloc funcs */
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+ if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create)
+ break;
+ }
+ if (c == config->num_crtc)
+ {
+ xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 |
+ RR_Rotate_180 | RR_Rotate_270 |
+ RR_Reflect_X | RR_Reflect_Y);
+ xf86RandR12SetTransformSupport (screen, TRUE);
+ }
+ else
+ {
+ xf86RandR12SetRotations (screen, RR_Rotate_0);
+ xf86RandR12SetTransformSupport (screen, FALSE);
+ }
+
+ /* Wrap CreateScreenResources so we can initialize the RandR code */
+ config->CreateScreenResources = screen->CreateScreenResources;
+ screen->CreateScreenResources = xf86CrtcCreateScreenResources;
+
+ config->CloseScreen = screen->CloseScreen;
+ screen->CloseScreen = xf86CrtcCloseScreen;
+
+#ifdef XFreeXDGA
+ _xf86_di_dga_init_internal(screen);
+#endif
+#ifdef RANDR_13_INTERFACE
+ return RANDR_INTERFACE_VERSION;
+#else
+ return TRUE;
+#endif
+}
+
+static DisplayModePtr
+xf86DefaultMode (xf86OutputPtr output, int width, int height)
+{
+ DisplayModePtr target_mode = NULL;
+ DisplayModePtr mode;
+ int target_diff = 0;
+ int target_preferred = 0;
+ int mm_height;
+
+ mm_height = output->mm_height;
+ if (!mm_height)
+ mm_height = (768 * 25.4) / DEFAULT_DPI;
+ /*
+ * Pick a mode closest to DEFAULT_DPI
+ */
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ int dpi;
+ int preferred = (((mode->type & M_T_PREFERRED) != 0) +
+ ((mode->type & M_T_USERPREF) != 0));
+ int diff;
+
+ if (xf86ModeWidth (mode, output->initial_rotation) > width ||
+ xf86ModeHeight (mode, output->initial_rotation) > height)
+ continue;
+
+ /* yes, use VDisplay here, not xf86ModeHeight */
+ dpi = (mode->VDisplay * 254) / (mm_height * 10);
+ diff = dpi - DEFAULT_DPI;
+ diff = diff < 0 ? -diff : diff;
+ if (target_mode == NULL || (preferred > target_preferred) ||
+ (preferred == target_preferred && diff < target_diff))
+ {
+ target_mode = mode;
+ target_diff = diff;
+ target_preferred = preferred;
+ }
+ }
+ return target_mode;
+}
+
+static DisplayModePtr
+xf86ClosestMode (xf86OutputPtr output,
+ DisplayModePtr match, Rotation match_rotation,
+ int width, int height)
+{
+ DisplayModePtr target_mode = NULL;
+ DisplayModePtr mode;
+ int target_diff = 0;
+
+ /*
+ * Pick a mode closest to the specified mode
+ */
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ int dx, dy;
+ int diff;
+
+ if (xf86ModeWidth (mode, output->initial_rotation) > width ||
+ xf86ModeHeight (mode, output->initial_rotation) > height)
+ continue;
+
+ /* exact matches are preferred */
+ if (output->initial_rotation == match_rotation &&
+ xf86ModesEqual (mode, match))
+ return mode;
+
+ dx = xf86ModeWidth (match, match_rotation) - xf86ModeWidth (mode, output->initial_rotation);
+ dy = xf86ModeHeight (match, match_rotation) - xf86ModeHeight (mode, output->initial_rotation);
+ diff = dx * dx + dy * dy;
+ if (target_mode == NULL || diff < target_diff)
+ {
+ target_mode = mode;
+ target_diff = diff;
+ }
+ }
+ return target_mode;
+}
+
+static DisplayModePtr
+xf86OutputHasPreferredMode (xf86OutputPtr output, int width, int height)
+{
+ DisplayModePtr mode;
+
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ if (xf86ModeWidth (mode, output->initial_rotation) > width ||
+ xf86ModeHeight (mode, output->initial_rotation) > height)
+ continue;
+
+ if (mode->type & M_T_PREFERRED)
+ return mode;
+ }
+ return NULL;
+}
+
+static DisplayModePtr
+xf86OutputHasUserPreferredMode (xf86OutputPtr output)
+{
+ DisplayModePtr mode, first = output->probed_modes;
+
+ for (mode = first; mode && mode->next != first; mode = mode->next)
+ if (mode->type & M_T_USERPREF)
+ return mode;
+
+ return NULL;
+}
+
+static int
+xf86PickCrtcs (ScrnInfoPtr scrn,
+ xf86CrtcPtr *best_crtcs,
+ DisplayModePtr *modes,
+ int n,
+ int width,
+ int height)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c, o;
+ xf86OutputPtr output;
+ xf86CrtcPtr crtc;
+ xf86CrtcPtr *crtcs;
+ xf86CrtcPtr best_crtc;
+ int best_score;
+ int score;
+ int my_score;
+
+ if (n == config->num_output)
+ return 0;
+ output = config->output[n];
+
+ /*
+ * Compute score with this output disabled
+ */
+ best_crtcs[n] = NULL;
+ best_crtc = NULL;
+ best_score = xf86PickCrtcs (scrn, best_crtcs, modes, n+1, width, height);
+ if (modes[n] == NULL)
+ return best_score;
+
+ crtcs = malloc(config->num_output * sizeof (xf86CrtcPtr));
+ if (!crtcs)
+ return best_score;
+
+ my_score = 1;
+ /* Score outputs that are known to be connected higher */
+ if (output->status == XF86OutputStatusConnected)
+ my_score++;
+ /* Score outputs with preferred modes higher */
+ if (xf86OutputHasPreferredMode (output, width, height))
+ my_score++;
+ /*
+ * Select a crtc for this output and
+ * then attempt to configure the remaining
+ * outputs
+ */
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ if ((output->possible_crtcs & (1 << c)) == 0)
+ continue;
+
+ crtc = config->crtc[c];
+ /*
+ * Check to see if some other output is
+ * using this crtc
+ */
+ for (o = 0; o < n; o++)
+ if (best_crtcs[o] == crtc)
+ break;
+ if (o < n)
+ {
+ /*
+ * If the two outputs desire the same mode,
+ * see if they can be cloned
+ */
+ if (xf86ModesEqual (modes[o], modes[n]) &&
+ config->output[o]->initial_rotation == config->output[n]->initial_rotation &&
+ config->output[o]->initial_x == config->output[n]->initial_x &&
+ config->output[o]->initial_y == config->output[n]->initial_y)
+ {
+ if ((output->possible_clones & (1 << o)) == 0)
+ continue; /* nope, try next CRTC */
+ }
+ else
+ continue; /* different modes, can't clone */
+ }
+ crtcs[n] = crtc;
+ memcpy (crtcs, best_crtcs, n * sizeof (xf86CrtcPtr));
+ score = my_score + xf86PickCrtcs (scrn, crtcs, modes, n+1, width, height);
+ if (score > best_score)
+ {
+ best_crtc = crtc;
+ best_score = score;
+ memcpy (best_crtcs, crtcs, config->num_output * sizeof (xf86CrtcPtr));
+ }
+ }
+ free(crtcs);
+ return best_score;
+}
+
+
+/*
+ * Compute the virtual size necessary to place all of the available
+ * crtcs in the specified configuration.
+ *
+ * canGrow indicates that the driver can make the screen larger than its initial
+ * configuration. If FALSE, this function will enlarge the screen to include
+ * the largest available mode.
+ */
+
+static void
+xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp,
+ Bool canGrow)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int width = 0, height = 0;
+ int o;
+ int c;
+ int s;
+
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ int crtc_width = 0, crtc_height = 0;
+ xf86CrtcPtr crtc = config->crtc[c];
+
+ if (crtc->enabled)
+ {
+ crtc_width = crtc->desiredX + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation);
+ crtc_height = crtc->desiredY + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation);
+ }
+ if (!canGrow) {
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ for (s = 0; s < config->num_crtc; s++)
+ if (output->possible_crtcs & (1 << s))
+ {
+ DisplayModePtr mode;
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ if (mode->HDisplay > crtc_width)
+ crtc_width = mode->HDisplay;
+ if (mode->VDisplay > crtc_width)
+ crtc_width = mode->VDisplay;
+ if (mode->VDisplay > crtc_height)
+ crtc_height = mode->VDisplay;
+ if (mode->HDisplay > crtc_height)
+ crtc_height = mode->HDisplay;
+ }
+ }
+ }
+ }
+ if (crtc_width > width)
+ width = crtc_width;
+ if (crtc_height > height)
+ height = crtc_height;
+ }
+ if (config->maxWidth && width > config->maxWidth) width = config->maxWidth;
+ if (config->maxHeight && height > config->maxHeight) height = config->maxHeight;
+ if (config->minWidth && width < config->minWidth) width = config->minWidth;
+ if (config->minHeight && height < config->minHeight) height = config->minHeight;
+ *widthp = width;
+ *heightp = height;
+}
+
+#define POSITION_UNSET -100000
+
+/*
+ * check if the user configured any outputs at all
+ * with either a position or a relative setting or a mode.
+ */
+static Bool
+xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+ Bool user_conf = FALSE;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ char *position;
+ char *relative_name;
+ OutputOpts relation;
+ int r;
+ static const OutputOpts relations[] = {
+ OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF
+ };
+
+ position = xf86GetOptValString (output->options,
+ OPTION_POSITION);
+ if (position)
+ user_conf = TRUE;
+
+ relation = 0;
+ relative_name = NULL;
+ for (r = 0; r < 4; r++)
+ {
+ relation = relations[r];
+ relative_name = xf86GetOptValString (output->options,
+ relation);
+ if (relative_name)
+ break;
+ }
+ if (relative_name)
+ user_conf = TRUE;
+
+ modes[o] = xf86OutputHasUserPreferredMode(output);
+ if (modes[o])
+ user_conf = TRUE;
+ }
+
+ return user_conf;
+}
+
+static Bool
+xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+ int min_x, min_y;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ output->initial_x = output->initial_y = POSITION_UNSET;
+ }
+
+ /*
+ * Loop until all outputs are set
+ */
+ for (;;)
+ {
+ Bool any_set = FALSE;
+ Bool keep_going = FALSE;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ static const OutputOpts relations[] = {
+ OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF
+ };
+ xf86OutputPtr output = config->output[o];
+ xf86OutputPtr relative;
+ char *relative_name;
+ char *position;
+ OutputOpts relation;
+ int r;
+
+ if (output->initial_x != POSITION_UNSET)
+ continue;
+ position = xf86GetOptValString (output->options,
+ OPTION_POSITION);
+ /*
+ * Absolute position wins
+ */
+ if (position)
+ {
+ int x, y;
+ if (sscanf (position, "%d %d", &x, &y) == 2)
+ {
+ output->initial_x = x;
+ output->initial_y = y;
+ }
+ else
+ {
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Output %s position not of form \"x y\"\n",
+ output->name);
+ output->initial_x = output->initial_y = 0;
+ }
+ any_set = TRUE;
+ continue;
+ }
+ /*
+ * Next comes relative positions
+ */
+ relation = 0;
+ relative_name = NULL;
+ for (r = 0; r < 4; r++)
+ {
+ relation = relations[r];
+ relative_name = xf86GetOptValString (output->options,
+ relation);
+ if (relative_name)
+ break;
+ }
+ if (relative_name)
+ {
+ int or;
+ relative = NULL;
+ for (or = 0; or < config->num_output; or++)
+ {
+ xf86OutputPtr out_rel = config->output[or];
+ XF86ConfMonitorPtr rel_mon = out_rel->conf_monitor;
+
+ if (rel_mon)
+ {
+ if (xf86nameCompare (rel_mon->mon_identifier,
+ relative_name) == 0)
+ {
+ relative = config->output[or];
+ break;
+ }
+ }
+ if (strcmp (out_rel->name, relative_name) == 0)
+ {
+ relative = config->output[or];
+ break;
+ }
+ }
+ if (!relative)
+ {
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Cannot position output %s relative to unknown output %s\n",
+ output->name, relative_name);
+ output->initial_x = 0;
+ output->initial_y = 0;
+ any_set = TRUE;
+ continue;
+ }
+ if (!modes[or])
+ {
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Cannot position output %s relative to output %s without modes\n",
+ output->name, relative_name);
+ output->initial_x = 0;
+ output->initial_y = 0;
+ any_set = TRUE;
+ continue;
+ }
+ if (relative->initial_x == POSITION_UNSET)
+ {
+ keep_going = TRUE;
+ continue;
+ }
+ output->initial_x = relative->initial_x;
+ output->initial_y = relative->initial_y;
+ switch (relation) {
+ case OPTION_BELOW:
+ output->initial_y += xf86ModeHeight (modes[or], relative->initial_rotation);
+ break;
+ case OPTION_RIGHT_OF:
+ output->initial_x += xf86ModeWidth (modes[or], relative->initial_rotation);
+ break;
+ case OPTION_ABOVE:
+ if (modes[o])
+ output->initial_y -= xf86ModeHeight (modes[o], output->initial_rotation);
+ break;
+ case OPTION_LEFT_OF:
+ if (modes[o])
+ output->initial_x -= xf86ModeWidth (modes[o], output->initial_rotation);
+ break;
+ default:
+ break;
+ }
+ any_set = TRUE;
+ continue;
+ }
+
+ /* Nothing set, just stick them at 0,0 */
+ output->initial_x = 0;
+ output->initial_y = 0;
+ any_set = TRUE;
+ }
+ if (!keep_going)
+ break;
+ if (!any_set)
+ {
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ if (output->initial_x == POSITION_UNSET)
+ {
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Output position loop. Moving %s to 0,0\n",
+ output->name);
+ output->initial_x = output->initial_y = 0;
+ break;
+ }
+ }
+ }
+ }
+
+ /*
+ * normalize positions
+ */
+ min_x = 1000000;
+ min_y = 1000000;
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ if (output->initial_x < min_x)
+ min_x = output->initial_x;
+ if (output->initial_y < min_y)
+ min_y = output->initial_y;
+ }
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+
+ output->initial_x -= min_x;
+ output->initial_y -= min_y;
+ }
+ return TRUE;
+}
+
+static void
+xf86InitialPanning (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ char *panning = xf86GetOptValString (output->options, OPTION_PANNING);
+ int width, height, left, top;
+ int track_width, track_height, track_left, track_top;
+ int brdr[4];
+
+ memset (&output->initialTotalArea, 0, sizeof(BoxRec));
+ memset (&output->initialTrackingArea, 0, sizeof(BoxRec));
+ memset (output->initialBorder, 0, 4*sizeof(INT16));
+
+ if (! panning)
+ continue;
+
+ switch (sscanf (panning, "%dx%d+%d+%d/%dx%d+%d+%d/%d/%d/%d/%d",
+ &width, &height, &left, &top,
+ &track_width, &track_height, &track_left, &track_top,
+ &brdr[0], &brdr[1], &brdr[2], &brdr[3])) {
+ case 12:
+ output->initialBorder[0] = brdr[0];
+ output->initialBorder[1] = brdr[1];
+ output->initialBorder[2] = brdr[2];
+ output->initialBorder[3] = brdr[3];
+ /* fall through */
+ case 8:
+ output->initialTrackingArea.x1 = track_left;
+ output->initialTrackingArea.y1 = track_top;
+ output->initialTrackingArea.x2 = track_left + track_width;
+ output->initialTrackingArea.y2 = track_top + track_height;
+ /* fall through */
+ case 4:
+ output->initialTotalArea.x1 = left;
+ output->initialTotalArea.y1 = top;
+ /* fall through */
+ case 2:
+ output->initialTotalArea.x2 = output->initialTotalArea.x1 + width;
+ output->initialTotalArea.y2 = output->initialTotalArea.y1 + height;
+ break;
+ default:
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Broken panning specification '%s' for output %s in config file\n",
+ panning, output->name);
+ }
+ }
+}
+
+/** Return - 0 + if a should be earlier, same or later than b in list
+ */
+static int
+xf86ModeCompare (DisplayModePtr a, DisplayModePtr b)
+{
+ int diff;
+
+ diff = ((b->type & M_T_PREFERRED) != 0) - ((a->type & M_T_PREFERRED) != 0);
+ if (diff)
+ return diff;
+ diff = b->HDisplay * b->VDisplay - a->HDisplay * a->VDisplay;
+ if (diff)
+ return diff;
+ diff = b->Clock - a->Clock;
+ return diff;
+}
+
+/**
+ * Insertion sort input in-place and return the resulting head
+ */
+static DisplayModePtr
+xf86SortModes (DisplayModePtr input)
+{
+ DisplayModePtr output = NULL, i, o, n, *op, prev;
+
+ /* sort by preferred status and pixel area */
+ while (input)
+ {
+ i = input;
+ input = input->next;
+ for (op = &output; (o = *op); op = &o->next)
+ if (xf86ModeCompare (o, i) > 0)
+ break;
+ i->next = *op;
+ *op = i;
+ }
+ /* prune identical modes */
+ for (o = output; o && (n = o->next); o = n)
+ {
+ if (!strcmp (o->name, n->name) && xf86ModesEqual (o, n))
+ {
+ o->next = n->next;
+ free(n->name);
+ free(n);
+ n = o;
+ }
+ }
+ /* hook up backward links */
+ prev = NULL;
+ for (o = output; o; o = o->next)
+ {
+ o->prev = prev;
+ prev = o;
+ }
+ return output;
+}
+
+static char *
+preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output)
+{
+ char *preferred_mode = NULL;
+
+ /* Check for a configured preference for a particular mode */
+ preferred_mode = xf86GetOptValString (output->options,
+ OPTION_PREFERRED_MODE);
+ if (preferred_mode)
+ return preferred_mode;
+
+ if (pScrn->display->modes && *pScrn->display->modes)
+ preferred_mode = *pScrn->display->modes;
+
+ return preferred_mode;
+}
+
+static void
+GuessRangeFromModes(MonPtr mon, DisplayModePtr mode)
+{
+ if (!mon || !mode)
+ return;
+
+ mon->nHsync = 1;
+ mon->hsync[0].lo = 1024.0;
+ mon->hsync[0].hi = 0.0;
+
+ mon->nVrefresh = 1;
+ mon->vrefresh[0].lo = 1024.0;
+ mon->vrefresh[0].hi = 0.0;
+
+ while (mode) {
+ if (!mode->HSync)
+ mode->HSync = ((float) mode->Clock ) / ((float) mode->HTotal);
+
+ if (!mode->VRefresh)
+ mode->VRefresh = (1000.0 * ((float) mode->Clock)) /
+ ((float) (mode->HTotal * mode->VTotal));
+
+ if (mode->HSync < mon->hsync[0].lo)
+ mon->hsync[0].lo = mode->HSync;
+
+ if (mode->HSync > mon->hsync[0].hi)
+ mon->hsync[0].hi = mode->HSync;
+
+ if (mode->VRefresh < mon->vrefresh[0].lo)
+ mon->vrefresh[0].lo = mode->VRefresh;
+
+ if (mode->VRefresh > mon->vrefresh[0].hi)
+ mon->vrefresh[0].hi = mode->VRefresh;
+
+ mode = mode->next;
+ }
+
+ /* stretch out the bottom to fit 640x480@60 */
+ if (mon->hsync[0].lo > 31.0)
+ mon->hsync[0].lo = 31.0;
+ if (mon->vrefresh[0].lo > 58.0)
+ mon->vrefresh[0].lo = 58.0;
+}
+
+enum det_monrec_source {
+ sync_config, sync_edid, sync_default
+};
+
+struct det_monrec_parameter {
+ MonRec *mon_rec;
+ int *max_clock;
+ Bool set_hsync;
+ Bool set_vrefresh;
+ enum det_monrec_source *sync_source;
+};
+
+static void handle_detailed_monrec(struct detailed_monitor_section *det_mon,
+ void *data)
+{
+ struct det_monrec_parameter *p;
+ p = (struct det_monrec_parameter *)data;
+
+ if (det_mon->type == DS_RANGES) {
+ struct monitor_ranges *ranges = &det_mon->section.ranges;
+ if (p->set_hsync && ranges->max_h) {
+ p->mon_rec->hsync[p->mon_rec->nHsync].lo = ranges->min_h;
+ p->mon_rec->hsync[p->mon_rec->nHsync].hi = ranges->max_h;
+ p->mon_rec->nHsync++;
+ if (*p->sync_source == sync_default)
+ *p->sync_source = sync_edid;
+ }
+ if (p->set_vrefresh && ranges->max_v) {
+ p->mon_rec->vrefresh[p->mon_rec->nVrefresh].lo = ranges->min_v;
+ p->mon_rec->vrefresh[p->mon_rec->nVrefresh].hi = ranges->max_v;
+ p->mon_rec->nVrefresh++;
+ if (*p->sync_source == sync_default)
+ *p->sync_source = sync_edid;
+ }
+ if (ranges->max_clock * 1000 > *p->max_clock)
+ *p->max_clock = ranges->max_clock * 1000;
+ }
+}
+
+void
+xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+
+ /* When canGrow was TRUE in the initial configuration we have to
+ * compare against the maximum values so that we don't drop modes.
+ * When canGrow was FALSE, the maximum values would have been clamped
+ * anyway.
+ */
+ if (maxX == 0 || maxY == 0) {
+ maxX = config->maxWidth;
+ maxY = config->maxHeight;
+ }
+
+ /* Probe the list of modes for each output. */
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ DisplayModePtr mode;
+ DisplayModePtr config_modes = NULL, output_modes, default_modes = NULL;
+ char *preferred_mode;
+ xf86MonPtr edid_monitor;
+ XF86ConfMonitorPtr conf_monitor;
+ MonRec mon_rec;
+ int min_clock = 0;
+ int max_clock = 0;
+ double clock;
+ Bool add_default_modes;
+ Bool debug_modes = config->debug_modes ||
+ xf86Initialising;
+ enum det_monrec_source sync_source = sync_default;
+
+ while (output->probed_modes != NULL)
+ xf86DeleteMode(&output->probed_modes, output->probed_modes);
+
+ /*
+ * Check connection status
+ */
+ output->status = (*output->funcs->detect)(output);
+
+ if (output->status == XF86OutputStatusDisconnected &&
+ !xf86ReturnOptValBool(output->options, OPTION_ENABLE, FALSE))
+ {
+ xf86OutputSetEDID (output, NULL);
+ continue;
+ }
+
+ memset (&mon_rec, '\0', sizeof (mon_rec));
+
+ conf_monitor = output->conf_monitor;
+
+ if (conf_monitor)
+ {
+ int i;
+
+ for (i = 0; i < conf_monitor->mon_n_hsync; i++)
+ {
+ mon_rec.hsync[mon_rec.nHsync].lo = conf_monitor->mon_hsync[i].lo;
+ mon_rec.hsync[mon_rec.nHsync].hi = conf_monitor->mon_hsync[i].hi;
+ mon_rec.nHsync++;
+ sync_source = sync_config;
+ }
+ for (i = 0; i < conf_monitor->mon_n_vrefresh; i++)
+ {
+ mon_rec.vrefresh[mon_rec.nVrefresh].lo = conf_monitor->mon_vrefresh[i].lo;
+ mon_rec.vrefresh[mon_rec.nVrefresh].hi = conf_monitor->mon_vrefresh[i].hi;
+ mon_rec.nVrefresh++;
+ sync_source = sync_config;
+ }
+ config_modes = xf86GetMonitorModes (scrn, conf_monitor);
+ }
+
+ output_modes = (*output->funcs->get_modes) (output);
+
+ /*
+ * If the user has a preference, respect it.
+ * Otherwise, don't second-guess the driver.
+ */
+ if (!xf86GetOptValBool(output->options, OPTION_DEFAULT_MODES,
+ &add_default_modes))
+ add_default_modes = (output_modes == NULL);
+
+ edid_monitor = output->MonInfo;
+
+ if (edid_monitor)
+ {
+ struct det_monrec_parameter p;
+ struct disp_features *features = &edid_monitor->features;
+
+ /* if display is not continuous-frequency, don't add default modes */
+ if (!GTF_SUPPORTED(features->msc))
+ add_default_modes = FALSE;
+
+ p.mon_rec = &mon_rec;
+ p.max_clock = &max_clock;
+ p.set_hsync = mon_rec.nHsync == 0;
+ p.set_vrefresh = mon_rec.nVrefresh == 0;
+ p.sync_source = &sync_source;
+
+ xf86ForEachDetailedBlock(edid_monitor,
+ handle_detailed_monrec,
+ &p);
+ }
+
+ if (xf86GetOptValFreq (output->options, OPTION_MIN_CLOCK,
+ OPTUNITS_KHZ, &clock))
+ min_clock = (int) clock;
+ if (xf86GetOptValFreq (output->options, OPTION_MAX_CLOCK,
+ OPTUNITS_KHZ, &clock))
+ max_clock = (int) clock;
+
+ /* If we still don't have a sync range, guess wildly */
+ if (!mon_rec.nHsync || !mon_rec.nVrefresh)
+ GuessRangeFromModes(&mon_rec, output_modes);
+
+ /*
+ * These limits will end up setting a 1024x768@60Hz mode by default,
+ * which seems like a fairly good mode to use when nothing else is
+ * specified
+ */
+ if (mon_rec.nHsync == 0)
+ {
+ mon_rec.hsync[0].lo = 31.0;
+ mon_rec.hsync[0].hi = 55.0;
+ mon_rec.nHsync = 1;
+ }
+ if (mon_rec.nVrefresh == 0)
+ {
+ mon_rec.vrefresh[0].lo = 58.0;
+ mon_rec.vrefresh[0].hi = 62.0;
+ mon_rec.nVrefresh = 1;
+ }
+
+ if (add_default_modes)
+ default_modes = xf86GetDefaultModes ();
+
+ /*
+ * If this is not an RB monitor, remove RB modes from the default
+ * pool. RB modes from the config or the monitor itself are fine.
+ */
+ if (!mon_rec.reducedblanking)
+ xf86ValidateModesReducedBlanking (scrn, default_modes);
+
+ if (sync_source == sync_config)
+ {
+ /*
+ * Check output and config modes against sync range from config file
+ */
+ xf86ValidateModesSync (scrn, output_modes, &mon_rec);
+ xf86ValidateModesSync (scrn, config_modes, &mon_rec);
+ }
+ /*
+ * Check default modes against sync range
+ */
+ xf86ValidateModesSync (scrn, default_modes, &mon_rec);
+ /*
+ * Check default modes against monitor max clock
+ */
+ if (max_clock) {
+ xf86ValidateModesClocks(scrn, default_modes,
+ &min_clock, &max_clock, 1);
+ xf86ValidateModesClocks(scrn, output_modes,
+ &min_clock, &max_clock, 1);
+ }
+
+ output->probed_modes = NULL;
+ output->probed_modes = xf86ModesAdd (output->probed_modes, config_modes);
+ output->probed_modes = xf86ModesAdd (output->probed_modes, output_modes);
+ output->probed_modes = xf86ModesAdd (output->probed_modes, default_modes);
+
+ /*
+ * Check all modes against max size, interlace, and doublescan
+ */
+ if (maxX && maxY)
+ xf86ValidateModesSize (scrn, output->probed_modes,
+ maxX, maxY, 0);
+
+ {
+ int flags = (output->interlaceAllowed ? V_INTERLACE : 0) |
+ (output->doubleScanAllowed ? V_DBLSCAN : 0);
+ xf86ValidateModesFlags (scrn, output->probed_modes, flags);
+ }
+
+ /*
+ * Check all modes against output
+ */
+ for (mode = output->probed_modes; mode != NULL; mode = mode->next)
+ if (mode->status == MODE_OK)
+ mode->status = (*output->funcs->mode_valid)(output, mode);
+
+ xf86PruneInvalidModes(scrn, &output->probed_modes, debug_modes);
+
+ output->probed_modes = xf86SortModes (output->probed_modes);
+
+ /* Check for a configured preference for a particular mode */
+ preferred_mode = preferredMode(scrn, output);
+
+ if (preferred_mode)
+ {
+ for (mode = output->probed_modes; mode; mode = mode->next)
+ {
+ if (!strcmp (preferred_mode, mode->name))
+ {
+ if (mode != output->probed_modes)
+ {
+ if (mode->prev)
+ mode->prev->next = mode->next;
+ if (mode->next)
+ mode->next->prev = mode->prev;
+ mode->next = output->probed_modes;
+ output->probed_modes->prev = mode;
+ mode->prev = NULL;
+ output->probed_modes = mode;
+ }
+ mode->type |= (M_T_PREFERRED|M_T_USERPREF);
+ break;
+ }
+ }
+ }
+
+ output->initial_rotation = xf86OutputInitialRotation (output);
+
+ if (debug_modes) {
+ if (output->probed_modes != NULL) {
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
+ "Printing probed modes for output %s\n",
+ output->name);
+ } else {
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
+ "No remaining probed modes for output %s\n",
+ output->name);
+ }
+ }
+ for (mode = output->probed_modes; mode != NULL; mode = mode->next)
+ {
+ /* The code to choose the best mode per pipe later on will require
+ * VRefresh to be set.
+ */
+ mode->VRefresh = xf86ModeVRefresh(mode);
+ xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
+
+ if (debug_modes)
+ xf86PrintModeline(scrn->scrnIndex, mode);
+ }
+ }
+}
+
+
+/**
+ * Copy one of the output mode lists to the ScrnInfo record
+ */
+
+/* XXX where does this function belong? Here? */
+void
+xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y);
+
+static DisplayModePtr
+biggestMode(DisplayModePtr a, DisplayModePtr b)
+{
+ int A, B;
+
+ if (!a)
+ return b;
+ if (!b)
+ return a;
+
+ A = a->HDisplay * a->VDisplay;
+ B = b->HDisplay * b->VDisplay;
+
+ if (A > B)
+ return a;
+
+ return b;
+}
+
+static xf86OutputPtr
+SetCompatOutput(xf86CrtcConfigPtr config)
+{
+ xf86OutputPtr output = NULL, test = NULL;
+ DisplayModePtr maxmode = NULL, testmode, mode;
+ int o, compat = -1, count, mincount = 0;
+
+ /* Look for one that's definitely connected */
+ for (o = 0; o < config->num_output; o++)
+ {
+ test = config->output[o];
+ if (!test->crtc)
+ continue;
+ if (test->status != XF86OutputStatusConnected)
+ continue;
+ if (!test->probed_modes)
+ continue;
+
+ testmode = mode = test->probed_modes;
+ for (count = 0; mode; mode = mode->next, count++)
+ testmode = biggestMode(testmode, mode);
+
+ if (!output) {
+ output = test;
+ compat = o;
+ maxmode = testmode;
+ mincount = count;
+ } else if (maxmode == biggestMode(maxmode, testmode)) {
+ output = test;
+ compat = o;
+ maxmode = testmode;
+ mincount = count;
+ } else if ((maxmode->HDisplay == testmode->HDisplay) &&
+ (maxmode->VDisplay == testmode->VDisplay) &&
+ count <= mincount) {
+ output = test;
+ compat = o;
+ maxmode = testmode;
+ mincount = count;
+ }
+ }
+
+ /* If we didn't find one, take anything we can get */
+ if (!output)
+ {
+ for (o = 0; o < config->num_output; o++)
+ {
+ test = config->output[o];
+ if (!test->crtc)
+ continue;
+ if (!test->probed_modes)
+ continue;
+
+ if (!output) {
+ output = test;
+ compat = o;
+ } else if (test->probed_modes->HDisplay < output->probed_modes->HDisplay) {
+ output = test;
+ compat = o;
+ }
+ }
+ }
+
+ if (compat >= 0) {
+ config->compat_output = compat;
+ } else {
+ /* Don't change the compat output when no valid outputs found */
+ output = config->output[config->compat_output];
+ }
+
+ return output;
+}
+
+void
+xf86SetScrnInfoModes (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86OutputPtr output;
+ xf86CrtcPtr crtc;
+ DisplayModePtr last, mode = NULL;
+
+ output = SetCompatOutput(config);
+
+ if (!output)
+ return; /* punt */
+
+ crtc = output->crtc;
+
+ /* Clear any existing modes from scrn->modes */
+ while (scrn->modes != NULL)
+ xf86DeleteMode(&scrn->modes, scrn->modes);
+
+ /* Set scrn->modes to the mode list for the 'compat' output */
+ scrn->modes = xf86DuplicateModes(scrn, output->probed_modes);
+
+ if (crtc) {
+ for (mode = scrn->modes; mode; mode = mode->next)
+ if (xf86ModesEqual (mode, &crtc->desiredMode))
+ break;
+ }
+
+ if (scrn->modes != NULL) {
+ /* For some reason, scrn->modes is circular, unlike the other mode
+ * lists. How great is that?
+ */
+ for (last = scrn->modes; last && last->next; last = last->next)
+ ;
+ last->next = scrn->modes;
+ scrn->modes->prev = last;
+ if (mode) {
+ while (scrn->modes != mode)
+ scrn->modes = scrn->modes->next;
+ }
+ }
+ scrn->currentMode = scrn->modes;
+#ifdef XFreeXDGA
+ if (scrn->pScreen)
+ _xf86_di_dga_reinit_internal(scrn->pScreen);
+#endif
+}
+
+static Bool
+xf86CollectEnabledOutputs(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ Bool *enabled)
+{
+ Bool any_enabled = FALSE;
+ int o;
+
+ for (o = 0; o < config->num_output; o++)
+ any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], TRUE);
+
+ if (!any_enabled) {
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+ "No outputs definitely connected, trying again...\n");
+
+ for (o = 0; o < config->num_output; o++)
+ any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], FALSE);
+ }
+
+ return any_enabled;
+}
+
+static Bool
+nextEnabledOutput(xf86CrtcConfigPtr config, Bool *enabled, int *index)
+{
+ int o = *index;
+
+ for (o++; o < config->num_output; o++) {
+ if (enabled[o]) {
+ *index = o;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+static Bool
+aspectMatch(float a, float b)
+{
+ return fabs(1 - (a / b)) < 0.05;
+}
+
+static DisplayModePtr
+nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect)
+{
+ DisplayModePtr m = NULL;
+
+ if (!o)
+ return NULL;
+
+ if (!last)
+ m = o->probed_modes;
+ else
+ m = last->next;
+
+ for (; m; m = m->next)
+ if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay))
+ return m;
+
+ return NULL;
+}
+
+static DisplayModePtr
+bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
+{
+ int o = -1, p;
+ DisplayModePtr mode = NULL, test = NULL, match = NULL;
+
+ if (!nextEnabledOutput(config, enabled, &o))
+ return NULL;
+ while ((mode = nextAspectMode(config->output[o], mode, aspect))) {
+ test = mode;
+ for (p = o; nextEnabledOutput(config, enabled, &p); ) {
+ test = xf86OutputFindClosestMode(config->output[p], mode);
+ if (!test)
+ break;
+ if (test->HDisplay != mode->HDisplay ||
+ test->VDisplay != mode->VDisplay) {
+ test = NULL;
+ break;
+ }
+ }
+
+ /* if we didn't match it on all outputs, try the next one */
+ if (!test)
+ continue;
+
+ /* if it's bigger than the last one, save it */
+ if (!match || (test->HDisplay > match->HDisplay))
+ match = test;
+ }
+
+ /* return the biggest one found */
+ return match;
+}
+
+static Bool
+xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ DisplayModePtr *modes, Bool *enabled,
+ int width, int height)
+{
+ int o, p;
+ int max_pref_width = 0, max_pref_height = 0;
+ DisplayModePtr *preferred, *preferred_match;
+ Bool ret = FALSE;
+
+ preferred = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
+ preferred_match = xnfcalloc(config->num_output, sizeof(DisplayModePtr));
+
+ /* Check if the preferred mode is available on all outputs */
+ for (p = -1; nextEnabledOutput(config, enabled, &p); ) {
+ Rotation r = config->output[p]->initial_rotation;
+ DisplayModePtr mode;
+ if ((preferred[p] = xf86OutputHasPreferredMode(config->output[p],
+ width, height))) {
+ int pref_width = xf86ModeWidth(preferred[p], r);
+ int pref_height = xf86ModeHeight(preferred[p], r);
+ Bool all_match = TRUE;
+
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ Bool match = FALSE;
+ xf86OutputPtr output = config->output[o];
+ if (o == p)
+ continue;
+
+ for (mode = output->probed_modes; mode; mode = mode->next) {
+ Rotation r = output->initial_rotation;
+ if (xf86ModeWidth(mode, r) == pref_width &&
+ xf86ModeHeight(mode, r) == pref_height) {
+ preferred[o] = mode;
+ match = TRUE;
+ }
+ }
+
+ all_match &= match;
+ }
+
+ if (all_match &&
+ (pref_width*pref_height > max_pref_width*max_pref_height)) {
+ for (o = -1; nextEnabledOutput(config, enabled, &o); )
+ preferred_match[o] = preferred[o];
+ max_pref_width = pref_width;
+ max_pref_height = pref_height;
+ ret = TRUE;
+ }
+ }
+ }
+
+ /*
+ * If there's no preferred mode, but only one monitor, pick the
+ * biggest mode for its aspect ratio, assuming one exists.
+ */
+ if (!ret) do {
+ int i = 0;
+ float aspect = 0.0;
+
+ /* count the number of enabled outputs */
+ for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ;
+
+ if (i != 1)
+ break;
+
+ p = -1;
+ nextEnabledOutput(config, enabled, &p);
+ if (config->output[p]->mm_height)
+ aspect = (float)config->output[p]->mm_width /
+ (float)config->output[p]->mm_height;
+
+ if (aspect)
+ preferred_match[p] = bestModeForAspect(config, enabled, aspect);
+
+ if (preferred_match[p])
+ ret = TRUE;
+
+ } while (0);
+
+ if (ret) {
+ /* oh good, there is a match. stash the selected modes and return. */
+ memcpy(modes, preferred_match,
+ config->num_output * sizeof(DisplayModePtr));
+ }
+
+ free(preferred);
+ free(preferred_match);
+ return ret;
+}
+
+static Bool
+xf86TargetAspect(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ DisplayModePtr *modes, Bool *enabled,
+ int width, int height)
+{
+ int o;
+ float aspect = 0.0, *aspects;
+ xf86OutputPtr output;
+ Bool ret = FALSE;
+ DisplayModePtr guess = NULL, aspect_guess = NULL, base_guess = NULL;
+
+ aspects = xnfcalloc(config->num_output, sizeof(float));
+
+ /* collect the aspect ratios */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ output = config->output[o];
+ if (output->mm_height)
+ aspects[o] = (float)output->mm_width / (float)output->mm_height;
+ else
+ aspects[o] = 4.0 / 3.0;
+ }
+
+ /* check that they're all the same */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ output = config->output[o];
+ if (!aspect) {
+ aspect = aspects[o];
+ } else if (!aspectMatch(aspect, aspects[o])) {
+ goto no_aspect_match;
+ }
+ }
+
+ /* if they're all 4:3, just skip ahead and save effort */
+ if (!aspectMatch(aspect, 4.0/3.0))
+ aspect_guess = bestModeForAspect(config, enabled, aspect);
+
+no_aspect_match:
+ base_guess = bestModeForAspect(config, enabled, 4.0/3.0);
+
+ guess = biggestMode(base_guess, aspect_guess);
+
+ if (!guess)
+ goto out;
+
+ /* found a mode that works everywhere, now apply it */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ modes[o] = xf86OutputFindClosestMode(config->output[o], guess);
+ }
+ ret = TRUE;
+
+out:
+ free(aspects);
+ return ret;
+}
+
+static Bool
+xf86TargetFallback(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ DisplayModePtr *modes, Bool *enabled,
+ int width, int height)
+{
+ DisplayModePtr target_mode = NULL;
+ Rotation target_rotation = RR_Rotate_0;
+ DisplayModePtr default_mode;
+ int default_preferred, target_preferred = 0, o;
+
+ /* User preferred > preferred > other modes */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ default_mode = xf86DefaultMode (config->output[o], width, height);
+ if (!default_mode)
+ continue;
+
+ default_preferred = (((default_mode->type & M_T_PREFERRED) != 0) +
+ ((default_mode->type & M_T_USERPREF) != 0));
+
+ if (default_preferred > target_preferred || !target_mode) {
+ target_mode = default_mode;
+ target_preferred = default_preferred;
+ target_rotation = config->output[o]->initial_rotation;
+ config->compat_output = o;
+ }
+ }
+
+ if (target_mode)
+ modes[config->compat_output] = target_mode;
+
+ /* Fill in other output modes */
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ if (!modes[o])
+ modes[o] = xf86ClosestMode(config->output[o], target_mode,
+ target_rotation, width, height);
+ }
+
+ return target_mode != NULL;
+}
+
+static Bool
+xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+ DisplayModePtr *modes, Bool *enabled,
+ int width, int height)
+{
+ int o;
+
+ if (xf86UserConfiguredOutputs(scrn, modes))
+ return xf86TargetFallback(scrn, config, modes, enabled, width, height);
+
+ for (o = -1; nextEnabledOutput(config, enabled, &o); )
+ if (xf86OutputHasUserPreferredMode(config->output[o]))
+ return
+ xf86TargetFallback(scrn, config, modes, enabled, width, height);
+
+ return FALSE;
+}
+
+static Bool
+xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green,
+ float gamma_blue)
+{
+ int i, size = 256;
+ CARD16 *red, *green, *blue;
+
+ red = malloc(3 * size * sizeof(CARD16));
+ green = red + size;
+ blue = green + size;
+
+ /* Only cause warning if user wanted gamma to be set. */
+ if (!crtc->funcs->gamma_set && (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0)) {
+ free(red);
+ return FALSE;
+ } else if (!crtc->funcs->gamma_set) {
+ free(red);
+ return TRUE;
+ }
+
+ /* At this early stage none of the randr-interface stuff is up.
+ * So take the default gamma size for lack of something better.
+ */
+ for (i = 0; i < size; i++) {
+ if (gamma_red == 1.0)
+ red[i] = i << 8;
+ else
+ red[i] = (CARD16)(pow((double)i/(double)(size - 1),
+ 1. / (double)gamma_red) * (double)(size - 1) * 256);
+
+ if (gamma_green == 1.0)
+ green[i] = i << 8;
+ else
+ green[i] = (CARD16)(pow((double)i/(double)(size - 1),
+ 1. / (double)gamma_green) * (double)(size - 1) * 256);
+
+ if (gamma_blue == 1.0)
+ blue[i] = i << 8;
+ else
+ blue[i] = (CARD16)(pow((double)i/(double)(size - 1),
+ 1. / (double)gamma_blue) * (double)(size - 1) * 256);
+ }
+
+ /* Default size is 256, so anything else is failure. */
+ if (size != crtc->gamma_size) {
+ free(red);
+ return FALSE;
+ }
+
+ crtc->gamma_size = size;
+ memcpy (crtc->gamma_red, red, crtc->gamma_size * sizeof (CARD16));
+ memcpy (crtc->gamma_green, green, crtc->gamma_size * sizeof (CARD16));
+ memcpy (crtc->gamma_blue, blue, crtc->gamma_size * sizeof (CARD16));
+
+ /* Do not set gamma now, delay until the crtc is activated. */
+
+ free(red);
+
+ return TRUE;
+}
+
+static Bool
+xf86OutputSetInitialGamma(xf86OutputPtr output)
+{
+ XF86ConfMonitorPtr mon = output->conf_monitor;
+ float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0;
+
+ if (!mon)
+ return TRUE;
+
+ if (!output->crtc)
+ return FALSE;
+
+ /* Get configured values, where they exist. */
+ if (mon->mon_gamma_red >= GAMMA_MIN &&
+ mon->mon_gamma_red <= GAMMA_MAX)
+ gamma_red = mon->mon_gamma_red;
+
+ if (mon->mon_gamma_green >= GAMMA_MIN &&
+ mon->mon_gamma_green <= GAMMA_MAX)
+ gamma_green = mon->mon_gamma_green;
+
+ if (mon->mon_gamma_blue >= GAMMA_MIN &&
+ mon->mon_gamma_blue <= GAMMA_MAX)
+ gamma_blue = mon->mon_gamma_blue;
+
+ /* This avoids setting gamma 1.0 in case another cloned output on this crtc has a specific gamma. */
+ if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) {
+ xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", output->name, gamma_red, gamma_green, gamma_blue);
+ return xf86CrtcSetInitialGamma(output->crtc, gamma_red, gamma_green, gamma_blue);
+ }else
+ return TRUE;
+}
+
+/**
+ * Construct default screen configuration
+ *
+ * Given auto-detected (and, eventually, configured) values,
+ * construct a usable configuration for the system
+ *
+ * canGrow indicates that the driver can resize the screen to larger than its
+ * initially configured size via the config->funcs->resize hook. If TRUE, this
+ * function will set virtualX and virtualY to match the initial configuration
+ * and leave config->max{Width,Height} alone. If FALSE, it will bloat
+ * virtual[XY] to include the largest modes and set config->max{Width,Height}
+ * accordingly.
+ */
+
+Bool
+xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o, c;
+ xf86CrtcPtr *crtcs;
+ DisplayModePtr *modes;
+ Bool *enabled;
+ int width, height;
+ int i = scrn->scrnIndex;
+ Bool have_outputs = TRUE;
+ Bool ret;
+ Bool success = FALSE;
+
+ /* Set up the device options */
+ config->options = xnfalloc (sizeof (xf86DeviceOptions));
+ memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions));
+ xf86ProcessOptions (scrn->scrnIndex,
+ scrn->options,
+ config->options);
+ config->debug_modes = xf86ReturnOptValBool (config->options,
+ OPTION_MODEDEBUG, FALSE);
+
+ if (scrn->display->virtualX)
+ width = scrn->display->virtualX;
+ else
+ width = config->maxWidth;
+ if (scrn->display->virtualY)
+ height = scrn->display->virtualY;
+ else
+ height = config->maxHeight;
+
+ xf86ProbeOutputModes (scrn, width, height);
+
+ crtcs = xnfcalloc (config->num_output, sizeof (xf86CrtcPtr));
+ modes = xnfcalloc (config->num_output, sizeof (DisplayModePtr));
+ enabled = xnfcalloc (config->num_output, sizeof (Bool));
+
+ ret = xf86CollectEnabledOutputs(scrn, config, enabled);
+ if (ret == FALSE && canGrow) {
+ xf86DrvMsg(i, X_WARNING, "Unable to find connected outputs - setting %dx%d initial framebuffer\n",
+ NO_OUTPUT_DEFAULT_WIDTH, NO_OUTPUT_DEFAULT_HEIGHT);
+ have_outputs = FALSE;
+ } else {
+ if (xf86TargetUserpref(scrn, config, modes, enabled, width, height))
+ xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n");
+ else if (xf86TargetPreferred(scrn, config, modes, enabled, width, height))
+ xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n");
+ else if (xf86TargetAspect(scrn, config, modes, enabled, width, height))
+ xf86DrvMsg(i, X_INFO, "Using fuzzy aspect match for initial modes\n");
+ else if (xf86TargetFallback(scrn, config, modes, enabled, width, height))
+ xf86DrvMsg(i, X_INFO, "Using sloppy heuristic for initial modes\n");
+ else
+ xf86DrvMsg(i, X_WARNING, "Unable to find initial modes\n");
+ }
+
+ for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+ if (!modes[o])
+ xf86DrvMsg (scrn->scrnIndex, X_ERROR,
+ "Output %s enabled but has no modes\n",
+ config->output[o]->name);
+ else
+ xf86DrvMsg (scrn->scrnIndex, X_INFO,
+ "Output %s using initial mode %s\n",
+ config->output[o]->name, modes[o]->name);
+ }
+
+ /*
+ * Set the position of each output
+ */
+ if (!xf86InitialOutputPositions (scrn, modes))
+ goto bailout;
+
+ /*
+ * Set initial panning of each output
+ */
+ xf86InitialPanning (scrn);
+
+ /*
+ * Assign CRTCs to fit output configuration
+ */
+ if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, height))
+ goto bailout;
+
+ /* XXX override xf86 common frame computation code */
+
+ scrn->display->frameX0 = 0;
+ scrn->display->frameY0 = 0;
+
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+
+ crtc->enabled = FALSE;
+ memset (&crtc->desiredMode, '\0', sizeof (crtc->desiredMode));
+ /* Set default gamma for all crtc's. */
+ /* This is done to avoid problems later on with cloned outputs. */
+ xf86CrtcSetInitialGamma(crtc, 1.0, 1.0, 1.0);
+ }
+
+ if (xf86_crtc_supports_gamma(scrn))
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.\n");
+
+ /*
+ * Set initial configuration
+ */
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ DisplayModePtr mode = modes[o];
+ xf86CrtcPtr crtc = crtcs[o];
+
+ if (mode && crtc)
+ {
+ crtc->desiredMode = *mode;
+ crtc->desiredRotation = output->initial_rotation;
+ crtc->desiredX = output->initial_x;
+ crtc->desiredY = output->initial_y;
+ crtc->desiredTransformPresent = FALSE;
+ crtc->enabled = TRUE;
+ memcpy (&crtc->panningTotalArea, &output->initialTotalArea, sizeof(BoxRec));
+ memcpy (&crtc->panningTrackingArea, &output->initialTrackingArea, sizeof(BoxRec));
+ memcpy (crtc->panningBorder, output->initialBorder, 4*sizeof(INT16));
+ output->crtc = crtc;
+ if (!xf86OutputSetInitialGamma(output))
+ xf86DrvMsg (scrn->scrnIndex, X_WARNING, "Initial gamma correction for output %s: failed.\n", output->name);
+ } else {
+ output->crtc = NULL;
+ }
+ }
+
+ if (scrn->display->virtualX == 0)
+ {
+ /*
+ * Expand virtual size to cover the current config and potential mode
+ * switches, if the driver can't enlarge the screen later.
+ */
+ xf86DefaultScreenLimits (scrn, &width, &height, canGrow);
+
+ if (have_outputs == FALSE) {
+ if (width < NO_OUTPUT_DEFAULT_WIDTH && height < NO_OUTPUT_DEFAULT_HEIGHT) {
+ width = NO_OUTPUT_DEFAULT_WIDTH;
+ height = NO_OUTPUT_DEFAULT_HEIGHT;
+ }
+ }
+
+ scrn->display->virtualX = width;
+ scrn->display->virtualY = height;
+ }
+
+ if (width > scrn->virtualX)
+ scrn->virtualX = width;
+ if (height > scrn->virtualY)
+ scrn->virtualY = height;
+
+ /*
+ * Make sure the configuration isn't too small.
+ */
+ if (width < config->minWidth || height < config->minHeight)
+ goto bailout;
+
+ /*
+ * Limit the crtc config to virtual[XY] if the driver can't grow the
+ * desktop.
+ */
+ if (!canGrow)
+ {
+ xf86CrtcSetSizeRange (scrn, config->minWidth, config->minHeight,
+ width, height);
+ }
+
+ if (have_outputs) {
+ /* Mirror output modes to scrn mode list */
+ xf86SetScrnInfoModes (scrn);
+ } else {
+ /* Clear any existing modes from scrn->modes */
+ while (scrn->modes != NULL)
+ xf86DeleteMode(&scrn->modes, scrn->modes);
+ scrn->modes = xf86ModesAdd(scrn->modes,
+ xf86CVTMode(width, height, 60, 0, 0));
+ }
+
+ success = TRUE;
+ bailout:
+ free(crtcs);
+ free(modes);
+ free(enabled);
+ return success;
+}
+
+/*
+ * Check the CRTC we're going to map each output to vs. it's current
+ * CRTC. If they don't match, we have to disable the output and the CRTC
+ * since the driver will have to re-route things.
+ */
+static void
+xf86PrepareOutputs (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int o;
+
+ for (o = 0; o < config->num_output; o++) {
+ xf86OutputPtr output = config->output[o];
+#if RANDR_GET_CRTC_INTERFACE
+ /* Disable outputs that are unused or will be re-routed */
+ if (!output->funcs->get_crtc ||
+ output->crtc != (*output->funcs->get_crtc)(output) ||
+ output->crtc == NULL)
+#endif
+ (*output->funcs->dpms)(output, DPMSModeOff);
+ }
+}
+
+static void
+xf86PrepareCrtcs (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c;
+
+ for (c = 0; c < config->num_crtc; c++) {
+#if RANDR_GET_CRTC_INTERFACE
+ xf86CrtcPtr crtc = config->crtc[c];
+ xf86OutputPtr output = NULL;
+ uint32_t desired_outputs = 0, current_outputs = 0;
+ int o;
+
+ for (o = 0; o < config->num_output; o++) {
+ output = config->output[o];
+ if (output->crtc == crtc)
+ desired_outputs |= (1<<o);
+ /* If we can't tell where it's mapped, force it off */
+ if (!output->funcs->get_crtc) {
+ desired_outputs = 0;
+ break;
+ }
+ if ((*output->funcs->get_crtc)(output) == crtc)
+ current_outputs |= (1<<o);
+ }
+
+ /*
+ * If mappings are different or the CRTC is unused,
+ * we need to disable it
+ */
+ if (desired_outputs != current_outputs ||
+ !desired_outputs)
+ (*crtc->funcs->dpms)(crtc, DPMSModeOff);
+#else
+ (*crtc->funcs->dpms)(crtc, DPMSModeOff);
+#endif
+ }
+}
+
+/*
+ * Using the desired mode information in each crtc, set
+ * modes (used in EnterVT functions, or at server startup)
+ */
+
+Bool
+xf86SetDesiredModes (ScrnInfoPtr scrn)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86CrtcPtr crtc = config->crtc[0];
+ int c;
+
+ /* A driver with this hook will take care of this */
+ if (!crtc->funcs->set_mode_major) {
+ xf86PrepareOutputs(scrn);
+ xf86PrepareCrtcs(scrn);
+ }
+
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86OutputPtr output = NULL;
+ int o;
+ RRTransformPtr transform;
+
+ crtc = config->crtc[c];
+
+ /* Skip disabled CRTCs */
+ if (!crtc->enabled)
+ continue;
+
+ if (xf86CompatOutput(scrn) && xf86CompatCrtc(scrn) == crtc)
+ output = xf86CompatOutput(scrn);
+ else
+ {
+ for (o = 0; o < config->num_output; o++)
+ if (config->output[o]->crtc == crtc)
+ {
+ output = config->output[o];
+ break;
+ }
+ }
+ /* paranoia */
+ if (!output)
+ continue;
+
+ /* Mark that we'll need to re-set the mode for sure */
+ memset(&crtc->mode, 0, sizeof(crtc->mode));
+ if (!crtc->desiredMode.CrtcHDisplay)
+ {
+ DisplayModePtr mode = xf86OutputFindClosestMode (output, scrn->currentMode);
+
+ if (!mode)
+ return FALSE;
+ crtc->desiredMode = *mode;
+ crtc->desiredRotation = RR_Rotate_0;
+ crtc->desiredTransformPresent = FALSE;
+ crtc->desiredX = 0;
+ crtc->desiredY = 0;
+ }
+
+ if (crtc->desiredTransformPresent)
+ transform = &crtc->desiredTransform;
+ else
+ transform = NULL;
+ if (!xf86CrtcSetModeTransform (crtc, &crtc->desiredMode, crtc->desiredRotation,
+ transform, crtc->desiredX, crtc->desiredY))
+ return FALSE;
+ }
+
+ xf86DisableUnusedFunctions(scrn);
+ return TRUE;
+}
+
+/**
+ * In the current world order, there are lists of modes per output, which may
+ * or may not include the mode that was asked to be set by XFree86's mode
+ * selection. Find the closest one, in the following preference order:
+ *
+ * - Equality
+ * - Closer in size to the requested mode, but no larger
+ * - Closer in refresh rate to the requested mode.
+ */
+
+DisplayModePtr
+xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired)
+{
+ DisplayModePtr best = NULL, scan = NULL;
+
+ for (scan = output->probed_modes; scan != NULL; scan = scan->next)
+ {
+ /* If there's an exact match, we're done. */
+ if (xf86ModesEqual(scan, desired)) {
+ best = desired;
+ break;
+ }
+
+ /* Reject if it's larger than the desired mode. */
+ if (scan->HDisplay > desired->HDisplay ||
+ scan->VDisplay > desired->VDisplay)
+ {
+ continue;
+ }
+
+ /*
+ * If we haven't picked a best mode yet, use the first
+ * one in the size range
+ */
+ if (best == NULL)
+ {
+ best = scan;
+ continue;
+ }
+
+ /* Find if it's closer to the right size than the current best
+ * option.
+ */
+ if ((scan->HDisplay > best->HDisplay &&
+ scan->VDisplay >= best->VDisplay) ||
+ (scan->HDisplay >= best->HDisplay &&
+ scan->VDisplay > best->VDisplay))
+ {
+ best = scan;
+ continue;
+ }
+
+ /* Find if it's still closer to the right refresh than the current
+ * best resolution.
+ */
+ if (scan->HDisplay == best->HDisplay &&
+ scan->VDisplay == best->VDisplay &&
+ (fabs(scan->VRefresh - desired->VRefresh) <
+ fabs(best->VRefresh - desired->VRefresh))) {
+ best = scan;
+ }
+ }
+ return best;
+}
+
+/**
+ * When setting a mode through XFree86-VidModeExtension or XFree86-DGA,
+ * take the specified mode and apply it to the crtc connected to the compat
+ * output. Then, find similar modes for the other outputs, as with the
+ * InitialConfiguration code above. The goal is to clone the desired
+ * mode across all outputs that are currently active.
+ */
+
+Bool
+xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ Bool ok = TRUE;
+ xf86OutputPtr compat_output;
+ DisplayModePtr compat_mode = NULL;
+ int c;
+
+ /*
+ * Let the compat output drive the final mode selection
+ */
+ compat_output = xf86CompatOutput(pScrn);
+ if (compat_output)
+ compat_mode = xf86OutputFindClosestMode (compat_output, desired);
+ if (compat_mode)
+ desired = compat_mode;
+
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+ DisplayModePtr crtc_mode = NULL;
+ int o;
+
+ if (!crtc->enabled)
+ continue;
+
+ for (o = 0; o < config->num_output; o++)
+ {
+ xf86OutputPtr output = config->output[o];
+ DisplayModePtr output_mode;
+
+ /* skip outputs not on this crtc */
+ if (output->crtc != crtc)
+ continue;
+
+ if (crtc_mode)
+ {
+ output_mode = xf86OutputFindClosestMode (output, crtc_mode);
+ if (output_mode != crtc_mode)
+ output->crtc = NULL;
+ }
+ else
+ crtc_mode = xf86OutputFindClosestMode (output, desired);
+ }
+ if (!crtc_mode)
+ {
+ crtc->enabled = FALSE;
+ continue;
+ }
+ if (!xf86CrtcSetModeTransform (crtc, crtc_mode, rotation, NULL, 0, 0))
+ ok = FALSE;
+ else
+ {
+ crtc->desiredMode = *crtc_mode;
+ crtc->desiredRotation = rotation;
+ crtc->desiredTransformPresent = FALSE;
+ crtc->desiredX = 0;
+ crtc->desiredY = 0;
+ }
+ }
+ xf86DisableUnusedFunctions(pScrn);
+#ifdef RANDR_12_INTERFACE
+ xf86RandR12TellChanged (pScrn->pScreen);
+#endif
+ return ok;
+}
+
+
+/**
+ * Set the DPMS power mode of all outputs and CRTCs.
+ *
+ * If the new mode is off, it will turn off outputs and then CRTCs.
+ * Otherwise, it will affect CRTCs before outputs.
+ */
+void
+xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags)
+{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int i;
+
+ if (!scrn->vtSema)
+ return;
+
+ if (mode == DPMSModeOff) {
+ for (i = 0; i < config->num_output; i++) {
+ xf86OutputPtr output = config->output[i];
+ if (output->crtc != NULL)
+ (*output->funcs->dpms) (output, mode);
+ }
+ }
+
+ for (i = 0; i < config->num_crtc; i++) {
+ xf86CrtcPtr crtc = config->crtc[i];
+ if (crtc->enabled)
+ (*crtc->funcs->dpms) (crtc, mode);
+ }
+
+ if (mode != DPMSModeOff) {
+ for (i = 0; i < config->num_output; i++) {
+ xf86OutputPtr output = config->output[i];
+ if (output->crtc != NULL)
+ (*output->funcs->dpms) (output, mode);
+ }
+ }
+}
+
+/**
+ * Implement the screensaver by just calling down into the driver DPMS hooks.
+ *
+ * Even for monitors with no DPMS support, by the definition of our DPMS hooks,
+ * the outputs will still get disabled (blanked).
+ */
+Bool
+xf86SaveScreen(ScreenPtr pScreen, int mode)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if (xf86IsUnblank(mode))
+ xf86DPMSSet(pScrn, DPMSModeOn, 0);
+ else
+ xf86DPMSSet(pScrn, DPMSModeOff, 0);
+
+ return TRUE;
+}
+
+/**
+ * Disable all inactive crtcs and outputs
+ */
+void
+xf86DisableUnusedFunctions(ScrnInfoPtr pScrn)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int o, c;
+
+ for (o = 0; o < xf86_config->num_output; o++)
+ {
+ xf86OutputPtr output = xf86_config->output[o];
+ if (!output->crtc)
+ (*output->funcs->dpms)(output, DPMSModeOff);
+ }
+
+ for (c = 0; c < xf86_config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+ if (!crtc->enabled)
+ {
+ crtc->funcs->dpms(crtc, DPMSModeOff);
+ memset(&crtc->mode, 0, sizeof(crtc->mode));
+ xf86RotateDestroy(crtc);
+ crtc->active = FALSE;
+ }
+ }
+ if (pScrn->pScreen)
+ xf86_crtc_notify(pScrn->pScreen);
+ if (pScrn->ModeSet)
+ pScrn->ModeSet(pScrn);
+}
+
+#ifdef RANDR_12_INTERFACE
+
+#define EDID_ATOM_NAME "EDID"
+
+/**
+ * Set the RandR EDID property
+ */
+static void
+xf86OutputSetEDIDProperty (xf86OutputPtr output, void *data, int data_len)
+{
+ Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME) - 1, TRUE);
+
+ /* This may get called before the RandR resources have been created */
+ if (output->randr_output == NULL)
+ return;
+
+ if (data_len != 0) {
+ RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8,
+ PropModeReplace, data_len, data, FALSE, TRUE);
+ } else {
+ RRDeleteOutputProperty(output->randr_output, edid_atom);
+ }
+}
+
+#endif
+
+/* Pull out a phyiscal size from a detailed timing if available. */
+struct det_phySize_parameter {
+ xf86OutputPtr output;
+ ddc_quirk_t quirks;
+ Bool ret;
+};
+
+static void handle_detailed_physical_size(struct detailed_monitor_section
+ *det_mon, void *data)
+{
+ struct det_phySize_parameter *p;
+ p = (struct det_phySize_parameter *)data;
+
+ if (p->ret == TRUE )
+ return ;
+
+ xf86DetTimingApplyQuirks(det_mon, p->quirks,
+ p->output->MonInfo->features.hsize,
+ p->output->MonInfo->features.vsize);
+ if (det_mon->type == DT &&
+ det_mon->section.d_timings.h_size != 0 &&
+ det_mon->section.d_timings.v_size != 0) {
+
+ p->output->mm_width = det_mon->section.d_timings.h_size;
+ p->output->mm_height = det_mon->section.d_timings.v_size;
+ p->ret = TRUE;
+ }
+}
+
+/**
+ * Set the EDID information for the specified output
+ */
+void
+xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon)
+{
+ ScrnInfoPtr scrn = output->scrn;
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ Bool debug_modes = config->debug_modes || xf86Initialising;
+#ifdef RANDR_12_INTERFACE
+ int size;
+#endif
+
+ free(output->MonInfo);
+
+ output->MonInfo = edid_mon;
+ output->mm_width = 0;
+ output->mm_height = 0;
+
+ if (debug_modes) {
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n",
+ output->name);
+ xf86PrintEDID(edid_mon);
+ }
+
+ /* Set the DDC properties for the 'compat' output */
+ if (output == xf86CompatOutput(scrn))
+ xf86SetDDCproperties(scrn, edid_mon);
+
+#ifdef RANDR_12_INTERFACE
+ /* Set the RandR output properties */
+ size = 0;
+ if (edid_mon)
+ {
+ if (edid_mon->ver.version == 1) {
+ size = 128;
+ if (edid_mon->flags & EDID_COMPLETE_RAWDATA)
+ size += edid_mon->no_sections * 128;
+ } else if (edid_mon->ver.version == 2)
+ size = 256;
+ }
+ xf86OutputSetEDIDProperty (output, edid_mon ? edid_mon->rawData : NULL, size);
+#endif
+
+ if (edid_mon) {
+
+ struct det_phySize_parameter p;
+ p.output = output;
+ p.quirks = xf86DDCDetectQuirks(scrn->scrnIndex,edid_mon, FALSE);
+ p.ret = FALSE;
+ xf86ForEachDetailedBlock(edid_mon,
+ handle_detailed_physical_size, &p);
+
+ /* if no mm size is available from a detailed timing, check the max size field */
+ if ((!output->mm_width || !output->mm_height) &&
+ (edid_mon->features.hsize && edid_mon->features.vsize))
+ {
+ output->mm_width = edid_mon->features.hsize * 10;
+ output->mm_height = edid_mon->features.vsize * 10;
+ }
+ }
+}
+
+/**
+ * Return the list of modes supported by the EDID information
+ * stored in 'output'
+ */
+DisplayModePtr
+xf86OutputGetEDIDModes (xf86OutputPtr output)
+{
+ ScrnInfoPtr scrn = output->scrn;
+ xf86MonPtr edid_mon = output->MonInfo;
+
+ if (!edid_mon)
+ return NULL;
+ return xf86DDCGetModes(scrn->scrnIndex, edid_mon);
+}
+
+/* maybe we should care about DDC1? meh. */
+xf86MonPtr
+xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus)
+{
+ ScrnInfoPtr scrn = output->scrn;
+ xf86MonPtr mon;
+
+ mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE);
+ if (mon)
+ xf86DDCApplyQuirks(scrn->scrnIndex, mon);
+
+ return mon;
+}
+
+static char *_xf86ConnectorNames[] = {
+ "None", "VGA", "DVI-I", "DVI-D",
+ "DVI-A", "Composite", "S-Video",
+ "Component", "LFP", "Proprietary",
+ "HDMI", "DisplayPort",
+ };
+char *
+xf86ConnectorGetName(xf86ConnectorType connector)
+{
+ return _xf86ConnectorNames[connector];
+}
+
+static void
+x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
+{
+ dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
+ dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2;
+ dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1;
+ dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2;
+
+ if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2)
+ dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0;
+}
+
+static void
+x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box)
+{
+ if (crtc->enabled) {
+ crtc_box->x1 = crtc->x;
+ crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation);
+ crtc_box->y1 = crtc->y;
+ crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation);
+ } else
+ crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
+}
+
+static int
+xf86_crtc_box_area(BoxPtr box)
+{
+ return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
+}
+
+/*
+ * Return the crtc covering 'box'. If two crtcs cover a portion of
+ * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
+ * with greater coverage
+ */
+
+static xf86CrtcPtr
+xf86_covering_crtc(ScrnInfoPtr pScrn,
+ BoxPtr box,
+ xf86CrtcPtr desired,
+ BoxPtr crtc_box_ret)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ xf86CrtcPtr crtc, best_crtc;
+ int coverage, best_coverage;
+ int c;
+ BoxRec crtc_box, cover_box;
+
+ best_crtc = NULL;
+ best_coverage = 0;
+ crtc_box_ret->x1 = 0;
+ crtc_box_ret->x2 = 0;
+ crtc_box_ret->y1 = 0;
+ crtc_box_ret->y2 = 0;
+ for (c = 0; c < xf86_config->num_crtc; c++) {
+ crtc = xf86_config->crtc[c];
+ x86_crtc_box(crtc, &crtc_box);
+ x86_crtc_box_intersect(&cover_box, &crtc_box, box);
+ coverage = xf86_crtc_box_area(&cover_box);
+ if (coverage && crtc == desired) {
+ *crtc_box_ret = crtc_box;
+ return crtc;
+ } else if (coverage > best_coverage) {
+ *crtc_box_ret = crtc_box;
+ best_crtc = crtc;
+ best_coverage = coverage;
+ }
+ }
+ return best_crtc;
+}
+
+/*
+ * For overlay video, compute the relevant CRTC and
+ * clip video to that.
+ *
+ * returning FALSE means there was a memory failure of some kind,
+ * not that the video shouldn't be displayed
+ */
+
+Bool
+xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
+ xf86CrtcPtr *crtc_ret,
+ xf86CrtcPtr desired_crtc,
+ BoxPtr dst,
+ INT32 *xa,
+ INT32 *xb,
+ INT32 *ya,
+ INT32 *yb,
+ RegionPtr reg,
+ INT32 width,
+ INT32 height)
+{
+ Bool ret;
+ RegionRec crtc_region_local;
+ RegionPtr crtc_region = reg;
+
+ if (crtc_ret) {
+ BoxRec crtc_box;
+ xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst,
+ desired_crtc,
+ &crtc_box);
+
+ if (crtc) {
+ RegionInit(&crtc_region_local, &crtc_box, 1);
+ crtc_region = &crtc_region_local;
+ RegionIntersect(crtc_region, crtc_region, reg);
+ }
+ *crtc_ret = crtc;
+ }
+
+ ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb,
+ crtc_region, width, height);
+
+ if (crtc_region != reg)
+ RegionUninit(&crtc_region_local);
+
+ return ret;
+}
+
+xf86_crtc_notify_proc_ptr
+xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new)
+{
+ if (xf86CrtcConfigPrivateIndex != -1)
+ {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86_crtc_notify_proc_ptr old;
+
+ old = config->xf86_crtc_notify;
+ config->xf86_crtc_notify = new;
+ return old;
+ }
+ return NULL;
+}
+
+void
+xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old)
+{
+ if (xf86CrtcConfigPrivateIndex != -1)
+ {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ config->xf86_crtc_notify = old;
+ }
+}
+
+void
+xf86_crtc_notify(ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ if (config->xf86_crtc_notify)
+ config->xf86_crtc_notify(screen);
+}
+
+Bool
+xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
+{
+ if (xf86CrtcConfigPrivateIndex != -1) {
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ xf86CrtcPtr crtc;
+
+ /* for multiple drivers loaded we need this */
+ if (!xf86_config)
+ return FALSE;
+ if (xf86_config->num_crtc == 0)
+ return FALSE;
+ crtc = xf86_config->crtc[0];
+
+ return crtc->funcs->gamma_set != NULL;
+ }
+
+ return FALSE;
+}
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.h b/xorg-server/hw/xfree86/modes/xf86Crtc.h
index 68a968cc2..ffb2efff4 100644
--- a/xorg-server/hw/xfree86/modes/xf86Crtc.h
+++ b/xorg-server/hw/xfree86/modes/xf86Crtc.h
@@ -1,5 +1,6 @@
/*
* Copyright © 2006 Keith Packard
+ * Copyright © 2011 Aaron Plattner
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -223,7 +224,7 @@ typedef struct _xf86CrtcFuncs {
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
-#define XF86_CRTC_VERSION 3
+#define XF86_CRTC_VERSION 4
struct _xf86Crtc {
/**
@@ -361,6 +362,19 @@ struct _xf86Crtc {
* Clear the shadow
*/
Bool shadowClear;
+
+ /**
+ * Indicates that the driver is handling the transform, so the shadow
+ * surface should be disabled. The driver writes this field before calling
+ * xf86CrtcRotate to indicate that it is handling the transform (including
+ * rotation and reflection).
+ *
+ * Setting this flag also causes the server to stop adjusting the cursor
+ * image and position.
+ *
+ * Added in ABI version 4
+ */
+ Bool driverIsPerformingTransform;
};
typedef struct _xf86OutputFuncs {
@@ -934,6 +948,14 @@ xf86_hide_cursors (ScrnInfoPtr scrn);
extern _X_EXPORT void
xf86_cursors_fini (ScreenPtr screen);
+/**
+ * Transform the cursor's coordinates based on the crtc transform. Normally
+ * this is done by the server, but if crtc->driverIsPerformingTransform is TRUE,
+ * then the server does not transform the cursor position automatically.
+ */
+extern _X_EXPORT void
+xf86CrtcTransformCursorPos (xf86CrtcPtr crtc, int *x, int *y);
+
/*
* For overlay video, compute the relevant CRTC and
* clip video to that.
diff --git a/xorg-server/hw/xfree86/modes/xf86Cursors.c b/xorg-server/hw/xfree86/modes/xf86Cursors.c
index 23c48eb9e..4a03428ea 100644
--- a/xorg-server/hw/xfree86/modes/xf86Cursors.c
+++ b/xorg-server/hw/xfree86/modes/xf86Cursors.c
@@ -1,6 +1,6 @@
/*
* Copyright © 2007 Keith Packard
- * Copyright © 2010 Aaron Plattner
+ * Copyright © 2010-2011 Aaron Plattner
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -47,6 +47,18 @@
#include "inputstr.h"
/*
+ * Returns the rotation being performed by the server. If the driver indicates
+ * that it's handling the screen transform, then this returns RR_Rotate_0.
+ */
+static Rotation
+xf86_crtc_cursor_rotation (xf86CrtcPtr crtc)
+{
+ if (crtc->driverIsPerformingTransform)
+ return RR_Rotate_0;
+ return crtc->rotation;
+}
+
+/*
* Given a screen coordinate, rotate back to a cursor source coordinate
*/
static void
@@ -214,6 +226,7 @@ xf86_crtc_convert_cursor_to_argb (xf86CrtcPtr crtc, unsigned char *src)
int xin, yin;
int flags = cursor_info->Flags;
CARD32 bits;
+ const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
#ifdef ARGB_CURSOR
crtc->cursor_argb = FALSE;
@@ -222,7 +235,7 @@ xf86_crtc_convert_cursor_to_argb (xf86CrtcPtr crtc, unsigned char *src)
for (y = 0; y < cursor_info->MaxHeight; y++)
for (x = 0; x < cursor_info->MaxWidth; x++)
{
- xf86_crtc_rotate_coord (crtc->rotation,
+ xf86_crtc_rotate_coord (rotation,
cursor_info->MaxWidth,
cursor_info->MaxHeight,
x, y, &xin, &yin);
@@ -324,7 +337,36 @@ xf86_show_cursors (ScrnInfoPtr scrn)
xf86_crtc_show_cursor (crtc);
}
}
-
+
+void xf86CrtcTransformCursorPos (xf86CrtcPtr crtc, int *x, int *y)
+{
+ ScrnInfoPtr scrn = crtc->scrn;
+ ScreenPtr screen = scrn->pScreen;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+ xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
+ xf86CursorScreenPtr ScreenPriv =
+ (xf86CursorScreenPtr)dixLookupPrivate(&screen->devPrivates,
+ xf86CursorScreenKey);
+ struct pict_f_vector v;
+ int dx, dy;
+
+ v.v[0] = (*x + ScreenPriv->HotX) + 0.5;
+ v.v[1] = (*y + ScreenPriv->HotY) + 0.5;
+ v.v[2] = 1;
+ pixman_f_transform_point (&crtc->f_framebuffer_to_crtc, &v);
+ /* cursor will have 0.5 added to it already so floor is sufficent */
+ *x = floor (v.v[0]);
+ *y = floor (v.v[1]);
+ /*
+ * Transform position of cursor upper left corner
+ */
+ xf86_crtc_rotate_coord_back (crtc->rotation, cursor_info->MaxWidth,
+ cursor_info->MaxHeight, ScreenPriv->HotX,
+ ScreenPriv->HotY, &dx, &dy);
+ *x -= dx;
+ *y -= dy;
+}
+
static void
xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
{
@@ -333,36 +375,12 @@ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
DisplayModePtr mode = &crtc->mode;
Bool in_range;
- int dx, dy;
/*
* Transform position of cursor on screen
*/
- if (crtc->transform_in_use)
- {
- ScreenPtr screen = scrn->pScreen;
- xf86CursorScreenPtr ScreenPriv =
- (xf86CursorScreenPtr)dixLookupPrivate(&screen->devPrivates,
- xf86CursorScreenKey);
- struct pict_f_vector v;
-
- v.v[0] = (x + ScreenPriv->HotX) + 0.5;
- v.v[1] = (y + ScreenPriv->HotY) + 0.5;
- v.v[2] = 1;
- pixman_f_transform_point (&crtc->f_framebuffer_to_crtc, &v);
- /* cursor will have 0.5 added to it already so floor is sufficent */
- x = floor (v.v[0]);
- y = floor (v.v[1]);
- /*
- * Transform position of cursor upper left corner
- */
- xf86_crtc_rotate_coord_back (crtc->rotation,
- cursor_info->MaxWidth,
- cursor_info->MaxHeight,
- ScreenPriv->HotX, ScreenPriv->HotY, &dx, &dy);
- x -= dx;
- y -= dy;
- }
+ if (crtc->transform_in_use && !crtc->driverIsPerformingTransform)
+ xf86CrtcTransformCursorPos(crtc, &x, &y);
else
{
x -= crtc->x;
@@ -420,12 +438,13 @@ xf86_crtc_load_cursor_image (xf86CrtcPtr crtc, CARD8 *src)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
CARD8 *cursor_image;
+ const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
#ifdef ARGB_CURSOR
crtc->cursor_argb = FALSE;
#endif
- if (crtc->rotation == RR_Rotate_0)
+ if (rotation == RR_Rotate_0)
cursor_image = src;
else
{
@@ -439,7 +458,7 @@ xf86_crtc_load_cursor_image (xf86CrtcPtr crtc, CARD8 *src)
for (y = 0; y < cursor_info->MaxHeight; y++)
for (x = 0; x < cursor_info->MaxWidth; x++)
{
- xf86_crtc_rotate_coord (crtc->rotation,
+ xf86_crtc_rotate_coord (rotation,
cursor_info->MaxWidth,
cursor_info->MaxHeight,
x, y, &xin, &yin);
@@ -532,12 +551,13 @@ xf86_crtc_load_cursor_argb (xf86CrtcPtr crtc, CursorPtr cursor)
int source_height = cursor->bits->height;
int image_width = cursor_info->MaxWidth;
int image_height = cursor_info->MaxHeight;
-
+ const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
+
for (y = 0; y < image_height; y++)
for (x = 0; x < image_width; x++)
{
- xf86_crtc_rotate_coord (crtc->rotation, image_width, image_height,
- x, y, &xin, &yin);
+ xf86_crtc_rotate_coord (rotation, image_width, image_height, x, y,
+ &xin, &yin);
if (xin < source_width && yin < source_height)
bits = cursor_source[yin * source_width + xin];
else
diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c
index 57c3499ac..ff7000b5a 100644
--- a/xorg-server/hw/xfree86/modes/xf86Rotate.c
+++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c
@@ -1,5 +1,6 @@
/*
* Copyright © 2006 Keith Packard
+ * Copyright © 2011 Aaron Plattner
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -84,7 +85,10 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region)
int n = RegionNumRects(region);
BoxPtr b = RegionRects(region);
XID include_inferiors = IncludeInferiors;
-
+
+ if (crtc->driverIsPerformingTransform)
+ return;
+
src = CreatePicture (None,
&root->drawable,
format,
@@ -194,7 +198,7 @@ xf86RotatePrepare (ScreenPtr pScreen)
if (!xf86_config->rotation_damage_registered)
{
/* Hook damage to screen pixmap */
- DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+ DamageRegister (&pScreen->root->drawable,
xf86_config->rotation_damage);
xf86_config->rotation_damage_registered = TRUE;
EnableLimitedSchedulingLatency();
@@ -290,7 +294,7 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
}
for (c = 0; c < xf86_config->num_crtc; c++)
- if (xf86_config->crtc[c]->transform_in_use)
+ if (xf86_config->crtc[c]->rotatedData)
return;
/*
@@ -301,7 +305,7 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
/* Free damage structure */
if (xf86_config->rotation_damage_registered)
{
- DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+ DamageUnregister (&pScreen->root->drawable,
xf86_config->rotation_damage);
xf86_config->rotation_damage_registered = FALSE;
DisableLimitedSchedulingLatency();
@@ -414,52 +418,73 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
}
else
{
- /*
- * these are the size of the shadow pixmap, which
- * matches the mode, not the pre-rotated copy in the
- * frame buffer
- */
- int width = crtc->mode.HDisplay;
- int height = crtc->mode.VDisplay;
- void *shadowData = crtc->rotatedData;
- PixmapPtr shadow = crtc->rotatedPixmap;
- int old_width = shadow ? shadow->drawable.width : 0;
- int old_height = shadow ? shadow->drawable.height : 0;
-
- /* Allocate memory for rotation */
- if (old_width != width || old_height != height)
- {
- if (shadow || shadowData)
+ if (crtc->driverIsPerformingTransform) {
+ xf86RotateDestroy(crtc);
+ } else {
+ /*
+ * these are the size of the shadow pixmap, which
+ * matches the mode, not the pre-rotated copy in the
+ * frame buffer
+ */
+ int width = crtc->mode.HDisplay;
+ int height = crtc->mode.VDisplay;
+ void *shadowData = crtc->rotatedData;
+ PixmapPtr shadow = crtc->rotatedPixmap;
+ int old_width = shadow ? shadow->drawable.width : 0;
+ int old_height = shadow ? shadow->drawable.height : 0;
+
+ /* Allocate memory for rotation */
+ if (old_width != width || old_height != height)
{
- crtc->funcs->shadow_destroy (crtc, shadow, shadowData);
- crtc->rotatedPixmap = NULL;
- crtc->rotatedData = NULL;
+ if (shadow || shadowData)
+ {
+ crtc->funcs->shadow_destroy (crtc, shadow, shadowData);
+ crtc->rotatedPixmap = NULL;
+ crtc->rotatedData = NULL;
+ }
+ shadowData = crtc->funcs->shadow_allocate (crtc, width, height);
+ if (!shadowData)
+ goto bail1;
+ crtc->rotatedData = shadowData;
+ /* shadow will be damaged in xf86RotatePrepare */
+ }
+ else
+ {
+ /* mark shadowed area as damaged so it will be repainted */
+ damage = TRUE;
}
- shadowData = crtc->funcs->shadow_allocate (crtc, width, height);
- if (!shadowData)
- goto bail1;
- crtc->rotatedData = shadowData;
- /* shadow will be damaged in xf86RotatePrepare */
- }
- else
- {
- /* mark shadowed area as damaged so it will be repainted */
- damage = TRUE;
- }
- if (!xf86_config->rotation_damage)
- {
- /* Create damage structure */
- xf86_config->rotation_damage = DamageCreate (NULL, NULL,
- DamageReportNone,
- TRUE, pScreen, pScreen);
if (!xf86_config->rotation_damage)
- goto bail2;
-
- /* Wrap block handler */
- if (!xf86_config->BlockHandler) {
- xf86_config->BlockHandler = pScreen->BlockHandler;
- pScreen->BlockHandler = xf86RotateBlockHandler;
+ {
+ /* Create damage structure */
+ xf86_config->rotation_damage = DamageCreate (NULL, NULL,
+ DamageReportNone,
+ TRUE, pScreen, pScreen);
+ if (!xf86_config->rotation_damage)
+ goto bail2;
+
+ /* Wrap block handler */
+ if (!xf86_config->BlockHandler) {
+ xf86_config->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = xf86RotateBlockHandler;
+ }
+ }
+
+ if (0)
+ {
+ bail2:
+ if (shadow || shadowData)
+ {
+ crtc->funcs->shadow_destroy (crtc, shadow, shadowData);
+ crtc->rotatedPixmap = NULL;
+ crtc->rotatedData = NULL;
+ }
+ bail1:
+ if (old_width && old_height)
+ crtc->rotatedPixmap =
+ crtc->funcs->shadow_create (crtc, NULL, old_width,
+ old_height);
+ return FALSE;
}
}
#ifdef RANDR_12_INTERFACE
@@ -482,24 +507,6 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
}
}
#endif
-
- if (0)
- {
- bail2:
- if (shadow || shadowData)
- {
- crtc->funcs->shadow_destroy (crtc, shadow, shadowData);
- crtc->rotatedPixmap = NULL;
- crtc->rotatedData = NULL;
- }
- bail1:
- if (old_width && old_height)
- crtc->rotatedPixmap = crtc->funcs->shadow_create (crtc,
- NULL,
- old_width,
- old_height);
- return FALSE;
- }
crtc->transform_in_use = TRUE;
}
crtc->crtc_to_framebuffer = crtc_to_fb;
diff --git a/xorg-server/hw/xfree86/os-support/bsd/alpha_video.c b/xorg-server/hw/xfree86/os-support/bsd/alpha_video.c
index 7b5d2c7a4..15eb2a422 100644
--- a/xorg-server/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/xorg-server/hw/xfree86/os-support/bsd/alpha_video.c
@@ -1,719 +1,719 @@
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#include <sys/param.h>
-#ifndef __NetBSD__
-# include <sys/sysctl.h>
-# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-# include <machine/sysarch.h>
-# endif
-# else
-# include <machine/sysarch.h>
-#endif
-
-#include "xf86Axp.h"
-
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#if defined(__NetBSD__) && !defined(MAP_FILE)
-#define MAP_FLAGS MAP_SHARED
-#else
-#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-axpDevice bsdGetAXP(void);
-
-#ifndef __NetBSD__
-extern unsigned long dense_base(void);
-
-static int axpSystem = -1;
-static unsigned long hae_thresh;
-static unsigned long hae_mask;
-static unsigned long bus_base;
-static unsigned long sparse_size;
-
-static unsigned long
-memory_base(void)
-{
- static unsigned long base = 0;
-
- if (base == 0) {
- size_t len = sizeof(base);
- int error;
-#ifdef __OpenBSD__
- int mib[3];
-
- mib[0] = CTL_MACHDEP;
- mib[1] = CPU_CHIPSET;
- mib[2] = CPU_CHIPSET_MEM;
-
- if ((error = sysctl(mib, 3, &base, &len, NULL, 0)) < 0)
-#else
- if ((error = sysctlbyname("hw.chipset.memory", &base, &len,
- 0, 0)) < 0)
-#endif
- FatalError("xf86MapVidMem: can't find memory\n");
- }
-
- return base;
-}
-
-static int
-has_bwx(void)
-{
- static int bwx = 0;
- size_t len = sizeof(bwx);
- int error;
-#ifdef __OpenBSD__
- int mib[3];
-
- mib[0] = CTL_MACHDEP;
- mib[1] = CPU_CHIPSET;
- mib[2] = CPU_CHIPSET_BWX;
-
- if ((error = sysctl(mib, 3, &bwx, &len, NULL, 0)) < 0)
- return FALSE;
- else
- return bwx;
-#else
- if ((error = sysctlbyname("hw.chipset.bwx", &bwx, &len, 0, 0)) < 0)
- return FALSE;
- else
- return bwx;
-#endif
-}
-#else /* __NetBSD__ */
-static unsigned long hae_thresh = (1UL << 24);
-static unsigned long hae_mask = 0xf8000000UL; /* XXX - should use xf86AXP.c */
-static struct alpha_bus_window *abw;
-static int abw_count = -1;
-
-static void
-init_abw(void)
-{
- if (abw_count < 0) {
- abw_count = alpha_bus_getwindows(ALPHA_BUS_TYPE_PCI_MEM, &abw);
- if (abw_count <= 0)
- FatalError("init_abw: alpha_bus_getwindows failed\n");
- }
-}
-
-static int
-has_bwx(void)
-{
- if (abw_count < 0)
- init_abw();
-
- xf86Msg(X_INFO, "has_bwx = %d\n",
- abw[0].abw_abst.abst_flags & ABST_BWX ? 1 : 0); /* XXXX */
- return abw[0].abw_abst.abst_flags & ABST_BWX;
-}
-
-static unsigned long
-dense_base(void)
-{
- if (abw_count < 0)
- init_abw();
-
- /* XXX check abst_flags for ABST_DENSE just to be safe? */
- xf86Msg(X_INFO, "dense base = %#lx\n",
- abw[0].abw_abst.abst_sys_start); /* XXXX */
- return abw[0].abw_abst.abst_sys_start;
-}
-
-static unsigned long
-memory_base(void)
-{
- if (abw_count < 0)
- init_abw();
-
- if (abw_count > 1) {
- xf86Msg(X_INFO, "memory base = %#lx\n",
- abw[1].abw_abst.abst_sys_start); /* XXXX */
- return abw[1].abw_abst.abst_sys_start;
- } else if (abw_count == 1) {
- /* assume memory_base == dense_base */
- xf86Msg(X_INFO, "memory base = %#lx\n",
- abw[0].abw_abst.abst_sys_start); /* XXXX */
- return abw[0].abw_abst.abst_sys_start;
- } else {
- xf86Msg(X_INFO, "no memory base\n"); /* XXXX */
- return 0;
- }
-}
-#endif /* __NetBSD__ */
-
-#define BUS_BASE dense_base()
-#define BUS_BASE_BWX memory_base()
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-#ifdef __OpenBSD__
-#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
- "\tin /etc/sysctl.conf and reboot your machine\n" \
- "\trefer to xf86(4) for details"
-#endif
-
-static Bool useDevMem = FALSE;
-static int devMemFd = -1;
-
-#ifdef HAS_APERTURE_DRV
-#define DEV_APERTURE "/dev/xf86"
-#endif
-#define DEV_MEM "/dev/mem"
-
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-static pointer mapVidMemSparse(int, unsigned long, unsigned long, int);
-static void unmapVidMemSparse(int, pointer, unsigned long);
-
-/*
- * Check if /dev/mem can be mmap'd. If it can't print a warning when
- * "warn" is TRUE.
- */
-static void
-checkDevMem(Bool warn)
-{
- static Bool devMemChecked = FALSE;
- int fd;
- pointer base;
-
- if (devMemChecked)
- return;
- devMemChecked = TRUE;
-
-#ifdef HAS_APERTURE_DRV
- /* Try the aperture driver first */
- if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
-
- if (base != MAP_FAILED) {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n",
- DEV_APERTURE);
- return;
- } else {
- if (warn) {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_APERTURE, strerror(errno));
- }
- }
- }
-#endif
- if ((fd = open(DEV_MEM, O_RDWR)) >= 0) {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
-
- if (base != MAP_FAILED) {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- return;
- } else {
- if (warn) {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- }
- }
- if (warn) {
-#ifndef HAS_APERTURE_DRV
- xf86Msg(X_WARNING, "checkDevMem: failed to open/mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
-#else
-#ifndef __OpenBSD__
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno));
-#else /* __OpenBSD__ */
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n%s", DEV_APERTURE, DEV_MEM, strerror(errno),
- SYSCTL_MSG);
-#endif /* __OpenBSD__ */
-#endif
- xf86ErrorF("\tlinear framebuffer access unavailable\n");
- }
- useDevMem = FALSE;
- return;
-}
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- checkDevMem(TRUE);
- pVidMem->linearSupported = useDevMem;
-
- if (has_bwx()) {
- xf86Msg(X_PROBED,"Machine type has 8/16 bit access\n");
- pVidMem->mapMem = mapVidMem;
- pVidMem->unmapMem = unmapVidMem;
- } else {
- xf86Msg(X_PROBED,"Machine needs sparse mapping\n");
- pVidMem->mapMem = mapVidMemSparse;
- pVidMem->unmapMem = unmapVidMemSparse;
-#ifndef __NetBSD__
- if (axpSystem == -1)
- axpSystem = bsdGetAXP();
- hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
- hae_mask = xf86AXPParams[axpSystem].hae_mask;
- sparse_size = xf86AXPParams[axpSystem].size;
-#endif /* __NetBSD__ */
- }
- pVidMem->initialised = TRUE;
-}
-
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
-
- checkDevMem(FALSE);
- Base = Base & ((1L<<32) - 1);
-
- if (useDevMem)
- {
- if (devMemFd < 0)
- {
- FatalError("xf86MapVidMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- base = mmap((caddr_t)0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
- if (base == MAP_FAILED)
- {
- FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)\n",
- "xf86MapVidMem", DEV_MEM, Size, Base,
- strerror(errno));
- }
- return base;
- }
-
- /* else, mmap /dev/vga */
- if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
- {
- FatalError("%s: Address 0x%lx outside allowable range\n",
- "xf86MapVidMem", Base);
- }
- base = mmap(0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
- (unsigned long)Base + BUS_BASE);
- if (base == MAP_FAILED)
- {
- FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
- strerror(errno));
- }
- return base;
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap((caddr_t)Base, Size);
-}
-
-/*
- * Read BIOS via mmap()ing DEV_MEM
- */
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- unsigned char *ptr;
- int psize;
- int mlen;
-
- checkDevMem(TRUE);
- if (devMemFd == -1) {
- return -1;
- }
-
- psize = getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
- ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
- MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE);
- if ((long)ptr == -1)
- {
- xf86Msg(X_WARNING,
- "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n",
- DEV_MEM, Len, Base, Offset, strerror(errno));
- return -1;
- }
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
- Base, ptr[0] | (ptr[1] << 8));
-#endif
- (void)memcpy(Buf, (void *)(ptr + Offset), Len);
- (void)munmap((caddr_t)ptr, mlen);
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
- "-> %02x %02x %02x %02x...\n",
- Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
-#endif
- return Len;
-}
-
-
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
-
-extern int ioperm(unsigned long from, unsigned long num, int on);
-
-Bool
-xf86EnableIO()
-{
- if (!ioperm(0, 65536, TRUE))
- return TRUE;
- return FALSE;
-}
-
-void
-xf86DisableIO()
-{
- return;
-}
-
-#endif /* __FreeBSD_kernel__ || __OpenBSD__ */
-
-#ifdef USE_ALPHA_PIO
-
-Bool
-xf86EnableIO()
-{
- alpha_pci_io_enable(1);
- return TRUE;
-}
-
-void
-xf86DisableIO()
-{
- alpha_pci_io_enable(0);
-}
-
-#endif /* USE_ALPHA_PIO */
-
-#define vuip volatile unsigned int *
-
-static unsigned long msb_set = 0;
-static pointer memSBase = 0;
-static pointer memBase = 0;
-
-extern int readDense8(pointer Base, register unsigned long Offset);
-extern int readDense16(pointer Base, register unsigned long Offset);
-extern int readDense32(pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense8(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense16(int Value, pointer Base, register unsigned long Offset);
-extern void
-writeDense32(int Value, pointer Base, register unsigned long Offset);
-
-static int readSparse8(pointer Base, register unsigned long Offset);
-static int readSparse16(pointer Base, register unsigned long Offset);
-static int readSparse32(pointer Base, register unsigned long Offset);
-static void
-writeSparseNB8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseNB16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparseNB32(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse8(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse16(int Value, pointer Base, register unsigned long Offset);
-static void
-writeSparse32(int Value, pointer Base, register unsigned long Offset);
-
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-extern int sysarch(int, void *);
-#endif
-
-struct parms {
- u_int64_t hae;
-};
-
-#ifndef __NetBSD__
-static int
-sethae(u_int64_t hae)
-{
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-#ifndef ALPHA_SETHAE
-#define ALPHA_SETHAE 0
-#endif
- struct parms p;
- p.hae = hae;
- return (sysarch(ALPHA_SETHAE, (char *)&p));
-#endif
-#ifdef __OpenBSD__
- return -1;
-#endif
-}
-#endif /* __NetBSD__ */
-
-static pointer
-mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- static Bool was_here = FALSE;
-
- if (!was_here) {
- was_here = TRUE;
-
- checkDevMem(FALSE);
-
- xf86WriteMmio8 = writeSparse8;
- xf86WriteMmio16 = writeSparse16;
- xf86WriteMmio32 = writeSparse32;
- xf86WriteMmioNB8 = writeSparseNB8;
- xf86WriteMmioNB16 = writeSparseNB16;
- xf86WriteMmioNB32 = writeSparseNB32;
- xf86ReadMmio8 = readSparse8;
- xf86ReadMmio16 = readSparse16;
- xf86ReadMmio32 = readSparse32;
-
- memBase = mmap((caddr_t)0, 0x100000000,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, devMemFd,
- (off_t) BUS_BASE);
- memSBase = mmap((caddr_t)0, 0x100000000,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, devMemFd,
- (off_t) BUS_BASE_BWX);
-
- if (memSBase == MAP_FAILED || memBase == MAP_FAILED) {
- FatalError("xf86MapVidMem: Could not mmap framebuffer (%s)\n",
- strerror(errno));
- }
- }
- return (pointer)((unsigned long)memBase + Base);
-}
-
-static void
-unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size)
-{
-}
-
-static int
-readSparse8(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
- register unsigned long msb;
- mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- shift = (Offset & 0x3) << 3;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
- sethae(msb);
-#endif
- msb_set = msb;
- }
- }
- result = *(vuip) ((unsigned long)memSBase + (Offset << 5));
- result >>= shift;
- return 0xffUL & result;
-}
-
-static int
-readSparse16(pointer Base, register unsigned long Offset)
-{
- register unsigned long result, shift;
- register unsigned long msb;
-
- mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- shift = (Offset & 0x2) << 3;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
- sethae(msb);
-#endif
- msb_set = msb;
- }
- }
- result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2)));
- result >>= shift;
- return 0xffffUL & result;
-}
-
-static int
-readSparse32(pointer Base, register unsigned long Offset)
-{
- mem_barrier();
- return *(vuip)((unsigned long)Base+(Offset));
-}
-
-static void
-writeSparse8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int b = Value & 0xffU;
-
- write_mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
- sethae(msb);
-#endif
- msb_set = msb;
- }
- }
- *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
-}
-
-static void
-writeSparse16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int w = Value & 0xffffU;
-
- write_mem_barrier();
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
- sethae(msb);
-#endif
- msb_set = msb;
- }
- }
- *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
- w * 0x00010001;
-
-}
-
-static void
-writeSparse32(int Value, pointer Base, register unsigned long Offset)
-{
- write_mem_barrier();
- *(vuip)((unsigned long)Base + (Offset)) = Value;
- return;
-}
-
-static void
-writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int b = Value & 0xffU;
-
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask;
- Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
- sethae(msb);
-#endif
- msb_set = msb;
- }
- }
- *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
-}
-
-static void
-writeSparseNB16(int Value, pointer Base, register unsigned long Offset)
-{
- register unsigned long msb;
- register unsigned int w = Value & 0xffffU;
-
- Offset += (unsigned long)Base - (unsigned long)memBase;
- if (Offset >= (hae_thresh)) {
- msb = Offset & hae_mask ;
- Offset -= msb;
- if (msb_set != msb) {
-#ifndef __NetBSD__
- sethae(msb);
-#endif
- msb_set = msb;
- }
- }
- *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
- w * 0x00010001;
-}
-
-static void
-writeSparseNB32(int Value, pointer Base, register unsigned long Offset)
-{
- *(vuip)((unsigned long)Base + (Offset)) = Value;
- return;
-}
-
-void (*xf86WriteMmio8)(int Value, pointer Base, unsigned long Offset)
- = writeDense8;
-void (*xf86WriteMmio16)(int Value, pointer Base, unsigned long Offset)
- = writeDense16;
-void (*xf86WriteMmio32)(int Value, pointer Base, unsigned long Offset)
- = writeDense32;
-void (*xf86WriteMmioNB8)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB8;
-void (*xf86WriteMmioNB16)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB16;
-void (*xf86WriteMmioNB32)(int Value, pointer Base, unsigned long Offset)
- = writeDenseNB32;
-int (*xf86ReadMmio8)(pointer Base, unsigned long Offset)
- = readDense8;
-int (*xf86ReadMmio16)(pointer Base, unsigned long Offset)
- = readDense16;
-int (*xf86ReadMmio32)(pointer Base, unsigned long Offset)
- = readDense32;
-
+/*
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Rich Murphey and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Rich Murphey and
+ * David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
+ * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#include <sys/param.h>
+#ifndef __NetBSD__
+# include <sys/sysctl.h>
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+# include <machine/sysarch.h>
+# endif
+# else
+# include <machine/sysarch.h>
+#endif
+
+#include "xf86Axp.h"
+
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#if defined(__NetBSD__) && !defined(MAP_FILE)
+#define MAP_FLAGS MAP_SHARED
+#else
+#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
+#endif
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+axpDevice bsdGetAXP(void);
+
+#ifndef __NetBSD__
+extern unsigned long dense_base(void);
+
+static int axpSystem = -1;
+static unsigned long hae_thresh;
+static unsigned long hae_mask;
+static unsigned long bus_base;
+static unsigned long sparse_size;
+
+static unsigned long
+memory_base(void)
+{
+ static unsigned long base = 0;
+
+ if (base == 0) {
+ size_t len = sizeof(base);
+ int error;
+#ifdef __OpenBSD__
+ int mib[3];
+
+ mib[0] = CTL_MACHDEP;
+ mib[1] = CPU_CHIPSET;
+ mib[2] = CPU_CHIPSET_MEM;
+
+ if ((error = sysctl(mib, 3, &base, &len, NULL, 0)) < 0)
+#else
+ if ((error = sysctlbyname("hw.chipset.memory", &base, &len,
+ 0, 0)) < 0)
+#endif
+ FatalError("xf86MapVidMem: can't find memory\n");
+ }
+
+ return base;
+}
+
+static int
+has_bwx(void)
+{
+ static int bwx = 0;
+ size_t len = sizeof(bwx);
+ int error;
+#ifdef __OpenBSD__
+ int mib[3];
+
+ mib[0] = CTL_MACHDEP;
+ mib[1] = CPU_CHIPSET;
+ mib[2] = CPU_CHIPSET_BWX;
+
+ if ((error = sysctl(mib, 3, &bwx, &len, NULL, 0)) < 0)
+ return FALSE;
+ else
+ return bwx;
+#else
+ if ((error = sysctlbyname("hw.chipset.bwx", &bwx, &len, 0, 0)) < 0)
+ return FALSE;
+ else
+ return bwx;
+#endif
+}
+#else /* __NetBSD__ */
+static unsigned long hae_thresh = (1UL << 24);
+static unsigned long hae_mask = 0xf8000000UL; /* XXX - should use xf86AXP.c */
+static struct alpha_bus_window *abw;
+static int abw_count = -1;
+
+static void
+init_abw(void)
+{
+ if (abw_count < 0) {
+ abw_count = alpha_bus_getwindows(ALPHA_BUS_TYPE_PCI_MEM, &abw);
+ if (abw_count <= 0)
+ FatalError("init_abw: alpha_bus_getwindows failed\n");
+ }
+}
+
+static int
+has_bwx(void)
+{
+ if (abw_count < 0)
+ init_abw();
+
+ xf86Msg(X_INFO, "has_bwx = %d\n",
+ abw[0].abw_abst.abst_flags & ABST_BWX ? 1 : 0); /* XXXX */
+ return abw[0].abw_abst.abst_flags & ABST_BWX;
+}
+
+static unsigned long
+dense_base(void)
+{
+ if (abw_count < 0)
+ init_abw();
+
+ /* XXX check abst_flags for ABST_DENSE just to be safe? */
+ xf86Msg(X_INFO, "dense base = %#lx\n",
+ abw[0].abw_abst.abst_sys_start); /* XXXX */
+ return abw[0].abw_abst.abst_sys_start;
+}
+
+static unsigned long
+memory_base(void)
+{
+ if (abw_count < 0)
+ init_abw();
+
+ if (abw_count > 1) {
+ xf86Msg(X_INFO, "memory base = %#lx\n",
+ abw[1].abw_abst.abst_sys_start); /* XXXX */
+ return abw[1].abw_abst.abst_sys_start;
+ } else if (abw_count == 1) {
+ /* assume memory_base == dense_base */
+ xf86Msg(X_INFO, "memory base = %#lx\n",
+ abw[0].abw_abst.abst_sys_start); /* XXXX */
+ return abw[0].abw_abst.abst_sys_start;
+ } else {
+ xf86Msg(X_INFO, "no memory base\n"); /* XXXX */
+ return 0;
+ }
+}
+#endif /* __NetBSD__ */
+
+#define BUS_BASE dense_base()
+#define BUS_BASE_BWX memory_base()
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+#ifdef __OpenBSD__
+#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
+ "\tin /etc/sysctl.conf and reboot your machine\n" \
+ "\trefer to xf86(4) for details"
+#endif
+
+static Bool useDevMem = FALSE;
+static int devMemFd = -1;
+
+#ifdef HAS_APERTURE_DRV
+#define DEV_APERTURE "/dev/xf86"
+#endif
+#define DEV_MEM "/dev/mem"
+
+static pointer mapVidMem(int, unsigned long, unsigned long, int);
+static void unmapVidMem(int, pointer, unsigned long);
+static pointer mapVidMemSparse(int, unsigned long, unsigned long, int);
+static void unmapVidMemSparse(int, pointer, unsigned long);
+
+/*
+ * Check if /dev/mem can be mmap'd. If it can't print a warning when
+ * "warn" is TRUE.
+ */
+static void
+checkDevMem(Bool warn)
+{
+ static Bool devMemChecked = FALSE;
+ int fd;
+ pointer base;
+
+ if (devMemChecked)
+ return;
+ devMemChecked = TRUE;
+
+#ifdef HAS_APERTURE_DRV
+ /* Try the aperture driver first */
+ if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
+
+ if (base != MAP_FAILED) {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n",
+ DEV_APERTURE);
+ return;
+ } else {
+ if (warn) {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_APERTURE, strerror(errno));
+ }
+ }
+ }
+#endif
+ if ((fd = open(DEV_MEM, O_RDWR)) >= 0) {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
+
+ if (base != MAP_FAILED) {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ return;
+ } else {
+ if (warn) {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ }
+ }
+ if (warn) {
+#ifndef HAS_APERTURE_DRV
+ xf86Msg(X_WARNING, "checkDevMem: failed to open/mmap %s (%s)\n",
+ DEV_MEM, strerror(errno));
+#else
+#ifndef __OpenBSD__
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
+ "\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno));
+#else /* __OpenBSD__ */
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
+ "\t(%s)\n%s", DEV_APERTURE, DEV_MEM, strerror(errno),
+ SYSCTL_MSG);
+#endif /* __OpenBSD__ */
+#endif
+ xf86ErrorF("\tlinear framebuffer access unavailable\n");
+ }
+ useDevMem = FALSE;
+ return;
+}
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+ checkDevMem(TRUE);
+ pVidMem->linearSupported = useDevMem;
+
+ if (has_bwx()) {
+ xf86Msg(X_PROBED,"Machine type has 8/16 bit access\n");
+ pVidMem->mapMem = mapVidMem;
+ pVidMem->unmapMem = unmapVidMem;
+ } else {
+ xf86Msg(X_PROBED,"Machine needs sparse mapping\n");
+ pVidMem->mapMem = mapVidMemSparse;
+ pVidMem->unmapMem = unmapVidMemSparse;
+#ifndef __NetBSD__
+ if (axpSystem == -1)
+ axpSystem = bsdGetAXP();
+ hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
+ hae_mask = xf86AXPParams[axpSystem].hae_mask;
+ sparse_size = xf86AXPParams[axpSystem].size;
+#endif /* __NetBSD__ */
+ }
+ pVidMem->initialised = TRUE;
+}
+
+static pointer
+mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ pointer base;
+
+ checkDevMem(FALSE);
+ Base = Base & ((1L<<32) - 1);
+
+ if (useDevMem)
+ {
+ if (devMemFd < 0)
+ {
+ FatalError("xf86MapVidMem: failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ base = mmap((caddr_t)0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
+ if (base == MAP_FAILED)
+ {
+ FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)\n",
+ "xf86MapVidMem", DEV_MEM, Size, Base,
+ strerror(errno));
+ }
+ return base;
+ }
+
+ /* else, mmap /dev/vga */
+ if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
+ {
+ FatalError("%s: Address 0x%lx outside allowable range\n",
+ "xf86MapVidMem", Base);
+ }
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_FLAGS, xf86Info.consoleFd,
+ (unsigned long)Base + BUS_BASE);
+ if (base == MAP_FAILED)
+ {
+ FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
+ strerror(errno));
+ }
+ return base;
+}
+
+static void
+unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap((caddr_t)Base, Size);
+}
+
+/*
+ * Read BIOS via mmap()ing DEV_MEM
+ */
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ unsigned char *ptr;
+ int psize;
+ int mlen;
+
+ checkDevMem(TRUE);
+ if (devMemFd == -1) {
+ return -1;
+ }
+
+ psize = getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+ ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
+ MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE);
+ if ((long)ptr == -1)
+ {
+ xf86Msg(X_WARNING,
+ "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n",
+ DEV_MEM, Len, Base, Offset, strerror(errno));
+ return -1;
+ }
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
+ Base, ptr[0] | (ptr[1] << 8));
+#endif
+ (void)memcpy(Buf, (void *)(ptr + Offset), Len);
+ (void)munmap((caddr_t)ptr, mlen);
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
+ "-> %02x %02x %02x %02x...\n",
+ Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
+#endif
+ return Len;
+}
+
+
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+
+extern int ioperm(unsigned long from, unsigned long num, int on);
+
+Bool
+xf86EnableIO()
+{
+ if (!ioperm(0, 65536, TRUE))
+ return TRUE;
+ return FALSE;
+}
+
+void
+xf86DisableIO()
+{
+ return;
+}
+
+#endif /* __FreeBSD_kernel__ || __OpenBSD__ */
+
+#ifdef USE_ALPHA_PIO
+
+Bool
+xf86EnableIO()
+{
+ alpha_pci_io_enable(1);
+ return TRUE;
+}
+
+void
+xf86DisableIO()
+{
+ alpha_pci_io_enable(0);
+}
+
+#endif /* USE_ALPHA_PIO */
+
+#define vuip volatile unsigned int *
+
+static unsigned long msb_set = 0;
+static pointer memSBase = 0;
+static pointer memBase = 0;
+
+extern int readDense8(pointer Base, register unsigned long Offset);
+extern int readDense16(pointer Base, register unsigned long Offset);
+extern int readDense32(pointer Base, register unsigned long Offset);
+extern void
+writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDense8(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDense16(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDense32(int Value, pointer Base, register unsigned long Offset);
+
+static int readSparse8(pointer Base, register unsigned long Offset);
+static int readSparse16(pointer Base, register unsigned long Offset);
+static int readSparse32(pointer Base, register unsigned long Offset);
+static void
+writeSparseNB8(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparseNB16(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparseNB32(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparse8(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparse16(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparse32(int Value, pointer Base, register unsigned long Offset);
+
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+extern int sysarch(int, void *);
+#endif
+
+struct parms {
+ u_int64_t hae;
+};
+
+#ifndef __NetBSD__
+static int
+sethae(u_int64_t hae)
+{
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#ifndef ALPHA_SETHAE
+#define ALPHA_SETHAE 0
+#endif
+ struct parms p;
+ p.hae = hae;
+ return (sysarch(ALPHA_SETHAE, (char *)&p));
+#endif
+#ifdef __OpenBSD__
+ return -1;
+#endif
+}
+#endif /* __NetBSD__ */
+
+static pointer
+mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ static Bool was_here = FALSE;
+
+ if (!was_here) {
+ was_here = TRUE;
+
+ checkDevMem(FALSE);
+
+ xf86WriteMmio8 = writeSparse8;
+ xf86WriteMmio16 = writeSparse16;
+ xf86WriteMmio32 = writeSparse32;
+ xf86WriteMmioNB8 = writeSparseNB8;
+ xf86WriteMmioNB16 = writeSparseNB16;
+ xf86WriteMmioNB32 = writeSparseNB32;
+ xf86ReadMmio8 = readSparse8;
+ xf86ReadMmio16 = readSparse16;
+ xf86ReadMmio32 = readSparse32;
+
+ memBase = mmap((caddr_t)0, 0x100000000,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, devMemFd,
+ (off_t) BUS_BASE);
+ memSBase = mmap((caddr_t)0, 0x100000000,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, devMemFd,
+ (off_t) BUS_BASE_BWX);
+
+ if (memSBase == MAP_FAILED || memBase == MAP_FAILED) {
+ FatalError("xf86MapVidMem: Could not mmap framebuffer (%s)\n",
+ strerror(errno));
+ }
+ }
+ return (pointer)((unsigned long)memBase + Base);
+}
+
+static void
+unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size)
+{
+}
+
+static int
+readSparse8(pointer Base, register unsigned long Offset)
+{
+ register unsigned long result, shift;
+ register unsigned long msb;
+ mem_barrier();
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ shift = (Offset & 0x3) << 3;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+#ifndef __NetBSD__
+ sethae(msb);
+#endif
+ msb_set = msb;
+ }
+ }
+ result = *(vuip) ((unsigned long)memSBase + (Offset << 5));
+ result >>= shift;
+ return 0xffUL & result;
+}
+
+static int
+readSparse16(pointer Base, register unsigned long Offset)
+{
+ register unsigned long result, shift;
+ register unsigned long msb;
+
+ mem_barrier();
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ shift = (Offset & 0x2) << 3;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+#ifndef __NetBSD__
+ sethae(msb);
+#endif
+ msb_set = msb;
+ }
+ }
+ result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2)));
+ result >>= shift;
+ return 0xffffUL & result;
+}
+
+static int
+readSparse32(pointer Base, register unsigned long Offset)
+{
+ mem_barrier();
+ return *(vuip)((unsigned long)Base+(Offset));
+}
+
+static void
+writeSparse8(int Value, pointer Base, register unsigned long Offset)
+{
+ register unsigned long msb;
+ register unsigned int b = Value & 0xffU;
+
+ write_mem_barrier();
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+#ifndef __NetBSD__
+ sethae(msb);
+#endif
+ msb_set = msb;
+ }
+ }
+ *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
+}
+
+static void
+writeSparse16(int Value, pointer Base, register unsigned long Offset)
+{
+ register unsigned long msb;
+ register unsigned int w = Value & 0xffffU;
+
+ write_mem_barrier();
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+#ifndef __NetBSD__
+ sethae(msb);
+#endif
+ msb_set = msb;
+ }
+ }
+ *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
+ w * 0x00010001;
+
+}
+
+static void
+writeSparse32(int Value, pointer Base, register unsigned long Offset)
+{
+ write_mem_barrier();
+ *(vuip)((unsigned long)Base + (Offset)) = Value;
+ return;
+}
+
+static void
+writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
+{
+ register unsigned long msb;
+ register unsigned int b = Value & 0xffU;
+
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+#ifndef __NetBSD__
+ sethae(msb);
+#endif
+ msb_set = msb;
+ }
+ }
+ *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
+}
+
+static void
+writeSparseNB16(int Value, pointer Base, register unsigned long Offset)
+{
+ register unsigned long msb;
+ register unsigned int w = Value & 0xffffU;
+
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask ;
+ Offset -= msb;
+ if (msb_set != msb) {
+#ifndef __NetBSD__
+ sethae(msb);
+#endif
+ msb_set = msb;
+ }
+ }
+ *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
+ w * 0x00010001;
+}
+
+static void
+writeSparseNB32(int Value, pointer Base, register unsigned long Offset)
+{
+ *(vuip)((unsigned long)Base + (Offset)) = Value;
+ return;
+}
+
+void (*xf86WriteMmio8)(int Value, pointer Base, unsigned long Offset)
+ = writeDense8;
+void (*xf86WriteMmio16)(int Value, pointer Base, unsigned long Offset)
+ = writeDense16;
+void (*xf86WriteMmio32)(int Value, pointer Base, unsigned long Offset)
+ = writeDense32;
+void (*xf86WriteMmioNB8)(int Value, pointer Base, unsigned long Offset)
+ = writeDenseNB8;
+void (*xf86WriteMmioNB16)(int Value, pointer Base, unsigned long Offset)
+ = writeDenseNB16;
+void (*xf86WriteMmioNB32)(int Value, pointer Base, unsigned long Offset)
+ = writeDenseNB32;
+int (*xf86ReadMmio8)(pointer Base, unsigned long Offset)
+ = readDense8;
+int (*xf86ReadMmio16)(pointer Base, unsigned long Offset)
+ = readDense16;
+int (*xf86ReadMmio32)(pointer Base, unsigned long Offset)
+ = readDense32;
+
diff --git a/xorg-server/hw/xfree86/os-support/bsd/arm_video.c b/xorg-server/hw/xfree86/os-support/bsd/arm_video.c
index 10cfee764..eb631a7f3 100644
--- a/xorg-server/hw/xfree86/os-support/bsd/arm_video.c
+++ b/xorg-server/hw/xfree86/os-support/bsd/arm_video.c
@@ -1,666 +1,666 @@
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/*
- * The ARM32 code here carries the following copyright:
- *
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- * This software is furnished under license and may be used and copied only in
- * accordance with the following terms and conditions. Subject to these
- * conditions, you may download, copy, install, use, modify and distribute
- * this software in source and/or binary form. No title or ownership is
- * transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce and retain
- * this copyright notice and list of conditions as they appear in the
- * source file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of Digital
- * Equipment Corporation. Neither the "Digital Equipment Corporation"
- * name nor any trademark or logo of Digital Equipment Corporation may be
- * used to endorse or promote products derived from this software without
- * the prior written permission of Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied warranties,
- * including but not limited to, any implied warranties of merchantability,
- * fitness for a particular purpose, or non-infringement are disclaimed.
- * In no event shall DIGITAL be liable for any damages whatsoever, and in
- * particular, DIGITAL shall not be liable for special, indirect,
- * consequential, or incidental damages or damages for lost profits, loss
- * of revenue or loss of use, whether such damages arise in contract,
- * negligence, tort, under statute, in equity, at law or otherwise, even
- * if advised of the possibility of such damage.
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#ifdef __arm32__
-#include "machine/devmap.h"
-struct memAccess
-{
- int ioctl;
- struct map_info memInfo;
- pointer regionVirtBase;
- Bool Checked;
- Bool OK;
-};
-
-static pointer xf86MapInfoMap();
-static void xf86MapInfoUnmap();
-static struct memAccess *checkMapInfo();
-extern int vgaPhysLinearBase;
-
-/* A memAccess structure is needed for each possible region */
-struct memAccess vgaMemInfo = { CONSOLE_GET_MEM_INFO, NULL, NULL,
- FALSE, FALSE };
-struct memAccess linearMemInfo = { CONSOLE_GET_LINEAR_INFO, NULL, NULL,
- FALSE, FALSE };
-struct memAccess ioMemInfo = { CONSOLE_GET_IO_INFO, NULL, NULL,
- FALSE, FALSE };
-#endif /* __arm32__ */
-
-#if defined(__NetBSD__) && !defined(MAP_FILE)
-#define MAP_FLAGS MAP_SHARED
-#else
-#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-
-#define BUS_BASE 0L
-#define BUS_BASE_BWX 0L
-
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static Bool useDevMem = FALSE;
-static int devMemFd = -1;
-
-#define DEV_MEM "/dev/mem"
-
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-
-/*
- * Check if /dev/mem can be mmap'd. If it can't print a warning when
- * "warn" is TRUE.
- */
-static void
-checkDevMem(Bool warn)
-{
- static Bool devMemChecked = FALSE;
- int fd;
- pointer base;
-
- if (devMemChecked)
- return;
- devMemChecked = TRUE;
-
- if ((fd = open(DEV_MEM, O_RDWR)) >= 0)
- {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
-
- if (base != MAP_FAILED)
- {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- return;
- } else {
- /* This should not happen */
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- useDevMem = FALSE;
- return;
- }
- }
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- useDevMem = FALSE;
- return;
-}
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
-
- checkDevMem(TRUE);
- pVidMem->linearSupported = useDevMem;
- pVidMem->mapMem = armMapVidMem;
- pVidMem->unmapVidMem = armUnmapVidMem;
-
- pVidMem->initialised = TRUE;
-}
-
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
-
- checkDevMem(FALSE);
-
- if (useDevMem)
- {
- if (devMemFd < 0)
- {
- FatalError("xf86MapVidMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- base = mmap((caddr_t)0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
- if (base == MAP_FAILED)
- {
- FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
- "xf86MapVidMem", DEV_MEM, Size, Base,
- strerror(errno));
- }
- return base;
- }
-
- /* else, mmap /dev/vga */
- if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
- {
- FatalError("%s: Address 0x%x outside allowable range\n",
- "xf86MapVidMem", Base);
- }
- base = mmap(0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
- (unsigned long)Base - 0xA0000);
- if (base == MAP_FAILED)
- {
- FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
- strerror(errno));
- }
- return base;
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap((caddr_t)Base, Size);
-}
-
-/*
- * Read BIOS via mmap()ing DEV_MEM
- */
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- unsigned char *ptr;
- int psize;
- int mlen;
-
- checkDevMem(TRUE);
- if (devMemFd == -1) {
- return -1;
- }
-
- psize = getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
- ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
- MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE);
- if ((long)ptr == -1)
- {
- xf86Msg(X_WARNING,
- "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
- DEV_MEM, Len, Base, Offset, strerror(errno));
- return -1;
- }
-#ifdef DEBUG
- ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
- Base, ptr[0] | (ptr[1] << 8));
-#endif
- (void)memcpy(Buf, (void *)(ptr + Offset), Len);
- (void)munmap((caddr_t)ptr, mlen);
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
- "-> %02x %02x %02x %02x...\n",
- Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
-#endif
- return Len;
-}
-
-
-/* XXX This needs to be updated for the ND */
-
-/*
-** Find out whether the console driver provides memory mapping information
-** for the specified region and return the map_info pointer. Print a warning if required.
-*/
-static struct memAccess *
-checkMapInfo(Bool warn, int Region)
-{
- struct memAccess *memAccP;
-
- switch (Region)
- {
- case VGA_REGION:
- memAccP = &vgaMemInfo;
- break;
-
- case LINEAR_REGION:
- memAccP = &linearMemInfo;
- break;
-
- case MMIO_REGION:
- memAccP = &ioMemInfo;
- break;
-
- default:
- return NULL;
- break;
- }
-
- if(!memAccP->Checked)
- {
- if(ioctl(xf86Info.screenFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
- {
- if(warn)
- {
- xf86Msg(X_WARNING,
- "checkMapInfo: failed to get map info for region %d\n\t(%s)\n",
- Region, strerror(errno));
- }
- }
- else
- {
- if(memAccP->memInfo.u.map_info_mmap.map_offset
- != MAP_INFO_UNKNOWN)
- memAccP->OK = TRUE;
- }
- memAccP->Checked = TRUE;
- }
- if (memAccP->OK)
- {
- return memAccP;
- }
- else
- {
- return NULL;
- }
-}
-
-static pointer
-xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
-{
- struct map_info *mapInfoP = &(memInfoP->memInfo);
-
- if (mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
- {
- Size = (unsigned long)Base + Size;
- }
- else
- {
- Size = mapInfoP->u.map_info_mmap.map_size;
- }
-
- switch(mapInfoP->method)
- {
- case MAP_MMAP:
- /* Need to remap if size is unknown because we may not have
- mapped the whole region initially */
- if(memInfoP->regionVirtBase == NULL ||
- mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
- {
- if((memInfoP->regionVirtBase =
- mmap((caddr_t)0,
- Size,
- PROT_READ | PROT_WRITE,
- MAP_SHARED,
- xf86Info.screenFd,
- (unsigned long)mapInfoP->u.map_info_mmap.map_offset))
- == (pointer)-1)
- {
- FatalError("xf86MapInfoMap: Failed to map memory at 0x%x\n\t%s\n",
- mapInfoP->u.map_info_mmap.map_offset, strerror(errno));
- }
- if(mapInfoP->u.map_info_mmap.internal_offset > 0)
- memInfoP->regionVirtBase +=
- mapInfoP->u.map_info_mmap.internal_offset;
- }
- break;
-
- default:
- FatalError("xf86MapInfoMap: Unsuported mapping method\n");
- break;
- }
-
- return (pointer)((int)memInfoP->regionVirtBase + (int)Base);
-}
-
-static void
-xf86MapInfoUnmap(struct memAccess *memInfoP, unsigned long Size)
-{
- struct map_info *mapInfoP = &(memInfoP->memInfo);
-
- switch(mapInfoP->method)
- {
- case MAP_MMAP:
- if(memInfoP->regionVirtBase != NULL)
- {
- if(mapInfoP->u.map_info_mmap.map_size != MAP_INFO_UNKNOWN)
- Size = mapInfoP->u.map_info_mmap.map_size;
- munmap((caddr_t)memInfoP->regionVirtBase, Size);
- memInfoP->regionVirtBase = NULL;
- }
- break;
- default:
- FatalError("xf86MapInfoMap: Unsuported mapping method\n");
- break;
- }
-}
-
-static pointer
-armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- struct memAccess *memInfoP;
-
- if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
- {
- /*
- ** xf86 passes in a physical address offset from the start
- ** of physical memory, but xf86MapInfoMap expects an
- ** offset from the start of the specified region - it gets
- ** the physical address of the region from the display driver.
- */
- switch(Region)
- {
- case LINEAR_REGION:
- if (vgaPhysLinearBase)
- {
- Base -= vgaPhysLinearBase;
- }
- break;
- case VGA_REGION:
- Base -= 0xA0000;
- break;
- }
-
- base = xf86MapInfoMap(memInfoP, Base, Size);
- return base;
- }
- return mapVidMem(ScreenNum, Base, Size, flags);
-}
-
-static void
-armUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- struct memAccess *memInfoP;
-
- if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
- {
- xf86MapInfoUnmap(memInfoP, Base, Size);
- }
- unmapVidMem(ScreenNum, Base, Size);
-}
-
-#ifdef USE_DEV_IO
-static int IoFd = -1;
-
-Bool
-xf86EnableIO()
-{
- if (IoFd >= 0)
- return TRUE;
-
- if ((IoFd = open("/dev/io", O_RDWR)) == -1)
- {
- xf86Msg(X_WARNING,"xf86EnableIO: "
- "Failed to open /dev/io for extended I/O\n");
- return FALSE;
- }
- return TRUE;
-}
-
-void
-xf86DisableIO()
-{
- if (IoFd < 0)
- return;
-
- close(IoFd);
- IoFd = -1;
- return;
-}
-
-#endif
-
-#if defined(USE_ARC_MMAP) || defined(__arm32__)
-
-Bool
-xf86EnableIO()
-{
- int fd;
- pointer base;
-
- if (ExtendedEnabled)
- return TRUE;
-
- if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
- /* Try to map a page at the pccons I/O space */
- base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0x0000);
-
- if (base != (pointer)-1) {
- IOPortBase = base;
- }
- else {
- xf86Msg(X_WARNING,"EnableIO: failed to mmap %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- return FALSE;
- }
- }
- else {
- xf86Msg("EnableIO: failed to open %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- return FALSE;
- }
-
- ExtendedEnabled = TRUE;
-
- return TRUE;
-}
-
-void
-xf86DisableIO()
-{
- return;
-}
-
-#endif /* USE_ARC_MMAP */
-
-#if 0
-/*
- * XXX This is here for reference. It needs to be handled differently for the
- * ND.
- */
-#if defined(USE_ARC_MMAP) || defined(__arm32__)
-
-#ifdef USE_ARM32_MMAP
-#define DEV_MEM_IOBASE 0x43000000
-#endif
-
-static Bool ScreenEnabled[MAXSCREENS];
-static Bool ExtendedEnabled = FALSE;
-static Bool InitDone = FALSE;
-
-Bool
-xf86EnableIOPorts(ScreenNum)
-int ScreenNum;
-{
- int i;
- int fd;
- pointer base;
-
-#ifdef __arm32__
- struct memAccess *memInfoP;
- int *Size;
-#endif
-
- ScreenEnabled[ScreenNum] = TRUE;
-
- if (ExtendedEnabled)
- return TRUE;
-
-#ifdef USE_ARC_MMAP
- if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
- /* Try to map a page at the pccons I/O space */
- base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0x0000);
-
- if (base != (pointer)-1) {
- IOPortBase = base;
- }
- else {
- xf86Msg(X_ERROR,
- "EnableIOPorts: failed to mmap %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
- }
- else {
- xf86Msg(X_ERROR, "EnableIOPorts: failed to open %s (%s)\n",
- "/dev/ttyC0", strerror(errno));
- }
-#endif
-
-#ifdef __arm32__
- IOPortBase = (unsigned int)-1;
-
- if((memInfoP = checkMapInfo(TRUE, MMIO_REGION)) != NULL)
- {
- /*
- * xf86MapInfoMap maps an offset from the start of video IO
- * space (e.g. 0x3B0), but IOPortBase is expected to map to
- * physical address 0x000, so subtract the start of video I/O
- * space from the result. This is safe for now becase we
- * actually mmap the start of the page, then the start of video
- * I/O space is added as an internal offset.
- */
- IOPortBase = (unsigned int)xf86MapInfoMap(memInfoP,
- (caddr_t)0x0, 0L)
- - memInfoP->memInfo.u.map_info_mmap.internal_offset;
- ExtendedEnabled = TRUE;
- return TRUE;
- }
-#ifdef USE_ARM32_MMAP
- checkDevMem(TRUE);
-
- if (devMemFd >= 0 && useDevMem)
- {
- base = (pointer)mmap((caddr_t)0, 0x400, PROT_READ | PROT_WRITE,
- MAP_FLAGS, devMemFd, (off_t)DEV_MEM_IOBASE);
-
- if (base != (pointer)-1)
- IOPortBase = (unsigned int)base;
- }
-
- if (IOPortBase == (unsigned int)-1)
- {
- xf86Msg(X_WARNING,"xf86EnableIOPorts: failed to open mem device or map IO base. \n\
-Make sure you have the Aperture Driver installed, or a kernel built with the INSECURE option\n");
- return FALSE;
- }
-#else
- /* We don't have the IOBASE, so we can't map the address */
- xf86Msg(X_WARNING,"xf86EnableIOPorts: failed to open mem device or map IO base. \n\
-Try building the server with USE_ARM32_MMAP defined\n");
- return FALSE;
-#endif
-#endif
-
- ExtendedEnabled = TRUE;
-
- return TRUE;
-}
-
-void
-xf86DisableIOPorts(ScreenNum)
-int ScreenNum;
-{
- int i;
-#ifdef __arm32__
- struct memAccess *memInfoP;
-#endif
-
- ScreenEnabled[ScreenNum] = FALSE;
-
-#ifdef __arm32__
- if((memInfoP = checkMapInfo(FALSE, MMIO_REGION)) != NULL)
- {
- xf86MapInfoUnmap(memInfoP, 0);
- }
-#endif
-
-#ifdef USE_ARM32_MMAP
- if (!ExtendedEnabled)
- return;
-
- for (i = 0; i < MAXSCREENS; i++)
- if (ScreenEnabled[i])
- return;
-
- munmap((caddr_t)IOPortBase, 0x400);
- IOPortBase = (unsigned int)-1;
- ExtendedEnabled = FALSE;
-#endif
-
- return;
-}
-
-#endif /* USE_ARC_MMAP || USE_ARM32_MMAP */
-#endif
-
-
+/*
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Rich Murphey and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Rich Murphey and
+ * David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
+ * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+/*
+ * The ARM32 code here carries the following copyright:
+ *
+ * Copyright 1997
+ * Digital Equipment Corporation. All rights reserved.
+ * This software is furnished under license and may be used and copied only in
+ * accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * this software in source and/or binary form. No title or ownership is
+ * transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and retain
+ * this copyright notice and list of conditions as they appear in the
+ * source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of Digital
+ * Equipment Corporation. Neither the "Digital Equipment Corporation"
+ * name nor any trademark or logo of Digital Equipment Corporation may be
+ * used to endorse or promote products derived from this software without
+ * the prior written permission of Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied warranties,
+ * including but not limited to, any implied warranties of merchantability,
+ * fitness for a particular purpose, or non-infringement are disclaimed.
+ * In no event shall DIGITAL be liable for any damages whatsoever, and in
+ * particular, DIGITAL shall not be liable for special, indirect,
+ * consequential, or incidental damages or damages for lost profits, loss
+ * of revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise, even
+ * if advised of the possibility of such damage.
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#ifdef __arm32__
+#include "machine/devmap.h"
+struct memAccess
+{
+ int ioctl;
+ struct map_info memInfo;
+ pointer regionVirtBase;
+ Bool Checked;
+ Bool OK;
+};
+
+static pointer xf86MapInfoMap();
+static void xf86MapInfoUnmap();
+static struct memAccess *checkMapInfo();
+extern int vgaPhysLinearBase;
+
+/* A memAccess structure is needed for each possible region */
+struct memAccess vgaMemInfo = { CONSOLE_GET_MEM_INFO, NULL, NULL,
+ FALSE, FALSE };
+struct memAccess linearMemInfo = { CONSOLE_GET_LINEAR_INFO, NULL, NULL,
+ FALSE, FALSE };
+struct memAccess ioMemInfo = { CONSOLE_GET_IO_INFO, NULL, NULL,
+ FALSE, FALSE };
+#endif /* __arm32__ */
+
+#if defined(__NetBSD__) && !defined(MAP_FILE)
+#define MAP_FLAGS MAP_SHARED
+#else
+#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
+#endif
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+
+#define BUS_BASE 0L
+#define BUS_BASE_BWX 0L
+
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+static Bool useDevMem = FALSE;
+static int devMemFd = -1;
+
+#define DEV_MEM "/dev/mem"
+
+static pointer mapVidMem(int, unsigned long, unsigned long, int);
+static void unmapVidMem(int, pointer, unsigned long);
+
+/*
+ * Check if /dev/mem can be mmap'd. If it can't print a warning when
+ * "warn" is TRUE.
+ */
+static void
+checkDevMem(Bool warn)
+{
+ static Bool devMemChecked = FALSE;
+ int fd;
+ pointer base;
+
+ if (devMemChecked)
+ return;
+ devMemChecked = TRUE;
+
+ if ((fd = open(DEV_MEM, O_RDWR)) >= 0)
+ {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
+
+ if (base != MAP_FAILED)
+ {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ return;
+ } else {
+ /* This should not happen */
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ useDevMem = FALSE;
+ return;
+ }
+ }
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ useDevMem = FALSE;
+ return;
+}
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+
+ checkDevMem(TRUE);
+ pVidMem->linearSupported = useDevMem;
+ pVidMem->mapMem = armMapVidMem;
+ pVidMem->unmapVidMem = armUnmapVidMem;
+
+ pVidMem->initialised = TRUE;
+}
+
+static pointer
+mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ pointer base;
+
+ checkDevMem(FALSE);
+
+ if (useDevMem)
+ {
+ if (devMemFd < 0)
+ {
+ FatalError("xf86MapVidMem: failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ base = mmap((caddr_t)0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
+ if (base == MAP_FAILED)
+ {
+ FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
+ "xf86MapVidMem", DEV_MEM, Size, Base,
+ strerror(errno));
+ }
+ return base;
+ }
+
+ /* else, mmap /dev/vga */
+ if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
+ {
+ FatalError("%s: Address 0x%x outside allowable range\n",
+ "xf86MapVidMem", Base);
+ }
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_FLAGS, xf86Info.consoleFd,
+ (unsigned long)Base - 0xA0000);
+ if (base == MAP_FAILED)
+ {
+ FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
+ strerror(errno));
+ }
+ return base;
+}
+
+static void
+unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap((caddr_t)Base, Size);
+}
+
+/*
+ * Read BIOS via mmap()ing DEV_MEM
+ */
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ unsigned char *ptr;
+ int psize;
+ int mlen;
+
+ checkDevMem(TRUE);
+ if (devMemFd == -1) {
+ return -1;
+ }
+
+ psize = getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+ ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
+ MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE);
+ if ((long)ptr == -1)
+ {
+ xf86Msg(X_WARNING,
+ "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
+ DEV_MEM, Len, Base, Offset, strerror(errno));
+ return -1;
+ }
+#ifdef DEBUG
+ ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
+ Base, ptr[0] | (ptr[1] << 8));
+#endif
+ (void)memcpy(Buf, (void *)(ptr + Offset), Len);
+ (void)munmap((caddr_t)ptr, mlen);
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
+ "-> %02x %02x %02x %02x...\n",
+ Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
+#endif
+ return Len;
+}
+
+
+/* XXX This needs to be updated for the ND */
+
+/*
+** Find out whether the console driver provides memory mapping information
+** for the specified region and return the map_info pointer. Print a warning if required.
+*/
+static struct memAccess *
+checkMapInfo(Bool warn, int Region)
+{
+ struct memAccess *memAccP;
+
+ switch (Region)
+ {
+ case VGA_REGION:
+ memAccP = &vgaMemInfo;
+ break;
+
+ case LINEAR_REGION:
+ memAccP = &linearMemInfo;
+ break;
+
+ case MMIO_REGION:
+ memAccP = &ioMemInfo;
+ break;
+
+ default:
+ return NULL;
+ break;
+ }
+
+ if(!memAccP->Checked)
+ {
+ if(ioctl(xf86Info.consoleFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
+ {
+ if(warn)
+ {
+ xf86Msg(X_WARNING,
+ "checkMapInfo: failed to get map info for region %d\n\t(%s)\n",
+ Region, strerror(errno));
+ }
+ }
+ else
+ {
+ if(memAccP->memInfo.u.map_info_mmap.map_offset
+ != MAP_INFO_UNKNOWN)
+ memAccP->OK = TRUE;
+ }
+ memAccP->Checked = TRUE;
+ }
+ if (memAccP->OK)
+ {
+ return memAccP;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+static pointer
+xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
+{
+ struct map_info *mapInfoP = &(memInfoP->memInfo);
+
+ if (mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
+ {
+ Size = (unsigned long)Base + Size;
+ }
+ else
+ {
+ Size = mapInfoP->u.map_info_mmap.map_size;
+ }
+
+ switch(mapInfoP->method)
+ {
+ case MAP_MMAP:
+ /* Need to remap if size is unknown because we may not have
+ mapped the whole region initially */
+ if(memInfoP->regionVirtBase == NULL ||
+ mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
+ {
+ if((memInfoP->regionVirtBase =
+ mmap((caddr_t)0,
+ Size,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED,
+ xf86Info.consoleFd,
+ (unsigned long)mapInfoP->u.map_info_mmap.map_offset))
+ == (pointer)-1)
+ {
+ FatalError("xf86MapInfoMap: Failed to map memory at 0x%x\n\t%s\n",
+ mapInfoP->u.map_info_mmap.map_offset, strerror(errno));
+ }
+ if(mapInfoP->u.map_info_mmap.internal_offset > 0)
+ memInfoP->regionVirtBase +=
+ mapInfoP->u.map_info_mmap.internal_offset;
+ }
+ break;
+
+ default:
+ FatalError("xf86MapInfoMap: Unsuported mapping method\n");
+ break;
+ }
+
+ return (pointer)((int)memInfoP->regionVirtBase + (int)Base);
+}
+
+static void
+xf86MapInfoUnmap(struct memAccess *memInfoP, unsigned long Size)
+{
+ struct map_info *mapInfoP = &(memInfoP->memInfo);
+
+ switch(mapInfoP->method)
+ {
+ case MAP_MMAP:
+ if(memInfoP->regionVirtBase != NULL)
+ {
+ if(mapInfoP->u.map_info_mmap.map_size != MAP_INFO_UNKNOWN)
+ Size = mapInfoP->u.map_info_mmap.map_size;
+ munmap((caddr_t)memInfoP->regionVirtBase, Size);
+ memInfoP->regionVirtBase = NULL;
+ }
+ break;
+ default:
+ FatalError("xf86MapInfoMap: Unsuported mapping method\n");
+ break;
+ }
+}
+
+static pointer
+armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ struct memAccess *memInfoP;
+
+ if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
+ {
+ /*
+ ** xf86 passes in a physical address offset from the start
+ ** of physical memory, but xf86MapInfoMap expects an
+ ** offset from the start of the specified region - it gets
+ ** the physical address of the region from the display driver.
+ */
+ switch(Region)
+ {
+ case LINEAR_REGION:
+ if (vgaPhysLinearBase)
+ {
+ Base -= vgaPhysLinearBase;
+ }
+ break;
+ case VGA_REGION:
+ Base -= 0xA0000;
+ break;
+ }
+
+ base = xf86MapInfoMap(memInfoP, Base, Size);
+ return base;
+ }
+ return mapVidMem(ScreenNum, Base, Size, flags);
+}
+
+static void
+armUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ struct memAccess *memInfoP;
+
+ if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
+ {
+ xf86MapInfoUnmap(memInfoP, Base, Size);
+ }
+ unmapVidMem(ScreenNum, Base, Size);
+}
+
+#ifdef USE_DEV_IO
+static int IoFd = -1;
+
+Bool
+xf86EnableIO()
+{
+ if (IoFd >= 0)
+ return TRUE;
+
+ if ((IoFd = open("/dev/io", O_RDWR)) == -1)
+ {
+ xf86Msg(X_WARNING,"xf86EnableIO: "
+ "Failed to open /dev/io for extended I/O\n");
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void
+xf86DisableIO()
+{
+ if (IoFd < 0)
+ return;
+
+ close(IoFd);
+ IoFd = -1;
+ return;
+}
+
+#endif
+
+#if defined(USE_ARC_MMAP) || defined(__arm32__)
+
+Bool
+xf86EnableIO()
+{
+ int fd;
+ pointer base;
+
+ if (ExtendedEnabled)
+ return TRUE;
+
+ if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
+ /* Try to map a page at the pccons I/O space */
+ base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0x0000);
+
+ if (base != (pointer)-1) {
+ IOPortBase = base;
+ }
+ else {
+ xf86Msg(X_WARNING,"EnableIO: failed to mmap %s (%s)\n",
+ "/dev/ttyC0", strerror(errno));
+ return FALSE;
+ }
+ }
+ else {
+ xf86Msg("EnableIO: failed to open %s (%s)\n",
+ "/dev/ttyC0", strerror(errno));
+ return FALSE;
+ }
+
+ ExtendedEnabled = TRUE;
+
+ return TRUE;
+}
+
+void
+xf86DisableIO()
+{
+ return;
+}
+
+#endif /* USE_ARC_MMAP */
+
+#if 0
+/*
+ * XXX This is here for reference. It needs to be handled differently for the
+ * ND.
+ */
+#if defined(USE_ARC_MMAP) || defined(__arm32__)
+
+#ifdef USE_ARM32_MMAP
+#define DEV_MEM_IOBASE 0x43000000
+#endif
+
+static Bool ScreenEnabled[MAXSCREENS];
+static Bool ExtendedEnabled = FALSE;
+static Bool InitDone = FALSE;
+
+Bool
+xf86EnableIOPorts(ScreenNum)
+int ScreenNum;
+{
+ int i;
+ int fd;
+ pointer base;
+
+#ifdef __arm32__
+ struct memAccess *memInfoP;
+ int *Size;
+#endif
+
+ ScreenEnabled[ScreenNum] = TRUE;
+
+ if (ExtendedEnabled)
+ return TRUE;
+
+#ifdef USE_ARC_MMAP
+ if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
+ /* Try to map a page at the pccons I/O space */
+ base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0x0000);
+
+ if (base != (pointer)-1) {
+ IOPortBase = base;
+ }
+ else {
+ xf86Msg(X_ERROR,
+ "EnableIOPorts: failed to mmap %s (%s)\n",
+ "/dev/ttyC0", strerror(errno));
+ }
+ }
+ else {
+ xf86Msg(X_ERROR, "EnableIOPorts: failed to open %s (%s)\n",
+ "/dev/ttyC0", strerror(errno));
+ }
+#endif
+
+#ifdef __arm32__
+ IOPortBase = (unsigned int)-1;
+
+ if((memInfoP = checkMapInfo(TRUE, MMIO_REGION)) != NULL)
+ {
+ /*
+ * xf86MapInfoMap maps an offset from the start of video IO
+ * space (e.g. 0x3B0), but IOPortBase is expected to map to
+ * physical address 0x000, so subtract the start of video I/O
+ * space from the result. This is safe for now becase we
+ * actually mmap the start of the page, then the start of video
+ * I/O space is added as an internal offset.
+ */
+ IOPortBase = (unsigned int)xf86MapInfoMap(memInfoP,
+ (caddr_t)0x0, 0L)
+ - memInfoP->memInfo.u.map_info_mmap.internal_offset;
+ ExtendedEnabled = TRUE;
+ return TRUE;
+ }
+#ifdef USE_ARM32_MMAP
+ checkDevMem(TRUE);
+
+ if (devMemFd >= 0 && useDevMem)
+ {
+ base = (pointer)mmap((caddr_t)0, 0x400, PROT_READ | PROT_WRITE,
+ MAP_FLAGS, devMemFd, (off_t)DEV_MEM_IOBASE);
+
+ if (base != (pointer)-1)
+ IOPortBase = (unsigned int)base;
+ }
+
+ if (IOPortBase == (unsigned int)-1)
+ {
+ xf86Msg(X_WARNING,"xf86EnableIOPorts: failed to open mem device or map IO base. \n\
+Make sure you have the Aperture Driver installed, or a kernel built with the INSECURE option\n");
+ return FALSE;
+ }
+#else
+ /* We don't have the IOBASE, so we can't map the address */
+ xf86Msg(X_WARNING,"xf86EnableIOPorts: failed to open mem device or map IO base. \n\
+Try building the server with USE_ARM32_MMAP defined\n");
+ return FALSE;
+#endif
+#endif
+
+ ExtendedEnabled = TRUE;
+
+ return TRUE;
+}
+
+void
+xf86DisableIOPorts(ScreenNum)
+int ScreenNum;
+{
+ int i;
+#ifdef __arm32__
+ struct memAccess *memInfoP;
+#endif
+
+ ScreenEnabled[ScreenNum] = FALSE;
+
+#ifdef __arm32__
+ if((memInfoP = checkMapInfo(FALSE, MMIO_REGION)) != NULL)
+ {
+ xf86MapInfoUnmap(memInfoP, 0);
+ }
+#endif
+
+#ifdef USE_ARM32_MMAP
+ if (!ExtendedEnabled)
+ return;
+
+ for (i = 0; i < MAXSCREENS; i++)
+ if (ScreenEnabled[i])
+ return;
+
+ munmap((caddr_t)IOPortBase, 0x400);
+ IOPortBase = (unsigned int)-1;
+ ExtendedEnabled = FALSE;
+#endif
+
+ return;
+}
+
+#endif /* USE_ARC_MMAP || USE_ARM32_MMAP */
+#endif
+
+
diff --git a/xorg-server/hw/xfree86/os-support/bsd/bsd_bell.c b/xorg-server/hw/xfree86/os-support/bsd/bsd_bell.c
index 55eb75231..fb457db71 100644
--- a/xorg-server/hw/xfree86/os-support/bsd/bsd_bell.c
+++ b/xorg-server/hw/xfree86/os-support/bsd/bsd_bell.c
@@ -37,10 +37,6 @@
#include "xf86Priv.h"
#include "xf86_OSlib.h"
-#ifdef WSCONS_SUPPORT
-#define KBD_FD(i) ((i).kbdFd != -1 ? (i).kbdFd : (i).consoleFd)
-#endif
-
void
xf86OSRingBell(int loudness, int pitch, int duration)
{
diff --git a/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c b/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c
index 837a2f4d1..844617980 100644
--- a/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c
@@ -41,7 +41,10 @@
#include <errno.h>
static Bool KeepTty = FALSE;
+
+#ifdef PCCONS_SUPPORT
static int devConsoleFd = -1;
+#endif
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
static int VTnum = -1;
static int initialVT = -1;
@@ -207,11 +210,7 @@ xf86OpenConsole()
"%s: No console driver found\n\tSupported drivers: %s\n\t%s",
"xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG);
}
-#if 0 /* stdin is already closed in OsInit() */
- fclose(stdin);
-#endif
xf86Info.consoleFd = fd;
- xf86Info.screenFd = fd;
switch (xf86Info.consType)
{
@@ -292,13 +291,13 @@ acquire_vt:
{
FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed");
}
- #if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
+#if !defined(__OpenBSD__) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
if (ioctl(xf86Info.consoleFd, KDENABIO, 0) < 0)
{
FatalError("xf86OpenConsole: KDENABIO failed (%s)",
strerror(errno));
}
- #endif
+#endif
if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
{
FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed");
@@ -370,7 +369,6 @@ xf86OpenSyscons()
int fd = -1;
vtmode_t vtmode;
char vtname[12];
- struct stat status;
long syscons_version;
MessageType from;
@@ -423,20 +421,11 @@ xf86OpenSyscons()
{
/*
* All VTs are in use. If initialVT was found, use it.
- * Otherwise, if stdin is a VT, use that one.
- * XXX stdin is already closed, so this won't work.
*/
if (initialVT != -1)
{
xf86Info.vtno = initialVT;
}
- else if ((fstat(0, &status) >= 0)
- && S_ISCHR(status.st_mode)
- && (ioctl(0, VT_GETMODE, &vtmode) >= 0))
- {
- /* stdin is a VT */
- xf86Info.vtno = minor(status.st_rdev) + 1;
- }
else
{
if (syscons_version >= 0x100)
@@ -457,11 +446,7 @@ xf86OpenSyscons()
}
close(fd);
-#ifndef __OpenBSD__
sprintf(vtname, "/dev/ttyv%01x", xf86Info.vtno - 1);
-#else
- sprintf(vtname, "/dev/ttyC%01x", xf86Info.vtno - 1);
-#endif
if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0)
{
FatalError("xf86OpenSyscons: Cannot open %s (%s)",
@@ -506,7 +491,6 @@ xf86OpenPcvt()
int fd = -1;
vtmode_t vtmode;
char vtname[12], *vtprefix;
- struct stat status;
struct pcvtid pcvt_version;
#ifndef __OpenBSD__
@@ -552,20 +536,11 @@ xf86OpenPcvt()
{
/*
* All VTs are in use. If initialVT was found, use it.
- * Otherwise, if stdin is a VT, use that one.
- * XXX stdin is already closed, so this won't work.
*/
if (initialVT != -1)
{
xf86Info.vtno = initialVT;
}
- else if ((fstat(0, &status) >= 0)
- && S_ISCHR(status.st_mode)
- && (ioctl(0, VT_GETMODE, &vtmode) >= 0))
- {
- /* stdin is a VT */
- xf86Info.vtno = minor(status.st_rdev) + 1;
- }
else
{
FatalError("%s: Cannot find a free VT",
@@ -673,7 +648,7 @@ xf86CloseConsole()
VT.mode = VT_AUTO;
ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* dflt vt handling */
}
-#if !defined(OpenBSD) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
+#if !defined(__OpenBSD__) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL)
if (ioctl(xf86Info.consoleFd, KDDISABIO, 0) < 0)
{
xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)",
@@ -688,25 +663,17 @@ xf86CloseConsole()
case WSCONS:
{
int mode = WSDISPLAYIO_MODE_EMUL;
- ioctl(xf86Info.screenFd, WSDISPLAYIO_SMODE, &mode);
+ ioctl(xf86Info.consoleFd, WSDISPLAYIO_SMODE, &mode);
break;
}
#endif
}
- if (xf86Info.screenFd != xf86Info.consoleFd)
- {
- close(xf86Info.screenFd);
- close(xf86Info.consoleFd);
- if ((xf86Info.consoleFd = open("/dev/console",O_RDONLY,0)) <0)
- {
- xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)",
- strerror(errno));
- }
- }
close(xf86Info.consoleFd);
+#ifdef PCCONS_SUPPORT
if (devConsoleFd >= 0)
close(devConsoleFd);
+#endif
return;
}
diff --git a/xorg-server/hw/xfree86/os-support/bsd/i386_video.c b/xorg-server/hw/xfree86/os-support/bsd/i386_video.c
index 9b26fb1dd..525bfb607 100644
--- a/xorg-server/hw/xfree86/os-support/bsd/i386_video.c
+++ b/xorg-server/hw/xfree86/os-support/bsd/i386_video.c
@@ -1,908 +1,908 @@
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#include <errno.h>
-#include <sys/mman.h>
-
-#ifdef HAS_MTRR_SUPPORT
-#ifndef __NetBSD__
-#include <sys/types.h>
-#include <sys/memrange.h>
-#else
-#include "memrange.h"
-#endif
-#define X_MTRR_ID "XFree86"
-#endif
-
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-#include <machine/mtrr.h>
-#include <machine/sysarch.h>
-#include <sys/queue.h>
-#ifdef __x86_64__
-#define i386_set_mtrr x86_64_set_mtrr
-#define i386_get_mtrr x86_64_get_mtrr
-#define i386_iopl x86_64_iopl
-#endif
-#endif
-
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#if defined(__NetBSD__) && !defined(MAP_FILE)
-#define MAP_FLAGS MAP_SHARED
-#else
-#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-#ifdef __OpenBSD__
-#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
- "\tin /etc/sysctl.conf and reboot your machine\n" \
- "\trefer to xf86(4) for details"
-#define SYSCTL_MSG2 \
- "Check that you have set 'machdep.allowaperture=2'\n" \
- "\tin /etc/sysctl.conf and reboot your machine\n" \
- "\trefer to xf86(4) for details"
-#endif
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static Bool useDevMem = FALSE;
-static int devMemFd = -1;
-
-#ifdef HAS_APERTURE_DRV
-#define DEV_APERTURE "/dev/xf86"
-#endif
-#define DEV_MEM "/dev/mem"
-
-static pointer mapVidMem(int, unsigned long, unsigned long, int);
-static void unmapVidMem(int, pointer, unsigned long);
-
-#ifdef HAS_MTRR_SUPPORT
-static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType);
-static void undoWC(int, pointer);
-static Bool cleanMTRR(void);
-#endif
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-static pointer NetBSDsetWC(int, unsigned long, unsigned long, Bool,
- MessageType);
-static void NetBSDundoWC(int, pointer);
-#endif
-
-/*
- * Check if /dev/mem can be mmap'd. If it can't print a warning when
- * "warn" is TRUE.
- */
-static void
-checkDevMem(Bool warn)
-{
- static Bool devMemChecked = FALSE;
- int fd;
- pointer base;
-
- if (devMemChecked)
- return;
- devMemChecked = TRUE;
-
- if ((fd = open(DEV_MEM, O_RDWR)) >= 0)
- {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000);
-
- if (base != MAP_FAILED)
- {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- return;
- } else {
- /* This should not happen */
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- useDevMem = FALSE;
- return;
- }
- }
-#ifndef HAS_APERTURE_DRV
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n",
- DEV_MEM, strerror(errno));
- }
- useDevMem = FALSE;
- return;
-#else
- /* Failed to open /dev/mem, try the aperture driver */
- if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0)
- {
- /* Try to map a page at the VGA address */
- base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
- MAP_FLAGS, fd, (off_t)0xA0000);
-
- if (base != MAP_FAILED)
- {
- munmap((caddr_t)base, 4096);
- devMemFd = fd;
- useDevMem = TRUE;
- xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n",
- DEV_APERTURE);
- return;
- } else {
-
- if (warn)
- {
- xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
- DEV_APERTURE, strerror(errno));
- }
- }
- } else {
- if (warn)
- {
-#ifndef __OpenBSD__
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n", DEV_MEM, DEV_APERTURE, strerror(errno));
-#else /* __OpenBSD__ */
- xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
- "\t(%s)\n%s", DEV_MEM, DEV_APERTURE, strerror(errno),
- SYSCTL_MSG);
-#endif /* __OpenBSD__ */
- }
- }
-
- useDevMem = FALSE;
- return;
-
-#endif
-}
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- checkDevMem(TRUE);
- pVidMem->linearSupported = useDevMem;
- pVidMem->mapMem = mapVidMem;
- pVidMem->unmapMem = unmapVidMem;
-
-#if HAVE_PCI_SYSTEM_INIT_DEV_MEM
- if (useDevMem)
- pci_system_init_dev_mem(devMemFd);
-#endif
-
-#ifdef HAS_MTRR_SUPPORT
- if (useDevMem) {
- if (cleanMTRR()) {
- pVidMem->setWC = setWC;
- pVidMem->undoWC = undoWC;
- }
- }
-#endif
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
- pVidMem->setWC = NetBSDsetWC;
- pVidMem->undoWC = NetBSDundoWC;
-#endif
- pVidMem->initialised = TRUE;
-}
-
-static pointer
-mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
-{
- pointer base;
-
- checkDevMem(FALSE);
-
- if (useDevMem)
- {
- if (devMemFd < 0)
- {
- FatalError("xf86MapVidMem: failed to open %s (%s)",
- DEV_MEM, strerror(errno));
- }
- base = mmap((caddr_t)0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, devMemFd, (off_t)Base);
- if (base == MAP_FAILED)
- {
- FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)",
- "xf86MapVidMem", DEV_MEM, Size, Base,
- strerror(errno));
- }
- return base;
- }
-
- /* else, mmap /dev/vga */
- if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
- {
- FatalError("%s: Address 0x%lx outside allowable range",
- "xf86MapVidMem", Base);
- }
- base = mmap(0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_FLAGS, xf86Info.screenFd,
- (unsigned long)Base - 0xA0000
- );
- if (base == MAP_FAILED)
- {
- FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)",
- strerror(errno));
- }
- return base;
-}
-
-static void
-unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap((caddr_t)Base, Size);
-}
-
-/*
- * Read BIOS via mmap()ing DEV_MEM
- */
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
- unsigned char *ptr;
- int psize;
- int mlen;
-
- checkDevMem(TRUE);
- if (devMemFd == -1) {
- return -1;
- }
-
- psize = getpagesize();
- Offset += Base & (psize - 1);
- Base &= ~(psize - 1);
- mlen = (Offset + Len + psize - 1) & ~(psize - 1);
- ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
- MAP_SHARED, devMemFd, (off_t)Base);
- if ((long)ptr == -1)
- {
- xf86Msg(X_WARNING,
- "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n",
- DEV_MEM, Len, Base, Offset, strerror(errno));
-#ifdef __OpenBSD__
- if (Base < 0xa0000) {
- xf86Msg(X_WARNING, SYSCTL_MSG2);
- }
-#endif
- return -1;
- }
-#ifdef DEBUG
- ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
- Base, ptr[0] | (ptr[1] << 8));
-#endif
- (void)memcpy(Buf, (void *)(ptr + Offset), Len);
- (void)munmap((caddr_t)ptr, mlen);
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
- "-> %02x %02x %02x %02x...\n",
- Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
-#endif
- return Len;
-}
-
-#ifdef USE_I386_IOPL
-/***************************************************************************/
-/* I/O Permissions section */
-/***************************************************************************/
-
-static Bool ExtendedEnabled = FALSE;
-
-Bool
-xf86EnableIO()
-{
- if (ExtendedEnabled)
- return TRUE;
-
- if (i386_iopl(TRUE) < 0)
- {
-#ifndef __OpenBSD__
- xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O",
- "xf86EnableIO");
-#else
- xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O\n%s",
- "xf86EnableIO", SYSCTL_MSG);
-#endif
- return FALSE;
- }
- ExtendedEnabled = TRUE;
-
- return TRUE;
-}
-
-void
-xf86DisableIO()
-{
- if (!ExtendedEnabled)
- return;
-
- i386_iopl(FALSE);
- ExtendedEnabled = FALSE;
-
- return;
-}
-
-#endif /* USE_I386_IOPL */
-
-#ifdef USE_AMD64_IOPL
-/***************************************************************************/
-/* I/O Permissions section */
-/***************************************************************************/
-
-static Bool ExtendedEnabled = FALSE;
-
-Bool
-xf86EnableIO()
-{
- if (ExtendedEnabled)
- return TRUE;
-
- if (amd64_iopl(TRUE) < 0)
- {
-#ifndef __OpenBSD__
- xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O",
- "xf86EnableIO");
-#else
- xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O\n%s",
- "xf86EnableIO", SYSCTL_MSG);
-#endif
- return FALSE;
- }
- ExtendedEnabled = TRUE;
-
- return TRUE;
-}
-
-void
-xf86DisableIO()
-{
- if (!ExtendedEnabled)
- return;
-
- if (amd64_iopl(FALSE) == 0) {
- ExtendedEnabled = FALSE;
- }
- /* Otherwise, the X server has revoqued its root uid,
- and thus cannot give up IO privileges any more */
-
- return;
-}
-
-#endif /* USE_AMD64_IOPL */
-
-#ifdef USE_DEV_IO
-static int IoFd = -1;
-
-Bool
-xf86EnableIO()
-{
- if (IoFd >= 0)
- return TRUE;
-
- if ((IoFd = open("/dev/io", O_RDWR)) == -1)
- {
- xf86Msg(X_WARNING,"xf86EnableIO: "
- "Failed to open /dev/io for extended I/O");
- return FALSE;
- }
- return TRUE;
-}
-
-void
-xf86DisableIO()
-{
- if (IoFd < 0)
- return;
-
- close(IoFd);
- IoFd = -1;
- return;
-}
-
-#endif
-
-#ifdef __NetBSD__
-/***************************************************************************/
-/* Set TV output mode */
-/***************************************************************************/
-void
-xf86SetTVOut(int mode)
-{
- switch (xf86Info.consType)
- {
-#ifdef PCCONS_SUPPORT
- case PCCONS:{
-
- if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_ON, &mode) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86SetTVOut: Could not set console to TV output, %s\n",
- strerror(errno));
- }
- }
- break;
-#endif /* PCCONS_SUPPORT */
-
- default:
- FatalError("Xf86SetTVOut: Unsupported console");
- break;
- }
- return;
-}
-
-void
-xf86SetRGBOut()
-{
- switch (xf86Info.consType)
- {
-#ifdef PCCONS_SUPPORT
- case PCCONS:{
-
- if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_OFF, 0) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86SetTVOut: Could not set console to RGB output, %s\n",
- strerror(errno));
- }
- }
- break;
-#endif /* PCCONS_SUPPORT */
-
- default:
- FatalError("Xf86SetTVOut: Unsupported console");
- break;
- }
- return;
-}
-#endif
-
-#ifdef HAS_MTRR_SUPPORT
-/* memory range (MTRR) support for FreeBSD */
-
-/*
- * This code is experimental. Some parts may be overkill, and other parts
- * may be incomplete.
- */
-
-/*
- * getAllRanges returns the full list of memory ranges with attributes set.
- */
-
-static struct mem_range_desc *
-getAllRanges(int *nmr)
-{
- struct mem_range_desc *mrd;
- struct mem_range_op mro;
-
- /*
- * Find how many ranges there are. If this fails, then the kernel
- * probably doesn't have MTRR support.
- */
- mro.mo_arg[0] = 0;
- if (ioctl(devMemFd, MEMRANGE_GET, &mro))
- return NULL;
- *nmr = mro.mo_arg[0];
- mrd = xnfalloc(*nmr * sizeof(struct mem_range_desc));
- mro.mo_arg[0] = *nmr;
- mro.mo_desc = mrd;
- if (ioctl(devMemFd, MEMRANGE_GET, &mro)) {
- free(mrd);
- return NULL;
- }
- return mrd;
-}
-
-/*
- * cleanMTRR removes any memory attribute that may be left by a previous
- * X server. Normally there won't be any, but this takes care of the
- * case where a server crashed without being able finish cleaning up.
- */
-
-static Bool
-cleanMTRR()
-{
- struct mem_range_desc *mrd;
- struct mem_range_op mro;
- int nmr, i;
-
- /* This shouldn't happen */
- if (devMemFd < 0)
- return FALSE;
-
- if (!(mrd = getAllRanges(&nmr)))
- return FALSE;
-
- for (i = 0; i < nmr; i++) {
- if (strcmp(mrd[i].mr_owner, X_MTRR_ID) == 0 &&
- (mrd[i].mr_flags & MDF_ACTIVE)) {
-#ifdef DEBUG
- ErrorF("Clean for (0x%lx,0x%lx)\n",
- (unsigned long)mrd[i].mr_base,
- (unsigned long)mrd[i].mr_len);
-#endif
- if (mrd[i].mr_flags & MDF_FIXACTIVE) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- mrd[i].mr_flags = MDF_UNCACHEABLE;
- } else {
- mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
- }
- mro.mo_desc = mrd + i;
- ioctl(devMemFd, MEMRANGE_SET, &mro);
- }
- }
-#ifdef DEBUG
- sleep(10);
-#endif
- free(mrd);
- return TRUE;
-}
-
-typedef struct x_RangeRec {
- struct mem_range_desc mrd;
- Bool wasWC;
- struct x_RangeRec * next;
-} RangeRec, *RangePtr;
-
-static void
-freeRangeList(RangePtr range)
-{
- RangePtr rp;
-
- while (range) {
- rp = range;
- range = rp->next;
- free(rp);
- }
-}
-
-static RangePtr
-dupRangeList(RangePtr list)
-{
- RangePtr new = NULL, rp, p;
-
- rp = list;
- while (rp) {
- p = xnfalloc(sizeof(RangeRec));
- *p = *rp;
- p->next = new;
- new = p;
- rp = rp->next;
- }
- return new;
-}
-
-static RangePtr
-sortRangeList(RangePtr list)
-{
- RangePtr rp1, rp2, copy, sorted = NULL, minp, prev, minprev;
- unsigned long minBase;
-
- /* Sort by base address */
- rp1 = copy = dupRangeList(list);
- while (rp1) {
- minBase = rp1->mrd.mr_base;
- minp = rp1;
- minprev = NULL;
- prev = rp1;
- rp2 = rp1->next;
- while (rp2) {
- if (rp2->mrd.mr_base < minBase) {
- minBase = rp2->mrd.mr_base;
- minp = rp2;
- minprev = prev;
- }
- prev = rp2;
- rp2 = rp2->next;
- }
- if (minprev) {
- minprev->next = minp->next;
- rp1 = copy;
- } else {
- rp1 = minp->next;
- }
- minp->next = sorted;
- sorted = minp;
- }
- return sorted;
-}
-
-/*
- * findRanges returns a list of ranges that overlap the specified range.
- */
-
-static void
-findRanges(unsigned long base, unsigned long size, RangePtr *ucp, RangePtr *wcp)
-{
- struct mem_range_desc *mrd;
- int nmr, i;
- RangePtr rp, *p;
-
- if (!(mrd = getAllRanges(&nmr)))
- return;
-
- for (i = 0; i < nmr; i++) {
- if ((mrd[i].mr_flags & MDF_ACTIVE) &&
- mrd[i].mr_base < base + size &&
- mrd[i].mr_base + mrd[i].mr_len > base) {
- if (mrd[i].mr_flags & MDF_WRITECOMBINE)
- p = wcp;
- else if (mrd[i].mr_flags & MDF_UNCACHEABLE)
- p = ucp;
- else
- continue;
- rp = xnfalloc(sizeof(RangeRec));
- rp->mrd = mrd[i];
- rp->next = *p;
- *p = rp;
- }
- }
- free(mrd);
-}
-
-/*
- * This checks if the existing overlapping ranges fully cover the requested
- * range. Is this overkill?
- */
-
-static Bool
-fullCoverage(unsigned long base, unsigned long size, RangePtr overlap)
-{
- RangePtr rp1, sorted = NULL;
- unsigned long end;
-
- sorted = sortRangeList(overlap);
- /* Look for gaps */
- rp1 = sorted;
- end = base + size;
- while (rp1) {
- if (rp1->mrd.mr_base > base) {
- freeRangeList(sorted);
- return FALSE;
- } else {
- base = rp1->mrd.mr_base + rp1->mrd.mr_len;
- }
- if (base >= end) {
- freeRangeList(sorted);
- return TRUE;
- }
- rp1 = rp1->next;
- }
- freeRangeList(sorted);
- return FALSE;
-}
-
-static pointer
-addWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
- RangePtr uc = NULL, wc = NULL, retlist = NULL;
- struct mem_range_desc mrd;
- struct mem_range_op mro;
-
- findRanges(base, size, &uc, &wc);
-
- /* See of the full range is already WC */
- if (!uc && fullCoverage(base, size, wc)) {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx) was already set\n",
- base, size);
- return NULL;
- }
-
- /* Otherwise, try to add the new range */
- mrd.mr_base = base;
- mrd.mr_len = size;
- strcpy(mrd.mr_owner, X_MTRR_ID);
- mrd.mr_flags = MDF_WRITECOMBINE;
- mro.mo_desc = &mrd;
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to set write-combining range "
- "(0x%lx,0x%lx)\n", base, size);
- return NULL;
- } else {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx)\n", base, size);
- retlist = xnfalloc(sizeof(RangeRec));
- retlist->mrd = mrd;
- retlist->wasWC = FALSE;
- retlist->next = NULL;
- return retlist;
- }
-}
-
-static pointer
-delWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
-{
- RangePtr uc = NULL, wc = NULL, retlist = NULL;
- struct mem_range_desc mrd;
- struct mem_range_op mro;
-
- findRanges(base, size, &uc, &wc);
-
- /*
- * See of the full range is already not WC, or if there is full
- * coverage from UC ranges.
- */
- if (!wc || fullCoverage(base, size, uc)) {
- xf86DrvMsg(screenNum, from,
- "Write-combining range (0x%lx,0x%lx) was already clear\n",
- base, size);
- return NULL;
- }
-
- /* Otherwise, try to add the new range */
- mrd.mr_base = base;
- mrd.mr_len = size;
- strcpy(mrd.mr_owner, X_MTRR_ID);
- mrd.mr_flags = MDF_UNCACHEABLE;
- mro.mo_desc = &mrd;
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to remove write-combining range "
- "(0x%lx,0x%lx)\n", base, size);
- /* XXX Should then remove all of the overlapping WC ranges */
- return NULL;
- } else {
- xf86DrvMsg(screenNum, from,
- "Removed Write-combining range (0x%lx,0x%lx)\n",
- base, size);
- retlist = xnfalloc(sizeof(RangeRec));
- retlist->mrd = mrd;
- retlist->wasWC = TRUE;
- retlist->next = NULL;
- return retlist;
- }
-}
-
-static pointer
-setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
- MessageType from)
-{
- if (enable)
- return addWC(screenNum, base, size, from);
- else
- return delWC(screenNum, base, size, from);
-}
-
-static void
-undoWC(int screenNum, pointer list)
-{
- RangePtr rp;
- struct mem_range_op mro;
- Bool failed;
-
- rp = list;
- while (rp) {
-#ifdef DEBUG
- ErrorF("Undo for (0x%lx,0x%lx), %d\n",
- (unsigned long)rp->mrd.mr_base,
- (unsigned long)rp->mrd.mr_len, rp->wasWC);
-#endif
- failed = FALSE;
- if (rp->wasWC) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- rp->mrd.mr_flags = MDF_WRITECOMBINE;
- strcpy(rp->mrd.mr_owner, "unknown");
- } else {
- mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
- }
- mro.mo_desc = &rp->mrd;
-
- if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
- if (!rp->wasWC) {
- mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
- rp->mrd.mr_flags = MDF_UNCACHEABLE;
- strcpy(rp->mrd.mr_owner, "unknown");
- if (ioctl(devMemFd, MEMRANGE_SET, &mro))
- failed = TRUE;
- } else
- failed = TRUE;
- }
- if (failed) {
- xf86DrvMsg(screenNum, X_WARNING,
- "Failed to restore MTRR range (0x%lx,0x%lx)\n",
- (unsigned long)rp->mrd.mr_base,
- (unsigned long)rp->mrd.mr_len);
- }
- rp = rp->next;
- }
-}
-
-#endif /* HAS_MTRR_SUPPORT */
-
-
-#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
-static pointer
-NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
- MessageType from)
-{
- struct mtrr *mtrrp;
- int n;
-
- xf86DrvMsg(screenNum, X_WARNING,
- "%s MTRR %lx - %lx\n", enable ? "set" : "remove",
- base, (base + size));
-
- mtrrp = xnfalloc(sizeof (struct mtrr));
- mtrrp->base = base;
- mtrrp->len = size;
- mtrrp->type = MTRR_TYPE_WC;
-
- /*
- * MTRR_PRIVATE will make this MTRR get reset automatically
- * if this process exits, so we have no need for an explicit
- * cleanup operation when starting a new server.
- */
-
- if (enable)
- mtrrp->flags = MTRR_VALID | MTRR_PRIVATE;
- else
- mtrrp->flags = 0;
- n = 1;
-
- if (i386_set_mtrr(mtrrp, &n) < 0) {
- free(mtrrp);
- return NULL;
- }
- return mtrrp;
-}
-
-static void
-NetBSDundoWC(int screenNum, pointer list)
-{
- struct mtrr *mtrrp = (struct mtrr *)list;
- int n;
-
- if (mtrrp == NULL)
- return;
- n = 1;
- mtrrp->flags &= ~MTRR_VALID;
- i386_set_mtrr(mtrrp, &n);
- free(mtrrp);
-}
-#endif
+/*
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Rich Murphey and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Rich Murphey and
+ * David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
+ * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#include <errno.h>
+#include <sys/mman.h>
+
+#ifdef HAS_MTRR_SUPPORT
+#ifndef __NetBSD__
+#include <sys/types.h>
+#include <sys/memrange.h>
+#else
+#include "memrange.h"
+#endif
+#define X_MTRR_ID "XFree86"
+#endif
+
+#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
+#include <machine/mtrr.h>
+#include <machine/sysarch.h>
+#include <sys/queue.h>
+#ifdef __x86_64__
+#define i386_set_mtrr x86_64_set_mtrr
+#define i386_get_mtrr x86_64_get_mtrr
+#define i386_iopl x86_64_iopl
+#endif
+#endif
+
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#if defined(__NetBSD__) && !defined(MAP_FILE)
+#define MAP_FLAGS MAP_SHARED
+#else
+#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
+#endif
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+#ifdef __OpenBSD__
+#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
+ "\tin /etc/sysctl.conf and reboot your machine\n" \
+ "\trefer to xf86(4) for details"
+#define SYSCTL_MSG2 \
+ "Check that you have set 'machdep.allowaperture=2'\n" \
+ "\tin /etc/sysctl.conf and reboot your machine\n" \
+ "\trefer to xf86(4) for details"
+#endif
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+static Bool useDevMem = FALSE;
+static int devMemFd = -1;
+
+#ifdef HAS_APERTURE_DRV
+#define DEV_APERTURE "/dev/xf86"
+#endif
+#define DEV_MEM "/dev/mem"
+
+static pointer mapVidMem(int, unsigned long, unsigned long, int);
+static void unmapVidMem(int, pointer, unsigned long);
+
+#ifdef HAS_MTRR_SUPPORT
+static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType);
+static void undoWC(int, pointer);
+static Bool cleanMTRR(void);
+#endif
+#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
+static pointer NetBSDsetWC(int, unsigned long, unsigned long, Bool,
+ MessageType);
+static void NetBSDundoWC(int, pointer);
+#endif
+
+/*
+ * Check if /dev/mem can be mmap'd. If it can't print a warning when
+ * "warn" is TRUE.
+ */
+static void
+checkDevMem(Bool warn)
+{
+ static Bool devMemChecked = FALSE;
+ int fd;
+ pointer base;
+
+ if (devMemChecked)
+ return;
+ devMemChecked = TRUE;
+
+ if ((fd = open(DEV_MEM, O_RDWR)) >= 0)
+ {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000);
+
+ if (base != MAP_FAILED)
+ {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ return;
+ } else {
+ /* This should not happen */
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ useDevMem = FALSE;
+ return;
+ }
+ }
+#ifndef HAS_APERTURE_DRV
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ useDevMem = FALSE;
+ return;
+#else
+ /* Failed to open /dev/mem, try the aperture driver */
+ if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0)
+ {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000);
+
+ if (base != MAP_FAILED)
+ {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n",
+ DEV_APERTURE);
+ return;
+ } else {
+
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_APERTURE, strerror(errno));
+ }
+ }
+ } else {
+ if (warn)
+ {
+#ifndef __OpenBSD__
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
+ "\t(%s)\n", DEV_MEM, DEV_APERTURE, strerror(errno));
+#else /* __OpenBSD__ */
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
+ "\t(%s)\n%s", DEV_MEM, DEV_APERTURE, strerror(errno),
+ SYSCTL_MSG);
+#endif /* __OpenBSD__ */
+ }
+ }
+
+ useDevMem = FALSE;
+ return;
+
+#endif
+}
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+ checkDevMem(TRUE);
+ pVidMem->linearSupported = useDevMem;
+ pVidMem->mapMem = mapVidMem;
+ pVidMem->unmapMem = unmapVidMem;
+
+#if HAVE_PCI_SYSTEM_INIT_DEV_MEM
+ if (useDevMem)
+ pci_system_init_dev_mem(devMemFd);
+#endif
+
+#ifdef HAS_MTRR_SUPPORT
+ if (useDevMem) {
+ if (cleanMTRR()) {
+ pVidMem->setWC = setWC;
+ pVidMem->undoWC = undoWC;
+ }
+ }
+#endif
+#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
+ pVidMem->setWC = NetBSDsetWC;
+ pVidMem->undoWC = NetBSDundoWC;
+#endif
+ pVidMem->initialised = TRUE;
+}
+
+static pointer
+mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ pointer base;
+
+ checkDevMem(FALSE);
+
+ if (useDevMem)
+ {
+ if (devMemFd < 0)
+ {
+ FatalError("xf86MapVidMem: failed to open %s (%s)",
+ DEV_MEM, strerror(errno));
+ }
+ base = mmap((caddr_t)0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_FLAGS, devMemFd, (off_t)Base);
+ if (base == MAP_FAILED)
+ {
+ FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)",
+ "xf86MapVidMem", DEV_MEM, Size, Base,
+ strerror(errno));
+ }
+ return base;
+ }
+
+ /* else, mmap /dev/vga */
+ if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
+ {
+ FatalError("%s: Address 0x%lx outside allowable range",
+ "xf86MapVidMem", Base);
+ }
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_FLAGS, xf86Info.consoleFd,
+ (unsigned long)Base - 0xA0000
+ );
+ if (base == MAP_FAILED)
+ {
+ FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)",
+ strerror(errno));
+ }
+ return base;
+}
+
+static void
+unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap((caddr_t)Base, Size);
+}
+
+/*
+ * Read BIOS via mmap()ing DEV_MEM
+ */
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ unsigned char *ptr;
+ int psize;
+ int mlen;
+
+ checkDevMem(TRUE);
+ if (devMemFd == -1) {
+ return -1;
+ }
+
+ psize = getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+ ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
+ MAP_SHARED, devMemFd, (off_t)Base);
+ if ((long)ptr == -1)
+ {
+ xf86Msg(X_WARNING,
+ "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n",
+ DEV_MEM, Len, Base, Offset, strerror(errno));
+#ifdef __OpenBSD__
+ if (Base < 0xa0000) {
+ xf86Msg(X_WARNING, SYSCTL_MSG2);
+ }
+#endif
+ return -1;
+ }
+#ifdef DEBUG
+ ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
+ Base, ptr[0] | (ptr[1] << 8));
+#endif
+ (void)memcpy(Buf, (void *)(ptr + Offset), Len);
+ (void)munmap((caddr_t)ptr, mlen);
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
+ "-> %02x %02x %02x %02x...\n",
+ Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
+#endif
+ return Len;
+}
+
+#ifdef USE_I386_IOPL
+/***************************************************************************/
+/* I/O Permissions section */
+/***************************************************************************/
+
+static Bool ExtendedEnabled = FALSE;
+
+Bool
+xf86EnableIO()
+{
+ if (ExtendedEnabled)
+ return TRUE;
+
+ if (i386_iopl(TRUE) < 0)
+ {
+#ifndef __OpenBSD__
+ xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O",
+ "xf86EnableIO");
+#else
+ xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O\n%s",
+ "xf86EnableIO", SYSCTL_MSG);
+#endif
+ return FALSE;
+ }
+ ExtendedEnabled = TRUE;
+
+ return TRUE;
+}
+
+void
+xf86DisableIO()
+{
+ if (!ExtendedEnabled)
+ return;
+
+ i386_iopl(FALSE);
+ ExtendedEnabled = FALSE;
+
+ return;
+}
+
+#endif /* USE_I386_IOPL */
+
+#ifdef USE_AMD64_IOPL
+/***************************************************************************/
+/* I/O Permissions section */
+/***************************************************************************/
+
+static Bool ExtendedEnabled = FALSE;
+
+Bool
+xf86EnableIO()
+{
+ if (ExtendedEnabled)
+ return TRUE;
+
+ if (amd64_iopl(TRUE) < 0)
+ {
+#ifndef __OpenBSD__
+ xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O",
+ "xf86EnableIO");
+#else
+ xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O\n%s",
+ "xf86EnableIO", SYSCTL_MSG);
+#endif
+ return FALSE;
+ }
+ ExtendedEnabled = TRUE;
+
+ return TRUE;
+}
+
+void
+xf86DisableIO()
+{
+ if (!ExtendedEnabled)
+ return;
+
+ if (amd64_iopl(FALSE) == 0) {
+ ExtendedEnabled = FALSE;
+ }
+ /* Otherwise, the X server has revoqued its root uid,
+ and thus cannot give up IO privileges any more */
+
+ return;
+}
+
+#endif /* USE_AMD64_IOPL */
+
+#ifdef USE_DEV_IO
+static int IoFd = -1;
+
+Bool
+xf86EnableIO()
+{
+ if (IoFd >= 0)
+ return TRUE;
+
+ if ((IoFd = open("/dev/io", O_RDWR)) == -1)
+ {
+ xf86Msg(X_WARNING,"xf86EnableIO: "
+ "Failed to open /dev/io for extended I/O");
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void
+xf86DisableIO()
+{
+ if (IoFd < 0)
+ return;
+
+ close(IoFd);
+ IoFd = -1;
+ return;
+}
+
+#endif
+
+#ifdef __NetBSD__
+/***************************************************************************/
+/* Set TV output mode */
+/***************************************************************************/
+void
+xf86SetTVOut(int mode)
+{
+ switch (xf86Info.consType)
+ {
+#ifdef PCCONS_SUPPORT
+ case PCCONS:{
+
+ if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_ON, &mode) < 0)
+ {
+ xf86Msg(X_WARNING,
+ "xf86SetTVOut: Could not set console to TV output, %s\n",
+ strerror(errno));
+ }
+ }
+ break;
+#endif /* PCCONS_SUPPORT */
+
+ default:
+ FatalError("Xf86SetTVOut: Unsupported console");
+ break;
+ }
+ return;
+}
+
+void
+xf86SetRGBOut()
+{
+ switch (xf86Info.consType)
+ {
+#ifdef PCCONS_SUPPORT
+ case PCCONS:{
+
+ if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_OFF, 0) < 0)
+ {
+ xf86Msg(X_WARNING,
+ "xf86SetTVOut: Could not set console to RGB output, %s\n",
+ strerror(errno));
+ }
+ }
+ break;
+#endif /* PCCONS_SUPPORT */
+
+ default:
+ FatalError("Xf86SetTVOut: Unsupported console");
+ break;
+ }
+ return;
+}
+#endif
+
+#ifdef HAS_MTRR_SUPPORT
+/* memory range (MTRR) support for FreeBSD */
+
+/*
+ * This code is experimental. Some parts may be overkill, and other parts
+ * may be incomplete.
+ */
+
+/*
+ * getAllRanges returns the full list of memory ranges with attributes set.
+ */
+
+static struct mem_range_desc *
+getAllRanges(int *nmr)
+{
+ struct mem_range_desc *mrd;
+ struct mem_range_op mro;
+
+ /*
+ * Find how many ranges there are. If this fails, then the kernel
+ * probably doesn't have MTRR support.
+ */
+ mro.mo_arg[0] = 0;
+ if (ioctl(devMemFd, MEMRANGE_GET, &mro))
+ return NULL;
+ *nmr = mro.mo_arg[0];
+ mrd = xnfalloc(*nmr * sizeof(struct mem_range_desc));
+ mro.mo_arg[0] = *nmr;
+ mro.mo_desc = mrd;
+ if (ioctl(devMemFd, MEMRANGE_GET, &mro)) {
+ free(mrd);
+ return NULL;
+ }
+ return mrd;
+}
+
+/*
+ * cleanMTRR removes any memory attribute that may be left by a previous
+ * X server. Normally there won't be any, but this takes care of the
+ * case where a server crashed without being able finish cleaning up.
+ */
+
+static Bool
+cleanMTRR()
+{
+ struct mem_range_desc *mrd;
+ struct mem_range_op mro;
+ int nmr, i;
+
+ /* This shouldn't happen */
+ if (devMemFd < 0)
+ return FALSE;
+
+ if (!(mrd = getAllRanges(&nmr)))
+ return FALSE;
+
+ for (i = 0; i < nmr; i++) {
+ if (strcmp(mrd[i].mr_owner, X_MTRR_ID) == 0 &&
+ (mrd[i].mr_flags & MDF_ACTIVE)) {
+#ifdef DEBUG
+ ErrorF("Clean for (0x%lx,0x%lx)\n",
+ (unsigned long)mrd[i].mr_base,
+ (unsigned long)mrd[i].mr_len);
+#endif
+ if (mrd[i].mr_flags & MDF_FIXACTIVE) {
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ mrd[i].mr_flags = MDF_UNCACHEABLE;
+ } else {
+ mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
+ }
+ mro.mo_desc = mrd + i;
+ ioctl(devMemFd, MEMRANGE_SET, &mro);
+ }
+ }
+#ifdef DEBUG
+ sleep(10);
+#endif
+ free(mrd);
+ return TRUE;
+}
+
+typedef struct x_RangeRec {
+ struct mem_range_desc mrd;
+ Bool wasWC;
+ struct x_RangeRec * next;
+} RangeRec, *RangePtr;
+
+static void
+freeRangeList(RangePtr range)
+{
+ RangePtr rp;
+
+ while (range) {
+ rp = range;
+ range = rp->next;
+ free(rp);
+ }
+}
+
+static RangePtr
+dupRangeList(RangePtr list)
+{
+ RangePtr new = NULL, rp, p;
+
+ rp = list;
+ while (rp) {
+ p = xnfalloc(sizeof(RangeRec));
+ *p = *rp;
+ p->next = new;
+ new = p;
+ rp = rp->next;
+ }
+ return new;
+}
+
+static RangePtr
+sortRangeList(RangePtr list)
+{
+ RangePtr rp1, rp2, copy, sorted = NULL, minp, prev, minprev;
+ unsigned long minBase;
+
+ /* Sort by base address */
+ rp1 = copy = dupRangeList(list);
+ while (rp1) {
+ minBase = rp1->mrd.mr_base;
+ minp = rp1;
+ minprev = NULL;
+ prev = rp1;
+ rp2 = rp1->next;
+ while (rp2) {
+ if (rp2->mrd.mr_base < minBase) {
+ minBase = rp2->mrd.mr_base;
+ minp = rp2;
+ minprev = prev;
+ }
+ prev = rp2;
+ rp2 = rp2->next;
+ }
+ if (minprev) {
+ minprev->next = minp->next;
+ rp1 = copy;
+ } else {
+ rp1 = minp->next;
+ }
+ minp->next = sorted;
+ sorted = minp;
+ }
+ return sorted;
+}
+
+/*
+ * findRanges returns a list of ranges that overlap the specified range.
+ */
+
+static void
+findRanges(unsigned long base, unsigned long size, RangePtr *ucp, RangePtr *wcp)
+{
+ struct mem_range_desc *mrd;
+ int nmr, i;
+ RangePtr rp, *p;
+
+ if (!(mrd = getAllRanges(&nmr)))
+ return;
+
+ for (i = 0; i < nmr; i++) {
+ if ((mrd[i].mr_flags & MDF_ACTIVE) &&
+ mrd[i].mr_base < base + size &&
+ mrd[i].mr_base + mrd[i].mr_len > base) {
+ if (mrd[i].mr_flags & MDF_WRITECOMBINE)
+ p = wcp;
+ else if (mrd[i].mr_flags & MDF_UNCACHEABLE)
+ p = ucp;
+ else
+ continue;
+ rp = xnfalloc(sizeof(RangeRec));
+ rp->mrd = mrd[i];
+ rp->next = *p;
+ *p = rp;
+ }
+ }
+ free(mrd);
+}
+
+/*
+ * This checks if the existing overlapping ranges fully cover the requested
+ * range. Is this overkill?
+ */
+
+static Bool
+fullCoverage(unsigned long base, unsigned long size, RangePtr overlap)
+{
+ RangePtr rp1, sorted = NULL;
+ unsigned long end;
+
+ sorted = sortRangeList(overlap);
+ /* Look for gaps */
+ rp1 = sorted;
+ end = base + size;
+ while (rp1) {
+ if (rp1->mrd.mr_base > base) {
+ freeRangeList(sorted);
+ return FALSE;
+ } else {
+ base = rp1->mrd.mr_base + rp1->mrd.mr_len;
+ }
+ if (base >= end) {
+ freeRangeList(sorted);
+ return TRUE;
+ }
+ rp1 = rp1->next;
+ }
+ freeRangeList(sorted);
+ return FALSE;
+}
+
+static pointer
+addWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
+{
+ RangePtr uc = NULL, wc = NULL, retlist = NULL;
+ struct mem_range_desc mrd;
+ struct mem_range_op mro;
+
+ findRanges(base, size, &uc, &wc);
+
+ /* See of the full range is already WC */
+ if (!uc && fullCoverage(base, size, wc)) {
+ xf86DrvMsg(screenNum, from,
+ "Write-combining range (0x%lx,0x%lx) was already set\n",
+ base, size);
+ return NULL;
+ }
+
+ /* Otherwise, try to add the new range */
+ mrd.mr_base = base;
+ mrd.mr_len = size;
+ strcpy(mrd.mr_owner, X_MTRR_ID);
+ mrd.mr_flags = MDF_WRITECOMBINE;
+ mro.mo_desc = &mrd;
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "Failed to set write-combining range "
+ "(0x%lx,0x%lx)\n", base, size);
+ return NULL;
+ } else {
+ xf86DrvMsg(screenNum, from,
+ "Write-combining range (0x%lx,0x%lx)\n", base, size);
+ retlist = xnfalloc(sizeof(RangeRec));
+ retlist->mrd = mrd;
+ retlist->wasWC = FALSE;
+ retlist->next = NULL;
+ return retlist;
+ }
+}
+
+static pointer
+delWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
+{
+ RangePtr uc = NULL, wc = NULL, retlist = NULL;
+ struct mem_range_desc mrd;
+ struct mem_range_op mro;
+
+ findRanges(base, size, &uc, &wc);
+
+ /*
+ * See of the full range is already not WC, or if there is full
+ * coverage from UC ranges.
+ */
+ if (!wc || fullCoverage(base, size, uc)) {
+ xf86DrvMsg(screenNum, from,
+ "Write-combining range (0x%lx,0x%lx) was already clear\n",
+ base, size);
+ return NULL;
+ }
+
+ /* Otherwise, try to add the new range */
+ mrd.mr_base = base;
+ mrd.mr_len = size;
+ strcpy(mrd.mr_owner, X_MTRR_ID);
+ mrd.mr_flags = MDF_UNCACHEABLE;
+ mro.mo_desc = &mrd;
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "Failed to remove write-combining range "
+ "(0x%lx,0x%lx)\n", base, size);
+ /* XXX Should then remove all of the overlapping WC ranges */
+ return NULL;
+ } else {
+ xf86DrvMsg(screenNum, from,
+ "Removed Write-combining range (0x%lx,0x%lx)\n",
+ base, size);
+ retlist = xnfalloc(sizeof(RangeRec));
+ retlist->mrd = mrd;
+ retlist->wasWC = TRUE;
+ retlist->next = NULL;
+ return retlist;
+ }
+}
+
+static pointer
+setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
+ MessageType from)
+{
+ if (enable)
+ return addWC(screenNum, base, size, from);
+ else
+ return delWC(screenNum, base, size, from);
+}
+
+static void
+undoWC(int screenNum, pointer list)
+{
+ RangePtr rp;
+ struct mem_range_op mro;
+ Bool failed;
+
+ rp = list;
+ while (rp) {
+#ifdef DEBUG
+ ErrorF("Undo for (0x%lx,0x%lx), %d\n",
+ (unsigned long)rp->mrd.mr_base,
+ (unsigned long)rp->mrd.mr_len, rp->wasWC);
+#endif
+ failed = FALSE;
+ if (rp->wasWC) {
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ rp->mrd.mr_flags = MDF_WRITECOMBINE;
+ strcpy(rp->mrd.mr_owner, "unknown");
+ } else {
+ mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
+ }
+ mro.mo_desc = &rp->mrd;
+
+ if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
+ if (!rp->wasWC) {
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ rp->mrd.mr_flags = MDF_UNCACHEABLE;
+ strcpy(rp->mrd.mr_owner, "unknown");
+ if (ioctl(devMemFd, MEMRANGE_SET, &mro))
+ failed = TRUE;
+ } else
+ failed = TRUE;
+ }
+ if (failed) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "Failed to restore MTRR range (0x%lx,0x%lx)\n",
+ (unsigned long)rp->mrd.mr_base,
+ (unsigned long)rp->mrd.mr_len);
+ }
+ rp = rp->next;
+ }
+}
+
+#endif /* HAS_MTRR_SUPPORT */
+
+
+#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
+static pointer
+NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
+ MessageType from)
+{
+ struct mtrr *mtrrp;
+ int n;
+
+ xf86DrvMsg(screenNum, X_WARNING,
+ "%s MTRR %lx - %lx\n", enable ? "set" : "remove",
+ base, (base + size));
+
+ mtrrp = xnfalloc(sizeof (struct mtrr));
+ mtrrp->base = base;
+ mtrrp->len = size;
+ mtrrp->type = MTRR_TYPE_WC;
+
+ /*
+ * MTRR_PRIVATE will make this MTRR get reset automatically
+ * if this process exits, so we have no need for an explicit
+ * cleanup operation when starting a new server.
+ */
+
+ if (enable)
+ mtrrp->flags = MTRR_VALID | MTRR_PRIVATE;
+ else
+ mtrrp->flags = 0;
+ n = 1;
+
+ if (i386_set_mtrr(mtrrp, &n) < 0) {
+ free(mtrrp);
+ return NULL;
+ }
+ return mtrrp;
+}
+
+static void
+NetBSDundoWC(int screenNum, pointer list)
+{
+ struct mtrr *mtrrp = (struct mtrr *)list;
+ int n;
+
+ if (mtrrp == NULL)
+ return;
+ n = 1;
+ mtrrp->flags &= ~MTRR_VALID;
+ i386_set_mtrr(mtrrp, &n);
+ free(mtrrp);
+}
+#endif
diff --git a/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c b/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c
index 7e3fcdb2c..aeaf18305 100644
--- a/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/xorg-server/hw/xfree86/os-support/bsd/ppc_video.c
@@ -73,7 +73,7 @@ volatile unsigned char *ioBase = MAP_FAILED;
static pointer
ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
{
- int fd = xf86Info.screenFd;
+ int fd = xf86Info.consoleFd;
pointer base;
#ifdef DEBUG
xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
@@ -125,7 +125,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
Bool xf86EnableIO()
{
- int fd = xf86Info.screenFd;
+ int fd = xf86Info.consoleFd;
xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd);
if (ioBase == MAP_FAILED)
diff --git a/xorg-server/hw/xfree86/os-support/bsd/sparc64_video.c b/xorg-server/hw/xfree86/os-support/bsd/sparc64_video.c
index 1dcd77711..a2a30c9d7 100644
--- a/xorg-server/hw/xfree86/os-support/bsd/sparc64_video.c
+++ b/xorg-server/hw/xfree86/os-support/bsd/sparc64_video.c
@@ -1,91 +1,91 @@
-/*
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Rich Murphey and David Wexelblat
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Rich Murphey and
- * David Wexelblat make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((caddr_t)-1)
-#endif
-
-/***************************************************************************/
-/* Video Memory Mapping section */
-/***************************************************************************/
-
-static pointer sparc64MapVidMem(int, unsigned long, unsigned long, int);
-static void sparc64UnmapVidMem(int, pointer, unsigned long);
-
-void
-xf86OSInitVidMem(VidMemInfoPtr pVidMem)
-{
- pVidMem->linearSupported = TRUE;
- pVidMem->mapMem = sparc64MapVidMem;
- pVidMem->unmapMem = sparc64UnmapVidMem;
- pVidMem->initialised = TRUE;
-}
-
-static pointer
-sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
- int flags)
-{
- int fd = xf86Info.screenFd;
- pointer base;
-
-#ifdef DEBUG
- xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
- Base, Size, fd);
-#endif
-
- base = mmap(0, Size,
- (flags & VIDMEM_READONLY) ?
- PROT_READ : (PROT_READ | PROT_WRITE),
- MAP_SHARED, fd, Base);
- if (base == MAP_FAILED)
- FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
- "xf86MapVidMem", Size, Base, strerror(errno));
- return base;
-}
-
-static void
-sparc64UnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
-{
- munmap(Base, Size);
-}
-
-int
-xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
- int Len)
-{
-
- return 0;
-}
+/*
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Rich Murphey and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Rich Murphey and
+ * David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR
+ * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+static pointer sparc64MapVidMem(int, unsigned long, unsigned long, int);
+static void sparc64UnmapVidMem(int, pointer, unsigned long);
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+ pVidMem->linearSupported = TRUE;
+ pVidMem->mapMem = sparc64MapVidMem;
+ pVidMem->unmapMem = sparc64UnmapVidMem;
+ pVidMem->initialised = TRUE;
+}
+
+static pointer
+sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
+ int flags)
+{
+ int fd = xf86Info.consoleFd;
+ pointer base;
+
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
+ Base, Size, fd);
+#endif
+
+ base = mmap(0, Size,
+ (flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_SHARED, fd, Base);
+ if (base == MAP_FAILED)
+ FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)",
+ "xf86MapVidMem", Size, Base, strerror(errno));
+ return base;
+}
+
+static void
+sparc64UnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap(Base, Size);
+}
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+
+ return 0;
+}
diff --git a/xorg-server/hw/xfree86/os-support/xf86_OSlib.h b/xorg-server/hw/xfree86/os-support/xf86_OSlib.h
index 6374ccab3..1d5906084 100644
--- a/xorg-server/hw/xfree86/os-support/xf86_OSlib.h
+++ b/xorg-server/hw/xfree86/os-support/xf86_OSlib.h
@@ -1,414 +1,394 @@
-/*
- * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1992 by David Dawes <dawes@XFree86.org>
- * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
- * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
- * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
- * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
- * Copyright 1993 by Vrije Universiteit, The Netherlands
- * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
- * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
- * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk>
- * Copyright 1994-2003 by The XFree86 Project, Inc
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of the above listed copyright holders
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. The above listed
- * copyright holders make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/*
- * The ARM32 code here carries the following copyright:
- *
- * Copyright 1997
- * Digital Equipment Corporation. All rights reserved.
- * This software is furnished under license and may be used and copied only in
- * accordance with the following terms and conditions. Subject to these
- * conditions, you may download, copy, install, use, modify and distribute
- * this software in source and/or binary form. No title or ownership is
- * transferred hereby.
- *
- * 1) Any source code used, modified or distributed must reproduce and retain
- * this copyright notice and list of conditions as they appear in the
- * source file.
- *
- * 2) No right is granted to use any trade name, trademark, or logo of Digital
- * Equipment Corporation. Neither the "Digital Equipment Corporation"
- * name nor any trademark or logo of Digital Equipment Corporation may be
- * used to endorse or promote products derived from this software without
- * the prior written permission of Digital Equipment Corporation.
- *
- * 3) This software is provided "AS-IS" and any express or implied warranties,
- * including but not limited to, any implied warranties of merchantability,
- * fitness for a particular purpose, or non-infringement are disclaimed.
- * In no event shall DIGITAL be liable for any damages whatsoever, and in
- * particular, DIGITAL shall not be liable for special, indirect,
- * consequential, or incidental damages or damages for lost profits, loss
- * of revenue or loss of use, whether such damages arise in contract,
- * negligence, tort, under statute, in equity, at law or otherwise, even
- * if advised of the possibility of such damage.
- *
- */
-
-/*
- * This is private, and should not be included by any drivers. Drivers
- * may include xf86_OSproc.h to get prototypes for public interfaces.
- */
-
-#ifndef _XF86_OSLIB_H
-#define _XF86_OSLIB_H
-
-#include <X11/Xos.h>
-#include <X11/Xfuncproto.h>
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stddef.h>
-
-/**************************************************************************/
-/* SYSV386 (SVR3, SVR4), including Solaris */
-/**************************************************************************/
-#if (defined(SYSV) || defined(SVR4)) && \
- (defined(sun) || defined(__i386__))
-# include <sys/ioctl.h>
-# include <signal.h>
-# include <termio.h>
-# include <sys/stat.h>
-# include <sys/types.h>
-
-
-# include <errno.h>
-
-# if defined(_NEED_SYSI86)
-# if !(defined (sun) && defined (SVR4))
-# include <sys/immu.h>
-# include <sys/region.h>
-# endif
-# include <sys/proc.h>
-# include <sys/tss.h>
-# include <sys/sysi86.h>
-# if defined(SVR4) && !defined(sun)
-# include <sys/seg.h>
-# endif /* SVR4 && !sun */
-/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
-# if !defined(V86SC_IOPL) /* Solaris 7 or later? */
-# include <sys/v86.h> /* Nope */
-# endif
-# if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4)
-# include <sys/psw.h>
-# endif
-# endif /* _NEED_SYSI86 */
-
-# if defined(HAS_SVR3_MMAPDRV)
-# include <sys/sysmacros.h>
-# if !defined(_NEED_SYSI86)
-# include <sys/immu.h>
-# include <sys/region.h>
-# endif
-# include <sys/mmap.h> /* MMAP driver header */
-# endif
-
-# if !defined(sun) || defined(HAVE_SYS_VT_H)
-# define HAS_USL_VTS
-# endif
-# if !defined(sun)
-# include <sys/emap.h>
-# endif
-# if defined(HAS_USL_VTS)
-# if !defined(sun)
-# include <sys/at_ansi.h>
-# endif
-# include <sys/kd.h>
-# include <sys/vt.h>
-# endif
-
-# if defined(sun)
-# include <sys/fbio.h>
-# include <sys/kbd.h>
-# include <sys/kbio.h>
-
-/* undefine symbols from <sys/kbd.h> we don't need that conflict with enum
- definitions in parser/xf86tokens.h */
-# undef STRING
-# undef LEFTALT
-# undef RIGHTALT
-
-# define LED_CAP LED_CAPS_LOCK
-# define LED_NUM LED_NUM_LOCK
-# define LED_SCR LED_SCROLL_LOCK
-# define LED_COMP LED_COMPOSE
-# endif /* sun */
-
-# if !defined(VT_ACKACQ)
-# define VT_ACKACQ 2
-# endif /* !VT_ACKACQ */
-
-
-# if defined(SVR4)
-# include <sys/mman.h>
-# if !(defined(sun) && defined (SVR4))
-# define DEV_MEM "/dev/pmem"
-# endif
-# define CLEARDTR_SUPPORT
-# define POSIX_TTY
-# endif /* SVR4 */
-
-
-# if defined(sun) && defined(HAS_USL_VTS)
-# define USE_VT_SYSREQ
-# endif
-
-#endif /* (SYSV || SVR4) */
-
-/**************************************************************************/
-/* Linux or Glibc-based system */
-/**************************************************************************/
-#if defined(__linux__) || defined(__GLIBC__)
-# include <sys/ioctl.h>
-# include <signal.h>
-# include <stdlib.h>
-# include <sys/types.h>
-# include <assert.h>
-
-# ifdef __linux__
-# include <termio.h>
-# else /* __GLIBC__ */
-# include <termios.h>
-# endif
-# ifdef __sparc__
-# include <sys/param.h>
-# endif
-
-# include <errno.h>
-
-# include <sys/stat.h>
-
-# include <sys/mman.h>
-# ifdef __linux__
-# define HAS_USL_VTS
-# include <sys/kd.h>
-# include <sys/vt.h>
-# define LDGMAP GIO_SCRNMAP
-# define LDSMAP PIO_SCRNMAP
-# define LDNMAP LDSMAP
-# define CLEARDTR_SUPPORT
-# define USE_VT_SYSREQ
-# endif
-
-# define POSIX_TTY
-
-#endif /* __linux__ || __GLIBC__ */
-
-/**************************************************************************/
-/* 386BSD and derivatives, BSD/386 */
-/**************************************************************************/
-
-#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
-# undef __386BSD__
-#endif
-
-#ifdef CSRG_BASED
-# include <sys/ioctl.h>
-# include <signal.h>
-
-# include <termios.h>
-# define termio termios
-# define POSIX_TTY
-
-# include <errno.h>
-
-# include <sys/types.h>
-# include <sys/mman.h>
-# include <sys/stat.h>
-
-# if defined(__bsdi__)
-# include <sys/param.h>
-# if (_BSDI_VERSION < 199510)
-# include <i386/isa/vgaioctl.h>
-# endif
-# endif /* __bsdi__ */
-
-#endif /* CSRG_BASED */
-
-/**************************************************************************/
-/* Kernel of *BSD */
-/**************************************************************************/
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
- defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
-
-# include <sys/param.h>
-# if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
-# define __FreeBSD_kernel_version __FreeBSD_version
-# endif
-
-# if !defined(LINKKIT)
- /* Don't need this stuff for the Link Kit */
-# if defined(__bsdi__)
-# include <i386/isa/pcconsioctl.h>
-# define CONSOLE_X_MODE_ON PCCONIOCRAW
-# define CONSOLE_X_MODE_OFF PCCONIOCCOOK
-# define CONSOLE_X_BELL PCCONIOCBEEP
-# else /* __bsdi__ */
-# ifdef SYSCONS_SUPPORT
-# define COMPAT_SYSCONS
-# if defined(__NetBSD__) || defined(__OpenBSD__)
-# include <machine/console.h>
-# else
-# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-# if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
-# include <sys/consio.h>
-# include <sys/kbio.h>
-# else
-# include <machine/console.h>
-# endif /* FreeBSD 4.1 RELEASE or lator */
-# else
-# include <sys/console.h>
-# endif
-# endif
-# endif /* SYSCONS_SUPPORT */
-# if defined(PCVT_SUPPORT)
-# if !defined(SYSCONS_SUPPORT)
- /* no syscons, so include pcvt specific header file */
-# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-# include <machine/pcvt_ioctl.h>
-# else
-# if defined(__NetBSD__) || defined(__OpenBSD__)
-# if !defined(WSCONS_SUPPORT)
-# include <machine/pcvt_ioctl.h>
-# endif /* WSCONS_SUPPORT */
-# else
-# include <sys/pcvt_ioctl.h>
-# endif /* __NetBSD__ */
-# endif /* __FreeBSD_kernel__ || __OpenBSD__ */
-# else /* pcvt and syscons: hard-code the ID magic */
-# define VGAPCVTID _IOWR('V',113, struct pcvtid)
- struct pcvtid {
- char name[16];
- int rmajor, rminor;
- };
-# endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
-# endif /* PCVT_SUPPORT */
-# ifdef WSCONS_SUPPORT
-# include <dev/wscons/wsconsio.h>
-# include <dev/wscons/wsdisplay_usl_io.h>
-# endif /* WSCONS_SUPPORT */
-# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
-# if defined(__FreeBSD_kernel_version) && (__FreeBSD_kernel_version >= 500013)
-# include <sys/mouse.h>
-# else
-# undef MOUSE_GETINFO
-# include <machine/mouse.h>
-# endif
-# endif
- /* Include these definitions in case ioctl_pc.h didn't get included */
-# ifndef CONSOLE_X_MODE_ON
-# define CONSOLE_X_MODE_ON _IO('t',121)
-# endif
-# ifndef CONSOLE_X_MODE_OFF
-# define CONSOLE_X_MODE_OFF _IO('t',122)
-# endif
-# ifndef CONSOLE_X_BELL
-# define CONSOLE_X_BELL _IOW('t',123,int[2])
-# endif
-# ifndef CONSOLE_X_TV_ON
-# define CONSOLE_X_TV_ON _IOW('t',155,int)
-# define XMODE_RGB 0
-# define XMODE_NTSC 1
-# define XMODE_PAL 2
-# define XMODE_SECAM 3
-# endif
-# ifndef CONSOLE_X_TV_OFF
-# define CONSOLE_X_TV_OFF _IO('t',156)
-# endif
-#ifndef CONSOLE_GET_LINEAR_INFO
-# define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
-#endif
-#ifndef CONSOLE_GET_IO_INFO
-# define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
-#endif
-#ifndef CONSOLE_GET_MEM_INFO
-# define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
-#endif
-# endif /* __bsdi__ */
-# endif /* !LINKKIT */
-
-#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
-#include <machine/sysarch.h>
-#endif
-
-# define CLEARDTR_SUPPORT
-
-# if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
-# define USE_VT_SYSREQ
-# endif
-
-#endif
-/* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */
-
-/**************************************************************************/
-/* IRIX */
-/**************************************************************************/
-
-/**************************************************************************/
-/* Generic */
-/**************************************************************************/
-
-#include <sys/wait.h> /* May need to adjust this for other OSs */
-
-/* For PATH_MAX */
-#include "misc.h"
-
-/*
- * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
- * and it's safe, so just do it.
- */
-#if !defined(O_NDELAY) && defined(O_NONBLOCK)
-# define O_NDELAY O_NONBLOCK
-#endif /* !O_NDELAY && O_NONBLOCK */
-
-#if !defined(MAXHOSTNAMELEN)
-# define MAXHOSTNAMELEN 32
-#endif /* !MAXHOSTNAMELEN */
-
-#if defined(_POSIX_SOURCE)
-# include <limits.h>
-#else
-# define _POSIX_SOURCE
-# include <limits.h>
-# undef _POSIX_SOURCE
-#endif /* _POSIX_SOURCE */
-
-
-#ifndef DEV_MEM
-#define DEV_MEM "/dev/mem"
-#endif
-
-#ifndef VT_SYSREQ_DEFAULT
-#define VT_SYSREQ_DEFAULT FALSE
-#endif
-
-#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
-
-#define XF86_OS_PRIVS
-#include "xf86_OSproc.h"
-
-#ifndef NO_COMPILER_H
-#include "compiler.h"
-#endif
-
-#endif /* _XF86_OSLIB_H */
+/*
+ * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1992 by David Dawes <dawes@XFree86.org>
+ * Copyright 1992 by Jim Tsillas <jtsilla@damon.ccs.northeastern.edu>
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1992 by Robert Baron <Robert.Baron@ernst.mach.cs.cmu.edu>
+ * Copyright 1992 by Orest Zborowski <obz@eskimo.com>
+ * Copyright 1993 by Vrije Universiteit, The Netherlands
+ * Copyright 1993 by David Wexelblat <dwex@XFree86.org>
+ * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de>
+ * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk>
+ * Copyright 1994-2003 by The XFree86 Project, Inc
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of the above listed copyright holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holders make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+/*
+ * The ARM32 code here carries the following copyright:
+ *
+ * Copyright 1997
+ * Digital Equipment Corporation. All rights reserved.
+ * This software is furnished under license and may be used and copied only in
+ * accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * this software in source and/or binary form. No title or ownership is
+ * transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and retain
+ * this copyright notice and list of conditions as they appear in the
+ * source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of Digital
+ * Equipment Corporation. Neither the "Digital Equipment Corporation"
+ * name nor any trademark or logo of Digital Equipment Corporation may be
+ * used to endorse or promote products derived from this software without
+ * the prior written permission of Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied warranties,
+ * including but not limited to, any implied warranties of merchantability,
+ * fitness for a particular purpose, or non-infringement are disclaimed.
+ * In no event shall DIGITAL be liable for any damages whatsoever, and in
+ * particular, DIGITAL shall not be liable for special, indirect,
+ * consequential, or incidental damages or damages for lost profits, loss
+ * of revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise, even
+ * if advised of the possibility of such damage.
+ *
+ */
+
+/*
+ * This is private, and should not be included by any drivers. Drivers
+ * may include xf86_OSproc.h to get prototypes for public interfaces.
+ */
+
+#ifndef _XF86_OSLIB_H
+#define _XF86_OSLIB_H
+
+#include <X11/Xos.h>
+#include <X11/Xfuncproto.h>
+
+#include <stdio.h>
+#include <ctype.h>
+#include <stddef.h>
+
+/**************************************************************************/
+/* SYSV386 (SVR3, SVR4), including Solaris */
+/**************************************************************************/
+#if (defined(SYSV) || defined(SVR4)) && \
+ (defined(sun) || defined(__i386__))
+# include <sys/ioctl.h>
+# include <signal.h>
+# include <termio.h>
+# include <sys/stat.h>
+# include <sys/types.h>
+
+
+# include <errno.h>
+
+# if defined(_NEED_SYSI86)
+# if !(defined (sun) && defined (SVR4))
+# include <sys/immu.h>
+# include <sys/region.h>
+# endif
+# include <sys/proc.h>
+# include <sys/tss.h>
+# include <sys/sysi86.h>
+# if defined(SVR4) && !defined(sun)
+# include <sys/seg.h>
+# endif /* SVR4 && !sun */
+/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
+# if !defined(V86SC_IOPL) /* Solaris 7 or later? */
+# include <sys/v86.h> /* Nope */
+# endif
+# if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4)
+# include <sys/psw.h>
+# endif
+# endif /* _NEED_SYSI86 */
+
+# if defined(HAS_SVR3_MMAPDRV)
+# include <sys/sysmacros.h>
+# if !defined(_NEED_SYSI86)
+# include <sys/immu.h>
+# include <sys/region.h>
+# endif
+# include <sys/mmap.h> /* MMAP driver header */
+# endif
+
+# if !defined(sun) || defined(HAVE_SYS_VT_H)
+# define HAS_USL_VTS
+# endif
+# if !defined(sun)
+# include <sys/emap.h>
+# endif
+# if defined(HAS_USL_VTS)
+# if !defined(sun)
+# include <sys/at_ansi.h>
+# endif
+# include <sys/kd.h>
+# include <sys/vt.h>
+# endif
+
+# if defined(sun)
+# include <sys/fbio.h>
+# include <sys/kbd.h>
+# include <sys/kbio.h>
+
+/* undefine symbols from <sys/kbd.h> we don't need that conflict with enum
+ definitions in parser/xf86tokens.h */
+# undef STRING
+# undef LEFTALT
+# undef RIGHTALT
+
+# define LED_CAP LED_CAPS_LOCK
+# define LED_NUM LED_NUM_LOCK
+# define LED_SCR LED_SCROLL_LOCK
+# define LED_COMP LED_COMPOSE
+# endif /* sun */
+
+# if !defined(VT_ACKACQ)
+# define VT_ACKACQ 2
+# endif /* !VT_ACKACQ */
+
+
+# if defined(SVR4)
+# include <sys/mman.h>
+# if !(defined(sun) && defined (SVR4))
+# define DEV_MEM "/dev/pmem"
+# endif
+# define CLEARDTR_SUPPORT
+# define POSIX_TTY
+# endif /* SVR4 */
+
+#endif /* (SYSV || SVR4) */
+
+/**************************************************************************/
+/* Linux or Glibc-based system */
+/**************************************************************************/
+#if defined(__linux__) || defined(__GLIBC__)
+# include <sys/ioctl.h>
+# include <signal.h>
+# include <stdlib.h>
+# include <sys/types.h>
+# include <assert.h>
+
+# ifdef __linux__
+# include <termio.h>
+# else /* __GLIBC__ */
+# include <termios.h>
+# endif
+# ifdef __sparc__
+# include <sys/param.h>
+# endif
+
+# include <errno.h>
+
+# include <sys/stat.h>
+
+# include <sys/mman.h>
+# ifdef __linux__
+# define HAS_USL_VTS
+# include <sys/kd.h>
+# include <sys/vt.h>
+# define LDGMAP GIO_SCRNMAP
+# define LDSMAP PIO_SCRNMAP
+# define LDNMAP LDSMAP
+# define CLEARDTR_SUPPORT
+# endif
+
+# define POSIX_TTY
+
+#endif /* __linux__ || __GLIBC__ */
+
+/**************************************************************************/
+/* 386BSD and derivatives, BSD/386 */
+/**************************************************************************/
+
+#if defined(__386BSD__) && (defined(__FreeBSD__) || defined(__NetBSD__))
+# undef __386BSD__
+#endif
+
+#ifdef CSRG_BASED
+# include <sys/ioctl.h>
+# include <signal.h>
+
+# include <termios.h>
+# define termio termios
+# define POSIX_TTY
+
+# include <errno.h>
+
+# include <sys/types.h>
+# include <sys/mman.h>
+# include <sys/stat.h>
+
+# if defined(__bsdi__)
+# include <sys/param.h>
+# if (_BSDI_VERSION < 199510)
+# include <i386/isa/vgaioctl.h>
+# endif
+# endif /* __bsdi__ */
+
+#endif /* CSRG_BASED */
+
+/**************************************************************************/
+/* Kernel of *BSD */
+/**************************************************************************/
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+ defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
+
+# include <sys/param.h>
+# if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
+# define __FreeBSD_kernel_version __FreeBSD_version
+# endif
+
+# if !defined(LINKKIT)
+ /* Don't need this stuff for the Link Kit */
+# if defined(__bsdi__)
+# include <i386/isa/pcconsioctl.h>
+# define CONSOLE_X_MODE_ON PCCONIOCRAW
+# define CONSOLE_X_MODE_OFF PCCONIOCCOOK
+# define CONSOLE_X_BELL PCCONIOCBEEP
+# else /* __bsdi__ */
+# ifdef SYSCONS_SUPPORT
+# define COMPAT_SYSCONS
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+# if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
+# include <sys/consio.h>
+# include <sys/kbio.h>
+# else
+# include <machine/console.h>
+# endif /* FreeBSD 4.1 RELEASE or lator */
+# else
+# include <sys/console.h>
+# endif
+# endif /* SYSCONS_SUPPORT */
+# if defined(PCVT_SUPPORT) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+# if !defined(SYSCONS_SUPPORT)
+ /* no syscons, so include pcvt specific header file */
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+# include <machine/pcvt_ioctl.h>
+# else
+# include <sys/pcvt_ioctl.h>
+# endif /* __FreeBSD_kernel__ */
+# else /* pcvt and syscons: hard-code the ID magic */
+# define VGAPCVTID _IOWR('V',113, struct pcvtid)
+ struct pcvtid {
+ char name[16];
+ int rmajor, rminor;
+ };
+# endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
+# endif /* PCVT_SUPPORT */
+# ifdef WSCONS_SUPPORT
+# include <dev/wscons/wsconsio.h>
+# include <dev/wscons/wsdisplay_usl_io.h>
+# endif /* WSCONS_SUPPORT */
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+# if defined(__FreeBSD_kernel_version) && (__FreeBSD_kernel_version >= 500013)
+# include <sys/mouse.h>
+# else
+# undef MOUSE_GETINFO
+# include <machine/mouse.h>
+# endif
+# endif
+ /* Include these definitions in case ioctl_pc.h didn't get included */
+# ifndef CONSOLE_X_MODE_ON
+# define CONSOLE_X_MODE_ON _IO('t',121)
+# endif
+# ifndef CONSOLE_X_MODE_OFF
+# define CONSOLE_X_MODE_OFF _IO('t',122)
+# endif
+# ifndef CONSOLE_X_BELL
+# define CONSOLE_X_BELL _IOW('t',123,int[2])
+# endif
+# ifndef CONSOLE_X_TV_ON
+# define CONSOLE_X_TV_ON _IOW('t',155,int)
+# define XMODE_RGB 0
+# define XMODE_NTSC 1
+# define XMODE_PAL 2
+# define XMODE_SECAM 3
+# endif
+# ifndef CONSOLE_X_TV_OFF
+# define CONSOLE_X_TV_OFF _IO('t',156)
+# endif
+#ifndef CONSOLE_GET_LINEAR_INFO
+# define CONSOLE_GET_LINEAR_INFO _IOR('t',157,struct map_info)
+#endif
+#ifndef CONSOLE_GET_IO_INFO
+# define CONSOLE_GET_IO_INFO _IOR('t',158,struct map_info)
+#endif
+#ifndef CONSOLE_GET_MEM_INFO
+# define CONSOLE_GET_MEM_INFO _IOR('t',159,struct map_info)
+#endif
+# endif /* __bsdi__ */
+# endif /* !LINKKIT */
+
+#if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
+#include <machine/sysarch.h>
+#endif
+
+# define CLEARDTR_SUPPORT
+
+#endif
+/* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */
+
+/**************************************************************************/
+/* IRIX */
+/**************************************************************************/
+
+/**************************************************************************/
+/* Generic */
+/**************************************************************************/
+
+#include <sys/wait.h> /* May need to adjust this for other OSs */
+
+/* For PATH_MAX */
+#include "misc.h"
+
+/*
+ * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
+ * and it's safe, so just do it.
+ */
+#if !defined(O_NDELAY) && defined(O_NONBLOCK)
+# define O_NDELAY O_NONBLOCK
+#endif /* !O_NDELAY && O_NONBLOCK */
+
+#if !defined(MAXHOSTNAMELEN)
+# define MAXHOSTNAMELEN 32
+#endif /* !MAXHOSTNAMELEN */
+
+#if defined(_POSIX_SOURCE)
+# include <limits.h>
+#else
+# define _POSIX_SOURCE
+# include <limits.h>
+# undef _POSIX_SOURCE
+#endif /* _POSIX_SOURCE */
+
+
+#ifndef DEV_MEM
+#define DEV_MEM "/dev/mem"
+#endif
+
+#ifndef VT_SYSREQ_DEFAULT
+#define VT_SYSREQ_DEFAULT FALSE
+#endif
+
+#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
+
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+
+#ifndef NO_COMPILER_H
+#include "compiler.h"
+#endif
+
+#endif /* _XF86_OSLIB_H */
diff --git a/xorg-server/hw/xfree86/parser/xf86tokens.h b/xorg-server/hw/xfree86/parser/xf86tokens.h
index abcafcf8e..a9856064e 100644
--- a/xorg-server/hw/xfree86/parser/xf86tokens.h
+++ b/xorg-server/hw/xfree86/parser/xf86tokens.h
@@ -207,8 +207,6 @@ typedef enum {
XKBLAYOUT,
XKBVARIANT,
XKBOPTIONS,
- /* The next two have become ServerFlags options */
- VTSYSREQ,
/* Obsolete keyboard tokens */
SERVERNUM,
LEFTALT,
diff --git a/xorg-server/hw/xquartz/X11Application.m b/xorg-server/hw/xquartz/X11Application.m
index 7fd7dab3c..12ff53c88 100644
--- a/xorg-server/hw/xquartz/X11Application.m
+++ b/xorg-server/hw/xquartz/X11Application.m
@@ -356,7 +356,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
*/
_appFlags._active = YES;
- X11ApplicationSetFrontProcess();
+ [self set_front_process:nil];
/* Get the Spaces preference for SwitchOnActivate */
(void)CFPreferencesAppSynchronize(CFSTR("com.apple.dock"));
diff --git a/xorg-server/hw/xquartz/pbproxy/Makefile.am b/xorg-server/hw/xquartz/pbproxy/Makefile.am
index b8b95d232..1b14dffce 100644
--- a/xorg-server/hw/xquartz/pbproxy/Makefile.am
+++ b/xorg-server/hw/xquartz/pbproxy/Makefile.am
@@ -2,6 +2,7 @@ AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Framework
-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\"
AM_CFLAGS=$(XPBPROXY_CFLAGS)
+AM_OBJCFLAGS=$(XPBPROXY_CFLAGS)
noinst_LTLIBRARIES = libxpbproxy.la
libxpbproxy_la_SOURCES = \
diff --git a/xorg-server/include/dix-config.h.in b/xorg-server/include/dix-config.h.in
index 5facb1106..7d6cb966c 100644
--- a/xorg-server/include/dix-config.h.in
+++ b/xorg-server/include/dix-config.h.in
@@ -178,9 +178,6 @@
/* Define to 1 if you have the `shmctl64' function. */
#undef HAVE_SHMCTL64
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@@ -402,6 +399,12 @@
/* Use libudev for input hotplug */
#undef CONFIG_UDEV
+/* Use udev_monitor_filter_add_match_tag() */
+#undef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
+
+/* Use udev_enumerate_add_match_tag() */
+#undef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
+
/* Use D-Bus for input hotplug */
#undef CONFIG_NEED_DBUS
diff --git a/xorg-server/include/eventstr.h b/xorg-server/include/eventstr.h
index 049688ca0..2de077fd2 100644
--- a/xorg-server/include/eventstr.h
+++ b/xorg-server/include/eventstr.h
@@ -95,8 +95,7 @@ struct _DeviceEvent
struct {
uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
uint8_t mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/
- int32_t data[MAX_VALUATORS]; /**< Valuator data */
- int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */
+ double data[MAX_VALUATORS]; /**< Valuator data */
} valuators;
struct {
uint32_t base; /**< XKB base modifiers */
@@ -113,6 +112,7 @@ struct _DeviceEvent
Window root; /**< Root window of the event */
int corestate; /**< Core key/button state BEFORE the event */
int key_repeat; /**< Internally-generated key repeat event */
+ uint32_t flags; /**< Flags to be copied into the generated event */
};
@@ -198,11 +198,10 @@ struct _RawDeviceEvent
} detail;
struct {
uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
- int32_t data[MAX_VALUATORS]; /**< Valuator data */
- int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */
- int32_t data_raw[MAX_VALUATORS]; /**< Valuator data as posted */
- int32_t data_raw_frac[MAX_VALUATORS];/**< Fractional part for data_raw */
+ double data[MAX_VALUATORS]; /**< Valuator data */
+ double data_raw[MAX_VALUATORS]; /**< Valuator data as posted */
} valuators;
+ uint32_t flags; /**< Flags to be copied into the generated event */
};
#ifdef XQUARTZ
diff --git a/xorg-server/include/exevents.h b/xorg-server/include/exevents.h
index 6e5804080..4fe6c61a9 100644
--- a/xorg-server/include/exevents.h
+++ b/xorg-server/include/exevents.h
@@ -1,312 +1,335 @@
-/************************************************************
-
-Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of the above listed
-copyright holder(s) not be used in advertising or publicity pertaining
-to distribution of the software without specific, written prior
-permission.
-
-THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
-TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
-/********************************************************************
- * Interface of 'exevents.c'
- */
-
-#ifndef EXEVENTS_H
-#define EXEVENTS_H
-
-#include <X11/extensions/XIproto.h>
-#include "inputstr.h"
-
-/***************************************************************
- * Interface available to drivers *
- ***************************************************************/
-
-extern _X_EXPORT int InitProximityClassDeviceStruct(
- DeviceIntPtr /* dev */);
-
-extern _X_EXPORT void InitValuatorAxisStruct(
- DeviceIntPtr /* dev */,
- int /* axnum */,
- Atom /* label */,
- int /* minval */,
- int /* maxval */,
- int /* resolution */,
- int /* min_res */,
- int /* max_res */,
- int /* mode */);
-
-/* Input device properties */
-extern _X_EXPORT void XIDeleteAllDeviceProperties(
- DeviceIntPtr /* device */
-);
-
-extern _X_EXPORT int XIDeleteDeviceProperty(
- DeviceIntPtr /* device */,
- Atom /* property */,
- Bool /* fromClient */
-);
-
-extern _X_EXPORT int XIChangeDeviceProperty(
- DeviceIntPtr /* dev */,
- Atom /* property */,
- Atom /* type */,
- int /* format*/,
- int /* mode*/,
- unsigned long /* len*/,
- const pointer /* value*/,
- Bool /* sendevent*/
- );
-
-extern _X_EXPORT int XIGetDeviceProperty(
- DeviceIntPtr /* dev */,
- Atom /* property */,
- XIPropertyValuePtr* /* value */
-);
-
-extern _X_EXPORT int XISetDevicePropertyDeletable(
- DeviceIntPtr /* dev */,
- Atom /* property */,
- Bool /* deletable */
-);
-
-extern _X_EXPORT long XIRegisterPropertyHandler(
- DeviceIntPtr dev,
- int (*SetProperty) (DeviceIntPtr dev,
- Atom property,
- XIPropertyValuePtr prop,
- BOOL checkonly),
- int (*GetProperty) (DeviceIntPtr dev,
- Atom property),
- int (*DeleteProperty) (DeviceIntPtr dev,
- Atom property)
-);
-
-extern _X_EXPORT void XIUnregisterPropertyHandler(
- DeviceIntPtr dev,
- long id
-);
-
-extern _X_EXPORT Atom XIGetKnownProperty(
- char* name
-);
-
-extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
-
-extern _X_EXPORT int XIPropToInt(
- XIPropertyValuePtr val,
- int *nelem_return,
- int **buf_return
-);
-
-extern _X_EXPORT int XIPropToFloat(
- XIPropertyValuePtr val,
- int *nelem_return,
- float **buf_return
-);
-
-/****************************************************************************
- * End of driver interface *
- ****************************************************************************/
-
-
-/**
- * Attached to the devPrivates of each client. Specifies the version number as
- * supported by the client.
- */
-typedef struct _XIClientRec {
- int major_version;
- int minor_version;
-} XIClientRec, *XIClientPtr;
-
-
-typedef struct _GrabParameters {
- int grabtype; /* GRABTYPE_CORE, etc. */
- unsigned int ownerEvents;
- unsigned int this_device_mode;
- unsigned int other_devices_mode;
- Window grabWindow;
- Window confineTo;
- Cursor cursor;
- unsigned int modifiers;
-} GrabParameters;
-
-
-extern int
-UpdateDeviceState (
- DeviceIntPtr /* device */,
- DeviceEvent* /* xE */);
-
-extern void
-ProcessOtherEvent (
- InternalEvent* /* ev */,
- DeviceIntPtr /* other */);
-
-extern void
-DeviceFocusEvent(
- DeviceIntPtr /* dev */,
- int /* type */,
- int /* mode */,
- int /* detail */,
- WindowPtr /* pWin */);
-
-extern int
-CheckGrabValues(
- ClientPtr /* client */,
- GrabParameters* /* param */);
-
-extern int
-GrabButton(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- DeviceIntPtr /* modifier_device */,
- int /* button */,
- GrabParameters* /* param */,
- GrabType /* grabtype */,
- GrabMask* /* eventMask */);
-
-extern int
-GrabKey(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- DeviceIntPtr /* modifier_device */,
- int /* key */,
- GrabParameters* /* param */,
- GrabType /* grabtype */,
- GrabMask* /* eventMask */);
-
-extern int
-GrabWindow(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- int /* type */,
- GrabParameters* /* param */,
- GrabMask* /* eventMask */);
-
-extern int
-SelectForWindow(
- DeviceIntPtr /* dev */,
- WindowPtr /* pWin */,
- ClientPtr /* client */,
- Mask /* mask */,
- Mask /* exclusivemasks */);
-
-extern int
-AddExtensionClient (
- WindowPtr /* pWin */,
- ClientPtr /* client */,
- Mask /* mask */,
- int /* mskidx */);
-
-extern void
-RecalculateDeviceDeliverableEvents(
- WindowPtr /* pWin */);
-
-extern int
-InputClientGone(
- WindowPtr /* pWin */,
- XID /* id */);
-
-extern int
-SendEvent (
- ClientPtr /* client */,
- DeviceIntPtr /* d */,
- Window /* dest */,
- Bool /* propagate */,
- xEvent * /* ev */,
- Mask /* mask */,
- int /* count */);
-
-extern int
-SetButtonMapping (
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- int /* nElts */,
- BYTE * /* map */);
-
-extern int
-ChangeKeyMapping(
- ClientPtr /* client */,
- DeviceIntPtr /* dev */,
- unsigned /* len */,
- int /* type */,
- KeyCode /* firstKeyCode */,
- CARD8 /* keyCodes */,
- CARD8 /* keySymsPerKeyCode */,
- KeySym * /* map */);
-
-extern void
-DeleteWindowFromAnyExtEvents(
- WindowPtr /* pWin */,
- Bool /* freeResources */);
-
-extern int
-MaybeSendDeviceMotionNotifyHint (
- deviceKeyButtonPointer * /* pEvents */,
- Mask /* mask */);
-
-extern void
-CheckDeviceGrabAndHintWindow (
- WindowPtr /* pWin */,
- int /* type */,
- deviceKeyButtonPointer * /* xE */,
- GrabPtr /* grab */,
- ClientPtr /* client */,
- Mask /* deliveryMask */);
-
-extern void
-MaybeStopDeviceHint(
- DeviceIntPtr /* dev */,
- ClientPtr /* client */);
-
-extern int
-DeviceEventSuppressForWindow(
- WindowPtr /* pWin */,
- ClientPtr /* client */,
- Mask /* mask */,
- int /* maskndx */);
-
-extern void
-SendEventToAllWindows(
- DeviceIntPtr /* dev */,
- Mask /* mask */,
- xEvent * /* ev */,
- int /* count */);
-
-extern _X_HIDDEN void XI2EventSwap(
- xGenericEvent * /* from */,
- xGenericEvent * /* to */);
-
-/* For an event such as MappingNotify which affects client interpretation
- * of input events sent by device dev, should we notify the client, or
- * would it merely be irrelevant and confusing? */
-extern int
-XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
-
-extern void
-XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master,
- DeviceChangedEvent *dce);
-
-extern int
-XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
- unsigned int len, unsigned char* mask);
-
-extern int
-XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len);
-
-#endif /* EXEVENTS_H */
+/************************************************************
+
+Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of the above listed
+copyright holder(s) not be used in advertising or publicity pertaining
+to distribution of the software without specific, written prior
+permission.
+
+THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
+TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
+LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+/********************************************************************
+ * Interface of 'exevents.c'
+ */
+
+#ifndef EXEVENTS_H
+#define EXEVENTS_H
+
+#include <X11/extensions/XIproto.h>
+#include "inputstr.h"
+
+/***************************************************************
+ * Interface available to drivers *
+ ***************************************************************/
+
+/**
+ * Scroll flags for ::SetScrollValuator.
+ */
+enum ScrollFlags {
+ SCROLL_FLAG_NONE = 0,
+ /**
+ * Do not emulate legacy button events for valuator events on this axis.
+ */
+ SCROLL_FLAG_DONT_EMULATE = (1 << 1),
+ /**
+ * This axis is the preferred axis for valuator emulation for this axis'
+ * scroll type.
+ */
+ SCROLL_FLAG_PREFERRED = (1 << 2)
+};
+
+extern _X_EXPORT int InitProximityClassDeviceStruct(
+ DeviceIntPtr /* dev */);
+
+extern _X_EXPORT Bool InitValuatorAxisStruct(
+ DeviceIntPtr /* dev */,
+ int /* axnum */,
+ Atom /* label */,
+ int /* minval */,
+ int /* maxval */,
+ int /* resolution */,
+ int /* min_res */,
+ int /* max_res */,
+ int /* mode */);
+
+extern _X_EXPORT Bool SetScrollValuator(
+ DeviceIntPtr /* dev */,
+ int /* axnum */,
+ enum ScrollType /* type */,
+ double /* increment */,
+ int /* flags */);
+
+/* Input device properties */
+extern _X_EXPORT void XIDeleteAllDeviceProperties(
+ DeviceIntPtr /* device */
+);
+
+extern _X_EXPORT int XIDeleteDeviceProperty(
+ DeviceIntPtr /* device */,
+ Atom /* property */,
+ Bool /* fromClient */
+);
+
+extern _X_EXPORT int XIChangeDeviceProperty(
+ DeviceIntPtr /* dev */,
+ Atom /* property */,
+ Atom /* type */,
+ int /* format*/,
+ int /* mode*/,
+ unsigned long /* len*/,
+ const pointer /* value*/,
+ Bool /* sendevent*/
+ );
+
+extern _X_EXPORT int XIGetDeviceProperty(
+ DeviceIntPtr /* dev */,
+ Atom /* property */,
+ XIPropertyValuePtr* /* value */
+);
+
+extern _X_EXPORT int XISetDevicePropertyDeletable(
+ DeviceIntPtr /* dev */,
+ Atom /* property */,
+ Bool /* deletable */
+);
+
+extern _X_EXPORT long XIRegisterPropertyHandler(
+ DeviceIntPtr dev,
+ int (*SetProperty) (DeviceIntPtr dev,
+ Atom property,
+ XIPropertyValuePtr prop,
+ BOOL checkonly),
+ int (*GetProperty) (DeviceIntPtr dev,
+ Atom property),
+ int (*DeleteProperty) (DeviceIntPtr dev,
+ Atom property)
+);
+
+extern _X_EXPORT void XIUnregisterPropertyHandler(
+ DeviceIntPtr dev,
+ long id
+);
+
+extern _X_EXPORT Atom XIGetKnownProperty(
+ char* name
+);
+
+extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
+
+extern _X_EXPORT int XIPropToInt(
+ XIPropertyValuePtr val,
+ int *nelem_return,
+ int **buf_return
+);
+
+extern _X_EXPORT int XIPropToFloat(
+ XIPropertyValuePtr val,
+ int *nelem_return,
+ float **buf_return
+);
+
+/****************************************************************************
+ * End of driver interface *
+ ****************************************************************************/
+
+
+/**
+ * Attached to the devPrivates of each client. Specifies the version number as
+ * supported by the client.
+ */
+typedef struct _XIClientRec {
+ int major_version;
+ int minor_version;
+} XIClientRec, *XIClientPtr;
+
+
+typedef struct _GrabParameters {
+ int grabtype; /* GRABTYPE_CORE, etc. */
+ unsigned int ownerEvents;
+ unsigned int this_device_mode;
+ unsigned int other_devices_mode;
+ Window grabWindow;
+ Window confineTo;
+ Cursor cursor;
+ unsigned int modifiers;
+} GrabParameters;
+
+
+extern int
+UpdateDeviceState (
+ DeviceIntPtr /* device */,
+ DeviceEvent* /* xE */);
+
+extern void
+ProcessOtherEvent (
+ InternalEvent* /* ev */,
+ DeviceIntPtr /* other */);
+
+extern void
+DeviceFocusEvent(
+ DeviceIntPtr /* dev */,
+ int /* type */,
+ int /* mode */,
+ int /* detail */,
+ WindowPtr /* pWin */);
+
+extern int
+CheckGrabValues(
+ ClientPtr /* client */,
+ GrabParameters* /* param */);
+
+extern int
+GrabButton(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* modifier_device */,
+ int /* button */,
+ GrabParameters* /* param */,
+ GrabType /* grabtype */,
+ GrabMask* /* eventMask */);
+
+extern int
+GrabKey(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* modifier_device */,
+ int /* key */,
+ GrabParameters* /* param */,
+ GrabType /* grabtype */,
+ GrabMask* /* eventMask */);
+
+extern int
+GrabWindow(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* type */,
+ GrabParameters* /* param */,
+ GrabMask* /* eventMask */);
+
+extern int
+SelectForWindow(
+ DeviceIntPtr /* dev */,
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ Mask /* exclusivemasks */);
+
+extern int
+AddExtensionClient (
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ int /* mskidx */);
+
+extern void
+RecalculateDeviceDeliverableEvents(
+ WindowPtr /* pWin */);
+
+extern int
+InputClientGone(
+ WindowPtr /* pWin */,
+ XID /* id */);
+
+extern int
+SendEvent (
+ ClientPtr /* client */,
+ DeviceIntPtr /* d */,
+ Window /* dest */,
+ Bool /* propagate */,
+ xEvent * /* ev */,
+ Mask /* mask */,
+ int /* count */);
+
+extern int
+SetButtonMapping (
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* nElts */,
+ BYTE * /* map */);
+
+extern int
+ChangeKeyMapping(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ unsigned /* len */,
+ int /* type */,
+ KeyCode /* firstKeyCode */,
+ CARD8 /* keyCodes */,
+ CARD8 /* keySymsPerKeyCode */,
+ KeySym * /* map */);
+
+extern void
+DeleteWindowFromAnyExtEvents(
+ WindowPtr /* pWin */,
+ Bool /* freeResources */);
+
+extern int
+MaybeSendDeviceMotionNotifyHint (
+ deviceKeyButtonPointer * /* pEvents */,
+ Mask /* mask */);
+
+extern void
+CheckDeviceGrabAndHintWindow (
+ WindowPtr /* pWin */,
+ int /* type */,
+ deviceKeyButtonPointer * /* xE */,
+ GrabPtr /* grab */,
+ ClientPtr /* client */,
+ Mask /* deliveryMask */);
+
+extern void
+MaybeStopDeviceHint(
+ DeviceIntPtr /* dev */,
+ ClientPtr /* client */);
+
+extern int
+DeviceEventSuppressForWindow(
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ int /* maskndx */);
+
+extern void
+SendEventToAllWindows(
+ DeviceIntPtr /* dev */,
+ Mask /* mask */,
+ xEvent * /* ev */,
+ int /* count */);
+
+extern _X_HIDDEN void XI2EventSwap(
+ xGenericEvent * /* from */,
+ xGenericEvent * /* to */);
+
+/* For an event such as MappingNotify which affects client interpretation
+ * of input events sent by device dev, should we notify the client, or
+ * would it merely be irrelevant and confusing? */
+extern int
+XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
+
+extern void
+XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master,
+ DeviceChangedEvent *dce);
+
+extern int
+XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
+ unsigned int len, unsigned char* mask);
+
+extern int
+XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len);
+
+#endif /* EXEVENTS_H */
diff --git a/xorg-server/include/input.h b/xorg-server/include/input.h
index 0258f4f18..6ba1ab200 100644
--- a/xorg-server/include/input.h
+++ b/xorg-server/include/input.h
@@ -68,6 +68,7 @@ SOFTWARE.
#define POINTER_ACCELERATE (1 << 3)
#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */
#define POINTER_NORAW (1 << 5) /* Don't generate RawEvents */
+#define POINTER_EMULATED (1 << 6) /* Event was emulated from another event */
/*int constants for pointer acceleration schemes*/
#define PtrAccelNoOp 0
@@ -583,6 +584,9 @@ extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask,
int valuator,
int data);
+extern _X_EXPORT void valuator_mask_set_double(ValuatorMask *mask,
+ int valuator,
+ double data);
extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask);
extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit);
@@ -591,6 +595,8 @@ extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask);
extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest,
const ValuatorMask *src);
extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum);
+extern _X_EXPORT double valuator_mask_get_double(const ValuatorMask *mask,
+ int valnum);
/* InputOption handling interface */
extern _X_EXPORT InputOption* input_option_new(InputOption *list, const char *key, const char *value);
diff --git a/xorg-server/include/inputstr.h b/xorg-server/include/inputstr.h
index 480e95671..9d4108ef5 100644
--- a/xorg-server/include/inputstr.h
+++ b/xorg-server/include/inputstr.h
@@ -75,6 +75,16 @@ extern _X_EXPORT int CountBits(const uint8_t *mask, int len);
#define XI2MASKSIZE ((XI2LASTEVENT + 7)/8) /* no of bits for masks */
/**
+ * Scroll types for ::SetScrollValuator and the scroll type in the
+ * ::ScrollInfoPtr.
+ */
+enum ScrollType {
+ SCROLL_TYPE_NONE = 0, /**< Not a scrolling valuator */
+ SCROLL_TYPE_VERTICAL = 8,
+ SCROLL_TYPE_HORIZONTAL = 9,
+};
+
+/**
* This struct stores the core event mask for each client except the client
* that created the window.
*
@@ -252,6 +262,12 @@ typedef struct _KeyClassRec {
struct _XkbSrvInfo *xkbInfo;
} KeyClassRec, *KeyClassPtr;
+typedef struct _ScrollInfo {
+ enum ScrollType type;
+ double increment;
+ int flags;
+} ScrollInfo, *ScrollInfoPtr;
+
typedef struct _AxisInfo {
int resolution;
int min_resolution;
@@ -260,6 +276,7 @@ typedef struct _AxisInfo {
int max_value;
Atom label;
CARD8 mode;
+ ScrollInfo scroll;
} AxisInfo, *AxisInfoPtr;
typedef struct _ValuatorAccelerationRec {
@@ -283,6 +300,8 @@ typedef struct _ValuatorClassRec {
unsigned short numAxes;
double *axisVal; /* always absolute, but device-coord system */
ValuatorAccelerationRec accelScheme;
+ int h_scroll_axis; /* horiz smooth-scrolling axis */
+ int v_scroll_axis; /* vert smooth-scrolling axis */
} ValuatorClassRec;
typedef struct _ButtonClassRec {
@@ -521,10 +540,10 @@ typedef struct _DeviceIntRec {
* remainder supports acceleration
*/
struct {
- int valuators[MAX_VALUATORS];
- float remainder[MAX_VALUATORS];
+ double valuators[MAX_VALUATORS];
int numValuators;
DeviceIntPtr slave;
+ ValuatorMask *scroll;
} last;
/* Input device property handling. */
diff --git a/xorg-server/include/inpututils.h b/xorg-server/include/inpututils.h
index 63e1a263a..47e242d87 100644
--- a/xorg-server/include/inpututils.h
+++ b/xorg-server/include/inpututils.h
@@ -34,7 +34,7 @@
struct _ValuatorMask {
int8_t last_bit; /* highest bit set in mask */
uint8_t mask[(MAX_VALUATORS + 7)/8];
- int valuators[MAX_VALUATORS]; /* valuator data */
+ double valuators[MAX_VALUATORS]; /* valuator data */
};
extern void verify_internal_event(const InternalEvent *ev);
diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h
index 1fd24ffa6..79549e714 100644
--- a/xorg-server/include/misc.h
+++ b/xorg-server/include/misc.h
@@ -266,13 +266,15 @@ version_compare(uint16_t a_major, uint16_t a_minor,
#define SwapRestL(stuff) \
SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
-#ifdef __GNUC__
+#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
void __attribute__((error("wrong sized variable passed to swap"))) wrong_size(void);
#else
static inline void wrong_size(void)
{
}
+#endif
+#if !(defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C < 0x590)))
static inline int __builtin_constant_p(int x)
{
return 0;
@@ -282,7 +284,7 @@ static inline int __builtin_constant_p(int x)
/* byte swap a 32-bit value */
static inline void swap_uint32(uint32_t *x)
{
- char n = ((char *) &x)[0];
+ char n = ((char *) x)[0];
((char *) x)[0] = ((char *) x)[3];
((char *) x)[3] = n;
n = ((char *) x)[1];
diff --git a/xorg-server/include/protocol-versions.h b/xorg-server/include/protocol-versions.h
index 7b7a9f53c..832bcf756 100644
--- a/xorg-server/include/protocol-versions.h
+++ b/xorg-server/include/protocol-versions.h
@@ -127,7 +127,7 @@
/* X Input */
#define SERVER_XI_MAJOR_VERSION 2
-#define SERVER_XI_MINOR_VERSION 0
+#define SERVER_XI_MINOR_VERSION 1
/* XKB */
#define SERVER_XKB_MAJOR_VERSION 1
diff --git a/xorg-server/include/ptrveloc.h b/xorg-server/include/ptrveloc.h
index 6ca309c8c..4f76b0094 100644
--- a/xorg-server/include/ptrveloc.h
+++ b/xorg-server/include/ptrveloc.h
@@ -47,9 +47,9 @@ struct _DeviceVelocityRec;
* profile
* returns actual acceleration depending on velocity, acceleration control,...
*/
-typedef float (*PointerAccelerationProfileFunc)
+typedef double (*PointerAccelerationProfileFunc)
(DeviceIntPtr dev, struct _DeviceVelocityRec* vel,
- float velocity, float threshold, float accelCoeff);
+ double velocity, double threshold, double accelCoeff);
/**
* a motion history, with just enough information to
@@ -57,8 +57,8 @@ typedef float (*PointerAccelerationProfileFunc)
* a more or less straight line
*/
typedef struct _MotionTracker {
- int dx, dy; /* accumulated delta for each axis */
- int time; /* time of creation */
+ double dx, dy; /* accumulated delta for each axis */
+ int time; /* time of creation */
int dir; /* initial direction bitfield */
} MotionTracker, *MotionTrackerPtr;
@@ -69,17 +69,17 @@ typedef struct _DeviceVelocityRec {
MotionTrackerPtr tracker;
int num_tracker;
int cur_tracker; /* current index */
- float velocity; /* velocity as guessed by algorithm */
- float last_velocity; /* previous velocity estimate */
- int last_dx; /* last time-difference */
- int last_dy ; /* phase of last/current estimate */
- float corr_mul; /* config: multiply this into velocity */
- float const_acceleration; /* config: (recipr.) const deceleration */
- float min_acceleration; /* config: minimum acceleration */
+ double velocity; /* velocity as guessed by algorithm */
+ double last_velocity; /* previous velocity estimate */
+ double last_dx; /* last time-difference */
+ double last_dy; /* phase of last/current estimate */
+ double corr_mul; /* config: multiply this into velocity */
+ double const_acceleration; /* config: (recipr.) const deceleration */
+ double min_acceleration; /* config: minimum acceleration */
short reset_time; /* config: reset non-visible state after # ms */
short use_softening; /* config: use softening of mouse values */
- float max_rel_diff; /* config: max. relative difference */
- float max_diff; /* config: max. difference */
+ double max_rel_diff; /* config: max. relative difference */
+ double max_diff; /* config: max. difference */
int initial_range; /* config: max. offset used as initial velocity */
Bool average_accel; /* config: average acceleration over velocity */
PointerAccelerationProfileFunc Profile;
@@ -107,11 +107,11 @@ extern _X_EXPORT void
InitTrackers(DeviceVelocityPtr vel, int ntracker);
extern _X_EXPORT BOOL
-ProcessVelocityData2D(DeviceVelocityPtr vel, int dx, int dy, int time);
+ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time);
-extern _X_EXPORT float
+extern _X_EXPORT double
BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel,
- float velocity, float threshold, float acc);
+ double velocity, double threshold, double acc);
extern _X_EXPORT void
FreeVelocityData(DeviceVelocityPtr vel);
diff --git a/xorg-server/include/xserver-properties.h b/xorg-server/include/xserver-properties.h
index bf50042d0..18b54ba32 100644
--- a/xorg-server/include/xserver-properties.h
+++ b/xorg-server/include/xserver-properties.h
@@ -77,6 +77,8 @@
#define AXIS_LABEL_PROP_REL_DIAL "Rel Dial"
#define AXIS_LABEL_PROP_REL_WHEEL "Rel Vert Wheel"
#define AXIS_LABEL_PROP_REL_MISC "Rel Misc"
+#define AXIS_LABEL_PROP_REL_VSCROLL "Rel Vert Scroll"
+#define AXIS_LABEL_PROP_REL_HSCROLL "Rel Horiz Scroll"
/*
* Absolute axes
diff --git a/xorg-server/render/render.c b/xorg-server/render/render.c
index cc13dbc2a..ff75409cb 100644
--- a/xorg-server/render/render.c
+++ b/xorg-server/render/render.c
@@ -52,11 +52,7 @@
#include "panoramiXsrv.h"
#endif
-#if HAVE_STDINT_H
#include <stdint.h>
-#elif !defined(UINT32_MAX)
-#define UINT32_MAX 0xffffffffU
-#endif
static int ProcRenderQueryVersion (ClientPtr pClient);
static int ProcRenderQueryPictFormats (ClientPtr pClient);
diff --git a/xorg-server/test/input.c b/xorg-server/test/input.c
index b8dad1c60..afc4d4d99 100644
--- a/xorg-server/test/input.c
+++ b/xorg-server/test/input.c
@@ -52,6 +52,7 @@ static void dix_init_valuators(void)
{
DeviceIntRec dev;
ValuatorClassPtr val;
+ AxisInfoPtr axis;
const int num_axes = 2;
int i;
Atom atoms[MAX_VALUATORS] = { 0 };
@@ -78,6 +79,62 @@ static void dix_init_valuators(void)
}
assert(dev.last.numValuators == num_axes);
+
+ /* invalid increment */
+ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_VERTICAL, 0.0, SCROLL_FLAG_NONE) == FALSE);
+ /* invalid type */
+ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_VERTICAL - 1, 1.0, SCROLL_FLAG_NONE) == FALSE);
+ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_HORIZONTAL + 1, 1.0, SCROLL_FLAG_NONE) == FALSE);
+ /* invalid axisnum */
+ assert(SetScrollValuator(&dev, 2, SCROLL_TYPE_HORIZONTAL, 1.0, SCROLL_FLAG_NONE) == FALSE);
+
+ /* valid */
+ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_VERTICAL, 3.0, SCROLL_FLAG_NONE) == TRUE);
+ axis = &dev.valuator->axes[0];
+ assert(axis->scroll.increment == 3.0);
+ assert(axis->scroll.type == SCROLL_TYPE_VERTICAL);
+ assert(axis->scroll.flags == 0);
+
+ /* valid */
+ assert(SetScrollValuator(&dev, 1, SCROLL_TYPE_HORIZONTAL, 2.0, SCROLL_FLAG_NONE) == TRUE);
+ axis = &dev.valuator->axes[1];
+ assert(axis->scroll.increment == 2.0);
+ assert(axis->scroll.type == SCROLL_TYPE_HORIZONTAL);
+ assert(axis->scroll.flags == 0);
+
+ /* can add another non-preffered axis */
+ assert(SetScrollValuator(&dev, 1, SCROLL_TYPE_VERTICAL, 5.0, SCROLL_FLAG_NONE) == TRUE);
+ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_HORIZONTAL, 5.0, SCROLL_FLAG_NONE) == TRUE);
+
+ /* can overwrite with Preferred */
+ assert(SetScrollValuator(&dev, 1, SCROLL_TYPE_VERTICAL, 5.5, SCROLL_FLAG_PREFERRED) == TRUE);
+ axis = &dev.valuator->axes[1];
+ assert(axis->scroll.increment == 5.5);
+ assert(axis->scroll.type == SCROLL_TYPE_VERTICAL);
+ assert(axis->scroll.flags == SCROLL_FLAG_PREFERRED);
+
+ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_HORIZONTAL, 8.8, SCROLL_FLAG_PREFERRED) == TRUE);
+ axis = &dev.valuator->axes[0];
+ assert(axis->scroll.increment == 8.8);
+ assert(axis->scroll.type == SCROLL_TYPE_HORIZONTAL);
+ assert(axis->scroll.flags == SCROLL_FLAG_PREFERRED);
+
+ /* can overwrite as none */
+ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_NONE, 5.0,
+ SCROLL_FLAG_NONE) == TRUE);
+ axis = &dev.valuator->axes[0];
+ assert(axis->scroll.type == SCROLL_TYPE_NONE);
+
+ /* can overwrite axis with new settings */
+ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_VERTICAL, 5.0, SCROLL_FLAG_NONE) == TRUE);
+ axis = &dev.valuator->axes[0];
+ assert(axis->scroll.type == SCROLL_TYPE_VERTICAL);
+ assert(axis->scroll.increment == 5.0);
+ assert(axis->scroll.flags == SCROLL_FLAG_NONE);
+ assert(SetScrollValuator(&dev, 0, SCROLL_TYPE_VERTICAL, 3.0, SCROLL_FLAG_NONE) == TRUE);
+ assert(axis->scroll.type == SCROLL_TYPE_VERTICAL);
+ assert(axis->scroll.increment == 3.0);
+ assert(axis->scroll.flags == SCROLL_FLAG_NONE);
}
/* just check the known success cases, and that error cases set the client's
@@ -1089,12 +1146,16 @@ static void dix_input_valuator_masks(void)
{
ValuatorMask *mask = NULL, *copy;
int nvaluators = MAX_VALUATORS;
- int valuators[nvaluators];
+ double valuators[nvaluators];
+ int val_ranged[nvaluators];
int i;
int first_val, num_vals;
for (i = 0; i < nvaluators; i++)
- valuators[i] = i;
+ {
+ valuators[i] = i + 0.5;
+ val_ranged[i] = i;
+ }
mask = valuator_mask_new(nvaluators);
assert(mask != NULL);
@@ -1104,9 +1165,10 @@ static void dix_input_valuator_masks(void)
for (i = 0; i < nvaluators; i++)
{
assert(!valuator_mask_isset(mask, i));
- valuator_mask_set(mask, i, valuators[i]);
+ valuator_mask_set_double(mask, i, valuators[i]);
assert(valuator_mask_isset(mask, i));
- assert(valuator_mask_get(mask, i) == valuators[i]);
+ assert(valuator_mask_get(mask, i) == trunc(valuators[i]));
+ assert(valuator_mask_get_double(mask, i) == valuators[i]);
assert(valuator_mask_size(mask) == i + 1);
assert(valuator_mask_num_valuators(mask) == i + 1);
}
@@ -1132,7 +1194,7 @@ static void dix_input_valuator_masks(void)
first_val = 5;
num_vals = 6;
- valuator_mask_set_range(mask, first_val, num_vals, valuators);
+ valuator_mask_set_range(mask, first_val, num_vals, val_ranged);
assert(valuator_mask_size(mask) == first_val + num_vals);
assert(valuator_mask_num_valuators(mask) == num_vals);
for (i = 0; i < nvaluators; i++)
@@ -1142,7 +1204,9 @@ static void dix_input_valuator_masks(void)
else
{
assert(valuator_mask_isset(mask, i));
- assert(valuator_mask_get(mask, i) == valuators[i - first_val]);
+ assert(valuator_mask_get(mask, i) == val_ranged[i - first_val]);
+ assert(valuator_mask_get_double(mask, i) ==
+ val_ranged[i - first_val]);
}
}
@@ -1156,6 +1220,8 @@ static void dix_input_valuator_masks(void)
{
assert(valuator_mask_isset(mask, i) == valuator_mask_isset(copy, i));
assert(valuator_mask_get(mask, i) == valuator_mask_get(copy, i));
+ assert(valuator_mask_get_double(mask, i) ==
+ valuator_mask_get_double(copy, i));
}
valuator_mask_free(&mask);
diff --git a/xorg-server/test/xi2/protocol-common.c b/xorg-server/test/xi2/protocol-common.c
index 423453358..56d6bd268 100644
--- a/xorg-server/test/xi2/protocol-common.c
+++ b/xorg-server/test/xi2/protocol-common.c
@@ -29,6 +29,8 @@
#include "extinit.h" /* for XInputExtensionInit */
#include "exglobals.h"
#include "xkbsrv.h" /* for XkbInitPrivates */
+#include "xserver-properties.h"
+#include <X11/extensions/XI2.h>
#include "protocol-common.h"
@@ -63,6 +65,65 @@ static void fake_init_sprite(DeviceIntPtr dev)
sprite->physLimits.y2 = screen.height;
}
+/* This is essentially CorePointerProc with ScrollAxes added */
+static int
+TestPointerProc(DeviceIntPtr pDev, int what)
+{
+#define NBUTTONS 10
+#define NAXES 4
+ BYTE map[NBUTTONS + 1];
+ int i = 0;
+ Atom btn_labels[NBUTTONS] = {0};
+ Atom axes_labels[NAXES] = {0};
+
+ switch (what) {
+ case DEVICE_INIT:
+ for (i = 1; i <= NBUTTONS; i++)
+ map[i] = i;
+
+ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
+ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
+ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+ btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
+ btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
+ btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT);
+ btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
+ /* don't know about the rest */
+
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
+
+ if (!InitPointerDeviceStruct((DevicePtr)pDev, map, NBUTTONS, btn_labels,
+ (PtrCtrlProcPtr)NoopDDA,
+ GetMotionHistorySize(), NAXES, axes_labels))
+ {
+ ErrorF("Could not initialize device '%s'. Out of memory.\n",
+ pDev->name);
+ return BadAlloc;
+ }
+ pDev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2;
+ pDev->last.valuators[0] = pDev->valuator->axisVal[0];
+ pDev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2;
+ pDev->last.valuators[1] = pDev->valuator->axisVal[1];
+
+ SetScrollValuator(pDev, 2, SCROLL_TYPE_VERTICAL, 2.4, SCROLL_FLAG_NONE);
+ SetScrollValuator(pDev, 3, SCROLL_TYPE_HORIZONTAL, 3.5, SCROLL_FLAG_PREFERRED);
+ break;
+
+ case DEVICE_CLOSE:
+ break;
+
+ default:
+ break;
+ }
+
+ return Success;
+
+#undef NBUTTONS
+#undef NAXES
+}
/**
* Create and init 2 master devices (VCP + VCK) and two slave devices, one
* default mouse, one default keyboard.
@@ -84,7 +145,7 @@ struct devices init_devices(void)
EnableDevice(devices.vck, FALSE);
AllocDevicePair(&client, "", &devices.mouse, &devices.kbd,
- CorePointerProc, CoreKeyboardProc, FALSE);
+ TestPointerProc, CoreKeyboardProc, FALSE);
ActivateDevice(devices.mouse, FALSE);
ActivateDevice(devices.kbd, FALSE);
EnableDevice(devices.mouse, FALSE);
diff --git a/xorg-server/test/xi2/protocol-eventconvert.c b/xorg-server/test/xi2/protocol-eventconvert.c
index 6ec94be6c..bfa23b51f 100644
--- a/xorg-server/test/xi2/protocol-eventconvert.c
+++ b/xorg-server/test/xi2/protocol-eventconvert.c
@@ -41,6 +41,7 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
int nvals = 0;
int bits_set;
int len;
+ uint32_t flagmask = 0;
if (swap)
{
@@ -51,6 +52,7 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
swapl(&out->time);
swapl(&out->detail);
swaps(&out->valuators_len);
+ swapl(&out->flags);
}
@@ -61,7 +63,17 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
assert(out->detail == in->detail.button);
assert(out->deviceid == in->deviceid);
assert(out->valuators_len >= bytes_to_int32(bits_to_bytes(sizeof(in->valuators.mask))));
- assert(out->flags == 0); /* FIXME: we don't set the flags yet */
+
+ switch (in->type) {
+ case ET_RawMotion:
+ case ET_RawButtonPress:
+ case ET_RawButtonRelease:
+ flagmask = XIPointerEmulated;
+ break;
+ default:
+ flagmask = 0;
+ }
+ assert((out->flags & ~flagmask) == 0);
ptr = (unsigned char*)&out[1];
bits_set = 0;
@@ -92,8 +104,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
value = (FP3232*)(((unsigned char*)&out[1]) + out->valuators_len * 4);
value += nvals;
- vi.integral = in->valuators.data[i];
- vi.frac = in->valuators.data_frac[i];
+ vi.integral = trunc(in->valuators.data[i]);
+ vi.frac = in->valuators.data[i] - vi.integral;
vo.integral = value->integral;
vo.frac = value->frac;
@@ -108,8 +120,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
raw_value = value + bits_set;
- vi.integral = in->valuators.data_raw[i];
- vi.frac = in->valuators.data_raw_frac[i];
+ vi.integral = trunc(in->valuators.data_raw[i]);
+ vi.frac = in->valuators.data_raw[i] - vi.integral;
vo.integral = raw_value->integral;
vo.frac = raw_value->frac;
@@ -247,10 +259,8 @@ static void test_convert_XIRawEvent(void)
{
XISetMask(in.valuators.mask, i);
- in.valuators.data[i] = i;
- in.valuators.data_raw[i] = i + 10;
- in.valuators.data_frac[i] = i + 20;
- in.valuators.data_raw_frac[i] = i + 30;
+ in.valuators.data[i] = i + (i * 0.0010);
+ in.valuators.data_raw[i] = (i + 10) + (i * 0.0030);
test_XIRawEvent(&in);
XIClearMask(in.valuators.mask, i);
}
@@ -305,6 +315,11 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
assert(out->sourceid == in->sourceid);
switch (in->type) {
+ case ET_ButtonPress:
+ case ET_Motion:
+ case ET_ButtonRelease:
+ flagmask = XIPointerEmulated;
+ break;
case ET_KeyPress:
flagmask = XIKeyRepeat;
break;
@@ -375,8 +390,8 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
{
FP3232 vi, vo;
- vi.integral = in->valuators.data[i];
- vi.frac = in->valuators.data_frac[i];
+ vi.integral = trunc(in->valuators.data[i]);
+ vi.frac = (in->valuators.data[i] - vi.integral) * (1UL << 32);
vo = *values;
@@ -618,8 +633,7 @@ static void test_convert_XIDeviceEvent(void)
{
XISetMask(in.valuators.mask, i);
- in.valuators.data[i] = i;
- in.valuators.data_frac[i] = i + 20;
+ in.valuators.data[i] = i + (i * 0.0020);
test_XIDeviceEvent(&in);
XIClearMask(in.valuators.mask, i);
}
diff --git a/xorg-server/test/xi2/protocol-xiquerydevice.c b/xorg-server/test/xi2/protocol-xiquerydevice.c
index 47eb5b14c..63d725f28 100644
--- a/xorg-server/test/xi2/protocol-xiquerydevice.c
+++ b/xorg-server/test/xi2/protocol-xiquerydevice.c
@@ -127,7 +127,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
dev = devices.mouse;
assert(info->use == XISlavePointer);
assert(info->attachment == devices.vcp->id);
- assert(info->num_classes == 3); /* 2 axes + button */
+ assert(info->num_classes == 7); /* 4 axes + button + 2 scroll*/
break;
case 5: /* keyboard */
dev = devices.kbd;
@@ -183,11 +183,48 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
}
break;
}
- case 2: /* VCP and mouse have the same properties */
case 4:
{
assert(any->type == XIButtonClass ||
- any->type == XIValuatorClass);
+ any->type == XIValuatorClass ||
+ any->type == XIScrollClass);
+
+ if (any->type == XIScrollClass)
+ {
+ xXIScrollInfo *si = (xXIScrollInfo*)any;
+
+ if (client->swapped)
+ {
+ swaps(&si->number);
+ swaps(&si->scroll_type);
+ swapl(&si->increment.integral);
+ swapl(&si->increment.frac);
+ }
+ assert(si->length == 6);
+ assert(si->number == 2 || si->number == 3);
+ if (si->number == 2) {
+ assert(si->scroll_type == XIScrollTypeVertical);
+ assert(!si->flags);
+ }
+ if (si->number == 3) {
+ assert(si->scroll_type == XIScrollTypeHorizontal);
+ assert(si->flags & XIScrollFlagPreferred);
+ assert(!(si->flags & ~XIScrollFlagPreferred));
+ }
+
+ assert(si->increment.integral == si->number);
+ /* FIXME: frac testing with float/FP issues? */
+ assert(si->increment.frac > 0.3 * (1UL << 32));
+ assert(si->increment.frac < 0.6 * (1UL << 32));
+ }
+
+ }
+ /* fall through */
+ case 2: /* VCP and mouse have the same properties except for scroll */
+ {
+ if (info->deviceid == 2 ) /* VCP */
+ assert(any->type == XIButtonClass ||
+ any->type == XIValuatorClass);
if (any->type == XIButtonClass)
{
@@ -217,8 +254,10 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
}
assert(vi->length == 11);
- assert(vi->number == 0 ||
- vi->number == 1);
+ assert(vi->number >= 0 && vi->number < 4);
+ if (info->deviceid == 2) /* VCP */
+ assert(vi->number < 2);
+
assert(vi->mode == XIModeRelative);
/* device was set up as relative, so standard
* values here. */
diff --git a/xorg-server/xkb/xkbAccessX.c b/xorg-server/xkb/xkbAccessX.c
index 4115ff27d..d246827ea 100644
--- a/xorg-server/xkb/xkbAccessX.c
+++ b/xorg-server/xkb/xkbAccessX.c
@@ -37,6 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/extensions/XIproto.h>
#include "inputstr.h"
#include "eventstr.h"
+#include "inpututils.h"
#include <xkbsrv.h>
#if !defined(WIN32)
#include <sys/time.h>
diff --git a/xorg-server/xkeyboard-config/NEWS b/xorg-server/xkeyboard-config/NEWS
index e32b2c318..00ae0db79 100644
--- a/xorg-server/xkeyboard-config/NEWS
+++ b/xorg-server/xkeyboard-config/NEWS
@@ -1,3 +1,4 @@
+2.4.1 Critical bug fixed: many Ctl+Alt combinations broken
2.4 9 bugs fixed, a number of translations updated
2.3 First scheduled (and reasonably polished) release since GNOME3.
Serious cleanup of descriptions
diff --git a/xorg-server/xkeyboard-config/configure.in b/xorg-server/xkeyboard-config/configure.in
index 6a395aab0..fa4baef95 100644
--- a/xorg-server/xkeyboard-config/configure.in
+++ b/xorg-server/xkeyboard-config/configure.in
@@ -1,4 +1,4 @@
-AC_INIT(xkeyboard-config, 2.4)
+AC_INIT(xkeyboard-config, 2.4.1)
AC_CONFIG_SRCDIR(rules/base.xml.in)
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
diff --git a/xorg-server/xkeyboard-config/symbols/in b/xorg-server/xkeyboard-config/symbols/in
index 7b7300f40..84d9b06f8 100644
--- a/xorg-server/xkeyboard-config/symbols/in
+++ b/xorg-server/xkeyboard-config/symbols/in
@@ -172,7 +172,7 @@ xkb_symbols "bolnagri" {
partial alphanumeric_keys
xkb_symbols "ben" {
- name[Group1]= "Bengali";
+ name[Group1]= "Bengali (India)";
// Mainly numbers.
key <AE01> { [ U09E7 ] };
@@ -237,7 +237,7 @@ xkb_symbols "ben" {
};
xkb_symbols "ben_probhat" {
- name[Group1]= "Bengali (Probhat)";
+ name[Group1]= "Bengali (India, Probhat)";
key <ESC> { [ Escape ] };
// numbers
@@ -312,7 +312,7 @@ xkb_symbols "ben_probhat" {
// Bengali Baishakhi, Bengali Baishakhi Inscript, Bengali Bornona, Uni Gitanjali Layouts are added by Promathesh Mandal <promathesh812004@gmail.com>
xkb_symbols "ben_baishakhi" {
- name[Group1]= "Bengali (Baishakhi)";
+ name[Group1]= "Bengali (India, Baishakhi)";
key <ESC> { [ Escape ] };
// numbers
@@ -389,7 +389,7 @@ xkb_symbols "ben_baishakhi" {
};
xkb_symbols "ben_inscript" {
- name[Group1]= "Bengali (Baishakhi Inscript)";
+ name[Group1]= "Bengali (India, Baishakhi Inscript)";
// Mainly numbers.
key <TLDE> { [ 0x100200D, 0x100200C ] };
@@ -455,7 +455,7 @@ xkb_symbols "ben_inscript" {
};
xkb_symbols "ben_gitanjali" {
- name[Group1]= "Bengali (Uni Gitanjali)";
+ name[Group1]= "Bengali (India, Uni Gitanjali)";
key <ESC> { [ Escape ] };
// numbers
@@ -533,7 +533,7 @@ xkb_symbols "ben_gitanjali" {
xkb_symbols "ben_bornona" {
- name[Group1]= "Bengali (Bornona)";
+ name[Group1]= "Bengali (India, Bornona)";
key <ESC> { [ Escape ] };
// numbers
diff --git a/xorg-server/xkeyboard-config/symbols/keypad b/xorg-server/xkeyboard-config/symbols/keypad
index fb3469850..e85aaacbd 100644
--- a/xorg-server/xkeyboard-config/symbols/keypad
+++ b/xorg-server/xkeyboard-config/symbols/keypad
@@ -1,633 +1,633 @@
-partial hidden keypad_keys
-xkb_symbols "overlay" {
- include "keypad(overlay1)"
-};
-
-partial hidden keypad_keys
-xkb_symbols "overlay1" {
-
- // Begin "Keypad" section
-
- key <KP7> { [ KP_Home ], overlay1=<KO7> };
- key <KP8> { [ KP_Up ], overlay1=<KO8> };
- key <KP9> { [ KP_Prior ], overlay1=<KO9> };
-
- key <KP4> { [ KP_Left ], overlay1=<KO4> };
- key <KP5> { [ KP_Begin ], overlay1=<KO5> };
- key <KP6> { [ KP_Right ], overlay1=<KO6> };
-
- key <KP1> { [ KP_End ], overlay1=<KO1> };
- key <KP2> { [ KP_Down ], overlay1=<KO2> };
- key <KP3> { [ KP_Next ], overlay1=<KO3> };
-
- key <KP0> { [ KP_Insert ], overlay1=<KO0> };
- key <KPDL> { [ KP_Delete ], overlay1=<KODL> };
-
- key <KO7> { [ KP_7 ] };
- key <KO8> { [ KP_8 ] };
- key <KO9> { [ KP_9 ] };
-
- key <KO4> { [ KP_4 ] };
- key <KO5> { [ KP_5 ] };
- key <KO6> { [ KP_6 ] };
-
- key <KO1> { [ KP_1 ] };
- key <KO2> { [ KP_2 ] };
- key <KO3> { [ KP_3 ] };
-
- key <KO0> { [ KP_0 ] };
- key <KODL> { [ KP_Decimal ] };
-
- // End "Keypad" section
-};
-
-partial hidden keypad_keys
-xkb_symbols "overlay2" {
-
- // Begin "Keypad" section
-
- key <KP7> { [ KP_Home ], overlay2=<KO7> };
- key <KP8> { [ KP_Up ], overlay2=<KO8> };
- key <KP9> { [ KP_Prior ], overlay2=<KO9> };
-
- key <KP4> { [ KP_Left ], overlay2=<KO4> };
- key <KP5> { [ KP_Begin ], overlay2=<KO5> };
- key <KP6> { [ KP_Right ], overlay2=<KO6> };
-
- key <KP1> { [ KP_End ], overlay2=<KO1> };
- key <KP2> { [ KP_Down ], overlay2=<KO2> };
- key <KP3> { [ KP_Next ], overlay2=<KO3> };
-
- key <KP0> { [ KP_Insert ], overlay2=<KO0> };
- key <KPDL> { [ KP_Delete ], overlay2=<KODL> };
-
- key <KO7> { [ KP_7 ] };
- key <KO8> { [ KP_8 ] };
- key <KO9> { [ KP_9 ] };
-
- key <KO4> { [ KP_4 ] };
- key <KO5> { [ KP_5 ] };
- key <KO6> { [ KP_6 ] };
-
- key <KO1> { [ KP_1 ] };
- key <KO2> { [ KP_2 ] };
- key <KO3> { [ KP_3 ] };
-
- key <KO0> { [ KP_0 ] };
- key <KODL> { [ KP_Decimal ] };
-
- // End "Keypad" section
-};
-
-partial hidden default keypad_keys
-xkb_symbols "x11" {
-// Ungrab cancels server/keyboard/pointer grabs
- key <KPDV> {
- type="CTRL+ALT",
- symbols[Group1]= [ KP_Divide, XF86_Ungrab ]
- };
-
-// ClsGrb kills whichever client has a grab in effect
- key <KPMU> {
- type="CTRL+ALT",
- symbols[Group1]= [ KP_Multiply, XF86_ClearGrab ]
- };
-
-// -VMode switches to the previous video mode
- key <KPSU> {
- type="CTRL+ALT",
- symbols[Group1]= [ KP_Subtract, XF86_Prev_VMode ]
- };
-
- key <KP7> { [ KP_Home, KP_7 ] };
- key <KP8> { [ KP_Up, KP_8 ] };
- key <KP9> { [ KP_Prior, KP_9 ] };
-
-// +VMode switches to the next video mode
- key <KPAD> {
- type="CTRL+ALT",
- symbols[Group1]= [ KP_Add, XF86_Next_VMode ]
- };
-
- key <KP4> { [ KP_Left, KP_4 ] };
- key <KP5> { [ KP_Begin, KP_5 ] };
- key <KP6> { [ KP_Right, KP_6 ] };
-
- key <KP1> { [ KP_End, KP_1 ] };
- key <KP2> { [ KP_Down, KP_2 ] };
- key <KP3> { [ KP_Next, KP_3 ] };
- key <KPEN> { [ KP_Enter ] };
- key <KPEQ> { [ KP_Equal ] };
-
- key <KP0> { [ KP_Insert, KP_0 ] };
- key <KPDL> { [ KP_Delete, KP_Decimal ] };
- key <KPPT> { [ KP_Decimal, KP_Decimal ] };
-};
-
-
-// Legacy PC keypad definition
-// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-keypad_keys
-xkb_symbols "legacy" {
-
- include "keypad(core)"
- include "keypad(legacymath)"
- include "keypad(legacynumber)"
- include "kpdl(dot)"
-};
-
-
-// Legacy Wang 725-3771-ae and 725-3771-uk keypad definition
-// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-keypad_keys
-xkb_symbols "legacy_wang" {
-
- include "keypad(core)"
- include "keypad(legacymath)"
- include "keypad(legacynumber_wang)"
- include "kpdl(dot)"
-};
-
-
-// Complete new keypad definition
-// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-keypad_keys
-xkb_symbols "oss" {
-
- include "keypad(core)"
- include "keypad(ossmath)"
- include "keypad(ossnumber)"
- include "kpdl(dotoss)"
-};
-
-
-// Latin9 restriction of new keypad definition
-// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-keypad_keys
-xkb_symbols "oss_latin9" {
-
- include "keypad(core)"
- include "keypad(ossmath_latin9)"
- include "keypad(legacynumber)"
- include "kpdl(dotoss_latin9)"
-};
-
-
-// Wang 725-3771-ae and 725-3771-uk keypad variant of oss keypad
-// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-keypad_keys
-xkb_symbols "oss_wang" {
-
- include "keypad(core)"
- include "keypad(ossmath)"
- include "keypad(ossnumber_wang)"
- include "kpdl(dotoss)"
-};
-
-
-// Forward-looking keypad definition
-// Won't work with applications that make ASCII assumptions
-// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-keypad_keys
-xkb_symbols "future" {
-
- include "keypad(core)"
- include "keypad(futuremath)"
- include "keypad(ossnumber)"
- include "kpdl(commaoss)"
-};
-
-
-// Forward-looking keypad definition
-// Won't work with applications that make ASCII assumptions
-// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-keypad_keys
-xkb_symbols "future_wang" {
-
- include "keypad(core)"
- include "keypad(futuremath)"
- include "keypad(ossnumber_wang)"
- include "kpdl(commaoss)"
-};
-
-
-// Keypad keys nobody changes
-// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-partial keypad_keys
-xkb_symbols "core" {
-
- modifier_map Mod2 { Num_Lock };
-
- key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
- key <KPEN> { [ KP_Enter ] };
- key <KPEQ> { [ KP_Equal ] };
-};
-
-
-// Legacy keypad math area
-// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-//
-// ┏━━━━━┱─────┬─────┬─────┐
-// ┃Num ┃ ₁ │ ₂ │ ₃ │ ₁ <XF86_Ungrab>
-// ┃Lock⇭┃ / │ * │ - │ ₂ <XF86_ClearGrab>
-// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
-// │ ₄ │ ₄ <XF86_Next_VMode>
-// │ │
-// ┤ │ 1 None
-// │ │ 2 Ctrl+Alt
-// │ + │
-// ╆━━━━━┪
-partial keypad_keys
-xkb_symbols "legacymath" {
-
- key.type[Group1]="CTRL+ALT" ;
-
- key <KPDV> { [ KP_Divide, XF86_Ungrab ] }; // / <XF86_Ungrab>
- key <KPMU> { [ KP_Multiply, XF86_ClearGrab ] }; // * <XF86_ClearGrab>
- key <KPSU> { [ KP_Subtract, XF86_Prev_VMode ] }; // - <XF86_Prev_VMode>
-
- key <KPAD> { [ KP_Add, XF86_Next_VMode ] }; // + <XF86_Next_VMode>
-
-};
-
-
-// Keypad math area with non-CS operators
-// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-//
-// ┏━━━━━┱─────┬─────┬─────┐
-// ┃Num ┃ ∕ ₁ │ . ₂ │ − ₃ │ ₁ <XF86_Ungrab>
-// ┃Lock⇭┃ / ÷ │ * × │ - − │ ₂ <XF86_ClearGrab>
-// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
-// │ + ₄ │ ₄ <XF86_Next_VMode>
-// │ │
-// ┤ │ 1 None
-// │ │ 2 Level3 ⇮
-// │ + + │ 3 Shift+Level3 ⇧⇮
-// ╆━━━━━┪ 4 Ctrl+Alt
-partial keypad_keys
-xkb_symbols "ossmath" {
-
- key.type[Group1]="FOUR_LEVEL_X" ;
-
- key <KPDV> { [ KP_Divide, 0x1002215, 0x10000F7, XF86_Ungrab ] }; // / ∕ ÷ <XF86_Ungrab>
- key <KPMU> { [ KP_Multiply, 0x10022C5, 0x10000D7, XF86_ClearGrab ] }; // * ⋅ × <XF86_ClearGrab>
- key <KPSU> { [ KP_Subtract, 0x1002212, 0x1002212, XF86_Prev_VMode ] }; // - − − <XF86_Prev_VMode>
-
- key <KPAD> { [ KP_Add, 0x100002B, 0x100002B, XF86_Next_VMode ] }; // + + + <XF86_Next_VMode>
-
-};
-
-
-// Keypad math area with non-CS operators in first levels
-// As demanded by users not interested in legacy pre-unicode junk
-// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-//
-// ┏━━━━━┱─────┬─────┬─────┐
-// ┃Num ┃ / ₁ │ * ₂ │ - ₃ │ ₁ <XF86_Ungrab>
-// ┃Lock⇭┃ ∕ ÷ │ . × │ − − │ ₂ <XF86_ClearGrab>
-// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
-// │ + ₄ │ ₄ <XF86_Next_VMode>
-// │ │
-// ┤ │ 1 None
-// │ │ 2 Level3 ⇮
-// │ + + │ 3 Shift+Level3 ⇧⇮
-// ╆━━━━━┪ 4 Ctrl+Alt
-partial keypad_keys
-xkb_symbols "futuremath" {
-
- key.type[Group1]="FOUR_LEVEL_X" ;
-
- key <KPDV> { [ 0x1002215, KP_Divide, 0x10000F7, XF86_Ungrab ] }; // ∕ / ÷ <XF86_Ungrab>
- key <KPMU> { [ 0x10022C5, KP_Multiply, 0x10000D7, XF86_ClearGrab ] }; // ⋅ * × <XF86_ClearGrab>
- key <KPSU> { [ 0x1002212, KP_Subtract, 0x1002212, XF86_Prev_VMode ] }; // − - − <XF86_Prev_VMode>
-
- key <KPAD> { [ 0x100002B, KP_Add, 0x100002B, XF86_Next_VMode ] }; // + + + <XF86_Next_VMode>
-};
-
-
-// Keypad math area with non-CS operators, restricted to latin9
-// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-//
-// ┏━━━━━┱─────┬─────┬─────┐
-// ┃Num ┃ / ₁ │ · ₂ │ - ₃ │ ₁ <XF86_Ungrab>
-// ┃Lock⇭┃ / ÷ │ * × │ - - │ ₂ <XF86_ClearGrab>
-// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
-// │ + ₄ │ ₄ <XF86_Next_VMode>
-// │ │
-// ┤ │ 1 None
-// │ │ 2 Level3 ⇮
-// │ + + │ 3 Shift+Level3 ⇧⇮
-// ╆━━━━━┪ 4 Ctrl+Alt
-partial keypad_keys
-xkb_symbols "ossmath_latin9" {
-
- key.type[Group1]="FOUR_LEVEL_X";
-
- key <KPDV> { [ KP_Divide, slash, division, XF86_Ungrab ] }; // / / ÷ <XF86_Ungrab>
- key <KPMU> { [ KP_Multiply, periodcentered, multiply, XF86_ClearGrab ] }; // * · × <XF86_ClearGrab>
- key <KPSU> { [ KP_Subtract, minus, minus, XF86_Prev_VMode ] }; // - - - <XF86_Prev_VMode>
-
- key <KPAD> { [ KP_Add, plus, plus, XF86_Next_VMode ] }; // + + + <XF86_Next_VMode>
-};
-
-
-// Legacy keypad number area
-// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-//
-// ┏━━━━━┱ ⇱ Home
-// ┃Num ┃ ⇲ End
-// ┃Lock⇭┃ ⇞ Page up
-// ┡━━━━━╃─────┼─────┼ ⇟ Page down
-// │ 7 │ 8 │ 9 │ ⇞ Page up
-// │ ⇱ │ ⇧ │ ⇞ │ ⎀ Insert
-// ├─────┼─────┼─────┤ ␥ Delete
-// │ 4 │ 5 │ 6 │ ⇦⇧⇨⇩ Directions
-// │ ⇦ │ │ ⇨ │
-// ├─────┼─────┼─────╆
-// │ 1 │ 2 │ 3 ┃
-// │ ⇲ │ ⇩ │ ⇟ ┃ 1 None
-// ├─────┴─────┼─────┨ 2 Num Lock ⇭
-// │ 0 │
-// │ ⎀ │
-// └───────────┴
-partial keypad_keys
-xkb_symbols "legacynumber" {
-
- key.type[Group1]="KEYPAD" ;
-
- key <KP7> { [ KP_Home, KP_7 ] }; // <home> 7
- key <KP8> { [ KP_Up, KP_8 ] }; // <up> 8
- key <KP9> { [ KP_Prior, KP_9 ] }; // <prior> 9
-
- key <KP4> { [ KP_Left, KP_4 ] }; // <left> 4
- key <KP5> { [ KP_Begin, KP_5 ] }; // <begin> 5
- key <KP6> { [ KP_Right, KP_6 ] }; // <right> 6
-
- key <KP1> { [ KP_End, KP_1 ] }; // <end> 1
- key <KP2> { [ KP_Down, KP_2 ] }; // <down> 2
- key <KP3> { [ KP_Next, KP_3 ] }; // <next> 3
-
- key <KP0> { [ KP_Insert, KP_0 ] }; // <insert> 0
-};
-
-
-// Legacy Wang 725-3771-ae and 725-3771-uk keypad number area
-// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-// This is actually a three-level keypad, declared as four-level
-// to avoid defining a new type
-//
-// ┏━━━━━┱ ⇱ Home
-// ┃Num ┃ ⇲ End
-// ┃Lock⇭┃ ⇞ Page up
-// ┡━━━━━╃─────┼─────┼ ⇟ Page down
-// │ 7 │ 8 │ 9 │ ⇞ Page up
-// │ ⇱ < │ ⇧ > │ ⇞ ^ │ ⎀ Insert
-// ├─────┼─────┼─────┤ ␥ Delete
-// │ 4 │ 5 │ 6 │ ⇦⇧⇨⇩ Directions
-// │ ⇦ [ │ ] │ ⇨ $ │
-// ├─────┼─────┼─────╆
-// │ 1 │ 2 │ 3 ┃
-// │ ⇲ & │ ⇩ @ │ ⇟ # ┃ 1 None
-// ├─────┴─────┼─────┨ 2 Num Lock ⇭
-// │ 0 │ 3 Level3 ⇮
-// │ ⎀ │
-// └───────────┴
-partial keypad_keys
-xkb_symbols "legacynumber_wang" {
-
- key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
-
- key <KP7> { [ KP_Home, KP_7, less ] }; // <home> 7 <
- key <KP8> { [ KP_Up, KP_8, greater ] }; // <up> 8 >
- key <KP9> { [ KP_Prior, KP_9, asciicircum ] }; // <prior> 9 ^
-
- key <KP4> { [ KP_Left, KP_4, bracketleft ] }; // <left> 4 [
- key <KP5> { [ KP_Begin, KP_5, bracketright ] }; // <begin> 5 ]
- key <KP6> { [ KP_Right, KP_6, dollar ] }; // <right> 6 $
-
- key <KP1> { [ KP_End, KP_1, ampersand ] }; // <end> 1 &
- key <KP2> { [ KP_Down, KP_2, at ] }; // <down> 2 @
- key <KP3> { [ KP_Next, KP_3, numbersign ] }; // <next> 3 #
-
- key <KP0> { [ KP_Insert, KP_0, apostrophe ] }; // <insert> 0 '
-};
-
-
-// Keypad number area with arrow symbols
-// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-//
-// ┏━━━━━┱ ⇱ Home
-// ┃Num ┃ ⇲ End
-// ┃Lock⇭┃ ⇞ Page up
-// ┡━━━━━╃─────┼─────┼ ⇟ Page down
-// │ 7 ⇖ │ 8 ⇑ │ 9 ⇗ │ ⇞ Page up
-// │ ⇱ ↖ │ ⇧ ↑ │ ⇞ ↗ │ ⎀ Insert
-// ├─────┼─────┼─────┤ ␥ Delete
-// │ 4 ⇐ │ 5 ⇔ │ 6 ⇗ │ ⇦⇧⇨⇩ Directions
-// │ ⇦ ← │ ↔ │ ⇨ ↗ │ ⍽ narrow no-break space
-// ├─────┼─────┼─────╆
-// │ 1 ⇙ │ 2 ⇓ │ 3 ⇘ ┃
-// │ ⇲ ↙ │ ⇩ ↓ │ ⇟ ↘ ┃ 1 None
-// ├─────┴─────┼─────┨ 2 Num Lock ⇭
-// │ 0 ⇕ │ 3 Level3 ⇮
-// │ ⎀ ↕ │ 4 Shift+Level3 ⇧⇮
-// └───────────┴
-partial keypad_keys
-xkb_symbols "ossnumber" {
-
- key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
-
- key <KP7> { [ KP_Home, KP_7, 0x1002196, 0x10021D6 ] }; // <home> 7 ↖ ⇖
- key <KP8> { [ KP_Up, KP_8, 0x1002191, 0x10021D1 ] }; // <up> 8 ↑ ⇑
- key <KP9> { [ KP_Prior, KP_9, 0x1002197, 0x10021D7 ] }; // <prior> 9 ↗ ⇗
-
- key <KP4> { [ KP_Left, KP_4, 0x1002190, 0x10021D0 ] }; // <left> 4 ← ⇐
- key <KP5> { [ KP_Begin, KP_5, 0x1002194, 0x10021D4 ] }; // <begin> 5 ↔ ⇔
- key <KP6> { [ KP_Right, KP_6, 0x1002192, 0x10021D2 ] }; // <right> 6 → ⇒
-
- key <KP1> { [ KP_End, KP_1, 0x1002199, 0x10021D9 ] }; // <end> 1 ↙ ⇙
- key <KP2> { [ KP_Down, KP_2, 0x1002193, 0x10021D3 ] }; // <down> 2 ↓ ⇓
- key <KP3> { [ KP_Next, KP_3, 0x1002198, 0x10021D8 ] }; // <next> 3 ↘ ⇘
-
- key <KP0> { [ KP_Insert, KP_0, 0x1002195, 0x10021D5 ] }; // <insert> 0 ↕ ⇕
-};
-
-
-// Wang 725-3771-ae and 725-3771-uk keypad number area with additional arrow symbols
-// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
-//
-// ┏━━━━━┱ ⇱ Home
-// ┃Num ┃ ⇲ End
-// ┃Lock⇭┃ ⇞ Page up
-// ┡━━━━━╃─────┼─────┼ ⇟ Page down
-// │ 7 ↖ │ 8 ↑ │ 9 ↗ │ ⇞ Page up
-// │ ⇱ < │ ⇧ > │ ⇞ ^ │ ⎀ Insert
-// ├─────┼─────┼─────┤ ␥ Delete
-// │ 4 ← │ 5 ↔ │ 6 → │ ⇦⇧⇨⇩ Directions
-// │ ⇦ [ │ ] │ ⇨ $ │ ⍽ narrow no-break space
-// ├─────┼─────┼─────╆
-// │ 1 ↙ │ 2 ↓ │ 3 ↘ ┃
-// │ ⇲ & │ ⇩ @ │ ⇟ # ┃ 1 None
-// ├─────┴─────┼─────┨ 2 Num Lock ⇭
-// │ 0 ↕ │ 3 Level3 ⇮
-// │ ⎀ ' │ 4 Shift+Level3 ⇧⇮
-// └───────────┴
-partial keypad_keys
-xkb_symbols "ossnumber_wang" {
-
- key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
-
- key <KP7> { [ KP_Home, KP_7, less, 0x1002196 ] }; // <home> 7 < ↖
- key <KP8> { [ KP_Up, KP_8, greater, 0x1002191 ] }; // <up> 8 > ↑
- key <KP9> { [ KP_Prior, KP_9, asciicircum, 0x1002197 ] }; // <prior> 9 ^ ↗
-
- key <KP4> { [ KP_Left, KP_4, bracketleft, 0x1002190 ] }; // <left> 4 [ ←
- key <KP5> { [ KP_Begin, KP_5, bracketright, 0x1002194 ] }; // <begin> 5 ] ↔
- key <KP6> { [ KP_Right, KP_6, dollar, 0x1002192 ] }; // <right> 6 $ →
-
- key <KP1> { [ KP_End, KP_1, ampersand, 0x1002199 ] }; // <end> 1 & ↙
- key <KP2> { [ KP_Down, KP_2, at, 0x1002193 ] }; // <down> 2 @ ↓
- key <KP3> { [ KP_Next, KP_3, numbersign, 0x1002198 ] }; // <next> 3 # ↘
-
- key <KP0> { [ KP_Insert, KP_0, apostrophe, 0x1002195 ] }; // <insert> 0 ' ↕
-};
-
-// Standard base "pc" layout only contains cursor keys, and then gets
-// augmented with the digits later. If you define your own layout for
-// the numpad you can inherit the cursors, but you'll have to define
-// the digits yourself. This module can be included in the rules to
-// define math operators; these are the variants used in computer
-// languages that are based on ASCII. NoSymbol doesn't mean that
-// nothing is bound to the key but that no assignment is done here.
-// srvr_ctrl(stdkeypad) and keypad(x11) declare the operator keys to
-// be of type CTRL+ALT in order to assign server control events to
-// them, but it uses the second level which is overwritten if we have
-// more than one definition (shift state) for the key. Instead, here
-// the commands are put at the fourth level.
-partial keypad_keys
-xkb_symbols "ops" {
- key <KPDV> { [ NoSymbol, slash, NoSymbol, XF86_Ungrab ] };
- key <KPMU> { [ NoSymbol, asterisk, NoSymbol, XF86_ClearGrab ] };
- key <KPSU> { [ NoSymbol, minus, NoSymbol, XF86_Prev_VMode ] };
- key <KPAD> { [ NoSymbol, plus, NoSymbol, XF86_Next_VMode ] };
- key <KPEQ> { [ NoSymbol, equal ] };
-};
-
-// Hexadecimal Numpad, by Roland Kaufmann <rlndkfmn at gmail dot com>
-// License: BSD (also covers variant with ATM digit order)
-// Third-level gives the letters used in hexadecimal numbers, or
-// columns in small spreadsheets. As a bonus, having 'e' available at
-// the center of the keyboard makes it easy to enter floating point
-// numbers in scientific notation.
-// Equal is added to start formulas (most numpads on PCs don't have
-// their own equal key), comma as a list separator (as most
-// programming languages wants period as a decimal separator) and
-// colon to enter times and ranges. Someone also may want to represent
-// multiplication and division in prose using x and colon.
-// Two first levels are specified as NoSymbol to not override any
-// previous specification. Combine this with another keypad specifier,
-// e.g. "legacy".
-partial keypad_keys
-xkb_symbols "hex" {
- key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
-
- // None NumLock AltGr
- // symbol row
- key <KPDV> { [ NoSymbol, NoSymbol, parenleft ] };
- key <KPMU> { [ NoSymbol, NoSymbol, parenright ] };
- key <KPSU> { [ NoSymbol, NoSymbol, dollar ] };
-
- // upper row
- key <KP7> { [ NoSymbol, NoSymbol, a ] };
- key <KP8> { [ NoSymbol, NoSymbol, b ] };
- key <KP9> { [ NoSymbol, NoSymbol, c ] };
-
- // home row
- key <KP4> { [ NoSymbol, NoSymbol, d ] };
- key <KP5> { [ NoSymbol, NoSymbol, e ] };
- key <KP6> { [ NoSymbol, NoSymbol, f ] };
- key <KPAD> { [ NoSymbol, NoSymbol, comma ] };
-
- // lower row
- key <KP1> { [ NoSymbol, NoSymbol, equal ] };
- key <KP2> { [ NoSymbol, NoSymbol, x ] };
- key <KP3> { [ NoSymbol, NoSymbol, colon ] };
-
- // decimal row
- key <KP0> { [ NoSymbol, NoSymbol, backslash ] };
-};
-
-// Main numbers follows the traditions from ATMs and phones with
-// numbers increasing downwards to the right. (It is easier to
-// change the keyboard layout than to reprogram your local ATM;
-// also cell-phones are becoming more common while calculators are
-// becoming more rare).
-// First level is left unspecified, so it may be combined with another
-// layout, e.g. "legacy".
-partial keypad_keys
-xkb_symbols "atm" {
- // upper row
- key <KP7> { [ NoSymbol, KP_1 ] };
- key <KP8> { [ NoSymbol, KP_2 ] };
- key <KP9> { [ NoSymbol, KP_3 ] };
-
- // lower row
- key <KP1> { [ NoSymbol, KP_7 ] };
- key <KP2> { [ NoSymbol, KP_8 ] };
- key <KP3> { [ NoSymbol, KP_9 ] };
-};
-
-
-partial default modifier_keys
-xkb_symbols "pointerkeys" {
- key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
-};
-
-// Only numbers, operators and decimal separator,
-// as seen on keypad overlay on Japanese keyboard.
-// ┌─┬─┬─┬─┐
-// │7│8│9│*│
-// ├─┼─┼─┼─┤
-// │4│5│6│-│
-// ├─┼─┼─┼─┤
-// │1│2│3│+│
-// ├─┼─┼─┼─┤
-// │0│ │·│/│
-// └─┴─┴─┴─┘
-partial keypad_keys
-xkb_symbols "numoperdecsep" {
- key <KO7> { [ KP_7 ] };
- key <KO8> { [ KP_8 ] };
- key <KO9> { [ KP_9 ] };
-// ClsGrb kills whichever client has a grab in effect
- key <KOMU> {
- type="CTRL+ALT",
- symbols[Group1]= [ KP_Multiply, XF86_ClearGrab ]
- };
-
- key <KO4> { [ KP_4 ] };
- key <KO5> { [ KP_5 ] };
- key <KO6> { [ KP_6 ] };
-// -VMode switches to the previous video mode
- key <KOSU> {
- type="CTRL+ALT",
- symbols[Group1]= [ KP_Subtract, XF86_Prev_VMode ]
- };
-
- key <KO1> { [ KP_1 ] };
- key <KO2> { [ KP_2 ] };
- key <KO3> { [ KP_3 ] };
-// +VMode switches to the next video mode
- key <KOAD> {
- type="CTRL+ALT",
- symbols[Group1]= [ KP_Add, XF86_Next_VMode ]
- };
-
- key <KO0> { [ KP_0 ] };
- key <KODL> { [ KP_Decimal ] };
-// Ungrab cancels server/keyboard/pointer grabs
- key <KODV> {
- type="CTRL+ALT",
- symbols[Group1]= [ KP_Divide, XF86_Ungrab ]
- };
-};
+partial hidden keypad_keys
+xkb_symbols "overlay" {
+ include "keypad(overlay1)"
+};
+
+partial hidden keypad_keys
+xkb_symbols "overlay1" {
+
+ // Begin "Keypad" section
+
+ key <KP7> { [ KP_Home ], overlay1=<KO7> };
+ key <KP8> { [ KP_Up ], overlay1=<KO8> };
+ key <KP9> { [ KP_Prior ], overlay1=<KO9> };
+
+ key <KP4> { [ KP_Left ], overlay1=<KO4> };
+ key <KP5> { [ KP_Begin ], overlay1=<KO5> };
+ key <KP6> { [ KP_Right ], overlay1=<KO6> };
+
+ key <KP1> { [ KP_End ], overlay1=<KO1> };
+ key <KP2> { [ KP_Down ], overlay1=<KO2> };
+ key <KP3> { [ KP_Next ], overlay1=<KO3> };
+
+ key <KP0> { [ KP_Insert ], overlay1=<KO0> };
+ key <KPDL> { [ KP_Delete ], overlay1=<KODL> };
+
+ key <KO7> { [ KP_7 ] };
+ key <KO8> { [ KP_8 ] };
+ key <KO9> { [ KP_9 ] };
+
+ key <KO4> { [ KP_4 ] };
+ key <KO5> { [ KP_5 ] };
+ key <KO6> { [ KP_6 ] };
+
+ key <KO1> { [ KP_1 ] };
+ key <KO2> { [ KP_2 ] };
+ key <KO3> { [ KP_3 ] };
+
+ key <KO0> { [ KP_0 ] };
+ key <KODL> { [ KP_Decimal ] };
+
+ // End "Keypad" section
+};
+
+partial hidden keypad_keys
+xkb_symbols "overlay2" {
+
+ // Begin "Keypad" section
+
+ key <KP7> { [ KP_Home ], overlay2=<KO7> };
+ key <KP8> { [ KP_Up ], overlay2=<KO8> };
+ key <KP9> { [ KP_Prior ], overlay2=<KO9> };
+
+ key <KP4> { [ KP_Left ], overlay2=<KO4> };
+ key <KP5> { [ KP_Begin ], overlay2=<KO5> };
+ key <KP6> { [ KP_Right ], overlay2=<KO6> };
+
+ key <KP1> { [ KP_End ], overlay2=<KO1> };
+ key <KP2> { [ KP_Down ], overlay2=<KO2> };
+ key <KP3> { [ KP_Next ], overlay2=<KO3> };
+
+ key <KP0> { [ KP_Insert ], overlay2=<KO0> };
+ key <KPDL> { [ KP_Delete ], overlay2=<KODL> };
+
+ key <KO7> { [ KP_7 ] };
+ key <KO8> { [ KP_8 ] };
+ key <KO9> { [ KP_9 ] };
+
+ key <KO4> { [ KP_4 ] };
+ key <KO5> { [ KP_5 ] };
+ key <KO6> { [ KP_6 ] };
+
+ key <KO1> { [ KP_1 ] };
+ key <KO2> { [ KP_2 ] };
+ key <KO3> { [ KP_3 ] };
+
+ key <KO0> { [ KP_0 ] };
+ key <KODL> { [ KP_Decimal ] };
+
+ // End "Keypad" section
+};
+
+partial hidden default keypad_keys
+xkb_symbols "x11" {
+// Ungrab cancels server/keyboard/pointer grabs
+ key <KPDV> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Divide, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Ungrab ]
+ };
+
+// ClsGrb kills whichever client has a grab in effect
+ key <KPMU> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Multiply, VoidSymbol, VoidSymbol, VoidSymbol, XF86_ClearGrab ]
+ };
+
+// -VMode switches to the previous video mode
+ key <KPSU> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Subtract, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Prev_VMode ]
+ };
+
+ key <KP7> { [ KP_Home, KP_7 ] };
+ key <KP8> { [ KP_Up, KP_8 ] };
+ key <KP9> { [ KP_Prior, KP_9 ] };
+
+// +VMode switches to the next video mode
+ key <KPAD> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Add, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Next_VMode ]
+ };
+
+ key <KP4> { [ KP_Left, KP_4 ] };
+ key <KP5> { [ KP_Begin, KP_5 ] };
+ key <KP6> { [ KP_Right, KP_6 ] };
+
+ key <KP1> { [ KP_End, KP_1 ] };
+ key <KP2> { [ KP_Down, KP_2 ] };
+ key <KP3> { [ KP_Next, KP_3 ] };
+ key <KPEN> { [ KP_Enter ] };
+ key <KPEQ> { [ KP_Equal ] };
+
+ key <KP0> { [ KP_Insert, KP_0 ] };
+ key <KPDL> { [ KP_Delete, KP_Decimal ] };
+ key <KPPT> { [ KP_Decimal, KP_Decimal ] };
+};
+
+
+// Legacy PC keypad definition
+// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+keypad_keys
+xkb_symbols "legacy" {
+
+ include "keypad(core)"
+ include "keypad(legacymath)"
+ include "keypad(legacynumber)"
+ include "kpdl(dot)"
+};
+
+
+// Legacy Wang 725-3771-ae and 725-3771-uk keypad definition
+// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+keypad_keys
+xkb_symbols "legacy_wang" {
+
+ include "keypad(core)"
+ include "keypad(legacymath)"
+ include "keypad(legacynumber_wang)"
+ include "kpdl(dot)"
+};
+
+
+// Complete new keypad definition
+// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+keypad_keys
+xkb_symbols "oss" {
+
+ include "keypad(core)"
+ include "keypad(ossmath)"
+ include "keypad(ossnumber)"
+ include "kpdl(dotoss)"
+};
+
+
+// Latin9 restriction of new keypad definition
+// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+keypad_keys
+xkb_symbols "oss_latin9" {
+
+ include "keypad(core)"
+ include "keypad(ossmath_latin9)"
+ include "keypad(legacynumber)"
+ include "kpdl(dotoss_latin9)"
+};
+
+
+// Wang 725-3771-ae and 725-3771-uk keypad variant of oss keypad
+// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+keypad_keys
+xkb_symbols "oss_wang" {
+
+ include "keypad(core)"
+ include "keypad(ossmath)"
+ include "keypad(ossnumber_wang)"
+ include "kpdl(dotoss)"
+};
+
+
+// Forward-looking keypad definition
+// Won't work with applications that make ASCII assumptions
+// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+keypad_keys
+xkb_symbols "future" {
+
+ include "keypad(core)"
+ include "keypad(futuremath)"
+ include "keypad(ossnumber)"
+ include "kpdl(commaoss)"
+};
+
+
+// Forward-looking keypad definition
+// Won't work with applications that make ASCII assumptions
+// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+keypad_keys
+xkb_symbols "future_wang" {
+
+ include "keypad(core)"
+ include "keypad(futuremath)"
+ include "keypad(ossnumber_wang)"
+ include "kpdl(commaoss)"
+};
+
+
+// Keypad keys nobody changes
+// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+partial keypad_keys
+xkb_symbols "core" {
+
+ modifier_map Mod2 { Num_Lock };
+
+ key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
+ key <KPEN> { [ KP_Enter ] };
+ key <KPEQ> { [ KP_Equal ] };
+};
+
+
+// Legacy keypad math area
+// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+//
+// ┏━━━━━┱─────┬─────┬─────┐
+// ┃Num ┃ ₁ │ ₂ │ ₃ │ ₁ <XF86_Ungrab>
+// ┃Lock⇭┃ / │ * │ - │ ₂ <XF86_ClearGrab>
+// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
+// │ ₄ │ ₄ <XF86_Next_VMode>
+// │ │
+// ┤ │ 1 None
+// │ │ 2 Ctrl+Alt
+// │ + │
+// ╆━━━━━┪
+partial keypad_keys
+xkb_symbols "legacymath" {
+
+ key.type[Group1]="CTRL+ALT" ;
+
+ key <KPDV> { [ KP_Divide, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Ungrab ] }; // / <XF86_Ungrab>
+ key <KPMU> { [ KP_Multiply, VoidSymbol, VoidSymbol, VoidSymbol, XF86_ClearGrab ] }; // * <XF86_ClearGrab>
+ key <KPSU> { [ KP_Subtract, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Prev_VMode ] }; // - <XF86_Prev_VMode>
+
+ key <KPAD> { [ KP_Add, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Next_VMode ] }; // + <XF86_Next_VMode>
+
+};
+
+
+// Keypad math area with non-CS operators
+// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+//
+// ┏━━━━━┱─────┬─────┬─────┐
+// ┃Num ┃ ∕ ₁ │ . ₂ │ − ₃ │ ₁ <XF86_Ungrab>
+// ┃Lock⇭┃ / ÷ │ * × │ - − │ ₂ <XF86_ClearGrab>
+// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
+// │ + ₄ │ ₄ <XF86_Next_VMode>
+// │ │
+// ┤ │ 1 None
+// │ │ 2 Level3 ⇮
+// │ + + │ 3 Shift+Level3 ⇧⇮
+// ╆━━━━━┪ 4 Ctrl+Alt
+partial keypad_keys
+xkb_symbols "ossmath" {
+
+ key.type[Group1]="FOUR_LEVEL_X" ;
+
+ key <KPDV> { [ KP_Divide, 0x1002215, 0x10000F7, XF86_Ungrab ] }; // / ∕ ÷ <XF86_Ungrab>
+ key <KPMU> { [ KP_Multiply, 0x10022C5, 0x10000D7, XF86_ClearGrab ] }; // * ⋅ × <XF86_ClearGrab>
+ key <KPSU> { [ KP_Subtract, 0x1002212, 0x1002212, XF86_Prev_VMode ] }; // - − − <XF86_Prev_VMode>
+
+ key <KPAD> { [ KP_Add, 0x100002B, 0x100002B, XF86_Next_VMode ] }; // + + + <XF86_Next_VMode>
+
+};
+
+
+// Keypad math area with non-CS operators in first levels
+// As demanded by users not interested in legacy pre-unicode junk
+// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+//
+// ┏━━━━━┱─────┬─────┬─────┐
+// ┃Num ┃ / ₁ │ * ₂ │ - ₃ │ ₁ <XF86_Ungrab>
+// ┃Lock⇭┃ ∕ ÷ │ . × │ − − │ ₂ <XF86_ClearGrab>
+// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
+// │ + ₄ │ ₄ <XF86_Next_VMode>
+// │ │
+// ┤ │ 1 None
+// │ │ 2 Level3 ⇮
+// │ + + │ 3 Shift+Level3 ⇧⇮
+// ╆━━━━━┪ 4 Ctrl+Alt
+partial keypad_keys
+xkb_symbols "futuremath" {
+
+ key.type[Group1]="FOUR_LEVEL_X" ;
+
+ key <KPDV> { [ 0x1002215, KP_Divide, 0x10000F7, XF86_Ungrab ] }; // ∕ / ÷ <XF86_Ungrab>
+ key <KPMU> { [ 0x10022C5, KP_Multiply, 0x10000D7, XF86_ClearGrab ] }; // ⋅ * × <XF86_ClearGrab>
+ key <KPSU> { [ 0x1002212, KP_Subtract, 0x1002212, XF86_Prev_VMode ] }; // − - − <XF86_Prev_VMode>
+
+ key <KPAD> { [ 0x100002B, KP_Add, 0x100002B, XF86_Next_VMode ] }; // + + + <XF86_Next_VMode>
+};
+
+
+// Keypad math area with non-CS operators, restricted to latin9
+// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+//
+// ┏━━━━━┱─────┬─────┬─────┐
+// ┃Num ┃ / ₁ │ · ₂ │ - ₃ │ ₁ <XF86_Ungrab>
+// ┃Lock⇭┃ / ÷ │ * × │ - - │ ₂ <XF86_ClearGrab>
+// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
+// │ + ₄ │ ₄ <XF86_Next_VMode>
+// │ │
+// ┤ │ 1 None
+// │ │ 2 Level3 ⇮
+// │ + + │ 3 Shift+Level3 ⇧⇮
+// ╆━━━━━┪ 4 Ctrl+Alt
+partial keypad_keys
+xkb_symbols "ossmath_latin9" {
+
+ key.type[Group1]="FOUR_LEVEL_X";
+
+ key <KPDV> { [ KP_Divide, slash, division, XF86_Ungrab ] }; // / / ÷ <XF86_Ungrab>
+ key <KPMU> { [ KP_Multiply, periodcentered, multiply, XF86_ClearGrab ] }; // * · × <XF86_ClearGrab>
+ key <KPSU> { [ KP_Subtract, minus, minus, XF86_Prev_VMode ] }; // - - - <XF86_Prev_VMode>
+
+ key <KPAD> { [ KP_Add, plus, plus, XF86_Next_VMode ] }; // + + + <XF86_Next_VMode>
+};
+
+
+// Legacy keypad number area
+// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+//
+// ┏━━━━━┱ ⇱ Home
+// ┃Num ┃ ⇲ End
+// ┃Lock⇭┃ ⇞ Page up
+// ┡━━━━━╃─────┼─────┼ ⇟ Page down
+// │ 7 │ 8 │ 9 │ ⇞ Page up
+// │ ⇱ │ ⇧ │ ⇞ │ ⎀ Insert
+// ├─────┼─────┼─────┤ ␥ Delete
+// │ 4 │ 5 │ 6 │ ⇦⇧⇨⇩ Directions
+// │ ⇦ │ │ ⇨ │
+// ├─────┼─────┼─────╆
+// │ 1 │ 2 │ 3 ┃
+// │ ⇲ │ ⇩ │ ⇟ ┃ 1 None
+// ├─────┴─────┼─────┨ 2 Num Lock ⇭
+// │ 0 │
+// │ ⎀ │
+// └───────────┴
+partial keypad_keys
+xkb_symbols "legacynumber" {
+
+ key.type[Group1]="KEYPAD" ;
+
+ key <KP7> { [ KP_Home, KP_7 ] }; // <home> 7
+ key <KP8> { [ KP_Up, KP_8 ] }; // <up> 8
+ key <KP9> { [ KP_Prior, KP_9 ] }; // <prior> 9
+
+ key <KP4> { [ KP_Left, KP_4 ] }; // <left> 4
+ key <KP5> { [ KP_Begin, KP_5 ] }; // <begin> 5
+ key <KP6> { [ KP_Right, KP_6 ] }; // <right> 6
+
+ key <KP1> { [ KP_End, KP_1 ] }; // <end> 1
+ key <KP2> { [ KP_Down, KP_2 ] }; // <down> 2
+ key <KP3> { [ KP_Next, KP_3 ] }; // <next> 3
+
+ key <KP0> { [ KP_Insert, KP_0 ] }; // <insert> 0
+};
+
+
+// Legacy Wang 725-3771-ae and 725-3771-uk keypad number area
+// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+// This is actually a three-level keypad, declared as four-level
+// to avoid defining a new type
+//
+// ┏━━━━━┱ ⇱ Home
+// ┃Num ┃ ⇲ End
+// ┃Lock⇭┃ ⇞ Page up
+// ┡━━━━━╃─────┼─────┼ ⇟ Page down
+// │ 7 │ 8 │ 9 │ ⇞ Page up
+// │ ⇱ < │ ⇧ > │ ⇞ ^ │ ⎀ Insert
+// ├─────┼─────┼─────┤ ␥ Delete
+// │ 4 │ 5 │ 6 │ ⇦⇧⇨⇩ Directions
+// │ ⇦ [ │ ] │ ⇨ $ │
+// ├─────┼─────┼─────╆
+// │ 1 │ 2 │ 3 ┃
+// │ ⇲ & │ ⇩ @ │ ⇟ # ┃ 1 None
+// ├─────┴─────┼─────┨ 2 Num Lock ⇭
+// │ 0 │ 3 Level3 ⇮
+// │ ⎀ │
+// └───────────┴
+partial keypad_keys
+xkb_symbols "legacynumber_wang" {
+
+ key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
+
+ key <KP7> { [ KP_Home, KP_7, less ] }; // <home> 7 <
+ key <KP8> { [ KP_Up, KP_8, greater ] }; // <up> 8 >
+ key <KP9> { [ KP_Prior, KP_9, asciicircum ] }; // <prior> 9 ^
+
+ key <KP4> { [ KP_Left, KP_4, bracketleft ] }; // <left> 4 [
+ key <KP5> { [ KP_Begin, KP_5, bracketright ] }; // <begin> 5 ]
+ key <KP6> { [ KP_Right, KP_6, dollar ] }; // <right> 6 $
+
+ key <KP1> { [ KP_End, KP_1, ampersand ] }; // <end> 1 &
+ key <KP2> { [ KP_Down, KP_2, at ] }; // <down> 2 @
+ key <KP3> { [ KP_Next, KP_3, numbersign ] }; // <next> 3 #
+
+ key <KP0> { [ KP_Insert, KP_0, apostrophe ] }; // <insert> 0 '
+};
+
+
+// Keypad number area with arrow symbols
+// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+//
+// ┏━━━━━┱ ⇱ Home
+// ┃Num ┃ ⇲ End
+// ┃Lock⇭┃ ⇞ Page up
+// ┡━━━━━╃─────┼─────┼ ⇟ Page down
+// │ 7 ⇖ │ 8 ⇑ │ 9 ⇗ │ ⇞ Page up
+// │ ⇱ ↖ │ ⇧ ↑ │ ⇞ ↗ │ ⎀ Insert
+// ├─────┼─────┼─────┤ ␥ Delete
+// │ 4 ⇐ │ 5 ⇔ │ 6 ⇗ │ ⇦⇧⇨⇩ Directions
+// │ ⇦ ← │ ↔ │ ⇨ ↗ │ ⍽ narrow no-break space
+// ├─────┼─────┼─────╆
+// │ 1 ⇙ │ 2 ⇓ │ 3 ⇘ ┃
+// │ ⇲ ↙ │ ⇩ ↓ │ ⇟ ↘ ┃ 1 None
+// ├─────┴─────┼─────┨ 2 Num Lock ⇭
+// │ 0 ⇕ │ 3 Level3 ⇮
+// │ ⎀ ↕ │ 4 Shift+Level3 ⇧⇮
+// └───────────┴
+partial keypad_keys
+xkb_symbols "ossnumber" {
+
+ key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
+
+ key <KP7> { [ KP_Home, KP_7, 0x1002196, 0x10021D6 ] }; // <home> 7 ↖ ⇖
+ key <KP8> { [ KP_Up, KP_8, 0x1002191, 0x10021D1 ] }; // <up> 8 ↑ ⇑
+ key <KP9> { [ KP_Prior, KP_9, 0x1002197, 0x10021D7 ] }; // <prior> 9 ↗ ⇗
+
+ key <KP4> { [ KP_Left, KP_4, 0x1002190, 0x10021D0 ] }; // <left> 4 ← ⇐
+ key <KP5> { [ KP_Begin, KP_5, 0x1002194, 0x10021D4 ] }; // <begin> 5 ↔ ⇔
+ key <KP6> { [ KP_Right, KP_6, 0x1002192, 0x10021D2 ] }; // <right> 6 → ⇒
+
+ key <KP1> { [ KP_End, KP_1, 0x1002199, 0x10021D9 ] }; // <end> 1 ↙ ⇙
+ key <KP2> { [ KP_Down, KP_2, 0x1002193, 0x10021D3 ] }; // <down> 2 ↓ ⇓
+ key <KP3> { [ KP_Next, KP_3, 0x1002198, 0x10021D8 ] }; // <next> 3 ↘ ⇘
+
+ key <KP0> { [ KP_Insert, KP_0, 0x1002195, 0x10021D5 ] }; // <insert> 0 ↕ ⇕
+};
+
+
+// Wang 725-3771-ae and 725-3771-uk keypad number area with additional arrow symbols
+// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
+//
+// ┏━━━━━┱ ⇱ Home
+// ┃Num ┃ ⇲ End
+// ┃Lock⇭┃ ⇞ Page up
+// ┡━━━━━╃─────┼─────┼ ⇟ Page down
+// │ 7 ↖ │ 8 ↑ │ 9 ↗ │ ⇞ Page up
+// │ ⇱ < │ ⇧ > │ ⇞ ^ │ ⎀ Insert
+// ├─────┼─────┼─────┤ ␥ Delete
+// │ 4 ← │ 5 ↔ │ 6 → │ ⇦⇧⇨⇩ Directions
+// │ ⇦ [ │ ] │ ⇨ $ │ ⍽ narrow no-break space
+// ├─────┼─────┼─────╆
+// │ 1 ↙ │ 2 ↓ │ 3 ↘ ┃
+// │ ⇲ & │ ⇩ @ │ ⇟ # ┃ 1 None
+// ├─────┴─────┼─────┨ 2 Num Lock ⇭
+// │ 0 ↕ │ 3 Level3 ⇮
+// │ ⎀ ' │ 4 Shift+Level3 ⇧⇮
+// └───────────┴
+partial keypad_keys
+xkb_symbols "ossnumber_wang" {
+
+ key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
+
+ key <KP7> { [ KP_Home, KP_7, less, 0x1002196 ] }; // <home> 7 < ↖
+ key <KP8> { [ KP_Up, KP_8, greater, 0x1002191 ] }; // <up> 8 > ↑
+ key <KP9> { [ KP_Prior, KP_9, asciicircum, 0x1002197 ] }; // <prior> 9 ^ ↗
+
+ key <KP4> { [ KP_Left, KP_4, bracketleft, 0x1002190 ] }; // <left> 4 [ ←
+ key <KP5> { [ KP_Begin, KP_5, bracketright, 0x1002194 ] }; // <begin> 5 ] ↔
+ key <KP6> { [ KP_Right, KP_6, dollar, 0x1002192 ] }; // <right> 6 $ →
+
+ key <KP1> { [ KP_End, KP_1, ampersand, 0x1002199 ] }; // <end> 1 & ↙
+ key <KP2> { [ KP_Down, KP_2, at, 0x1002193 ] }; // <down> 2 @ ↓
+ key <KP3> { [ KP_Next, KP_3, numbersign, 0x1002198 ] }; // <next> 3 # ↘
+
+ key <KP0> { [ KP_Insert, KP_0, apostrophe, 0x1002195 ] }; // <insert> 0 ' ↕
+};
+
+// Standard base "pc" layout only contains cursor keys, and then gets
+// augmented with the digits later. If you define your own layout for
+// the numpad you can inherit the cursors, but you'll have to define
+// the digits yourself. This module can be included in the rules to
+// define math operators; these are the variants used in computer
+// languages that are based on ASCII. NoSymbol doesn't mean that
+// nothing is bound to the key but that no assignment is done here.
+// srvr_ctrl(stdkeypad) and keypad(x11) declare the operator keys to
+// be of type CTRL+ALT in order to assign server control events to
+// them, but it uses the second level which is overwritten if we have
+// more than one definition (shift state) for the key. Instead, here
+// the commands are put at the fourth level.
+partial keypad_keys
+xkb_symbols "ops" {
+ key <KPDV> { [ NoSymbol, slash, NoSymbol, XF86_Ungrab ] };
+ key <KPMU> { [ NoSymbol, asterisk, NoSymbol, XF86_ClearGrab ] };
+ key <KPSU> { [ NoSymbol, minus, NoSymbol, XF86_Prev_VMode ] };
+ key <KPAD> { [ NoSymbol, plus, NoSymbol, XF86_Next_VMode ] };
+ key <KPEQ> { [ NoSymbol, equal ] };
+};
+
+// Hexadecimal Numpad, by Roland Kaufmann <rlndkfmn at gmail dot com>
+// License: BSD (also covers variant with ATM digit order)
+// Third-level gives the letters used in hexadecimal numbers, or
+// columns in small spreadsheets. As a bonus, having 'e' available at
+// the center of the keyboard makes it easy to enter floating point
+// numbers in scientific notation.
+// Equal is added to start formulas (most numpads on PCs don't have
+// their own equal key), comma as a list separator (as most
+// programming languages wants period as a decimal separator) and
+// colon to enter times and ranges. Someone also may want to represent
+// multiplication and division in prose using x and colon.
+// Two first levels are specified as NoSymbol to not override any
+// previous specification. Combine this with another keypad specifier,
+// e.g. "legacy".
+partial keypad_keys
+xkb_symbols "hex" {
+ key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
+
+ // None NumLock AltGr
+ // symbol row
+ key <KPDV> { [ NoSymbol, NoSymbol, parenleft ] };
+ key <KPMU> { [ NoSymbol, NoSymbol, parenright ] };
+ key <KPSU> { [ NoSymbol, NoSymbol, dollar ] };
+
+ // upper row
+ key <KP7> { [ NoSymbol, NoSymbol, a ] };
+ key <KP8> { [ NoSymbol, NoSymbol, b ] };
+ key <KP9> { [ NoSymbol, NoSymbol, c ] };
+
+ // home row
+ key <KP4> { [ NoSymbol, NoSymbol, d ] };
+ key <KP5> { [ NoSymbol, NoSymbol, e ] };
+ key <KP6> { [ NoSymbol, NoSymbol, f ] };
+ key <KPAD> { [ NoSymbol, NoSymbol, comma ] };
+
+ // lower row
+ key <KP1> { [ NoSymbol, NoSymbol, equal ] };
+ key <KP2> { [ NoSymbol, NoSymbol, x ] };
+ key <KP3> { [ NoSymbol, NoSymbol, colon ] };
+
+ // decimal row
+ key <KP0> { [ NoSymbol, NoSymbol, backslash ] };
+};
+
+// Main numbers follows the traditions from ATMs and phones with
+// numbers increasing downwards to the right. (It is easier to
+// change the keyboard layout than to reprogram your local ATM;
+// also cell-phones are becoming more common while calculators are
+// becoming more rare).
+// First level is left unspecified, so it may be combined with another
+// layout, e.g. "legacy".
+partial keypad_keys
+xkb_symbols "atm" {
+ // upper row
+ key <KP7> { [ NoSymbol, KP_1 ] };
+ key <KP8> { [ NoSymbol, KP_2 ] };
+ key <KP9> { [ NoSymbol, KP_3 ] };
+
+ // lower row
+ key <KP1> { [ NoSymbol, KP_7 ] };
+ key <KP2> { [ NoSymbol, KP_8 ] };
+ key <KP3> { [ NoSymbol, KP_9 ] };
+};
+
+
+partial default modifier_keys
+xkb_symbols "pointerkeys" {
+ key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
+};
+
+// Only numbers, operators and decimal separator,
+// as seen on keypad overlay on Japanese keyboard.
+// ┌─┬─┬─┬─┐
+// │7│8│9│*│
+// ├─┼─┼─┼─┤
+// │4│5│6│-│
+// ├─┼─┼─┼─┤
+// │1│2│3│+│
+// ├─┼─┼─┼─┤
+// │0│ │·│/│
+// └─┴─┴─┴─┘
+partial keypad_keys
+xkb_symbols "numoperdecsep" {
+ key <KO7> { [ KP_7 ] };
+ key <KO8> { [ KP_8 ] };
+ key <KO9> { [ KP_9 ] };
+// ClsGrb kills whichever client has a grab in effect
+ key <KOMU> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Multiply, VoidSymbol, VoidSymbol, VoidSymbol, XF86_ClearGrab ]
+ };
+
+ key <KO4> { [ KP_4 ] };
+ key <KO5> { [ KP_5 ] };
+ key <KO6> { [ KP_6 ] };
+// -VMode switches to the previous video mode
+ key <KOSU> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Subtract, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Prev_VMode ]
+ };
+
+ key <KO1> { [ KP_1 ] };
+ key <KO2> { [ KP_2 ] };
+ key <KO3> { [ KP_3 ] };
+// +VMode switches to the next video mode
+ key <KOAD> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Add, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Next_VMode ]
+ };
+
+ key <KO0> { [ KP_0 ] };
+ key <KODL> { [ KP_Decimal ] };
+// Ungrab cancels server/keyboard/pointer grabs
+ key <KODV> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Divide, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Ungrab ]
+ };
+};
diff --git a/xorg-server/xkeyboard-config/symbols/srvr_ctrl b/xorg-server/xkeyboard-config/symbols/srvr_ctrl
index 8bdf503a1..7d47d66a3 100644
--- a/xorg-server/xkeyboard-config/symbols/srvr_ctrl
+++ b/xorg-server/xkeyboard-config/symbols/srvr_ctrl
@@ -12,25 +12,25 @@ xkb_symbols "stdkeypad" {
// Ungrab cancels server/keyboard/pointer grabs
key <KPDV> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Divide, XF86_Ungrab ]
+ symbols[Group1]= [ KP_Divide, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Ungrab ]
};
// ClsGrb kills whichever client has a grab in effect
key <KPMU> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Multiply, XF86_ClearGrab ]
+ symbols[Group1]= [ KP_Multiply, VoidSymbol, VoidSymbol, VoidSymbol, XF86_ClearGrab ]
};
// -VMode switches to the previous video mode
key <KPSU> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Subtract, XF86_Prev_VMode ]
+ symbols[Group1]= [ KP_Subtract, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Prev_VMode ]
};
// +VMode switches to the next video mode
key <KPAD> {
type="CTRL+ALT",
- symbols[Group1]= [ KP_Add, XF86_Next_VMode]
+ symbols[Group1]= [ KP_Add, VoidSymbol, VoidSymbol, VoidSymbol, XF86_Next_VMode]
};
};
diff --git a/xorg-server/xkeyboard-config/symbols/terminate b/xorg-server/xkeyboard-config/symbols/terminate
index 8bb528cf8..96dd6e8f2 100644
--- a/xorg-server/xkeyboard-config/symbols/terminate
+++ b/xorg-server/xkeyboard-config/symbols/terminate
@@ -1,7 +1,7 @@
-partial default modifier_keys
-xkb_symbols "ctrl_alt_bksp" {
- key <BKSP> {
- type="CTRL+ALT",
- symbols[Group1] = [ NoSymbol, Terminate_Server ]
- };
-};
+partial default modifier_keys
+xkb_symbols "ctrl_alt_bksp" {
+ key <BKSP> {
+ type="CTRL+ALT",
+ symbols[Group1] = [ NoSymbol, VoidSymbol, VoidSymbol, VoidSymbol, Terminate_Server ]
+ };
+};