EGL_MESA_screen_surface proposal

Brian Paul brian.paul at tungstengraphics.com
Tue Mar 15 06:26:48 PST 2005


Here's a rough specification for an EGL extension to support 
screen/display management.  I used "MESA" as the extension vendor 
string, but perhaps "DRI" would be more appropriate.  Doesn't really 
matter to me.

-Brian


-------------- next part --------------
Name

    MESA_screen_surface

Name Strings

    EGL_MESA_screen_surface

Contact

    Brian Paul

Status

    Preliminary - totally subject to change.

Version

    Last revised on 15 March 2005.

Number

    TBD

Dependencies

    EGL 1.1 or later.

Overview

    EGL 1.1 supports three types of drawing surfaces:
      * Window surfaces
      * Pixmap surfaces
      * Pbuffer surfaces
    This extension defines a fourth type of drawing surface:
      * Screen surface

    A screen surface is a surface for which the (front) color buffer can
    be directly displayed (i.e. scanned out) on a monitor (such as a flat
    panel or CRT).  In particular the color buffer memory will be allocated
    at a location in VRAM (and in a suitable format) which can be displayed
    by the graphics hardware.

    Note that the width and height of the screen surface need not exactly
    match the monitor's current resolution.  For example, while the monitor
    may be configured to to show 1024x768 pixels, the associated screen
    surface may be larger, such as 1200x1000.  The monitor's "viewport
    origin" will specify which region of the screen surface is visible on
    the monitor.  The screen can be scrolled by changing the origin.

    This extension also defines functions for controlling the monitor's
    display mode (width, height, refresh rate, etc), and specifing which
    screen surface to display on a monitor.

Issues

    TBD

New Procedures and Functions

    EGLBoolean eglChooseModeMESA(EGLDisplay dpy, const EGLint *attrib_list,
                                 EGLModeMESA *modes, EGLint modes_size,
                                 EGLint *num_modes)

    EGLBoolean eglGetModesMESA(EGLDisplay dpy, EGLint screen_number,
                               EGLModeMESA *modes, EGLint modes_size,
                               EGLint *num_modes)

    EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode,
                                    EGLint attribute, EGLint *value)



    EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config,
                                          const EGLint *attrib_list)

    EGLBoolean eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen_number,
                                  EGLSurface surface)


    EGLBoolean eglScreenModeMESA(EGLDisplay dpy, EGLint screen_number,
                                 EGLModeMESA mode)

    EGLBoolean eglScreenAttribsMESA(EGLDisplay dpy, EGLint screen,
                                    const EGLint *attrib_list)

    EGLBoolean eglQueryDisplayMESA(EGLDisplay dpy, EGLint attribute,
                                   EGLint *value)

    EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLint screen_number,
                                         EGLSurface *surface)

    EGLBoolean eglQueryScreenModeMESA(EGLDisplay dpy, EGLint screen_number,
                                      EGLModeMESA *mode)

    EGLBoolean eglQueryScreenMESA(EGLDisplay dpy, EGLint screen_number,
                                  EGLint attribute, EGLint *value);


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             
    EGL_SCREEN_BIT_MESA        

Additions to Chapter X of the EGL 1.1 Specification

    EGLBoolean eglChooseModeMESA(EGLDisplay dpy, const EGLint *attrib_list,
                                 EGLModeMESA *modes, EGLint modes_size,
                                 EGLint *num_modes)

    Like eglChooseConfig, returns a list of EGLModes which match the given
    attribute list.  This does not set the screen's current display mode.



    EGLBoolean eglGetModesMESA(EGLDisplay dpy, EGLint screen_number,
                               EGLModeMESA *modes, EGLint modes_size,
                               EGLint *num_modes)

    Like eglGetConfigs, returns a list of all modes supporteb by the
    given screen.



    EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode,
                                    EGLint attribute, EGLint *value)

    Used to query mode attributes, attribute may be one of EGL_WIDTH,
    EGL_HEIGHT, EGL_DEPTH, EGL_SCREEN_X_ORIGIN, EGL_SCREEN_Y_ORIGIN.



    EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config,
                                          const EGLint *attrib_list)

    Create a surface that can be displayed on a screen.  <attrib_list> values:
        EGL_WIDTH         *required
        EGL_HEIGHT        *required

    

    EGLBoolean eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen_number,
                                  EGLSurface surface)

    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.



    EGLBoolean eglScreenModeMESA(EGLDisplay dpy, EGLint screen_number,
                                 EGLModeMESA mode)

    This function sets the given screen's current display mode.  If the
    new mode is in any way incompatible with the screen's current surface,
    an error will be recorded and EGL_FALSE will be returned.



    EGLBoolean eglScreenAttribsMESA(EGLDisplay dpy, EGLint screen,
                                    const EGLint *attrib_list)

    Used to set attributes for a screen.  <attrib_list> tokens may include
    EGL_SCREEN_X_ORIGIN and EGL_SCREEN_Y_ORIGIN.  Each is followed by the
    attribute value.  The list is terminated with EGL_NONE.



    EGLBoolean eglQueryDisplayMESA(EGLDisplay dpy, EGLint screen_number,
                                   EGLint attrib, EGLint *value)

    Query a display parameter.  If <attrib> is EGL_NUM_SCREENS, the number
    of screens controlled by the display will be returned.



    EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLint screen_number,
                                         EGLSurface *surface)

    Returns the surface currently displayed on the given screen.  <surface>
    may be EGL_NO_SURFACE if the screen isn't currently showing any surface.



    EGLBoolean eglQueryScreenModeMESA(EGLDisplay dpy, EGLint screen_number,
                                      EGLModeMESA *mode)

    Returns the given screen's current display mode.  The mode may be
    EGL_NO_MODE if the screen is currently disabled.



    EGLBoolean eglQueryScreenMESA(EGLDisplay dpy, EGLint screen_number,
                                  EGLint attribute, EGLint *value);

    Used to query screen attributes.  <attribute> may be one of
    EGL_SCREEN_X_ORIGIN or EGL_SCREEN_Y_ORIGIN.


More information about the dri-egl mailing list