X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fstate_trackers%2Fegl%2Fcommon%2Fnative.h;h=3886ca20562b0ae25a3a33a8294821d55a843fc6;hb=b2ddb93ff3b8c88682634ccdef247967e31fab84;hp=5ab21b639ea3217d6eefb0f2c42cac4eb797f869;hpb=287c94ea4987033f9c99a2f91c5750c9083504ca;p=mesa.git diff --git a/src/gallium/state_trackers/egl/common/native.h b/src/gallium/state_trackers/egl/common/native.h index 5ab21b639ea..3886ca20562 100644 --- a/src/gallium/state_trackers/egl/common/native.h +++ b/src/gallium/state_trackers/egl/common/native.h @@ -27,15 +27,18 @@ #define _NATIVE_H_ #include "EGL/egl.h" /* for EGL native types */ -#include "GL/gl.h" /* for GL types needed by __GLcontextModes */ -#include "GL/internal/glcore.h" /* for __GLcontextModes */ #include "pipe/p_compiler.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_state.h" +#include "state_tracker/sw_winsys.h" -#include "native_probe.h" +#ifdef __cplusplus +extern "C" { +#endif + +#include "native_buffer.h" #include "native_modeset.h" /** @@ -56,7 +59,17 @@ enum native_param_type { * Return TRUE if window/pixmap surfaces use the buffers of the native * types. */ - NATIVE_PARAM_USE_NATIVE_BUFFER + NATIVE_PARAM_USE_NATIVE_BUFFER, + + /** + * Return TRUE if native_surface::present can preserve the buffer. + */ + NATIVE_PARAM_PRESERVE_BUFFER, + + /** + * Return the maximum supported swap interval. + */ + NATIVE_PARAM_MAX_SWAP_INTERVAL }; struct native_surface { @@ -68,17 +81,12 @@ struct native_surface { void (*destroy)(struct native_surface *nsurf); /** - * Swap the front and back buffers so that the back buffer is visible. It - * is no-op if the surface is single-buffered. The contents of the back - * buffer after swapping may or may not be preserved. + * Present the given buffer to the native engine. */ - boolean (*swap_buffers)(struct native_surface *nsurf); - - /** - * Make the front buffer visible. In some native displays, changes to the - * front buffer might not be visible immediately and require manual flush. - */ - boolean (*flush_frontbuffer)(struct native_surface *nsurf); + boolean (*present)(struct native_surface *nsurf, + enum native_attachment natt, + boolean preserve, + uint swap_interval); /** * Validate the buffers of the surface. textures, if not NULL, points to an @@ -102,15 +110,26 @@ struct native_surface { void (*wait)(struct native_surface *nsurf); }; +/** + * Describe a native display config. + */ struct native_config { - /* __GLcontextModes should go away some day */ - __GLcontextModes mode; + /* available buffers and their format */ + uint buffer_mask; enum pipe_format color_format; - enum pipe_format depth_format; - enum pipe_format stencil_format; - /* treat it as an additional flag to mode.drawableType */ + /* supported surface types */ + boolean window_bit; + boolean pixmap_bit; boolean scanout_bit; + + int native_visual_id; + int native_visual_type; + int level; + int samples; + boolean slow_config; + boolean transparent_rgb; + int transparent_rgb_values[3]; }; /** @@ -141,18 +160,14 @@ struct native_display { /** * Get the supported configs. The configs are owned by the display, but - * the returned array should be free()ed. - * - * The configs will be converted to EGL config by - * _eglConfigFromContextModesRec and validated by _eglValidateConfig. - * Those failing to pass the test will be skipped. + * the returned array should be FREE()ed. */ const struct native_config **(*get_configs)(struct native_display *ndpy, int *num_configs); /** * Test if a pixmap is supported by the given config. Required unless no - * config has GLX_PIXMAP_BIT set. + * config has pixmap_bit set. * * This function is usually called to find a config that supports a given * pixmap. Thus, it is usually called with the same pixmap in a row. @@ -163,21 +178,20 @@ struct native_display { /** - * Create a window surface. Required unless no config has GLX_WINDOW_BIT - * set. + * Create a window surface. Required unless no config has window_bit set. */ struct native_surface *(*create_window_surface)(struct native_display *ndpy, EGLNativeWindowType win, const struct native_config *nconf); /** - * Create a pixmap surface. Required unless no config has GLX_PIXMAP_BIT - * set. + * Create a pixmap surface. Required unless no config has pixmap_bit set. */ struct native_surface *(*create_pixmap_surface)(struct native_display *ndpy, EGLNativePixmapType pix, const struct native_config *nconf); + const struct native_display_buffer *buffer; const struct native_display_modeset *modeset; }; @@ -193,6 +207,11 @@ struct native_event_handler { void (*invalid_surface)(struct native_display *ndpy, struct native_surface *nsurf, unsigned int seq_num); + + struct pipe_screen *(*new_drm_screen)(struct native_display *ndpy, + const char *name, int fd); + struct pipe_screen *(*new_sw_screen)(struct native_display *ndpy, + struct sw_winsys *ws); }; /** @@ -204,11 +223,28 @@ native_attachment_mask_test(uint mask, enum native_attachment att) return !!(mask & (1 << att)); } -const char * -native_get_name(void); +struct native_platform { + const char *name; + + struct native_display *(*create_display)(void *dpy, + struct native_event_handler *handler, + void *user_data); +}; -struct native_display * -native_create_display(EGLNativeDisplayType dpy, - struct native_event_handler *handler); +const struct native_platform * +native_get_gdi_platform(void); + +const struct native_platform * +native_get_x11_platform(void); + +const struct native_platform * +native_get_drm_platform(void); + +const struct native_platform * +native_get_fbdev_platform(void); + +#ifdef __cplusplus +} +#endif #endif /* _NATIVE_H_ */