Re: [info-performer] Multipipe Initialization

Date view Thread view Subject view Author view

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


Rick-

Excellent info. I have run "echo $DISPLAY" on my Fedore Core 3 system and what I get is ":0.0". In my program, I am running "system("export DISPLAY=:0.0;/usr/X11R6/bin/xhost + ");" before I do anyth ing else. If I r un "system("export DISPLAY=:0.1;/usr/X11R6/bin/xhost + ");" instead, things show up on the "upper" LCD. Seems to me this indicates that my system is running a single X-Server that "sees" the two screens and would explain why when I run the following:

pfPipeScreen(pipe0,0);
pfPipeScreen(pipe1,1);

and then call pfFrame() I can see the windows (black) being created on each LCD. Then my calls to grab the display and capture x-events are what fails. Great information. I feel like I am learning something, just not sure how to apply it to get the results (i.e. get my program not to hang during initialization) I need.

Is it al least safe for me to assume, given what I said above, that I am running on one X-Server managing 2 screens?

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

 --- On Thu 10/06, Rick van Haasen < rick.van.haasen++at++philips.com > wrote:
From: Rick van Haasen [mailto: rick.van.haasen++at++philips.com]
To: cubicwts++at++excite.com
     Cc: info-performer++at++sgi.com
Date: Thu, 6 Oct 2005 12:00:36 +0200
Subject: Re: [info-performer] Multipipe Initialization

Concepts like pfPipe, pfPipeWindow, pfWindow and their relations can <br>indeed be confusing. After having read the chapters x times, i think to <br>know their meaning and relations. Maybe my short description can be of <br>help to others strugling with the concepts,<br>please correct me if you think the description is not correct.<br> <br>what is a pfPipe?<br><br>a pfPipe represents a "software rendering pipeline". This software <br>pipeline represents the way the APP, CULL and DRAW stages are configured <br>(for example by specifying that all stages should be implemented on <br>separate CPU's or just on 1 CPU). When a pfPipe is created, It is NOT <br>associated with any specific "hardware pipeline" yet. That association has <br>to be done by "connecting" the pfPipe with a "screen". <br><br>What is a "screen" ?<br><br>a screen "represents a framebuffer and all its capabilities". The "screen" <br> has un unambiguous meaning, it represents "a screen as seen by the <br>x-server
  
(on Unix-like systems)". The configuration of the screen (like <br>the "total" resolution and how the framebuffer is mapped to the available <br>video-outputs) can be done with system-specific tools. SGI uses <br>"ircombine". On Linux with nvidia graphics, these settings have to be done <br>through settings of the x11.config file, twinview is used to map the <br>screen onto 2 video-outputs. It also uses enviroment-variables (eg for <br>synchronisation of the vsync to the glSwap).<br> <br>What is the relevance of the pfPipe <-> screen asociation?<br>The "screen" which the pfPipe will use must be determined somehow. There <br>are several situations:<br><br>1- Application is started from an x-connection on the server that manages <br>all screens that you want to use.<br><br>In this situation a function "pfGetNrScreens()" returnes all screens <br>available on the system. <br>For our hardware it means the 2 screens are available. As such, 2 pfPipes <br>can be created and
associated with the 2 screens:<br> <br>pfPipeScreen(pipe0,0);<br>pfPipeScreen(pipe1,1);<br> <br> 2- Application is started from an x-connection on the server that manages <br>NOT all screens: <br><br>This is the case when our system is configured with 2 x-servers (each <br>managing 1 screen). In this situation, pfGetNrScreens() will return 1. <br>This screen can now be asociated to 1 pfPipe.<br><br>How can you now use the other screen?<br><br>This is done by connecting the pfPipe explicitly to the screen of the <br>x-server by using the funtion <br>pfPipeWSConnectionName(pfPipe *pipe, const char *name) eg <br>pfPipeWSConnectionName(&pipe1, "mets-a:1.0") <br> <br>3- Application is started from a remote x-connection:<br> Asuming the system is configured as 2 x-servers, the connection is done <br>as follows:<br> <br> pfPipeWSConnectionName(&pipe1, "mets-a:0.0");<br> pfPipeWSConnectionName(&pipe2, "mets-a:1.0");<br> <br> When configured as 1
x-server:<br> <br> pfPipeWSConnectionName(&pipe1, "mets-a:0.0");<br> pfPipeWSConnectionName(&pipe2, "mets-a:0.1");<br><br> (in the case of remote connection to a server that manages all screens, <br> it is probably easier to just set the DISPLAY environment variable to the <br>"first screen of interest", eg export DISPLAY=mets:0.0)<br> <br> Windows?<br> <br>The next step is defining "pfPipeWindows" from the pfPipes. A fullscreen <br>application, with a screen that "maps" to serveral video outputs can be <br>setup in several ways:<br>1 - 1 pfPipeWindow that covers the total area by specifying it as <br>"fullscreen"<br>2- a pfPipeWindow for "each video-output" by specifying the location and <br>size of each window within the "total screen area".<br><br>For fullscreen application i always use method 1. I think that each <br>pfPipeWindow has its own "graphic context" in the draw process. By using <br>more pfPipeWIndows, the resulting graphic
context swapping is less <br>efficient than using 1. I think it can be generalised to state "for <br>fullscreen applications, only use 1 pfPipeWindow per screen". <br><br> A pfPipeWindow is implicitely associated with a pfWindow. The pfWindow is <br>the "pr" equavalent of the pfPipeWindow, and thus can only be used from <br>the draw process. They share many functions but not all. This has to do <br>with the fact that only the draw proces has the connection to the <br>x-server. <br>I guess that calls to a pfPipeWindow (from the application process) <br>"register" things to be actualy done by the associated pfWindow in the <br>draw process.<br> <br>The "final step" that finishes the setup:<br><br> A pfChannel defines a "view from a scene". A pfChannel must be rendered <br>to a pfPipeWindow/pfWindow. You can specify wich area of the <br>pfPipeWindow/pfWindow should be used. In case of a screen with multiple <br>"video-ouputs", configured with 1 pfPipeWindow, each
"video-output"<br>is associated with a channel that specifies its location&size within the <br>total screen.<br> (A great improvement of Performer 3.0 are the "pfvViewer" and related <br>classes, that enable configuration from an xml description file).<br><br><br><br><br><br><br><br><br><br>"Christopher D. Johnson" <cubicwts++at++excite.com> <br>Sent by:<br>owner-info-performer++at++performer.engr.sgi.com<br>2005-10-06 00:33<br>Please respond to<br>cubicwts++at++excite.com<br><br><br>To<br>stacep++at++sgi.com<br>cc<br>info-performer++at++sgi.com<br>Subject<br>Re: [info-performer] Multipipe Initialization<br>Classification<br><br><br><br><br><br><br><br><br>So when I create my single pfPipe (which I already have) and then create <br>my 2 seperate windows, what is the "best" way to have each of my windows <br>go to the proper display? I though something like the following calls <br>might work:<br><br>pfpwinscreen(pwinLOWER,0);<br>pfpwinscreen(pwinUPPER,1);<br><br>but the definition of pfpwinscreen
states that it "will set the screen of <br>pwin and on the parent pfPipe." And from what I understand you can only <br>have one pipe per screen. BUt if what you say is true, and my system is <br>treating the 2 physical screens as one "screen", what calls would I make <br>to get the windows on the proper physical screen?<br><br>Before, when I made the calls:<br><br>pfPipeScreen(mttGlobal->gfxPipeLOWER,0);<br>pfPipeScreen(mttGlobal->gfxPipeUPPER,1);<br><br>I could see the windows on each screen being created when I called <br>pfFrame() the first time. Does the fact that these calls directed the <br>windows (and assigned the pipes) to the "screen" I expected mean I have to <br>treat the situation as two screens and have 2 pipes?<br><br>As an aside, I can move the mouse pointer from the lower screen to the <br>upper screen seemlessly. Is this a direct indication that the system sees <br>the 2 physical screens as one "screen"? I know this is long winded but I'm <br>trying to
really get the heart of the concepts I'm learning here. Thanks.<br><br><br><br>Christopher D. Johnson<br>AV-8B Harrier II Simulators<br>ISEO Support Team<br>Cherry Point, NC<br>252-466-4542<br>252-466-4538<br><br> --- On Wed 10/05, Stace Peterson < stacep++at++sgi.com > wrote:<br>From: Stace Peterson [mailto: stacep++at++sgi.com]<br>To: cubicwts++at++excite.com<br> Cc: info-performer++at++sgi.com<br>Date: Wed, 05 Oct 2005 13:22:35 -0700<br>Subject: Re: [info-performer] Multipipe Initialization<br><br>Hi,<br><br>Gordon's comment is probably correct. If the system has a <br>single<br>graphics card, then you should only be creating one pfPipe. The <br>notice<br>you reported is usually not a meaningful one, unless you are <br>directly<br>calling pfChooseFBConfig in your application with constraints <br>which may<br>not be achievable. For most multi-screen PC setups, the <br>single card<br>treats the combined screen as a single desktop, and thus <br>you will want<br>to use either 2 windows
with 2 channels, or 1 window with <br>2 channels on<br>a single pipe.<br><br>Hope this helps,<br>Stace <br><br><br>"Christopher D. Johnson" wrote:<br>> <br>> Greetings all. I have a <br>simulation program running on a dual processor PC. There is an upper and a <br>lower LCD display, with the lower LCD being a touch screen. The lower <br>screen is "display 0" while the upper screen is "display 1".<br>> <br>> <br>What I am trying unsuccessfully to do is initialize performer so that I <br>have 2 pfPipes created (one for each display) and <br>each pfPipe has just a single pfPipeWindow attached to it. Everything <br>initializes seemingly fine until I call pfFrame() for the first time, at <br>which time I see my full screen windows created (blank) on the uper and <br>lower display, and then it bombs out (the screens disappear) and I get the <br>following notice:<br>> <br>> "PF Notice: pfChooseFBConfig: failed to make <br>configuration matching specified attributes"<br>> <br>> Below
  
that I get a <br>"BadWindow" message as my X calls try to operate on the lower window <br>created. Simply going back to one pipe, one window runs fine. Here are the <br>functions I am using to initialize performer and initialize the pfPipes <br>and pfPipeWindows. I've looked in the Performer manual and tried to set <br>the pipes and windows up to work properly, but obviously I am missing <br>something. Any clues?<br>> <br>> static void<br>> initPerformer(void)<br>> <br>{<br>> void *arena = NULL;<br>> pfSharedArenaSize(134217728); /* 128 <br>* 1024 * 1024 = 128 Mb */<br>> // <br>pfSharedArenaSize(167772160); /* 160 * 1024 * 1024 = 128 Mb */<br>> // <br>pfSharedArenaSize(268435456); /* 256 * 1024 * 1024 = 256 Mb */<br>> <br>pfInit();<br>> arena = pfGetSharedArena();<br>> <br>> /* Allocate <br>Global Variables */<br>> mttGlobal = pfMalloc(sizeof(global_t), <br>arena);<br>> MttGfx = pfMalloc(sizeof( MTTGFX ), <br>arena);<br>> c_
  
         = pfMalloc(sizeof( struct ForCComm ), <br>arena);<br>> ntReq = pfMalloc(sizeof(NTREQ), arena);<br>> <br><br>> Client = pfMalloc(sizeof( CLIENT ), arena);<br>> <br>BBoxTerrain = pfMalloc(sizeof ( pfBox ), arena);<br>> <br>> /* <br>initialize global values */<br>> initGlobal();<br>> <br>> <br>/*------------------------------------------------------<br>> * <br>Initialize main Gfx variables.<br>> <br>*-----------------------------------------------------*/<br>> <br>initGfx();<br>> readConfigFile();<br>> <br>> // <br>pfMultiprocess(PFMP_DEFAULT);<br>> <br>pfMultiprocess(PFMP_FORK_DBASE | PFMP_FORK_LPOINT);<br>> <br>pfMultipipe(2);<br>> <br>> // scb - uncommented Multithread(...)<br>> <br>/* pfMultithread(0, PFPROC_CULL, 2); */<br>> <br>> <br>pfdInitConverter("flt");<br>> pfConfig();<br>> pfFilePath( <br>"../data/");<br>> pfNotifyLevel(PFNFY_FATAL);<br>> #ifdef <br>GFXAUTOSYNC<br>>
pfFrameRate(MttGfx->FrameRate);<br>> <br>pfPhase(PFPHASE_LOCK);<br>> #endif<br>> }<br>> <br>> static void <br>OpenPipeWin(pfPipeWindow *pwin)<br>> {<br>> pfOpenPWin(pwin);<br>> <br>}<br>> <br>> static void<br>> initPipeWindow(void)<br>> {<br>> int <br>constraints[] = {<br>> PFFB_DOUBLEBUFFER,<br>> PFFB_RGBA,<br>> <br> PFFB_RED_SIZE, 5,<br>> PFFB_GREEN_SIZE, 5,<br>> <br>PFFB_BLUE_SIZE, 5,<br>> <br>> PFFB_ALPHA_SIZE, 1,<br>> <br>PFFB_STENCIL_SIZE, 8,<br>> PFFB_DEPTH_SIZE, 15,<br>> (int)NULL<br>> <br> };<br>> /*------------------------------------------------------<br>> <br>* Configure graphics <br>pipeline.<br>> <br>*-----------------------------------------------------*/<br>> <br>mttGlobal->gfxPipeLOWER = pfGetPipe(0);<br>> if <br>(!(mttGlobal->gfxPipeLOWER)) {<br>> fprintf(stderr, "ERROR: Unable <br>to initialize (pfPipe *) LOWER!\n");<br>> abort();<br>> }<br>> <br>mttGlobal->gfxPipeUPPER =
pfGetPipe(1);<br>> if <br>(!(mttGlobal->gfxPipeUPPER)) {<br>> fprintf(stderr, "ERROR: Unable <br>to initialize (pfPipe *) UPPER!\n");<br>> abort();<br>> }<br>> <br><br>> pfPipeScreen(mttGlobal->gfxPipeLOWER,0);<br>> <br>pfPipeScreen(mttGlobal->gfxPipeUPPER,1);<br>> <br>> mttGlobal->pwinLOWER = <br>pfNewPWin(mttGlobal->gfxPipeLOWER);<br>> if (!(mttGlobal->pwinLOWER)) <br>{<br>> fprintf(stderr, "ERROR: Unable to initialize (pfWindow *) <br>LOWER!\n");<br>> abort();<br>> }<br>> mttGlobal->pwinUPPER = <br>pfNewPWin(mttGlobal->gfxPipeUPPER);<br>> if (!(mttGlobal->pwinUPPER)) <br>{<br>> fprintf(stderr, "ERROR: Unable to initialize (pfWindow *) <br>UPPER!\n");<br>> abort();<br>> }<br>> <br>> <br>pfPWinName(mttGlobal->pwinLOWER,MttGfx->ScreenLOWER.Name);<br>> <br>pfPWinType(mttGlobal->pwinLOWER, PFWIN_TYPE_X);<br>> pfPWinMode( <br>mttGlobal->pwinLOWER, PFWIN_NOBORDER, 1);<br>> pfPWinConfigFunc(
<br>mttGlobal->pwinLOWER, OpenPipeWin);<br>> pfChoosePWinFBConfig( <br>mttGlobal->pwinLOWER, constraints);<br>> pfConfigPWin( <br>mttGlobal->pwinLOWER );<br>> pfPWinOriginSize(mttGlobal->pwinLOWER, 0, <br>0,<br>> MttGfx->ScreenLOWER.SizeW,<br>> <br>MttGfx->ScreenLOWER.SizeH);<br>> <br>//pfPWinScreen(mttGlobal->pwinLOWER,0);<br>> <br>pfOpenPWin(mttGlobal->pwinLOWER);<br>> <br>> <br>pfPWinName(mttGlobal->pwinUPPER,MttGfx->ScreenUPPER.Name);<br>> <br>pfPWinType(mttGlobal->pwinUPPER, PFWIN_TYPE_X);<br>> pfPWinMode( <br>mttGlobal->pwinUPPER, PFWIN_NOBORDER, 1);<br>> pfPWinConfigFunc( <br>mttGlobal->pwinUPPER, OpenPipeWin);<br>> pfChoosePWinFBConfig( <br>mttGlobal->pwinUPPER, constraints);<br>> pfConfigPWin( <br>mttGlobal->pwinUPPER <br>);<br>> pfPWinOriginSize(mttGlobal->pwinUPPER, 0, 0,<br>> <br>MttGfx->ScreenUPPER.SizeW,<br>> MttGfx->ScreenUPPER.SizeH);<br>> <br>//pfPWinScreen(mttGlobal->pwinLOWER,1);<br>>
<br>pfOpenPWin(mttGlobal->pwinUPPER);<br>> <br>> /* set off the draw <br>process to open windows and call init callbacks */<br>> pfFrame();<br>> <br><br>> sleep(3);<br>> <br>> pfPWinFullScreen( mttGlobal->pwinLOWER <br>);<br>> pfPWinFullScreen( mttGlobal->pwinUPPER );<br>> <br>> <br>mttGlobal->dspLOWER = pfGetCurWSConnection();<br>> <br>> // Logic To <br>Set Up Catching Of X-Events on the lower touch screen<br>> <br>mttGlobal->winLOWER = pfGetPWinWSWindow(mttGlobal->pwinLOWER);<br>> <br>XSelectInput(mttGlobal->dspLOWER,mttGlobal->winLOWER,KeyPressMask | <br>ButtonPressMask );<br>> <br>XMapWindow(mttGlobal->dspLOWER,mttGlobal->winLOWER);<br>> <br>XSync(mttGlobal->dspLOWER,FALSE);<br>> <br>> <br>/*------------------------------------------------------<br>> * Remove <br>cursor arrow.<br>> <br>*-----------------------------------------------------*/<br>> #ifndef <br>TESTMTT<br>> pfuLoadPWinCursor(mttGlobal->pwinLOWER, <br>PFU_CURSOR_OFF);<br>> #endif<br>>
  
}<br>> <br>> Christopher D. Johnson<br>> <br>AV-8B Harrier II Simulators<br>> ISEO Support Team<br>> Cherry Point, <br>NC<br>> 252-466-4542<br>> 252-466-4538<br>> <br>> <br>_______________________________________________<br>> Join Excite! - <br>http://www.excite.com>> The most personalized portal on the Web!<br>> <br><br>> <br>-----------------------------------------------------------------------<br>> <br> List Archives, Info, FAQ: http://www.sgi.com/software/performer/>> <br> Open Development Project: http://oss.sgi.com/projects/performer/>> <br> Submissions: info-performer++at++sgi.com<br>> Admin. <br>requests: info-performer-request++at++sgi.com<br>> <br>-----------------------------------------------------------------------<br><br>-- <br><br>------------------------------------------------------------------<br>Stace <br>Peterson <br> <br> stacep++at++sgi.com<br>Silicon Graphics, Inc. <br>
(650) 933-2323<br><br><br>_______________________________________________<br>Join Excite! -
http://www.excite.com>The most personalized portal on the Web!<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><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>

_______________________________________________
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 : Thu Oct 06 2005 - 06:24:24 PDT