EGL_MESA_screen_surface proposal

Brian Paul brian.paul at tungstengraphics.com
Wed Mar 16 12:21:08 PST 2005


Jon Smirl wrote:
> On Wed, 16 Mar 2005 13:15:23 -0500, Jon Smirl <jonsmirl at gmail.com> wrote:
> 
>>The root of the problem is that there are more attributes on the mode
>>than are exposed in EGL. You could do a elgChooseMode(1024,768) and
>>get back 10 identical modes at the EGL level, but they would all be
>>different at the hardware level. EGL will pick the what it thinks is
>>the best mode and you won't be able to get to the others since you
>>can't tell them appart.
> 
> 
> I think the key problem here is that elgChooseMode(1024,768) can
> return more than one mode. I don't think you can make the argument
> that you need to return more than one mode at each resolution. You
> will want this to be the best mode possible, why would you want to set
> an inferior one? But not enough information is returned through the
> EGL API to actually determine what the best mode is at the given
> resolution.

I believe the EGL API should be designed so that any number of modes 
at 1024x768 (for example) can be dealt with.  Whether or not you want 
to configure your system to do that is up to whoever writes the 
/etc/fb.modes file, or whatever.

If we design the EGL API to only allow one mode at each particular 
resolution I believe we'll be hurting ourselves in the long run 
(remember what I wrote about API extensibility?).


> My first approach was to expand the amount of information available
> about the modes. Now instead I would propose that the internal
> implementation of the egl API should sort through the modes in all of
> their gory detail and pick the best one. Then only this one would be
> exposed via the egl API to upper layers.
> 
> Right now my monitor reports this from framebuffer:
> U:1152x864-75,width=1152,height=864,refresh=75
> D:1280x1024-60,width=1280,height=1024,refresh=60
> V:1153x864-75,width=1153,height=864,refresh=75
> V:1280x1024-75,width=1280,height=1024,refresh=75
> V:1024x768-75,width=1024,height=768,refresh=75
> V:1024x768-70,width=1024,height=768,refresh=70
> V:1024x768-60,width=1024,height=768,refresh=60
> U:832x624-75,width=832,height=624,refresh=75
> V:800x600-75,width=800,height=600,refresh=75
> V:800x600-72,width=800,height=600,refresh=72
> V:800x600-60,width=800,height=600,refresh=60
> V:800x600-56,width=800,height=600,refresh=56
> V:640x480-75,width=640,height=480,refresh=75
> V:640x480-72,width=640,height=480,refresh=72
> U:640x480-67,width=640,height=480,refresh=67
> V:640x480-60,width=640,height=480,refresh=60
> U:720x400-70,width=720,height=400,refresh=70
> 
> I know that the detailed mode is the best mode possible:
> D:1280x1024-60,width=1280,height=1024,refresh=60
> 
> My implementation of the egl API would then return the best mode at
> each resolution. I might incorporate the knowledge that if the
> detailed refresh rate is 60Hz that it make no sense to set the modes
> at anything other than 60Hz. My list for egl would then look like
> this:
> 
> U:1152x864-75,width=1152,height=864,refresh=75
> D:1280x1024-60,width=1280,height=1024,refresh=60
> V:1153x864-75,width=1153,height=864,refresh=75
> V:1024x768-60,width=1024,height=768,refresh=60
> U:832x624-75,width=832,height=624,refresh=75
> V:800x600-60,width=800,height=600,refresh=60
> V:640x480-60,width=640,height=480,refresh=60
> U:720x400-70,width=720,height=400,refresh=70
> 
> which would then only be returned as a set of resolutions encoded in egl format
> width=1152,height=864
> width=1280,height=1024
> width=1153,height=864
> width=1024,height=768
> width=832,height=624
> width=800,height=600
> width=640,height=480
> width=720,height=400
> 
> Doesn't this simplify everything?

Perhaps, but we're giving up flexibility.

Suppose I have two screens attached to my system, one with max refresh 
of 85Hz and the other with max refresh at 72Hz.  Now suppose I simply 
want to drive both screens at the same rate (perhaps so my stereo 
goggles work).  I want to select the 72Hz mode on the first screen 
whether or not it's the "best" mode.  (and I don't want to have to go 
edit my /etc/fb.config file) and restart.

-Brian


More information about the dri-egl mailing list