Xprt "no screens found" error pinpointed: unified vs print-only

Drew Parsons dparsons at debian.org
Thu Nov 10 15:58:12 PST 2005


As I've reported earlier, a CVS build of Xprt (xserver/xorg module,
autogen.sh --enable-xprint) fails to run, complaining:

Fatal server error:   
no screens found

I've dug further and learnt why this error was happening. The error
arises in xorg/dix/main.c, around l.11783:


        InitOutput(&screenInfo, argc, argv);
#ifdef XPRINT
        PrinterInitOutput(&screenInfo, argc, argv);
#endif

        if (screenInfo.numScreens < 1)
            FatalError("no screens found");


The error is a subtlety related to whether a print-only server or a
unified video+print server is being built.  InitOutput() is defined in
the ddx submodule.  In the case of unified video+print (if I understand
it correctly), the ddx is video so InitOutput will not define a print
screen.  In that case XPRINT needs to be defined, and then
PrinterInitOutput() gets called, defining a print screen.

At the moment --enable-xprint implies a print-only server. Therefore
XPRINT is not defined and PrinterInitOutput() is not called by
dix/main.c.  Instead PRINT_ONLY_SERVER is defined (Xprt_CFLAGS in
Xprint/Makefile.am) and the Xprint ddx is used to define InitOutput, in
Xprint/ddxInit.c.

The problem then, is that ddxInit.c has changed in 6.9. Its definition
for InitOutput() in 6.8.2 was:

void
InitOutput(
    ScreenInfo   *pScreenInfo,
    int          argc,
    char         **argv)

{
    int i;

    pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
    pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
    pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
    pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;

    pScreenInfo->numPixmapFormats = 0; /* get them in PrinterInitOutput
*/
    screenInfo.numVideoScreens = 0;
#ifdef PRINT_ONLY_SERVER
    PrinterInitOutput(pScreenInfo, argc, argv);
#endif
}



In 6.9/7.0 this has been changed to
void 
InitOutput(
    ScreenInfo   *pScreenInfo,
    int          argc,
    char         **argv)

{
    int i;

    pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
    pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
    pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
    pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;

    pScreenInfo->numPixmapFormats = 0; /* get them in PrinterInitOutput */
    screenInfo.numVideoScreens = 0;
}


Note how the conditional print-server-only call to PrinterInitOutput()
has been removed.


The change occurred in a patch made by Roland Mainz and Julien Lafon in
March 2005 (to v1.5 of ddxInit.c). The log says this was done to 
"Fix build bustage when |PrintOnlyServer| is set to |NO|", see
http://cvs.freedesktop.org/xorg/xc/programs/Xserver/Xprint/ddxInit.c?rev=1.7&view=log

I don't know about the other changes made in 1.5 done for the unified
server, but this particular one with respect to PrinterInitOutput()
called in InitOutput() doesn't seem to be helping.  The extra line is,
I gather, only called when |PrintOnlyServer| is |YES| and so shouldn't
affect behaviour when it is |NO|.


When I reinstate the excised lines, then Xprt starts to run, now having
a screen to work with.

A patch to do this looks like:

===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ddxInit.c,v
retrieving revision 1.7
diff -u -r1.7 ddxInit.c
--- ddxInit.c   3 Jul 2005 07:01:09 -0000       1.7
+++ ddxInit.c   10 Nov 2005 23:51:34 -0000
@@ -85,6 +85,11 @@

     pScreenInfo->numPixmapFormats = 0; /* get them in PrinterInitOutput */
     screenInfo.numVideoScreens = 0;
+
+#ifdef PRINT_ONLY_SERVER
+    PrinterInitOutput(pScreenInfo, argc, argv);
+#endif
+
 }



I'm cc:ing Julien so he can review why these lines were removed, and
perhaps put them back in again.

Thanks,

Drew




p.s. 

solving this problem just leads us to the next one, of course :) 

I set a symlink from /opt/xorg-modular/X11/xserver to
/usr/share/Xprint/xserver/, where my current Xprint configuration files
lay.  Then when I run Xprt, it fails with:

Xp Extension: Can't load driver XP-POSTSCRIPT
              init function missing
Xp Extension: Can't load driver XP-POSTSCRIPT
              init function missing
Xp Extension: Can't load driver XP-POSTSCRIPT
              init function missing
Xp Extension: Can't load driver XP-POSTSCRIPT
              init function missing
Xp Extension: Can't load driver XP-POSTSCRIPT
              init function missing
Xp Extension: Can't load driver XP-POSTSCRIPT
              init function missing
Xp Extension: Can't load driver XP-POSTSCRIPT
              init function missing
Segmentation fault

So on to the next piece of the puzzle...



More information about the xorg-modular mailing list