eglmesaext.h revision e23bfdb3298ec43ef895121527fb4d79474d7b1b
1/**************************************************************************
2 *
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28#ifndef __eglmesaext_h_
29#define __eglmesaext_h_
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include <EGL/eglplatform.h>
36
37/* EGL_MESA_screen extension  >>> PRELIMINARY <<< */
38#ifndef EGL_MESA_screen_surface
39#define EGL_MESA_screen_surface 1
40
41#define EGL_BAD_SCREEN_MESA                    0x4000
42#define EGL_BAD_MODE_MESA                      0x4001
43#define EGL_SCREEN_COUNT_MESA                  0x4002
44#define EGL_SCREEN_POSITION_MESA               0x4003
45#define EGL_SCREEN_POSITION_GRANULARITY_MESA   0x4004
46#define EGL_MODE_ID_MESA                       0x4005
47#define EGL_REFRESH_RATE_MESA                  0x4006
48#define EGL_OPTIMAL_MESA                       0x4007
49#define EGL_INTERLACED_MESA                    0x4008
50#define EGL_SCREEN_BIT_MESA                    0x08
51
52typedef khronos_uint32_t EGLScreenMESA;
53typedef khronos_uint32_t EGLModeMESA;
54
55#ifdef EGL_EGLEXT_PROTOTYPES
56EGLAPI EGLBoolean EGLAPIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
57EGLAPI EGLBoolean EGLAPIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
58EGLAPI EGLBoolean EGLAPIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
59EGLAPI EGLBoolean EGLAPIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
60EGLAPI EGLSurface EGLAPIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
61EGLAPI EGLBoolean EGLAPIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
62EGLAPI EGLBoolean EGLAPIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
63EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
64EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
65EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
66EGLAPI const char * EGLAPIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
67#endif /* EGL_EGLEXT_PROTOTYPES */
68
69typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSEMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
70typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMODESMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
71typedef EGLBoolean (EGLAPIENTRYP PFNEGLGetModeATTRIBMESA) (EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
72typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSCRREENSMESA) (EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
73typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESCREENSURFACEMESA) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
74typedef EGLBoolean (EGLAPIENTRYP PFNEGLSHOWSCREENSURFACEMESA) (EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
75typedef EGLBoolean (EGLAPIENTRYP PFNEGLSCREENPOSIITONMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
76typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
77typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENSURFACEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
78typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
79typedef const char * (EGLAPIENTRYP PFNEGLQUERYMODESTRINGMESA) (EGLDisplay dpy, EGLModeMESA mode);
80
81#endif /* EGL_MESA_screen_surface */
82
83#ifndef EGL_MESA_copy_context
84#define EGL_MESA_copy_context 1
85
86#ifdef EGL_EGLEXT_PROTOTYPES
87EGLAPI EGLBoolean EGLAPIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
88#endif /* EGL_EGLEXT_PROTOTYPES */
89
90typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYCONTEXTMESA) (EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
91
92#endif /* EGL_MESA_copy_context */
93
94#ifndef EGL_MESA_drm_display
95#define EGL_MESA_drm_display 1
96
97#ifdef EGL_EGLEXT_PROTOTYPES
98EGLAPI EGLDisplay EGLAPIENTRY eglGetDRMDisplayMESA(int fd);
99#endif /* EGL_EGLEXT_PROTOTYPES */
100
101typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);
102
103#endif /* EGL_MESA_drm_display */
104
105#ifdef EGL_MESA_drm_image
106/* Mesa's extension to EGL_MESA_drm_image... */
107#ifndef EGL_DRM_BUFFER_USE_CURSOR_MESA
108#define EGL_DRM_BUFFER_USE_CURSOR_MESA		0x0004
109#endif
110#endif
111
112#ifndef EGL_WL_bind_wayland_display
113#define EGL_WL_bind_wayland_display 1
114
115#define EGL_WAYLAND_BUFFER_WL		0x31D5 /* eglCreateImageKHR target */
116#define EGL_WAYLAND_PLANE_WL		0x31D6 /* eglCreateImageKHR target */
117
118#define EGL_TEXTURE_Y_U_V_WL            0x31D7
119#define EGL_TEXTURE_Y_UV_WL             0x31D8
120#define EGL_TEXTURE_Y_XUXV_WL           0x31D9
121
122struct wl_display;
123struct wl_buffer;
124#ifdef EGL_EGLEXT_PROTOTYPES
125EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
126EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
127EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
128#endif
129typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
130typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
131typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);
132
133#endif
134
135#ifndef EGL_NOK_swap_region
136#define EGL_NOK_swap_region 1
137
138#ifdef EGL_EGLEXT_PROTOTYPES
139EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
140#endif
141
142typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
143#endif
144
145#ifndef EGL_NOK_texture_from_pixmap
146#define EGL_NOK_texture_from_pixmap 1
147
148#define EGL_Y_INVERTED_NOK			0x307F
149#endif /* EGL_NOK_texture_from_pixmap */
150
151#ifndef EGL_ANDROID_image_native_buffer
152#define EGL_ANDROID_image_native_buffer 1
153#define EGL_NATIVE_BUFFER_ANDROID       0x3140  /* eglCreateImageKHR target */
154#endif
155
156#ifdef __cplusplus
157}
158#endif
159
160#endif
161