EGL_MESA_screen_surface proposal

Brian Paul brian.paul at tungstengraphics.com
Tue Mar 15 07:17:13 PST 2005


Jon Smirl wrote:
> Breif comments on how to implement each one on top of new fbdev layer.
> 
> On Tue, 15 Mar 2005 07:26:48 -0700, Brian Paul
> <brian.paul at tungstengraphics.com> wrote:
> 
>>    EGLBoolean eglChooseModeMESA(EGLDisplay dpy, const EGLint *attrib_list,
>>                                 EGLModeMESA *modes, EGLint modes_size,
>>                                 EGLint *num_modes)
> 
> 
> Retrieve full mode list, do matching in egl library
> 
> 
>>    EGLBoolean eglGetModesMESA(EGLDisplay dpy, EGLint screen_number,
>>                               EGLModeMESA *modes, EGLint modes_size,
>>                               EGLint *num_modes)
> 
> 
> read full list of modes from sysfs
> 
> 
>>    EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode,
>>                                    EGLint attribute, EGLint *value)
> 
> 
> return from egl cached full list
>  
> 
>>    EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config,
>>                                          const EGLint *attrib_list)
> 
> 
> DRM memory manager implements this
> 
> 
>>    EGLBoolean eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen_number,
>>                                  EGLSurface surface)
> 
> 
> DRM implements this by calling into fbdev and setting buffer location
> 
> 
>>    This function tells the given screen to show the given surface (or more
>>    precisely, the surface's front color buffer.  If the surface is in any
>>    way incompatible with the screen's current display mode, an error will
>>    be recorded and EGL_FALSE will be returned.
> 
> 
> If we are changing color depth there is going to be a mismatch as some
> point since the mode change and surface show are not in the same call.

Perhaps the eglShowSurface() and eglScreenMode() functions should be 
combined so the new surface and new display mode can be validated 
together.  That way, the undefined state between setting the new 
surface and new mode can be avoided.


> The error checking should be implemented in the user space code. It
> will know the current mode that is set and what the surface config is.
> By the time these get into the driver these are just typeless
> pointers.
> 
> 
>>    EGLBoolean eglScreenModeMESA(EGLDisplay dpy, EGLint screen_number,
>>                                 EGLModeMESA mode)
> 
> 
> Write mode name from egl cached list to sysfs variable. It will always
> have to match EGLModeMesa is a handle to an entry on the internally
> cached list of available modes. Only way it can fail is if a monitor
> change event is in progress.
> 
> 
> 
>>    EGLBoolean eglScreenAttribsMESA(EGLDisplay dpy, EGLint screen,
>>                                    const EGLint *attrib_list)
> 
> 
> There is a sysfs variable, pan. Open it and keep writing strings like
> 23,45\n to it. I could rename it to be origin.
> 
> 
>>    EGLBoolean eglQueryDisplayMESA(EGLDisplay dpy, EGLint attribute,
>>                                   EGLint *value)
> 
> 
> To get the number of screens available, ls /sys/class/graphics/fb*.
> What other variables can be queried?

EGL_SCREEN_COUNT is the only one for now.



>>    EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLint screen_number,
>>                                         EGLSurface *surface)
> 
> 
> egl library needs to implement this
> 
> 
>>    EGLBoolean eglQueryScreenModeMESA(EGLDisplay dpy, EGLint screen_number,
>>                                      EGLModeMESA *mode)
> 
> 
> you can read back from the 'mode' variable.
> 
> 
>>    EGLBoolean eglQueryScreenMESA(EGLDisplay dpy, EGLint screen_number,
>>                                  EGLint attribute, EGLint *value);
> 
> 
> you can read back from the 'pan' variable
> 
> 
>>New Types
>>
>>    EGLModeMESA
>>
>>New Tokens
>>
>>    EGL_BAD_SCREEN_MESA
>>    EGL_BAD_MODE_MESA
>>    EGL_SCREEN_COUNT_MESA
>>    EGL_SCREEN_X_ORIGIN_MESA
>>    EGL_SCREEN_Y_ORIGIN_MESA
>>    EGL_MODE_ID_MESA
>>    EGL_REFRESH_RATE_MESA
>>    EGL_DEPTH_MESA
> 
> 
> what is the syntax for this? a simple 8,16,32 doesn't work
> ARGB1555/RGB565 (depth = 16),  ARGB8888/ARGB2101010 (depth 32)

You're forgetting about the surface's EGLConfig.  The EGLConfig 
describes the RGB color channels, stencil buffer, depth buffer, etc. 
attributes.

-Brian


More information about the dri-egl mailing list