egl: use coherent variable names
`EGLDisplay` variables (the opaque Khronos type) have mostly been consistently called `dpy`, as this is the name used in the Khronos specs. However, `_EGLDisplay` variables (our internal struct) have been randomly called `dpy` when there was no local variable clash with `EGLDisplay`s, and `disp` otherwise. Let's be consistent and use `dpy` for the Khronos type, and `disp` for our struct. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Acked-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
@@ -241,12 +241,12 @@ _eglCheckSync(_EGLDisplay *disp, _EGLSync *s, const char *msg)
|
||||
* Lookup and lock a display.
|
||||
*/
|
||||
static inline _EGLDisplay *
|
||||
_eglLockDisplay(EGLDisplay display)
|
||||
_eglLockDisplay(EGLDisplay dpy)
|
||||
{
|
||||
_EGLDisplay *dpy = _eglLookupDisplay(display);
|
||||
if (dpy)
|
||||
mtx_lock(&dpy->Mutex);
|
||||
return dpy;
|
||||
_EGLDisplay *disp = _eglLookupDisplay(dpy);
|
||||
if (disp)
|
||||
mtx_lock(&disp->Mutex);
|
||||
return disp;
|
||||
}
|
||||
|
||||
|
||||
@@ -254,9 +254,9 @@ _eglLockDisplay(EGLDisplay display)
|
||||
* Unlock a display.
|
||||
*/
|
||||
static inline void
|
||||
_eglUnlockDisplay(_EGLDisplay *dpy)
|
||||
_eglUnlockDisplay(_EGLDisplay *disp)
|
||||
{
|
||||
mtx_unlock(&dpy->Mutex);
|
||||
mtx_unlock(&disp->Mutex);
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
@@ -364,7 +364,7 @@ EGLDisplay EGLAPIENTRY
|
||||
eglGetDisplay(EGLNativeDisplayType nativeDisplay)
|
||||
{
|
||||
_EGLPlatformType plat;
|
||||
_EGLDisplay *dpy;
|
||||
_EGLDisplay *disp;
|
||||
void *native_display_ptr;
|
||||
|
||||
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL, EGL_NO_DISPLAY);
|
||||
@@ -373,44 +373,44 @@ eglGetDisplay(EGLNativeDisplayType nativeDisplay)
|
||||
native_display_ptr = (void*) nativeDisplay;
|
||||
|
||||
plat = _eglGetNativePlatform(native_display_ptr);
|
||||
dpy = _eglFindDisplay(plat, native_display_ptr);
|
||||
return _eglGetDisplayHandle(dpy);
|
||||
disp = _eglFindDisplay(plat, native_display_ptr);
|
||||
return _eglGetDisplayHandle(disp);
|
||||
}
|
||||
|
||||
static EGLDisplay
|
||||
_eglGetPlatformDisplayCommon(EGLenum platform, void *native_display,
|
||||
const EGLAttrib *attrib_list)
|
||||
{
|
||||
_EGLDisplay *dpy;
|
||||
_EGLDisplay *disp;
|
||||
|
||||
switch (platform) {
|
||||
#ifdef HAVE_X11_PLATFORM
|
||||
case EGL_PLATFORM_X11_EXT:
|
||||
dpy = _eglGetX11Display((Display*) native_display, attrib_list);
|
||||
disp = _eglGetX11Display((Display*) native_display, attrib_list);
|
||||
break;
|
||||
#endif
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
case EGL_PLATFORM_GBM_MESA:
|
||||
dpy = _eglGetGbmDisplay((struct gbm_device*) native_display,
|
||||
disp = _eglGetGbmDisplay((struct gbm_device*) native_display,
|
||||
attrib_list);
|
||||
break;
|
||||
#endif
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
case EGL_PLATFORM_WAYLAND_EXT:
|
||||
dpy = _eglGetWaylandDisplay((struct wl_display*) native_display,
|
||||
disp = _eglGetWaylandDisplay((struct wl_display*) native_display,
|
||||
attrib_list);
|
||||
break;
|
||||
#endif
|
||||
#ifdef HAVE_SURFACELESS_PLATFORM
|
||||
case EGL_PLATFORM_SURFACELESS_MESA:
|
||||
dpy = _eglGetSurfacelessDisplay(native_display, attrib_list);
|
||||
disp = _eglGetSurfacelessDisplay(native_display, attrib_list);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
RETURN_EGL_ERROR(NULL, EGL_BAD_PARAMETER, NULL);
|
||||
}
|
||||
|
||||
return _eglGetDisplayHandle(dpy);
|
||||
return _eglGetDisplayHandle(disp);
|
||||
}
|
||||
|
||||
static EGLDisplay EGLAPIENTRY
|
||||
@@ -418,16 +418,16 @@ eglGetPlatformDisplayEXT(EGLenum platform, void *native_display,
|
||||
const EGLint *int_attribs)
|
||||
{
|
||||
EGLAttrib *attrib_list;
|
||||
EGLDisplay display;
|
||||
EGLDisplay disp;
|
||||
|
||||
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL, EGL_NO_DISPLAY);
|
||||
|
||||
if (_eglConvertIntsToAttribs(int_attribs, &attrib_list) != EGL_SUCCESS)
|
||||
RETURN_EGL_ERROR(NULL, EGL_BAD_ALLOC, NULL);
|
||||
|
||||
display = _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
|
||||
disp = _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
|
||||
free(attrib_list);
|
||||
return display;
|
||||
return disp;
|
||||
}
|
||||
|
||||
EGLDisplay EGLAPIENTRY
|
||||
@@ -466,17 +466,17 @@ _eglAppendExtension(char **str, const char *ext)
|
||||
* the driver's Extensions string.
|
||||
*/
|
||||
static void
|
||||
_eglCreateExtensionsString(_EGLDisplay *dpy)
|
||||
_eglCreateExtensionsString(_EGLDisplay *disp)
|
||||
{
|
||||
#define _EGL_CHECK_EXTENSION(ext) \
|
||||
do { \
|
||||
if (dpy->Extensions.ext) { \
|
||||
if (disp->Extensions.ext) { \
|
||||
_eglAppendExtension(&exts, "EGL_" #ext); \
|
||||
assert(exts <= dpy->ExtensionsString + _EGL_MAX_EXTENSIONS_LEN); \
|
||||
assert(exts <= disp->ExtensionsString + _EGL_MAX_EXTENSIONS_LEN); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
char *exts = dpy->ExtensionsString;
|
||||
char *exts = disp->ExtensionsString;
|
||||
|
||||
/* Please keep these sorted alphabetically. */
|
||||
_EGL_CHECK_EXTENSION(ANDROID_blob_cache);
|
||||
@@ -509,8 +509,8 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_texture_2D_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_texture_3D_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_gl_texture_cubemap_image);
|
||||
if (dpy->Extensions.KHR_image_base && dpy->Extensions.KHR_image_pixmap)
|
||||
dpy->Extensions.KHR_image = EGL_TRUE;
|
||||
if (disp->Extensions.KHR_image_base && disp->Extensions.KHR_image_pixmap)
|
||||
disp->Extensions.KHR_image = EGL_TRUE;
|
||||
_EGL_CHECK_EXTENSION(KHR_image);
|
||||
_EGL_CHECK_EXTENSION(KHR_image_base);
|
||||
_EGL_CHECK_EXTENSION(KHR_image_pixmap);
|
||||
@@ -519,12 +519,12 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
|
||||
_EGL_CHECK_EXTENSION(KHR_partial_update);
|
||||
_EGL_CHECK_EXTENSION(KHR_reusable_sync);
|
||||
_EGL_CHECK_EXTENSION(KHR_surfaceless_context);
|
||||
if (dpy->Extensions.EXT_swap_buffers_with_damage)
|
||||
if (disp->Extensions.EXT_swap_buffers_with_damage)
|
||||
_eglAppendExtension(&exts, "EGL_KHR_swap_buffers_with_damage");
|
||||
_EGL_CHECK_EXTENSION(EXT_pixel_format_float);
|
||||
_EGL_CHECK_EXTENSION(KHR_wait_sync);
|
||||
|
||||
if (dpy->Extensions.KHR_no_config_context)
|
||||
if (disp->Extensions.KHR_no_config_context)
|
||||
_eglAppendExtension(&exts, "EGL_MESA_configless_context");
|
||||
_EGL_CHECK_EXTENSION(MESA_drm_image);
|
||||
_EGL_CHECK_EXTENSION(MESA_image_dma_buf_export);
|
||||
@@ -542,29 +542,29 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
|
||||
}
|
||||
|
||||
static void
|
||||
_eglCreateAPIsString(_EGLDisplay *dpy)
|
||||
_eglCreateAPIsString(_EGLDisplay *disp)
|
||||
{
|
||||
#define addstr(str) \
|
||||
{ \
|
||||
const size_t old_len = strlen(dpy->ClientAPIsString); \
|
||||
const size_t old_len = strlen(disp->ClientAPIsString); \
|
||||
const size_t add_len = sizeof(str); \
|
||||
const size_t max_len = sizeof(dpy->ClientAPIsString) - 1; \
|
||||
const size_t max_len = sizeof(disp->ClientAPIsString) - 1; \
|
||||
if (old_len + add_len <= max_len) \
|
||||
strcat(dpy->ClientAPIsString, str " "); \
|
||||
strcat(disp->ClientAPIsString, str " "); \
|
||||
else \
|
||||
assert(!"dpy->ClientAPIsString is not large enough"); \
|
||||
assert(!"disp->ClientAPIsString is not large enough"); \
|
||||
}
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_BIT)
|
||||
if (disp->ClientAPIs & EGL_OPENGL_BIT)
|
||||
addstr("OpenGL");
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENGL_ES_BIT ||
|
||||
dpy->ClientAPIs & EGL_OPENGL_ES2_BIT ||
|
||||
dpy->ClientAPIs & EGL_OPENGL_ES3_BIT_KHR) {
|
||||
if (disp->ClientAPIs & EGL_OPENGL_ES_BIT ||
|
||||
disp->ClientAPIs & EGL_OPENGL_ES2_BIT ||
|
||||
disp->ClientAPIs & EGL_OPENGL_ES3_BIT_KHR) {
|
||||
addstr("OpenGL_ES");
|
||||
}
|
||||
|
||||
if (dpy->ClientAPIs & EGL_OPENVG_BIT)
|
||||
if (disp->ClientAPIs & EGL_OPENVG_BIT)
|
||||
addstr("OpenVG");
|
||||
|
||||
#undef addstr
|
||||
@@ -2290,11 +2290,11 @@ eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface,
|
||||
}
|
||||
|
||||
static EGLBoolean EGLAPIENTRY
|
||||
eglGetSyncValuesCHROMIUM(EGLDisplay display, EGLSurface surface,
|
||||
eglGetSyncValuesCHROMIUM(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLuint64KHR *ust, EGLuint64KHR *msc,
|
||||
EGLuint64KHR *sbc)
|
||||
{
|
||||
_EGLDisplay *disp = _eglLockDisplay(display);
|
||||
_EGLDisplay *disp = _eglLockDisplay(dpy);
|
||||
_EGLSurface *surf = _eglLookupSurface(surface, disp);
|
||||
_EGLDriver *drv;
|
||||
EGLBoolean ret;
|
||||
|
@@ -53,105 +53,105 @@ struct mesa_glinterop_export_out;
|
||||
struct _egl_api
|
||||
{
|
||||
/* driver funcs */
|
||||
EGLBoolean (*Initialize)(_EGLDriver *, _EGLDisplay *dpy);
|
||||
EGLBoolean (*Terminate)(_EGLDriver *, _EGLDisplay *dpy);
|
||||
const char *(*QueryDriverName)(_EGLDisplay *dpy);
|
||||
char *(*QueryDriverConfig)(_EGLDisplay *dpy);
|
||||
EGLBoolean (*Initialize)(_EGLDriver *, _EGLDisplay *disp);
|
||||
EGLBoolean (*Terminate)(_EGLDriver *, _EGLDisplay *disp);
|
||||
const char *(*QueryDriverName)(_EGLDisplay *disp);
|
||||
char *(*QueryDriverConfig)(_EGLDisplay *disp);
|
||||
|
||||
/* config funcs */
|
||||
EGLBoolean (*GetConfigs)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*GetConfigs)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
EGLConfig *configs, EGLint config_size,
|
||||
EGLint *num_config);
|
||||
EGLBoolean (*ChooseConfig)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*ChooseConfig)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
const EGLint *attrib_list, EGLConfig *configs,
|
||||
EGLint config_size, EGLint *num_config);
|
||||
EGLBoolean (*GetConfigAttrib)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*GetConfigAttrib)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *config, EGLint attribute,
|
||||
EGLint *value);
|
||||
|
||||
/* context funcs */
|
||||
_EGLContext *(*CreateContext)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLContext *(*CreateContext)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *config, _EGLContext *share_list,
|
||||
const EGLint *attrib_list);
|
||||
EGLBoolean (*DestroyContext)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*DestroyContext)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx);
|
||||
/* this is the only function (other than Initialize) that may be called
|
||||
* with an uninitialized display
|
||||
*/
|
||||
EGLBoolean (*MakeCurrent)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*MakeCurrent)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *draw, _EGLSurface *read,
|
||||
_EGLContext *ctx);
|
||||
EGLBoolean (*QueryContext)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*QueryContext)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx, EGLint attribute,
|
||||
EGLint *value);
|
||||
|
||||
/* surface funcs */
|
||||
_EGLSurface *(*CreateWindowSurface)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLSurface *(*CreateWindowSurface)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *config, void *native_window,
|
||||
const EGLint *attrib_list);
|
||||
_EGLSurface *(*CreatePixmapSurface)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLSurface *(*CreatePixmapSurface)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *config, void *native_pixmap,
|
||||
const EGLint *attrib_list);
|
||||
_EGLSurface *(*CreatePbufferSurface)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLSurface *(*CreatePbufferSurface)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *config,
|
||||
const EGLint *attrib_list);
|
||||
EGLBoolean (*DestroySurface)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*DestroySurface)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *surface);
|
||||
EGLBoolean (*QuerySurface)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*QuerySurface)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *surface, EGLint attribute,
|
||||
EGLint *value);
|
||||
EGLBoolean (*SurfaceAttrib)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*SurfaceAttrib)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *surface, EGLint attribute,
|
||||
EGLint value);
|
||||
EGLBoolean (*BindTexImage)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*BindTexImage)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *surface, EGLint buffer);
|
||||
EGLBoolean (*ReleaseTexImage)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*ReleaseTexImage)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *surface, EGLint buffer);
|
||||
EGLBoolean (*SwapInterval)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*SwapInterval)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *surf, EGLint interval);
|
||||
EGLBoolean (*SwapBuffers)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*SwapBuffers)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *draw);
|
||||
EGLBoolean (*CopyBuffers)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*CopyBuffers)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *surface, void *native_pixmap_target);
|
||||
EGLBoolean (*SetDamageRegion)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*SetDamageRegion)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *surface, EGLint *rects, EGLint n_rects);
|
||||
|
||||
/* misc functions */
|
||||
EGLBoolean (*WaitClient)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*WaitClient)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx);
|
||||
EGLBoolean (*WaitNative)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*WaitNative)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
EGLint engine);
|
||||
|
||||
/* this function may be called from multiple threads at the same time */
|
||||
_EGLProc (*GetProcAddress)(_EGLDriver *drv, const char *procname);
|
||||
|
||||
_EGLSurface *(*CreatePbufferFromClientBuffer)(_EGLDriver *drv,
|
||||
_EGLDisplay *dpy,
|
||||
_EGLDisplay *disp,
|
||||
EGLenum buftype,
|
||||
EGLClientBuffer buffer,
|
||||
_EGLConfig *config,
|
||||
const EGLint *attrib_list);
|
||||
|
||||
_EGLImage *(*CreateImageKHR)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLImage *(*CreateImageKHR)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx, EGLenum target,
|
||||
EGLClientBuffer buffer,
|
||||
const EGLint *attr_list);
|
||||
EGLBoolean (*DestroyImageKHR)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*DestroyImageKHR)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLImage *image);
|
||||
|
||||
_EGLSync *(*CreateSyncKHR)(_EGLDriver *drv, _EGLDisplay *dpy, EGLenum type,
|
||||
_EGLSync *(*CreateSyncKHR)(_EGLDriver *drv, _EGLDisplay *disp, EGLenum type,
|
||||
const EGLAttrib *attrib_list);
|
||||
EGLBoolean (*DestroySyncKHR)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*DestroySyncKHR)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSync *sync);
|
||||
EGLint (*ClientWaitSyncKHR)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLint (*ClientWaitSyncKHR)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSync *sync, EGLint flags, EGLTime timeout);
|
||||
EGLint (*WaitSyncKHR)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync);
|
||||
EGLBoolean (*SignalSyncKHR)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLint (*WaitSyncKHR)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync);
|
||||
EGLBoolean (*SignalSyncKHR)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSync *sync, EGLenum mode);
|
||||
EGLBoolean (*GetSyncAttrib)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*GetSyncAttrib)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSync *sync, EGLint attribute,
|
||||
EGLAttrib *value);
|
||||
EGLint (*DupNativeFenceFDANDROID)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLint (*DupNativeFenceFDANDROID)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSync *sync);
|
||||
|
||||
EGLBoolean (*SwapBuffersRegionNOK)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
@@ -176,7 +176,7 @@ struct _egl_api
|
||||
_EGLDisplay *disp,
|
||||
_EGLImage *img);
|
||||
|
||||
EGLBoolean (*SwapBuffersWithDamageEXT)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*SwapBuffersWithDamageEXT)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLSurface *surface,
|
||||
const EGLint *rects, EGLint n_rects);
|
||||
|
||||
@@ -185,8 +185,8 @@ struct _egl_api
|
||||
EGLint width, EGLint height);
|
||||
|
||||
EGLint (*QueryBufferAge)(_EGLDriver *drv,
|
||||
_EGLDisplay *dpy, _EGLSurface *surface);
|
||||
EGLBoolean (*GetSyncValuesCHROMIUM)(_EGLDisplay *dpy, _EGLSurface *surface,
|
||||
_EGLDisplay *disp, _EGLSurface *surface);
|
||||
EGLBoolean (*GetSyncValuesCHROMIUM)(_EGLDisplay *disp, _EGLSurface *surface,
|
||||
EGLuint64KHR *ust, EGLuint64KHR *msc,
|
||||
EGLuint64KHR *sbc);
|
||||
|
||||
@@ -198,22 +198,22 @@ struct _egl_api
|
||||
_EGLImage *img, EGLint *fds,
|
||||
EGLint *strides, EGLint *offsets);
|
||||
|
||||
int (*GLInteropQueryDeviceInfo)(_EGLDisplay *dpy, _EGLContext *ctx,
|
||||
int (*GLInteropQueryDeviceInfo)(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
int (*GLInteropExportObject)(_EGLDisplay *dpy, _EGLContext *ctx,
|
||||
int (*GLInteropExportObject)(_EGLDisplay *disp, _EGLContext *ctx,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
|
||||
EGLBoolean (*QueryDmaBufFormatsEXT)(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*QueryDmaBufFormatsEXT)(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
EGLint max_formats, EGLint *formats,
|
||||
EGLint *num_formats);
|
||||
EGLBoolean (*QueryDmaBufModifiersEXT) (_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLBoolean (*QueryDmaBufModifiersEXT) (_EGLDriver *drv, _EGLDisplay *disp,
|
||||
EGLint format, EGLint max_modifiers,
|
||||
EGLuint64KHR *modifiers,
|
||||
EGLBoolean *external_only,
|
||||
EGLint *num_modifiers);
|
||||
|
||||
void (*SetBlobCacheFuncsANDROID) (_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
void (*SetBlobCacheFuncsANDROID) (_EGLDriver *drv, _EGLDisplay *disp,
|
||||
EGLSetBlobFuncANDROID set,
|
||||
EGLGetBlobFuncANDROID get);
|
||||
};
|
||||
|
@@ -56,11 +56,11 @@
|
||||
* IDs are from 1 to N respectively.
|
||||
*/
|
||||
void
|
||||
_eglInitConfig(_EGLConfig *conf, _EGLDisplay *dpy, EGLint id)
|
||||
_eglInitConfig(_EGLConfig *conf, _EGLDisplay *disp, EGLint id)
|
||||
{
|
||||
memset(conf, 0, sizeof(*conf));
|
||||
|
||||
conf->Display = dpy;
|
||||
conf->Display = disp;
|
||||
|
||||
/* some attributes take non-zero default values */
|
||||
conf->ConfigID = id;
|
||||
@@ -81,19 +81,19 @@ _eglInitConfig(_EGLConfig *conf, _EGLDisplay *dpy, EGLint id)
|
||||
EGLConfig
|
||||
_eglLinkConfig(_EGLConfig *conf)
|
||||
{
|
||||
_EGLDisplay *dpy = conf->Display;
|
||||
_EGLDisplay *disp = conf->Display;
|
||||
|
||||
/* sanity check */
|
||||
assert(dpy);
|
||||
assert(disp);
|
||||
assert(conf->ConfigID > 0);
|
||||
|
||||
if (!dpy->Configs) {
|
||||
dpy->Configs = _eglCreateArray("Config", 16);
|
||||
if (!dpy->Configs)
|
||||
if (!disp->Configs) {
|
||||
disp->Configs = _eglCreateArray("Config", 16);
|
||||
if (!disp->Configs)
|
||||
return (EGLConfig) NULL;
|
||||
}
|
||||
|
||||
_eglAppendArray(dpy->Configs, (void *) conf);
|
||||
_eglAppendArray(disp->Configs, (void *) conf);
|
||||
|
||||
return (EGLConfig) conf;
|
||||
}
|
||||
@@ -104,16 +104,16 @@ _eglLinkConfig(_EGLConfig *conf)
|
||||
* Return NULL if the handle has no corresponding linked config.
|
||||
*/
|
||||
_EGLConfig *
|
||||
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy)
|
||||
_eglLookupConfig(EGLConfig config, _EGLDisplay *disp)
|
||||
{
|
||||
_EGLConfig *conf;
|
||||
|
||||
if (!dpy)
|
||||
if (!disp)
|
||||
return NULL;
|
||||
|
||||
conf = (_EGLConfig *) _eglFindArray(dpy->Configs, (void *) config);
|
||||
conf = (_EGLConfig *) _eglFindArray(disp->Configs, (void *) config);
|
||||
if (conf)
|
||||
assert(conf->Display == dpy);
|
||||
assert(conf->Display == disp);
|
||||
|
||||
return conf;
|
||||
}
|
||||
@@ -521,12 +521,12 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
|
||||
* Return EGL_FALSE if any of the attribute is invalid.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
|
||||
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *disp,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
EGLint attr, val, i;
|
||||
|
||||
_eglInitConfig(conf, dpy, EGL_DONT_CARE);
|
||||
_eglInitConfig(conf, disp, EGL_DONT_CARE);
|
||||
|
||||
/* reset to default values */
|
||||
for (i = 0; i < ARRAY_SIZE(_eglValidationTable); i++) {
|
||||
@@ -812,7 +812,7 @@ _eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
|
||||
* Fallback for eglGetConfigAttrib.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
|
||||
_eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
EGLint attribute, EGLint *value)
|
||||
{
|
||||
if (!_eglIsConfigAttribValid(conf, attribute))
|
||||
|
@@ -175,7 +175,7 @@ _eglGetConfigKey(const _EGLConfig *conf, EGLint key)
|
||||
|
||||
|
||||
extern void
|
||||
_eglInitConfig(_EGLConfig *config, _EGLDisplay *dpy, EGLint id);
|
||||
_eglInitConfig(_EGLConfig *config, _EGLDisplay *disp, EGLint id);
|
||||
|
||||
|
||||
extern EGLConfig
|
||||
@@ -183,7 +183,7 @@ _eglLinkConfig(_EGLConfig *conf);
|
||||
|
||||
|
||||
extern _EGLConfig *
|
||||
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy);
|
||||
_eglLookupConfig(EGLConfig config, _EGLDisplay *disp);
|
||||
|
||||
|
||||
/**
|
||||
@@ -205,7 +205,7 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
|
||||
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *disp,
|
||||
const EGLint *attrib_list);
|
||||
|
||||
|
||||
@@ -224,15 +224,15 @@ _eglFilterConfigArray(_EGLArray *array, EGLConfig *configs,
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglChooseConfig(_EGLDriver *drv, _EGLDisplay *dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
_eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, EGLint attribute, EGLint *value);
|
||||
_eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf, EGLint attribute, EGLint *value);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglGetConfigs(_EGLDriver *drv, _EGLDisplay *dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
_eglGetConfigs(_EGLDriver *drv, _EGLDisplay *disp, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -82,7 +82,7 @@ _eglGetContextAPIBit(_EGLContext *ctx)
|
||||
* Parse the list of context attributes and return the proper error code.
|
||||
*/
|
||||
static EGLint
|
||||
_eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
_eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *disp,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
EGLenum api = ctx->ClientAPI;
|
||||
@@ -119,7 +119,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
* generate an error."
|
||||
*/
|
||||
if ((api != EGL_OPENGL_ES_API &&
|
||||
(!dpy->Extensions.KHR_create_context || api != EGL_OPENGL_API))) {
|
||||
(!disp->Extensions.KHR_create_context || api != EGL_OPENGL_API))) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
* contexts, and specifying them for other types of contexts will
|
||||
* generate an error."
|
||||
*/
|
||||
if (!dpy->Extensions.KHR_create_context ||
|
||||
if (!disp->Extensions.KHR_create_context ||
|
||||
(api != EGL_OPENGL_ES_API && api != EGL_OPENGL_API)) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
@@ -146,7 +146,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_FLAGS_KHR:
|
||||
if (!dpy->Extensions.KHR_create_context) {
|
||||
if (!disp->Extensions.KHR_create_context) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -220,7 +220,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR:
|
||||
if (!dpy->Extensions.KHR_create_context) {
|
||||
if (!disp->Extensions.KHR_create_context) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
* types of contexts, including OpenGL ES contexts, will generate
|
||||
* an error."
|
||||
*/
|
||||
if (!dpy->Extensions.KHR_create_context
|
||||
if (!disp->Extensions.KHR_create_context
|
||||
|| api != EGL_OPENGL_API) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
@@ -264,7 +264,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
* meaningful for OpenGL ES contexts, and specifying it for other
|
||||
* types of contexts will generate an EGL_BAD_ATTRIBUTE error."
|
||||
*/
|
||||
if (!dpy->Extensions.EXT_create_context_robustness
|
||||
if (!disp->Extensions.EXT_create_context_robustness
|
||||
|| api != EGL_OPENGL_ES_API) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
@@ -274,7 +274,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT:
|
||||
if (!dpy->Extensions.EXT_create_context_robustness) {
|
||||
if (!disp->Extensions.EXT_create_context_robustness) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_ROBUST_ACCESS:
|
||||
if (dpy->Version < 15) {
|
||||
if (disp->Version < 15) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -294,7 +294,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_DEBUG:
|
||||
if (dpy->Version < 15) {
|
||||
if (disp->Version < 15) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -304,7 +304,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE:
|
||||
if (dpy->Version < 15) {
|
||||
if (disp->Version < 15) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -314,8 +314,8 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_NO_ERROR_KHR:
|
||||
if (dpy->Version < 14 ||
|
||||
!dpy->Extensions.KHR_create_context_no_error) {
|
||||
if (disp->Version < 14 ||
|
||||
!disp->Extensions.KHR_create_context_no_error) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -381,7 +381,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
* the driver would fail, and ctx->ContextPriority matches the
|
||||
* hint applied to the driver/hardware backend.
|
||||
*/
|
||||
if (dpy->Extensions.IMG_context_priority & (1 << bit))
|
||||
if (disp->Extensions.IMG_context_priority & (1 << bit))
|
||||
ctx->ContextPriority = val;
|
||||
|
||||
break;
|
||||
@@ -577,7 +577,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
* responsible for determining whether that's an API it supports.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
|
||||
_eglInitContext(_EGLContext *ctx, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
const EGLenum api = eglQueryAPI();
|
||||
@@ -586,7 +586,7 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
|
||||
if (api == EGL_NONE)
|
||||
return _eglError(EGL_BAD_MATCH, "eglCreateContext(no client API)");
|
||||
|
||||
_eglInitResource(&ctx->Resource, sizeof(*ctx), dpy);
|
||||
_eglInitResource(&ctx->Resource, sizeof(*ctx), disp);
|
||||
ctx->ClientAPI = api;
|
||||
ctx->Config = conf;
|
||||
ctx->Profile = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
@@ -598,7 +598,7 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
|
||||
ctx->ContextPriority = EGL_CONTEXT_PRIORITY_MEDIUM_IMG;
|
||||
ctx->ReleaseBehavior = EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR;
|
||||
|
||||
err = _eglParseContextAttribList(ctx, dpy, attrib_list);
|
||||
err = _eglParseContextAttribList(ctx, disp, attrib_list);
|
||||
if (err == EGL_SUCCESS && ctx->Config) {
|
||||
EGLint api_bit;
|
||||
|
||||
@@ -660,11 +660,11 @@ _eglQueryContextRenderBuffer(_EGLContext *ctx)
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *c,
|
||||
_eglQueryContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *c,
|
||||
EGLint attribute, EGLint *value)
|
||||
{
|
||||
(void) drv;
|
||||
(void) dpy;
|
||||
(void) disp;
|
||||
|
||||
if (!value)
|
||||
return _eglError(EGL_BAD_PARAMETER, "eglQueryContext");
|
||||
@@ -731,7 +731,7 @@ static EGLBoolean
|
||||
_eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
|
||||
{
|
||||
_EGLThreadInfo *t = _eglGetCurrentThread();
|
||||
_EGLDisplay *dpy;
|
||||
_EGLDisplay *disp;
|
||||
|
||||
if (_eglIsCurrentThreadDummy())
|
||||
return _eglError(EGL_BAD_ALLOC, "eglMakeCurrent");
|
||||
@@ -743,8 +743,8 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
dpy = ctx->Resource.Display;
|
||||
if (!dpy->Extensions.KHR_surfaceless_context
|
||||
disp = ctx->Resource.Display;
|
||||
if (!disp->Extensions.KHR_surfaceless_context
|
||||
&& (draw == NULL || read == NULL))
|
||||
return _eglError(EGL_BAD_MATCH, "eglMakeCurrent");
|
||||
|
||||
@@ -780,7 +780,7 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
|
||||
} else {
|
||||
/* Otherwise we must be using the EGL_KHR_no_config_context
|
||||
* extension */
|
||||
assert(dpy->Extensions.KHR_no_config_context);
|
||||
assert(disp->Extensions.KHR_no_config_context);
|
||||
|
||||
/* The extension doesn't permit binding draw and read buffers with
|
||||
* differing contexts */
|
||||
|
@@ -69,12 +69,12 @@ struct _egl_context
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy,
|
||||
_eglInitContext(_EGLContext *ctx, _EGLDisplay *disp,
|
||||
_EGLConfig *config, const EGLint *attrib_list);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLint attribute, EGLint *value);
|
||||
_eglQueryContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx, EGLint attribute, EGLint *value);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
@@ -136,10 +136,10 @@ _eglUnlinkContext(_EGLContext *ctx)
|
||||
* Return NULL if the handle has no corresponding linked context.
|
||||
*/
|
||||
static inline _EGLContext *
|
||||
_eglLookupContext(EGLContext context, _EGLDisplay *dpy)
|
||||
_eglLookupContext(EGLContext context, _EGLDisplay *disp)
|
||||
{
|
||||
_EGLContext *ctx = (_EGLContext *) context;
|
||||
if (!dpy || !_eglCheckResource((void *) ctx, _EGL_RESOURCE_CONTEXT, dpy))
|
||||
if (!disp || !_eglCheckResource((void *) ctx, _EGL_RESOURCE_CONTEXT, disp))
|
||||
ctx = NULL;
|
||||
return ctx;
|
||||
}
|
||||
|
@@ -184,25 +184,25 @@ _eglGetNativePlatform(void *nativeDisplay)
|
||||
void
|
||||
_eglFiniDisplay(void)
|
||||
{
|
||||
_EGLDisplay *dpyList, *dpy;
|
||||
_EGLDisplay *dispList, *disp;
|
||||
|
||||
/* atexit function is called with global mutex locked */
|
||||
dpyList = _eglGlobal.DisplayList;
|
||||
while (dpyList) {
|
||||
dispList = _eglGlobal.DisplayList;
|
||||
while (dispList) {
|
||||
EGLint i;
|
||||
|
||||
/* pop list head */
|
||||
dpy = dpyList;
|
||||
dpyList = dpyList->Next;
|
||||
disp = dispList;
|
||||
dispList = dispList->Next;
|
||||
|
||||
for (i = 0; i < _EGL_NUM_RESOURCES; i++) {
|
||||
if (dpy->ResourceLists[i]) {
|
||||
_eglLog(_EGL_DEBUG, "Display %p is destroyed with resources", dpy);
|
||||
if (disp->ResourceLists[i]) {
|
||||
_eglLog(_EGL_DEBUG, "Display %p is destroyed with resources", disp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
free(dpy);
|
||||
free(disp);
|
||||
}
|
||||
_eglGlobal.DisplayList = NULL;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ _eglFiniDisplay(void)
|
||||
_EGLDisplay *
|
||||
_eglFindDisplay(_EGLPlatformType plat, void *plat_dpy)
|
||||
{
|
||||
_EGLDisplay *dpy;
|
||||
_EGLDisplay *disp;
|
||||
|
||||
if (plat == _EGL_INVALID_PLATFORM)
|
||||
return NULL;
|
||||
@@ -223,30 +223,30 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy)
|
||||
mtx_lock(_eglGlobal.Mutex);
|
||||
|
||||
/* search the display list first */
|
||||
dpy = _eglGlobal.DisplayList;
|
||||
while (dpy) {
|
||||
if (dpy->Platform == plat && dpy->PlatformDisplay == plat_dpy)
|
||||
disp = _eglGlobal.DisplayList;
|
||||
while (disp) {
|
||||
if (disp->Platform == plat && disp->PlatformDisplay == plat_dpy)
|
||||
break;
|
||||
dpy = dpy->Next;
|
||||
disp = disp->Next;
|
||||
}
|
||||
|
||||
/* create a new display */
|
||||
if (!dpy) {
|
||||
dpy = calloc(1, sizeof(_EGLDisplay));
|
||||
if (dpy) {
|
||||
mtx_init(&dpy->Mutex, mtx_plain);
|
||||
dpy->Platform = plat;
|
||||
dpy->PlatformDisplay = plat_dpy;
|
||||
if (!disp) {
|
||||
disp = calloc(1, sizeof(_EGLDisplay));
|
||||
if (disp) {
|
||||
mtx_init(&disp->Mutex, mtx_plain);
|
||||
disp->Platform = plat;
|
||||
disp->PlatformDisplay = plat_dpy;
|
||||
|
||||
/* add to the display list */
|
||||
dpy->Next = _eglGlobal.DisplayList;
|
||||
_eglGlobal.DisplayList = dpy;
|
||||
disp->Next = _eglGlobal.DisplayList;
|
||||
_eglGlobal.DisplayList = disp;
|
||||
}
|
||||
}
|
||||
|
||||
mtx_unlock(_eglGlobal.Mutex);
|
||||
|
||||
return dpy;
|
||||
return disp;
|
||||
}
|
||||
|
||||
|
||||
@@ -341,16 +341,16 @@ _eglCheckDisplayHandle(EGLDisplay dpy)
|
||||
* own the resource.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy)
|
||||
_eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *disp)
|
||||
{
|
||||
_EGLResource *list = dpy->ResourceLists[type];
|
||||
_EGLResource *list = disp->ResourceLists[type];
|
||||
|
||||
if (!res)
|
||||
return EGL_FALSE;
|
||||
|
||||
while (list) {
|
||||
if (res == (void *) list) {
|
||||
assert(list->Display == dpy);
|
||||
assert(list->Display == disp);
|
||||
break;
|
||||
}
|
||||
list = list->Next;
|
||||
@@ -368,10 +368,10 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy)
|
||||
* _eglInitContext or _eglInitSurface.
|
||||
*/
|
||||
void
|
||||
_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *dpy)
|
||||
_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *disp)
|
||||
{
|
||||
memset(res, 0, size);
|
||||
res->Display = dpy;
|
||||
res->Display = disp;
|
||||
res->RefCount = 1;
|
||||
}
|
||||
|
||||
|
@@ -206,7 +206,7 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy);
|
||||
|
||||
|
||||
extern void
|
||||
_eglReleaseDisplayResources(_EGLDriver *drv, _EGLDisplay *dpy);
|
||||
_eglReleaseDisplayResources(_EGLDriver *drv, _EGLDisplay *disp);
|
||||
|
||||
|
||||
extern void
|
||||
@@ -218,7 +218,7 @@ _eglCheckDisplayHandle(EGLDisplay dpy);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy);
|
||||
_eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *disp);
|
||||
|
||||
|
||||
/**
|
||||
@@ -226,12 +226,12 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy);
|
||||
* Return NULL if the handle has no corresponding linked display.
|
||||
*/
|
||||
static inline _EGLDisplay *
|
||||
_eglLookupDisplay(EGLDisplay display)
|
||||
_eglLookupDisplay(EGLDisplay dpy)
|
||||
{
|
||||
_EGLDisplay *dpy = (_EGLDisplay *) display;
|
||||
if (!_eglCheckDisplayHandle(display))
|
||||
dpy = NULL;
|
||||
return dpy;
|
||||
_EGLDisplay *disp = (_EGLDisplay *) dpy;
|
||||
if (!_eglCheckDisplayHandle(dpy))
|
||||
disp = NULL;
|
||||
return disp;
|
||||
}
|
||||
|
||||
|
||||
@@ -239,14 +239,14 @@ _eglLookupDisplay(EGLDisplay display)
|
||||
* Return the handle of a linked display, or EGL_NO_DISPLAY.
|
||||
*/
|
||||
static inline EGLDisplay
|
||||
_eglGetDisplayHandle(_EGLDisplay *dpy)
|
||||
_eglGetDisplayHandle(_EGLDisplay *disp)
|
||||
{
|
||||
return (EGLDisplay) ((dpy) ? dpy : EGL_NO_DISPLAY);
|
||||
return (EGLDisplay) ((disp) ? disp : EGL_NO_DISPLAY);
|
||||
}
|
||||
|
||||
|
||||
extern void
|
||||
_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *dpy);
|
||||
_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *disp);
|
||||
|
||||
|
||||
extern void
|
||||
|
@@ -68,10 +68,10 @@ _eglGetDriver(void)
|
||||
}
|
||||
|
||||
static _EGLDriver *
|
||||
_eglMatchAndInitialize(_EGLDisplay *dpy)
|
||||
_eglMatchAndInitialize(_EGLDisplay *disp)
|
||||
{
|
||||
if (_eglGetDriver())
|
||||
if (_eglDriver->API.Initialize(_eglDriver, dpy))
|
||||
if (_eglDriver->API.Initialize(_eglDriver, disp))
|
||||
return _eglDriver;
|
||||
|
||||
return NULL;
|
||||
@@ -82,25 +82,25 @@ _eglMatchAndInitialize(_EGLDisplay *dpy)
|
||||
* driver that can initialize the display.
|
||||
*/
|
||||
_EGLDriver *
|
||||
_eglMatchDriver(_EGLDisplay *dpy)
|
||||
_eglMatchDriver(_EGLDisplay *disp)
|
||||
{
|
||||
_EGLDriver *best_drv;
|
||||
|
||||
assert(!dpy->Initialized);
|
||||
assert(!disp->Initialized);
|
||||
|
||||
/* set options */
|
||||
dpy->Options.ForceSoftware =
|
||||
disp->Options.ForceSoftware =
|
||||
env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
|
||||
|
||||
best_drv = _eglMatchAndInitialize(dpy);
|
||||
if (!best_drv && !dpy->Options.ForceSoftware) {
|
||||
dpy->Options.ForceSoftware = EGL_TRUE;
|
||||
best_drv = _eglMatchAndInitialize(dpy);
|
||||
best_drv = _eglMatchAndInitialize(disp);
|
||||
if (!best_drv && !disp->Options.ForceSoftware) {
|
||||
disp->Options.ForceSoftware = EGL_TRUE;
|
||||
best_drv = _eglMatchAndInitialize(disp);
|
||||
}
|
||||
|
||||
if (best_drv) {
|
||||
dpy->Driver = best_drv;
|
||||
dpy->Initialized = EGL_TRUE;
|
||||
disp->Driver = best_drv;
|
||||
disp->Initialized = EGL_TRUE;
|
||||
}
|
||||
|
||||
return best_drv;
|
||||
|
@@ -84,7 +84,7 @@ _eglInitDriver(_EGLDriver *driver);
|
||||
|
||||
|
||||
extern _EGLDriver *
|
||||
_eglMatchDriver(_EGLDisplay *dpy);
|
||||
_eglMatchDriver(_EGLDisplay *disp);
|
||||
|
||||
|
||||
extern __eglMustCastToProperFunctionPointerType
|
||||
|
@@ -35,25 +35,25 @@
|
||||
#include "egllog.h"
|
||||
|
||||
static EGLint
|
||||
_eglParseKHRImageAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
_eglParseKHRImageAttribs(_EGLImageAttribs *attrs, _EGLDisplay *disp,
|
||||
EGLint attr, EGLint val)
|
||||
{
|
||||
switch (attr) {
|
||||
case EGL_IMAGE_PRESERVED_KHR:
|
||||
if (!dpy->Extensions.KHR_image_base)
|
||||
if (!disp->Extensions.KHR_image_base)
|
||||
return EGL_BAD_PARAMETER;
|
||||
|
||||
attrs->ImagePreserved = val;
|
||||
break;
|
||||
|
||||
case EGL_GL_TEXTURE_LEVEL_KHR:
|
||||
if (!dpy->Extensions.KHR_gl_texture_2D_image)
|
||||
if (!disp->Extensions.KHR_gl_texture_2D_image)
|
||||
return EGL_BAD_PARAMETER;
|
||||
|
||||
attrs->GLTextureLevel = val;
|
||||
break;
|
||||
case EGL_GL_TEXTURE_ZOFFSET_KHR:
|
||||
if (!dpy->Extensions.KHR_gl_texture_3D_image)
|
||||
if (!disp->Extensions.KHR_gl_texture_3D_image)
|
||||
return EGL_BAD_PARAMETER;
|
||||
|
||||
attrs->GLTextureZOffset = val;
|
||||
@@ -66,10 +66,10 @@ _eglParseKHRImageAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
}
|
||||
|
||||
static EGLint
|
||||
_eglParseMESADrmImageAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
_eglParseMESADrmImageAttribs(_EGLImageAttribs *attrs, _EGLDisplay *disp,
|
||||
EGLint attr, EGLint val)
|
||||
{
|
||||
if (!dpy->Extensions.MESA_drm_image)
|
||||
if (!disp->Extensions.MESA_drm_image)
|
||||
return EGL_BAD_PARAMETER;
|
||||
|
||||
switch (attr) {
|
||||
@@ -96,10 +96,10 @@ _eglParseMESADrmImageAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
}
|
||||
|
||||
static EGLint
|
||||
_eglParseWLBindWaylandDisplayAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
_eglParseWLBindWaylandDisplayAttribs(_EGLImageAttribs *attrs, _EGLDisplay *disp,
|
||||
EGLint attr, EGLint val)
|
||||
{
|
||||
if (!dpy->Extensions.WL_bind_wayland_display)
|
||||
if (!disp->Extensions.WL_bind_wayland_display)
|
||||
return EGL_BAD_PARAMETER;
|
||||
|
||||
switch (attr) {
|
||||
@@ -114,10 +114,10 @@ _eglParseWLBindWaylandDisplayAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
}
|
||||
|
||||
static EGLint
|
||||
_eglParseEXTImageDmaBufImportAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
_eglParseEXTImageDmaBufImportAttribs(_EGLImageAttribs *attrs, _EGLDisplay *disp,
|
||||
EGLint attr, EGLint val)
|
||||
{
|
||||
if (!dpy->Extensions.EXT_image_dma_buf_import)
|
||||
if (!disp->Extensions.EXT_image_dma_buf_import)
|
||||
return EGL_BAD_PARAMETER;
|
||||
|
||||
switch (attr) {
|
||||
@@ -207,10 +207,10 @@ _eglParseEXTImageDmaBufImportAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
|
||||
static EGLint
|
||||
_eglParseEXTImageDmaBufImportModifiersAttribs(_EGLImageAttribs *attrs,
|
||||
_EGLDisplay *dpy,
|
||||
_EGLDisplay *disp,
|
||||
EGLint attr, EGLint val)
|
||||
{
|
||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||
if (!disp->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||
return EGL_BAD_PARAMETER;
|
||||
|
||||
switch (attr) {
|
||||
@@ -272,7 +272,7 @@ _eglParseEXTImageDmaBufImportModifiersAttribs(_EGLImageAttribs *attrs,
|
||||
* Function calls _eglError to set the correct error code.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *disp,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
EGLint i, err;
|
||||
@@ -286,19 +286,19 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
EGLint attr = attrib_list[i++];
|
||||
EGLint val = attrib_list[i];
|
||||
|
||||
err = _eglParseKHRImageAttribs(attrs, dpy, attr, val);
|
||||
err = _eglParseKHRImageAttribs(attrs, disp, attr, val);
|
||||
if (err == EGL_SUCCESS)
|
||||
continue;
|
||||
|
||||
err = _eglParseMESADrmImageAttribs(attrs, dpy, attr, val);
|
||||
err = _eglParseMESADrmImageAttribs(attrs, disp, attr, val);
|
||||
if (err == EGL_SUCCESS)
|
||||
continue;
|
||||
|
||||
err = _eglParseWLBindWaylandDisplayAttribs(attrs, dpy, attr, val);
|
||||
err = _eglParseWLBindWaylandDisplayAttribs(attrs, disp, attr, val);
|
||||
if (err == EGL_SUCCESS)
|
||||
continue;
|
||||
|
||||
err = _eglParseEXTImageDmaBufImportAttribs(attrs, dpy, attr, val);
|
||||
err = _eglParseEXTImageDmaBufImportAttribs(attrs, disp, attr, val);
|
||||
if (err == EGL_SUCCESS)
|
||||
continue;
|
||||
|
||||
@@ -309,7 +309,7 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
if (err == EGL_BAD_ATTRIBUTE)
|
||||
return _eglError(err, __func__);
|
||||
|
||||
err = _eglParseEXTImageDmaBufImportModifiersAttribs(attrs, dpy, attr, val);
|
||||
err = _eglParseEXTImageDmaBufImportModifiersAttribs(attrs, disp, attr, val);
|
||||
if (err == EGL_SUCCESS)
|
||||
continue;
|
||||
|
||||
|
@@ -92,14 +92,14 @@ struct _egl_image
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *disp,
|
||||
const EGLint *attrib_list);
|
||||
|
||||
|
||||
static inline void
|
||||
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy)
|
||||
_eglInitImage(_EGLImage *img, _EGLDisplay *disp)
|
||||
{
|
||||
_eglInitResource(&img->Resource, sizeof(*img), dpy);
|
||||
_eglInitResource(&img->Resource, sizeof(*img), disp);
|
||||
}
|
||||
|
||||
|
||||
@@ -153,10 +153,10 @@ _eglUnlinkImage(_EGLImage *img)
|
||||
* Return NULL if the handle has no corresponding linked image.
|
||||
*/
|
||||
static inline _EGLImage *
|
||||
_eglLookupImage(EGLImage image, _EGLDisplay *dpy)
|
||||
_eglLookupImage(EGLImage image, _EGLDisplay *disp)
|
||||
{
|
||||
_EGLImage *img = (_EGLImage *) image;
|
||||
if (!dpy || !_eglCheckResource((void *) img, _EGL_RESOURCE_IMAGE, dpy))
|
||||
if (!disp || !_eglCheckResource((void *) img, _EGL_RESOURCE_IMAGE, disp))
|
||||
img = NULL;
|
||||
return img;
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@
|
||||
static EGLint
|
||||
_eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
|
||||
{
|
||||
_EGLDisplay *dpy = surf->Resource.Display;
|
||||
_EGLDisplay *disp = surf->Resource.Display;
|
||||
EGLint type = surf->Type;
|
||||
EGLint texture_type = EGL_PBUFFER_BIT;
|
||||
EGLint i, err = EGL_SUCCESS;
|
||||
@@ -63,7 +63,7 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
|
||||
if (!attrib_list)
|
||||
return EGL_SUCCESS;
|
||||
|
||||
if (dpy->Extensions.NOK_texture_from_pixmap)
|
||||
if (disp->Extensions.NOK_texture_from_pixmap)
|
||||
texture_type |= EGL_PIXMAP_BIT;
|
||||
|
||||
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
|
||||
@@ -73,7 +73,7 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
|
||||
switch (attr) {
|
||||
/* common attributes */
|
||||
case EGL_GL_COLORSPACE_KHR:
|
||||
if (!dpy->Extensions.KHR_gl_colorspace) {
|
||||
if (!disp->Extensions.KHR_gl_colorspace) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -89,84 +89,84 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
|
||||
surf->GLColorspace = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.display_primary_r.x = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.display_primary_r.y = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.display_primary_g.x = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.display_primary_g.y = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.display_primary_b.x = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.display_primary_b.y = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_WHITE_POINT_X_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.white_point.x = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_WHITE_POINT_Y_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.white_point.y = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_MAX_LUMINANCE_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.max_luminance = val;
|
||||
break;
|
||||
case EGL_SMPTE2086_MIN_LUMINANCE_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_SMPTE2086_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.min_luminance = val;
|
||||
break;
|
||||
case EGL_CTA861_3_MAX_CONTENT_LIGHT_LEVEL_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_CTA861_3_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_CTA861_3_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
surf->HdrMetadata.max_cll = val;
|
||||
break;
|
||||
case EGL_CTA861_3_MAX_FRAME_AVERAGE_LEVEL_EXT:
|
||||
if (!dpy->Extensions.EXT_surface_CTA861_3_metadata) {
|
||||
if (!disp->Extensions.EXT_surface_CTA861_3_metadata) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -217,7 +217,7 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
|
||||
}
|
||||
break;
|
||||
case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
|
||||
if (!dpy->Extensions.NV_post_sub_buffer ||
|
||||
if (!disp->Extensions.NV_post_sub_buffer ||
|
||||
type != EGL_WINDOW_BIT) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
@@ -333,7 +333,7 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
|
||||
* \return EGL_TRUE if no errors, EGL_FALSE otherwise.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
|
||||
_eglInitSurface(_EGLSurface *surf, _EGLDisplay *disp, EGLint type,
|
||||
_EGLConfig *conf, const EGLint *attrib_list)
|
||||
{
|
||||
const char *func;
|
||||
@@ -366,7 +366,7 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
|
||||
/* The config can't be used to create a surface of this type */
|
||||
return _eglError(EGL_BAD_MATCH, func);
|
||||
|
||||
_eglInitResource(&surf->Resource, sizeof(*surf), dpy);
|
||||
_eglInitResource(&surf->Resource, sizeof(*surf), disp);
|
||||
surf->Type = type;
|
||||
surf->Config = conf;
|
||||
surf->Lost = EGL_FALSE;
|
||||
@@ -426,7 +426,7 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
_eglQuerySurface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface,
|
||||
EGLint attribute, EGLint *value)
|
||||
{
|
||||
switch (attribute) {
|
||||
@@ -513,7 +513,7 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
*value = surface->VGColorspace;
|
||||
break;
|
||||
case EGL_GL_COLORSPACE_KHR:
|
||||
if (!dpy->Extensions.KHR_gl_colorspace)
|
||||
if (!disp->Extensions.KHR_gl_colorspace)
|
||||
return _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
|
||||
|
||||
*value = surface->GLColorspace;
|
||||
@@ -522,11 +522,11 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
*value = surface->PostSubBufferSupportedNV;
|
||||
break;
|
||||
case EGL_BUFFER_AGE_EXT:
|
||||
if (!dpy->Extensions.EXT_buffer_age)
|
||||
if (!disp->Extensions.EXT_buffer_age)
|
||||
return _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
|
||||
|
||||
_EGLContext *ctx = _eglGetCurrentContext();
|
||||
EGLint result = drv->API.QueryBufferAge(drv, dpy, surface);
|
||||
EGLint result = drv->API.QueryBufferAge(drv, disp, surface);
|
||||
/* error happened */
|
||||
if (result < 0)
|
||||
return EGL_FALSE;
|
||||
@@ -585,7 +585,7 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
* Default fallback routine - drivers might override this.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
_eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface,
|
||||
EGLint attribute, EGLint value)
|
||||
{
|
||||
EGLint confval;
|
||||
@@ -621,7 +621,7 @@ _eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
surface->MultisampleResolve = value;
|
||||
break;
|
||||
case EGL_RENDER_BUFFER:
|
||||
if (!dpy->Extensions.KHR_mutable_render_buffer) {
|
||||
if (!disp->Extensions.KHR_mutable_render_buffer) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
@@ -710,7 +710,7 @@ _eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
_eglBindTexImage(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface,
|
||||
EGLint buffer)
|
||||
{
|
||||
EGLint texture_type = EGL_PBUFFER_BIT;
|
||||
@@ -719,7 +719,7 @@ _eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
* Drivers must implement the real stuff.
|
||||
*/
|
||||
|
||||
if (dpy->Extensions.NOK_texture_from_pixmap)
|
||||
if (disp->Extensions.NOK_texture_from_pixmap)
|
||||
texture_type |= EGL_PIXMAP_BIT;
|
||||
|
||||
if (!(surface->Type & texture_type))
|
||||
@@ -740,7 +740,7 @@ _eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
_eglReleaseTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
|
||||
_eglReleaseTexImage(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
|
||||
EGLint buffer)
|
||||
{
|
||||
/* Just do basic error checking and return success/fail.
|
||||
@@ -764,7 +764,7 @@ _eglReleaseTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
|
||||
if (buffer != EGL_BACK_BUFFER)
|
||||
return _eglError(EGL_BAD_PARAMETER, "eglReleaseTexImage");
|
||||
|
||||
if (dpy->Extensions.NOK_texture_from_pixmap)
|
||||
if (disp->Extensions.NOK_texture_from_pixmap)
|
||||
texture_type |= EGL_PIXMAP_BIT;
|
||||
|
||||
if (!(surf->Type & texture_type))
|
||||
@@ -777,7 +777,7 @@ _eglReleaseTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
|
||||
_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
|
||||
EGLint interval)
|
||||
{
|
||||
return EGL_TRUE;
|
||||
|
@@ -174,27 +174,27 @@ struct _egl_surface
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
|
||||
_eglInitSurface(_EGLSurface *surf, _EGLDisplay *disp, EGLint type,
|
||||
_EGLConfig *config, const EGLint *attrib_list);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint attribute, EGLint *value);
|
||||
_eglQuerySurface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint attribute, EGLint *value);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint attribute, EGLint value);
|
||||
_eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint attribute, EGLint value);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint buffer);
|
||||
_eglBindTexImage(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint buffer);
|
||||
|
||||
extern EGLBoolean
|
||||
_eglReleaseTexImage(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint buffer);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint interval);
|
||||
_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint interval);
|
||||
|
||||
extern EGLBoolean
|
||||
_eglSurfaceHasMutableRenderBuffer(_EGLSurface *surf);
|
||||
@@ -252,10 +252,10 @@ _eglUnlinkSurface(_EGLSurface *surf)
|
||||
* Return NULL if the handle has no corresponding linked surface.
|
||||
*/
|
||||
static inline _EGLSurface *
|
||||
_eglLookupSurface(EGLSurface surface, _EGLDisplay *dpy)
|
||||
_eglLookupSurface(EGLSurface surface, _EGLDisplay *disp)
|
||||
{
|
||||
_EGLSurface *surf = (_EGLSurface *) surface;
|
||||
if (!dpy || !_eglCheckResource((void *) surf, _EGL_RESOURCE_SURFACE, dpy))
|
||||
if (!disp || !_eglCheckResource((void *) surf, _EGL_RESOURCE_SURFACE, disp))
|
||||
surf = NULL;
|
||||
return surf;
|
||||
}
|
||||
|
@@ -83,12 +83,12 @@ _eglParseSyncAttribList(_EGLSync *sync, const EGLAttrib *attrib_list)
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
|
||||
_eglInitSync(_EGLSync *sync, _EGLDisplay *disp, EGLenum type,
|
||||
const EGLAttrib *attrib_list)
|
||||
{
|
||||
EGLint err;
|
||||
|
||||
_eglInitResource(&sync->Resource, sizeof(*sync), dpy);
|
||||
_eglInitResource(&sync->Resource, sizeof(*sync), disp);
|
||||
sync->Type = type;
|
||||
sync->SyncStatus = EGL_UNSIGNALED_KHR;
|
||||
sync->SyncFd = EGL_NO_NATIVE_FENCE_FD_ANDROID;
|
||||
@@ -120,7 +120,7 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglGetSyncAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
_eglGetSyncAttrib(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync,
|
||||
EGLint attribute, EGLAttrib *value)
|
||||
{
|
||||
switch (attribute) {
|
||||
@@ -134,7 +134,7 @@ _eglGetSyncAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
sync->Type == EGL_SYNC_CL_EVENT_KHR ||
|
||||
sync->Type == EGL_SYNC_REUSABLE_KHR ||
|
||||
sync->Type == EGL_SYNC_NATIVE_FENCE_ANDROID))
|
||||
drv->API.ClientWaitSyncKHR(drv, dpy, sync, 0, 0);
|
||||
drv->API.ClientWaitSyncKHR(drv, disp, sync, 0, 0);
|
||||
|
||||
*value = sync->SyncStatus;
|
||||
break;
|
||||
|
@@ -53,12 +53,12 @@ struct _egl_sync
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
|
||||
_eglInitSync(_EGLSync *sync, _EGLDisplay *disp, EGLenum type,
|
||||
const EGLAttrib *attrib_list);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglGetSyncAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
_eglGetSyncAttrib(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync,
|
||||
EGLint attribute, EGLAttrib *value);
|
||||
|
||||
|
||||
@@ -111,10 +111,10 @@ _eglUnlinkSync(_EGLSync *sync)
|
||||
* Return NULL if the handle has no corresponding linked sync.
|
||||
*/
|
||||
static inline _EGLSync *
|
||||
_eglLookupSync(EGLSync handle, _EGLDisplay *dpy)
|
||||
_eglLookupSync(EGLSync handle, _EGLDisplay *disp)
|
||||
{
|
||||
_EGLSync *sync = (_EGLSync *) handle;
|
||||
if (!dpy || !_eglCheckResource((void *) sync, _EGL_RESOURCE_SYNC, dpy))
|
||||
if (!disp || !_eglCheckResource((void *) sync, _EGL_RESOURCE_SYNC, disp))
|
||||
sync = NULL;
|
||||
return sync;
|
||||
}
|
||||
|
Reference in New Issue
Block a user