Chia-I Wu wrote:
> Hi,
> 
> This patch series tries to clarify the roles of EGLDriver and
> EGLDisplay.  It was also mentioned in another thread, and depend on the
> driver API overhaul.
> 
> The rationale behind the change is every driver provides only a single
> EGLDriver instance.  That instance is used to drive any number of
> displays supported.  This patch series updates the drivers such that
> they still build and work with a single EGLDisplay, as they were before.
> Individual updates to drivers are still required to support multiple
> EGLDisplay.
> 
> The first patch changes egldriver.c.  Now drivers are chosen and
> preloaded at eglGetDisplay time.  When eglInitialize is called, the
> previously preloaded driver (EGLDriver) is matched with the display.
> It is possible that multiple displays match to the same driver.
> 
> It also adds two new hooks to EGLDriver.  `Unload' is called so that the
> driver has a change to release any resource it uses before being
> unloaded.  `Probe` is used to match a display with a driver, when the
> display does not specify one.  It is not used yet though.
> 
> The second patch moves per-display data from EGLDriver to EGLDisplay.
> It breaks builds of drivers, which is later fixed by the last patch.
> 
> The third patch removes some cleanups done in EGL core.  They belong to
> drivers.  That last patch updates drivers (demo, egl_glx, egl_softpipe,
> and EGL_i915).  This patch series is tested on egl_glx, egl_softpipe,
> and EGL_i915.
> 
> 

I like where this patch series is going. There is one use case that I 
like to be take in consideration.

Lets say you have a machine with two cards that use the same EGL driver, 
and lets say the EGL state tracker can parse arguments as cardN to open 
the different dri devices, like so.

dsp1 = eglGetDisplay("!EGL_redeon:card0");
dsp2 = eglGetDisplay("!EGL_redeon:card1");

eglInitialize(dsp1);
eglInitialize(dsp2);

The driver should then be called with something like this:

_eglDriver * _eglLoad() (formerly _eglMain)
_eglDisplay * _eglNewDisplay(_eglDriver *drv, const char *args)
_eglDisplay * _eglNewDisplay(_eglDriver *drv, const char *args)
_eglInitialize(_eglDriver *drv, EGLDisplay dsp1)
_eglInitialize(_eglDriver *drv, EGLDisplay dsp2)

I don't know how well creating two or more displays from the same driver 
works with the old/new API. I'm guessing with the old one it would load 
the driver twice. From what I can see from the code it looks like your 
does as well.

The biggest point is that you should move the "const char *args" away 
from the function which create the driver to something which creates a 
EGLDisplay instance.

Cheers Jakob.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to