RE: [info-performer] Multipipe Initialization

Date view Thread view Subject view Author view

From: Christopher D. Johnson (cubicwts++at++excite.com)
Date: 10/07/2005 07:11:51


I have at least gotten a version of my code working that initializes using 1 pipe, 2 windows, and the lower screen. I am wondering that, since I have this working, should I just reconfigure my system to see both screens as one "screen", as this seems to be giving me the results I want when I experimented on the lower LCD only and left the upper LCD out of the equation. Do any of you know if once I go the "one screen over 2 LCDs" route if my calls for glRasterPositions that will be in the "lower" window will be affected by the "one-screen" system change, ie, are calls of that nature window relative or screen relative? Technically my "screen" will now be twice as big as before but my windows will still be positioned so that they appear on the proper LCD.

Here is how I'm getting it to work as 2 windows, one pipe, one screen. I'm leaving the upper LCD out of the equation until the system is reconfigured to see both LCD's as one "screen". Can any of you direct me to any good documentation as to how to get that accomplished in a Fedore Core 3 environment?

static void
initPerformer(void)
{
   void *arena = NULL;
   pfSharedArenaSize(134217728); /* 128 * 1024 * 1024 = 128 Mb */
   // pfSharedArenaSize(167772160); /* 160 * 1024 * 1024 = 128 Mb */
   // pfSharedArenaSize(268435456); /* 256 * 1024 * 1024 = 256 Mb */
   pfInit();
   arena = pfGetSharedArena();

   /* Allocate Global Variables */
   mttGlobal = pfMalloc(sizeof(global_t), arena);
   MttGfx = pfMalloc(sizeof( MTTGFX ), arena);
   c_ = pfMalloc(sizeof( struct ForCComm ), arena);
   ntReq = pfMalloc(sizeof(NTREQ), arena);

   Client = pfMalloc(sizeof( CLIENT ), arena);
   BBoxTerrain = pfMalloc(sizeof ( pfBox ), arena);

   /* initialize global values */
   initGlobal();

   /*------------------------------------------------------
    * Initialize main Gfx variables.
    *-----------------------------------------------------*/
   initGfx();
   readConfigFile();

   // pfMultiprocess(PFMP_DEFAULT);
   pfMultiprocess(PFMP_FORK_DBASE | PFMP_FORK_LPOINT);
   pfMultipipe(1);

   // scb - uncommented Multithread(...)
   /* pfMultithread(0, PFPROC_CULL, 2); */

   pfdInitConverter("flt");
   pfConfig();
   pfFilePath( "../data/");
   pfNotifyLevel(PFNFY_FATAL);
#ifdef GFXAUTOSYNC
   pfFrameRate(MttGfx->FrameRate);
   pfPhase(PFPHASE_LOCK);
#endif
}

static void OpenPipeWin(pfPipeWindow *pwin)
{
   pfOpenPWin(pwin);
}

static void
initPipeWindow(void)
{
   int constraints[] = {
      PFFB_DOUBLEBUFFER,
      PFFB_RGBA,
      PFFB_RED_SIZE, 5,
      PFFB_GREEN_SIZE, 5,
      PFFB_BLUE_SIZE, 5,

      PFFB_ALPHA_SIZE, 1,
      PFFB_STENCIL_SIZE, 8,
      PFFB_DEPTH_SIZE, 15,
      (int)NULL
   };
   /*------------------------------------------------------
    * Configure graphics pipeline.
    *-----------------------------------------------------*/
   mttGlobal->gfxPipeLOWER = pfGetPipe(0);
   if (!(mttGlobal->gfxPipeLOWER)) {
      fprintf(stderr, "ERROR: Unable to initialize LOWER (pfPipe *)!\n");
      abort();
   }
   /*mttGlobal->gfxPipeUPPER = pfGetPipe(1);
   if (!(mttGlobal->gfxPipeUPPER)) {
      fprintf(stderr, "ERROR: Unable to initialize UPPER (pfPipe *)!\n");
      abort();
   }*/
   
   pfPipeScreen(mttGlobal->gfxPipeLOWER,0);
   /*pfPipeScreen(mttGlobal->gfxPipeUPPER,1);*/
   
   mttGlobal->pwinLOWER = pfNewPWin(mttGlobal->gfxPipeLOWER);
   if (!(mttGlobal->pwinLOWER)) {
      fprintf(stderr, "ERROR: Unable to initialize LOWER(pfWindow *)!\n");
      abort();
   }
   mttGlobal->pwinUPPER = pfNewPWin(mttGlobal->gfxPipeLOWER);
   if (!(mttGlobal->pwinUPPER)) {
      fprintf(stderr, "ERROR: Unable to initialize UPPER(pfWindow *)!\n");
      abort();
   }
   
   pfPWinShare(mttGlobal->pwinLOWER,PFWIN_SHARE_GL_OBJS);
   pfPWinShare(mttGlobal->pwinUPPER,PFWIN_SHARE_GL_OBJS);
   pfAttachPWin(mttGlobal->pwinLOWER,mttGlobal->pwinUPPER);
   
   pfPWinName(mttGlobal->pwinLOWER,MttGfx->ScreenLOWER.Name);
   pfPWinType(mttGlobal->pwinLOWER, PFWIN_TYPE_X);
   pfPWinMode( mttGlobal->pwinLOWER, PFWIN_NOBORDER, 1);
   pfPWinConfigFunc( mttGlobal->pwinLOWER, OpenPipeWin);
   pfChoosePWinFBConfig( mttGlobal->pwinLOWER, constraints);
   pfConfigPWin( mttGlobal->pwinLOWER );
   pfPWinOriginSize(mttGlobal->pwinLOWER, 0, 0,
      MttGfx->ScreenLOWER.SizeW,
      MttGfx->ScreenLOWER.SizeH);
   pfOpenPWin(mttGlobal->pwinLOWER);
   
   pfPWinName(mttGlobal->pwinUPPER,MttGfx->ScreenUPPER.Name);
   pfPWinType(mttGlobal->pwinUPPER, PFWIN_TYPE_X);
   pfPWinMode( mttGlobal->pwinUPPER, PFWIN_NOBORDER, 1);
   pfPWinConfigFunc( mttGlobal->pwinUPPER, OpenPipeWin);
   pfChoosePWinFBConfig( mttGlobal->pwinUPPER, constraints);
   pfConfigPWin( mttGlobal->pwinUPPER );
   pfPWinOriginSize(mttGlobal->pwinUPPER, 0, 0,
      MttGfx->ScreenUPPER.SizeW,
      MttGfx->ScreenUPPER.SizeH);
   pfOpenPWin(mttGlobal->pwinUPPER);
   
   /* set off the draw process to open windows and call init callbacks */
   pfFrame();
   sleep(3);
   
   pfPWinFullScreen( mttGlobal->pwinLOWER );
   pfPWinFullScreen( mttGlobal->pwinUPPER );
   
   dsp = mttGlobal->dsp = pfGetCurWSConnection();
   mttGlobal->winLOWER = pfGetPWinWSWindow(mttGlobal->pwinLOWER);
   XSelectInput(mttGlobal->dsp,mttGlobal->winLOWER,KeyPressMask | ButtonPressMask );
   XMapWindow(mttGlobal->dsp,mttGlobal->winLOWER);
   XSync(mttGlobal->dsp,FALSE);

   /*------------------------------------------------------
    * Remove cursor arrow.
    *-----------------------------------------------------*/
#ifndef TESTMTT
   pfuLoadPWinCursor(mttGlobal->pwinLOWER, PFU_CURSOR_OFF);
#endif
}

Christopher D. Johnson
AV-8B Harrier II Simulators
ISEO Support Team
Cherry Point, NC
252-466-4542
252-466-4538

 --- On Fri 10/07, Dick Rous < dick++at++sgi.com > wrote:
From: Dick Rous [mailto: dick++at++sgi.com]
To: paolo++at++sgi.com, cubicwts++at++excite.com
     Cc: info-performer++at++sgi.com
Date: Fri, 7 Oct 2005 11:14:10 +0100
Subject: RE: [info-performer] Multipipe Initialization

Hi Christopher,<br><br>You also might check your multi-processing mode.<br>Your call to pfMultiprocess (pfMultiprocess(PFMP_FORK_DBASE |<br>PFMP_FORK_LPOINT);), means that you do not fork the CULL and DRAW<br>processes, a must for dealing with multiple screens. <br>Try pfMultiprocess(PFMP_APP_CULL_DRAW | PFMP_FORK_DBASE |<br>PFMP_FORK_LPOINT);<br><br>My .02 euro.<br><br>Dick.<br><br>> -----Original Message-----<br>> From: owner-info-performer++at++performer.engr.sgi.com <br>> [mailto:owner-info-performer++at++performer.engr.sgi.com] On <br>> Behalf Of Paolo Farinelli<br>> Sent: Thursday, October 06, 2005 21:39<br>> To: Christopher D. Johnson<br>> Cc: info-performer++at++sgi.com<br>> Subject: Re: [info-performer] Multipipe Initialization<br>> <br>> <br>> Hi Christopher,<br>> <br>> What happens if you try to run 'perfly esprit.pfb' on<br>> your system when it is configured as 2 X-screens?<br>> <br>> If perfly does not work, pls set PFNFYLEVEL to 8 and<br>> collect some output for me to look
at. If possible,<br>> you could also try to grab some call-stack data<br>> using gdb.<br>> <br>> If perfly does work, then I suggest you strip down<br>> your application code to the bare minimum and work your<br>> way up to see where things start breaking.<br>> In particular, the Xcalls you make in the APP process<br>> look suspicious:<br>> <br>> > XSelectInput(mttGlobal->dsp,mttGlobal->winLOWER,KeyPressMask | <br>> > ButtonPressMask );<br>> > XMapWindow(mttGlobal->dsp,mttGlobal->winLOWER);<br>> > XSync(mttGlobal->dsp,FALSE);<br>> <br>> Let me know how it goes.<br>> Regards,<br>> Paolo<br>> <br>> <br>> <br>> On Thu, 6 Oct 2005 14:01:20 -0400 (EDT), Christopher D. Johnson <br>> <cubicwts++at++excite.com> wrote:<br>> <br>> ><br>> > Jason-<br>> ><br>> > I am going to take a step back from my "multiscreen" view <br>> and see about <br>> > attacking the problem with one "screen" covering both LCD <br>> displays, ie <br>> > setting up my system with one "screen" instead of
2..<br>> ><br>> > So far I have one pipe, with two windows attached to it and <br>> channels set <br>> > in the windows. I have noticed that when I created the 2nd <br>> window, what <br>> > gets displayed in each window now looks "funky", with <br>> colors being off <br>> > and some things not showing up or updating. What else needs <br>> to be done <br>> > to get 2 windows to "play nice"? I've read about <br>> pfPWinShare() and the <br>> > associated funcitons but don't have an example of how configuring, <br>> > framebuffering, and relying on calls to pfFrame() should be <br>> set up. I <br>> > suspect that may be my problem.<br>> <br>> -- <br>> Paolo Farinelli <paolo++at++sgi.com><br>> OpenGL|Performer - Silicon Graphics Inc.<br>> <br>> --------------------------------------------------------------<br>> ---------<br>> List Archives, Info, FAQ: http://www.sgi.com/software/performer/>> Open Development Project: http://oss.sgi.com/projects/performer/>>
  
         Submissions: info-performer++at++sgi.com<br>> Admin. requests: info-performer-request++at++sgi.com<br>> --------------------------------------------------------------<br>> ---------<br>> <br>

_______________________________________________
Join Excite! -
http://www.excite.com
The most personalized portal on the Web!


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Oct 07 2005 - 07:18:10 PDT