diff options
79 files changed, 738 insertions, 2562 deletions
diff --git a/X11/xtrans/Makefile.am b/X11/xtrans/Makefile.am index 9ff172370..38c34c33f 100644 --- a/X11/xtrans/Makefile.am +++ b/X11/xtrans/Makefile.am @@ -7,7 +7,6 @@ Xtransinclude_HEADERS = \ Xtransint.h \ Xtranslcl.c \ Xtranssock.c \ - Xtranstli.c \ Xtransutil.c \ transport.c diff --git a/X11/xtrans/Xtrans.c b/X11/xtrans/Xtrans.c index 1f37c4341..57a001a61 100644 --- a/X11/xtrans/Xtrans.c +++ b/X11/xtrans/Xtrans.c @@ -84,11 +84,6 @@ from The Open Group. static Xtransport_table Xtransports[] = { -#if defined(STREAMSCONN) - { &TRANS(TLITCPFuncs), TRANS_TLI_TCP_INDEX }, - { &TRANS(TLIINETFuncs), TRANS_TLI_INET_INDEX }, - { &TRANS(TLITLIFuncs), TRANS_TLI_TLI_INDEX }, -#endif /* STREAMSCONN */ #if defined(TCPCONN) { &TRANS(SocketTCPFuncs), TRANS_SOCKET_TCP_INDEX }, #if defined(IPv6) && defined(AF_INET6) diff --git a/X11/xtrans/Xtranstli.c b/X11/xtrans/Xtranstli.c deleted file mode 100644 index 397c946df..000000000 --- a/X11/xtrans/Xtranstli.c +++ /dev/null @@ -1,1407 +0,0 @@ -/* - -Copyright 1993, 1994, 1998 The Open Group - -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. - -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 OPEN GROUP 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 name of The Open Group 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 Open Group. - - * Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA - * - * 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 NCR not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. NCR makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN - * NO EVENT SHALL NCR 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. - */ - -#include <sys/un.h> -#include <stropts.h> -#include <poll.h> -#include <tiuser.h> - -#include <netdir.h> -#include <netconfig.h> - - -/* - * This is the TLI implementation of the X Transport service layer - */ - -typedef struct _TLItrans2dev { - char *transname; - char *protofamily; - char *devcotsname; - char *devcltsname; - int family; -} TLItrans2dev; - -static TLItrans2dev TLItrans2devtab[] = { - {"inet","inet","/dev/tcp","/dev/udp",AF_INET}, - {"tcp","inet","/dev/tcp","/dev/udp",AF_INET}, - {"tli","loopback","/dev/ticots","/dev/ticlts",AF_UNIX}, -}; - -#define NUMTLIFAMILIES (sizeof(TLItrans2devtab)/sizeof(TLItrans2dev)) - -/* - * The local TLI connection, is a form of a local connection, so use a - * sockaddr_un for the address so that it will be treated just like the other - * local transports such as UNIX domain sockets, pts, and named. - */ - -#if defined(X11_t) -#define TLINODENAME "TLI:xserver" -#endif - -#if defined(XIM_t) -#define TLINODENAME "TLI:xim" -#endif - -#if defined(FS_t) || defined(FONT_t) -#define TLINODENAME "TLI:fontserver" -#endif - -#if defined(ICE_t) -#define TLINODENAME "TLI:ICE" -#endif - -#if defined(TEST_t) -#define TLINODENAME "TLI:test" -#endif - -#ifndef PORTBUFSIZE -#ifdef TRANS_SERVER -#define PORTBUFSIZE 64 -#else -#ifdef TRANS_CLIENT -#define PORTBUFSIZE 64 -#endif -#endif -#endif - - -/* - * These are some utility function used by the real interface function below. - */ - -static int -TRANS(TLISelectFamily)(char *family) - -{ - int i; - - prmsg(3,"TLISelectFamily(%s)\n", family); - - for(i=0;i<NUMTLIFAMILIES;i++) - { - if( !strcmp(family,TLItrans2devtab[i].transname) ) - return i; - } - return -1; -} - - -/* - * This function gets the local address of the transport and stores it in the - * XtransConnInfo structure for the connection. - */ - -static int -TRANS(TLIGetAddr)(XtransConnInfo ciptr) - -{ - Xtransaddr sockname; - struct netbuf netbuf; - - prmsg(3,"TLIGetAddr(%x)\n", ciptr); - - netbuf.buf=(char *)&sockname; - netbuf.len=sizeof(sockname); - netbuf.maxlen=sizeof(sockname); - - if( t_getname(ciptr->fd,&netbuf,LOCALNAME) < 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); - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - if( ciptr->addr ) - free(ciptr->addr); - - if( (ciptr->addr = malloc(netbuf.len)) == NULL ) - { - prmsg(1, "TLIGetAddr: Can't allocate space for the addr\n"); - return -1; - } - - ciptr->family=((struct sockaddr *) &sockname)->sa_family; - ciptr->addrlen=netbuf.len; - memcpy(ciptr->addr,&sockname,ciptr->addrlen); - - return 0; -} - - -/* - * This function gets the remote address of the socket and stores it in the - * XtransConnInfo structure for the connection. - */ - -static int -TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr) - -{ - Xtransaddr sockname; - struct netbuf netbuf; - - prmsg(3,"TLIGetPeerAddr(%x)\n", ciptr); - - netbuf.buf=(char *)&sockname; - netbuf.len=sizeof(sockname); - netbuf.maxlen=sizeof(sockname); - - if( t_getname(ciptr->fd,&netbuf,REMOTENAME) < 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); - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - if( ciptr->peeraddr ) - free(ciptr->peeraddr); - - if( (ciptr->peeraddr = malloc(netbuf.len)) == NULL ) - { - prmsg(1, - "TLIGetPeerAddr: Can't allocate space for the addr\n"); - return -1; - } - - ciptr->peeraddrlen=netbuf.len; - memcpy(ciptr->peeraddr,&sockname,ciptr->peeraddrlen); - - return 0; -} - - -/* - * This function will establish a local name for the transport. This function - * do extra work for the local tli connection. It must create a sockaddr_un - * format address so that it will look like an AF_UNIX connection to the - * higher layer. - * - * This function will only be called by the OPENC?TSClient() functions since - * the local address is set up in the CreateListner() for the server ends. - */ - -static int -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); - - 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"); - return -1; - } - - if( (sunaddr=(struct sockaddr_un *) - malloc(sizeof(struct sockaddr_un))) == NULL ) - { - prmsg(1, - "TLITLIBindLocal: failed to allocate a sockaddr_un\n"); - t_free((char *)req,T_BIND); - return -1; - } - - sunaddr->sun_family=AF_UNIX; - -#ifdef nuke - if( *port == '/' ) { /* A full pathname */ - (void) strcpy(sunaddr->sun_path, port); - } else { - (void) sprintf(sunaddr->sun_path,"%s%s", TLINODENAME, port ); - } -#endif /*NUKE*/ - - (void) sprintf(sunaddr->sun_path,"%s%d", - TLINODENAME, getpid()^time(NULL) ); - - prmsg(4, "TLITLIBindLocal: binding to %s\n", - sunaddr->sun_path); - - req->addr.buf=(char *)sunaddr; - req->addr.len=sizeof(*sunaddr); - req->addr.maxlen=sizeof(*sunaddr); - } - - if( t_bind(fd, req, NULL) < 0 ) - { - prmsg(1, - "TLIBindLocal: Unable to bind TLI device to %s\n", - port); - if (sunaddr) - free((char *) sunaddr); - if (req) - t_free((char *)req,T_BIND); - return -1; - } - return 0; -} - -static XtransConnInfo -TRANS(TLIOpen)(char *device) - -{ - XtransConnInfo ciptr; - - prmsg(3,"TLIOpen(%s)\n", device); - - if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) - { - 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); - free(ciptr); - return NULL; - } - - return ciptr; -} - - -#ifdef TRANS_REOPEN - -static XtransConnInfo -TRANS(TLIReopen)(char *device, int fd, char *port) - -{ - XtransConnInfo ciptr; - - prmsg(3,"TLIReopen(%s,%d, %s)\n", device, fd, port ); - - if (t_sync (fd) < 0) - { - prmsg(1, "TLIReopen: t_sync failed\n"); - return NULL; - } - - if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) - { - prmsg(1, "TLIReopen: calloc failed\n"); - return NULL; - } - - ciptr->fd = fd; - - return ciptr; -} - -#endif /* TRANS_REOPEN */ - - -static int -TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port, - struct netbuf *netbufp) - -{ - struct netconfig *netconfigp; - struct nd_hostserv nd_hostserv; - struct nd_addrlist *nd_addrlistp = NULL; - void *handlep; - long lport; - - prmsg(3,"TLIAddrToNetbuf(%d,%s,%s)\n", tlifamily, host, port ); - - if( (handlep=setnetconfig()) == NULL ) - return -1; - - lport = strtol (port, (char**)NULL, 10); - if (lport < 1024 || lport > USHRT_MAX) - return -1; - - nd_hostserv.h_host = host; - if( port && *port ) { - nd_hostserv.h_serv = port; - } else { - nd_hostserv.h_serv = NULL; - } - - while( (netconfigp=getnetconfig(handlep)) != NULL ) - { - if( strcmp(netconfigp->nc_protofmly, - TLItrans2devtab[tlifamily].protofamily) != 0 ) - continue; - 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); - prmsg(5, "TLIAddrToNetbuf: %s\n",taddr2uaddr(netconfigp,nd_addrlistp->n_addrs)); - - memcpy(netbufp->buf,nd_addrlistp->n_addrs->buf, - nd_addrlistp->n_addrs->len); - netbufp->len=nd_addrlistp->n_addrs->len; - endnetconfig(handlep); - return 0; - } - } - endnetconfig(handlep); - - return -1; -} - -/* - * These functions are the interface supplied in the Xtransport structure - */ - -#ifdef TRANS_CLIENT - -static XtransConnInfo -TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i; - - 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); - return NULL; - } - - if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL ) - { - 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, - "TLIOpenCOTSClient: ...TLITLIBindLocal() failed: %d\n", - errno); - t_close(ciptr->fd); - free(ciptr); - return NULL; - } - - if( TRANS(TLIGetAddr)(ciptr) < 0 ) - { - prmsg(1, - "TLIOpenCOTSClient: ...TLIGetAddr() failed: %d\n", - errno); - t_close(ciptr->fd); - free(ciptr); - return NULL; - } - - /* Save the TLIFamily for later use in TLIAddrToNetbuf() lookups */ - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_CLIENT */ - - -#ifdef TRANS_SERVER - -static XtransConnInfo -TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i; - - prmsg(2,"TLIOpenCOTSServer(%s,%s,%s)\n", protocol, host, port ); - - if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 ) - { - prmsg(1, - "TLIOpenCOTSServer: Unable to determine device for %s\n", - thistrans->TransName); - return NULL; - } - - if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL ) - { - prmsg(1, - "TLIOpenCOTSServer: Unable to open device for %s\n", - thistrans->TransName); - return NULL; - } - - /* Set the family type */ - - ciptr->family = TLItrans2devtab[i].family; - - - /* Save the TLIFamily for later use in TLIAddrToNetbuf() lookups */ - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_SERVER */ - - -#ifdef TRANS_CLIENT - -static XtransConnInfo -TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i; - - prmsg(2,"TLIOpenCLTSClient(%s,%s,%s)\n", protocol, host, port ); - - if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 ) - { - prmsg(1, - "TLIOpenCLTSClient: Unable to determine device for %s\n", - thistrans->TransName); - return NULL; - } - - if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL ) - { - prmsg(1, - "TLIOpenCLTSClient: Unable to open device for %s\n", - thistrans->TransName); - return NULL; - } - - if( TRANS(TLITLIBindLocal)(ciptr->fd,TLItrans2devtab[i].family,port) < 0 ) - { - prmsg(1, - "TLIOpenCLTSClient: ...TLITLIBindLocal() failed: %d\n", - errno); - t_close(ciptr->fd); - free(ciptr); - return NULL; - } - - if( TRANS(TLIGetAddr)(ciptr) < 0 ) - { - prmsg(1, - "TLIOpenCLTSClient: ...TLIGetPeerAddr() failed: %d\n", - errno); - t_close(ciptr->fd); - free(ciptr); - return NULL; - } - - return ciptr; -} - -#endif /* TRANS_CLIENT */ - - -#ifdef TRANS_SERVER - -static XtransConnInfo -TRANS(TLIOpenCLTSServer)(Xtransport *thistrans, char *protocol, - char *host, char *port) - -{ - XtransConnInfo ciptr; - int i; - - prmsg(2,"TLIOpenCLTSServer(%s,%s,%s)\n", protocol, host, port ); - - if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 ) - { - prmsg(1, - "TLIOpenCLTSServer: Unable to determine device for %s\n", - thistrans->TransName); - return NULL; - } - - if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL ) - { - prmsg(1, - "TLIOpenCLTSServer: Unable to open device for %s\n", - thistrans->TransName); - return NULL; - } - - return ciptr; -} - -#endif /* TRANS_SERVER */ - - -#ifdef TRANS_REOPEN - -static XtransConnInfo -TRANS(TLIReopenCOTSServer)(Xtransport *thistrans, int fd, char *port) - -{ - XtransConnInfo ciptr; - int i; - - prmsg(2,"TLIReopenCOTSServer(%d, %s)\n", fd, port); - - if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 ) - { - prmsg(1, - "TLIReopenCOTSServer: Unable to determine device for %s\n", - thistrans->TransName); - return NULL; - } - - if( (ciptr=TRANS(TLIReopen)( - TLItrans2devtab[i].devcotsname, fd, port)) == NULL ) - { - prmsg(1, - "TLIReopenCOTSServer: Unable to open device for %s\n", - thistrans->TransName); - return NULL; - } - - /* Save the TLIFamily for later use in TLIAddrToNetbuf() lookups */ - - ciptr->index = i; - - return ciptr; -} - - -static XtransConnInfo -TRANS(TLIReopenCLTSServer)(Xtransport *thistrans, int fd, char *port) - -{ - XtransConnInfo ciptr; - int i; - - prmsg(2,"TLIReopenCLTSServer(%d, %s)\n", fd, port); - - if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 ) - { - prmsg(1, - "TLIReopenCLTSServer: Unable to determine device for %s\n", - thistrans->TransName); - return NULL; - } - - if( (ciptr=TRANS(TLIReopen)( - TLItrans2devtab[i].devcltsname, fd, port)) == NULL ) - { - prmsg(1, - "TLIReopenCLTSServer: Unable to open device for %s\n", - thistrans->TransName); - return NULL; - } - - ciptr->index = i; - - return ciptr; -} - -#endif /* TRANS_REOPEN */ - - -static int -TRANS(TLISetOption)(XtransConnInfo ciptr, int option, int arg) - -{ - prmsg(2,"TLISetOption(%d,%d,%d)\n", ciptr->fd, option, arg ); - - return -1; -} - - -#ifdef TRANS_SERVER - -static int -TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req) - -{ - struct t_bind *ret; - - 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"); - 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"); - t_free((char *)req,T_BIND); - t_free((char *)ret,T_BIND); - return TRANS_CREATE_LISTENER_FAILED; - } - - if( memcmp(req->addr.buf,ret->addr.buf,req->addr.len) != 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; - } - - /* - * Everything looks good: fill in the XtransConnInfo structure. - */ - - if( (ciptr->addr = malloc(ret->addr.len)) == NULL ) - { - 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; - } - - ciptr->addrlen=ret->addr.len; - memcpy(ciptr->addr,ret->addr.buf,ret->addr.len); - - t_free((char *)req,T_BIND); - t_free((char *)ret, T_BIND); - - return 0; -} - - -static int -TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags) - -{ - char portbuf[PORTBUFSIZE]; - struct t_bind *req; - struct sockaddr_in *sinaddr; - long tmpport; - - prmsg(2,"TLIINETCreateListener(%x->%d,%s)\n", ciptr, - ciptr->fd, port ? port : "NULL" ); - -#ifdef X11_t - /* - * X has a well known port, that is transport dependent. It is easier - * to handle it here, than try and come up with a transport independent - * representation that can be passed in and resolved the usual way. - * - * The port that is passed here is really a string containing the idisplay - * from ConnectDisplay(). - */ - - if (is_numeric (port)) - { - tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); - sprintf(portbuf,"%u", tmpport); - port = portbuf; - } -#endif - - if( (req=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,T_ALL)) == NULL ) - { - 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, - "TLIINETCreateListener: can't resolve name:HOST_SELF.%s\n", - port); - t_free((char *)req,T_BIND); - return TRANS_CREATE_LISTENER_FAILED; - } - } else { - sinaddr=(struct sockaddr_in *) req->addr.buf; - sinaddr->sin_family=AF_INET; - sinaddr->sin_port=htons(0); - sinaddr->sin_addr.s_addr=0; - } - - /* Set the qlen */ - - req->qlen=1; - - return TRANS(TLICreateListener)(ciptr, req); -} - - -static int -TRANS(TLITLICreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags) - -{ - struct t_bind *req; - struct sockaddr_un *sunaddr; - int ret_value; - - 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"); - 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"); - t_free((char *)req,T_BIND); - return TRANS_CREATE_LISTENER_FAILED; - } - - sunaddr->sun_family=AF_UNIX; - if( port && *port ) { - if( *port == '/' ) { /* A full pathname */ - (void) strcpy(sunaddr->sun_path, port); - } else { - (void) sprintf(sunaddr->sun_path,"%s%s", TLINODENAME, port ); - } - } else { - (void) sprintf(sunaddr->sun_path,"%s%d", TLINODENAME, getpid()); - } - - req->addr.buf=(char *)sunaddr; - req->addr.len=sizeof(*sunaddr); - req->addr.maxlen=sizeof(*sunaddr); - - /* Set the qlen */ - - req->qlen=1; - - ret_value = TRANS(TLICreateListener)(ciptr, req); - - free((char *) sunaddr); - - return ret_value; -} - - -static XtransConnInfo -TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) - -{ - struct t_call *call; - XtransConnInfo newciptr; - int i; - - 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"); - *status = TRANS_ACCEPT_BAD_MALLOC; - return NULL; - } - - if( t_listen(ciptr->fd,call) < 0 ) - { - extern char *t_errlist[]; - extern int t_errno; - 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; - } - - /* - * Now we need to set up the new endpoint for the incoming connection. - */ - - i=ciptr->index; /* Makes the next line more readable */ - - if( (newciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL ) - { - prmsg(1, "TLIAccept() failed to open a new endpoint\n"); - t_free((char *)call,T_CALL); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - if( TRANS(TLITLIBindLocal)(newciptr->fd,TLItrans2devtab[i].family,"") < 0 ) - { - prmsg(1, - "TLIAccept: TRANS(TLITLIBindLocal)() failed: %d\n", - errno); - t_free((char *)call,T_CALL); - t_close(newciptr->fd); - free(newciptr); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - - if( t_accept(ciptr->fd,newciptr->fd,call) < 0 ) - { - extern char *t_errlist[]; - extern int t_errno; - 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); - switch( evtype ) - { - case T_DISCONNECT: - if( t_rcvdis(ciptr->fd, NULL) < 0 ) - { - prmsg(1, "TLIAccept() t_rcvdis() failed\n"); - prmsg(1, "TLIAccept: %s\n", t_errlist[t_errno]); - } - break; - default: - break; - } - } - t_free((char *)call,T_CALL); - t_close(newciptr->fd); - free(newciptr); - *status = TRANS_ACCEPT_FAILED; - return NULL; - } - - t_free((char *)call,T_CALL); - - if( TRANS(TLIGetAddr)(newciptr) < 0 ) - { - prmsg(1, - "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n", - errno); - t_close(newciptr->fd); - free(newciptr); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - if( TRANS(TLIGetPeerAddr)(newciptr) < 0 ) - { - prmsg(1, - "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n", - errno); - t_close(newciptr->fd); - free(newciptr->addr); - free(newciptr); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - if( ioctl(newciptr->fd, I_POP,"timod") < 0 ) - { - prmsg(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n", - errno); - t_close(newciptr->fd); - free(newciptr->addr); - free(newciptr); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - if( ioctl(newciptr->fd, I_PUSH,"tirdwr") < 0 ) - { - prmsg(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n", - errno); - t_close(newciptr->fd); - free(newciptr->addr); - free(newciptr); - *status = TRANS_ACCEPT_MISC_ERROR; - return NULL; - } - - *status = 0; - - return newciptr; -} - -#endif /* TRANS_SERVER */ - - -#ifdef TRANS_CLIENT - -static int -TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *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"); - 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) - { - t_rcvdis(ciptr->fd,NULL); - return TRANS_TRY_CONNECT_AGAIN; - } - else - return TRANS_CONNECT_FAILED; - } - - t_free((char *)sndcall,T_CALL); - - /* - * Sync up the address fields of ciptr. - */ - - if( TRANS(TLIGetAddr)(ciptr) < 0 ) - { - prmsg(1, - "TLIConnect: ...TLIGetAddr() failed: %d\n", - errno); - return TRANS_CONNECT_FAILED; - } - - if( TRANS(TLIGetPeerAddr)(ciptr) < 0 ) - { - prmsg(1, - "TLIConnect: ...TLIGetPeerAddr() failed: %d\n", - errno); - return TRANS_CONNECT_FAILED; - } - - if( ioctl(ciptr->fd, I_POP,"timod") < 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); - return TRANS_CONNECT_FAILED; - } - - return 0; -} - - -static int -TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port) - -{ - char portbuf[PORTBUFSIZE]; - struct t_call *sndcall; - long tmpport; - - prmsg(2, "TLIINETConnect(%s,%s)\n", host, port); - -#ifdef X11_t - /* - * X has a well known port, that is transport dependant. It is easier - * to handle it here, than try and come up with a transport independent - * representation that can be passed in and resolved the usual way. - * - * The port that is passed here is really a string containing the idisplay - * from ConnectDisplay(). - */ - - if (is_numeric (port)) - { - tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); - sprintf(portbuf,"%u", tmpport ); - port = portbuf; - } -#endif - - if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_ALL)) == NULL ) - { - 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); - t_free((char *)sndcall,T_CALL); - return TRANS_CONNECT_FAILED; - } - - return TRANS(TLIConnect)(ciptr, sndcall ); -} - - -static int -TRANS(TLITLIConnect)(XtransConnInfo ciptr, char *host, char *port) - -{ - struct t_call *sndcall; - struct sockaddr_un *sunaddr; - int ret_value; - - 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"); - 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"); - t_free((char *)sndcall,T_CALL); - return TRANS_CONNECT_FAILED; - } - - sunaddr->sun_family=AF_UNIX; - if( *port == '/' || - strncmp (port, TLINODENAME, strlen (TLINODENAME)) == 0) { - /* Use the port as is */ - (void) strcpy(sunaddr->sun_path, port); - } else { - (void) sprintf(sunaddr->sun_path,"%s%s", TLINODENAME, port ); - } - - sndcall->addr.buf=(char *)sunaddr; - sndcall->addr.len=sizeof(*sunaddr); - sndcall->addr.maxlen=sizeof(*sunaddr); - - ret_value = TRANS(TLIConnect)(ciptr, sndcall ); - - free((char *) sunaddr); - - return ret_value; -} - -#endif /* TRANS_CLIENT */ - - -static int -TRANS(TLIBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend) - -{ - int ret; - struct pollfd filedes; - - prmsg(2, "TLIByteReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend ); - - /* - * This function should detect hangup conditions. Use poll to check - * if no data is present. On SVR4, the M_HANGUP message sits on the - * streams head, and ioctl(N_READ) keeps returning 0 because there is - * no data available. The hangup goes undetected, and the client hangs. - */ - - ret=ioctl(ciptr->fd, I_NREAD, (char *)pend); - - if( ret != 0 ) - return ret; /* Data present or error */ - - - /* Zero data, or POLLHUP message */ - - filedes.fd=ciptr->fd; - filedes.events=POLLIN; - - ret=poll(&filedes, 1, 0); - - if( ret == 0 ) { - *pend=0; - return 0; /* Really, no data */ - } - - if( ret < 0 ) - return -1; /* just pass back the error */ - - if( filedes.revents & (POLLHUP|POLLERR) ) /* check for hangup */ - return -1; - - /* Should only get here if data arrived after the first ioctl() */ - return ioctl(ciptr->fd, I_NREAD, (char *)pend); -} - - -static int -TRANS(TLIRead)(XtransConnInfo ciptr, char *buf, int size) - -{ - prmsg(2, "TLIRead(%d,%x,%d)\n", ciptr->fd, buf, size ); - - return read(ciptr->fd,buf,size); -} - - -static int -TRANS(TLIWrite)(XtransConnInfo ciptr, char *buf, int size) - -{ - prmsg(2, "TLIWrite(%d,%x,%d)\n", ciptr->fd, buf, size ); - - return write(ciptr->fd,buf,size); -} - - -static int -TRANS(TLIReadv)(XtransConnInfo ciptr, struct iovec *buf, int size) - -{ - prmsg(2, "TLIReadv(%d,%x,%d)\n", ciptr->fd, buf, size ); - - return READV(ciptr,buf,size); -} - - -static int -TRANS(TLIWritev)(XtransConnInfo ciptr, struct iovec *buf, int size) - -{ - prmsg(2, "TLIWritev(%d,%x,%d)\n", ciptr->fd, buf, size ); - - return WRITEV(ciptr,buf,size); -} - - -static int -TRANS(TLIDisconnect)(XtransConnInfo ciptr) - -{ - prmsg(2, "TLIDisconnect(%x->%d)\n", ciptr, ciptr->fd); - - /* - * Restore the TLI modules so that the connection can be properly shutdown. - * This avoids the situation where a connection goes into the TIME_WAIT - * state, and the address remains unavailable for a while. - */ - ioctl(ciptr->fd, I_POP,"tirdwr"); - ioctl(ciptr->fd, I_PUSH,"timod"); - - t_snddis(ciptr->fd,NULL); - - return 0; -} - - -static int -TRANS(TLIClose)(XtransConnInfo ciptr) - -{ - prmsg(2, "TLIClose(%x->%d)\n", ciptr, ciptr->fd); - - t_unbind(ciptr->fd); - - return (t_close(ciptr->fd)); -} - - -static int -TRANS(TLICloseForCloning)(XtransConnInfo ciptr) - -{ - /* - * Don't unbind. - */ - - prmsg(2, "TLICloseForCloning(%x->%d)\n", ciptr, ciptr->fd); - - return (t_close(ciptr->fd)); -} - - -Xtransport TRANS(TLITCPFuncs) = { - /* TLI Interface */ - "tcp", - 0, -#ifdef TRANS_CLIENT - TRANS(TLIOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(TLIOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(TLIOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(TLIOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(TLIReopenCOTSServer), - TRANS(TLIReopenCLTSServer), -#endif - TRANS(TLISetOption), -#ifdef TRANS_SERVER - TRANS(TLIINETCreateListener), - NULL, /* ResetListener */ - TRANS(TLIAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(TLIINETConnect), -#endif /* TRANS_CLIENT */ - TRANS(TLIBytesReadable), - TRANS(TLIRead), - TRANS(TLIWrite), - TRANS(TLIReadv), - TRANS(TLIWritev), - TRANS(TLIDisconnect), - TRANS(TLIClose), - TRANS(TLICloseForCloning), -}; - -#ifdef TRANS_SERVER -static char * inet_aliases[] = { "tcp", NULL }; -#endif -Xtransport TRANS(TLIINETFuncs) = { - /* TLI Interface */ - "inet", - TRANS_ALIAS, -#ifdef TRANS_CLIENT - TRANS(TLIOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - inet_aliases, - TRANS(TLIOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(TLIOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(TLIOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(TLIReopenCOTSServer), - TRANS(TLIReopenCLTSServer), -#endif - TRANS(TLISetOption), -#ifdef TRANS_SERVER - TRANS(TLIINETCreateListener), - NULL, /* ResetListener */ - TRANS(TLIAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(TLIINETConnect), -#endif /* TRANS_CLIENT */ - TRANS(TLIBytesReadable), - TRANS(TLIRead), - TRANS(TLIWrite), - TRANS(TLIReadv), - TRANS(TLIWritev), - TRANS(TLIDisconnect), - TRANS(TLIClose), - TRANS(TLICloseForCloning), -}; - -Xtransport TRANS(TLITLIFuncs) = { - /* TLI Interface */ - "tli", - 0, -#ifdef TRANS_CLIENT - TRANS(TLIOpenCOTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - NULL, - TRANS(TLIOpenCOTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(TLIOpenCLTSClient), -#endif /* TRANS_CLIENT */ -#ifdef TRANS_SERVER - TRANS(TLIOpenCLTSServer), -#endif /* TRANS_SERVER */ -#ifdef TRANS_REOPEN - TRANS(TLIReopenCOTSServer), - TRANS(TLIReopenCLTSServer), -#endif - TRANS(TLISetOption), -#ifdef TRANS_SERVER - TRANS(TLITLICreateListener), - NULL, /* ResetListener */ - TRANS(TLIAccept), -#endif /* TRANS_SERVER */ -#ifdef TRANS_CLIENT - TRANS(TLITLIConnect), -#endif /* TRANS_CLIENT */ - TRANS(TLIBytesReadable), - TRANS(TLIRead), - TRANS(TLIWrite), - TRANS(TLIReadv), - TRANS(TLIWritev), - TRANS(TLIDisconnect), - TRANS(TLIClose), - TRANS(TLICloseForCloning), -}; diff --git a/X11/xtrans/Xtransutil.c b/X11/xtrans/Xtransutil.c index 52c937b04..a6928bb87 100644 --- a/X11/xtrans/Xtransutil.c +++ b/X11/xtrans/Xtransutil.c @@ -95,7 +95,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) switch( *familyp ) { -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) case AF_INET: { /* @@ -158,7 +158,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) break; } #endif /* IPv6 */ -#endif /* defined(TCPCONN) || defined(STREAMSCONN) */ +#endif /* defined(TCPCONN) */ #if defined(UNIXCONN) || defined(LOCALCONN) @@ -251,7 +251,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) switch (family) { -#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) +#if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: { struct sockaddr_un *saddr = (struct sockaddr_un *) addr; @@ -261,9 +261,9 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) hostnamebuf, saddr->sun_path); break; } -#endif /* defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) */ +#endif /* defined(UNIXCONN) || defined(LOCALCONN) */ -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) case AF_INET: #if defined(IPv6) && defined(AF_INET6) case AF_INET6: @@ -290,7 +290,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, portnumbuf); break; } -#endif /* defined(TCPCONN) || defined(STREAMSCONN) */ +#endif /* defined(TCPCONN) */ default: @@ -341,16 +341,16 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr) switch (family) { case AF_UNSPEC: -#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) +#if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: { if (gethostname (addrbuf, sizeof (addrbuf)) == 0) addr = addrbuf; break; } -#endif /* defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN) */ +#endif /* defined(UNIXCONN) || defined(LOCALCONN) */ -#if defined(TCPCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) case AF_INET: #if defined(IPv6) && defined(AF_INET6) case AF_INET6: @@ -410,7 +410,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr) break; } -#endif /* defined(TCPCONN) || defined(STREAMSCONN) */ +#endif /* defined(TCPCONN) */ default: diff --git a/X11/xtrans/transport.c b/X11/xtrans/transport.c index 2cb88825e..b62fc7b64 100644 --- a/X11/xtrans/transport.c +++ b/X11/xtrans/transport.c @@ -66,9 +66,6 @@ from The Open Group. #if defined(TCPCONN) || defined(UNIXCONN) #include "Xtranssock.c" #endif -#ifdef STREAMSCONN -#include "Xtranstli.c" -#endif #include "Xtrans.c" #include "Xtransutil.c" diff --git a/apps/xwininfo/xwininfo.c b/apps/xwininfo/xwininfo.c index de1e33e4c..59e09aff8 100644 --- a/apps/xwininfo/xwininfo.c +++ b/apps/xwininfo/xwininfo.c @@ -1837,7 +1837,7 @@ get_net_wm_name (xcb_connection_t *gnwn_dpy, xcb_window_t win) #define UTF8_SHORT_TAIL 3 #define UTF8_LONG_TAIL 4 static int -is_valid_utf8 (const char *string, int len) +is_valid_utf8 (const char *string, size_t len) { unsigned long codepoint; int rem, i; @@ -1958,7 +1958,7 @@ get_friendly_name (const char *string, const char *prefix) const char *name_start = string; char *lowered_name, *n; Bool first = True; - int prefix_len = strlen (prefix); + size_t prefix_len = strlen (prefix); if (strncmp (name_start, prefix, prefix_len) == 0) { name_start += prefix_len; diff --git a/libX11/include/X11/Xcms.h b/libX11/include/X11/Xcms.h index 8151fd1f3..663185410 100644 --- a/libX11/include/X11/Xcms.h +++ b/libX11/include/X11/Xcms.h @@ -31,6 +31,14 @@ #include <X11/Xlib.h> +/* The Xcms structs are full of implicit padding to properly align members. + We can't clean that up without breaking ABI, so tell clang not to bother + complaining about it. */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + /* * XCMS Status Values */ @@ -798,6 +806,10 @@ extern Visual *XcmsVisualOfCCC ( XcmsCCC /* ccc */ ); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + _XFUNCPROTOEND #endif /* _X11_XCMS_H_ */ diff --git a/libX11/include/X11/Xlib.h b/libX11/include/X11/Xlib.h index 3a73d7b83..112b85a94 100644 --- a/libX11/include/X11/Xlib.h +++ b/libX11/include/X11/Xlib.h @@ -81,6 +81,14 @@ _Xmblen( November 2000. Its presence is indicated through the following macro. */ #define X_HAVE_UTF8_STRING 1 +/* The Xlib structs are full of implicit padding to properly align members. + We can't clean that up without breaking ABI, so tell clang not to bother + complaining about it. */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + typedef char *XPointer; typedef int Bool; @@ -4019,6 +4027,10 @@ extern void XFreeEventData( XGenericEventCookie* /* cookie*/ ); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + _XFUNCPROTOEND #endif /* _X11_XLIB_H_ */ diff --git a/libX11/include/X11/Xlibint.h b/libX11/include/X11/Xlibint.h index 84abd7319..03856a671 100644 --- a/libX11/include/X11/Xlibint.h +++ b/libX11/include/X11/Xlibint.h @@ -42,6 +42,14 @@ from The Open Group. #include <X11/Xproto.h> /* to declare xEvent */ #include <X11/XlibConf.h> /* for configured options like XTHREADS */ +/* The Xlib structs are full of implicit padding to properly align members. + We can't clean that up without breaking ABI, so tell clang not to bother + complaining about it. */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + #ifdef WIN32 #define _XFlush _XFlushIt #endif @@ -1367,6 +1375,10 @@ extern void xlocaledir( int buf_len ); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + _XFUNCPROTOEND #endif /* _X11_XLIBINT_H_ */ diff --git a/libX11/include/X11/Xutil.h b/libX11/include/X11/Xutil.h index 8cab50e7d..62cdf5556 100644 --- a/libX11/include/X11/Xutil.h +++ b/libX11/include/X11/Xutil.h @@ -53,6 +53,14 @@ SOFTWARE. #include <X11/Xlib.h> #include <X11/keysym.h> +/* The Xlib structs are full of implicit padding to properly align members. + We can't clean that up without breaking ABI, so tell clang not to bother + complaining about it. */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#endif + /* * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding * value (x, y, width, height) was found in the parsed string. @@ -821,6 +829,10 @@ extern int XXorRegion( Region /* dr_return */ ); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + _XFUNCPROTOEND #endif /* _X11_XUTIL_H_ */ diff --git a/libX11/modules/im/ximcp/imTransR.c b/libX11/modules/im/ximcp/imTransR.c index 1fd008870..caa530904 100644 --- a/libX11/modules/im/ximcp/imTransR.c +++ b/libX11/modules/im/ximcp/imTransR.c @@ -66,12 +66,6 @@ TransportSW _XimTransportRec[] = { #if defined(UNIXCONN) || defined(LOCALCONN) { "local", _XimTransConf }, /* use X transport lib */ #endif /* UNIXCONN */ -#ifdef DNETCONN - { "dnet", _XimTransConf }, /* use X transport lib */ -#endif /* DNETCONN */ -#ifdef STREAMSCONN - { "streams", _XimTransConf }, /* use X transport lib */ -#endif /* STREAMSCONN */ { (char *)NULL, (Bool (*)(Xim, char *))NULL }, }; diff --git a/libX11/src/globals.c b/libX11/src/globals.c index 89e38a744..b7e49dda5 100644 --- a/libX11/src/globals.c +++ b/libX11/src/globals.c @@ -87,127 +87,6 @@ ZEROINIT (int, _Xdebug, 0); ZEROINIT (Display *, _XHeadOfDisplayList, NULL); - -#if 0 -#ifdef STREAMSCONN - - -/* The following are how the Xstream connections are used: */ -/* 1) Local connections over pseudo-tty ports. */ -/* 2) SVR4 local connections using named streams or SVR3.2 */ -/* local connections using streams. */ -/* 3) SVR4 stream pipe code. This code is proprietary and */ -/* the actual code is not included in the XC distribution. */ -/* 4) remote connections using tcp */ -/* 5) remote connections using StarLan */ - -/* - * descriptor block for streams connections - */ - -#include "Xstreams.h" - -char _XsTypeOfStream[100] = { 0 }; - -extern int write(); -extern int close(); -#ifdef SVR4 -extern int _XsSetupSpStream(); -extern int _XsSetupNamedStream(); -#endif -extern int _XsSetupLocalStream(); -extern int _XsConnectLocalClient(); -extern int _XsCallLocalServer(); -extern int _XsReadLocalStream(); -extern int _XsErrorCall(); -extern int _XsWriteLocalStream(); -extern int _XsCloseLocalStream(); -extern int _XsSetupTliStream(); -extern int _XsConnectTliClient(); -extern int _XsCallTliServer(); -extern int _XsReadTliStream(); -extern int _XsWriteTliStream(); -extern int _XsCloseTliStream(); - - -Xstream _XsStream[] = { - - { - /* local connections using pseudo-ttys */ - - _XsSetupLocalStream, - _XsConnectLocalClient, - _XsCallLocalServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - }, - { -#ifdef SVR4 - /* local connections using named streams */ - - _XsSetupNamedStream, -#else - /* local connections using streams */ - _XsSetupLocalStream, -#endif - _XsConnectLocalClient, - _XsCallLocalServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - }, - /* Enhanced Application Compatibility Support */ - { -#ifdef SVR4 - /* SVR4 stream pipe code */ - _XsSetupSpStream, -#else - _XsSetupLocalStream, -#endif - _XsConnectLocalClient, - _XsCallLocalServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - }, - /* End Enhanced Application Compatibility Support */ - - { - /* remote connections using tcp */ - _XsSetupTliStream, - _XsConnectTliClient, - _XsCallTliServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - }, - { - /* remote connections using StarLan */ - _XsSetupTliStream, - _XsConnectTliClient, - _XsCallTliServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - } -}; - - -#endif /* STREAMSCONN */ -#endif - - #ifdef XTEST1 /* * Stuff for input synthesis extension: diff --git a/libX11/src/xlibi18n/XimTrInt.h b/libX11/src/xlibi18n/XimTrInt.h index a08ac0308..bceab9886 100644 --- a/libX11/src/xlibi18n/XimTrInt.h +++ b/libX11/src/xlibi18n/XimTrInt.h @@ -73,7 +73,7 @@ extern Bool _XimXConf( char *address ); -#if defined(TCPCONN) || defined(UNIXCONN) || defined(DNETCONN) || defined(STREAMSCONN) +#if defined(TCPCONN) || defined(UNIXCONN) extern Bool _XimTransConf( Xim im, diff --git a/libXau/AuLock.c b/libXau/AuLock.c index a816b2454..7bf9e5d30 100644 --- a/libXau/AuLock.c +++ b/libXau/AuLock.c @@ -43,9 +43,6 @@ extern unsigned sleep (); #define link rename #endif #endif -#ifdef __UNIXOS2__ -#define link rename -#endif int XauLockAuth ( diff --git a/libXau/Makefile.am b/libXau/Makefile.am index 9e8d95b84..1049614fd 100644 --- a/libXau/Makefile.am +++ b/libXau/Makefile.am @@ -3,8 +3,7 @@ SUBDIRS=man lib_LTLIBRARIES = libXau.la AM_CFLAGS = $(XAU_CFLAGS) $(CWARNFLAGS) - -INCLUDES = -I${top_srcdir}/include +AM_CPPFLAGS = -I${top_srcdir}/include libXau_la_LDFLAGS = -version-number 6:0:0 -no-undefined diff --git a/libXdmcp/Fill.c b/libXdmcp/Fill.c index 98c324f45..61cd974e9 100644 --- a/libXdmcp/Fill.c +++ b/libXdmcp/Fill.c @@ -36,24 +36,16 @@ in this Software without prior written authorization from The Open Group. #include <X11/Xdmcp.h> #include <stdlib.h> -#ifdef STREAMSCONN -#include <tiuser.h> -#else #ifdef WIN32 #include <X11/Xwinsock.h> #else #include <sys/socket.h> #endif -#endif int XdmcpFill (int fd, XdmcpBufferPtr buffer, XdmcpNetaddr from, int *fromlen) { BYTE *newBuf; -#ifdef STREAMSCONN - struct t_unitdata dataunit; - int gotallflag, result; -#endif if (buffer->size < XDM_MAX_MSGLEN) { @@ -66,22 +58,8 @@ XdmcpFill (int fd, XdmcpBufferPtr buffer, XdmcpNetaddr from, int *fromlen) } } buffer->pointer = 0; -#ifdef STREAMSCONN - dataunit.addr.buf = from; - dataunit.addr.maxlen = *fromlen; - dataunit.opt.maxlen = 0; /* don't care to know about options */ - dataunit.udata.buf = (char *)buffer->data; - dataunit.udata.maxlen = buffer->size; - result = t_rcvudata (fd, &dataunit, &gotallflag); - if (result < 0) { - return FALSE; - } - buffer->count = dataunit.udata.len; - *fromlen = dataunit.addr.len; -#else buffer->count = recvfrom (fd, (char*)buffer->data, buffer->size, 0, (struct sockaddr *)from, (void *)fromlen); -#endif if (buffer->count < 6) { buffer->count = 0; return FALSE; diff --git a/libXdmcp/Flush.c b/libXdmcp/Flush.c index cdcd1f096..1654846b9 100644 --- a/libXdmcp/Flush.c +++ b/libXdmcp/Flush.c @@ -35,36 +35,19 @@ in this Software without prior written authorization from The Open Group. #include <X11/Xmd.h> #include <X11/Xdmcp.h> -#ifdef STREAMSCONN -#include <tiuser.h> -#else #ifdef WIN32 #include <X11/Xwinsock.h> #else #include <sys/socket.h> #endif -#endif int XdmcpFlush (int fd, XdmcpBufferPtr buffer, XdmcpNetaddr to, int tolen) { int result; -#ifdef STREAMSCONN - struct t_unitdata dataunit; - - dataunit.addr.buf = to; - dataunit.addr.len = tolen; - dataunit.opt.len = 0; /* default options */ - dataunit.udata.buf = (char *)buffer->data; - dataunit.udata.len = buffer->pointer; - result = t_sndudata(fd, &dataunit); - if (result < 0) - return FALSE; -#else result = sendto (fd, (char *)buffer->data, buffer->pointer, 0, (struct sockaddr *)to, tolen); if (result != buffer->pointer) return FALSE; -#endif return TRUE; } diff --git a/libXdmcp/include/X11/Xdmcp.h b/libXdmcp/include/X11/Xdmcp.h index 99a5f9520..0b531de78 100644 --- a/libXdmcp/include/X11/Xdmcp.h +++ b/libXdmcp/include/X11/Xdmcp.h @@ -114,7 +114,7 @@ typedef struct _XdmAuthKey { /* implementation-independent network address structure. - Equiv to sockaddr* for sockets and netbuf* for STREAMS. */ + Equiv to sockaddr* for sockets. */ typedef char *XdmcpNetaddr; diff --git a/libXmu/src/CvtStdSel.c b/libXmu/src/CvtStdSel.c index 141dfe8df..36423c6fa 100644 --- a/libXmu/src/CvtStdSel.c +++ b/libXmu/src/CvtStdSel.c @@ -242,11 +242,6 @@ XmuConvertStandardSelection(Widget w, Time time, Atom *selection, Atom *target, return True; } #endif -#ifdef DNETCONN - if (*target == XA_DECNET_ADDRESS(d)) { - return False; /* XXX niy */ - } -#endif if (*target == XA_USER(d)) { char *name = (char*)getenv("USER"); if (name == NULL) return False; @@ -312,14 +307,10 @@ XmuConvertStandardSelection(Widget w, Time time, Atom *selection, Atom *target, return True; } if (*target == XA_TARGETS(d)) { -#if defined(unix) && defined(DNETCONN) -# define NUM_TARGETS 9 +#if defined(unix) +# define NUM_TARGETS 8 #else -# if defined(unix) || defined(DNETCONN) -# define NUM_TARGETS 8 -# else -# define NUM_TARGETS 7 -# endif +# define NUM_TARGETS 7 #endif Atom* std_targets = (Atom*)XtMalloc(NUM_TARGETS*sizeof(Atom)); int i = 0; @@ -333,9 +324,6 @@ XmuConvertStandardSelection(Widget w, Time time, Atom *selection, Atom *target, #ifdef unix std_targets[i++] = XA_OWNER_OS(d); #endif -#ifdef DNETCONN - std_targets[i++] = XA_DECNET_ADDRESS(d); -#endif *value = (XPointer)std_targets; *type = XA_ATOM; *length = NUM_TARGETS; diff --git a/libXmu/src/LocBitmap.c b/libXmu/src/LocBitmap.c index b587de7be..1d8b19828 100644 --- a/libXmu/src/LocBitmap.c +++ b/libXmu/src/LocBitmap.c @@ -156,12 +156,7 @@ XmuLocatePixmapFile(Screen *screen, _Xconst char *name, switch (i) { case 1: -#ifndef __UNIXOS2__ if (!(name[0] == '/' || ((name[0] == '.') && name[1] == '/'))) -#else - if (!(name[0] == '/' || (name[0] == '.' && name[1] == '/') || - (isalpha(name[0]) && name[1] == ':'))) -#endif continue; fn = (char *) name; try_plain_name = False; @@ -186,9 +181,6 @@ XmuLocatePixmapFile(Screen *screen, _Xconst char *name, data = NULL; pixmap = None; -#ifdef __UNIXOS2__ - fn = (char*)__XOS2RedirRoot(fn); -#endif if (XmuReadBitmapDataFromFile (fn, &width, &height, &data, &xhot, &yhot) == BitmapSuccess) { pixmap = XCreatePixmapFromBitmapData (dpy, root, (char *) data, diff --git a/libXmu/src/RdBitF.c b/libXmu/src/RdBitF.c index ea447c3c8..58b90a8aa 100644 --- a/libXmu/src/RdBitF.c +++ b/libXmu/src/RdBitF.c @@ -303,10 +303,6 @@ AccessFile(_Xconst char *path, char *pathbuf, int len_pathbuf, char **pathret) /* try the places set in the environment */ drive = getenv ("_XBASEDRIVE"); -#ifdef __UNIXOS2__ - if (!drive) - drive = getenv ("X11ROOT"); -#endif if (!drive) drive = "C:"; len = strlen (drive) + strlen (path); @@ -319,7 +315,6 @@ AccessFile(_Xconst char *path, char *pathbuf, int len_pathbuf, char **pathret) return 1; } -#ifndef __UNIXOS2__ /* one last place to look */ drive = getenv ("HOMEDRIVE"); if (drive) { @@ -354,7 +349,6 @@ AccessFile(_Xconst char *path, char *pathbuf, int len_pathbuf, char **pathret) } } } -#endif return 0; } @@ -389,9 +383,6 @@ XmuReadBitmapDataFromFile(_Xconst char *filename, unsigned int *width, FILE *fstream; int status; -#ifdef __UNIXOS2__ - filename = __XOS2RedirRoot(filename); -#endif if ((fstream = fopen_file (filename, "r")) == NULL) { return BitmapOpenFailed; } diff --git a/mesalib/configure.ac b/mesalib/configure.ac index 1b2083df5..5072ee007 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -1079,8 +1079,8 @@ if test "x$enable_dri" = xyes; then LIBS="$save_LIBS" fi - # if we are building any dri driver other than swrast ... - if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then + # if we are building any dri driver other than swrast or using the dri state tracker ... + if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast || test "x$enable_dri" = xyes; then # ... libdrm is required if test "x$have_libdrm" != xyes; then AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED]) @@ -1830,7 +1830,7 @@ if test "x$with_gallium_drivers" != x; then PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) gallium_require_llvm "Gallium R300" GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300" - gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300" + gallium_check_st "radeon/drm" "dri-r300" "" "" "xvmc-r300" "vdpau-r300" ;; xr600) HAVE_GALLIUM_R600=yes @@ -2057,7 +2057,6 @@ AC_CONFIG_FILES([Makefile src/gallium/targets/xa-vmwgfx/xatracker.pc src/gallium/targets/xorg-i915/Makefile src/gallium/targets/xorg-nouveau/Makefile - src/gallium/targets/xorg-r300/Makefile src/gallium/targets/xorg-r600/Makefile src/gallium/targets/xorg-radeonsi/Makefile src/gallium/targets/xvmc-nouveau/Makefile @@ -2104,6 +2103,7 @@ AC_CONFIG_FILES([Makefile src/mesa/drivers/Makefile src/mesa/drivers/dri/dri.pc src/mesa/drivers/dri/common/Makefile + src/mesa/drivers/dri/common/xmlpool/Makefile src/mesa/drivers/dri/i915/Makefile src/mesa/drivers/dri/i965/Makefile src/mesa/drivers/dri/Makefile diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt index 34cce729b..567781d90 100644 --- a/mesalib/docs/GL3.txt +++ b/mesalib/docs/GL3.txt @@ -41,15 +41,15 @@ GLX_ARB_create_context (GLX 1.4 is required) DONE GL 3.1: -GLSL 1.40 DONE (i965) -Forward compatibile context support/deprecations DONE (i965) +GLSL 1.40 DONE (i965, r600) +Forward compatibile context support/deprecations DONE (i965, r600) Instanced drawing (GL_ARB_draw_instanced) DONE (i965, gallium, swrast) Buffer copying (GL_ARB_copy_buffer) DONE (i965, r300, r600, swrast) Primitive restart (GL_NV_primitive_restart) DONE (i965, r600) 16 vertex texture image units DONE -Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts (i965) +Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts (i965, r600) Rectangular textures (GL_ARB_texture_rectangle) DONE (i965, r300, r600, swrast) -Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965) +Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965, r600, swrast) Signed normalized textures (GL_EXT_texture_snorm) DONE (i965, r300, r600) diff --git a/mesalib/src/gallium/auxiliary/Makefile.am b/mesalib/src/gallium/auxiliary/Makefile.am index b8ac7c9dd..a4eee4773 100644 --- a/mesalib/src/gallium/auxiliary/Makefile.am +++ b/mesalib/src/gallium/auxiliary/Makefile.am @@ -45,7 +45,3 @@ util/u_format_srgb.c: $(srcdir)/util/u_format_srgb.py util/u_format_table.c: $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format_pack.py $(srcdir)/util/u_format_parse.py $(srcdir)/util/u_format.csv $(AM_V_GEN) $(PYTHON2) $(srcdir)/util/u_format_table.py $(srcdir)/util/u_format.csv > $@ - -#XXX: Delete this when all targets are converted to automake. -all-local: libgallium.la - ln -f $(builddir)/.libs/libgallium.a $(builddir)/libgallium.a diff --git a/mesalib/src/glsl/Makefile.am b/mesalib/src/glsl/Makefile.am index aff1559e0..0f545d548 100644 --- a/mesalib/src/glsl/Makefile.am +++ b/mesalib/src/glsl/Makefile.am @@ -78,10 +78,3 @@ CLEANFILES = glsl_lexer.cc glsl_parser.cc $(BUILT_SOURCES) builtin_function.cpp builtin_function.cpp: $(srcdir)/builtins/profiles/* $(srcdir)/builtins/ir/* $(srcdir)/builtins/glsl/* $(srcdir)/builtins/tools/generate_builtins.py $(srcdir)/builtins/tools/texture_builtins.py builtin_compiler/builtin_compiler$(BUILD_EXEEXT) $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/builtins/tools/generate_builtins.py builtin_compiler/builtin_compiler$(BUILD_EXEEXT) > builtin_function.cpp || rm -f builtin_function.cpp - -# Provide compatibility with scripts for the old Mesa build system for -# a while by putting a link to the library in the current directory. -all-local: libglsl.la - ln -f .libs/libglsl.a . - -CLEANFILES += libglsl.a diff --git a/mesalib/src/glsl/glcpp/.gitignore b/mesalib/src/glsl/glcpp/.gitignore index fc93edb36..9f7e0cc3e 100755 --- a/mesalib/src/glsl/glcpp/.gitignore +++ b/mesalib/src/glsl/glcpp/.gitignore @@ -3,3 +3,4 @@ glcpp-lex.c glcpp-parse.output
glcpp-parse.c
glcpp-parse.h
+tests/*.out
diff --git a/mesalib/src/glsl/glcpp/glcpp-lex.l b/mesalib/src/glsl/glcpp/glcpp-lex.l index fd28711d1..a029f6203 100644 --- a/mesalib/src/glsl/glcpp/glcpp-lex.l +++ b/mesalib/src/glsl/glcpp/glcpp-lex.l @@ -260,6 +260,8 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? } "##" { + if (parser->is_gles) + glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES"); return PASTE; } diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y index 380a1d99c..8fba923a2 100644 --- a/mesalib/src/glsl/glcpp/glcpp-parse.y +++ b/mesalib/src/glsl/glcpp/glcpp-parse.y @@ -363,6 +363,8 @@ integer_constant: expression: integer_constant | IDENTIFIER { + if (parser->is_gles) + glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $1); $$ = 0; } | expression OR expression { @@ -1179,15 +1181,18 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) parser->has_new_source_number = 0; parser->new_source_number = 0; + parser->is_gles = false; + /* Add pre-defined macros. */ if (extensions != NULL) { if (extensions->OES_EGL_image_external) add_builtin_define(parser, "GL_OES_EGL_image_external", 1); } - if (api == API_OPENGLES2) + if (api == API_OPENGLES2) { + parser->is_gles = true; add_builtin_define(parser, "GL_ES", 1); - else { + } else { add_builtin_define(parser, "GL_ARB_draw_buffers", 1); add_builtin_define(parser, "GL_ARB_texture_rectangle", 1); @@ -2026,11 +2031,6 @@ static void _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t version, const char *es_identifier) { - /* Note: We assume that if any identifier is present, it means ES. - * The GLSL parser will double-check that the identifier is correct. - */ - bool is_es = es_identifier != NULL; - macro_t *macro = hash_table_find (parser->defines, "__VERSION__"); if (macro) { hash_table_remove (parser->defines, "__VERSION__"); @@ -2038,17 +2038,23 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio } add_builtin_define (parser, "__VERSION__", version); - if (version == 100) - is_es = true; - if (is_es) + /* If we didn't have a GLES context to begin with, (indicated + * by parser->api), then the version declaration here might + * indicate GLES. */ + if (! parser->is_gles && + (version == 100 || + (es_identifier && (strcmp(es_identifier, "es") == 0)))) + { + parser->is_gles = true; add_builtin_define (parser, "GL_ES", 1); + } /* Currently, all ES2/ES3 implementations support highp in the * fragment shader, so we always define this macro in ES2/ES3. * If we ever get a driver that doesn't support highp, we'll * need to add a flag to the gl_context and check that here. */ - if (version >= 130 || is_es) + if (version >= 130 || parser->is_gles) add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1); ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, diff --git a/mesalib/src/glsl/glcpp/glcpp.c b/mesalib/src/glsl/glcpp/glcpp.c index bef9fd08e..13a32fd7d 100644 --- a/mesalib/src/glsl/glcpp/glcpp.c +++ b/mesalib/src/glsl/glcpp/glcpp.c @@ -24,6 +24,8 @@ #include <stdio.h> #include <string.h> #include <errno.h> +#include <getopt.h> + #include "glcpp.h" #include "main/mtypes.h" #include "main/shaderobj.h" @@ -102,6 +104,37 @@ load_text_file(void *ctx, const char *filename) return text; } +/* Initialize only those things that glcpp cares about. + */ +static void +init_fake_gl_context (struct gl_context *gl_ctx) +{ + gl_ctx->API = API_OPENGL_COMPAT; + gl_ctx->Const.DisableGLSLLineContinuations = false; +} + +static void +usage (void) +{ + fprintf (stderr, + "Usage: glcpp [OPTIONS] [--] [<filename>]\n" + "\n" + "Pre-process the given filename (stdin if no filename given).\n" + "The following options are supported:\n" + " --disable-line-continuations Do not interpret lines ending with a\n" + " backslash ('\\') as a line continuation.\n"); +} + +enum { + DISABLE_LINE_CONTINUATIONS_OPT = CHAR_MAX + 1 +}; + +const static struct option +long_options[] = { + {"disable-line-continuations", no_argument, 0, DISABLE_LINE_CONTINUATIONS_OPT }, + {0, 0, 0, 0 } +}; + int main (int argc, char *argv[]) { @@ -110,16 +143,36 @@ main (int argc, char *argv[]) char *info_log = ralloc_strdup(ctx, ""); const char *shader; int ret; + struct gl_context gl_ctx; + int c; + + init_fake_gl_context (&gl_ctx); + + while ((c = getopt_long(argc, argv, "", long_options, NULL)) != -1) { + switch (c) { + case DISABLE_LINE_CONTINUATIONS_OPT: + gl_ctx.Const.DisableGLSLLineContinuations = true; + break; + default: + usage (); + exit (1); + } + } - if (argc) { - filename = argv[1]; + if (optind + 1 < argc) { + printf ("Unexpected argument: %s\n", argv[optind+1]); + usage (); + exit (1); + } + if (optind < argc) { + filename = argv[optind]; } shader = load_text_file (ctx, filename); if (shader == NULL) return 1; - ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, API_OPENGL_COMPAT); + ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, &gl_ctx); printf("%s", shader); fprintf(stderr, "%s", info_log); diff --git a/mesalib/src/glsl/glcpp/glcpp.h b/mesalib/src/glsl/glcpp/glcpp.h index a459289b2..8aaa551d1 100644 --- a/mesalib/src/glsl/glcpp/glcpp.h +++ b/mesalib/src/glsl/glcpp/glcpp.h @@ -27,6 +27,8 @@ #include <stdint.h> #include <stdbool.h> +#include "main/mtypes.h" + #include "../ralloc.h" #include "program/hash_table.h" @@ -182,6 +184,7 @@ struct glcpp_parser { int new_line_number; bool has_new_source_number; int new_source_number; + bool is_gles; }; struct gl_extensions; @@ -197,7 +200,7 @@ glcpp_parser_destroy (glcpp_parser_t *parser); int glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log, - const struct gl_extensions *extensions, int api); + const struct gl_extensions *extensions, struct gl_context *g_ctx); /* Functions for writing to the info log */ diff --git a/mesalib/src/glsl/glcpp/pp.c b/mesalib/src/glsl/glcpp/pp.c index 11b29417b..789f7f941 100644 --- a/mesalib/src/glsl/glcpp/pp.c +++ b/mesalib/src/glsl/glcpp/pp.c @@ -70,92 +70,77 @@ glcpp_warning (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...) &parser->info_log_length, "\n"); } -/* Searches backwards for '^ *#' from a given starting point. */ -static int -in_directive(const char *shader, const char *ptr) -{ - assert(ptr >= shader); - - /* Search backwards for '#'. If we find a \n first, it doesn't count */ - for (; ptr >= shader && *ptr != '#'; ptr--) { - if (*ptr == '\n') - return 0; - } - if (ptr >= shader) { - /* Found '#'...look for spaces preceded by a newline */ - for (ptr--; ptr >= shader && isblank(*ptr); ptr--); - // FIXME: I don't think the '\n' case can happen - if (ptr < shader || *ptr == '\n') - return 1; - } - return 0; -} - -/* Remove any line continuation characters in preprocessing directives. - * However, ignore any in GLSL code, as "There is no line continuation - * character" (1.30 page 9) in GLSL. +/* Remove any line continuation characters in the shader, (whether in + * preprocessing directives or in GLSL code). */ static char * remove_line_continuations(glcpp_parser_t *ctx, const char *shader) { - int in_continued_line = 0; - int extra_newlines = 0; char *clean = ralloc_strdup(ctx, ""); - const char *search_start = shader; - const char *newline; - while ((newline = strchr(search_start, '\n')) != NULL) { - const char *backslash = NULL; - - /* # of characters preceding the newline. */ - int n = newline - shader; - - /* Find the preceding '\', if it exists */ - if (n >= 1 && newline[-1] == '\\') - backslash = newline - 1; - else if (n >= 2 && newline[-1] == '\r' && newline[-2] == '\\') - backslash = newline - 2; - - /* Double backslashes don't count (the backslash is escaped) */ - if (backslash != NULL && backslash[-1] == '\\') { - backslash = NULL; - } - - if (backslash != NULL) { - /* We found a line continuation, but do we care? */ - if (!in_continued_line) { - if (in_directive(shader, backslash)) { - in_continued_line = 1; - extra_newlines = 0; - } - } - if (in_continued_line) { - /* Copy everything before the \ */ - ralloc_strncat(&clean, shader, backslash - shader); + const char *backslash, *newline, *search_start; + int collapsed_newlines = 0; + + search_start = shader; + + while (true) { + backslash = strchr(search_start, '\\'); + + /* If we have previously collapsed any line-continuations, + * then we want to insert additional newlines at the next + * occurrence of a newline character to avoid changing any + * line numbers. + */ + if (collapsed_newlines) { + newline = strchr(search_start, '\n'); + if (newline && + (backslash == NULL || newline < backslash)) + { + ralloc_strncat(&clean, shader, + newline - shader + 1); + while (collapsed_newlines--) + ralloc_strcat(&clean, "\n"); shader = newline + 1; - extra_newlines++; + search_start = shader; } - } else if (in_continued_line) { - /* Copy everything up to and including the \n */ - ralloc_strncat(&clean, shader, newline - shader + 1); - shader = newline + 1; - /* Output extra newlines to make line numbers match */ - for (; extra_newlines > 0; extra_newlines--) - ralloc_strcat(&clean, "\n"); - in_continued_line = 0; } - search_start = newline + 1; + + search_start = backslash + 1; + + if (backslash == NULL) + break; + + /* At each line continuation, (backslash followed by a + * newline), copy all preceding text to the output, then + * advance the shader pointer to the character after the + * newline. + */ + if (backslash[1] == '\n' || + (backslash[1] == '\r' && backslash[2] == '\n')) + { + collapsed_newlines++; + ralloc_strncat(&clean, shader, backslash - shader); + if (backslash[1] == '\n') + shader = backslash + 2; + else + shader = backslash + 3; + search_start = shader; + } } + ralloc_strcat(&clean, shader); + return clean; } int glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log, - const struct gl_extensions *extensions, int api) + const struct gl_extensions *extensions, struct gl_context *gl_ctx) { int errors; - glcpp_parser_t *parser = glcpp_parser_create (extensions, api); - *shader = remove_line_continuations(parser, *shader); + glcpp_parser_t *parser = glcpp_parser_create (extensions, gl_ctx->API); + + if (! gl_ctx->Const.DisableGLSLLineContinuations) + *shader = remove_line_continuations(parser, *shader); glcpp_lex_set_source_string (parser, *shader); diff --git a/mesalib/src/glsl/glsl_parser_extras.h b/mesalib/src/glsl/glsl_parser_extras.h index 01cf6a8d9..400cf9a2b 100644 --- a/mesalib/src/glsl/glsl_parser_extras.h +++ b/mesalib/src/glsl/glsl_parser_extras.h @@ -358,7 +358,7 @@ extern "C" { #endif extern int glcpp_preprocess(void *ctx, const char **shader, char **info_log, - const struct gl_extensions *extensions, int api); + const struct gl_extensions *extensions, struct gl_context *gl_ctx); extern void _mesa_destroy_shader_compiler(void); extern void _mesa_destroy_shader_compiler_caches(void); diff --git a/mesalib/src/glsl/main.cpp b/mesalib/src/glsl/main.cpp index d21b8cd2d..430a56512 100644 --- a/mesalib/src/glsl/main.cpp +++ b/mesalib/src/glsl/main.cpp @@ -157,7 +157,7 @@ compile_shader(struct gl_context *ctx, struct gl_shader *shader) const char *source = shader->Source; state->error = glcpp_preprocess(state, &source, &state->info_log, - state->extensions, ctx->API) != 0; + state->extensions, ctx) != 0; if (!state->error) { _mesa_glsl_lexer_ctor(state, source); diff --git a/mesalib/src/glsl/test_optpass.cpp b/mesalib/src/glsl/test_optpass.cpp index ce5df24d9..117b0b006 100644 --- a/mesalib/src/glsl/test_optpass.cpp +++ b/mesalib/src/glsl/test_optpass.cpp @@ -217,7 +217,7 @@ int test_optpass(int argc, char **argv) shader->Source = input.c_str(); const char *source = shader->Source; state->error = glcpp_preprocess(state, &source, &state->info_log, - state->extensions, ctx->API) != 0; + state->extensions, ctx) != 0; if (!state->error) { _mesa_glsl_lexer_ctor(state, source); diff --git a/mesalib/src/mapi/glapi/Makefile.am b/mesalib/src/mapi/glapi/Makefile.am index 181a28a7c..bdb527d5c 100644 --- a/mesalib/src/mapi/glapi/Makefile.am +++ b/mesalib/src/mapi/glapi/Makefile.am @@ -58,12 +58,3 @@ endif noinst_LTLIBRARIES = libglapi.la libglapi_la_SOURCES = $(glapi_GLAPI_sources) $(glapi_ASM_sources) $(glapi_MAPI_sources) -libglapi_la_LIBADD = -libglapi_la_LDFLAGS = - -# Provide compatibility with scripts for the old Mesa build system for -# a while by putting a link to libglapi.a here -all-local: libglapi.la - ln -sf .libs/libglapi.a libglapi.a - -CLEANFILES = libglapi.a diff --git a/mesalib/src/mapi/glapi/gen/ARB_get_program_binary.xml b/mesalib/src/mapi/glapi/gen/ARB_get_program_binary.xml index 7db166564..e84d0678e 100644 --- a/mesalib/src/mapi/glapi/gen/ARB_get_program_binary.xml +++ b/mesalib/src/mapi/glapi/gen/ARB_get_program_binary.xml @@ -5,14 +5,13 @@ <OpenGLAPI> -<category name="GL_ARB_get_program_binary " number="96"> +<category name="GL_ARB_get_program_binary" number="96"> <enum name="PROGRAM_BINARY_RETRIEVABLE_HINT" value="0x8257"/> <enum name="PROGRAM_BINARY_LENGTH" value="0x8741"/> <enum name="NUM_PROGRAM_BINARY_FORMATS" value="0x87FE"/> <enum name="PROGRAM_BINARY_FORMATS" value="0x87FF"/> - <function name="GetProgramBinary" offset="assign" static_dispatch="false" - es2="3.0" exec="skip"> + <function name="GetProgramBinary" offset="assign" es2="3.0"> <param name="program" type="GLuint"/> <param name="bufSize" type="GLsizei"/> <param name="length" type="GLsizei *"/> @@ -20,16 +19,14 @@ <param name="binary" type="GLvoid *"/> </function> - <function name="ProgramBinary" offset="assign" static_dispatch="false" - es2="3.0" exec="skip"> + <function name="ProgramBinary" offset="assign" es2="3.0"> <param name="program" type="GLuint"/> <param name="binaryFormat" type="GLenum"/> <param name="binary" type="const GLvoid *"/> <param name="length" type="GLsizei"/> </function> - <function name="ProgramParameteri" offset="assign" static_dispatch="false" - es2="3.0" exec="skip"> + <function name="ProgramParameteri" offset="assign" es2="3.0"> <param name="program" type="GLuint"/> <param name="pname" type="GLenum"/> <param name="value" type="GLint"/> diff --git a/mesalib/src/mapi/glapi/gen/Makefile.am b/mesalib/src/mapi/glapi/gen/Makefile.am index ff22c8e0d..f869d28e5 100644 --- a/mesalib/src/mapi/glapi/gen/Makefile.am +++ b/mesalib/src/mapi/glapi/gen/Makefile.am @@ -1,11 +1,3 @@ -# This file isn't used during a normal compilation since we don't want to -# require Python in order to compile Mesa. -# Instead, when the Mesa developers update/change the API interface it's -# up to him/her to re-run this makefile and check in the newly generated files. - - -TOP = ../../../.. - # These are the "official" xserver indent flags from utils/modular/x-indent.sh XORG_INDENT_FLAGS = -linux -bad -bap -blf -bli0 -cbi0 -cdw -nce -cs -i4 -lc80 -psl -nbbo \ -nbc -psl -nbfda -nut -nss -T pointer -T ScreenPtr -T ScrnInfoPtr -T pointer \ @@ -26,10 +18,10 @@ XORG_INDENT_FLAGS = -linux -bad -bap -blf -bli0 -cbi0 -cdw -nce -cs -i4 -lc80 -p -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT -MESA_DIR = $(TOP)/src/mesa -MESA_GLAPI_DIR = $(TOP)/src/mapi/glapi -MESA_MAPI_DIR = $(TOP)/src/mapi/mapi -MESA_GLX_DIR = $(TOP)/src/glx +MESA_DIR = $(top_srcdir)/src/mesa +MESA_GLAPI_DIR = $(top_srcdir)/src/mapi/glapi +MESA_MAPI_DIR = $(top_srcdir)/src/mapi/mapi +MESA_GLX_DIR = $(top_srcdir)/src/glx MESA_GLAPI_OUTPUTS = \ $(MESA_GLAPI_DIR)/glapi_mapi_tmp.h \ diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml index 4aa8b15e3..adbeea613 100755 --- a/mesalib/src/mapi/glapi/gen/gl_API.xml +++ b/mesalib/src/mapi/glapi/gen/gl_API.xml @@ -8269,20 +8269,18 @@ </function> </category> +<!-- ARB extensions #95...#108 --> + <xi:include href="ARB_ES2_compatibility.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> -<!-- ARB extensions #96...#103 --> +<xi:include href="ARB_get_program_binary.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> <xi:include href="ARB_debug_output.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> <xi:include href="ARB_robustness.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> -<!-- ARB extensions #106 --> - <xi:include href="ARB_base_instance.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> -<!-- ARB extensions #108 --> - <category name="GL_ARB_transform_feedback_instanced" number="109"> <function name="DrawTransformFeedbackInstanced" offset="assign" exec="dynamic"> @@ -12994,6 +12992,4 @@ <xi:include href="EXT_transform_feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> -<xi:include href="ARB_get_program_binary.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> - </OpenGLAPI> diff --git a/mesalib/src/mesa/Makefile.am b/mesalib/src/mesa/Makefile.am index 9809ee437..41483dd63 100644 --- a/mesalib/src/mesa/Makefile.am +++ b/mesalib/src/mesa/Makefile.am @@ -128,20 +128,9 @@ libmesagallium_la_LIBADD = \ $(top_builddir)/src/mesa/program/libprogram.la \ $() -libmesagallium_la_LDFLAGS = - -if HAVE_GALLIUM -# Provide compatibility with scripts for the old Mesa build system for -# a while by putting a link to the library in the current directory. -all-local: $(noinst_LTLIBRARIES) - ln -f .libs/libmesagallium.a . -endif - -CLEANFILES += libmesagallium.a - pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gl.pc # Emacs tags tags: - etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h + etags `find . -name \*.[ch]` $(top_srcdir)/include/GL/*.h diff --git a/mesalib/src/mesa/drivers/SConscript b/mesalib/src/mesa/drivers/SConscript index f1c4da6b8..6dcc50655 100644 --- a/mesalib/src/mesa/drivers/SConscript +++ b/mesalib/src/mesa/drivers/SConscript @@ -5,5 +5,8 @@ SConscript('osmesa/SConscript') if env['x11']: SConscript('x11/SConscript') +if env['drm']: + SConscript('dri/common/xmlpool/SConscript') + if env['platform'] == 'windows': SConscript('windows/gdi/SConscript') diff --git a/mesalib/src/mesa/drivers/dri/Android.mk b/mesalib/src/mesa/drivers/dri/Android.mk index d6196bb43..88629531a 100644 --- a/mesalib/src/mesa/drivers/dri/Android.mk +++ b/mesalib/src/mesa/drivers/dri/Android.mk @@ -38,6 +38,7 @@ MESA_DRI_CFLAGS := \ -DHAVE_ANDROID_PLATFORM MESA_DRI_C_INCLUDES := \ + $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_dri_common) \ $(addprefix $(MESA_TOP)/, $(mesa_dri_common_INCLUDES)) \ $(DRM_TOP) \ $(DRM_TOP)/include/drm \ @@ -56,6 +57,9 @@ MESA_DRI_SHARED_LIBRARIES := \ libglapi \ liblog +# All DRI modules must add this to LOCAL_GENERATED_SOURCES. +MESA_DRI_OPTIONS_H := $(call intermediates-dir-for,STATIC_LIBRARIES,libmesa_dri_common)/xmlpool/options.h + #----------------------------------------------- # Build drivers and libmesa_dri_common diff --git a/mesalib/src/mesa/drivers/dri/common/Android.mk b/mesalib/src/mesa/drivers/dri/common/Android.mk index 76464a153..f428c3855 100644 --- a/mesalib/src/mesa/drivers/dri/common/Android.mk +++ b/mesalib/src/mesa/drivers/dri/common/Android.mk @@ -34,8 +34,54 @@ include $(LOCAL_PATH)/Makefile.sources LOCAL_MODULE := libmesa_dri_common LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_C_INCLUDES := $(MESA_DRI_C_INCLUDES) +intermediates := $(call local-intermediates-dir) + +LOCAL_C_INCLUDES := \ + $(intermediates) \ + $(MESA_DRI_C_INCLUDES) + LOCAL_SRC_FILES := $(mesa_dri_common_SOURCES) +LOCAL_GENERATED_SOURCES := \ + $(intermediates)/xmlpool/options.h + +# +# Generate options.h from gettext translations. +# + +MESA_DRI_OPTIONS_LANGS := de es nl fr sv +POT := $(intermediates)/xmlpool.pot + +$(POT): $(LOCAL_PATH)/xmlpool/t_options.h + @mkdir -p $(dir $@) + xgettext -L C --from-code utf-8 -o $@ $< + +$(intermediates)/xmlpool/%.po: $(LOCAL_PATH)/xmlpool/%.po $(POT) + lang=$(basename $(notdir $@)); \ + mkdir -p $(dir $@); \ + if [ -f $< ]; then \ + msgmerge -o $@ $^; \ + else \ + msginit -i $(POT) \ + -o $@ \ + --locale=$$lang \ + --no-translator; \ + sed -i -e 's/charset=.*\\n/charset=UTF-8\\n/' $@; \ + fi + +$(intermediates)/xmlpool/%/LC_MESSAGES/options.mo: $(intermediates)/xmlpool/%.po + mkdir -p $(dir $@) + msgfmt -o $@ $< + +$(intermediates)/xmlpool/options.h: PRIVATE_SCRIPT := $(LOCAL_PATH)/xmlpool/gen_xmlpool.py +$(intermediates)/xmlpool/options.h: PRIVATE_LOCALEDIR := $(intermediates)/xmlpool +$(intermediates)/xmlpool/options.h: PRIVATE_TEMPLATE_HEADER := $(LOCAL_PATH)/xmlpool/t_options.h +$(intermediates)/xmlpool/options.h: PRIVATE_MO_FILES := $(MESA_DRI_OPTIONS_LANGS:%=$(intermediates)/xmlpool/%/LC_MESSAGES/options.mo) +$(intermediates)/xmlpool/options.h: $(PRIVATE_SCRIPT) $(PRIVATE_TEMPLATE_HEADER) $(PRIVATE_MO_FILES) + mkdir -p $(dir $@) + mkdir -p $(PRIVATE_LOCALEDIR) + $(MESA_PYTHON2) $(PRIVATE_SCRIPT) $(PRIVATE_TEMPLATE_HEADER) \ + $(PRIVATE_LOCALEDIR) $(MESA_DRI_OPTIONS_LANGS) > $@ + include $(MESA_COMMON_MK) include $(BUILD_STATIC_LIBRARY) diff --git a/mesalib/src/mesa/drivers/dri/common/Makefile.am b/mesalib/src/mesa/drivers/dri/common/Makefile.am index a662919b5..dfc8f3b7a 100644 --- a/mesalib/src/mesa/drivers/dri/common/Makefile.am +++ b/mesalib/src/mesa/drivers/dri/common/Makefile.am @@ -19,6 +19,8 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +SUBDIRS = xmlpool + AM_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src/ \ diff --git a/mesalib/src/mesa/drivers/dri/common/drirc b/mesalib/src/mesa/drivers/dri/common/drirc index cf13cdb80..a13941f68 100644 --- a/mesalib/src/mesa/drivers/dri/common/drirc +++ b/mesalib/src/mesa/drivers/dri/common/drirc @@ -22,5 +22,8 @@ <application name="Unigine OilRush (64-bit)" executable="OilRush_x64"> <option name="disable_blend_func_extended" value="true" /> </application> + <application name="Savage 2" executable="savage2.bin"> + <option name="disable_glsl_line_continuations" value="true" /> + </application> </device> </driconf> diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/.gitignore b/mesalib/src/mesa/drivers/dri/common/xmlpool/.gitignore index a5a437849..f6ba5c849 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlpool/.gitignore +++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/.gitignore @@ -3,3 +3,6 @@ es fr nl sv +options.h +Makefile +xmlpool.pot diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/Makefile b/mesalib/src/mesa/drivers/dri/common/xmlpool/Makefile.am index b71629e9f..b99df40d8 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlpool/Makefile +++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/Makefile.am @@ -54,43 +54,41 @@ POT=xmlpool.pot all: options.h -# Only intermediate files are cleaned up. options.h is not deleted because -# it's in CVS. +# All generated files are cleaned up. clean: - -rm -f $(POT) *~ + -rm -f $(POT) options.h *~ -rm -rf $(LANGS) # Default target options.h -options.h: t_options.h mo - $(PYTHON2) $(PYTHON_FLAGS) gen_xmlpool.py $(LANGS) > options.h +options.h: LOCALEDIR := . +options.h: t_options.h $(MOS) + $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/gen_xmlpool.py $(srcdir)/t_options.h $(LOCALEDIR) $(LANGS) > options.h # Update .mo files from the corresponding .po files. -mo: - @for mo in $(MOS); do \ - lang=$${mo%%/*}; \ - echo "Updating $$mo from $$lang.po."; \ - mkdir -p $${mo%/*}; \ - msgfmt -o $$mo $$lang.po; \ - done +%/LC_MESSAGES/options.mo: %.po + @mo="$@" \ + lang=$${mo%%/*}; \ + echo "Updating ($$lang) $@ from $?."; \ + mkdir -p $$lang/LC_MESSAGES; \ + msgfmt -o $@ $? # Use this target to create or update .po files with new messages in # driconf.py. -po: $(POS) +po: $(POT) + @for po in $(POS); do \ + if [ -f $$po ]; then \ + echo "Merging new strings from $(POT) into $@."; \ + mv $$po $$po~; \ + msgmerge -o $$po $$po~ $(POT); \ + else \ + echo "Initializing $$po from $(POT)."; \ + msginit -i $(POT) -o $$po~ --locale=$*; \ + sed -e 's/charset=.*\\n/charset=UTF-8\\n/' $$po~ > $$po; \ + fi \ + done pot: $(POT) # Extract message catalog from driconf.py. $(POT): t_options.h xgettext -L C --from-code utf-8 -o $(POT) t_options.h - -# Create or update a .po file for a specific language. -%.po: $(POT) - @if [ -f $@ ]; then \ - echo "Merging new strings from $(POT) into $@."; \ - mv $@ $@~; \ - msgmerge -o $@ $@~ $(POT); \ - else \ - echo "Initializing $@ from $(POT)."; \ - msginit -i $(POT) -o $@~ --locale=$*; \ - sed -e 's/charset=.*\\n/charset=UTF-8\\n/' $@~ > $@; \ - fi diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/SConscript b/mesalib/src/mesa/drivers/dri/common/xmlpool/SConscript new file mode 100644 index 000000000..fa42554d3 --- /dev/null +++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/SConscript @@ -0,0 +1,14 @@ +Import('*') + +from sys import executable as python_cmd + +LOCALEDIR = env.Dir('.').srcnode().abspath + +xmlpool_options, = env.CodeGenerate( + target = 'options.h', + script = 'gen_xmlpool.py', + source = ['t_options.h'], + command = python_cmd + ' $SCRIPT $SOURCE ' + LOCALEDIR + ' > $TARGET' +) + +Export('xmlpool_options') diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/de.po b/mesalib/src/mesa/drivers/dri/common/xmlpool/de.po index 724237929..a87c8d513 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlpool/de.po +++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/de.po @@ -207,14 +207,14 @@ msgid "" "Morphological anti-aliasing based on Jimenez\\' MLAA. 0 to disable, 8 for " "default quality" msgstr "Morphologische Kantenglättung (Anti-Aliasing) basierend auf " -"Jimenez\' MLAA. 0 für deaktiviert, 8 für Standardqualität" +"Jimenez' MLAA. 0 für deaktiviert, 8 für Standardqualität" #: t_options.h:221 msgid "" "Morphological anti-aliasing based on Jimenez\\' MLAA. 0 to disable, 8 for " "default quality. Color version, usable with 2d GL apps" msgstr "Morphologische Kantenglättung (Anti-Aliasing) basierend auf " -"Jimenez\' MLAA. 0 für deaktiviert, 8 für Standardqualität. " +"Jimenez' MLAA. 0 für deaktiviert, 8 für Standardqualität. " "Farbversion, für 2D-Anwendungen" #: t_options.h:226 diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py b/mesalib/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py index 7398c4cd0..acfdcf48a 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py +++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py @@ -1,11 +1,24 @@ #!/usr/bin/python +# +# Usage: +# gen_xmlpool.py /path/to/t_option.h localedir lang lang lang ... +# +# For each given language, this script expects to find a .mo file at +# `{localedir}/{language}/LC_MESSAGES/options.mo`. +# + import sys import gettext import re +# Path to t_options.h +template_header_path = sys.argv[1] + +localedir = sys.argv[2] + # List of supported languages -languages = sys.argv[1:] +languages = sys.argv[3:] # Escape special characters in C strings def escapeCString (s): @@ -134,7 +147,7 @@ def expandMatches (matches, translations, end=None): translations = [("en", gettext.NullTranslations())] for lang in languages: try: - trans = gettext.translation ("options", ".", [lang]) + trans = gettext.translation ("options", localedir, [lang]) except IOError: sys.stderr.write ("Warning: language '%s' not found.\n" % lang) continue @@ -155,7 +168,7 @@ print \ # Process the options template and generate options.h with all # translations. -template = file ("t_options.h", "r") +template = file (template_header_path, "r") descMatches = [] for line in template: if len(descMatches) > 0: diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/options.h b/mesalib/src/mesa/drivers/dri/common/xmlpool/options.h deleted file mode 100644 index 112a046d2..000000000 --- a/mesalib/src/mesa/drivers/dri/common/xmlpool/options.h +++ /dev/null @@ -1,638 +0,0 @@ -/*********************************************************************** - *** THIS FILE IS GENERATED AUTOMATICALLY. DON'T EDIT! *** - ***********************************************************************/ -/* - * XML DRI client-side driver configuration - * Copyright (C) 2003 Felix Kuehling - * - * 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 - * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS 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 t_options.h - * \brief Templates of common options - * \author Felix Kuehling - * - * This file defines macros for common options that can be used to - * construct driConfigOptions in the drivers. This file is only a - * template containing English descriptions for options wrapped in - * gettext(). xgettext can be used to extract translatable - * strings. These strings can then be translated by anyone familiar - * with GNU gettext. gen_xmlpool.py takes this template and fills in - * all the translations. The result (options.h) is included by - * xmlpool.h which in turn can be included by drivers. - * - * The macros used to describe otions in this file are defined in - * ../xmlpool.h. - */ - -/* This is needed for xgettext to extract translatable strings. - * gen_xmlpool.py will discard this line. */ -/* #include <libintl.h> - * commented out by gen_xmlpool.py */ - -/* - * predefined option sections and options with multi-lingual descriptions - */ - -/** \brief Debugging options */ -#define DRI_CONF_SECTION_DEBUG \ -DRI_CONF_SECTION_BEGIN \ - DRI_CONF_DESC(en,"Debugging") \ - DRI_CONF_DESC(de,"Fehlersuche") \ - DRI_CONF_DESC(es,"Depurando") \ - DRI_CONF_DESC(nl,"Debuggen") \ - DRI_CONF_DESC(fr,"Debogage") \ - DRI_CONF_DESC(sv,"Felsökning") - -#define DRI_CONF_NO_RAST(def) \ -DRI_CONF_OPT_BEGIN(no_rast,bool,def) \ - DRI_CONF_DESC(en,"Disable 3D acceleration") \ - DRI_CONF_DESC(de,"3D-Beschleunigung abschalten") \ - DRI_CONF_DESC(es,"Desactivar aceleración 3D") \ - DRI_CONF_DESC(nl,"3D versnelling uitschakelen") \ - DRI_CONF_DESC(fr,"Désactiver l'accélération 3D") \ - DRI_CONF_DESC(sv,"Inaktivera 3D-accelerering") \ -DRI_CONF_OPT_END - -#define DRI_CONF_PERFORMANCE_BOXES(def) \ -DRI_CONF_OPT_BEGIN(performance_boxes,bool,def) \ - DRI_CONF_DESC(en,"Show performance boxes") \ - DRI_CONF_DESC(de,"Zeige Performanceboxen") \ - DRI_CONF_DESC(es,"Mostrar cajas de rendimiento") \ - DRI_CONF_DESC(nl,"Laat prestatie boxjes zien") \ - DRI_CONF_DESC(fr,"Afficher les boîtes de performance") \ - DRI_CONF_DESC(sv,"Visa prestandarutor") \ -DRI_CONF_OPT_END - - -/** \brief Texture-related options */ -#define DRI_CONF_SECTION_QUALITY \ -DRI_CONF_SECTION_BEGIN \ - DRI_CONF_DESC(en,"Image Quality") \ - DRI_CONF_DESC(de,"Bildqualität") \ - DRI_CONF_DESC(es,"Calidad de imagen") \ - DRI_CONF_DESC(nl,"Beeldkwaliteit") \ - DRI_CONF_DESC(fr,"Qualité d'image") \ - DRI_CONF_DESC(sv,"Bildkvalitet") - -#define DRI_CONF_EXCESS_MIPMAP(def) \ -DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \ - DRI_CONF_DESC(en,"Enable extra mipmap level") \ -DRI_CONF_OPT_END - -#define DRI_CONF_TEXTURE_DEPTH_FB 0 -#define DRI_CONF_TEXTURE_DEPTH_32 1 -#define DRI_CONF_TEXTURE_DEPTH_16 2 -#define DRI_CONF_TEXTURE_DEPTH_FORCE_16 3 -#define DRI_CONF_TEXTURE_DEPTH(def) \ -DRI_CONF_OPT_BEGIN_V(texture_depth,enum,def,"0:3") \ - DRI_CONF_DESC_BEGIN(en,"Texture color depth") \ - DRI_CONF_ENUM(0,"Prefer frame buffer color depth") \ - DRI_CONF_ENUM(1,"Prefer 32 bits per texel") \ - DRI_CONF_ENUM(2,"Prefer 16 bits per texel") \ - DRI_CONF_ENUM(3,"Force 16 bits per texel") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(de,"Texturfarbtiefe") \ - DRI_CONF_ENUM(0,"Bevorzuge Farbtiefe des Framebuffers") \ - DRI_CONF_ENUM(1,"Bevorzuge 32 bits pro Texel") \ - DRI_CONF_ENUM(2,"Bevorzuge 16 bits pro Texel") \ - DRI_CONF_ENUM(3,"Erzwinge 16 bits pro Texel") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(es,"Profundidad de color de textura") \ - DRI_CONF_ENUM(0,"Preferir profundidad de color del ”framebuffer“") \ - DRI_CONF_ENUM(1,"Preferir 32 bits por texel") \ - DRI_CONF_ENUM(2,"Preferir 16 bits por texel") \ - DRI_CONF_ENUM(3,"Forzar a 16 bits por texel") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(nl,"Textuurkleurendiepte") \ - DRI_CONF_ENUM(0,"Prefereer kaderbufferkleurdiepte") \ - DRI_CONF_ENUM(1,"Prefereer 32 bits per texel") \ - DRI_CONF_ENUM(2,"Prefereer 16 bits per texel") \ - DRI_CONF_ENUM(3,"Dwing 16 bits per texel af") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(fr,"Profondeur de texture") \ - DRI_CONF_ENUM(0,"Profondeur de couleur") \ - DRI_CONF_ENUM(1,"Préférer 32 bits par texel") \ - DRI_CONF_ENUM(2,"Prérérer 16 bits par texel") \ - DRI_CONF_ENUM(3,"Forcer 16 bits par texel") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(sv,"Färgdjup för texturer") \ - DRI_CONF_ENUM(0,"Föredra färgdjupet för framebuffer") \ - DRI_CONF_ENUM(1,"Föredra 32 bitar per texel") \ - DRI_CONF_ENUM(2,"Föredra 16 bitar per texel") \ - DRI_CONF_ENUM(3,"Tvinga 16 bitar per texel") \ - DRI_CONF_DESC_END \ -DRI_CONF_OPT_END - -#define DRI_CONF_DEF_MAX_ANISOTROPY(def,range) \ -DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \ - DRI_CONF_DESC(en,"Initial maximum value for anisotropic texture filtering") \ - DRI_CONF_DESC(de,"Initialer Maximalwert für anisotropische Texturfilterung") \ - DRI_CONF_DESC(es,"Valor máximo inicial para filtrado anisotrópico de textura") \ - DRI_CONF_DESC(nl,"Initïele maximum waarde voor anisotrophische textuur filtering") \ - DRI_CONF_DESC(fr,"Valeur maximale initiale pour le filtrage anisotropique de texture") \ - DRI_CONF_DESC(sv,"Initialt maximalt värde för anisotropisk texturfiltrering") \ -DRI_CONF_OPT_END - -#define DRI_CONF_NO_NEG_LOD_BIAS(def) \ -DRI_CONF_OPT_BEGIN(no_neg_lod_bias,bool,def) \ - DRI_CONF_DESC(en,"Forbid negative texture LOD bias") \ - DRI_CONF_DESC(de,"Verbiete negative Textur-Detailgradverschiebung") \ - DRI_CONF_DESC(es,"Prohibir valores negativos de Nivel De Detalle (LOD) de texturas") \ - DRI_CONF_DESC(nl,"Verbied negatief niveau detailonderscheid (LOD) van texturen") \ - DRI_CONF_DESC(fr,"Interdire le LOD bias negatif") \ - DRI_CONF_DESC(sv,"Förbjud negativ LOD-kompensation för texturer") \ -DRI_CONF_OPT_END - -#define DRI_CONF_FORCE_S3TC_ENABLE(def) \ -DRI_CONF_OPT_BEGIN(force_s3tc_enable,bool,def) \ - DRI_CONF_DESC(en,"Enable S3TC texture compression even if software support is not available") \ - DRI_CONF_DESC(de,"Aktiviere S3TC Texturkomprimierung auch wenn die nötige Softwareunterstützung fehlt") \ - DRI_CONF_DESC(es,"Activar la compresión de texturas S3TC incluso si el soporte por software no está disponible") \ - DRI_CONF_DESC(nl,"Schakel S3TC textuurcompressie in, zelfs als softwareondersteuning niet aanwezig is") \ - DRI_CONF_DESC(fr,"Activer la compression de texture S3TC même si le support logiciel est absent") \ - DRI_CONF_DESC(sv,"Aktivera S3TC-texturkomprimering även om programvarustöd saknas") \ -DRI_CONF_OPT_END - -#define DRI_CONF_COLOR_REDUCTION_ROUND 0 -#define DRI_CONF_COLOR_REDUCTION_DITHER 1 -#define DRI_CONF_COLOR_REDUCTION(def) \ -DRI_CONF_OPT_BEGIN_V(color_reduction,enum,def,"0:1") \ - DRI_CONF_DESC_BEGIN(en,"Initial color reduction method") \ - DRI_CONF_ENUM(0,"Round colors") \ - DRI_CONF_ENUM(1,"Dither colors") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(de,"Initiale Farbreduktionsmethode") \ - DRI_CONF_ENUM(0,"Farben runden") \ - DRI_CONF_ENUM(1,"Farben rastern") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(es,"Método inicial de reducción de color") \ - DRI_CONF_ENUM(0,"Colores redondeados") \ - DRI_CONF_ENUM(1,"Colores suavizados") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(nl,"Initïele kleurreductie methode") \ - DRI_CONF_ENUM(0,"Rond kleuren af") \ - DRI_CONF_ENUM(1,"Rasteriseer kleuren") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(fr,"Technique de réduction de couleurs") \ - DRI_CONF_ENUM(0,"Arrondir les valeurs de couleur") \ - DRI_CONF_ENUM(1,"Tramer les couleurs") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(sv,"Initial färgminskningsmetod") \ - DRI_CONF_ENUM(0,"Avrunda färger") \ - DRI_CONF_ENUM(1,"Utjämna färger") \ - DRI_CONF_DESC_END \ -DRI_CONF_OPT_END - -#define DRI_CONF_ROUND_TRUNC 0 -#define DRI_CONF_ROUND_ROUND 1 -#define DRI_CONF_ROUND_MODE(def) \ -DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \ - DRI_CONF_DESC_BEGIN(en,"Color rounding method") \ - DRI_CONF_ENUM(0,"Round color components downward") \ - DRI_CONF_ENUM(1,"Round to nearest color") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(de,"Farbrundungsmethode") \ - DRI_CONF_ENUM(0,"Farbkomponenten abrunden") \ - DRI_CONF_ENUM(1,"Zur ähnlichsten Farbe runden") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(es,"Método de redondeo de colores") \ - DRI_CONF_ENUM(0,"Redondear hacia abajo los componentes de color") \ - DRI_CONF_ENUM(1,"Redondear al color más cercano") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(nl,"Kleurafrondingmethode") \ - DRI_CONF_ENUM(0,"Rond kleurencomponenten af naar beneden") \ - DRI_CONF_ENUM(1,"Rond af naar dichtsbijzijnde kleur") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(fr,"Méthode d'arrondi des couleurs") \ - DRI_CONF_ENUM(0,"Arrondi à l'inférieur") \ - DRI_CONF_ENUM(1,"Arrondi au plus proche") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(sv,"Färgavrundningsmetod") \ - DRI_CONF_ENUM(0,"Avrunda färdkomponenter nedåt") \ - DRI_CONF_ENUM(1,"Avrunda till närmsta färg") \ - DRI_CONF_DESC_END \ -DRI_CONF_OPT_END - -#define DRI_CONF_DITHER_XERRORDIFF 0 -#define DRI_CONF_DITHER_XERRORDIFFRESET 1 -#define DRI_CONF_DITHER_ORDERED 2 -#define DRI_CONF_DITHER_MODE(def) \ -DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \ - DRI_CONF_DESC_BEGIN(en,"Color dithering method") \ - DRI_CONF_ENUM(0,"Horizontal error diffusion") \ - DRI_CONF_ENUM(1,"Horizontal error diffusion, reset error at line start") \ - DRI_CONF_ENUM(2,"Ordered 2D color dithering") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(de,"Farbrasterungsmethode") \ - DRI_CONF_ENUM(0,"Horizontale Fehlerstreuung") \ - DRI_CONF_ENUM(1,"Horizontale Fehlerstreuung, Fehler am Zeilenanfang zurücksetzen") \ - DRI_CONF_ENUM(2,"Geordnete 2D Farbrasterung") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(es,"Método de suavizado de color") \ - DRI_CONF_ENUM(0,"Difusión de error horizontal") \ - DRI_CONF_ENUM(1,"Difusión de error horizontal, reiniciar error al comienzo de línea") \ - DRI_CONF_ENUM(2,"Suavizado de color 2D ordenado") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(nl,"Kleurrasteriseringsmethode") \ - DRI_CONF_ENUM(0,"Horizontale foutdiffusie") \ - DRI_CONF_ENUM(1,"Horizontale foutdiffusie, zet fout bij lijnbegin terug") \ - DRI_CONF_ENUM(2,"Geordende 2D kleurrasterisering") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(fr,"Méthode de tramage") \ - DRI_CONF_ENUM(0,"Diffusion d'erreur horizontale") \ - DRI_CONF_ENUM(1,"Diffusion d'erreur horizontale, réinitialisé pour chaque ligne") \ - DRI_CONF_ENUM(2,"Tramage ordonné des couleurs") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(sv,"Färgutjämningsmetod") \ - DRI_CONF_ENUM(0,"Horisontell felspridning") \ - DRI_CONF_ENUM(1,"Horisontell felspridning, återställ fel vid radbörjan") \ - DRI_CONF_ENUM(2,"Ordnad 2D-färgutjämning") \ - DRI_CONF_DESC_END \ -DRI_CONF_OPT_END - -#define DRI_CONF_FLOAT_DEPTH(def) \ -DRI_CONF_OPT_BEGIN(float_depth,bool,def) \ - DRI_CONF_DESC(en,"Floating point depth buffer") \ - DRI_CONF_DESC(de,"Fließkomma z-Puffer") \ - DRI_CONF_DESC(es,"Búfer de profundidad en coma flotante") \ - DRI_CONF_DESC(nl,"Dieptebuffer als commagetal") \ - DRI_CONF_DESC(fr,"Z-buffer en virgule flottante") \ - DRI_CONF_DESC(sv,"Buffert för flytande punktdjup") \ -DRI_CONF_OPT_END - -/** \brief Performance-related options */ -#define DRI_CONF_SECTION_PERFORMANCE \ -DRI_CONF_SECTION_BEGIN \ - DRI_CONF_DESC(en,"Performance") \ - DRI_CONF_DESC(de,"Leistung") \ - DRI_CONF_DESC(es,"Rendimiento") \ - DRI_CONF_DESC(nl,"Prestatie") \ - DRI_CONF_DESC(fr,"Performance") \ - DRI_CONF_DESC(sv,"Prestanda") - -#define DRI_CONF_TCL_SW 0 -#define DRI_CONF_TCL_PIPELINED 1 -#define DRI_CONF_TCL_VTXFMT 2 -#define DRI_CONF_TCL_CODEGEN 3 -#define DRI_CONF_TCL_MODE(def) \ -DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \ - DRI_CONF_DESC_BEGIN(en,"TCL mode (Transformation, Clipping, Lighting)") \ - DRI_CONF_ENUM(0,"Use software TCL pipeline") \ - DRI_CONF_ENUM(1,"Use hardware TCL as first TCL pipeline stage") \ - DRI_CONF_ENUM(2,"Bypass the TCL pipeline") \ - DRI_CONF_ENUM(3,"Bypass the TCL pipeline with state-based machine code generated on-the-fly") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(de,"TCL-Modus (Transformation, Clipping, Licht)") \ - DRI_CONF_ENUM(0,"Benutze die Software-TCL-Pipeline") \ - DRI_CONF_ENUM(1,"Benutze Hardware TCL als erste Stufe der TCL-Pipeline") \ - DRI_CONF_ENUM(2,"Umgehe die TCL-Pipeline") \ - DRI_CONF_ENUM(3,"Umgehe die TCL-Pipeline mit zur Laufzeit erzeugtem, zustandsbasiertem Maschinencode") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(es,"Modo TCL (Transformación, Recorte, Iluminación)") \ - DRI_CONF_ENUM(0,"Usar tubería TCL por software") \ - DRI_CONF_ENUM(1,"Usar TCL por hardware en la primera fase de la tubería TCL") \ - DRI_CONF_ENUM(2,"Pasar por alto la tubería TCL") \ - DRI_CONF_ENUM(3,"Pasar por alto la tubería TCL con código máquina basado en estados generado al vuelo") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(nl,"TCL-modus (Transformatie, Clipping, Licht)") \ - DRI_CONF_ENUM(0,"Gebruik software TCL pijpleiding") \ - DRI_CONF_ENUM(1,"Gebruik hardware TCL as eerste TCL pijpleiding trap") \ - DRI_CONF_ENUM(2,"Omzeil de TCL pijpleiding") \ - DRI_CONF_ENUM(3,"Omzeil de TCL pijpleiding met staatgebaseerde machinecode die tijdens executie gegenereerd wordt") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(fr,"Mode de TCL (Transformation, Clipping, Eclairage)") \ - DRI_CONF_ENUM(0,"Utiliser un pipeline TCL logiciel") \ - DRI_CONF_ENUM(1,"Utiliser le TCL matériel pour le premier niveau de pipeline") \ - DRI_CONF_ENUM(2,"Court-circuiter le pipeline TCL") \ - DRI_CONF_ENUM(3,"Court-circuiter le pipeline TCL par une machine à états qui génère le codede TCL à la volée") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(sv,"TCL-läge (Transformation, Clipping, Lighting)") \ - DRI_CONF_ENUM(0,"Använd programvaru-TCL-rörledning") \ - DRI_CONF_ENUM(1,"Använd maskinvaru-TCL som första TCL-rörledningssteg") \ - DRI_CONF_ENUM(2,"Kringgå TCL-rörledningen") \ - DRI_CONF_ENUM(3,"Kringgå TCL-rörledningen med tillståndsbaserad maskinkod som direktgenereras") \ - DRI_CONF_DESC_END \ -DRI_CONF_OPT_END - -#define DRI_CONF_FTHROTTLE_BUSY 0 -#define DRI_CONF_FTHROTTLE_USLEEPS 1 -#define DRI_CONF_FTHROTTLE_IRQS 2 -#define DRI_CONF_FTHROTTLE_MODE(def) \ -DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \ - DRI_CONF_DESC_BEGIN(en,"Method to limit rendering latency") \ - DRI_CONF_ENUM(0,"Busy waiting for the graphics hardware") \ - DRI_CONF_ENUM(1,"Sleep for brief intervals while waiting for the graphics hardware") \ - DRI_CONF_ENUM(2,"Let the graphics hardware emit a software interrupt and sleep") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(de,"Methode zur Begrenzung der Bildverzögerung") \ - DRI_CONF_ENUM(0,"Aktives Warten auf die Grafikhardware") \ - DRI_CONF_ENUM(1,"Kurze Schlafintervalle beim Warten auf die Grafikhardware") \ - DRI_CONF_ENUM(2,"Die Grafikhardware eine Softwareunterbrechnung erzeugen lassen und schlafen") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(es,"Método para limitar la latencia de rénder") \ - DRI_CONF_ENUM(0,"Esperar activamente al hardware gráfico") \ - DRI_CONF_ENUM(1,"Dormir en intervalos cortos mientras se espera al hardware gráfico") \ - DRI_CONF_ENUM(2,"Permitir que el hardware gráfico emita una interrupción de software y duerma") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(nl,"Methode om beeldopbouwvertraging te onderdrukken") \ - DRI_CONF_ENUM(0,"Actief wachten voor de grafische hardware") \ - DRI_CONF_ENUM(1,"Slaap voor korte intervallen tijdens het wachten op de grafische hardware") \ - DRI_CONF_ENUM(2,"Laat de grafische hardware een software onderbreking uitzenden en in slaap vallen") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(fr,"Méthode d'attente de la carte graphique") \ - DRI_CONF_ENUM(0,"Attente active de la carte graphique") \ - DRI_CONF_ENUM(1,"Attente utilisant usleep()") \ - DRI_CONF_ENUM(2,"Utiliser les interruptions") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(sv,"Metod för att begränsa renderingslatens") \ - DRI_CONF_ENUM(0,"Upptagen med att vänta på grafikhårdvaran") \ - DRI_CONF_ENUM(1,"Sov i korta intervall under väntan på grafikhårdvaran") \ - DRI_CONF_ENUM(2,"Låt grafikhårdvaran sända ut ett programvaruavbrott och sov") \ - DRI_CONF_DESC_END \ -DRI_CONF_OPT_END - -#define DRI_CONF_VBLANK_NEVER 0 -#define DRI_CONF_VBLANK_DEF_INTERVAL_0 1 -#define DRI_CONF_VBLANK_DEF_INTERVAL_1 2 -#define DRI_CONF_VBLANK_ALWAYS_SYNC 3 -#define DRI_CONF_VBLANK_MODE(def) \ -DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \ - DRI_CONF_DESC_BEGIN(en,"Synchronization with vertical refresh (swap intervals)") \ - DRI_CONF_ENUM(0,"Never synchronize with vertical refresh, ignore application's choice") \ - DRI_CONF_ENUM(1,"Initial swap interval 0, obey application's choice") \ - DRI_CONF_ENUM(2,"Initial swap interval 1, obey application's choice") \ - DRI_CONF_ENUM(3,"Always synchronize with vertical refresh, application chooses the minimum swap interval") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(de,"Synchronisation mit der vertikalen Bildwiederholung") \ - DRI_CONF_ENUM(0,"Niemals mit der Bildwiederholung synchronisieren, Anweisungen der Anwendung ignorieren") \ - DRI_CONF_ENUM(1,"Initiales Bildinterval 0, Anweisungen der Anwendung gehorchen") \ - DRI_CONF_ENUM(2,"Initiales Bildinterval 1, Anweisungen der Anwendung gehorchen") \ - DRI_CONF_ENUM(3,"Immer mit der Bildwiederholung synchronisieren, Anwendung wählt das minimale Bildintervall") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(es,"Sincronización con el refresco vertical (intervalos de intercambio)") \ - DRI_CONF_ENUM(0,"No sincronizar nunca con el refresco vertical, ignorar la elección de la aplicación") \ - DRI_CONF_ENUM(1,"Intervalo de intercambio inicial 0, obedecer la elección de la aplicación") \ - DRI_CONF_ENUM(2,"Intervalo de intercambio inicial 1, obedecer la elección de la aplicación") \ - DRI_CONF_ENUM(3,"Sincronizar siempre con el refresco vertical, la aplicación elige el intervalo de intercambio mínimo") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(nl,"Synchronisatie met verticale verversing (interval omwisselen)") \ - DRI_CONF_ENUM(0,"Nooit synchroniseren met verticale verversing, negeer de keuze van de applicatie") \ - DRI_CONF_ENUM(1,"Initïeel omwisselingsinterval 0, honoreer de keuze van de applicatie") \ - DRI_CONF_ENUM(2,"Initïeel omwisselingsinterval 1, honoreer de keuze van de applicatie") \ - DRI_CONF_ENUM(3,"Synchroniseer altijd met verticale verversing, de applicatie kiest het minimum omwisselingsinterval") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(fr,"Synchronisation de l'affichage avec le balayage vertical") \ - DRI_CONF_ENUM(0,"Ne jamais synchroniser avec le balayage vertical, ignorer le choix de l'application") \ - DRI_CONF_ENUM(1,"Ne pas synchroniser avec le balayage vertical par défaut, mais obéir au choix de l'application") \ - DRI_CONF_ENUM(2,"Synchroniser avec le balayage vertical par défaut, mais obéir au choix de l'application") \ - DRI_CONF_ENUM(3,"Toujours synchroniser avec le balayage vertical, l'application choisit l'intervalle minimal") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(sv,"Synkronisering med vertikal uppdatering (växlingsintervall)") \ - DRI_CONF_ENUM(0,"Synkronisera aldrig med vertikal uppdatering, ignorera programmets val") \ - DRI_CONF_ENUM(1,"Initialt växlingsintervall 0, följ programmets val") \ - DRI_CONF_ENUM(2,"Initialt växlingsintervall 1, följ programmets val") \ - DRI_CONF_ENUM(3,"Synkronisera alltid med vertikal uppdatering, programmet väljer den minsta växlingsintervallen") \ - DRI_CONF_DESC_END \ -DRI_CONF_OPT_END - -#define DRI_CONF_HYPERZ_DISABLED 0 -#define DRI_CONF_HYPERZ_ENABLED 1 -#define DRI_CONF_HYPERZ(def) \ -DRI_CONF_OPT_BEGIN(hyperz,bool,def) \ - DRI_CONF_DESC(en,"Use HyperZ to boost performance") \ - DRI_CONF_DESC(de,"HyperZ zur Leistungssteigerung verwenden") \ - DRI_CONF_DESC(es,"Usar HyperZ para potenciar rendimiento") \ - DRI_CONF_DESC(nl,"Gebruik HyperZ om de prestaties te verbeteren") \ - DRI_CONF_DESC(fr,"Utiliser le HyperZ pour améliorer les performances") \ - DRI_CONF_DESC(sv,"Använd HyperZ för att maximera prestandan") \ -DRI_CONF_OPT_END - -#define DRI_CONF_PP_CELSHADE(def) \ -DRI_CONF_OPT_BEGIN_V(pp_celshade,enum,def,"0:1") \ - DRI_CONF_DESC(en,"A post-processing filter to cel-shade the output") \ - DRI_CONF_DESC(de,"A post-processing filter to cel-shade the output") \ - DRI_CONF_DESC(es,"A post-processing filter to cel-shade the output") \ - DRI_CONF_DESC(nl,"A post-processing filter to cel-shade the output") \ - DRI_CONF_DESC(fr,"A post-processing filter to cel-shade the output") \ - DRI_CONF_DESC(sv,"A post-processing filter to cel-shade the output") \ -DRI_CONF_OPT_END - -#define DRI_CONF_PP_NORED(def) \ -DRI_CONF_OPT_BEGIN_V(pp_nored,enum,def,"0:1") \ - DRI_CONF_DESC(en,"A post-processing filter to remove the red channel") \ - DRI_CONF_DESC(de,"A post-processing filter to remove the red channel") \ - DRI_CONF_DESC(es,"A post-processing filter to remove the red channel") \ - DRI_CONF_DESC(nl,"A post-processing filter to remove the red channel") \ - DRI_CONF_DESC(fr,"A post-processing filter to remove the red channel") \ - DRI_CONF_DESC(sv,"A post-processing filter to remove the red channel") \ -DRI_CONF_OPT_END - -#define DRI_CONF_PP_NOGREEN(def) \ -DRI_CONF_OPT_BEGIN_V(pp_nogreen,enum,def,"0:1") \ - DRI_CONF_DESC(en,"A post-processing filter to remove the green channel") \ - DRI_CONF_DESC(de,"A post-processing filter to remove the green channel") \ - DRI_CONF_DESC(es,"A post-processing filter to remove the green channel") \ - DRI_CONF_DESC(nl,"A post-processing filter to remove the green channel") \ - DRI_CONF_DESC(fr,"A post-processing filter to remove the green channel") \ - DRI_CONF_DESC(sv,"A post-processing filter to remove the green channel") \ -DRI_CONF_OPT_END - -#define DRI_CONF_PP_NOBLUE(def) \ -DRI_CONF_OPT_BEGIN_V(pp_noblue,enum,def,"0:1") \ - DRI_CONF_DESC(en,"A post-processing filter to remove the blue channel") \ - DRI_CONF_DESC(de,"A post-processing filter to remove the blue channel") \ - DRI_CONF_DESC(es,"A post-processing filter to remove the blue channel") \ - DRI_CONF_DESC(nl,"A post-processing filter to remove the blue channel") \ - DRI_CONF_DESC(fr,"A post-processing filter to remove the blue channel") \ - DRI_CONF_DESC(sv,"A post-processing filter to remove the blue channel") \ -DRI_CONF_OPT_END - -#define DRI_CONF_PP_JIMENEZMLAA(def,min,max) \ -DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa,int,def, # min ":" # max ) \ - DRI_CONF_DESC(en,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \ - DRI_CONF_DESC(de,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \ - DRI_CONF_DESC(es,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \ - DRI_CONF_DESC(nl,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \ - DRI_CONF_DESC(fr,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \ - DRI_CONF_DESC(sv,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality") \ -DRI_CONF_OPT_END - -#define DRI_CONF_PP_JIMENEZMLAA_COLOR(def,min,max) \ -DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa_color,int,def, # min ":" # max ) \ - DRI_CONF_DESC(en,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \ - DRI_CONF_DESC(de,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \ - DRI_CONF_DESC(es,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \ - DRI_CONF_DESC(nl,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \ - DRI_CONF_DESC(fr,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \ - DRI_CONF_DESC(sv,"Morphological anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") \ -DRI_CONF_OPT_END - -#define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \ -DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \ - DRI_CONF_DESC(en,"Number of texture units used") \ - DRI_CONF_DESC(de,"Anzahl der benutzten Textureinheiten") \ - DRI_CONF_DESC(es,"Número de unidades de textura usadas") \ - DRI_CONF_DESC(nl,"Aantal textuureenheden in gebruik") \ - DRI_CONF_DESC(fr,"Nombre d'unités de texture") \ - DRI_CONF_DESC(sv,"Antal använda texturenheter") \ -DRI_CONF_OPT_END - -#define DRI_CONF_ALLOW_LARGE_TEXTURES(def) \ -DRI_CONF_OPT_BEGIN_V(allow_large_textures,enum,def,"0:2") \ - DRI_CONF_DESC_BEGIN(en,"Support larger textures not guaranteed to fit into graphics memory") \ - DRI_CONF_ENUM(0,"No") \ - DRI_CONF_ENUM(1,"At least 1 texture must fit under worst-case assumptions") \ - DRI_CONF_ENUM(2,"Announce hardware limits") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(de,"Unterstütze grosse Texturen die evtl. nicht in den Grafikspeicher passen") \ - DRI_CONF_ENUM(0,"Nein") \ - DRI_CONF_ENUM(1,"Mindestens 1 Textur muss auch im schlechtesten Fall Platz haben") \ - DRI_CONF_ENUM(2,"Benutze Hardware-Limits") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(es,"Support larger textures not guaranteed to fit into graphics memory") \ - DRI_CONF_ENUM(0,"No") \ - DRI_CONF_ENUM(1,"At least 1 texture must fit under worst-case assumptions") \ - DRI_CONF_ENUM(2,"Announce hardware limits") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(nl,"Support larger textures not guaranteed to fit into graphics memory") \ - DRI_CONF_ENUM(0,"No") \ - DRI_CONF_ENUM(1,"At least 1 texture must fit under worst-case assumptions") \ - DRI_CONF_ENUM(2,"Announce hardware limits") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(fr,"Support larger textures not guaranteed to fit into graphics memory") \ - DRI_CONF_ENUM(0,"No") \ - DRI_CONF_ENUM(1,"At least 1 texture must fit under worst-case assumptions") \ - DRI_CONF_ENUM(2,"Announce hardware limits") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(sv,"Stöd för större texturer är inte garanterat att passa i grafikminnet") \ - DRI_CONF_ENUM(0,"Nej") \ - DRI_CONF_ENUM(1,"Åtminstone en textur måste passa för antaget sämsta förhållande") \ - DRI_CONF_ENUM(2,"Annonsera hårdvarubegränsningar") \ - DRI_CONF_DESC_END \ -DRI_CONF_OPT_END - -#define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \ -DRI_CONF_OPT_BEGIN_V(texture_blend_quality,float,def,range) \ - DRI_CONF_DESC(en,"Texture filtering quality vs. speed, AKA “brilinear” texture filtering") \ - DRI_CONF_DESC(de,"Texturfilterqualität versus -geschwindigkeit, auch bekannt als „brilineare“ Texturfilterung") \ - DRI_CONF_DESC(es,"Calidad de filtrado de textura vs. velocidad, alias filtrado ”brilinear“ de textura") \ - DRI_CONF_DESC(nl,"Textuurfilterkwaliteit versus -snelheid, ookwel bekend als “brilineaire” textuurfiltering") \ - DRI_CONF_DESC(fr,"Qualité/performance du filtrage trilinéaire de texture (filtrage brilinéaire)") \ - DRI_CONF_DESC(sv,"Texturfiltreringskvalitet mot hastighet, även kallad ”brilinear”-texturfiltrering") \ -DRI_CONF_OPT_END - -#define DRI_CONF_TEXTURE_HEAPS_ALL 0 -#define DRI_CONF_TEXTURE_HEAPS_CARD 1 -#define DRI_CONF_TEXTURE_HEAPS_GART 2 -#define DRI_CONF_TEXTURE_HEAPS(def) \ -DRI_CONF_OPT_BEGIN_V(texture_heaps,enum,def,"0:2") \ - DRI_CONF_DESC_BEGIN(en,"Used types of texture memory") \ - DRI_CONF_ENUM(0,"All available memory") \ - DRI_CONF_ENUM(1,"Only card memory (if available)") \ - DRI_CONF_ENUM(2,"Only GART (AGP/PCIE) memory (if available)") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(de,"Benutzte Arten von Texturspeicher") \ - DRI_CONF_ENUM(0,"Aller verfügbarer Speicher") \ - DRI_CONF_ENUM(1,"Nur Grafikspeicher (falls verfügbar)") \ - DRI_CONF_ENUM(2,"Nur GART-Speicher (AGP/PCIE) (falls verfügbar)") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(es,"Tipos de memoria de textura usados") \ - DRI_CONF_ENUM(0,"Toda la memoria disponible") \ - DRI_CONF_ENUM(1,"Sólo la memoria de la tarjeta (si disponible)") \ - DRI_CONF_ENUM(2,"Sólo memoria GART (AGP/PCIE) (si disponible)") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(nl,"Gebruikte soorten textuurgeheugen") \ - DRI_CONF_ENUM(0,"Al het beschikbaar geheugen") \ - DRI_CONF_ENUM(1,"Alleen geheugen op de kaart (als het aanwezig is)") \ - DRI_CONF_ENUM(2,"Alleen GART (AGP/PCIE) geheugen (als het aanwezig is)") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(fr,"Types de mémoire de texture") \ - DRI_CONF_ENUM(0,"Utiliser toute la mémoire disponible") \ - DRI_CONF_ENUM(1,"Utiliser uniquement la mémoire graphique (si disponible)") \ - DRI_CONF_ENUM(2,"Utiliser uniquement la mémoire GART (AGP/PCIE) (si disponible)") \ - DRI_CONF_DESC_END \ - DRI_CONF_DESC_BEGIN(sv,"Använda typer av texturminne") \ - DRI_CONF_ENUM(0,"Allt tillgängligt minne") \ - DRI_CONF_ENUM(1,"Endast kortminne (om tillgängligt)") \ - DRI_CONF_ENUM(2,"Endast GART-minne (AGP/PCIE) (om tillgängligt)") \ - DRI_CONF_DESC_END \ -DRI_CONF_OPT_END - -/* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program - On cards where there is no documentation (r200) or on rasterization-only hardware). */ -#define DRI_CONF_SECTION_SOFTWARE \ -DRI_CONF_SECTION_BEGIN \ - DRI_CONF_DESC(en,"Features that are not hardware-accelerated") \ - DRI_CONF_DESC(de,"Funktionalität, die nicht hardwarebeschleunigt ist") \ - DRI_CONF_DESC(es,"Características no aceleradas por hardware") \ - DRI_CONF_DESC(nl,"Eigenschappen die niet hardwareversneld zijn") \ - DRI_CONF_DESC(fr,"Fonctionnalités ne bénéficiant pas d'une accélération matérielle") \ - DRI_CONF_DESC(sv,"Funktioner som inte är hårdvaruaccelererade") - -#define DRI_CONF_ARB_VERTEX_PROGRAM(def) \ -DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \ - DRI_CONF_DESC(en,"Enable extension GL_ARB_vertex_program") \ - DRI_CONF_DESC(de,"Erweiterung GL_ARB_vertex_program aktivieren") \ - DRI_CONF_DESC(es,"Activar la extensión GL_ARB_vertex_program") \ - DRI_CONF_DESC(nl,"Zet uitbreiding GL_ARB_vertex_program aan") \ - DRI_CONF_DESC(fr,"Activer l'extension GL_ARB_vertex_program") \ - DRI_CONF_DESC(sv,"Aktivera tillägget GL_ARB_vertex_program") \ -DRI_CONF_OPT_END - -#define DRI_CONF_ALWAYS_FLUSH_BATCH(def) \ -DRI_CONF_OPT_BEGIN(always_flush_batch,bool,def) \ - DRI_CONF_DESC(en,"Enable flushing batchbuffer after each draw call") \ - DRI_CONF_DESC(de,"Enable flushing batchbuffer after each draw call") \ - DRI_CONF_DESC(es,"Enable flushing batchbuffer after each draw call") \ - DRI_CONF_DESC(nl,"Enable flushing batchbuffer after each draw call") \ - DRI_CONF_DESC(fr,"Enable flushing batchbuffer after each draw call") \ - DRI_CONF_DESC(sv,"Enable flushing batchbuffer after each draw call") \ -DRI_CONF_OPT_END - -#define DRI_CONF_ALWAYS_FLUSH_CACHE(def) \ -DRI_CONF_OPT_BEGIN(always_flush_cache,bool,def) \ - DRI_CONF_DESC(en,"Enable flushing GPU caches with each draw call") \ - DRI_CONF_DESC(de,"Enable flushing GPU caches with each draw call") \ - DRI_CONF_DESC(es,"Enable flushing GPU caches with each draw call") \ - DRI_CONF_DESC(nl,"Enable flushing GPU caches with each draw call") \ - DRI_CONF_DESC(fr,"Enable flushing GPU caches with each draw call") \ - DRI_CONF_DESC(sv,"Enable flushing GPU caches with each draw call") \ -DRI_CONF_OPT_END - -#define DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(def) \ -DRI_CONF_OPT_BEGIN(force_glsl_extensions_warn,bool,def) \ - DRI_CONF_DESC(en,"Force GLSL extension default behavior to 'warn'") \ - DRI_CONF_DESC(de,"Force GLSL extension default behavior to 'warn'") \ - DRI_CONF_DESC(es,"Force GLSL extension default behavior to 'warn'") \ - DRI_CONF_DESC(nl,"Force GLSL extension default behavior to 'warn'") \ - DRI_CONF_DESC(fr,"Force GLSL extension default behavior to 'warn'") \ - DRI_CONF_DESC(sv,"Force GLSL extension default behavior to 'warn'") \ -DRI_CONF_OPT_END - -#define DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(def) \ -DRI_CONF_OPT_BEGIN(disable_blend_func_extended,bool,def) \ - DRI_CONF_DESC(en,"Disable dual source blending") \ - DRI_CONF_DESC(de,"Disable dual source blending") \ - DRI_CONF_DESC(es,"Disable dual source blending") \ - DRI_CONF_DESC(nl,"Disable dual source blending") \ - DRI_CONF_DESC(fr,"Disable dual source blending") \ - DRI_CONF_DESC(sv,"Disable dual source blending") \ -DRI_CONF_OPT_END diff --git a/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h b/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h index e2d4aaee3..683a47366 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h +++ b/mesalib/src/mesa/drivers/dri/common/xmlpool/t_options.h @@ -272,3 +272,18 @@ DRI_CONF_OPT_END DRI_CONF_OPT_BEGIN(always_flush_cache,bool,def) \ DRI_CONF_DESC(en,gettext("Enable flushing GPU caches with each draw call")) \ DRI_CONF_OPT_END + +#define DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(def) \ +DRI_CONF_OPT_BEGIN(force_glsl_extensions_warn,bool,def) \ + DRI_CONF_DESC(en,gettext("Force GLSL extension default behavior to 'warn'")) \ +DRI_CONF_OPT_END + +#define DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(def) \ +DRI_CONF_OPT_BEGIN(disable_blend_func_extended,bool,def) \ + DRI_CONF_DESC(en,gettext("Disable dual source blending")) \ +DRI_CONF_OPT_END + +#define DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(def) \ +DRI_CONF_OPT_BEGIN(disable_glsl_line_continuations,bool,def) \ + DRI_CONF_DESC(en,gettext("Disable backslash-based line continuations in GLSL source")) \ +DRI_CONF_OPT_END diff --git a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am index 244aa8b27..3e539073c 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am +++ b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am @@ -23,9 +23,6 @@ include Makefile.sources -# Hack to make some of the non-automake variables work. -TOP=$(top_builddir) - AM_CFLAGS = \ -D__NOT_HAVE_DRM_H \ -I$(top_srcdir)/include \ diff --git a/mesalib/src/mesa/main/api_arrayelt.c b/mesalib/src/mesa/main/api_arrayelt.c index 0fa242997..ea3361488 100644 --- a/mesalib/src/mesa/main/api_arrayelt.c +++ b/mesalib/src/mesa/main/api_arrayelt.c @@ -1636,7 +1636,7 @@ void GLAPIENTRY _ae_ArrayElement( GLint elt ) /* If PrimitiveRestart is enabled and the index is the RestartIndex * then we call PrimitiveRestartNV and return. */ - if (ctx->Array.PrimitiveRestart && (elt == ctx->Array.RestartIndex)) { + if (ctx->Array._PrimitiveRestart && (elt == ctx->Array._RestartIndex)) { CALL_PrimitiveRestartNV((struct _glapi_table *)disp, ()); return; } diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index a19d61054..d6f298d93 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -1377,7 +1377,10 @@ copy_array_attrib(struct gl_context *ctx, dest->LockFirst = src->LockFirst; dest->LockCount = src->LockCount; dest->PrimitiveRestart = src->PrimitiveRestart; + dest->PrimitiveRestartFixedIndex = src->PrimitiveRestartFixedIndex; + dest->_PrimitiveRestart = src->_PrimitiveRestart; dest->RestartIndex = src->RestartIndex; + dest->_RestartIndex = src->_RestartIndex; /* skip NewState */ /* skip RebindArrays */ diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index b48794f95..73257290e 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -48,6 +48,20 @@ } +static void +update_derived_primitive_restart_state(struct gl_context *ctx) +{ + /* Update derived primitive restart state. + */ + if (ctx->Array.PrimitiveRestart) + ctx->Array._RestartIndex = ctx->Array.RestartIndex; + else + ctx->Array._RestartIndex = ~0; + + ctx->Array._PrimitiveRestart = ctx->Array.PrimitiveRestart + || ctx->Array.PrimitiveRestartFixedIndex; +} + /** * Helper to enable/disable client-side state. */ @@ -119,6 +133,8 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state) *var = state; + update_derived_primitive_restart_state(ctx); + if (state) arrayObj->_Enabled |= flag; else @@ -967,6 +983,17 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Array.PrimitiveRestart != state) { FLUSH_VERTICES(ctx, _NEW_TRANSFORM); ctx->Array.PrimitiveRestart = state; + update_derived_primitive_restart_state(ctx); + } + break; + + case GL_PRIMITIVE_RESTART_FIXED_INDEX: + if (!_mesa_is_gles3(ctx) && !ctx->Extensions.ARB_ES3_compatibility) + goto invalid_enum_error; + if (ctx->Array.PrimitiveRestartFixedIndex != state) { + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + ctx->Array.PrimitiveRestartFixedIndex = state; + update_derived_primitive_restart_state(ctx); } break; @@ -1542,6 +1569,12 @@ _mesa_IsEnabled( GLenum cap ) } return ctx->Array.PrimitiveRestart; + case GL_PRIMITIVE_RESTART_FIXED_INDEX: + if (!_mesa_is_gles3(ctx) && !ctx->Extensions.ARB_ES3_compatibility) { + goto invalid_enum_error; + } + return ctx->Array.PrimitiveRestartFixedIndex; + /* GL3.0 - GL_framebuffer_sRGB */ case GL_FRAMEBUFFER_SRGB_EXT: if (!_mesa_is_desktop_gl(ctx)) diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index 3486b65a4..c3c73fc26 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -100,6 +100,7 @@ static const struct extension extension_table[] = { { "GL_ARB_fragment_shader", o(ARB_fragment_shader), GL, 2002 }, { "GL_ARB_framebuffer_object", o(ARB_framebuffer_object), GL, 2005 }, { "GL_ARB_framebuffer_sRGB", o(EXT_framebuffer_sRGB), GL, 1998 }, + { "GL_ARB_get_program_binary", o(ARB_shader_objects), GL, 2010 }, { "GL_ARB_half_float_pixel", o(ARB_half_float_pixel), GL, 2003 }, { "GL_ARB_half_float_vertex", o(ARB_half_float_vertex), GL, 2008 }, { "GL_ARB_instanced_arrays", o(ARB_instanced_arrays), GL, 2008 }, @@ -249,6 +250,7 @@ static const struct extension extension_table[] = { { "GL_OES_fbo_render_mipmap", o(EXT_framebuffer_object), ES1 | ES2, 2005 }, { "GL_OES_fixed_point", o(dummy_true), ES1, 2002 }, { "GL_OES_framebuffer_object", o(EXT_framebuffer_object), ES1, 2005 }, + { "GL_OES_get_program_binary", o(ARB_shader_objects), ES2, 2008 }, { "GL_OES_mapbuffer", o(dummy_true), ES1 | ES2, 2005 }, { "GL_OES_matrix_get", o(dummy_true), ES1, 2004 }, { "GL_OES_packed_depth_stencil", o(EXT_packed_depth_stencil), ES1 | ES2, 2007 }, diff --git a/mesalib/src/mesa/main/format_unpack.c b/mesalib/src/mesa/main/format_unpack.c index d34a27b82..92ce86908 100644 --- a/mesalib/src/mesa/main/format_unpack.c +++ b/mesalib/src/mesa/main/format_unpack.c @@ -2696,6 +2696,20 @@ unpack_int_rgba_ABGR2101010_UINT(const GLuint *src, GLuint dst[][4], GLuint n) } } +static void +unpack_int_rgba_ARGB2101010(const GLuint *src, GLuint dst[][4], GLuint n) +{ + unsigned int i; + + for (i = 0; i < n; i++) { + GLuint tmp = src[i]; + dst[i][0] = (tmp >> 20) & 0x3ff; + dst[i][1] = (tmp >> 10) & 0x3ff; + dst[i][2] = (tmp >> 0) & 0x3ff; + dst[i][3] = (tmp >> 30) & 0x3; + } +} + void _mesa_unpack_uint_rgba_row(gl_format format, GLuint n, const void *src, GLuint dst[][4]) @@ -2871,6 +2885,10 @@ _mesa_unpack_uint_rgba_row(gl_format format, GLuint n, unpack_int_rgba_ABGR2101010_UINT(src, dst, n); break; + case MESA_FORMAT_ARGB2101010: + unpack_int_rgba_ARGB2101010(src, dst, n); + break; + default: _mesa_problem(NULL, "%s: bad format %s", __FUNCTION__, _mesa_get_format_name(format)); diff --git a/mesalib/src/mesa/main/get_hash_params.py b/mesalib/src/mesa/main/get_hash_params.py index 3db820a77..26a722a87 100644 --- a/mesalib/src/mesa/main/get_hash_params.py +++ b/mesalib/src/mesa/main/get_hash_params.py @@ -310,6 +310,12 @@ descriptor=[ [ "MAX_VARYING_VECTORS", "CONTEXT_INT(Const.MaxVarying), extra_ARB_ES2_compatibility_api_es2" ], [ "MAX_VERTEX_UNIFORM_VECTORS", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_ES2_compatibility_api_es2" ], [ "MAX_FRAGMENT_UNIFORM_VECTORS", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_ES2_compatibility_api_es2" ], + [ "NUM_SHADER_BINARY_FORMATS", "CONST(0), extra_ARB_ES2_compatibility_api_es2" ], + [ "SHADER_BINARY_FORMATS", "CONST(0), extra_ARB_ES2_compatibility_api_es2" ], + +# GL_ARB_get_program_binary / GL_OES_get_program_binary + [ "NUM_PROGRAM_BINARY_FORMATS", "CONST(0), extra_ARB_shader_objects" ], + [ "PROGRAM_BINARY_FORMATS", "LOC_CUSTOM, TYPE_INVALID, 0, extra_ARB_shader_objects" ], ]}, # GLES3 is not a typo. @@ -379,14 +385,6 @@ descriptor=[ [ "TEXTURE_EXTERNAL_OES", "LOC_CUSTOM, TYPE_BOOLEAN, 0, extra_OES_EGL_image_external" ], ]}, -# Enums unique to OpenGL ES 2.0 -{ "apis": ["GLES2"], "params": [ -# OES_get_program_binary - [ "NUM_SHADER_BINARY_FORMATS", "CONST(0), NO_EXTRA" ], - [ "SHADER_BINARY_FORMATS", "CONST(0), NO_EXTRA" ], -]}, - - # Remaining enums are only in OpenGL { "apis": ["GL", "GL_CORE"], "params": [ [ "ACCUM_RED_BITS", "BUFFER_INT(Visual.accumRedBits), NO_EXTRA" ], diff --git a/mesalib/src/mesa/main/glformats.c b/mesalib/src/mesa/main/glformats.c index f33a0503d..ff56ffad0 100644 --- a/mesalib/src/mesa/main/glformats.c +++ b/mesalib/src/mesa/main/glformats.c @@ -271,7 +271,8 @@ _mesa_bytes_per_pixel(GLenum format, GLenum type) case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: if (format == GL_RGBA || format == GL_BGRA || format == GL_ABGR_EXT || - format == GL_RGBA_INTEGER_EXT || format == GL_BGRA_INTEGER_EXT) + format == GL_RGBA_INTEGER_EXT || format == GL_BGRA_INTEGER_EXT || + format == GL_RGB) return sizeof(GLuint); else return -1; @@ -353,21 +354,9 @@ _mesa_bytes_per_vertex_attrib(GLint comps, GLenum type) * Test if the given format is an integer (non-normalized) format. */ GLboolean -_mesa_is_enum_format_integer(GLenum format) +_mesa_is_enum_format_unsigned_int(GLenum format) { switch (format) { - /* generic integer formats */ - case GL_RED_INTEGER_EXT: - case GL_GREEN_INTEGER_EXT: - case GL_BLUE_INTEGER_EXT: - case GL_ALPHA_INTEGER_EXT: - case GL_RGB_INTEGER_EXT: - case GL_RGBA_INTEGER_EXT: - case GL_BGR_INTEGER_EXT: - case GL_BGRA_INTEGER_EXT: - case GL_LUMINANCE_INTEGER_EXT: - case GL_LUMINANCE_ALPHA_INTEGER_EXT: - case GL_RG_INTEGER: /* specific integer formats */ case GL_RGBA32UI_EXT: case GL_RGB32UI_EXT: @@ -393,6 +382,34 @@ _mesa_is_enum_format_integer(GLenum format) case GL_INTENSITY8UI_EXT: case GL_LUMINANCE8UI_EXT: case GL_LUMINANCE_ALPHA8UI_EXT: + case GL_RGB10_A2UI: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + +/** + * Test if the given format is an integer (non-normalized) format. + */ +GLboolean +_mesa_is_enum_format_signed_int(GLenum format) +{ + switch (format) { + /* generic integer formats */ + case GL_RED_INTEGER_EXT: + case GL_GREEN_INTEGER_EXT: + case GL_BLUE_INTEGER_EXT: + case GL_ALPHA_INTEGER_EXT: + case GL_RGB_INTEGER_EXT: + case GL_RGBA_INTEGER_EXT: + case GL_BGR_INTEGER_EXT: + case GL_BGRA_INTEGER_EXT: + case GL_LUMINANCE_INTEGER_EXT: + case GL_LUMINANCE_ALPHA_INTEGER_EXT: + case GL_RG_INTEGER: + /* specific integer formats */ case GL_RGBA32I_EXT: case GL_RGB32I_EXT: case GL_RG32I: @@ -417,7 +434,6 @@ _mesa_is_enum_format_integer(GLenum format) case GL_INTENSITY8I_EXT: case GL_LUMINANCE8I_EXT: case GL_LUMINANCE_ALPHA8I_EXT: - case GL_RGB10_A2UI: return GL_TRUE; default: return GL_FALSE; @@ -426,6 +442,17 @@ _mesa_is_enum_format_integer(GLenum format) /** + * Test if the given format is an integer (non-normalized) format. + */ +GLboolean +_mesa_is_enum_format_integer(GLenum format) +{ + return _mesa_is_enum_format_unsigned_int(format) || + _mesa_is_enum_format_signed_int(format); +} + + +/** * Test if the given type is an integer (non-normalized) format. */ GLboolean @@ -1032,6 +1059,32 @@ _mesa_base_format_has_channel(GLenum base_format, GLenum pname) /** + * Returns the number of channels/components for a base format. + */ +GLint +_mesa_base_format_component_count(GLenum base_format) +{ + switch (base_format) { + case GL_RED: + case GL_ALPHA: + case GL_INTENSITY: + case GL_DEPTH_COMPONENT: + return 1; + case GL_RG: + case GL_LUMINANCE_ALPHA: + case GL_DEPTH_STENCIL: + return 2; + case GL_RGB: + return 3; + case GL_RGBA: + return 4; + default: + return -1; + } +} + + +/** * If format is a generic compressed format, return the corresponding * non-compressed format. For other formats, return the format as-is. */ diff --git a/mesalib/src/mesa/main/glformats.h b/mesalib/src/mesa/main/glformats.h index ccfb5e13c..fe604ddc9 100644 --- a/mesalib/src/mesa/main/glformats.h +++ b/mesalib/src/mesa/main/glformats.h @@ -62,6 +62,12 @@ extern GLboolean _mesa_is_enum_format_integer(GLenum format); extern GLboolean +_mesa_is_enum_format_unsigned_int(GLenum format); + +extern GLboolean +_mesa_is_enum_format_signed_int(GLenum format); + +extern GLboolean _mesa_is_enum_format_or_type_integer(GLenum format, GLenum type); extern GLboolean @@ -94,6 +100,9 @@ _mesa_base_format_to_integer_format(GLenum format); extern GLboolean _mesa_base_format_has_channel(GLenum base_format, GLenum pname); +extern GLint +_mesa_base_format_component_count(GLenum base_format); + extern GLenum _mesa_generic_compressed_format_to_uncompressed_format(GLenum format); diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index 318dcb548..8904b13d9 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -1634,9 +1634,20 @@ struct gl_array_attrib GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ - /** GL 3.1 (slightly different from GL_NV_primitive_restart) */ + /** + * \name Primitive restart controls + * + * Primitive restart is enabled if either \c PrimitiveRestart or + * \c PrimitiveRestart is set. If \c PrimitiveRestart is set, then + * \c RestartIndex is used as the cut vertex. Otherwise ~0 is used. + */ + /*@{*/ GLboolean PrimitiveRestart; + GLboolean PrimitiveRestartFixedIndex; + GLboolean _PrimitiveRestart; GLuint RestartIndex; + GLuint _RestartIndex; + /*@}*/ /* GL_ARB_vertex_buffer_object */ struct gl_buffer_object *ArrayBufferObj; @@ -2303,6 +2314,11 @@ struct gl_shader_program GLboolean DeletePending; /** + * Is the application intending to glGetProgramBinary this program? + */ + GLboolean BinaryRetreivableHint; + + /** * Flags that the linker should not reject the program if it lacks * a vertex or fragment shader. GLES2 doesn't allow separate * shader objects, and would reject them. However, we internally @@ -2973,6 +2989,12 @@ struct gl_constants * \sa _mesa_init_constants */ GLuint64 MaxElementIndex; + + /** + * Disable interpretation of line continuations (lines ending with a + * backslash character ('\') in GLSL source. + */ + GLboolean DisableGLSLLineContinuations; }; diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c index cfb20cd4c..054dfbad7 100644 --- a/mesalib/src/mesa/main/queryobj.c +++ b/mesalib/src/mesa/main/queryobj.c @@ -147,6 +147,12 @@ get_query_binding_point(struct gl_context *ctx, GLenum target) return &ctx->Query.CurrentOcclusionObject; else return NULL; + case GL_ANY_SAMPLES_PASSED_CONSERVATIVE: + if (ctx->Extensions.ARB_ES3_compatibility + || (ctx->API == API_OPENGLES2 && ctx->Version >= 30)) + return &ctx->Query.CurrentOcclusionObject; + else + return NULL; case GL_TIME_ELAPSED_EXT: if (ctx->Extensions.EXT_timer_query) return &ctx->Query.CurrentTimerObject; @@ -577,7 +583,8 @@ _mesa_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params) if (!q->Ready) ctx->Driver.WaitQuery(ctx, q); /* if result is too large for returned type, clamp to max value */ - if (q->Target == GL_ANY_SAMPLES_PASSED) { + if (q->Target == GL_ANY_SAMPLES_PASSED + || q->Target == GL_ANY_SAMPLES_PASSED_CONSERVATIVE) { if (q->Result) *params = GL_TRUE; else @@ -628,7 +635,8 @@ _mesa_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params) if (!q->Ready) ctx->Driver.WaitQuery(ctx, q); /* if result is too large for returned type, clamp to max value */ - if (q->Target == GL_ANY_SAMPLES_PASSED) { + if (q->Target == GL_ANY_SAMPLES_PASSED + || q->Target == GL_ANY_SAMPLES_PASSED_CONSERVATIVE) { if (q->Result) *params = GL_TRUE; else diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index 1f0002f6f..7f5fce796 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -583,6 +583,21 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param *params = shProg->NumUniformBlocks; return; + case GL_PROGRAM_BINARY_RETRIEVABLE_HINT: + /* This enum isn't part of the OES extension for OpenGL ES 2.0. It is + * only available with desktop OpenGL 3.0+ with the + * GL_ARB_get_program_binary extension or OpenGL ES 3.0. + * + * On desktop, we ignore the 3.0+ requirement because it is silly. + */ + if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) + break; + + *params = shProg->BinaryRetreivableHint; + return; + case GL_PROGRAM_BINARY_LENGTH: + *params = 0; + return; default: break; } @@ -1500,9 +1515,64 @@ _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, #endif /* FEATURE_ES2 */ +void GLAPIENTRY +_mesa_GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length, + GLenum *binaryFormat, GLvoid *binary) +{ + struct gl_shader_program *shProg; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetProgramBinary"); + if (!shProg) + return; + + if (!shProg->LinkStatus) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetProgramBinary(program %u not linked)", + shProg->Name); + return; + } + + if (bufSize < 0){ + _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramBinary(bufSize < 0)"); + return; + } + + /* The ARB_get_program_binary spec says: + * + * "If <length> is NULL, then no length is returned." + */ + if (length != NULL) + *length = 0; + + (void) binaryFormat; + (void) binary; +} void GLAPIENTRY -_mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value) +_mesa_ProgramBinary(GLuint program, GLenum binaryFormat, + const GLvoid *binary, GLsizei length) +{ + struct gl_shader_program *shProg; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + shProg = _mesa_lookup_shader_program_err(ctx, program, "glProgramBinary"); + if (!shProg) + return; + + (void) binaryFormat; + (void) binary; + (void) length; + _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__); +} + + +void GLAPIENTRY +_mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value) { struct gl_shader_program *shProg; GET_CURRENT_CONTEXT(ctx); @@ -1516,6 +1586,9 @@ _mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value) switch (pname) { case GL_GEOMETRY_VERTICES_OUT_ARB: + if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_geometry_shader4) + break; + if (value < 1 || (unsigned) value > ctx->Const.MaxGeometryOutputVertices) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -1524,8 +1597,11 @@ _mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value) return; } shProg->Geom.VerticesOut = value; - break; + return; case GL_GEOMETRY_INPUT_TYPE_ARB: + if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_geometry_shader4) + break; + switch (value) { case GL_POINTS: case GL_LINES: @@ -1540,8 +1616,11 @@ _mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value) _mesa_lookup_enum_by_nr(value)); return; } - break; + return; case GL_GEOMETRY_OUTPUT_TYPE_ARB: + if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_geometry_shader4) + break; + switch (value) { case GL_POINTS: case GL_LINE_STRIP: @@ -1554,12 +1633,58 @@ _mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value) _mesa_lookup_enum_by_nr(value)); return; } - break; + return; + case GL_PROGRAM_BINARY_RETRIEVABLE_HINT: + /* This enum isn't part of the OES extension for OpenGL ES 2.0, but it + * is part of OpenGL ES 3.0. For the ES2 case, this function shouldn't + * even be in the dispatch table, so we shouldn't need to expclicitly + * check here. + * + * On desktop, we ignore the 3.0+ requirement because it is silly. + */ + + /* The ARB_get_program_binary extension spec says: + * + * "An INVALID_VALUE error is generated if the <value> argument to + * ProgramParameteri is not TRUE or FALSE." + */ + if (value != GL_TRUE && value != GL_FALSE) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glProgramParameteri(pname=%s, value=%d): " + "value must be 0 or 1.", + _mesa_lookup_enum_by_nr(pname), + value); + return; + } + + /* No need to notify the driver. Any changes will actually take effect + * the next time the shader is linked. + * + * The ARB_get_program_binary extension spec says: + * + * "To indicate that a program binary is likely to be retrieved, + * ProgramParameteri should be called with <pname> + * PROGRAM_BINARY_RETRIEVABLE_HINT and <value> TRUE. This setting + * will not be in effect until the next time LinkProgram or + * ProgramBinary has been called successfully." + * + * The resloution of issue 9 in the extension spec also says: + * + * "The application may use the PROGRAM_BINARY_RETRIEVABLE_HINT hint + * to indicate to the GL implementation that this program will + * likely be saved with GetProgramBinary at some point. This will + * give the GL implementation the opportunity to track any state + * changes made to the program before being saved such that when it + * is loaded again a recompile can be avoided." + */ + shProg->BinaryRetreivableHint = value; + return; default: - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteriARB(pname=%s)", - _mesa_lookup_enum_by_nr(pname)); break; } + + _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameteri(pname=%s)", + _mesa_lookup_enum_by_nr(pname)); } void diff --git a/mesalib/src/mesa/main/shaderapi.h b/mesalib/src/mesa/main/shaderapi.h index 8ee68d82d..d3199db96 100644 --- a/mesalib/src/mesa/main/shaderapi.h +++ b/mesalib/src/mesa/main/shaderapi.h @@ -190,8 +190,16 @@ _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); +_mesa_GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length, + GLenum *binaryFormat, GLvoid *binary); + +extern void GLAPIENTRY +_mesa_ProgramBinary(GLuint program, GLenum binaryFormat, + const GLvoid *binary, GLsizei length); + +extern void GLAPIENTRY +_mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value); + void _mesa_use_shader_program(struct gl_context *ctx, GLenum type, struct gl_shader_program *shProg); diff --git a/mesalib/src/mesa/main/texformat.c b/mesalib/src/mesa/main/texformat.c index b3ffc6c51..4fb4b70f9 100644 --- a/mesalib/src/mesa/main/texformat.c +++ b/mesalib/src/mesa/main/texformat.c @@ -75,7 +75,9 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); } else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) { RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); - } + } else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) { + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); + } RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888); RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888); break; @@ -111,6 +113,10 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, /* shallow RGB formats */ case 3: case GL_RGB: + if (type == GL_UNSIGNED_INT_2_10_10_10_REV) { + RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); + } + /* fallthrough */ case GL_RGB8: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888); diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 33f81a25c..7d3abb7e0 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -1947,8 +1947,9 @@ texture_error_check( struct gl_context *ctx, err = _mesa_error_check_format_and_type(ctx, format, type); if (err != GL_NO_ERROR) { _mesa_error(ctx, err, - "glTexImage%dD(incompatible format 0x%x, type 0x%x)", - dimensions, format, type); + "glTexImage%dD(incompatible format = %s, type = %s)", + dimensions, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type)); return GL_TRUE; } @@ -1960,8 +1961,9 @@ texture_error_check( struct gl_context *ctx, (_mesa_is_depthstencil_format(internalFormat) != _mesa_is_depthstencil_format(format)) || (_mesa_is_dudv_format(internalFormat) != _mesa_is_dudv_format(format))) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexImage%dD(incompatible internalFormat 0x%x, format 0x%x)", - dimensions, internalFormat, format); + "glTexImage%dD(incompatible internalFormat = %s, format = %s)", + dimensions, _mesa_lookup_enum_by_nr(internalFormat), + _mesa_lookup_enum_by_nr(format)); return GL_TRUE; } @@ -2263,8 +2265,9 @@ texsubimage_error_check(struct gl_context *ctx, GLuint dimensions, err = _mesa_error_check_format_and_type(ctx, format, type); if (err != GL_NO_ERROR) { _mesa_error(ctx, err, - "glTexSubImage%dD(incompatible format 0x%x, type 0x%x)", - dimensions, format, type); + "glTexSubImage%dD(incompatible format = %s, type = %s)", + dimensions, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type)); return GL_TRUE; } diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index 751150937..a5c7712e0 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -1714,18 +1714,20 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS) srcPacking, ctx->_ImageTransferState); const GLfloat *src = tempImage; + const GLushort aMask = (srcFormat == GL_RGB) ? 0xffff : 0; GLint img, row, col; if (!tempImage) return GL_FALSE; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = dstSlices[img]; - if (baseInternalFormat == GL_RGBA) { + if (baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB) { for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { GLushort a,r,g,b; UNCLAMPED_FLOAT_TO_USHORT(a, src[ACOMP]); + a = a | aMask; UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]); UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]); UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]); @@ -1734,20 +1736,6 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS) } dstRow += dstRowStride; } - } else if (baseInternalFormat == GL_RGB) { - for (row = 0; row < srcHeight; row++) { - GLuint *dstUI = (GLuint *) dstRow; - for (col = 0; col < srcWidth; col++) { - GLushort r,g,b; - - UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]); - UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]); - UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]); - dstUI[col] = PACK_COLOR_2101010_US(0xffff, r, g, b); - src += 4; - } - dstRow += dstRowStride; - } } else { ASSERT(0); } diff --git a/mesalib/src/mesa/main/uniform_query.cpp b/mesalib/src/mesa/main/uniform_query.cpp index afe9a08c1..efff8f381 100644 --- a/mesalib/src/mesa/main/uniform_query.cpp +++ b/mesalib/src/mesa/main/uniform_query.cpp @@ -864,7 +864,8 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg, /* GL_INVALID_VALUE is generated if `transpose' is not GL_FALSE. * http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml */ - if (ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) { + if (ctx->API == API_OPENGLES + || (ctx->API == API_OPENGLES2 && ctx->Version < 30)) { if (transpose) { _mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix(matrix transpose is not GL_FALSE)"); diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c index 5e4d6c3e6..e453b3b0e 100644 --- a/mesalib/src/mesa/main/varray.c +++ b/mesalib/src/mesa/main/varray.c @@ -1113,9 +1113,10 @@ _mesa_PrimitiveRestartIndex(GLuint index) ASSERT_OUTSIDE_BEGIN_END(ctx); - if (ctx->Array.RestartIndex != index) { + ctx->Array.RestartIndex = index; + if (ctx->Array.PrimitiveRestart && ctx->Array._RestartIndex != index) { FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Array.RestartIndex = index; + ctx->Array._RestartIndex = index; } } diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp index d5b9683db..0f7439b3b 100644 --- a/mesalib/src/mesa/program/ir_to_mesa.cpp +++ b/mesalib/src/mesa/program/ir_to_mesa.cpp @@ -3061,7 +3061,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader) } state->error = glcpp_preprocess(state, &source, &state->info_log, - &ctx->Extensions, ctx->API); + &ctx->Extensions, ctx); if (ctx->Shader.Flags & GLSL_DUMP) { printf("GLSL source for %s shader %d:\n", diff --git a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c index 98b61f576..6a35c1b69 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c +++ b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c @@ -94,6 +94,7 @@ st_BeginQuery(struct gl_context *ctx, struct gl_query_object *q) /* convert GL query type to Gallium query type */ switch (q->Target) { case GL_ANY_SAMPLES_PASSED: + case GL_ANY_SAMPLES_PASSED_CONSERVATIVE: /* fall-through */ case GL_SAMPLES_PASSED_ARB: type = PIPE_QUERY_OCCLUSION_COUNTER; diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c index 4800e1c87..7de2bb9b8 100644 --- a/mesalib/src/mesa/state_tracker/st_draw.c +++ b/mesalib/src/mesa/state_tracker/st_draw.c @@ -230,8 +230,8 @@ st_draw_vbo(struct gl_context *ctx, /* The VBO module handles restart for the non-indexed GLDrawArrays * so we only set these fields for indexed drawing: */ - info.primitive_restart = ctx->Array.PrimitiveRestart; - info.restart_index = ctx->Array.RestartIndex; + info.primitive_restart = ctx->Array._PrimitiveRestart; + info.restart_index = ctx->Array._RestartIndex; } else { /* Transform feedback drawing is always non-indexed. */ diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index e7cf4f3bb..17fe16ee3 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -265,8 +265,11 @@ void st_init_limits(struct st_context *st) c->GLSLSkipStrictMaxVaryingLimitCheck = screen->get_param(screen, PIPE_CAP_TGSI_CAN_COMPACT_VARYINGS); - if (can_ubo) + if (can_ubo) { st->ctx->Extensions.ARB_uniform_buffer_object = GL_TRUE; + st->ctx->Const.UniformBufferOffsetAlignment = + screen->get_param(screen, PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT); + } } diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c index 4b2c5298d..7e61f7b31 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_array.c +++ b/mesalib/src/mesa/vbo/vbo_exec_array.c @@ -90,8 +90,8 @@ vbo_get_minmax_index(struct gl_context *ctx, GLuint *min_index, GLuint *max_index, const GLuint count) { - const GLboolean restart = ctx->Array.PrimitiveRestart; - const GLuint restartIndex = ctx->Array.RestartIndex; + const GLboolean restart = ctx->Array._PrimitiveRestart; + const GLuint restartIndex = ctx->Array._RestartIndex; const int index_size = vbo_sizeof_ib_type(ib->type); const char *indices; GLuint i; @@ -536,7 +536,7 @@ vbo_handle_primitive_restart(struct gl_context *ctx, if ((ib != NULL) && ctx->Const.PrimitiveRestartInSoftware && - ctx->Array.PrimitiveRestart) { + ctx->Array._PrimitiveRestart) { /* Handle primitive restart in software */ vbo_sw_primitive_restart(ctx, prim, nr_prims, ib); } else { @@ -572,10 +572,10 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, prim[0].base_instance = baseInstance; /* Implement the primitive restart index */ - if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex < count) { + if (ctx->Array._PrimitiveRestart && ctx->Array._RestartIndex < count) { GLuint primCount = 0; - if (ctx->Array.RestartIndex == start) { + if (ctx->Array._RestartIndex == start) { /* special case: RestartIndex at beginning */ if (count > 1) { prim[0].start = start + 1; @@ -583,7 +583,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, primCount = 1; } } - else if (ctx->Array.RestartIndex == start + count - 1) { + else if (ctx->Array._RestartIndex == start + count - 1) { /* special case: RestartIndex at end */ if (count > 1) { prim[0].start = start; @@ -594,10 +594,10 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, else { /* general case: RestartIndex in middle, split into two prims */ prim[0].start = start; - prim[0].count = ctx->Array.RestartIndex - start; + prim[0].count = ctx->Array._RestartIndex - start; prim[1] = prim[0]; - prim[1].start = ctx->Array.RestartIndex + 1; + prim[1].start = ctx->Array._RestartIndex + 1; prim[1].count = count - prim[1].start; primCount = 2; diff --git a/mesalib/src/mesa/vbo/vbo_primitive_restart.c b/mesalib/src/mesa/vbo/vbo_primitive_restart.c index 6f9d61c9b..a6a0149ca 100644 --- a/mesalib/src/mesa/vbo/vbo_primitive_restart.c +++ b/mesalib/src/mesa/vbo/vbo_primitive_restart.c @@ -171,7 +171,7 @@ vbo_sw_primitive_restart(struct gl_context *ctx, GLuint sub_prim_num; GLuint end_index; GLuint sub_end_index; - GLuint restart_index = ctx->Array.RestartIndex; + GLuint restart_index = ctx->Array._RestartIndex; struct _mesa_prim temp_prim; struct vbo_context *vbo = vbo_context(ctx); vbo_draw_func draw_prims_func = vbo->draw_prims; diff --git a/mkfontscale/mkfontscale.c b/mkfontscale/mkfontscale.c index f7aa709e1..01e982bf0 100644 --- a/mkfontscale/mkfontscale.c +++ b/mkfontscale/mkfontscale.c @@ -847,6 +847,7 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo) tprio = 0; } else #endif +#ifdef S_ISLNK { #ifndef WIN32 if (lstat(filename, &f_stat)) @@ -855,6 +856,9 @@ doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo) tprio = 0; #endif } +#else + ; +#endif if(doBitmaps) rc = bitmapIdentify(filename, &xlfd_name); else diff --git a/xorg-server/xkeyboard-config/rules/base.xml.in b/xorg-server/xkeyboard-config/rules/base.xml.in index 4b18513e9..d21891db2 100644 --- a/xorg-server/xkeyboard-config/rules/base.xml.in +++ b/xorg-server/xkeyboard-config/rules/base.xml.in @@ -1388,18 +1388,6 @@ </layout> <layout> <configItem> - <name>ad</name> - <!-- Keyboard indicator for Catalan layouts --> - <_shortDescription>ca</_shortDescription> - <_description>Catalan</_description> - <languageList> - <iso639Id>cat</iso639Id> - </languageList> - </configItem> - <variantList/> - </layout> - <layout> - <configItem> <name>af</name> <!-- Keyboard indicator for Afghani layouts --> <_shortDescription>fa</_shortDescription> @@ -6361,7 +6349,7 @@ <group allowMultipleSelection="true"> <!-- Special shortcuts for the Euro character --> <configItem> - <name>eurosign</name> + <name>currencysign</name> <_description>Adding currency signs to certain keys</_description> </configItem> <option> diff --git a/xorg-server/xkeyboard-config/symbols/Makefile.am b/xorg-server/xkeyboard-config/symbols/Makefile.am index af0322f0c..509a549cd 100644 --- a/xorg-server/xkeyboard-config/symbols/Makefile.am +++ b/xorg-server/xkeyboard-config/symbols/Makefile.am @@ -2,7 +2,7 @@ SUBDIRS = digital_vndr fujitsu_vndr hp_vndr macintosh_vndr nec_vndr nokia_vndr s symbolsdir = $(xkb_base)/symbols symbols_DATA = \ -ad af al \ +af al \ am apl ara \ at az \ ba bd be \ diff --git a/xorg-server/xkeyboard-config/symbols/typo b/xorg-server/xkeyboard-config/symbols/typo index ed4a2774b..02de5f7aa 100644 --- a/xorg-server/xkeyboard-config/symbols/typo +++ b/xorg-server/xkeyboard-config/symbols/typo @@ -2,25 +2,28 @@ // Sergei Stolyarov <sergei@regolit.com> // // Initial contribution by Alexey Ten <alexeyten+deb@gmail.com> +// Additional contribution and code cleanup by Artur Dryomov <artur.dryomov@gmail.com> // -// Based on the layout proposed by Ilya Birman, -// http://ilyabirman.ru/typography-layout/ -// +// Mainly based on the layout proposed by Ilya Birman, +// http://ilyabirman.ru/projects/typography-layout/ // default layout default partial xkb_symbols "base" { // 1st keyboard row key <TLDE> { [NoSymbol, NoSymbol, NoSymbol, approxeq] }; - key <AE01> { [NoSymbol, NoSymbol, onesuperior] }; - key <AE02> { [NoSymbol, NoSymbol, twosuperior, onehalf] }; - key <AE03> { [NoSymbol, NoSymbol, threesuperior, onethird] }; - key <AE04> { [NoSymbol, NoSymbol, dollar, onequarter] }; - key <AE05> { [NoSymbol, NoSymbol, U2030] }; - key <AE07> { [NoSymbol, NoSymbol, ampersand] }; - key <AE08> { [NoSymbol, NoSymbol, enfilledcircbullet, oneeighth] }; - key <AE11> { [NoSymbol, NoSymbol, emdash, hyphen] }; - key <AE12> { [NoSymbol, NoSymbol, notequal, plusminus] }; + key <AE01> { [NoSymbol, NoSymbol, onesuperior, exclamdown] }; // "1" + key <AE02> { [NoSymbol, NoSymbol, twosuperior, onehalf] }; // "2" + key <AE03> { [NoSymbol, NoSymbol, threesuperior, onethird] }; // "3" + key <AE04> { [NoSymbol, NoSymbol, dollar, onequarter] }; // "4" + key <AE05> { [NoSymbol, NoSymbol, permille] }; // "5" + key <AE06> { [NoSymbol, NoSymbol, uparrow] }; // "6" + key <AE07> { [NoSymbol, NoSymbol, ampersand, questiondown] }; // "7" + key <AE08> { [NoSymbol, NoSymbol, infinity, oneeighth] }; // "8" + key <AE09> { [NoSymbol, NoSymbol, leftarrow] }; // "9" + key <AE10> { [NoSymbol, NoSymbol, rightarrow] }; // "0" + key <AE11> { [NoSymbol, NoSymbol, emdash, endash] }; // "-" + key <AE12> { [NoSymbol, NoSymbol, notequal, plusminus] }; // "=" // 2nd keyboard row key <AD03> { [NoSymbol, NoSymbol, EuroSign] }; // "e" @@ -28,14 +31,14 @@ xkb_symbols "base" { key <AD05> { [NoSymbol, NoSymbol, trademark] }; // "t" key <AD06> { [NoSymbol, NoSymbol, yen] }; // "y" key <AD10> { [NoSymbol, NoSymbol, acute, doubleacute] }; // "p" - key <AD11> { [NoSymbol, NoSymbol, bracketleft, braceleft ] }; // [ - key <AD12> { [NoSymbol, NoSymbol, bracketright, braceright ] }; // ] + key <AD11> { [NoSymbol, NoSymbol, bracketleft, braceleft] }; // [ + key <AD12> { [NoSymbol, NoSymbol, bracketright, braceright] }; // ] // 3rd keyboard row - key <AC01> { [NoSymbol, NoSymbol, U0301, NoSymbol] }; // "a" - key <AC02> { [NoSymbol, NoSymbol, section]}; // "s" + key <AC01> { [NoSymbol, NoSymbol, U0301] }; // "a" + key <AC02> { [NoSymbol, NoSymbol, section] }; // "s" key <AC03> { [NoSymbol, NoSymbol, degree, division] }; // "d" - key <AC04> { [NoSymbol, NoSymbol, sterling, NoSymbol] }; // "f" + key <AC04> { [NoSymbol, NoSymbol, sterling] }; // "f" key <AC07> { [NoSymbol, NoSymbol, doublelowquotemark, singlelowquotemark] }; // "j" key <AC08> { [NoSymbol, NoSymbol, leftdoublequotemark, leftsinglequotemark] }; // "k" key <AC09> { [NoSymbol, NoSymbol, rightdoublequotemark, rightsinglequotemark] }; // "l" @@ -45,6 +48,8 @@ xkb_symbols "base" { // 4th keyboard row key <AB02> { [NoSymbol, NoSymbol, multiply, U22C5] }; // "x" key <AB03> { [NoSymbol, NoSymbol, copyright, cent] }; // "c" + key <AB04> { [NoSymbol, NoSymbol, downarrow] }; // "v" + key <AB07> { [NoSymbol, NoSymbol, U2212, enfilledcircbullet] }; // "m" key <AB08> { [NoSymbol, NoSymbol, guillemotleft, less] }; // "," key <AB09> { [NoSymbol, NoSymbol, guillemotright, greater] }; // "." key <AB10> { [NoSymbol, NoSymbol, ellipsis] }; // "/" |