Native surface creation

Jacek Rosik paproch at fastmail.fm
Mon Mar 14 00:42:37 PST 2005


Hi

Dnia 11-03-2005, pią o godzinie 20:08 -0500, Jon Smirl napisał(a):
...
> > 
> > >>Suppose I want to do active stereo (i.e. alternate display of
> > >>left/right color buffers in sync with LCD glasses).  How would I name
> > >>a mode that supported stereo?
> > >>
> > >>At the EGL API level, we'd probably have an opaque EGLMode handle and
> > >>a function for querying the mode's attributes (ala
> > >>eglGetConfigAttrib), another function for querying the available
> > >>modes, etc.
> > >>
> > >>That's not in conflict with what you're doing, of course.  The
> > >>translation would be done in the EGL library.
> > >>
> > >>
> > >>
> > >>>As for picking the mode, why bother with the closest match function.
> > >>>Why not just give them a list of mode names and let them pick?
> > >>
> > >>Well, either the user writes a search function or we offer one in the
> > >>EGL API.  I think a mode picking function similar to eglChooseConfig()
> > >>  would be most consistent
> > >
> > >
> > > There is already a search function in fbdev but it is not exposed in
> > > an ioctl. What is a case where executing an app should force a mode
> > > change that isn't under user control?
> > 
> > I'm not sure I understand your question.
> > 
> > I'm not saying I want to be able to set an arbitrary new mode like
> > 942x707 at 55Hz with an EGL call.  I just want to be able to use/set any
> > available mode (from a pre-defined list) with an EGL call.
> > 
> > Let me lay out a concrete usage scenario.  Suppose I want to write a
> > flight simulator using the EGL API.  I want to query the available
> > display modes to see if stereo is supported.  I also want to provide a
> > keyboard option in the simulator to turn stereo on/off on the fly.
> > Therefore, I need to be able to change the display between stereo and
> > non-stereo modes.
> > 
> > Or, perhaps I want to be able to try several different display
> > resolutions during simulator start-up to find the one which I can
> > render at a reliable 60Hz.  I may try 1600x1200 first, then 1280x1024,
> > then finally 1024x768.  Those modes would all be in the list
> > predefined modes.
> > 
> > Does any of that conflict with your ideas?
> 
> None of the fbdev drivers implement stereo so there is nothing to
> compare to. How is stero implemented, is it in hardware or software?

Both. You can alway implement it in software if hardware has vblank
interrupt and allows changing display offset. Radeons also have special
registers to support active stereo, but from my experiments it seems
that software only solution works better (using hardware registers
resulted in swapped buffers, left was right and vice versa). I think
Voodo3 also has hardware support for stereo, but I'm not 100% sure about
that.

> In software you would just pick a normal mode and then on vertical
> retrace change between buffers and pulse the glasses. The way I look
> at it the monitor doesn't know stereo is happening so it is not part
> of the video mode. Turning on stero would be a separate toggle
> somewhere.

Basically that's how it's done in software. But you are describing only
"alternate page" format There are also other formats, interlaced (where
two stereo images are interleaved line by line), above/below or side by
side and dual head (where stereo image are sent to separate heads).

So, for some of them you may require a specific mode and for some of
them not (above/below and side by side doesn't even require drivers
support).

I have posted stereo patches for radeon some time ago so you may take a
look at it. I have implemented alternate page and dual head formats.

Anyway, please keep in mind that stereo rendering is possible with
opengl and cards supported by DRI, don't make it hard or impossible to
implement later.

Regards,
-- 
Jacek Rosik <paproch at fastmail.fm>



More information about the dri-egl mailing list