From roland.mainz at nrubsig.org Sun Apr 3 07:01:05 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Sat Apr 2 23:07:48 2005 Subject: [Xprint] Re: Newer version of the combined video+print serverfrom? References: <42255FC3.A71AC9F4@nrubsig.org> <422A1660.99C8B595@nrubsig.org> <422CE6A1.B2FDAC80@nrubsig.org> <4231C381.B5316AB6@nrubsig.org> Message-ID: <424F6A81.BD353BB7@nrubsig.org> Roland Mainz wrote: > > > > > > Roland - had you time to continue your work on the combined > > > > > > ('unified') video+print server patch yet? > > > > > > > > > > Unfortunately no (except the integration of the fixes you send me) ... > > > > > almost every minute of my spare free time was consumed by my duties as > > > > > release manager of the X11R6.8.2 release (and then I was at the > > > > > XDevconf+LinuxWorld in Boston) ... > > > > > > > > Attached is a new version of the patch for testing. It deals with most > > > > of the problems of the previous version except that there is no switch > > > > to define a server mode yet (e.g. "video", "print", "unified"). > > > =================================================================== > > > > RCS file: /cvs/xorg/xc/config/cf/Imake.rules,v > > > > retrieving revision 1.8 > > > > diff -u -2 -0 -r1.8 Imake.rules > > > > --- xc/config/cf/Imake.rules 1 Feb 2005 22:27:00 -0000 1.8 > > > > +++ xc/config/cf/Imake.rules 5 Mar 2005 20:12:50 -0000 > > > > @@ -3529,40 +3529,66 @@ > > > The patch does not apply to XOrg head. Am I doing something wrong here? > > > > Uhm... uhm... that's likely my fault as I have dismanteled the patch and > > already commited smaller chunks of it to Xorg trunk (like > > https://bugs.freedesktop.org/show_bug.cgi?id=2653) ... either wait until > > I have a new patch or pull-by date (e.g. % cvs -z9 checkout -D "Fri Mar > > 4 23:38:24 MET 2005" xc # should pull a version of the tree where the > > patch applies correctly...) ... > > Attached is the next cycle of the patch. As usual you have to compile it > with > - #define PrintOnlyServer NO > to enable the "unified" (video+print) display > and > - #define DoLoadableServer NO > as the Xprint DDXs are no loadable modules yet and have some dependicies > (mainly the Postscript DDX which hooks deeply into the Freetype2 font > module) For the log: I've commited an updated version of the patch to Xorg trunk (see attached commit log). However there is a dispute about the dependicies the patch has introduced which require some adjustments or even a backout... ;-( ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) -------------- next part -------------- An embedded message was scrubbed... From: Roland Mainz Subject: CVS Update: xc (branch: trunk) Date: Wed, 23 Mar 2005 11:58:45 -0800 (PST) Size: 3823 Url: http://mozdev.org/pipermail/xprint/attachments/20050403/fe088595/attachment.eml From julien.lafon at gmail.com Sun Apr 3 10:15:48 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Sun Apr 3 03:22:21 2005 Subject: [Xprint] Re: Newer version of the combined video+print serverfrom? In-Reply-To: <424F6A81.BD353BB7@nrubsig.org> References: <42255FC3.A71AC9F4@nrubsig.org> <422A1660.99C8B595@nrubsig.org> <422CE6A1.B2FDAC80@nrubsig.org> <4231C381.B5316AB6@nrubsig.org> <424F6A81.BD353BB7@nrubsig.org> Message-ID: On Apr 3, 2005 6:01 AM, Roland Mainz wrote: > Roland Mainz wrote: > > > > > > > Roland - had you time to continue your work on the combined > > > > > > > ('unified') video+print server patch yet? > > > > > > > > > > > > Unfortunately no (except the integration of the fixes you send me) ... > > > > > > almost every minute of my spare free time was consumed by my duties as > > > > > > release manager of the X11R6.8.2 release (and then I was at the > > > > > > XDevconf+LinuxWorld in Boston) ... > > > > > > > > > > Attached is a new version of the patch for testing. It deals with most > > > > > of the problems of the previous version except that there is no switch > > > > > to define a server mode yet (e.g. "video", "print", "unified"). > > > > =================================================================== > > > > > RCS file: /cvs/xorg/xc/config/cf/Imake.rules,v > > > > > retrieving revision 1.8 > > > > > diff -u -2 -0 -r1.8 Imake.rules > > > > > --- xc/config/cf/Imake.rules 1 Feb 2005 22:27:00 -0000 1.8 > > > > > +++ xc/config/cf/Imake.rules 5 Mar 2005 20:12:50 -0000 > > > > > @@ -3529,40 +3529,66 @@ > > > > The patch does not apply to XOrg head. Am I doing something wrong here? > > > > > > Uhm... uhm... that's likely my fault as I have dismanteled the patch and > > > already commited smaller chunks of it to Xorg trunk (like > > > https://bugs.freedesktop.org/show_bug.cgi?id=2653) ... either wait until > > > I have a new patch or pull-by date (e.g. % cvs -z9 checkout -D "Fri Mar > > > 4 23:38:24 MET 2005" xc # should pull a version of the tree where the > > > patch applies correctly...) ... > > > > Attached is the next cycle of the patch. As usual you have to compile it > > with > > - #define PrintOnlyServer NO > > to enable the "unified" (video+print) display > > and > > - #define DoLoadableServer NO > > as the Xprint DDXs are no loadable modules yet and have some dependicies > > (mainly the Postscript DDX which hooks deeply into the Freetype2 font > > module) > > For the log: > I've commited an updated version of the patch to Xorg trunk (see > attached commit log). However there is a dispute about the dependicies > the patch has introduced which require some adjustments or even a > backout... ;-( Roland: What is the exact matter of the dispute? Julien -- Julien Lafon Senior Staff Engineer, Hitachi From eich at freedesktop.org Sun Apr 3 11:18:43 2005 From: eich at freedesktop.org (Egbert Eich) Date: Sun Apr 3 10:41:07 2005 Subject: [Xprint] Re: Unified video+print Xserver / was: Re:Modularization mailing list and initial strawman proposal In-Reply-To: roland.mainz@nrubsig.org wrote on Thursday, 31 March 2005 at 03:04:37 +0200 References: <20050311212008.GD14002@kem.org> <200503291349.46095.ajax@nwnk.net> <200503301057.02651.ajax@nwnk.net> <424B4CA5.90F5C700@nrubsig.org> Message-ID: <16975.42723.462919.33907@xf14.local> Roland Mainz writes: > > See my other reply to this thread - it's doing rasterizing in the > Xserver (as the decision whether vector data or bitmap data are > generated is up to the print DDX). However it doesn't really harm > anything since the RASTER driver operates at low resolution monocrome > (1bit StaticGray) visuals (originally it was written as test > implementation and can still be used for old matrix printers, but beyond > that point I don't see much use for it). > There exists an unfortunate misconception of Xprint that stems from the pure existence of the raster driver. Therefore it cannot be stressed enough that the raster driver was written for a proof of concept implementation and (unfortunately) survived in the code. The raster driver argument always gets in the way if the real arguments pro/con Xprint. Egbert. From eich at freedesktop.org Sun Apr 3 10:51:42 2005 From: eich at freedesktop.org (Egbert Eich) Date: Sun Apr 3 10:41:20 2005 Subject: [Xprint] Re: Unified video+print Xserver / was: Re: Modularization mailing list and initial strawman proposal In-Reply-To: julien.lafon@gmail.com wrote on Tuesday, 29 March 2005 at 14:58:11 +0200 References: <20050311212008.GD14002@kem.org> <423B3C84.29FCFCCF@nrubsig.org> <20050318234007.GA13433@kem.org> <4243490B.48C7684@nrubsig.org> <16966.30282.655109.388903@xf14.local> Message-ID: <16975.41102.822855.411561@xf14.local> Julien Lafon writes: > Xprint applications are scheduled by the X server as normal X clients > and do not behave differently. I do not see a different of having two > video cards or one video card and a print screen in one Xserver. Multiple heads on a display share some common infrastructure. The entire input semantics is (currently) coupled to a single focus. I may be wrong but there is much less common infrastructure between display and print screens. Scheduling print clients along side with display clients in the same Xserver instead only exhibits the disadvantages of a single threaded Xserver. Egbert. From roland.mainz at nrubsig.org Mon Apr 4 07:20:24 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Mon Apr 4 00:27:16 2005 Subject: [Xprint] Re: Newer version of the combined video+print serverfrom? References: <42255FC3.A71AC9F4@nrubsig.org> <422A1660.99C8B595@nrubsig.org> <422CE6A1.B2FDAC80@nrubsig.org> <4231C381.B5316AB6@nrubsig.org> <424F6A81.BD353BB7@nrubsig.org> Message-ID: <4250C088.BE5A3085@nrubsig.org> Julien Lafon wrote: > > On Apr 3, 2005 6:01 AM, Roland Mainz wrote: > > Roland Mainz wrote: > > > > > > > > Roland - had you time to continue your work on the combined > > > > > > > > ('unified') video+print server patch yet? > > > > > > > > > > > > > > Unfortunately no (except the integration of the fixes you send me) ... > > > > > > > almost every minute of my spare free time was consumed by my duties as > > > > > > > release manager of the X11R6.8.2 release (and then I was at the > > > > > > > XDevconf+LinuxWorld in Boston) ... > > > > > > > > > > > > Attached is a new version of the patch for testing. It deals with most > > > > > > of the problems of the previous version except that there is no switch > > > > > > to define a server mode yet (e.g. "video", "print", "unified"). > > > > > =================================================================== > > > > > > RCS file: /cvs/xorg/xc/config/cf/Imake.rules,v > > > > > > retrieving revision 1.8 > > > > > > diff -u -2 -0 -r1.8 Imake.rules > > > > > > --- xc/config/cf/Imake.rules 1 Feb 2005 22:27:00 -0000 1.8 > > > > > > +++ xc/config/cf/Imake.rules 5 Mar 2005 20:12:50 -0000 > > > > > > @@ -3529,40 +3529,66 @@ > > > > > The patch does not apply to XOrg head. Am I doing something wrong here? > > > > > > > > Uhm... uhm... that's likely my fault as I have dismanteled the patch and > > > > already commited smaller chunks of it to Xorg trunk (like > > > > https://bugs.freedesktop.org/show_bug.cgi?id=2653) ... either wait until > > > > I have a new patch or pull-by date (e.g. % cvs -z9 checkout -D "Fri Mar > > > > 4 23:38:24 MET 2005" xc # should pull a version of the tree where the > > > > patch applies correctly...) ... > > > > > > Attached is the next cycle of the patch. As usual you have to compile it > > > with > > > - #define PrintOnlyServer NO > > > to enable the "unified" (video+print) display > > > and > > > - #define DoLoadableServer NO > > > as the Xprint DDXs are no loadable modules yet and have some dependicies > > > (mainly the Postscript DDX which hooks deeply into the Freetype2 font > > > module) > > > > For the log: > > I've commited an updated version of the patch to Xorg trunk (see > > attached commit log). However there is a dispute about the dependicies > > the patch has introduced which require some adjustments or even a > > backout... ;-( > Roland: What is the exact matter of the dispute? Check https://bugs.freedesktop.org/show_bug.cgi?id=2792 (or your BugZilla email), the primary complain seem to be that the DIX code (xc/progras/Xserver/dix/) now depends on DiPrint.h (which - theoretically - shouldn't be done that way since some people want to compile the tree with |BuildXprint| set to |NO|) and that I have added stub (the |Printer*()|) functions for all servers which do not have print functionality. I discussed the matter with Egbert Eich/SuSE and posted two versions of a fix, hopefully one of them will be accepted... ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) From ajax at nwnk.net Sun Apr 3 14:30:51 2005 From: ajax at nwnk.net (Adam Jackson) Date: Mon Apr 4 00:57:54 2005 Subject: [Xprint] Re: Unified video+print Xserver / was: Re: Modularization mailing list and initial strawman proposal In-Reply-To: <16975.41102.822855.411561@xf14.local> References: <20050311212008.GD14002@kem.org> <16975.41102.822855.411561@xf14.local> Message-ID: <200504031330.54065.ajax@nwnk.net> On Sunday 03 April 2005 03:51, Egbert Eich wrote: > Julien Lafon writes: > > Xprint applications are scheduled by the X server as normal X clients > > and do not behave differently. I do not see a different of having two > > video cards or one video card and a print screen in one Xserver. > > Multiple heads on a display share some common infrastructure. > The entire input semantics is (currently) coupled to a single > focus. That's an aspect I hadn't considered before. When running a unified server, can your mouse get lost on the print screen? - ajax -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mozdev.org/pipermail/xprint/attachments/20050403/8a41387d/attachment.bin From roland.mainz at nrubsig.org Mon Apr 4 07:57:00 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Mon Apr 4 01:03:58 2005 Subject: [Xprint] Re: Unified video+print Xserver / was: Re:Modularization mailing list and initial strawman proposal References: <20050311212008.GD14002@kem.org> <16975.41102.822855.411561@xf14.local> <200504031330.54065.ajax@nwnk.net> Message-ID: <4250C91C.BDD9F3BE@nrubsig.org> Adam Jackson wrote: > On Sunday 03 April 2005 03:51, Egbert Eich wrote: > > Julien Lafon writes: > > > Xprint applications are scheduled by the X server as normal X clients > > > and do not behave differently. I do not see a different of having two > > > video cards or one video card and a print screen in one Xserver. > > > > Multiple heads on a display share some common infrastructure. > > The entire input semantics is (currently) coupled to a single > > focus. > > That's an aspect I hadn't considered before. When running a unified server, > can your mouse get lost on the print screen? No, the server code has checks to ensure the mouse (and other input devices) won't leave the video screens. By design the video screen(s) are always coming first (and then the print screen(s) follow) so you will never have something like videoscreen0,videoscreen1,printscreen0,videoscreen2 (which would be hard to handle correctly for the mouse pointer stuff... =:-) ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) From aleksander.adamowski.xprint at altkom.pl Mon Apr 4 11:38:54 2005 From: aleksander.adamowski.xprint at altkom.pl (Aleksander Adamowski) Date: Mon Apr 4 04:46:05 2005 Subject: [Xprint] Possibilities on Unix environment In-Reply-To: <11B77492550CC745AAD28167178DBD1712DF36@server01.home.brainstars.sk> References: <11B77492550CC745AAD28167178DBD1712DF36@server01.home.brainstars.sk> Message-ID: <4250FD1E.3000000@altkom.pl> Jakke wrote: > Dearest, > > Can somebody inform me what the possibilities of XPrint are on a UNIX > environment? > > Since I know XPrint is using its own .dll file and my UNIX knowledge > is limited I am not sure what?s possible to do with it. Generating > XPrint file is off course no issue but how can I enable printing? > > Is there some documentation available about how to set things up on UNIX? > Installation procedure for Xprint is documented here: http://xprint.mozdev.org/installation.html Good luck. -- Best Regards, Aleksander Adamowski GG#: 274614 ICQ UIN: 19780575 http://olo.ab.altkom.pl From aleksander.adamowski.xprint at altkom.pl Mon Apr 4 11:56:38 2005 From: aleksander.adamowski.xprint at altkom.pl (Aleksander Adamowski) Date: Mon Apr 4 05:03:47 2005 Subject: [Xprint] LQ-300+ printer support In-Reply-To: <20050213130044.60952.qmail@web40528.mail.yahoo.com> References: <20050213130044.60952.qmail@web40528.mail.yahoo.com> Message-ID: <42510146.8020903@altkom.pl> ali bagheri wrote: >I used xprint for printing persian in Laser printers >and it works fine , but I need to print persian in >LQ-300+ printer, but it generates very larg fonts ( a >word fits the whole paper), so please guide me how to >print in LQ-300+ > Best Regards > > This is THE major barrier to Xprint adoption. Just another case that supports my earlier posts (see the "GISWxprint-sparc-2004-07-07-release_009_001 Prints too large" thread) and bug 5355 (http://mozdev.org/bugs/show_bug.cgi?id=5355) - Xprint needs to be able to extract printer model information from the spooler (like CUPS through PPDs) automatically, without having the user write his model configs. Roland, if you read this: please, tell us, is there a chance of Xprint discovering the model-config info automatically from the printing system? I don't ask for implementation, nor any roadmap, only for acknowledgement of the problem - since to date I were only getting answers suggesting that noone thinks this is needed. And in my opinion it is. Ali: by default Xprint uses model configs which print in 300 DPI, but some packaged installations (for Debian) default to 600 DPI or suggest this configuration to the user, since 300 DPI is a very low resolution with visible printout quality degradation. If this is the case for you, it causes the job to be generated in a resolution too high for your printer. You have to write a model config for your printer and configure Xprint to use it. Here's how to do it: http://xprint.mozdev.org/docs/Xprint_FAQ.html#printout_only_covers_1_4_of_the_paper -- Best Regards, Aleksander Adamowski GG#: 274614 ICQ UIN: 19780575 http://olo.ab.altkom.pl From dparsons at debian.org Mon Apr 4 21:18:03 2005 From: dparsons at debian.org (Drew Parsons) Date: Mon Apr 4 06:24:52 2005 Subject: [Xprint] LQ-300+ printer support In-Reply-To: <42510146.8020903@altkom.pl> References: <20050213130044.60952.qmail@web40528.mail.yahoo.com> <42510146.8020903@altkom.pl> Message-ID: <1112609883.7451.8.camel@pug.anu.edu.au> On Mon, 2005-04-04 at 10:56 +0200, Aleksander Adamowski wrote: > Roland, if you read this: please, tell us, is there a chance of Xprint > discovering the model-config info automatically from the printing > system? I don't ask for implementation, nor any roadmap, only for > acknowledgement of the problem - since to date I were only getting > answers suggesting that noone thinks this is needed. > For my part, I'm hoping to see the problem fixed via Xprint bug #411, by using the OpenPrinting PAPI. This will deal with several issues all at once: enumeration of printers (well, Xprint does do this already), identifying the default printer, accessing printer-specific properties. But PAPI is new and under development, Xprint will have to wait until it is finished before we can use it. > Ali: by default Xprint uses model configs which print in 300 DPI, but > some packaged installations (for Debian) default to 600 DPI or suggest > this configuration to the user, since 300 DPI is a very low resolution > with visible printout quality degradation. The default Xprint configuration has now been changed to 600dpi I think. This was mainly done because the majority of printers at the moment support 600dpi (there were a lot of complaints about the reverse problem to Ali's, where the image only took up 1/4 of the page). > If this is the case for you, it causes the job to be generated in a > resolution too high for your printer. You have to write a model config > for your printer and configure Xprint to use it. > > Here's how to do it: > http://xprint.mozdev.org/docs/Xprint_FAQ.html#printout_only_covers_1_4_of_the_paper > You don't necessarily need a separate model config. The simplest approach is to just change default-printer-resolution in /usr/share/Xprint/xserver/C/print/attributes/document. Drew From felix.schulte at gmail.com Fri Apr 8 22:29:26 2005 From: felix.schulte at gmail.com (Felix Schulte) Date: Fri Apr 8 15:41:20 2005 Subject: [Xprint] XCreateColormap() for Pseudocolor 15bit fails Message-ID: <74f15d5f050408122934ce5014@mail.gmail.com> Hello, does anyone know under which conditions XCreateColormap() can fail? I have selected a Pseudocolor 15bit visual but calling XCreateColormap() fails all the time: X Error of failed request: BadAlloc (insufficient resources for operation) Major opcode of failed request: 78 (X_CreateColormap) Serial number of failed request: 39 Current serial number in output stream: 40 Breakpoint 1, 0x40178ab6 in exit () from /lib/libc.so.6 (gdb) where #0 0x40178ab6 in exit () from /lib/libc.so.6 #1 0x40070d10 in _XDefaultError (dpy=0x8052838, event=0xbffff340) at XlibInt.c:2831 #2 0x40070e82 in _XError (dpy=0x8052838, rep=0xbffff430) at XlibInt.c:2883 #3 0x4006edde in _XReply (dpy=0x8052838, rep=0xbffff430, extra=0, discard=1) at XlibInt.c:1812 #4 0x40068762 in XSync (dpy=0x8052838, discard=0) at Sync.c:45 #5 0x40068825 in _XSyncFunction (dpy=0x1) at Synchro.c:34 #6 0x40047725 in XCreateColormap (dpy=0x8052838, w=61, visual=0x8057d38, alloc=0) at CrCmap.c:51 Any ideas, comments, opinions on what I am doing wrong? -- _ Felix Schulte _|_|_ mailto:felix.schulte@gmail.com (0 0) ooO--(_)--Ooo From roland.mainz at nrubsig.org Sat Apr 9 01:17:33 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Fri Apr 8 18:24:38 2005 Subject: [Xprint] Re: XCreateColormap() for Pseudocolor 15bit fails References: <74f15d5f050408122934ce5014@mail.gmail.com> Message-ID: <425702FD.CF23AC58@nrubsig.org> Felix Schulte wrote: > does anyone know under which conditions XCreateColormap() can fail? I > have selected a Pseudocolor 15bit visual but calling XCreateColormap() > fails all the time: > X Error of failed request: BadAlloc (insufficient resources for operation) > Major opcode of failed request: 78 (X_CreateColormap) > Serial number of failed request: 39 > Current serial number in output stream: 40 > > Breakpoint 1, 0x40178ab6 in exit () from /lib/libc.so.6 > (gdb) where > #0 0x40178ab6 in exit () from /lib/libc.so.6 > #1 0x40070d10 in _XDefaultError (dpy=0x8052838, event=0xbffff340) at > XlibInt.c:2831 > #2 0x40070e82 in _XError (dpy=0x8052838, rep=0xbffff430) at XlibInt.c:2883 > #3 0x4006edde in _XReply (dpy=0x8052838, rep=0xbffff430, extra=0, > discard=1) at XlibInt.c:1812 > #4 0x40068762 in XSync (dpy=0x8052838, discard=0) at Sync.c:45 > #5 0x40068825 in _XSyncFunction (dpy=0x1) at Synchro.c:34 > #6 0x40047725 in XCreateColormap (dpy=0x8052838, w=61, > visual=0x8057d38, alloc=0) at CrCmap.c:51 > > Any ideas, comments, opinions on what I am doing wrong? AFAIK you're doing nothing wrong. The problem is that the core X protocol defines |ColormapEntries| as |CARD16| (which is AFAIK a |signed short|). There are two solutions: 1. Create a extension (XC-BIGCOLORMAP) which hooks into libX11 and allows larger colormaps (e.g. make the field |CARD32| and adjust the matching function calls). 2. Limit the driver to 14bit (16384 colormap entries or keep the 15bit but set the available number of colors to 32768-2 to avoid the datatype overflow). Option [1] sounds better here as we will need larger colormaps for the COLORSPACE extension anyway. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) From roland.mainz at nrubsig.org Sat Apr 9 02:45:33 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Fri Apr 8 19:53:02 2005 Subject: [Xprint] Re: XCreateColormap() for Pseudocolor 15bit fails References: <74f15d5f050408122934ce5014@mail.gmail.com> <425702FD.CF23AC58@nrubsig.org> Message-ID: <4257179D.52EFC3CB@nrubsig.org> Roland Mainz wrote: > > does anyone know under which conditions XCreateColormap() can fail? I > > have selected a Pseudocolor 15bit visual but calling XCreateColormap() > > fails all the time: > > X Error of failed request: BadAlloc (insufficient resources for operation) > > Major opcode of failed request: 78 (X_CreateColormap) > > Serial number of failed request: 39 > > Current serial number in output stream: 40 > > > > Breakpoint 1, 0x40178ab6 in exit () from /lib/libc.so.6 > > (gdb) where > > #0 0x40178ab6 in exit () from /lib/libc.so.6 > > #1 0x40070d10 in _XDefaultError (dpy=0x8052838, event=0xbffff340) at > > XlibInt.c:2831 > > #2 0x40070e82 in _XError (dpy=0x8052838, rep=0xbffff430) at XlibInt.c:2883 > > #3 0x4006edde in _XReply (dpy=0x8052838, rep=0xbffff430, extra=0, > > discard=1) at XlibInt.c:1812 > > #4 0x40068762 in XSync (dpy=0x8052838, discard=0) at Sync.c:45 > > #5 0x40068825 in _XSyncFunction (dpy=0x1) at Synchro.c:34 > > #6 0x40047725 in XCreateColormap (dpy=0x8052838, w=61, > > visual=0x8057d38, alloc=0) at CrCmap.c:51 > > > > Any ideas, comments, opinions on what I am doing wrong? > > AFAIK you're doing nothing wrong. The problem is that the core X > protocol defines |ColormapEntries| as |CARD16| (which is AFAIK a |signed > short|). There are two solutions: > 1. Create a extension (XC-BIGCOLORMAP) which hooks into libX11 and > allows larger colormaps (e.g. make the field |CARD32| and adjust the > matching function calls). Attached patch solves the problem (for 15bit, anything deeper needs something like XC-BIGCOLORMAP), however it will likely break the Xfree86 Module ABI (which leads to the debate whether we should break the ABI for 7.0) ... ;-( ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) -------------- next part -------------- Index: xc/programs/Xserver/include/scrnintstr.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/include/scrnintstr.h,v retrieving revision 1.4 diff -u -2 -0 -r1.4 scrnintstr.h --- xc/programs/Xserver/include/scrnintstr.h 7 Aug 2004 00:58:21 -0000 1.4 +++ xc/programs/Xserver/include/scrnintstr.h 8 Apr 2005 23:22:06 -0000 @@ -52,41 +52,41 @@ #include "screenint.h" #include "regionstr.h" #include "bstore.h" #include "colormap.h" #include "cursor.h" #include "validate.h" #include "X11/Xproto.h" #include "dix.h" typedef struct _PixmapFormat { unsigned char depth; unsigned char bitsPerPixel; unsigned char scanlinePad; } PixmapFormatRec; typedef struct _Visual { VisualID vid; short class; short bitsPerRGBValue; - short ColormapEntries; + unsigned long ColormapEntries; short nplanes;/* = log2 (ColormapEntries). This does not * imply that the screen has this many planes. * it may have more or fewer */ unsigned long redMask, greenMask, blueMask; int offsetRed, offsetGreen, offsetBlue; } VisualRec; typedef struct _Depth { unsigned char depth; short numVids; VisualID *vids; /* block of visual ids for this depth */ } DepthRec; /* * There is a typedef for each screen function pointer so that code that * needs to declare a screen function pointer (e.g. in a screen private * or as a local variable) can easily do so and retain full type checking. */ From julien.lafon at gmail.com Sat Apr 9 04:09:09 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Fri Apr 8 21:16:01 2005 Subject: [Xprint] Re: XCreateColormap() for Pseudocolor 15bit fails In-Reply-To: <4257179D.52EFC3CB@nrubsig.org> References: <74f15d5f050408122934ce5014@mail.gmail.com> <425702FD.CF23AC58@nrubsig.org> <4257179D.52EFC3CB@nrubsig.org> Message-ID: On Apr 9, 2005 1:45 AM, Roland Mainz wrote: > Roland Mainz wrote: > > > does anyone know under which conditions XCreateColormap() can fail? I > > > have selected a Pseudocolor 15bit visual but calling XCreateColormap() > > > fails all the time: > > > X Error of failed request: BadAlloc (insufficient resources for operation) > > > Major opcode of failed request: 78 (X_CreateColormap) > > > Serial number of failed request: 39 > > > Current serial number in output stream: 40 > > > > > > Breakpoint 1, 0x40178ab6 in exit () from /lib/libc.so.6 > > > (gdb) where > > > #0 0x40178ab6 in exit () from /lib/libc.so.6 > > > #1 0x40070d10 in _XDefaultError (dpy=0x8052838, event=0xbffff340) at > > > XlibInt.c:2831 > > > #2 0x40070e82 in _XError (dpy=0x8052838, rep=0xbffff430) at XlibInt.c:2883 > > > #3 0x4006edde in _XReply (dpy=0x8052838, rep=0xbffff430, extra=0, > > > discard=1) at XlibInt.c:1812 > > > #4 0x40068762 in XSync (dpy=0x8052838, discard=0) at Sync.c:45 > > > #5 0x40068825 in _XSyncFunction (dpy=0x1) at Synchro.c:34 > > > #6 0x40047725 in XCreateColormap (dpy=0x8052838, w=61, > > > visual=0x8057d38, alloc=0) at CrCmap.c:51 > > > > > > Any ideas, comments, opinions on what I am doing wrong? > > > > AFAIK you're doing nothing wrong. The problem is that the core X > > protocol defines |ColormapEntries| as |CARD16| (which is AFAIK a |signed > > short|). There are two solutions: > > 1. Create a extension (XC-BIGCOLORMAP) which hooks into libX11 and > > allows larger colormaps (e.g. make the field |CARD32| and adjust the > > matching function calls). > > Attached patch solves the problem (for 15bit, anything deeper needs > something like XC-BIGCOLORMAP), however it will likely break the Xfree86 > Module ABI (which leads to the debate whether we should break the ABI > for 7.0) ... ;-( > > ---- > > Bye, > Roland > > -- > __ . . __ > (o.\ \/ /.o) roland.mainz@nrubsig.org > \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer > /O /==\ O\ TEL +49 641 7950090 > (;O/ \/ \O;) > > Index: xc/programs/Xserver/include/scrnintstr.h > =================================================================== > RCS file: /cvs/xorg/xc/programs/Xserver/include/scrnintstr.h,v > retrieving revision 1.4 > diff -u -2 -0 -r1.4 scrnintstr.h > --- xc/programs/Xserver/include/scrnintstr.h 7 Aug 2004 00:58:21 -0000 1.4 > +++ xc/programs/Xserver/include/scrnintstr.h 8 Apr 2005 23:22:06 -0000 > @@ -52,41 +52,41 @@ > > #include "screenint.h" > #include "regionstr.h" > #include "bstore.h" > #include "colormap.h" > #include "cursor.h" > #include "validate.h" > #include "X11/Xproto.h" > #include "dix.h" > > typedef struct _PixmapFormat { > unsigned char depth; > unsigned char bitsPerPixel; > unsigned char scanlinePad; > } PixmapFormatRec; > > typedef struct _Visual { > VisualID vid; > short class; > short bitsPerRGBValue; > - short ColormapEntries; > + unsigned long ColormapEntries; > short nplanes;/* = log2 (ColormapEntries). This does not "unsigned short" may help for Pseudocolor 15bit without breaking the XFree 86 ABI. The question is whether such an intermediate step is feasible or whether directly moving to "unsigned long" is the better way to go... Julien -- Julien Lafon Senior Staff Engineer, Hitachi From simon.toedt at gmail.com Mon Apr 11 08:10:55 2005 From: simon.toedt at gmail.com (Simon Toedt) Date: Mon Apr 11 01:18:11 2005 Subject: [Xprint] Improving glXSwapBuffers performace Message-ID: <9a9b8bd3050410221040e2030f@mail.gmail.com> Has anyone yet looked into ways to improve rendering performance? I have noticed that glXSwapBuffers() is slow (30secs +/-5secs on a P3/600Mhz) and mainly spends its time in PsOutImageBytes() which calls sprintf() in a tight loop: (gdb) where #0 PsOut_OutImageBytes (self=0x8c91ed0, nBytes=3, bytes=0xbfffec7d "") at psout.c:1488 #1 0x080d63af in PsPutScaledImage (pDrawable=0x8a69eb0, pGC=0x8c6f640, depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, format=2, imageRes=0, pImage=0x4066e008 "") at PsArea.c:157 #2 0x080d6a79 in PsPutImage (pDrawable=0x8a69eb0, pGC=0x8c6f640, depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, format=2, pImage=0x4066e008 "") at PsArea.c:332 #3 0x08291717 in XMesaSwapBuffers (b=0x4063d008) at xm_api.c:2391 #4 0x0828dca9 in __MESA_swapBuffers (glxPriv=0x8c6f178) at xf86glx.c:736 #5 0x0825a00f in __glXSwapBuffers (cl=0x8a69c60, pc=0x8c90a40 "\220\v\003") at glxcmds.c:1340 #6 0x082300ff in __glXDispatch (client=0x8a647b0) at glxext.c:435 #7 0x08083b69 in Dispatch () at dispatch.c:449 #8 0x0806a790 in main (argc=8, argv=0xbffff2a4, envp=0xbffff2c8) at main.c:439 #9 0x400e48ae in __libc_start_main () from /lib/libc.so.6 -- Simon From boyer2004 at sympatico.ca Mon Apr 11 04:14:24 2005 From: boyer2004 at sympatico.ca (rboyer) Date: Mon Apr 11 08:22:11 2005 Subject: [Xprint] Using kprinter as spooler command Message-ID: Hello! I started using Xprint with Firefox a few weeks ago. There is one page on the web that I could not print without using Xprint. I wonder now if it would be possible to use kprinter as the spooler command. I tried the following (as a user, not as root) but without success: *xp-spooler-command: /usr/local/kde/bin/kprinter --display=:0 Error messages were: Xlib: connection to ":0.0" refused by server Xlib: no protocol specified kprinter: cannot connect to X server Thanks in advance for any help or suggestions. From brian.paul at tungstengraphics.com Mon Apr 11 09:34:45 2005 From: brian.paul at tungstengraphics.com (Brian Paul) Date: Mon Apr 11 13:00:55 2005 Subject: [Xprint] Re: Improving glXSwapBuffers performace In-Reply-To: <9a9b8bd3050410221040e2030f@mail.gmail.com> References: <9a9b8bd3050410221040e2030f@mail.gmail.com> Message-ID: <425A8B05.6090008@tungstengraphics.com> Simon Toedt wrote: > Has anyone yet looked into ways to improve rendering performance? I > have noticed that glXSwapBuffers() is slow (30secs +/-5secs on a > P3/600Mhz) and mainly spends its time in PsOutImageBytes() which calls > sprintf() in a tight loop: > (gdb) where > #0 PsOut_OutImageBytes (self=0x8c91ed0, nBytes=3, bytes=0xbfffec7d > "") at psout.c:1488 > #1 0x080d63af in PsPutScaledImage (pDrawable=0x8a69eb0, > pGC=0x8c6f640, depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, > format=2, imageRes=0, > pImage=0x4066e008 "") at PsArea.c:157 > #2 0x080d6a79 in PsPutImage (pDrawable=0x8a69eb0, pGC=0x8c6f640, > depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, format=2, > pImage=0x4066e008 "") at PsArea.c:332 > #3 0x08291717 in XMesaSwapBuffers (b=0x4063d008) at xm_api.c:2391 > #4 0x0828dca9 in __MESA_swapBuffers (glxPriv=0x8c6f178) at xf86glx.c:736 > #5 0x0825a00f in __glXSwapBuffers (cl=0x8a69c60, pc=0x8c90a40 > "\220\v\003") at glxcmds.c:1340 > #6 0x082300ff in __glXDispatch (client=0x8a647b0) at glxext.c:435 > #7 0x08083b69 in Dispatch () at dispatch.c:449 > #8 0x0806a790 in main (argc=8, argv=0xbffff2a4, envp=0xbffff2c8) at main.c:439 > #9 0x400e48ae in __libc_start_main () from /lib/libc.so.6 Well, at line 2391 of xm_api.c, XMesaXPutImage() is being called. That's a macro: #define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ do { \ /* Assumes: Images are always in ZPixmap format */ \ (void) __d; \ if (__sx || __sy) /* The non-trivial case */ \ XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \ ValidateGC(__b, __gc); \ (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ __x, __y, __w, __h, 0, ZPixmap, \ ((XMesaImage *)(__i))->data); \ } while (0) The PsPutImage() function is an internal server function in the Xprint module. I have no idea why that would be getting called. -Brian From roland.mainz at nrubsig.org Tue Apr 12 00:41:40 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Mon Apr 11 17:49:19 2005 Subject: [Xprint] Re: Modularization proposal updated References: <20050331033441.GA23330@kem.org> <425AEA05.3E8D64F5@nrubsig.org> <200504111729.24899.ajax@nwnk.net> Message-ID: <425AEF14.B69D8C89@nrubsig.org> Adam Jackson wrote: > > > I have updated the modularization proposal as discussed. The changes > > > were to generalize the driver module (as suggested by Keith and myself) > > > and explain that the configure options will be both standardized and > > > documented (as suggested by Egbert et al.). The updated proposal can be > > > found here: > > > > > > http://wiki.x.org/wiki/ModularizationProposal > > > > Two things: > > 1. XRX is still no DDX (it mainly belongs into the app/ module AFAIK) > > It's a wiki, you know. ;) Yes, but I am not sure whether anyone else except the author is allowed to edit it (technicially I can edit it but I would prefer if Kevin would do that (since there is no editoral review process for changes in this version of Wiki and I don't like to put random nonsense into other people's work... :)) > > 2. Where should server-specific config files stored (I am mainly > > thinking about the whole XpConfig/ hieracy which the print server needs > > to start (e.g. it will refuse to start without having those files so > > they should be placed close to the server sources IMO)) ? > > Config files belong with the app that needs them. OK... that would be the xserver module then... > Does this mean a combined print+display server will fail to start display > graphics if the XpConfig hierarchy is missing? If you force to run it in "print" mode then the answer is definately "yes" (since you will only have print screens in the "print"-only mode and all print drivers will refuse to initalise if the core config data are missing). The same applies to the "video+print" mode but that could be adjusted to a plain warning and then the Xserver only comes up with "video" screens. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) From roland.mainz at nrubsig.org Tue Apr 12 01:09:54 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Mon Apr 11 18:17:08 2005 Subject: [Xprint] Re: Modularization proposal updated References: <20050331033441.GA23330@kem.org> <425AEA05.3E8D64F5@nrubsig.org> <200504111729.24899.ajax@nwnk.net> <425AEF14.B69D8C89@nrubsig.org> <20050411214831.GC1609@kem.org> Message-ID: <425AF5B2.2BE50821@nrubsig.org> Kevin E Martin wrote: > > > > > I have updated the modularization proposal as discussed. The changes > > > > > were to generalize the driver module (as suggested by Keith and myself) > > > > > and explain that the configure options will be both standardized and > > > > > documented (as suggested by Egbert et al.). The updated proposal can be > > > > > found here: > > > > > > > > > > http://wiki.x.org/wiki/ModularizationProposal > > > > > > > > Two things: > > > > 1. XRX is still no DDX (it mainly belongs into the app/ module AFAIK) > > > > > > It's a wiki, you know. ;) > > > > Yes, but I am not sure whether anyone else except the author is allowed > > to edit it (technicially I can edit it but I would prefer if Kevin would > > do that (since there is no editoral review process for changes in this > > version of Wiki and I don't like to put random nonsense into other > > people's work... :)) > > I've change it now. Thanks! :) > > > > 2. Where should server-specific config files stored (I am mainly > > > > thinking about the whole XpConfig/ hieracy which the print server needs > > > > to start (e.g. it will refuse to start without having those files so > > > > they should be placed close to the server sources IMO)) ? > > > > > > Config files belong with the app that needs them. > > > > OK... that would be the xserver module then... > > That's a reasonable question. What should we do with XpConfig, > xorgconfig, etc? The app to which these belong is the server. Same applies to the /etc/init.d/xprint script (at some point it should be superset with the "xprintadm" utility but that's still some months away in the future) ... > > > Does this mean a combined print+display server will fail to start display > > > graphics if the XpConfig hierarchy is missing? > > > > If you force to run it in "print" mode then the answer is definately > > "yes" (since you will only have print screens in the "print"-only mode > > and all print drivers will refuse to initalise if the core config data > > are missing). The same applies to the "video+print" mode but that could > > be adjusted to a plain warning and then the Xserver only comes up with > > "video" screens. > > I think this is a good reason why the default is currently to build > separate video and print servers. But that will change likely in the future - at some point there should be a way to make the print modules dynamically loadable and that is only possible with the "Xorg" server. Replicating the module loader into the "Xprt" server will only cause bloat there and defeat the idea to keep "Xprt" around as a small&&standalone print server with only a few print DDX built-in while the heavy-wheight stuff like the SVG driver should only made available as loadable module. HP/UX already did go that path, Sun did a similar work with integrating Xvfb into the Xsun server (as loadable module and making "Xvfb" just a wrapper script which calls "Xsun" with the options to load the "vfb" module and dummy keyboard/mouse drivers) and I think it's the general way for Xorg, too. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) From Alan.Coopersmith at Sun.COM Mon Apr 11 16:17:45 2005 From: Alan.Coopersmith at Sun.COM (Alan Coopersmith) Date: Mon Apr 11 18:28:11 2005 Subject: [Xprint] Re: Modularization proposal updated In-Reply-To: <425AF5B2.2BE50821@nrubsig.org> References: <20050331033441.GA23330@kem.org> <425AEA05.3E8D64F5@nrubsig.org> <200504111729.24899.ajax@nwnk.net> <425AEF14.B69D8C89@nrubsig.org> <20050411214831.GC1609@kem.org> <425AF5B2.2BE50821@nrubsig.org> Message-ID: <425AF789.7010404@sun.com> Roland Mainz wrote: > HP/UX already did go that path, Sun did a similar work with integrating > Xvfb into the Xsun server (as loadable module and making "Xvfb" just a > wrapper script which calls "Xsun" with the options to load the "vfb" > module and dummy keyboard/mouse drivers) and I think it's the general > way for Xorg, too. You can thank the GNOME accessibility project for that, since the GNOME magnifier wanted to use an Xvfb screen as backing store that programs display to, which the GNOME magnifier would then transform to the real frame buffer for display, so we needed a single server with mixed physical and virtual screens. Composite threatens to make that unnecessary for Xorg - though Stuart has worked some on getting similar setups using the dummy driver in Xorg. -- -Alan Coopersmith- alan.coopersmith@sun.com Sun Microsystems, Inc. - X Window System Engineering From julien.lafon at gmail.com Tue Apr 12 09:33:42 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Tue Apr 12 02:40:37 2005 Subject: [Xprint] XDMCP - usefull for Xprt? Message-ID: Hello, during my work on the print server code I noticed that Xprt has support for the XDMCP option '-query' - I have no doubt the unified video+print server needs it - but does this option make any sense for the standalone Xprint server? Julien -- Julien Lafon Senior Staff Engineer, Hitachi From julien.lafon at gmail.com Tue Apr 12 09:36:09 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Tue Apr 12 02:43:03 2005 Subject: [Xprint] FW: Adding Xprint to LSB In-Reply-To: References: Message-ID: On Oct 20, 2004 2:30 PM, anderson@freestandards.org wrote: > On Wed, 20 Oct 2004, Julien Lafon wrote: > > > > Added comment from Stuart: > > > > > > I think there is even a spec already in place. Still > > > need tests. > > > > > > There is some debate over wether it is really best practice or not. > > What does Stuart mean with `it' in this case? > > 'It' is refering to Xprint. > > I was raising the question as to wether Xprint is really used as the de facto > printing model everywhere. I know a couple of things like Mozilla use it, > but I'm not sure if the majority of the desktop applications are using it > or not. 'Xprint' is not the de facto printing model everywhere as in Linux printing is Postscript/CUPS centric while Xprint lives far above both, abstracting spooler access and rendering model to a level where applications are independent from the spooler and independent from the rendering model (so far X core protocol, Postscript/EPS/PCL, XRender and OpenGL are supported for rendering). > > Ideally, what the LSB would like to adopt is the one de facto printing > model that is used by just about everything, wether that is Xprint or > not. First thing to do, is to decide if such a thing like this even > exists yet. As I have outlined there is no de facto printing model (except for OpenGL applications where Xprint is now the de facto standard), however Xprint provides a path to implement printing in applications in a way which is upward compatible to whatever the future brings - the application only has to implement Xprint support and the Xprint server takes the burden of implementing newer printing standards. > > Xprint also has the characteristic that it is a part of the X Window > System, and as such could be brought into the Desktop module anyway. Xprint may also be added to the OpenGL module (if there is such a thing) as it has itself established quickly as the de facto standard for printing using the OpenGL rendering model. Julien -- Julien Lafon Senior Staff Engineer, Hitachi From julien.lafon at gmail.com Tue Apr 12 09:39:04 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Tue Apr 12 02:45:57 2005 Subject: [Xprint] Xserver large file aware? Message-ID: Hello, today we ran some experiments using very large GL surfaces (16384x16384) as suggested by Brian Paul to test if the software renderer can handle such large view ports. The native PDF driver was OK but using the Postscript driver we hit the maximum file size at 2GB after 25 frames. Therefore my question - is the Xserver code supposed to be large file aware? Julien -- Julien Lafon Senior Staff Engineer, Hitachi From julien.lafon at gmail.com Tue Apr 12 10:32:55 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Tue Apr 12 03:39:51 2005 Subject: [Xprint] Re: Modularization proposal updated In-Reply-To: <425AF5B2.2BE50821@nrubsig.org> References: <20050331033441.GA23330@kem.org> <425AEA05.3E8D64F5@nrubsig.org> <200504111729.24899.ajax@nwnk.net> <425AEF14.B69D8C89@nrubsig.org> <20050411214831.GC1609@kem.org> <425AF5B2.2BE50821@nrubsig.org> Message-ID: On Apr 12, 2005 12:09 AM, Roland Mainz wrote: > Kevin E Martin wrote: > > I think this is a good reason why the default is currently to build > > separate video and print servers. I missed parts of the conversation - can you explain why do you think that separate video and print servers would be a good idea? Julien -- Julien Lafon Senior Staff Engineer, Hitachi From simon.toedt at gmail.com Tue Apr 12 16:51:23 2005 From: simon.toedt at gmail.com (Simon Toedt) Date: Tue Apr 12 09:59:18 2005 Subject: [Xprint] Re: Improving glXSwapBuffers performace In-Reply-To: <425A8B05.6090008@tungstengraphics.com> References: <9a9b8bd3050410221040e2030f@mail.gmail.com> <425A8B05.6090008@tungstengraphics.com> Message-ID: <9a9b8bd305041206516fc33386@mail.gmail.com> On Apr 11, 2005 4:34 PM, Brian Paul wrote: > Simon Toedt wrote: > > Has anyone yet looked into ways to improve rendering performance? I > > have noticed that glXSwapBuffers() is slow (30secs +/-5secs on a > > P3/600Mhz) and mainly spends its time in PsOutImageBytes() which calls > > sprintf() in a tight loop: > > (gdb) where > > #0 PsOut_OutImageBytes (self=0x8c91ed0, nBytes=3, bytes=0xbfffec7d > > "") at psout.c:1488 > > #1 0x080d63af in PsPutScaledImage (pDrawable=0x8a69eb0, > > pGC=0x8c6f640, depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, > > format=2, imageRes=0, > > pImage=0x4066e008 "") at PsArea.c:157 > > #2 0x080d6a79 in PsPutImage (pDrawable=0x8a69eb0, pGC=0x8c6f640, > > depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, format=2, > > pImage=0x4066e008 "") at PsArea.c:332 > > #3 0x08291717 in XMesaSwapBuffers (b=0x4063d008) at xm_api.c:2391 > > #4 0x0828dca9 in __MESA_swapBuffers (glxPriv=0x8c6f178) at xf86glx.c:736 > > #5 0x0825a00f in __glXSwapBuffers (cl=0x8a69c60, pc=0x8c90a40 > > "\220\v\003") at glxcmds.c:1340 > > #6 0x082300ff in __glXDispatch (client=0x8a647b0) at glxext.c:435 > > #7 0x08083b69 in Dispatch () at dispatch.c:449 > > #8 0x0806a790 in main (argc=8, argv=0xbffff2a4, envp=0xbffff2c8) at main.c:439 > > #9 0x400e48ae in __libc_start_main () from /lib/libc.so.6 > > Well, at line 2391 of xm_api.c, XMesaXPutImage() is being called. > That's a macro: > > #define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ > do { \ > /* Assumes: Images are always in ZPixmap format */ \ > (void) __d; \ > if (__sx || __sy) /* The non-trivial case */ \ > XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \ > ValidateGC(__b, __gc); \ > (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ > __x, __y, __w, __h, 0, ZPixmap, \ > ((XMesaImage *)(__i))->data); \ > } while (0) > > The PsPutImage() function is an internal server function in the Xprint > module. I have no idea why that would be getting called. I've just had a look at the code and did some modifications which improve the performance a lot - its now almost twice as fast. Can anyone pls look at the patch, make sure its correct and then apply it? Thanks! -- Simon -------------- next part -------------- A non-text attachment was scrubbed... Name: xprint_fast_glxputimage.diff Type: application/octet-stream Size: 5856 bytes Desc: not available Url : http://mozdev.org/pipermail/xprint/attachments/20050412/3c5a33cf/xprint_fast_glxputimage-0001.obj From julien.lafon at gmail.com Tue Apr 12 18:48:58 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Tue Apr 12 11:56:31 2005 Subject: [Xprint] Re: Modularization proposal updated In-Reply-To: <425AF5B2.2BE50821@nrubsig.org> References: <20050331033441.GA23330@kem.org> <425AEA05.3E8D64F5@nrubsig.org> <200504111729.24899.ajax@nwnk.net> <425AEF14.B69D8C89@nrubsig.org> <20050411214831.GC1609@kem.org> <425AF5B2.2BE50821@nrubsig.org> Message-ID: On Apr 12, 2005 12:09 AM, Roland Mainz wrote: > Kevin E Martin wrote: > > I think this is a good reason why the default is currently to build > > separate video and print servers. I missed parts of the conversation - can you explain why do you think that separate video and print servers would be a good idea? Julien -- Julien Lafon Senior Staff Engineer, Hitachi From Alan.Coopersmith at Sun.COM Tue Apr 12 11:27:29 2005 From: Alan.Coopersmith at Sun.COM (Alan Coopersmith) Date: Tue Apr 12 13:35:35 2005 Subject: [Xprint] Xserver large file aware? In-Reply-To: References: Message-ID: <425C0501.3070503@sun.com> Julien Lafon wrote: > Hello, > > today we ran some experiments using very large GL surfaces > (16384x16384) as suggested by Brian Paul to test if the software > renderer can handle such large view ports. > The native PDF driver was OK but using the Postscript driver we hit > the maximum file size at 2GB after 25 frames. Therefore my question - > is the Xserver code supposed to be large file aware? I don't think anyone's done any work in that area, since the X server doesn't normally access files that have any need of being that large. (A 2gb config file would be truly frightening.) -- -Alan Coopersmith- alan.coopersmith@sun.com Sun Microsystems, Inc. - X Window System Engineering From daniel at fooishbar.org Wed Apr 13 02:55:56 2005 From: daniel at fooishbar.org (Daniel Stone) Date: Tue Apr 12 16:17:44 2005 Subject: [Xprint] Re: Modularization proposal updated In-Reply-To: References: <20050331033441.GA23330@kem.org> <425AEA05.3E8D64F5@nrubsig.org> <200504111729.24899.ajax@nwnk.net> <425AEF14.B69D8C89@nrubsig.org> <20050411214831.GC1609@kem.org> <425AF5B2.2BE50821@nrubsig.org> Message-ID: <20050412155555.GF26322@catsby.fooishbar.org> On Tue, Apr 12, 2005 at 05:48:58PM +0200, Julien Lafon wrote: > On Apr 12, 2005 12:09 AM, Roland Mainz wrote: > > Kevin E Martin wrote: > > > I think this is a good reason why the default is currently to build > > > separate video and print servers. > > I missed parts of the conversation - can you explain why do you think > that separate video and print servers would be a good idea? This is how it is currently -- I think the onus would be on the people pushing for the unified server to make a very, very clear and strong case (I have seen the arguments been made, but I have not seen a clear, straightforward argument), and then for those who believe this is a bad idea to rebut it. There would have to be a clear proposal for it to be properly rebutted. Maybe you could do this, Julien? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mozdev.org/pipermail/xprint/attachments/20050413/b3fede09/attachment.bin From roland.mainz at nrubsig.org Wed Apr 13 03:12:48 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Tue Apr 12 20:20:03 2005 Subject: [Xprint] Re: Improving glXSwapBuffers performace References: <9a9b8bd3050410221040e2030f@mail.gmail.com> <425A8B05.6090008@tungstengraphics.com> <9a9b8bd305041206516fc33386@mail.gmail.com> <425C4A3C.AE85A5E1@nrubsig.org> Message-ID: <425C6400.1E27904E@nrubsig.org> Roland Mainz wrote: [snip] > > > The PsPutImage() function is an internal server function in the Xprint > > > module. I have no idea why that would be getting called. > > > > I've just had a look at the code and did some modifications which > > improve the performance a lot - its now almost twice as fast. > > I am looking into the patch right now... the performance increment isn't > that surprising as you have elimited some > |sprintf()|/|strlen()|/|strcat()| or replaced it with less heavy code. > And you removed the |ferror()| call which likely saves a couple of > syscalls, too. > > > Can > > anyone pls look at the patch, make sure its correct and then apply it? > > Yes, I'll do that. I filed > https://bugs.freedesktop.org/show_bug.cgi?id=3001 > ("|glXSwapBuffers()|/|XPutImage()| are slow") to track the further > progress... > ... thank you very much for the patch! :) Just for the log: I've checked the patch in a few secs ago. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) -------------- next part -------------- An embedded message was scrubbed... From: Roland Mainz Subject: CVS Update: xc (branch: trunk) Date: Tue, 12 Apr 2005 17:05:37 -0700 (PDT) Size: 2840 Url: http://mozdev.org/pipermail/xprint/attachments/20050413/438905db/attachment.eml From roland.mainz at nrubsig.org Wed Apr 13 01:22:52 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Wed Apr 13 02:18:50 2005 Subject: [Xprint] Re: Improving glXSwapBuffers performace References: <9a9b8bd3050410221040e2030f@mail.gmail.com> <425A8B05.6090008@tungstengraphics.com> <9a9b8bd305041206516fc33386@mail.gmail.com> Message-ID: <425C4A3C.AE85A5E1@nrubsig.org> Simon Toedt wrote: > > On Apr 11, 2005 4:34 PM, Brian Paul wrote: > > Simon Toedt wrote: > > > Has anyone yet looked into ways to improve rendering performance? I > > > have noticed that glXSwapBuffers() is slow (30secs +/-5secs on a > > > P3/600Mhz) and mainly spends its time in PsOutImageBytes() which calls > > > sprintf() in a tight loop: > > > (gdb) where > > > #0 PsOut_OutImageBytes (self=0x8c91ed0, nBytes=3, bytes=0xbfffec7d > > > "") at psout.c:1488 > > > #1 0x080d63af in PsPutScaledImage (pDrawable=0x8a69eb0, > > > pGC=0x8c6f640, depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, > > > format=2, imageRes=0, > > > pImage=0x4066e008 "") at PsArea.c:157 > > > #2 0x080d6a79 in PsPutImage (pDrawable=0x8a69eb0, pGC=0x8c6f640, > > > depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, format=2, > > > pImage=0x4066e008 "") at PsArea.c:332 > > > #3 0x08291717 in XMesaSwapBuffers (b=0x4063d008) at xm_api.c:2391 > > > #4 0x0828dca9 in __MESA_swapBuffers (glxPriv=0x8c6f178) at xf86glx.c:736 > > > #5 0x0825a00f in __glXSwapBuffers (cl=0x8a69c60, pc=0x8c90a40 > > > "\220\v\003") at glxcmds.c:1340 > > > #6 0x082300ff in __glXDispatch (client=0x8a647b0) at glxext.c:435 > > > #7 0x08083b69 in Dispatch () at dispatch.c:449 > > > #8 0x0806a790 in main (argc=8, argv=0xbffff2a4, envp=0xbffff2c8) at main.c:439 > > > #9 0x400e48ae in __libc_start_main () from /lib/libc.so.6 > > > > Well, at line 2391 of xm_api.c, XMesaXPutImage() is being called. > > That's a macro: > > > > #define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ > > do { \ > > /* Assumes: Images are always in ZPixmap format */ \ > > (void) __d; \ > > if (__sx || __sy) /* The non-trivial case */ \ > > XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \ > > ValidateGC(__b, __gc); \ > > (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ > > __x, __y, __w, __h, 0, ZPixmap, \ > > ((XMesaImage *)(__i))->data); \ > > } while (0) > > > > The PsPutImage() function is an internal server function in the Xprint > > module. I have no idea why that would be getting called. > > I've just had a look at the code and did some modifications which > improve the performance a lot - its now almost twice as fast. I am looking into the patch right now... the performance increment isn't that surprising as you have elimited some |sprintf()|/|strlen()|/|strcat()| or replaced it with less heavy code. And you removed the |ferror()| call which likely saves a couple of syscalls, too. > Can > anyone pls look at the patch, make sure its correct and then apply it? Yes, I'll do that. I filed https://bugs.freedesktop.org/show_bug.cgi?id=3001 ("|glXSwapBuffers()|/|XPutImage()| are slow") to track the further progress... ... thank you very much for the patch! :) ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) From roland.mainz at nrubsig.org Wed Apr 13 00:45:54 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Wed Apr 13 02:24:03 2005 Subject: [Xprint] Xserver large file aware? References: <425C0501.3070503@sun.com> Message-ID: <425C4192.B34AF1EA@nrubsig.org> Alan Coopersmith wrote: [snip] > > Therefore my question - > > is the Xserver code supposed to be large file aware? > > I don't think anyone's done any work in that area, since the X server > doesn't normally access files that have any need of being that large. > (A 2gb config file would be truly frightening.) A 2GB config file will hopefully something we will never see... =:-) ... but there are things like |mmap()| of device spaces or kernel/PCI space which may hit that issue (or output files such as spooler or log files (which may harm longrunning Xservers)). But again we are hitting a problem here: Recompiling the Xserver code with largefile support enabled will likely break the module ABI as there are AFAIK some 32bit-only I/O libc functions emulated by the ELF loader - and the datatypes for offsets are AFAIK 32bit and not 64bit (yes, it would be possible to add |*64()| versions of the 32bit functions to the libc emulation in the ELF loader but that does not cure the general problem (and ignores the existance of the dlloader completely)). The Solaris lfcompile(5) manual page lists another bunch of additional scenarios which need to be taken care of but I am not sure whether this work will ever happen (see below). The only ad-hoc solution here may be to recompile the Xserver as 64bit application and add the issue that "the Xserver core is not largefile aware" to the wishlist of things which should be fixed if the module ABI gets reworked (which will likely not happen until h*ll freezes... ;-(). ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) From ajax at nwnk.net Wed Apr 13 04:11:45 2005 From: ajax at nwnk.net (Adam Jackson) Date: Wed Apr 13 03:18:49 2005 Subject: [Xprint] Xserver large file aware? In-Reply-To: <425C4192.B34AF1EA@nrubsig.org> References: <425C0501.3070503@sun.com> <425C4192.B34AF1EA@nrubsig.org> Message-ID: <200504130311.49539.ajax@nwnk.net> On Tuesday 12 April 2005 17:45, Roland Mainz wrote: > Alan Coopersmith wrote: > > I don't think anyone's done any work in that area, since the X server > > doesn't normally access files that have any need of being that large. > > (A 2gb config file would be truly frightening.) > > A 2GB config file will hopefully something we will never see... =:-) > ... but there are things like |mmap()| of device spaces or kernel/PCI > space which may hit that issue (or output files such as spooler or log > files (which may harm longrunning Xservers)). > But again we are hitting a problem here: Recompiling the Xserver code > with largefile support enabled will likely break the module ABI as there > are AFAIK some 32bit-only I/O libc functions emulated by the ELF loader This is not an ABI break in the sense you're thinking of. You can't load a 32-bit driver from a 64-bit server or vice versa. (If you can, you shouldn't be able to, it's a horrible idea, and I will make sure it fails in the future.) There are three cases: - 32 bit object, no LFS. This is where we are now on ILP32. - 32 bit object, LFS. Need to add 64-bit entrypoints for mmap and friends and add 64 bit size_t's for them. - 64 bit object, implicit LFS. This is where we are now for LP64. > - and the datatypes for offsets are AFAIK 32bit and not 64bit No, xf86size_t is a typedef for unsigned long and is used in place of off_t in all the function signatures where it matters. A quick grep shows that we never encode xf86size_t in a struct or pass it over the wire, so this is handled entirely by new entrypoints. Note that if you use separate typedefs for the smallfile and largefile size_t's, then you can load smallfile drivers on largefile servers. The reverse won't work because the driver will explicitly require the new entrypoints and the smallfile server won't have them. We only need to extend the ABI for ILP32, assuming we even care about LFS on ILP32; there's not enough context in the quoted text to know if this is really an issue. > (yes, it > would be possible to add |*64()| versions of the 32bit functions to the > libc emulation in the ELF loader but that does not cure the general > problem (and ignores the existance of the dlloader completely)). This really has nothing to do with the loader, it has to to with the libc wrapper. Adding entrypoints to the libc wrapper for ILP32+LFS will work for all four loaders. > The only ad-hoc solution here may be to recompile the Xserver as 64bit > application and add the issue that "the Xserver core is not largefile > aware" to the wishlist of things which should be fixed if the module ABI > gets reworked (which will likely not happen until h*ll freezes... ;-(). Again, not an ABI break. At most we would need an ABI extension for ILP32 systems. - ajax -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mozdev.org/pipermail/xprint/attachments/20050413/8980cb3a/attachment.bin From julien.lafon at gmail.com Sat Apr 23 06:22:31 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Fri Apr 22 23:29:58 2005 Subject: [Xprint] x11perf support for printer devices Message-ID: Hello, I have spend some time to evaluate print job generation performance and added support for printer devices to x11perf. It would be nice if Roland or AlanC could comment on the patch here before I attach it to a bugzilla rfe. Julien -- Julien Lafon Senior Staff Engineer, Hitachi -------------- next part -------------- Index: Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/Imakefile,v retrieving revision 1.4 diff -u -r1.4 Imakefile --- Imakefile 11 Aug 2004 08:05:31 -0000 1.4 +++ Imakefile 22 Apr 2005 21:40:21 -0000 @@ -12,19 +12,24 @@ #if HasShm SHMDEFS = -DMITSHM #endif -#if BuildRenderLibrary +#if xBuildRenderLibrary XRENDERDEFS = -DXRENDER XRENDERDEPS = $(DEPXRENDERLIB) XRENDERLIBS = $(XRENDERLIB) XRENDERINCS = $(XRENDERINCLUDES) #endif -#if BuildXftLibrary +#if xBuildXftLibrary XFTDEFS = -DXFT -DXFREE86_FT2 XFTDEPS = XftClientDepLibs XFTLIBS = XftClientLibs XFTINCS = $(XFTINCLUDES) -I$(XBUILDINCDIR) #endif - DEFINES = $(SIGNAL_DEFINES) $(SHMDEFS) $(XFTDEFS) $(XRENDERDEFS) +#if BuildXprintLib && BuildXprintClients + XPRINTLIBS = -lXprintUtil $(XPLIB) + XPRINTDEFS = -DXPRINT +#endif + + DEFINES = $(SIGNAL_DEFINES) $(SHMDEFS) $(XFTDEFS) $(XRENDERDEFS) $(XPRINTDEFS) INCLUDES = $(TOP_INCLUDES) $(XFTINCS) $(XRENDERINCS) PERFLIB = X11perfcompLib HEADERS = x11perf.h bitmaps.h @@ -40,7 +45,7 @@ do_dots.o do_windows.o do_movewin.o do_text.o \ do_blt.o do_arcs.o \ do_tris.o do_complex.o do_traps.o -LOCAL_LIBRARIES = $(XFTLIBS) $(XRENDERLIBS) $(XMUULIB) $(XLIB) +LOCAL_LIBRARIES = $(XFTLIBS) $(XRENDERLIBS) $(XPRINTLIBS) $(XMUULIB) $(XLIB) DEPLIBS = $(XFTDEPS) $(XRENDERDEPS) $(DEPXMUULIB) $(DEPXLIB) SYS_LIBRARIES = MathLibrary Index: do_arcs.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_arcs.c,v retrieving revision 1.2 diff -u -r1.2 do_arcs.c --- do_arcs.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_arcs.c 22 Apr 2005 21:40:22 -0000 @@ -71,16 +71,16 @@ y += size + 1; rows++; - if (y >= HEIGHT - size - half || rows == MAXROWS) { + if (y >= xp->test_height - size - half || rows == MAXROWS) { /* Go to next column */ rows = 0; x += size + 1; - if (x >= WIDTH - size) { + if (x >= xp->test_width - size) { yorg++; - if (yorg >= size + half || yorg >= HEIGHT - size - half) { + if (yorg >= size + half || yorg >= xp->test_height - size - half) { yorg = half; xorg++; - if (xorg >= size + half || xorg >= WIDTH - size - half) { + if (xorg >= size + half || xorg >= xp->test_width - size - half) { xorg = half; } } @@ -289,12 +289,12 @@ y += size + 1; rows++; - if (y >= HEIGHT - size - half || rows == MAXROWS) { + if (y >= xp->test_height - size - half || rows == MAXROWS) { /* Go to next column */ rows = 0; y = half; x += size + 1; - if (x >= WIDTH - size - half) { + if (x >= xp->test_width - size - half) { x = half; } } Index: do_blt.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_blt.c,v retrieving revision 1.2 diff -u -r1.2 do_blt.c --- do_blt.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_blt.c 22 Apr 2005 21:40:23 -0000 @@ -36,29 +36,29 @@ #define NegMod(x, y) ((y) - (((-x)-1) % (7)) - 1) static void -InitBltLines(void) +InitBltLines(XParms xp) { int i, x, y; points[0].x = points[0].y = y = 0; for (i = 1; i != NUMPOINTS/2; i++) { if (i & 1) { - points[i].x = WIDTH-1; + points[i].x = xp->test_width-1; } else { points[i].x = 0; } - y += HEIGHT / (NUMPOINTS/2); + y += xp->test_height / (NUMPOINTS/2); points[i].y = y; } x = 0; for (i = NUMPOINTS/2; i!= NUMPOINTS; i++) { if (i & 1) { - points[i].y = HEIGHT-1; + points[i].y = xp->test_height-1; } else { points[i].y = 0; } - x += WIDTH / (NUMPOINTS/2); + x += xp->test_width / (NUMPOINTS/2); points[i].x = x; } } @@ -66,7 +66,7 @@ int InitScroll(XParms xp, Parms p, int reps) { - InitBltLines(); + InitBltLines(xp); XDrawLines(xp->d, xp->w, xp->fggc, points, NUMPOINTS, CoordModeOrigin); return reps; } @@ -93,18 +93,18 @@ XCopyArea(xp->d, xp->w, xp->w, xp->fggc, x, y + delta, size, size, x, y); y += size; - if (y + size + delta > HEIGHT) { + if (y + size + delta > xp->test_height) { yorg += delta; - if (yorg >= size || yorg + size + delta > HEIGHT) { + if (yorg >= size || yorg + size + delta > xp->test_height) { yorg = 0; xorg++; - if (xorg >= size || xorg + size > WIDTH) { + if (xorg >= size || xorg + size > xp->test_width) { xorg = 0; } } y = yorg; x += size; - if (x + size > WIDTH) { + if (x + size > xp->test_width) { x = xorg; } } @@ -140,8 +140,8 @@ xinc = (size & ~3) + 1; yinc = xinc + 3; - width = (WIDTH - size) & ~31; - height = (HEIGHT - size) & ~31; + width = (xp->test_width - size) & ~31; + height = (xp->test_height - size) & ~31; x1 = 0; y1 = 0; @@ -199,10 +199,10 @@ (void) InitCopyWin(xp, p, reps); /* Create pixmap to write stuff into, and initialize it */ - pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, xp->vinfo.depth); + pix = XCreatePixmap(xp->d, xp->w, xp->test_width, xp->test_height, xp->vinfo.depth); pixgc = XCreateGC(xp->d, pix, 0, 0); /* need a gc with GXcopy cos pixmaps contain junk on creation. mmm */ - XCopyArea(xp->d, xp->w, pix, pixgc, 0, 0, WIDTH, HEIGHT, 0, 0); + XCopyArea(xp->d, xp->w, pix, pixgc, 0, 0, xp->test_width, xp->test_height, 0, 0); XFreeGC(xp->d, pixgc); return reps; } @@ -212,9 +212,12 @@ { (void) InitCopyWin(xp, p, reps); +#if 1 +p->font=1; /* Create image to stuff bits into */ - image = XGetImage(xp->d, xp->w, 0, 0, WIDTH, HEIGHT, xp->planemask, + image = XGetImage(xp->d, xp->w, 0, 0, xp->test_width, xp->test_height, xp->planemask, p->font==0?ZPixmap:XYPixmap); +#endif if(image==0){ printf("XGetImage failed\n"); return False; @@ -523,18 +526,18 @@ XGCValues gcv; GC pixgc; - InitBltLines(); + InitBltLines(xp); InitCopyLocations(xp, p, reps); /* Create pixmap to write stuff into, and initialize it */ - pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, + pix = XCreatePixmap(xp->d, xp->w, xp->test_width, xp->test_height, p->font==0 ? 1 : xp->vinfo.depth); gcv.graphics_exposures = False; gcv.foreground = 0; gcv.background = 1; pixgc = XCreateGC(xp->d, pix, GCForeground | GCBackground | GCGraphicsExposures, &gcv); - XFillRectangle(xp->d, pix, pixgc, 0, 0, WIDTH, HEIGHT); + XFillRectangle(xp->d, pix, pixgc, 0, 0, xp->test_width, xp->test_height); gcv.foreground = 1; gcv.background = 0; XChangeGC(xp->d, pixgc, GCForeground | GCBackground, &gcv); Index: do_complex.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_complex.c,v retrieving revision 1.2 diff -u -r1.2 do_complex.c --- do_complex.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_complex.c 22 Apr 2005 21:40:23 -0000 @@ -86,10 +86,10 @@ phi += phiinc; y += 2 * iradius; - if (y + iradius >= HEIGHT) { + if (y + iradius >= xp->test_height) { y = iradius; x += 2 * iradius; - if (x + iradius >= WIDTH) { + if (x + iradius >= xp->test_width) { x = iradius; } } @@ -159,10 +159,10 @@ } phi += phiinc; y += 2 * iradius; - if (y + iradius >= HEIGHT) { + if (y + iradius >= xp->test_height) { y = iradius; x += 2 * iradius; - if (x + iradius >= WIDTH) { + if (x + iradius >= xp->test_width) { x = iradius; } } Index: do_lines.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_lines.c,v retrieving revision 1.2 diff -u -r1.2 do_lines.c --- do_lines.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_lines.c 22 Apr 2005 21:40:23 -0000 @@ -108,10 +108,10 @@ /* If off either top or bottom, backtrack to previous position and go the other way instead. Also move in bigxdir if not already. */ rows++; - if (y < half || y >= (HEIGHT-half) || rows > MAXROWS) { + if (y < half || y >= (xp->test_height-half) || rows > MAXROWS) { rows = 0; if (bigxdir > 0) { - if (x + size < WIDTH - half) { + if (x + size < xp->test_width - half) { xdir = 1; } else { bigxdir = -1; @@ -133,10 +133,10 @@ need such adjustment, line length (in pixels) should not change...we just can't get the slope we want for this line. */ if (y < half) { - y = (HEIGHT - y1)/2; + y = (xp->test_height - y1)/2; ydir = 1; - } else if (y > (HEIGHT - half)) { - y = (HEIGHT + y1)/2; + } else if (y > (xp->test_height - half)) { + y = (xp->test_height + y1)/2; ydir = -1; } } @@ -147,10 +147,10 @@ /* Again, if we are off the bottom then we can't really draw the line we want. */ if (x < half) { - x = (WIDTH - x1)/2; + x = (xp->test_width - x1)/2; xdir = 1; - } else if (x > (WIDTH - half)) { - x = (WIDTH + x1)/2; + } else if (x > (xp->test_width - half)) { + x = (xp->test_width + x1)/2; xdir = -1; } points[i].x = x; Index: do_movewin.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_movewin.c,v retrieving revision 1.2 diff -u -r1.2 do_movewin.c --- do_movewin.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_movewin.c 22 Apr 2005 21:40:24 -0000 @@ -33,7 +33,7 @@ static int xmax, ymax; static int delta1; /* Private global data for DoResizeWindows */ -#define STACK (4*(HEIGHT-10)/CHILDSIZE) +#define STACK (4*(xp->test_height-10)/CHILDSIZE) int InitMoveWindows(XParms xp, Parms p, int reps) @@ -72,9 +72,9 @@ for (i = 0; i != reps; i++) { x_offset += 1; y_offset += 3; - if (y_offset + ymax > HEIGHT) + if (y_offset + ymax > xp->test_height) y_offset = 0; - if (x_offset + xmax > WIDTH) + if (x_offset + xmax > xp->test_width) x_offset = 0; for (j = 0; j != p->objects; j++) { XMoveWindow(xp->d, children[j], @@ -189,9 +189,9 @@ for (i = 0; i != reps; i++) { x_offset += 1; y_offset += 3; - if (y_offset + ymax > HEIGHT) + if (y_offset + ymax > xp->test_height) y_offset = 0; - if (x_offset + xmax > WIDTH) + if (x_offset + xmax > xp->test_width) x_offset = 0; XMoveWindow(xp->d, cover, x_offset, y_offset); CheckAbort (); Index: do_rects.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_rects.c,v retrieving revision 1.2 diff -u -r1.2 do_rects.c --- do_rects.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_rects.c 22 Apr 2005 21:40:24 -0000 @@ -70,11 +70,11 @@ y += step; rows++; - if (y + size > HEIGHT || rows == MAXROWS) { + if (y + size > xp->test_height || rows == MAXROWS) { rows = 0; y = lw; x += step; - if (x + size > WIDTH) { + if (x + size > xp->test_width) { x = lw; } } Index: do_segs.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_segs.c,v retrieving revision 1.2 diff -u -r1.2 do_segs.c --- do_segs.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_segs.c 22 Apr 2005 21:40:24 -0000 @@ -140,12 +140,12 @@ /* Change square to draw segment in */ rows++; y += size; - if (y >= HEIGHT - size - half || rows == MAXROWS) { + if (y >= xp->test_height - size - half || rows == MAXROWS) { /* Go to next column */ rows = 0; y = half; x += size; - if (x >= WIDTH - size - half) { + if (x >= xp->test_width - size - half) { x = half; } } @@ -252,11 +252,11 @@ } rows++; y += size; - if (y >= HEIGHT - size - half || rows == MAXROWS) { + if (y >= xp->test_height - size - half || rows == MAXROWS) { rows = 0; y = half; x += size; - if (x >= WIDTH - size - half) + if (x >= xp->test_width - size - half) x = half; } } @@ -325,12 +325,12 @@ } rows++; y += size; - if (y >= HEIGHT - size - half || rows == MAXROWS) { + if (y >= xp->test_height - size - half || rows == MAXROWS) { /* Go to next column */ rows = 0; y = half; x += size; - if (x >= WIDTH - size - half) { + if (x >= xp->test_width - size - half) { x = half; } } Index: do_tests.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_tests.c,v retrieving revision 1.3 diff -u -r1.3 do_tests.c --- do_tests.c 6 Aug 2004 23:42:11 -0000 1.3 +++ do_tests.c 22 Apr 2005 21:40:28 -0000 @@ -925,85 +925,85 @@ {"-ftext", "Char in 80-char line (6x13)", NULL, InitText, DoText, ClearTextWin, EndText, V1_2FEATURE, ROP, 0, - {80, False, "6x13", NULL}}, + {80, False, "-misc-fixed-medium-r-semicondensed--*-120-*-*-c-0-iso8859-1,6x13", NULL}}, {"-f8text", "Char in 70-char line (8x13)", NULL, InitText, DoText, ClearTextWin, EndText, V1_3FEATURE, ROP, 0, - {70, False, "8x13", NULL}}, + {70, False, "-misc-fixed-medium-r-normal--*-120-*-*-c-0-iso8859-1,8x13", NULL}}, {"-f9text", "Char in 60-char line (9x15)", NULL, InitText, DoText, ClearTextWin, EndText, V1_3FEATURE, ROP, 0, - {60, False, "9x15", NULL}}, + {60, False, "-misc-fixed-medium-r-normal--*-140-*-*-c-0-iso8859-1,9x15", NULL}}, {"-f14text16", "Char16 in 40-char line (k14)", NULL, InitText16, DoText16, ClearTextWin, EndText16, V1_3FEATURE, ROP, 0, {40, False, - "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", + "-misc-fixed-medium-r-normal--*-130-*-*-c-0-jisx0208.1983-*,-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", NULL}}, {"-f24text16", "Char16 in 23-char line (k24)", NULL, InitText16, DoText16, ClearTextWin, EndText16, V1_3FEATURE, ROP, 0, {23, False, - "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*", + "-jis-fixed-medium-r-normal--*-230-*-*-c-0-jisx0208.1983-*,-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*", NULL}}, {"-tr10text", "Char in 80-char line (TR 10)", NULL, InitText, DoText, ClearTextWin, EndText, V1_2FEATURE, ROP, 0, {80, False, - "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", + "-adobe-times-medium-r-normal--*-100-*-*-p-0-iso8859-1,-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", NULL}}, {"-tr24text", "Char in 30-char line (TR 24)", NULL, InitText, DoText, ClearTextWin, EndText, V1_2FEATURE, ROP, 0, {30, False, - "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", + "-adobe-times-medium-r-normal--*-240-*-*-p-0-iso8859-1,-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", NULL}}, {"-polytext", "Char in 20/40/20 line (6x13, TR 10)", NULL, InitText, DoPolyText, ClearTextWin, EndText, V1_2FEATURE, ROP, 0, {80, True, "6x13", - "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1"}}, + "-adobe-times-medium-r-normal--*-100-*-*-p-0-iso8859-1,6x13"}}, {"-polytext16", "Char16 in 7/14/7 line (k14, k24)", NULL, InitText16, DoPolyText16, ClearTextWin, EndText16, V1_3FEATURE, ROP, 0, {28, True, - "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", - "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*"}}, + "-misc-fixed-medium-r-normal--*-130-*-*-c-0-jisx0208.1983-*,-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", + "-jis-fixed-medium-r-normal--*-230-*-*-c-0-jisx0208.1983-*,-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*"}}, {"-fitext", "Char in 80-char image line (6x13)", NULL, InitText, DoImageText, ClearTextWin, EndText, V1_2FEATURE, PLANEMASK, 0, - {80, False, "6x13", NULL}}, + {80, False, "-misc-fixed-medium-r-semicondensed--*-120-*-*-c-0-iso8859-1,6x13", NULL}}, {"-f8itext", "Char in 70-char image line (8x13)", NULL, InitText, DoImageText, ClearTextWin, EndText, V1_3FEATURE, PLANEMASK, 0, - {70, False, "8x13", NULL}}, + {70, False, "-misc-fixed-medium-r-normal--*-120-*-*-c-0-iso8859-1,8x13", NULL}}, {"-f9itext", "Char in 60-char image line (9x15)", NULL, InitText, DoImageText, ClearTextWin, EndText, V1_3FEATURE, PLANEMASK, 0, - {60, False, "9x15", NULL}}, + {60, False, "-misc-fixed-medium-r-normal--*-140-*-*-c-0-iso8859-1,9x15", NULL}}, {"-f14itext16", "Char16 in 40-char image line (k14)", NULL, InitText16, DoImageText16, ClearTextWin, EndText16, V1_3FEATURE, PLANEMASK, 0, {40, False, - "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", + "-misc-fixed-medium-r-normal--*-130-*-*-c-0-jisx0208.1983-*,-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", NULL}}, {"-f24itext16", "Char16 in 23-char image line (k24)", NULL, InitText16, DoImageText16, ClearTextWin, EndText16, V1_3FEATURE, PLANEMASK, 0, {23, False, - "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*", + "-jis-fixed-medium-r-normal--*-230-*-*-c-0-jisx0208.1983-*,-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*", NULL}}, {"-tr10itext", "Char in 80-char image line (TR 10)", NULL, InitText, DoImageText, ClearTextWin, EndText, V1_2FEATURE, PLANEMASK, 0, {80, False, - "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", + "-adobe-times-medium-r-normal--*-100-*-*-p-0-iso8859-1,-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", NULL}}, {"-tr24itext", "Char in 30-char image line (TR 24)", NULL, InitText, DoImageText, ClearTextWin, EndText, V1_2FEATURE, PLANEMASK, 0, {30, False, - "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", + "-adobe-times-medium-r-normal--*-240-*-*-p-0-iso8859-1,-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", NULL}}, #ifdef XFT {"-aa10text", "Char in 80-char aa line (Charter 10)", NULL, Index: do_text.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_text.c,v retrieving revision 1.2 diff -u -r1.2 do_text.c --- do_text.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_text.c 22 Apr 2005 21:40:29 -0000 @@ -35,6 +35,24 @@ #define XPOS 20 #define SEGS 3 +static +XFontStruct *LoadQueryFontList(Display *d, char *list) +{ + char *s; + XFontStruct *f; + list = strdup(list); + s = strtok(list, ","); + while(s) + { + f = XLoadQueryFont(d, s); + if (f) { + free(list); + return f; + } + s = strtok(NULL, ","); + } + return NULL; +} int InitText(XParms xp, Parms p, int reps) @@ -43,7 +61,7 @@ char ch; XGCValues gcv; - font = XLoadQueryFont(xp->d, p->font); + font = LoadQueryFontList(xp->d, p->font); if (font == NULL) { printf("Could not load font '%s', benchmark omitted\n", p->font); return 0; @@ -51,15 +69,15 @@ bfont = NULL; if (p->bfont != NULL) { - bfont = XLoadQueryFont(xp->d, p->bfont); + bfont = LoadQueryFontList(xp->d, p->bfont); if (bfont == NULL) { printf("Could not load font '%s', benchmark omitted\n", p->bfont); return 0; } } - ypos = XPOS; height = (font->max_bounds.ascent + font->max_bounds.descent) + 1; + ypos = XPOS+height; if (bfont != NULL) { int h = (bfont->max_bounds.ascent + bfont->max_bounds.descent) + 1; if (h > height) @@ -129,7 +147,7 @@ int rows, columns, totalChars, ch; int brows, bcolumns = 0, btotalChars = 0, bch = 0; - font = XLoadQueryFont(xp->d, p->font); + font = LoadQueryFontList(xp->d, p->font); if (font == NULL) { printf("Could not load font '%s', benchmark omitted\n", p->font); return 0; @@ -142,7 +160,7 @@ bfont = NULL; if (p->bfont != NULL) { - bfont = XLoadQueryFont(xp->d, p->bfont); + bfont = LoadQueryFontList(xp->d, p->bfont); if (bfont == NULL) { printf("Could not load font '%s', benchmark omitted\n", p->bfont); return 0; @@ -154,8 +172,8 @@ if (brows > totalLines) totalLines = brows; } - ypos = XPOS; height = (font->max_bounds.ascent + font->max_bounds.descent) + 1; + ypos = XPOS+height; if (bfont != NULL) { int h = (bfont->max_bounds.ascent + bfont->max_bounds.descent) + 1; if (h > height) @@ -230,9 +248,9 @@ XDrawString( xp->d, xp->w, xp->fggc, XPOS, ypos, charBuf[line], charsPerLine); ypos += height; - if (ypos > HEIGHT - height) { + if (ypos > xp->test_height - height) { /* Wraparound to top of window */ - ypos = XPOS; + ypos = XPOS+height; line = startLine; startLine = (startLine + 1) % totalLines; } @@ -252,9 +270,9 @@ XDrawString16( xp->d, xp->w, xp->fggc, XPOS, ypos, (XChar2b *)charBuf[line], charsPerLine); ypos += height; - if (ypos > HEIGHT - height) { + if (ypos > xp->test_height - height) { /* Wraparound to top of window */ - ypos = XPOS; + ypos = XPOS+height; line = startLine; startLine = (startLine + 1) % totalLines; } @@ -274,9 +292,9 @@ XDrawText( xp->d, xp->w, xp->fggc, XPOS, ypos, &items[line*SEGS], SEGS); ypos += height; - if (ypos > HEIGHT - height) { + if (ypos > xp->test_height - height) { /* Wraparound to top of window */ - ypos = XPOS; + ypos = XPOS+height; line = startLine; startLine = (startLine + 1) % totalLines; } @@ -296,9 +314,9 @@ XDrawText16( xp->d, xp->w, xp->fggc, XPOS, ypos, (XTextItem16 *)&items[line*SEGS], SEGS); ypos += height; - if (ypos > HEIGHT - height) { + if (ypos > xp->test_height - height) { /* Wraparound to top of window */ - ypos = XPOS; + ypos = XPOS+height; line = startLine; startLine = (startLine + 1) % totalLines; } @@ -318,9 +336,9 @@ XDrawImageString( xp->d, xp->w, xp->fggc, XPOS, ypos, charBuf[line], charsPerLine); ypos += height; - if (ypos > HEIGHT - height) { + if (ypos > xp->test_height - height) { /* Wraparound to top of window */ - ypos = XPOS; + ypos = XPOS+height; startLine = (startLine + 17) % totalLines; line = startLine; } @@ -340,9 +358,9 @@ XDrawImageString16( xp->d, xp->w, xp->fggc, XPOS, ypos, (XChar2b *)charBuf[line], charsPerLine); ypos += height; - if (ypos > HEIGHT - height) { + if (ypos > xp->test_height - height) { /* Wraparound to top of window */ - ypos = XPOS; + ypos = XPOS+height; startLine = (startLine + 17) % totalLines; line = startLine; } @@ -483,9 +501,9 @@ XftDrawString8 (aadraw, &aacolor, aafont, XPOS, ypos, (unsigned char *) charBuf[line], charsPerLine); ypos += height; - if (ypos > HEIGHT - height) { + if (ypos > xp->test_height - height) { /* Wraparound to top of window */ - ypos = XPOS; + ypos = XPOS+height; line = startLine; startLine = (startLine + 1) % totalLines; } Index: do_traps.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_traps.c,v retrieving revision 1.4 diff -u -r1.4 do_traps.c --- do_traps.c 11 Aug 2004 08:05:31 -0000 1.4 +++ do_traps.c 22 Apr 2005 21:40:29 -0000 @@ -65,11 +65,11 @@ y += size; rows++; - if (y + size > HEIGHT || rows == MAXROWS) { + if (y + size > xp->test_height || rows == MAXROWS) { rows = 0; y = 0; x += 2 * size; - if (x + size > WIDTH) { + if (x + size > xp->test_width) { x = size; } } @@ -171,7 +171,7 @@ } maskFormat = XRenderFindStandardFormat (xp->d, std_fmt); - maskPixmap = XCreatePixmap (xp->d, xp->w, WIDTH, HEIGHT, depth); + maskPixmap = XCreatePixmap (xp->d, xp->w, xp->test_width, xp->test_height, depth); mask = XRenderCreatePicture (xp->d, maskPixmap, maskFormat, 0, 0); @@ -217,11 +217,11 @@ y += size; rows++; - if (y + size > HEIGHT || rows == MAXROWS) { + if (y + size > xp->test_height || rows == MAXROWS) { rows = 0; y = 0; x += 2 * size; - if (x + size > WIDTH) { + if (x + size > xp->test_width) { x = size; } } @@ -244,10 +244,10 @@ src = black; for (i = 0; i != reps; i++) { XRenderFillRectangle (xp->d, PictOpSrc, mask, &transparent, - 0, 0, WIDTH, HEIGHT); + 0, 0, xp->test_width, xp->test_height); XRenderAddTraps (xp->d, mask, 0, 0, traps, p->objects); XRenderComposite (xp->d, PictOpOver, src, mask, dst, - 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT); + 0, 0, 0, 0, 0, 0, xp->test_width, xp->test_height); if (src == black) src = white; else @@ -350,11 +350,11 @@ y += size; rows++; - if (y + size > HEIGHT || rows == MAXROWS) { + if (y + size > xp->test_height || rows == MAXROWS) { rows = 0; y = 0; x += 2 * size; - if (x + size > WIDTH) { + if (x + size > xp->test_width) { x = size; } } Index: do_tris.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_tris.c,v retrieving revision 1.2 diff -u -r1.2 do_tris.c --- do_tris.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_tris.c 22 Apr 2005 21:40:29 -0000 @@ -115,11 +115,11 @@ phi += phiinc; y += 2 * iradius; rows++; - if (y + iradius > HEIGHT || rows == MAXROWS) { + if (y + iradius > xp->test_height || rows == MAXROWS) { rows = 0; y = iradius; x += 2 * iradius; - if (x + iradius > WIDTH) { + if (x + iradius > xp->test_width) { x = iradius; } } Index: do_windows.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_windows.c,v retrieving revision 1.2 diff -u -r1.2 do_windows.c --- do_windows.c 23 Apr 2004 19:54:38 -0000 1.2 +++ do_windows.c 22 Apr 2005 21:40:30 -0000 @@ -50,8 +50,8 @@ ComputeSizes(xp, p); - parentcolumns = WIDTH / parentwidth; - parentrows = HEIGHT / parentheight; + parentcolumns = xp->test_width / parentwidth; + parentrows = xp->test_height / parentheight; parentwindows = parentcolumns * parentrows; /* Max reps we can fit */ if (parentwindows > reps) { @@ -243,7 +243,7 @@ 0, xp->foreground, xp->foreground); #else isolate = XCreateSimpleWindow( - xp->d, xp->w, 0, 0, WIDTH, HEIGHT, + xp->d, xp->w, 0, 0, xp->test_width, xp->test_height, 0, xp->background, xp->background); ComputeSizes(xp, p); Index: x11perf.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/x11perf.c,v retrieving revision 1.2 diff -u -r1.2 x11perf.c --- x11perf.c 23 Apr 2004 19:54:38 -0000 1.2 +++ x11perf.c 22 Apr 2005 21:40:33 -0000 @@ -43,7 +43,9 @@ /* Only for working on ``fake'' servers, for hardware that doesn't exist */ static Bool drawToFakeServer = False; static Pixmap tileToQuery = None; -static char *displayName; +static char *displayName, + *printerName, + *printFilename; int abortTest; typedef struct _RopNames { char *name; int rop; } RopNameRec, *RopNamePtr; @@ -393,6 +395,125 @@ return(d); } +#ifdef XPRINT +static +void Open_Printer(char *printer_name, char *print_file) +{ + long dpi_x = 0L, + dpi_y = 0L; + XPPrinterList plist = NULL; /* list of printers */ + int plist_count; /* number of entries in |plist|-array */ + unsigned short dummy; + XRectangle winrect; + + plist = XpuGetPrinterList(printer_name, &plist_count); + + if (!plist) { + fprintf(stderr, "%s: no printers found for printer spec \"%s\".\n", + program_name, NULLSTR(printer_name)); + exit(1); + } + + printer_name = plist[0].name; + + Log(("Using printer '%s'\n", printer_name)); + + if (XpuGetPrinter(printer_name, &xparms.d, &xparms.pcontext) != 1) { + fprintf(stderr, "%s: Cannot open printer '%s'\n", program_name, printer_name); + exit(1); + } + + if (XpQueryExtension(xparms.d, &xparms.xp_event_base, &xparms.xp_error_base) == False) { + fprintf(stderr, "%s: XpQueryExtension() failed.\n", program_name); + XpuClosePrinterDisplay(xparms.d, xparms.pcontext); + exit(1); + } + + /* Listen to XP(Start|End)(Job|Doc|Page)Notify events). + * This is mantatory as Xp(Start|End)(Job|Doc|Page) functions are _not_ + * syncronous !! + * Not waiting for such events may cause that subsequent data may be + * destroyed/corrupted!! + */ + XpSelectInput(xparms.d, xparms.pcontext, XPPrintMask); + + /* Set job title */ + XpuSetJobTitle(xparms.d, xparms.pcontext, "x11perf/Xprint"); + + /* Set print context + * Note that this modifies the available fonts, including builtin printer prints. + * All XListFonts()/XLoadFont() stuff should be done _after_ setting the print + * context to obtain the proper fonts. + */ + XpSetContext(xparms.d, xparms.pcontext); + + /* Get default printer reolution */ + if (XpuGetResolution(xparms.d, xparms.pcontext, &dpi_x, &dpi_y) != 1) { + fprintf(stderr, "%s: No default resolution for printer '%s'.\n", + program_name, printer_name); + XpuClosePrinterDisplay(xparms.d, xparms.pcontext); + exit(1); + } + + if (print_file) { + Log(("starting job (to file '%s').\n", print_file)); + xparms.printtofile_handle = XpuStartJobToFile(xparms.d, xparms.pcontext, print_file); + if( !xparms.printtofile_handle ) { + fprintf(stderr, "%s: Error: %s while trying to print to file.\n", + program_name, strerror(errno)); + XpuClosePrinterDisplay(xparms.d, xparms.pcontext); + exit(1); + } + + XpuWaitForPrintNotify(xparms.d, xparms.xp_event_base, XPStartJobNotify); + } + else + { + Log(("starting job.\n")); + XpuStartJobToSpooler(xparms.d); + XpuWaitForPrintNotify(xparms.d, xparms.xp_event_base, XPStartJobNotify); + } + + xparms.screen = XpGetScreenOfContext(xparms.d, xparms.pcontext); + + /* Obtain some info about page geometry */ + XpGetPageDimensions(xparms.d, xparms.pcontext, &dummy, &dummy, &winrect); + + if (xparms.test_width == 0 && + xparms.test_height == 0) { + xparms.test_x = winrect.x; + xparms.test_y = winrect.y; + xparms.test_width = winrect.width; + xparms.test_height = winrect.height; + } +} + +static +void PrintSpoolerCommandResults( Display *pdpy, XPContext pcontext ) +{ + char *scr; + + scr = XpGetOneAttribute(pdpy, pcontext, XPJobAttr, "xp-spooler-command-results"); + if( scr ) + { + if( strlen(scr) > 0 ) + { + const char *msg = XpuCompoundTextToXmb(pdpy, scr); + if( msg ) + { + Msg(("Spooler command returned '%s'.\n", msg)); + XpuFreeXmbString(msg); + } + else + { + Msg(("Spooler command returned '%s' (unconverted).\n", scr)); + } + } + + XFree((void *)scr); + } +} +#endif /* XPRINT */ #ifdef SIGNALRETURNSINT static int @@ -428,6 +549,8 @@ static char *help_message[] = { "where options include:", " -display the X server to contact", +" -printer name of printer to work on", +" -printfile output file for print job", " -sync do the tests in synchronous mode", " -pack pack rectangles right next to each other", " -repeat do tests times (default = 5)", @@ -790,6 +913,11 @@ double time, totalTime; int reps; int j; + + if (xp->pcontext) { + XpStartPage(xp->d, xp->w); + XpuWaitForPrintNotify(xp->d, xp->xp_event_base, XPStartPageNotify); + } xp->planemask = pm; CreatePerfGCs(xp, func, pm); @@ -808,7 +936,7 @@ */ if(reps == 0){ DestroyPerfGCs(xp); - return; + goto done; } /* Create clip windows if requested */ CreateClipWindows(xp, test->clips); @@ -836,6 +964,12 @@ printf ("\n"); fflush(stdout); DestroyPerfGCs(xp); + +done: + if (xp->pcontext) { + XpEndPage(xp->d); + XpuWaitForPrintNotify(xp->d, xp->xp_event_base, XPEndPageNotify); + } } /* ProcessTest */ #define Strstr strstr @@ -868,6 +1002,8 @@ xparms.pack = False; xparms.save_under = False; xparms.backing_store = NotUseful; + xparms.test_width = 0; /* set to 0 means: use default */ + xparms.test_height = 0; /* set to 0 means: use default */ /* Count number of tests */ ForEachTest(numTests); @@ -878,7 +1014,18 @@ displayName = Get_Display_Name (&argc, argv); xparms.version = GetVersion(&argc, argv); for (i = 1; i != argc; i++) { - if (strcmp (argv[i], "-all") == 0) { + if (strcmp (argv[i], "-printer") == 0) { + i++; + if (argc <= i) + usage (); + printerName = argv[i]; + } else if (strcmp (argv[i], "-printfile") == 0) { + i++; + if (argc <= i) + usage (); + printFilename = argv[i]; + } else + if (strcmp (argv[i], "-all") == 0) { ForEachTest (j) doit[j] = test[j].versions & xparms.version; foundOne = True; @@ -1109,8 +1256,26 @@ if (!foundOne) usage (); - xparms.d = Open_Display (displayName); - screen = DefaultScreen(xparms.d); + if (displayName && printerName) { + fprintf (stderr, "%s: You cannot specify -display and -printer at the name time\n", + program_name); + exit(1); + } + if (printerName) { + Open_Printer(printerName, printFilename); + } + else + { + xparms.d = Open_Display (displayName); + xparms.screen = DefaultScreenOfDisplay(xparms.d); + } + + screen = XScreenNumberOfScreen(xparms.screen); + if (xparms.test_width == 0 && + xparms.test_height == 0) { + xparms.test_width = 1200; + xparms.test_height = 1200; + } /* get visual info of default visual */ vmask = VisualIDMask | VisualScreenMask; @@ -1212,20 +1377,27 @@ AllocateColor(xparms.d, background, WhitePixel(xparms.d, screen)); xparms.ddbackground = AllocateColor(xparms.d, ddbackground, WhitePixel(xparms.d, screen)); - window_x = 2; - if (DisplayWidth(xparms.d, screen) < WIDTH + window_x + 1) - window_x = -1; - window_y = 2; - if (DisplayHeight(xparms.d, screen) < HEIGHT + window_y + 1) - window_y = -1; - xparms.w = CreatePerfWindow(&xparms, window_x, window_y, WIDTH, HEIGHT); - HSx = WIDTH-1; - if (window_x + 1 + WIDTH > DisplayWidth(xparms.d, screen)) + if (xparms.pcontext) { + window_x = xparms.test_x; + window_y = xparms.test_y - (20+5); /* -room_for_status_window */ + } + else + { + window_x = 2; + if (DisplayWidth(xparms.d, screen) < xparms.test_width + window_x + 1) + window_x = -1; + window_y = 2; + if (DisplayHeight(xparms.d, screen) < xparms.test_height + window_y + 1) + window_y = -1; + } + xparms.w = CreatePerfWindow(&xparms, window_x, window_y, xparms.test_width, xparms.test_height); + HSx = xparms.test_width-1; + if (window_x + 1 + xparms.test_width > DisplayWidth(xparms.d, screen)) HSx = DisplayWidth(xparms.d, screen) - (1 + window_x + 1); - HSy = HEIGHT-1; - if (window_y + 1 + HEIGHT > DisplayHeight(xparms.d, screen)) + HSy = xparms.test_height-1; + if (window_y + 1 + xparms.test_height > DisplayHeight(xparms.d, screen)) HSy = DisplayHeight(xparms.d, screen) - (1 + window_y + 1); - status = CreatePerfWindow(&xparms, window_x, HEIGHT+5, WIDTH, 20); + status = CreatePerfWindow(&xparms, window_x, xparms.test_height+5, xparms.test_width, 20); tgcv.foreground = AllocateColor(xparms.d, "black", BlackPixel(xparms.d, screen)); tgcv.background = @@ -1241,7 +1413,7 @@ software cursor machines it will slow graphics performance. On all current MIT-derived servers it will slow window creation/configuration performance. */ - XWarpPointer(xparms.d, None, status, 0, 0, 0, 0, WIDTH+32, 20+32); + XWarpPointer(xparms.d, None, status, 0, 0, 0, 0, xparms.test_width+32, 20+32); /* Figure out how long to call HardwareSync, so we can adjust for that in our total elapsed time */ @@ -1320,7 +1492,31 @@ /* Restore ScreenSaver to original state. */ XSetScreenSaver(xparms.d, ssTimeout, ssInterval, ssPreferBlanking, ssAllowExposures); - XCloseDisplay(xparms.d); + + if (xparms.pcontext) { + /* End the print job - the final results are sent by the X print + * server to the spooler sub system. + */ + XpEndJob(xparms.d); + XpuWaitForPrintNotify(xparms.d, xparms.xp_event_base, XPEndJobNotify); + Log(("end job.\n")); + + if (printFilename) { + if (XpuWaitForPrintFileChild(xparms.printtofile_handle) != XPGetDocFinished) { + fprintf(stderr, "%s: Error while printing to file.\n", program_name); + XpuClosePrinterDisplay(xparms.d, xparms.pcontext); + exit(1); + } + } + + PrintSpoolerCommandResults(xparms.d, xparms.pcontext); + + XpuClosePrinterDisplay(xparms.d, xparms.pcontext); + } + else + { + XCloseDisplay(xparms.d); + } free(saveargv); free(doit); exit(0); Index: x11perf.h =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/x11perf.h,v retrieving revision 1.3 diff -u -r1.3 x11perf.h --- x11perf.h 6 Aug 2004 23:42:11 -0000 1.3 +++ x11perf.h 22 Apr 2005 21:40:34 -0000 @@ -34,15 +34,21 @@ #if defined(XlibSpecificationRelease) && XlibSpecificationRelease >= 5 #include #endif +#ifdef XPRINT +#include +#endif + #include +/* Turn a NULL pointer string into an empty string */ +#define NULLSTR(x) (((x)!=NULL)?(x):("")) +#define Log(x) { printf x; } +#define Msg(x) { printf x; } + #define POLY 1000 /* # (small) items in poly calls */ #define MAXROWS 40 /* Max rows of items in poly calls */ #define MAXCOLS 25 /* Max columns of items */ -#define WIDTH 600 /* Size of large window to work within */ -#define HEIGHT 600 - #define CHILDSIZE 8 /* Size of children on windowing tests */ #define CHILDSPACE 4 /* Space between children */ @@ -74,6 +80,17 @@ typedef struct _XParms { Display *d; + Screen *screen; +#ifdef XPRINT + XPContext pcontext; + void *printtofile_handle; /* "context" when printing to file */ + int xp_event_base, /* XpExtension even base */ + xp_error_base; /* XpExtension error base */ +#endif + unsigned short test_x, + test_y; + unsigned long test_width, + test_height; Window w; Pixmap p; GC fggc; From gyoungdahl at sbcglobal.net Tue Apr 19 03:18:44 2005 From: gyoungdahl at sbcglobal.net (Greg Youngdahl) Date: Fri Apr 22 23:36:05 2005 Subject: [Xprint] GISWxprint-sparc-2004-07-07-release_009_001 Prints toolarge Message-ID: <4264B0D4.2010301@sbcglobal.net> Hello, Sorry for resorting to direct communications, but I've not had any luck discovering any resolution to my printing problem via web searches or forum queries. I'm hoping perhaps you can point me in a fruitful direction. I got this email address from clicking the heading of a topic that seems to be exactly the problem I'm having (the URL is: http://xprint.mozdev.org/pipermail/xprint/2004-October/000319.html ). This is from last October, and seems to be some discussion as to whether Xprint should make use of a CUPS printer description if available, or not. However it does nothing to address the problem for someone such as myself who can't print from Mozilla. The links from the quoted message point to information that suggests setting the print DPI value in the /etc/Xprint document file from 300 up to 600, however as far as I can tell I'm already at 600. That suggestion is categorized as a Workaround anyway, but the "Solution" of creating ones own model-config for Xprint has been difficult to find any resolution for as well. In some Xprint FAQ it seemed to have such a topic among its questions, but when I went to the associated answer it just had "XXXX", which I guess was a place holder to indicate that someday an answer would be provided. Although the comments in the above referenced discussion seem to indicate that I'm not the only one experiencing this issue, I guess it must not be a high running problem, since I'm having such trouble finding any information to help resolve it. Perhaps it is a printer specific issue, and I may have a rare printer? If any significant number of people were unable to print satisfactorily I'm sure there would be plenty of discussion and resolution information available. In case it matters... I'm running Debian Linux 2.4.27 with Mozilla 1.7.6 using CUPS for printer management. I've got a single printer, an HP business inkjet 1100. It all worked fine with an earlier version of Mozilla. However some previous upgrade (I think to 1.6 Mozilla) broke it, but I was lazy and took the quick and dirty work around of using Konquerer (the KDE browser) to open a web page when I needed to print, and took to saving email messages that needed printing and opening them up with Kmail to print. I had kind of hoped that the upgrade to 1.7 would fix the problem, but it hasn't and so I'm determined to find and fix the problem so I don't have to deal with that cumbersome workaround anymore. So, if you have any insights, or can point me to some online resources that can help, I'd really appreciate it. Thanks, -- Greg Youngdahl gyoungdahl@sbcglobal.net From James.Ashton at anu.edu.au Wed Apr 20 14:14:08 2005 From: James.Ashton at anu.edu.au (James.Ashton) Date: Fri Apr 22 23:36:12 2005 Subject: [Xprint] Blank pages on Canon ir3300i Message-ID: <4265C900.6040100@anu.edu.au> We're seeing this exact same problem here. I can use gs to view the documents and printers other than the Canon iR series (we have several of those) print fine. The Canons just print the correct number of blank pages with no error messages. Did you ever find out what the problem is? -- James Ashton T: +61 2 6125 8675 IT Manager F: +61 2 6125 8660 Research School of Information Sciences & Engineering W: http://rsise.anu.edu.au/~jaa/ Australian National University E: James.Ashton@anu.edu.au Canberra ACT 0200 Australia From Martin.Deppe at web.de Sun Apr 24 00:02:46 2005 From: Martin.Deppe at web.de (Martin Deppe) Date: Sat Apr 23 17:10:47 2005 Subject: [Xprint] Application printing using Xprint Message-ID: <426AB7F6.1060601@web.de> Dear Listmembers, I just subscribed to this list because I got xprint knowing a few days ago and tried to create little program using xprint to print something from inside my application. I have been looking for the documentation of the client functions and some sample source code. I found something, but nothing that really helped me to finish my little applictation successfully. I hope my "problem" is very easy to answer and the answer is as easy as the question. Maybe someone can point me to some sample source code in which a connection to the X print server is being established, some more initializations are done, a job is being started, a page is being opened, some output (such as text and - more important - graphics, such as lines and points) is being done and then everything that has been started is being completed so that the data can be show on my printer. What I found were some sources that needed GL-something, xpu-something, xpt-something or whatever, which I didn't have and didn't find. The xprintutils, which I downloaded didn't compile so that I couldn't use them as a blueprint for my own application. Here is the code I wanted to use to print some lines on the printer: ----------------------------------------------------------------------------------------------------------------------------- void printDrawing(void) { Display *pdsp; Window pwin; Screen *pScreen; XPContext pContext; XGCValues values; unsigned long valuemask = 0; GC gc; XRectangle rect; unsigned short width, height; int rc; if (!printingAvailable) { chkPrinter(0); return; } pdsp = XOpenDisplay(":33"); if (pdsp == NULL) { fprintf(stderr, "could not connect to X printserver (again)\n"); return; } pContext = XpCreateContext(pdsp, prtName); fprintf(stderr, "pContext=%d\n", pContext); XpSetContext(pdsp, pContext); // void XpSetContext() gc = XCreateGC(pdsp, pwin, valuemask, &values); fprintf(stderr, "XCreateGC()=%d\n", gc); // debug output if (gc < 0) fprintf(stderr, "XCreateGC failed - cannot process print request\n"); else { XpStartJob(pdsp, XPSpool); // void XpStartJob() fprintf(stderr, "XpStartJob()\n"); // debug output // Generate the first page pScreen = XpGetScreenOfContext(pdsp, pContext); fprintf(stderr, "XpGetScreen()=%d\n", pScreen); // debug output fprintf(stderr, "XpGetPageDimensions()=%d\n", XpGetPageDimensions(pdsp, pContext, &width, &height, &rect)); // debug output included pwin = XCreateSimpleWindow(pdsp, RootWindowOfScreen(pScreen), rect.x, rect.y, rect.width, rect.height, 2, BlackPixelOfScreen(pScreen), WhitePixelOfScreen(pScreen)); fprintf(stderr, "pwin=%d\n", pwin); // debug output XpStartPage(pdsp, pwin); fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 20, 20, 120, 120)); fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 120, 120, 20, 20)); fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 20, 20, 120, 20)); fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 20, 120, 120, 120)); XpEndPage(pdsp); XFreeGC(pdsp, gc); /* free the GC */ // End the print job - the final results are sent by the X print server to the spooler sub system. XpEndJob(pdsp); } XpDestroyContext(pdsp, pContext); XCloseDisplay(pdsp); } ----------------------------------------------------------------------------------------------------------------------------- I hope that the code is not to confusing and someone can tell me, why I get some response from the printer, but no page out of it. I could connect to the X print server and get a list of my available printers. I could start a job and a page, but I didn't get anything else out of the printer than the initialization of it, after which it simply stopped doing anything again, as if I wouldn't have done anything. The debug output of this code was: ----------------------------------------------------------------------------------------------------------------------------- pContext=2097153 XCreateGC()=134588832 1: X-Server Error code: BadDrawable (invalid Pixmap or Window parameter) XpStartJob() XpGetScreen()=134588368 XpGetPageDimensions()=1 pwin=2097155 XDrawLine=1 XDrawLine=1 XDrawLine=1 XDrawLine=1 2: X-Server Error code: BadGC (invalid GC parameter) 3: X-Server Error code: BadGC (invalid GC parameter) ----------------------------------------------------------------------------------------------------------------------------- Thank you in advance Martin From roland.mainz at nrubsig.org Sun Apr 24 00:31:34 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Sat Apr 23 17:39:22 2005 Subject: [Xprint] x11perf support for printer devices References: Message-ID: <426ABEB6.B16F2A40@nrubsig.org> Julien Lafon wrote: > I have spend some time to evaluate print job generation performance > and added support for printer devices to x11perf. It would be nice if > Roland or AlanC could comment on the patch here before I attach it to > a bugzilla rfe. OK.. some comments on the patch: -- snip -- > Index: Imakefile > =================================================================== > RCS file: /cvs/xorg/xc/programs/x11perf/Imakefile,v > retrieving revision 1.4 > diff -u -r1.4 Imakefile > --- Imakefile 11 Aug 2004 08:05:31 -0000 1.4 > +++ Imakefile 22 Apr 2005 21:40:21 -0000 > @@ -12,19 +12,24 @@ > #if HasShm > SHMDEFS = -DMITSHM > #endif > -#if BuildRenderLibrary > +#if xBuildRenderLibrary > XRENDERDEFS = -DXRENDER > XRENDERDEPS = $(DEPXRENDERLIB) > XRENDERLIBS = $(XRENDERLIB) > XRENDERINCS = $(XRENDERINCLUDES) > #endif > -#if BuildXftLibrary > +#if xBuildXftLibrary Uhm... is this debugging code or what ? [snip] > Index: do_blt.c > =================================================================== > RCS file: /cvs/xorg/xc/programs/x11perf/do_blt.c,v > retrieving revision 1.2 > diff -u -r1.2 do_blt.c > --- do_blt.c 23 Apr 2004 19:54:38 -0000 1.2 > +++ do_blt.c 22 Apr 2005 21:40:23 -0000 > @@ -36,29 +36,29 @@ > #define NegMod(x, y) ((y) - (((-x)-1) % (7)) - 1) > > static void > -InitBltLines(void) > +InitBltLines(XParms xp) > { > int i, x, y; > > points[0].x = points[0].y = y = 0; > for (i = 1; i != NUMPOINTS/2; i++) { > if (i & 1) { > - points[i].x = WIDTH-1; > + points[i].x = xp->test_width-1; > } else { > points[i].x = 0; > } > - y += HEIGHT / (NUMPOINTS/2); > + y += xp->test_height / (NUMPOINTS/2); > points[i].y = y; > } > > x = 0; > for (i = NUMPOINTS/2; i!= NUMPOINTS; i++) { > if (i & 1) { > - points[i].y = HEIGHT-1; > + points[i].y = xp->test_height-1; > } else { > points[i].y = 0; > } > - x += WIDTH / (NUMPOINTS/2); > + x += xp->test_width / (NUMPOINTS/2); > points[i].x = x; > } > } > @@ -66,7 +66,7 @@ > int > InitScroll(XParms xp, Parms p, int reps) > { > - InitBltLines(); > + InitBltLines(xp); > XDrawLines(xp->d, xp->w, xp->fggc, points, NUMPOINTS, CoordModeOrigin); > return reps; > } > @@ -93,18 +93,18 @@ > XCopyArea(xp->d, xp->w, xp->w, xp->fggc, x, y + delta, > size, size, x, y); > y += size; > - if (y + size + delta > HEIGHT) { > + if (y + size + delta > xp->test_height) { > yorg += delta; > - if (yorg >= size || yorg + size + delta > HEIGHT) { > + if (yorg >= size || yorg + size + delta > xp->test_height) { > yorg = 0; > xorg++; > - if (xorg >= size || xorg + size > WIDTH) { > + if (xorg >= size || xorg + size > xp->test_width) { > xorg = 0; > } > } > y = yorg; > x += size; > - if (x + size > WIDTH) { > + if (x + size > xp->test_width) { > x = xorg; > } > } > @@ -140,8 +140,8 @@ > xinc = (size & ~3) + 1; > yinc = xinc + 3; > > - width = (WIDTH - size) & ~31; > - height = (HEIGHT - size) & ~31; > + width = (xp->test_width - size) & ~31; > + height = (xp->test_height - size) & ~31; > > x1 = 0; > y1 = 0; > @@ -199,10 +199,10 @@ > (void) InitCopyWin(xp, p, reps); > > /* Create pixmap to write stuff into, and initialize it */ > - pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, xp->vinfo.depth); > + pix = XCreatePixmap(xp->d, xp->w, xp->test_width, xp->test_height, xp->vinfo.depth); > pixgc = XCreateGC(xp->d, pix, 0, 0); > /* need a gc with GXcopy cos pixmaps contain junk on creation. mmm */ > - XCopyArea(xp->d, xp->w, pix, pixgc, 0, 0, WIDTH, HEIGHT, 0, 0); > + XCopyArea(xp->d, xp->w, pix, pixgc, 0, 0, xp->test_width, xp->test_height, 0, 0); > XFreeGC(xp->d, pixgc); > return reps; > } > @@ -212,9 +212,12 @@ > { > (void) InitCopyWin(xp, p, reps); > > +#if 1 > +p->font=1; Another piece of debug code ? > /* Create image to stuff bits into */ > - image = XGetImage(xp->d, xp->w, 0, 0, WIDTH, HEIGHT, xp->planemask, > + image = XGetImage(xp->d, xp->w, 0, 0, xp->test_width, xp->test_height, xp->planemask, > p->font==0?ZPixmap:XYPixmap); > +#endif > if(image==0){ > printf("XGetImage failed\n"); > return False; > @@ -523,18 +526,18 @@ > XGCValues gcv; > GC pixgc; > > - InitBltLines(); > + InitBltLines(xp); > InitCopyLocations(xp, p, reps); > > /* Create pixmap to write stuff into, and initialize it */ > - pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, > + pix = XCreatePixmap(xp->d, xp->w, xp->test_width, xp->test_height, > p->font==0 ? 1 : xp->vinfo.depth); > gcv.graphics_exposures = False; > gcv.foreground = 0; > gcv.background = 1; > pixgc = XCreateGC(xp->d, pix, > GCForeground | GCBackground | GCGraphicsExposures, &gcv); > - XFillRectangle(xp->d, pix, pixgc, 0, 0, WIDTH, HEIGHT); > + XFillRectangle(xp->d, pix, pixgc, 0, 0, xp->test_width, xp->test_height); > gcv.foreground = 1; > gcv.background = 0; > XChangeGC(xp->d, pixgc, GCForeground | GCBackground, &gcv); [snip] > Index: do_tests.c > =================================================================== > RCS file: /cvs/xorg/xc/programs/x11perf/do_tests.c,v > retrieving revision 1.3 > diff -u -r1.3 do_tests.c > --- do_tests.c 6 Aug 2004 23:42:11 -0000 1.3 > +++ do_tests.c 22 Apr 2005 21:40:28 -0000 > @@ -925,85 +925,85 @@ > {"-ftext", "Char in 80-char line (6x13)", NULL, > InitText, DoText, ClearTextWin, EndText, > V1_2FEATURE, ROP, 0, > - {80, False, "6x13", NULL}}, > + {80, False, "-misc-fixed-medium-r-semicondensed--*-120-*-*-c-0-iso8859-1,6x13", NULL}}, Why are you replacing the XLFD names here ? > {"-f8text", "Char in 70-char line (8x13)", NULL, > InitText, DoText, ClearTextWin, EndText, > V1_3FEATURE, ROP, 0, > - {70, False, "8x13", NULL}}, > + {70, False, "-misc-fixed-medium-r-normal--*-120-*-*-c-0-iso8859-1,8x13", NULL}}, > {"-f9text", "Char in 60-char line (9x15)", NULL, > InitText, DoText, ClearTextWin, EndText, > V1_3FEATURE, ROP, 0, > - {60, False, "9x15", NULL}}, > + {60, False, "-misc-fixed-medium-r-normal--*-140-*-*-c-0-iso8859-1,9x15", NULL}}, > {"-f14text16", "Char16 in 40-char line (k14)", NULL, > InitText16, DoText16, ClearTextWin, EndText16, > V1_3FEATURE, ROP, 0, > {40, False, > - "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", > + "-misc-fixed-medium-r-normal--*-130-*-*-c-0-jisx0208.1983-*,-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", Shouldn't this "-misc-fixed-medium-r-normal--*-130-*-*-c-0-jisx0208.1983-*,k14" ? > NULL}}, > {"-f24text16", "Char16 in 23-char line (k24)", NULL, > InitText16, DoText16, ClearTextWin, EndText16, > V1_3FEATURE, ROP, 0, > {23, False, > - "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*", > + "-jis-fixed-medium-r-normal--*-230-*-*-c-0-jisx0208.1983-*,-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*", > NULL}}, See above... "...,k24" may be better.... > {"-tr10text", "Char in 80-char line (TR 10)", NULL, > InitText, DoText, ClearTextWin, EndText, > V1_2FEATURE, ROP, 0, > {80, False, > - "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", > + "-adobe-times-medium-r-normal--*-100-*-*-p-0-iso8859-1,-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", > NULL}}, ... and "...,tr10" ... > {"-tr24text", "Char in 30-char line (TR 24)", NULL, > InitText, DoText, ClearTextWin, EndText, > V1_2FEATURE, ROP, 0, > {30, False, > - "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", > + "-adobe-times-medium-r-normal--*-240-*-*-p-0-iso8859-1,-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", > NULL}}, ... and "...,tr24" ... > {"-polytext", "Char in 20/40/20 line (6x13, TR 10)", NULL, > InitText, DoPolyText, ClearTextWin, EndText, > V1_2FEATURE, ROP, 0, > {80, True, "6x13", > - "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1"}}, > + "-adobe-times-medium-r-normal--*-100-*-*-p-0-iso8859-1,6x13"}}, > {"-polytext16", "Char16 in 7/14/7 line (k14, k24)", NULL, > InitText16, DoPolyText16, ClearTextWin, EndText16, > V1_3FEATURE, ROP, 0, > {28, True, > - "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", > - "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*"}}, > + "-misc-fixed-medium-r-normal--*-130-*-*-c-0-jisx0208.1983-*,-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", > + "-jis-fixed-medium-r-normal--*-230-*-*-c-0-jisx0208.1983-*,-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*"}}, dito. > {"-fitext", "Char in 80-char image line (6x13)", NULL, > InitText, DoImageText, ClearTextWin, EndText, > V1_2FEATURE, PLANEMASK, 0, > - {80, False, "6x13", NULL}}, > + {80, False, "-misc-fixed-medium-r-semicondensed--*-120-*-*-c-0-iso8859-1,6x13", NULL}}, > {"-f8itext", "Char in 70-char image line (8x13)", NULL, > InitText, DoImageText, ClearTextWin, EndText, > V1_3FEATURE, PLANEMASK, 0, > - {70, False, "8x13", NULL}}, > + {70, False, "-misc-fixed-medium-r-normal--*-120-*-*-c-0-iso8859-1,8x13", NULL}}, > {"-f9itext", "Char in 60-char image line (9x15)", NULL, > InitText, DoImageText, ClearTextWin, EndText, > V1_3FEATURE, PLANEMASK, 0, > - {60, False, "9x15", NULL}}, > + {60, False, "-misc-fixed-medium-r-normal--*-140-*-*-c-0-iso8859-1,9x15", NULL}}, > {"-f14itext16", "Char16 in 40-char image line (k14)", NULL, > InitText16, DoImageText16, ClearTextWin, EndText16, > V1_3FEATURE, PLANEMASK, 0, > {40, False, > - "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", > + "-misc-fixed-medium-r-normal--*-130-*-*-c-0-jisx0208.1983-*,-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*", > NULL}}, > {"-f24itext16", "Char16 in 23-char image line (k24)", NULL, > InitText16, DoImageText16, ClearTextWin, EndText16, > V1_3FEATURE, PLANEMASK, 0, > {23, False, > - "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*", > + "-jis-fixed-medium-r-normal--*-230-*-*-c-0-jisx0208.1983-*,-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*", > NULL}}, > {"-tr10itext", "Char in 80-char image line (TR 10)", NULL, > InitText, DoImageText, ClearTextWin, EndText, > V1_2FEATURE, PLANEMASK, 0, > {80, False, > - "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", > + "-adobe-times-medium-r-normal--*-100-*-*-p-0-iso8859-1,-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", > NULL}}, > {"-tr24itext", "Char in 30-char image line (TR 24)", NULL, > InitText, DoImageText, ClearTextWin, EndText, > V1_2FEATURE, PLANEMASK, 0, > {30, False, > - "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", > + "-adobe-times-medium-r-normal--*-240-*-*-p-0-iso8859-1,-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", > NULL}}, > #ifdef XFT > {"-aa10text", "Char in 80-char aa line (Charter 10)", NULL, > Index: do_text.c > =================================================================== > RCS file: /cvs/xorg/xc/programs/x11perf/do_text.c,v > retrieving revision 1.2 > diff -u -r1.2 do_text.c > --- do_text.c 23 Apr 2004 19:54:38 -0000 1.2 > +++ do_text.c 22 Apr 2005 21:40:29 -0000 > @@ -35,6 +35,24 @@ > #define XPOS 20 > #define SEGS 3 > > +static > +XFontStruct *LoadQueryFontList(Display *d, char *list) > +{ > + char *s; > + XFontStruct *f; > + list = strdup(list); > + s = strtok(list, ","); Ewwww... hopeflly the code does not use |strtok()| from a calling function (|strtok()| uses a libc-internal global variable which prevents the nested usage of this function). |strtok_r()| may be better here, however that one is not available on all platforms. Your choice - either replace |strok()| with |strtok_r()| here and somehow add a compile-time check whether |strtok_r()| is available or add a small comment which warns about that nested usage may be harmfull (and check whether there are any other consumers in the x11perf codebase). > + while(s) > + { > + f = XLoadQueryFont(d, s); > + if (f) { > + free(list); > + return f; > + } > + s = strtok(NULL, ","); > + } > + return NULL; > +} > > int > InitText(XParms xp, Parms p, int reps) > @@ -43,7 +61,7 @@ > char ch; > XGCValues gcv; > > - font = XLoadQueryFont(xp->d, p->font); > + font = LoadQueryFontList(xp->d, p->font); > if (font == NULL) { > printf("Could not load font '%s', benchmark omitted\n", p->font); > return 0; > @@ -51,15 +69,15 @@ > > bfont = NULL; > if (p->bfont != NULL) { > - bfont = XLoadQueryFont(xp->d, p->bfont); > + bfont = LoadQueryFontList(xp->d, p->bfont); > if (bfont == NULL) { > printf("Could not load font '%s', benchmark omitted\n", p->bfont); > return 0; > } > } > > - ypos = XPOS; > height = (font->max_bounds.ascent + font->max_bounds.descent) + 1; > + ypos = XPOS+height; > if (bfont != NULL) { > int h = (bfont->max_bounds.ascent + bfont->max_bounds.descent) + 1; > if (h > height) > @@ -129,7 +147,7 @@ > int rows, columns, totalChars, ch; > int brows, bcolumns = 0, btotalChars = 0, bch = 0; > > - font = XLoadQueryFont(xp->d, p->font); > + font = LoadQueryFontList(xp->d, p->font); > if (font == NULL) { > printf("Could not load font '%s', benchmark omitted\n", p->font); > return 0; > @@ -142,7 +160,7 @@ > > bfont = NULL; > if (p->bfont != NULL) { > - bfont = XLoadQueryFont(xp->d, p->bfont); > + bfont = LoadQueryFontList(xp->d, p->bfont); > if (bfont == NULL) { > printf("Could not load font '%s', benchmark omitted\n", p->bfont); > return 0; > @@ -154,8 +172,8 @@ > if (brows > totalLines) totalLines = brows; > } > > - ypos = XPOS; > height = (font->max_bounds.ascent + font->max_bounds.descent) + 1; > + ypos = XPOS+height; > if (bfont != NULL) { > int h = (bfont->max_bounds.ascent + bfont->max_bounds.descent) + 1; > if (h > height) > @@ -230,9 +248,9 @@ > XDrawString( > xp->d, xp->w, xp->fggc, XPOS, ypos, charBuf[line], charsPerLine); > ypos += height; > - if (ypos > HEIGHT - height) { > + if (ypos > xp->test_height - height) { > /* Wraparound to top of window */ > - ypos = XPOS; > + ypos = XPOS+height; Why is this change needed ? [snip] > Index: do_windows.c > =================================================================== > RCS file: /cvs/xorg/xc/programs/x11perf/do_windows.c,v > retrieving revision 1.2 > diff -u -r1.2 do_windows.c > --- do_windows.c 23 Apr 2004 19:54:38 -0000 1.2 > +++ do_windows.c 22 Apr 2005 21:40:30 -0000 > @@ -50,8 +50,8 @@ > > ComputeSizes(xp, p); > > - parentcolumns = WIDTH / parentwidth; > - parentrows = HEIGHT / parentheight; > + parentcolumns = xp->test_width / parentwidth; > + parentrows = xp->test_height / parentheight; > parentwindows = parentcolumns * parentrows; /* Max reps we can fit */ > > if (parentwindows > reps) { > @@ -243,7 +243,7 @@ > 0, xp->foreground, xp->foreground); > #else > isolate = XCreateSimpleWindow( > - xp->d, xp->w, 0, 0, WIDTH, HEIGHT, > + xp->d, xp->w, 0, 0, xp->test_width, xp->test_height, > 0, xp->background, xp->background); What about the x/y coordinates ? Should they really be 0,0 in this case ? > ComputeSizes(xp, p); > Index: x11perf.c > =================================================================== > RCS file: /cvs/xorg/xc/programs/x11perf/x11perf.c,v > retrieving revision 1.2 > diff -u -r1.2 x11perf.c > --- x11perf.c 23 Apr 2004 19:54:38 -0000 1.2 > +++ x11perf.c 22 Apr 2005 21:40:33 -0000 > @@ -43,7 +43,9 @@ > /* Only for working on ``fake'' servers, for hardware that doesn't exist */ > static Bool drawToFakeServer = False; > static Pixmap tileToQuery = None; > -static char *displayName; > +static char *displayName, > + *printerName, > + *printFilename; > int abortTest; > > typedef struct _RopNames { char *name; int rop; } RopNameRec, *RopNamePtr; > @@ -393,6 +395,125 @@ > return(d); > } > > +#ifdef XPRINT > +static > +void Open_Printer(char *printer_name, char *print_file) > +{ > + long dpi_x = 0L, > + dpi_y = 0L; > + XPPrinterList plist = NULL; /* list of printers */ > + int plist_count; /* number of entries in |plist|-array */ > + unsigned short dummy; > + XRectangle winrect; > + > + plist = XpuGetPrinterList(printer_name, &plist_count); > + > + if (!plist) { > + fprintf(stderr, "%s: no printers found for printer spec \"%s\".\n", > + program_name, NULLSTR(printer_name)); > + exit(1); Ewww... three-space intendation ? Did you copy that code from "glxgears" ? Please use four if possible unless the matching code uses something else consistently (this is AFAIK only glxgears). > + } > + > + printer_name = plist[0].name; > + > + Log(("Using printer '%s'\n", printer_name)); > + > + if (XpuGetPrinter(printer_name, &xparms.d, &xparms.pcontext) != 1) { > + fprintf(stderr, "%s: Cannot open printer '%s'\n", program_name, printer_name); > + exit(1); You can use |exit(EXIT_FAILURE| here (that's plain ANSI-C89). > + } > + > + if (XpQueryExtension(xparms.d, &xparms.xp_event_base, &xparms.xp_error_base) == False) { > + fprintf(stderr, "%s: XpQueryExtension() failed.\n", program_name); > + XpuClosePrinterDisplay(xparms.d, xparms.pcontext); > + exit(1); dito. > + } > + > + /* Listen to XP(Start|End)(Job|Doc|Page)Notify events). > + * This is mantatory as Xp(Start|End)(Job|Doc|Page) functions are _not_ > + * syncronous !! > + * Not waiting for such events may cause that subsequent data may be > + * destroyed/corrupted!! > + */ > + XpSelectInput(xparms.d, xparms.pcontext, XPPrintMask); > + > + /* Set job title */ > + XpuSetJobTitle(xparms.d, xparms.pcontext, "x11perf/Xprint"); > + > + /* Set print context > + * Note that this modifies the available fonts, including builtin printer prints. > + * All XListFonts()/XLoadFont() stuff should be done _after_ setting the print > + * context to obtain the proper fonts. > + */ > + XpSetContext(xparms.d, xparms.pcontext); > + > + /* Get default printer reolution */ > + if (XpuGetResolution(xparms.d, xparms.pcontext, &dpi_x, &dpi_y) != 1) { > + fprintf(stderr, "%s: No default resolution for printer '%s'.\n", > + program_name, printer_name); > + XpuClosePrinterDisplay(xparms.d, xparms.pcontext); > + exit(1); dito. > + } > + > + if (print_file) { > + Log(("starting job (to file '%s').\n", print_file)); > + xparms.printtofile_handle = XpuStartJobToFile(xparms.d, xparms.pcontext, print_file); > + if( !xparms.printtofile_handle ) { > + fprintf(stderr, "%s: Error: %s while trying to print to file.\n", > + program_name, strerror(errno)); > + XpuClosePrinterDisplay(xparms.d, xparms.pcontext); > + exit(1); dito. > + } > + > + XpuWaitForPrintNotify(xparms.d, xparms.xp_event_base, XPStartJobNotify); > + } > + else > + { > + Log(("starting job.\n")); > + XpuStartJobToSpooler(xparms.d); > + XpuWaitForPrintNotify(xparms.d, xparms.xp_event_base, XPStartJobNotify); > + } > + > + xparms.screen = XpGetScreenOfContext(xparms.d, xparms.pcontext); I remember that x11perf uses |DefaultScreen()| very often... please check whether it's always using the correct screen (that will bite people when there is more than one active print driver per server (e.g. Xprt with PostScript+PCL+SVG screens)). > + > + /* Obtain some info about page geometry */ > + XpGetPageDimensions(xparms.d, xparms.pcontext, &dummy, &dummy, &winrect); > + > + if (xparms.test_width == 0 && > + xparms.test_height == 0) { > + xparms.test_x = winrect.x; > + xparms.test_y = winrect.y; > + xparms.test_width = winrect.width; > + xparms.test_height = winrect.height; Please check whether all window creations really use |test_x|/|test_y|. [snip] > #ifdef SIGNALRETURNSINT > static int > @@ -428,6 +549,8 @@ > static char *help_message[] = { > "where options include:", > " -display the X server to contact", > +" -printer name of printer to work on", > +" -printfile output file for print job", > " -sync do the tests in synchronous mode", > " -pack pack rectangles right next to each other", What about "-width" and "-height" options here ? > " -repeat do tests times (default = 5)", > @@ -790,6 +913,11 @@ > double time, totalTime; > int reps; > int j; > + > + if (xp->pcontext) { > + XpStartPage(xp->d, xp->w); > + XpuWaitForPrintNotify(xp->d, xp->xp_event_base, XPStartPageNotify); > + } > > xp->planemask = pm; > CreatePerfGCs(xp, func, pm); > @@ -808,7 +936,7 @@ > */ > if(reps == 0){ > DestroyPerfGCs(xp); > - return; > + goto done; > } > /* Create clip windows if requested */ > CreateClipWindows(xp, test->clips); > @@ -836,6 +964,12 @@ > printf ("\n"); > fflush(stdout); > DestroyPerfGCs(xp); > + > +done: > + if (xp->pcontext) { > + XpEndPage(xp->d); > + XpuWaitForPrintNotify(xp->d, xp->xp_event_base, XPEndPageNotify); > + } > } /* ProcessTest */ > > #define Strstr strstr > @@ -868,6 +1002,8 @@ > xparms.pack = False; > xparms.save_under = False; > xparms.backing_store = NotUseful; > + xparms.test_width = 0; /* set to 0 means: use default */ > + xparms.test_height = 0; /* set to 0 means: use default */ > > /* Count number of tests */ > ForEachTest(numTests); > @@ -878,7 +1014,18 @@ > displayName = Get_Display_Name (&argc, argv); > xparms.version = GetVersion(&argc, argv); > for (i = 1; i != argc; i++) { > - if (strcmp (argv[i], "-all") == 0) { > + if (strcmp (argv[i], "-printer") == 0) { > + i++; > + if (argc <= i) > + usage (); > + printerName = argv[i]; > + } else if (strcmp (argv[i], "-printfile") == 0) { > + i++; > + if (argc <= i) > + usage (); > + printFilename = argv[i]; > + } else > + if (strcmp (argv[i], "-all") == 0) { > ForEachTest (j) > doit[j] = test[j].versions & xparms.version; > foundOne = True; > @@ -1109,8 +1256,26 @@ > > if (!foundOne) > usage (); > - xparms.d = Open_Display (displayName); > - screen = DefaultScreen(xparms.d); > + if (displayName && printerName) { > + fprintf (stderr, "%s: You cannot specify -display and -printer at the name time\n", > + program_name); > + exit(1); > + } > + if (printerName) { > + Open_Printer(printerName, printFilename); > + } > + else > + { > + xparms.d = Open_Display (displayName); > + xparms.screen = DefaultScreenOfDisplay(xparms.d); Please use |XDefaultScreenOfDisplay| instead of |DefaultScreenOfDisplay| (|DefaultScreenOfDisplay| is a macro which uses semi-private fields in the Xlib structures and this behaviour should be avoided... we're no longer in 1980 where we can count the MIPS value of a CPU with the fingers of one hand... :) ... > + } > + > + screen = XScreenNumberOfScreen(xparms.screen); > + if (xparms.test_width == 0 && > + xparms.test_height == 0) { > + xparms.test_width = 1200; > + xparms.test_height = 1200; > + } > > /* get visual info of default visual */ > vmask = VisualIDMask | VisualScreenMask; > @@ -1212,20 +1377,27 @@ > AllocateColor(xparms.d, background, WhitePixel(xparms.d, screen)); > xparms.ddbackground = > AllocateColor(xparms.d, ddbackground, WhitePixel(xparms.d, screen)); > - window_x = 2; > - if (DisplayWidth(xparms.d, screen) < WIDTH + window_x + 1) > - window_x = -1; > - window_y = 2; > - if (DisplayHeight(xparms.d, screen) < HEIGHT + window_y + 1) > - window_y = -1; > - xparms.w = CreatePerfWindow(&xparms, window_x, window_y, WIDTH, HEIGHT); > - HSx = WIDTH-1; > - if (window_x + 1 + WIDTH > DisplayWidth(xparms.d, screen)) > + if (xparms.pcontext) { > + window_x = xparms.test_x; > + window_y = xparms.test_y - (20+5); /* -room_for_status_window */ > + } > + else > + { > + window_x = 2; > + if (DisplayWidth(xparms.d, screen) < xparms.test_width + window_x + 1) > + window_x = -1; > + window_y = 2; > + if (DisplayHeight(xparms.d, screen) < xparms.test_height + window_y + 1) > + window_y = -1; > + } > + xparms.w = CreatePerfWindow(&xparms, window_x, window_y, xparms.test_width, xparms.test_height); > + HSx = xparms.test_width-1; > + if (window_x + 1 + xparms.test_width > DisplayWidth(xparms.d, screen)) > HSx = DisplayWidth(xparms.d, screen) - (1 + window_x + 1); > - HSy = HEIGHT-1; > - if (window_y + 1 + HEIGHT > DisplayHeight(xparms.d, screen)) > + HSy = xparms.test_height-1; > + if (window_y + 1 + xparms.test_height > DisplayHeight(xparms.d, screen)) > HSy = DisplayHeight(xparms.d, screen) - (1 + window_y + 1); > - status = CreatePerfWindow(&xparms, window_x, HEIGHT+5, WIDTH, 20); > + status = CreatePerfWindow(&xparms, window_x, xparms.test_height+5, xparms.test_width, 20); Shouldn't this be |window_y+xparms.test_height+5| instead of |xparms.test_height+5| = > tgcv.foreground = > AllocateColor(xparms.d, "black", BlackPixel(xparms.d, screen)); > tgcv.background = > @@ -1241,7 +1413,7 @@ > software cursor machines it will slow graphics performance. On > all current MIT-derived servers it will slow window > creation/configuration performance. */ > - XWarpPointer(xparms.d, None, status, 0, 0, 0, 0, WIDTH+32, 20+32); > + XWarpPointer(xparms.d, None, status, 0, 0, 0, 0, xparms.test_width+32, 20+32); > > /* Figure out how long to call HardwareSync, so we can adjust for that > in our total elapsed time */ > @@ -1320,7 +1492,31 @@ > /* Restore ScreenSaver to original state. */ > XSetScreenSaver(xparms.d, ssTimeout, ssInterval, ssPreferBlanking, > ssAllowExposures); > - XCloseDisplay(xparms.d); > + > + if (xparms.pcontext) { > + /* End the print job - the final results are sent by the X print > + * server to the spooler sub system. > + */ > + XpEndJob(xparms.d); > + XpuWaitForPrintNotify(xparms.d, xparms.xp_event_base, XPEndJobNotify); > + Log(("end job.\n")); > + > + if (printFilename) { > + if (XpuWaitForPrintFileChild(xparms.printtofile_handle) != XPGetDocFinished) { > + fprintf(stderr, "%s: Error while printing to file.\n", program_name); > + XpuClosePrinterDisplay(xparms.d, xparms.pcontext); > + exit(1); |EXIT_FAILURE| ... [snip] > Index: x11perf.h > =================================================================== > RCS file: /cvs/xorg/xc/programs/x11perf/x11perf.h,v > retrieving revision 1.3 > diff -u -r1.3 x11perf.h > --- x11perf.h 6 Aug 2004 23:42:11 -0000 1.3 > +++ x11perf.h 22 Apr 2005 21:40:34 -0000 > @@ -34,15 +34,21 @@ > #if defined(XlibSpecificationRelease) && XlibSpecificationRelease >= 5 > #include > #endif > +#ifdef XPRINT > +#include > +#endif > + > #include > > +/* Turn a NULL pointer string into an empty string */ > +#define NULLSTR(x) (((x)!=NULL)?(x):("")) > +#define Log(x) { printf x; } > +#define Msg(x) { printf x; } Both |Log()| and |Msg()| should be made conditional or replaced with |fprintf(stderr, ...| in the x11perf cases unless there is more usage of them in the code... [snip] -- snip -- Other nits: - The status window of "x11perf" seems to use the "fixed" font. - The idea of making the test window width/height depending on the page size may be debateable as this may alter the test results of some DDX when the default page size/resolution differs. Either a "-width" and "-height" option may be usefull - or a "-pagesize" option... ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) From roland.mainz at nrubsig.org Sun Apr 24 00:59:36 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Sat Apr 23 18:07:16 2005 Subject: [Xprint] Application printing using Xprint References: <426AB7F6.1060601@web.de> Message-ID: <426AC548.C3B9C600@nrubsig.org> Martin Deppe wrote: > I just subscribed to this list because I got xprint knowing a few days > ago and tried to create little program using xprint to print something > from inside my application. > > I have been looking for the documentation of the client functions and > some sample source code. I found something, but nothing that really > helped me to finish my little applictation successfully. > > I hope my "problem" is very easy to answer and the answer is as easy as > the question. Maybe someone can point me to some sample source code in > which a connection to the X print server is being established, some more > initializations are done, a job is being started, a page is being > opened, some output (such as text and - more important - graphics, such > as lines and points) is being done and then everything that has been > started is being completed so that the data can be show on my printer. > > What I found were some sources that needed GL-something, xpu-something, > xpt-something or whatever, which I didn't have and didn't find. The > xprintutils, which I downloaded didn't compile so that I couldn't use > them as a blueprint for my own application. Which compile error did you get for the XprintUtils stuff ? > Here is the code I wanted to use to print some lines on the printer: > ----------------------------------------------------------------------------------------------------------------------------- > void printDrawing(void) > { > Display *pdsp; > Window pwin; > Screen *pScreen; > XPContext pContext; > XGCValues values; > unsigned long valuemask = 0; > GC gc; > XRectangle rect; > unsigned short width, height; > int rc; > > if (!printingAvailable) > { > chkPrinter(0); > return; > } > > pdsp = XOpenDisplay(":33"); Uhm... you may want to use the XprintUtils libraries's |XpuGetPrinter()| instead of |XOpenDisplay()| - the XprintUtils function parses the XPSERVLIST/LPDEST environment variables and returns a |Display *| and |XPContext| based on the name given as argument (if you don't give an argument it just uses the default printer as defined by |LPDEST|&co., otherwise the first printer in the list returns by the first Xprint server specified by XPSERVERLIST). The XprintUtils source can be found at http://cvs.freedesktop.org/xorg/xc/lib/XprintUtil/ (this is no dynamic library yet as the API is not stable (yet), just add it to your codebase... :) > if (pdsp == NULL) > { > fprintf(stderr, "could not connect to X printserver (again)\n"); > return; > } > > pContext = XpCreateContext(pdsp, prtName); > fprintf(stderr, "pContext=%d\n", pContext); > XpSetContext(pdsp, pContext); // void XpSetContext() > gc = XCreateGC(pdsp, pwin, valuemask, &values); |pwin| seems to be undefined at this point... that cannot work... > fprintf(stderr, "XCreateGC()=%d\n", gc); // debug output > if (gc < 0) > fprintf(stderr, "XCreateGC failed - cannot process print request\n"); Uhm... AFAIK this should be |gc == 0| (or |gc == None| - which is the same) ... > else > { > XpStartJob(pdsp, XPSpool); // void XpStartJob() > fprintf(stderr, "XpStartJob()\n"); // debug output > > // Generate the first page > pScreen = XpGetScreenOfContext(pdsp, pContext); > fprintf(stderr, "XpGetScreen()=%d\n", pScreen); // debug output > fprintf(stderr, "XpGetPageDimensions()=%d\n", > XpGetPageDimensions(pdsp, pContext, &width, &height, &rect)); // debug > output included > pwin = XCreateSimpleWindow(pdsp, RootWindowOfScreen(pScreen), > rect.x, rect.y, rect.width, rect.height, 2, > BlackPixelOfScreen(pScreen), > WhitePixelOfScreen(pScreen)); > fprintf(stderr, "pwin=%d\n", pwin); // debug output > > XpStartPage(pdsp, pwin); > fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 20, > 20, 120, 120)); > fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 120, > 120, 20, 20)); > fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 20, > 20, 120, 20)); > fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 20, > 120, 120, 120)); > > XpEndPage(pdsp); > XFreeGC(pdsp, gc); /* free the GC */ > > // End the print job - the final results are sent by the X print > server to the spooler sub system. > XpEndJob(pdsp); AFAIK you should always wait here for the |XPEndJobNotify| event - otherwise the |XpDestroyContext()| may kill the print job while it is being prepared for spooling. Normally the sequence looks like this: -- snip -- XpEndJob(xparms.d); XpuWaitForPrintNotify(xparms.d, xparms.xp_event_base, XPEndJobNotify); XpDestroyContext() -- snip -- > } > XpDestroyContext(pdsp, pContext); > XCloseDisplay(pdsp); > } > ----------------------------------------------------------------------------------------------------------------------------- > > I hope that the code is not to confusing and someone can tell me, why I > get some response from the printer, but no page out of it. See above - you created an invalid GC which could not be used afterwards. Additionally you didn't wait for print job completion which may lead to a race condition - depending on the time the finalisation needed you may not get a print job delivered to the printer (I've seen that with Hitatchis Xprint server where the OpenGL engine runs in a seperate thread and therefore the GL rendering may complete async to the main server rendering). > I could connect to the X print server and get a list of my available > printers. I could start a job and a page, but I didn't get anything else > out of the printer than the initialization of it, after which it simply > stopped doing anything again, as if I wouldn't have done anything. > > The debug output of this code was: > ----------------------------------------------------------------------------------------------------------------------------- > pContext=2097153 > XCreateGC()=134588832 > 1: X-Server Error code: BadDrawable (invalid Pixmap or Window parameter) The bad thing happens here already with the GC... > XpStartJob() > XpGetScreen()=134588368 > XpGetPageDimensions()=1 > pwin=2097155 > XDrawLine=1 > XDrawLine=1 > XDrawLine=1 > XDrawLine=1 > 2: X-Server Error code: BadGC (invalid GC parameter) > 3: X-Server Error code: BadGC (invalid GC parameter) > ----------------------------------------------------------------------------------------------------------------------------- BTW: See http://cvs.freedesktop.org/xorg/xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c?rev=1.4&view=markup for the source code of a similar example... ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) From roland.mainz at nrubsig.org Sun Apr 24 04:29:28 2005 From: roland.mainz at nrubsig.org (Roland Mainz) Date: Sat Apr 23 21:37:00 2005 Subject: [Xprint] Application printing using Xprint References: <426AB7F6.1060601@web.de> <426AC548.C3B9C600@nrubsig.org> Message-ID: <426AF678.2E344F18@nrubsig.org> Roland Mainz wrote: > Martin Deppe wrote: > > I just subscribed to this list because I got xprint knowing a few days > > ago and tried to create little program using xprint to print something > > from inside my application. > > > > I have been looking for the documentation of the client functions and > > some sample source code. I found something, but nothing that really > > helped me to finish my little applictation successfully. [snip] I have modified your test application to get it working here: -- snip -- % gcc martin_deppe_xprinttest001.c -L/usr/X11R6/lib -lXp -lXext -lX11 % ./a.out pContext=2097153 XpStartJob() XpGetScreen()=134521544 XpGetPageDimensions()=1 pwin=2097154 XCreateGC()=134522384 XDrawLine=1 XDrawLine=1 XDrawLine=1 XDrawLine=1 -- snip -- Souce code is attached as "martin_deppe_xprinttest001.c" to this email... ... I hope that helps you a little bit... :) ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;) -------------- next part -------------- #include #include #include #include typedef struct IsNotifyEventContext_ { int event_base; int detail; } IsNotifyEventContext; static Bool IsXpNotifyEvent( Display *pdpy, XEvent *ev, XPointer arg ) { Bool match; IsNotifyEventContext *context = (IsNotifyEventContext *)arg; XPPrintEvent *pev = (XPPrintEvent *)ev; match = pev->type == (context->event_base+XPPrintNotify) && pev->detail == context->detail; return match; } void WaitForPrintNotify( Display *pdpy, int xp_event_base, int detail ) { XEvent dummy; IsNotifyEventContext matchcontext; matchcontext.event_base = xp_event_base; matchcontext.detail = detail; XIfEvent(pdpy, &dummy, IsXpNotifyEvent, (XPointer)&matchcontext); } int main(int ac, char **av) { Display *pdsp; Window pwin; Screen *pScreen; int xp_event_base, /* XpExtension even base */ xp_error_base; /* XpExtension error base */ XPContext pContext; XGCValues values; unsigned long valuemask = 0; GC gc; XRectangle rect; unsigned short width, height; int rc; pdsp = XOpenDisplay(":35"); if (pdsp == NULL) { fprintf(stderr, "could not connect to X printserver (again)\n"); exit(EXIT_FAILURE); } if( XpQueryExtension(pdsp, &xp_event_base, &xp_error_base) == False ) { fprintf(stderr, "XpQueryExtension() failed.\n"); exit(EXIT_FAILURE); } pContext = XpCreateContext(pdsp, "xp_ps_spooldir_tmp_Xprintjobs"); fprintf(stderr, "pContext=%d\n", pContext); /* Listen to XP(Start|End)(Job|Doc|Page)Notify events). * This is mantatory as Xp(Start|End)(Job|Doc|Page) functions are _not_ * syncronous !! * Not waiting for such events may cause that subsequent data may be * destroyed/corrupted!! */ XpSelectInput(pdsp, pContext, XPPrintMask); XpSetContext(pdsp, pContext); // void XpSetContext() XpStartJob(pdsp, XPSpool); // void XpStartJob() fprintf(stderr, "XpStartJob()\n"); // debug output WaitForPrintNotify(pdsp, xp_event_base, XPStartJobNotify); // Generate the first page pScreen = XpGetScreenOfContext(pdsp, pContext); fprintf(stderr, "XpGetScreen()=%d\n", pScreen); // debug output fprintf(stderr, "XpGetPageDimensions()=%d\n", XpGetPageDimensions(pdsp, pContext, &width, &height, &rect)); // debug output included pwin = XCreateSimpleWindow(pdsp, XRootWindowOfScreen(pScreen), rect.x, rect.y, rect.width, rect.height, 2, XBlackPixelOfScreen(pScreen), XWhitePixelOfScreen(pScreen)); fprintf(stderr, "pwin=%d\n", pwin); // debug output gc = XCreateGC(pdsp, pwin, valuemask, &values); fprintf(stderr, "XCreateGC()=%d\n", gc); // debug output XpStartPage(pdsp, pwin); WaitForPrintNotify(pdsp, xp_event_base, XPStartPageNotify); fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 20, 20, 120, 120)); fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 120, 120, 20, 20)); fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 20, 20, 120, 20)); fprintf(stderr, "XDrawLine=%d\n", XDrawLine(pdsp, pwin, gc, 20, 120, 120, 120)); XpEndPage(pdsp); WaitForPrintNotify(pdsp, xp_event_base, XPEndPageNotify); XFreeGC(pdsp, gc); /* free the GC */ // End the print job - the final results are sent by the X print server to the spooler sub system. XpEndJob(pdsp); WaitForPrintNotify(pdsp, xp_event_base, XPEndJobNotify); XpDestroyContext(pdsp, pContext); XCloseDisplay(pdsp); return EXIT_SUCCESS; } From Martin.Deppe at web.de Sun Apr 24 13:44:59 2005 From: Martin.Deppe at web.de (Martin Deppe) Date: Sun Apr 24 06:52:56 2005 Subject: [Xprint] Application printing using Xprint In-Reply-To: <426AF678.2E344F18@nrubsig.org> References: <426AB7F6.1060601@web.de> <426AC548.C3B9C600@nrubsig.org> <426AF678.2E344F18@nrubsig.org> Message-ID: <426B78AB.1040905@web.de> An HTML attachment was scrubbed... URL: http://mozdev.org/pipermail/xprint/attachments/20050424/423bd0ae/attachment.htm From julien.lafon at gmail.com Mon Apr 25 17:38:04 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Mon Apr 25 10:45:41 2005 Subject: [Xprint] Re: Improving glXSwapBuffers performace In-Reply-To: <425A8B05.6090008@tungstengraphics.com> References: <9a9b8bd3050410221040e2030f@mail.gmail.com> <425A8B05.6090008@tungstengraphics.com> Message-ID: On 4/11/05, Brian Paul wrote: > Simon Toedt wrote: > > Has anyone yet looked into ways to improve rendering performance? I > > have noticed that glXSwapBuffers() is slow (30secs +/-5secs on a > > P3/600Mhz) and mainly spends its time in PsOutImageBytes() which calls > > sprintf() in a tight loop: > > (gdb) where > > #0 PsOut_OutImageBytes (self=0x8c91ed0, nBytes=3, bytes=0xbfffec7d > > "") at psout.c:1488 > > #1 0x080d63af in PsPutScaledImage (pDrawable=0x8a69eb0, > > pGC=0x8c6f640, depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, > > format=2, imageRes=0, > > pImage=0x4066e008 "") at PsArea.c:157 > > #2 0x080d6a79 in PsPutImage (pDrawable=0x8a69eb0, pGC=0x8c6f640, > > depth=24, x=0, y=0, w=9321, h=13431, leftPad=0, format=2, > > pImage=0x4066e008 "") at PsArea.c:332 > > #3 0x08291717 in XMesaSwapBuffers (b=0x4063d008) at xm_api.c:2391 > > #4 0x0828dca9 in __MESA_swapBuffers (glxPriv=0x8c6f178) at xf86glx.c:736 > > #5 0x0825a00f in __glXSwapBuffers (cl=0x8a69c60, pc=0x8c90a40 > > "\220\v\003") at glxcmds.c:1340 > > #6 0x082300ff in __glXDispatch (client=0x8a647b0) at glxext.c:435 > > #7 0x08083b69 in Dispatch () at dispatch.c:449 > > #8 0x0806a790 in main (argc=8, argv=0xbffff2a4, envp=0xbffff2c8) at main.c:439 > > #9 0x400e48ae in __libc_start_main () from /lib/libc.so.6 > > Well, at line 2391 of xm_api.c, XMesaXPutImage() is being called. > That's a macro: > > #define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ > do { \ > /* Assumes: Images are always in ZPixmap format */ \ > (void) __d; \ > if (__sx || __sy) /* The non-trivial case */ \ > XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \ > ValidateGC(__b, __gc); \ > (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ > __x, __y, __w, __h, 0, ZPixmap, \ > ((XMesaImage *)(__i))->data); \ > } while (0) > > The PsPutImage() function is an internal server function in the Xprint > module. I have no idea why that would be getting called. If the application uses the GL software renderer then PutImage calls PsPutImage to push image dumps to the printer. If the Postscript GL driver is used then vector data are generated from the 3D scene. Both paths have their pro and cons... the software renderer has more GL features and generates plain images, the Postscript renderer is faster, generates scalable vector output but the Postscript code size increases with the scene complexity. Julien -- Julien Lafon Senior Staff Engineer, Hitachi From julien.lafon at gmail.com Mon Apr 25 17:39:39 2005 From: julien.lafon at gmail.com (Julien Lafon) Date: Mon Apr 25 10:47:54 2005 Subject: [Xprint] Application printing using Xprint In-Reply-To: <426AC548.C3B9C600@nrubsig.org> References: <426AB7F6.1060601@web.de> <426AC548.C3B9C600@nrubsig.org> Message-ID: On 4/23/05, Roland Mainz wrote: > Additionally you didn't wait for print job completion which > may lead to a race condition - depending on the time the finalisation > needed you may not get a print job delivered to the printer (I've seen > that with Hitatchis Xprint server where the OpenGL engine runs in a > seperate thread and therefore the GL rendering may complete async to the > main server rendering). Is it always required for the application to wait for the print events? The GL thing was a bug in the SGI code which triggered the GL scene rendering sporadically after XpEndPage and before the next page. Julien -- Julien Lafon Senior Staff Engineer, Hitachi