}
EGLBoolean
-dri2_init_surface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
+dri2_init_surface(_EGLSurface *surf, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, const EGLint *attrib_list, EGLBoolean enable_out_fence)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
dri2_surf->out_fence_fd = -1;
dri2_surf->enable_out_fence = false;
dri2_surf->enable_out_fence = enable_out_fence;
}
- return _eglInitSurface(surf, dpy, type, conf, attrib_list);
+ return _eglInitSurface(surf, disp, type, conf, attrib_list);
}
static void
}
static EGLBoolean
-dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
+dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
if (!_eglPutSurface(surf))
return EGL_TRUE;
- return dri2_dpy->vtbl->destroy_surface(drv, dpy, surf);
+ return dri2_dpy->vtbl->destroy_surface(drv, disp, surf);
}
static void
dri2_surf_update_fence_fd(_EGLContext *ctx,
- _EGLDisplay *dpy, _EGLSurface *surf)
+ _EGLDisplay *disp, _EGLSurface *surf)
{
__DRIcontext *dri_ctx = dri2_egl_context(ctx)->dri_context;
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
int fence_fd = -1;
void *fence;
}
static _EGLSurface*
-dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->create_window_surface(drv, dpy, conf, native_window,
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->create_window_surface(drv, disp, conf, native_window,
attrib_list);
}
static _EGLSurface*
-dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, void *native_pixmap,
const EGLint *attrib_list)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->create_pixmap_surface(drv, dpy, conf, native_pixmap,
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->create_pixmap_surface(drv, disp, conf, native_pixmap,
attrib_list);
}
static _EGLSurface*
-dri2_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, const EGLint *attrib_list)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->create_pbuffer_surface(drv, dpy, conf, attrib_list);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->create_pbuffer_surface(drv, disp, conf, attrib_list);
}
static EGLBoolean
-dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
+dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint interval)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
if (!dri2_dpy->vtbl->swap_interval)
return EGL_TRUE;
- return dri2_dpy->vtbl->swap_interval(drv, dpy, surf, interval);
+ return dri2_dpy->vtbl->swap_interval(drv, disp, surf, interval);
}
/**
}
static EGLBoolean
-dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
+dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLContext *ctx = _eglGetCurrentContext();
if (ctx && surf)
- dri2_surf_update_fence_fd(ctx, dpy, surf);
- return dri2_dpy->vtbl->swap_buffers(drv, dpy, surf);
+ dri2_surf_update_fence_fd(ctx, disp, surf);
+ return dri2_dpy->vtbl->swap_buffers(drv, disp, surf);
}
static EGLBoolean
-dri2_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf,
const EGLint *rects, EGLint n_rects)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLContext *ctx = _eglGetCurrentContext();
if (ctx && surf)
- dri2_surf_update_fence_fd(ctx, dpy, surf);
- return dri2_dpy->vtbl->swap_buffers_with_damage(drv, dpy, surf,
+ dri2_surf_update_fence_fd(ctx, disp, surf);
+ return dri2_dpy->vtbl->swap_buffers_with_damage(drv, disp, surf,
rects, n_rects);
}
static EGLBoolean
-dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
+dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint numRects, const EGLint *rects)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->swap_buffers_region(drv, dpy, surf, numRects, rects);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->swap_buffers_region(drv, disp, surf, numRects, rects);
}
static EGLBoolean
-dri2_set_damage_region(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
+dri2_set_damage_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint *rects, EGLint n_rects)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->set_damage_region(drv, dpy, surf, rects, n_rects);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->set_damage_region(drv, disp, surf, rects, n_rects);
}
static EGLBoolean
-dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
+dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint x, EGLint y, EGLint width, EGLint height)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->post_sub_buffer(drv, dpy, surf, x, y, width, height);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->post_sub_buffer(drv, disp, surf, x, y, width, height);
}
static EGLBoolean
-dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
+dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
void *native_pixmap_target)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->copy_buffers(drv, dpy, surf, native_pixmap_target);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->copy_buffers(drv, disp, surf, native_pixmap_target);
}
static EGLint
-dri2_query_buffer_age(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
+dri2_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->query_buffer_age(drv, dpy, surf);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->query_buffer_age(drv, disp, surf);
}
static EGLBoolean
}
static _EGLImage*
-dri2_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
+dri2_create_image(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx,
EGLenum target, EGLClientBuffer buffer,
const EGLint *attr_list)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->create_image(drv, dpy, ctx, target, buffer,
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->create_image(drv, disp, ctx, target, buffer,
attr_list);
}
#endif
static EGLBoolean
-dri2_get_sync_values_chromium(_EGLDisplay *dpy, _EGLSurface *surf,
+dri2_get_sync_values_chromium(_EGLDisplay *disp, _EGLSurface *surf,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->get_sync_values(dpy, surf, ust, msc, sbc);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->get_sync_values(disp, surf, ust, msc, sbc);
}
/**
}
static EGLBoolean
-dri2_query_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
+dri2_query_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint attribute, EGLint *value)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
if (!dri2_dpy->vtbl->query_surface)
- return _eglQuerySurface(drv, dpy, surf, attribute, value);
- return dri2_dpy->vtbl->query_surface(drv, dpy, surf, attribute, value);
+ return _eglQuerySurface(drv, disp, surf, attribute, value);
+ return dri2_dpy->vtbl->query_surface(drv, disp, surf, attribute, value);
}
static struct wl_buffer*
-dri2_create_wayland_buffer_from_image(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_create_wayland_buffer_from_image(_EGLDriver *drv, _EGLDisplay *disp,
_EGLImage *img)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- return dri2_dpy->vtbl->create_wayland_buffer_from_image(drv, dpy, img);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ return dri2_dpy->vtbl->create_wayland_buffer_from_image(drv, disp, img);
}
#ifdef HAVE_LIBDRM
}
static _EGLSync *
-dri2_create_sync(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_create_sync(_EGLDriver *drv, _EGLDisplay *disp,
EGLenum type, const EGLAttrib *attrib_list)
{
_EGLContext *ctx = _eglGetCurrentContext();
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
struct dri2_egl_sync *dri2_sync;
EGLint ret;
return NULL;
}
- if (!_eglInitSync(&dri2_sync->base, dpy, type, attrib_list)) {
+ if (!_eglInitSync(&dri2_sync->base, disp, type, attrib_list)) {
free(dri2_sync);
return NULL;
}
}
static EGLBoolean
-dri2_destroy_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync)
+dri2_destroy_sync(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_sync *dri2_sync = dri2_egl_sync(sync);
EGLint ret = EGL_TRUE;
EGLint err;
}
static EGLint
-dri2_dup_native_fence_fd(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync)
+dri2_dup_native_fence_fd(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_sync *dri2_sync = dri2_egl_sync(sync);
assert(sync->Type == EGL_SYNC_NATIVE_FENCE_ANDROID);
}
static void
-dri2_set_blob_cache_funcs(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_set_blob_cache_funcs(_EGLDriver *drv, _EGLDisplay *disp,
EGLSetBlobFuncANDROID set,
EGLGetBlobFuncANDROID get)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
dri2_dpy->blob->set_cache_funcs(dri2_dpy->dri_screen,
- dpy->BlobCacheSet,
- dpy->BlobCacheGet);
+ disp->BlobCacheSet,
+ disp->BlobCacheGet);
}
static EGLint
-dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
+dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync,
EGLint flags, EGLTime timeout)
{
_EGLContext *ctx = _eglGetCurrentContext();
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
struct dri2_egl_sync *dri2_sync = dri2_egl_sync(sync);
unsigned wait_flags = 0;
}
static EGLBoolean
-dri2_signal_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
+dri2_signal_sync(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync,
EGLenum mode)
{
struct dri2_egl_sync *dri2_sync = dri2_egl_sync(sync);
}
static EGLint
-dri2_server_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync)
+dri2_server_wait_sync(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync)
{
_EGLContext *ctx = _eglGetCurrentContext();
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
struct dri2_egl_sync *dri2_sync = dri2_egl_sync(sync);
}
static int
-dri2_interop_query_device_info(_EGLDisplay *dpy, _EGLContext *ctx,
+dri2_interop_query_device_info(_EGLDisplay *disp, _EGLContext *ctx,
struct mesa_glinterop_device_info *out)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
if (!dri2_dpy->interop)
}
static int
-dri2_interop_export_object(_EGLDisplay *dpy, _EGLContext *ctx,
+dri2_interop_export_object(_EGLDisplay *disp, _EGLContext *ctx,
struct mesa_glinterop_export_in *in,
struct mesa_glinterop_export_out *out)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
if (!dri2_dpy->interop)
struct dri2_egl_display_vtbl {
int (*authenticate)(_EGLDisplay *disp, uint32_t id);
- _EGLSurface* (*create_window_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLSurface* (*create_window_surface)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *config,
void *native_window,
const EGLint *attrib_list);
- _EGLSurface* (*create_pixmap_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLSurface* (*create_pixmap_surface)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *config,
void *native_pixmap,
const EGLint *attrib_list);
- _EGLSurface* (*create_pbuffer_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLSurface* (*create_pbuffer_surface)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *config,
const EGLint *attrib_list);
- EGLBoolean (*destroy_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*destroy_surface)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surface);
- EGLBoolean (*swap_interval)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*swap_interval)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf, EGLint interval);
- _EGLImage* (*create_image)(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLImage* (*create_image)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer,
const EGLint *attr_list);
- EGLBoolean (*swap_buffers)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*swap_buffers)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf);
- EGLBoolean (*swap_buffers_with_damage)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*swap_buffers_with_damage)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surface,
const EGLint *rects, EGLint n_rects);
- EGLBoolean (*set_damage_region)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*set_damage_region)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surface,
const EGLint *rects, EGLint n_rects);
- EGLBoolean (*swap_buffers_region)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*swap_buffers_region)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf, EGLint numRects,
const EGLint *rects);
- EGLBoolean (*post_sub_buffer)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*post_sub_buffer)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf,
EGLint x, EGLint y,
EGLint width, EGLint height);
- EGLBoolean (*copy_buffers)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*copy_buffers)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf, void *native_pixmap_target);
- EGLint (*query_buffer_age)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLint (*query_buffer_age)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf);
- EGLBoolean (*query_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*query_surface)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf, EGLint attribute,
EGLint *value);
struct wl_buffer* (*create_wayland_buffer_from_image)(
- _EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *img);
+ _EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img);
EGLBoolean (*get_sync_values)(_EGLDisplay *display, _EGLSurface *surface,
EGLuint64KHR *ust, EGLuint64KHR *msc,
__DRIdrawable *(*get_dri_drawable)(_EGLSurface *surf);
- void (*close_screen_notify)(_EGLDisplay *dpy);
+ void (*close_screen_notify)(_EGLDisplay *disp);
/* Used in EGL_KHR_mutable_render_buffer to update the native window's
* shared buffer mode.
*/
- bool (*set_shared_buffer_mode)(_EGLDisplay *dpy, _EGLSurface *surf,
+ bool (*set_shared_buffer_mode)(_EGLDisplay *disp, _EGLSurface *surf,
bool mode);
};
dri2_egl_surface_free_local_buffers(struct dri2_egl_surface *dri2_surf);
EGLBoolean
-dri2_init_surface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
+dri2_init_surface(_EGLSurface *surf, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, const EGLint *attrib_list, EGLBoolean enable_out_fence);
void
}
static inline EGLBoolean
-dri2_fallback_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_fallback_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf,
const EGLint *rects, EGLint n_rects)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- dri2_dpy->vtbl->set_damage_region(drv, dpy, surf, rects, n_rects);
- return dri2_dpy->vtbl->swap_buffers(drv, dpy, surf);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ dri2_dpy->vtbl->set_damage_region(drv, disp, surf, rects, n_rects);
+ return dri2_dpy->vtbl->swap_buffers(drv, disp, surf);
}
static inline EGLBoolean
-dri2_fallback_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_fallback_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf,
EGLint numRects, const EGLint *rects)
{
}
static inline EGLBoolean
-dri2_fallback_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_fallback_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *draw,
EGLint x, EGLint y, EGLint width, EGLint height)
{
}
static inline EGLBoolean
-dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf,
void *native_pixmap_target)
{
}
static inline EGLBoolean
-dri2_fallback_set_damage_region(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_fallback_set_damage_region(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf,
const EGLint *rects, EGLint n_rects)
{
}
static inline EGLint
-dri2_fallback_query_buffer_age(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_fallback_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf)
{
return 0;
static inline struct wl_buffer*
dri2_fallback_create_wayland_buffer_from_image(_EGLDriver *drv,
- _EGLDisplay *dpy,
+ _EGLDisplay *disp,
_EGLImage *img)
{
return NULL;
}
static inline EGLBoolean
-dri2_fallback_get_sync_values(_EGLDisplay *dpy, _EGLSurface *surf,
+dri2_fallback_get_sync_values(_EGLDisplay *disp, _EGLSurface *surf,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc)
{
}
static EGLBoolean
-droid_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy,
+droid_swap_interval(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf, EGLint interval)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
#endif /* HAVE_DRM_GRALLOC */
static EGLBoolean
-droid_query_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
+droid_query_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint attribute, EGLint *value)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
default:
break;
}
- return _eglQuerySurface(drv, dpy, surf, attribute, value);
+ return _eglQuerySurface(drv, disp, surf, attribute, value);
}
static _EGLImage *
}
static EGLBoolean
-droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
+droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
static const struct {
int format;
unsigned int rgba_masks[4];
};
struct dri2_egl_config *dri2_conf =
- dri2_add_config(dpy, dri2_dpy->driver_configs[j],
+ dri2_add_config(disp, dri2_dpy->driver_configs[j],
config_count + 1, surface_type, config_attrs,
visuals[i].rgba_masks);
if (dri2_conf) {
}
static EGLBoolean
-surfaceless_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
+surfaceless_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
static const struct {
const char *format_name;
unsigned int rgba_masks[4];
for (unsigned j = 0; j < ARRAY_SIZE(visuals); j++) {
struct dri2_egl_config *dri2_conf;
- dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[i],
+ dri2_conf = dri2_add_config(disp, dri2_dpy->driver_configs[i],
config_count + 1, EGL_PBUFFER_BIT, NULL,
visuals[j].rgba_masks);
};
static bool
-surfaceless_probe_device(_EGLDisplay *dpy, bool swrast)
+surfaceless_probe_device(_EGLDisplay *disp, bool swrast)
{
- struct dri2_egl_display *dri2_dpy = dpy->DriverData;
+ struct dri2_egl_display *dri2_dpy = disp->DriverData;
const int limit = 64;
const int base = 128;
int fd;
}
dri2_dpy->fd = fd;
- if (dri2_load_driver_dri3(dpy)) {
+ if (dri2_load_driver_dri3(disp)) {
_EGLDevice *dev = _eglAddDevice(dri2_dpy->fd, swrast);
if (!dev) {
dlclose(dri2_dpy->driver);
_eglLog(_EGL_WARNING, "DRI2: failed to find EGLDevice");
continue;
}
- dpy->Device = dev;
+ disp->Device = dev;
return true;
}
return false;
}
- if (dri2_load_driver_swrast(dpy)) {
+ if (dri2_load_driver_swrast(disp)) {
dri2_dpy->loader_extensions = swrast_loader_extensions;
return true;
}
* have.
*/
static EGLBoolean
-dri2_query_surface(_EGLDriver *drv, _EGLDisplay *dpy,
+dri2_query_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf, EGLint attribute,
EGLint *value)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
int x, y, w, h;
default:
break;
}
- return _eglQuerySurface(drv, dpy, surf, attribute, value);
+ return _eglQuerySurface(drv, disp, surf, attribute, value);
}
/**
}
static int
-dri3_query_buffer_age(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
+dri3_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri3_egl_surface *dri3_surf = dri3_egl_surface(surf);
}
static EGLBoolean
-dri3_query_surface(_EGLDriver *drv, _EGLDisplay *dpy,
+dri3_query_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surf, EGLint attribute,
EGLint *value)
{
break;
}
- return _eglQuerySurface(drv, dpy, surf, attribute, value);
+ return _eglQuerySurface(drv, disp, surf, attribute, value);
}
static __DRIdrawable *
}
static void
-dri3_close_screen_notify(_EGLDisplay *dpy)
+dri3_close_screen_notify(_EGLDisplay *disp)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
loader_dri3_close_screen(dri2_dpy->dri_screen);
}
static EGLBoolean
-haiku_add_configs_for_visuals(_EGLDisplay *dpy)
+haiku_add_configs_for_visuals(_EGLDisplay *disp)
{
CALLED();
if (!conf)
return _eglError(EGL_BAD_ALLOC, "haiku_add_configs_for_visuals");
- _eglInitConfig(&conf->base, dpy, 1);
+ _eglInitConfig(&conf->base, disp, 1);
TRACE("Config inited\n");
_eglSetConfigKey(&conf->base, EGL_RED_SIZE, 8);
TRACE("Validated config\n");
_eglLinkConfig(&conf->base);
- if (!_eglGetArraySize(dpy->Configs)) {
+ if (!_eglGetArraySize(disp->Configs)) {
_eglLog(_EGL_WARNING, "Haiku: failed to create any config");
goto cleanup;
}
extern "C"
EGLBoolean
-init_haiku(_EGLDriver *drv, _EGLDisplay *dpy)
+init_haiku(_EGLDriver *drv, _EGLDisplay *disp)
{
_EGLDevice *dev;
CALLED();
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to find EGLDevice");
return EGL_FALSE;
}
- dpy->Device = dev;
+ disp->Device = dev;
TRACE("Add configs\n");
- if (!haiku_add_configs_for_visuals(dpy))
+ if (!haiku_add_configs_for_visuals(disp))
return EGL_FALSE;
- dpy->Version = 14;
+ disp->Version = 14;
TRACE("Initialization finished\n");
extern "C"
EGLBoolean
-haiku_terminate(_EGLDriver* drv,_EGLDisplay* dpy)
+haiku_terminate(_EGLDriver* drv,_EGLDisplay *disp)
{
return EGL_TRUE;
}
extern "C"
EGLBoolean
-haiku_make_current(_EGLDriver* drv, _EGLDisplay* dpy, _EGLSurface *dsurf,
+haiku_make_current(_EGLDriver* drv, _EGLDisplay *disp, _EGLSurface *dsurf,
_EGLSurface *rsurf, _EGLContext *ctx)
{
CALLED();
extern "C"
EGLBoolean
-haiku_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
+haiku_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct haiku_egl_surface* surface = haiku_egl_surface(surf);
* 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;
}
* Unlock a display.
*/
static inline void
-_eglUnlockDisplay(_EGLDisplay *dpy)
+_eglUnlockDisplay(_EGLDisplay *disp)
{
- mtx_unlock(&dpy->Mutex);
+ mtx_unlock(&disp->Mutex);
}
static EGLBoolean
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);
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
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
* 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);
_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);
_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);
}
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
}
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;
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,
_EGLDisplay *disp,
_EGLImage *img);
- EGLBoolean (*SwapBuffersWithDamageEXT)(_EGLDriver *drv, _EGLDisplay *dpy,
+ EGLBoolean (*SwapBuffersWithDamageEXT)(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *surface,
const EGLint *rects, EGLint n_rects);
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);
_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);
};
* 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;
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;
}
* 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;
}
* 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++) {
* 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))
extern void
-_eglInitConfig(_EGLConfig *config, _EGLDisplay *dpy, EGLint id);
+_eglInitConfig(_EGLConfig *config, _EGLDisplay *disp, EGLint id);
extern EGLConfig
extern _EGLConfig *
-_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy);
+_eglLookupConfig(EGLConfig config, _EGLDisplay *disp);
/**
extern EGLBoolean
-_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
+_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *disp,
const EGLint *attrib_list);
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
* 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;
* 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;
}
* 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;
break;
case EGL_CONTEXT_FLAGS_KHR:
- if (!dpy->Extensions.KHR_create_context) {
+ if (!disp->Extensions.KHR_create_context) {
err = EGL_BAD_ATTRIBUTE;
break;
}
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;
}
* 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;
* 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;
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;
}
break;
case EGL_CONTEXT_OPENGL_ROBUST_ACCESS:
- if (dpy->Version < 15) {
+ if (disp->Version < 15) {
err = EGL_BAD_ATTRIBUTE;
break;
}
break;
case EGL_CONTEXT_OPENGL_DEBUG:
- if (dpy->Version < 15) {
+ if (disp->Version < 15) {
err = EGL_BAD_ATTRIBUTE;
break;
}
break;
case EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE:
- if (dpy->Version < 15) {
+ if (disp->Version < 15) {
err = EGL_BAD_ATTRIBUTE;
break;
}
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;
}
* 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;
* 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();
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;
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;
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");
_eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
- _EGLDisplay *dpy;
+ _EGLDisplay *disp;
if (_eglIsCurrentThreadDummy())
return _eglError(EGL_BAD_ALLOC, "eglMakeCurrent");
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");
} 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 */
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
* 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;
}
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;
}
_EGLDisplay *
_eglFindDisplay(_EGLPlatformType plat, void *plat_dpy)
{
- _EGLDisplay *dpy;
+ _EGLDisplay *disp;
if (plat == _EGL_INVALID_PLATFORM)
return NULL;
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;
}
* 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;
* _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;
}
extern void
-_eglReleaseDisplayResources(_EGLDriver *drv, _EGLDisplay *dpy);
+_eglReleaseDisplayResources(_EGLDriver *drv, _EGLDisplay *disp);
extern void
extern EGLBoolean
-_eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy);
+_eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *disp);
/**
* 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;
}
* 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
}
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;
* 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;
extern _EGLDriver *
-_eglMatchDriver(_EGLDisplay *dpy);
+_eglMatchDriver(_EGLDisplay *disp);
extern __eglMustCastToProperFunctionPointerType
#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;
}
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) {
}
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) {
}
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) {
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) {
* 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;
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;
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;
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);
}
* 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;
}
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;
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++) {
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;
}
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;
}
}
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;
* \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;
/* 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;
EGLBoolean
-_eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
+_eglQuerySurface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface,
EGLint attribute, EGLint *value)
{
switch (attribute) {
*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;
*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;
* 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;
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;
}
EGLBoolean
-_eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
+_eglBindTexImage(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface,
EGLint buffer)
{
EGLint texture_type = EGL_PBUFFER_BIT;
* 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))
}
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.
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))
EGLBoolean
-_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
+_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint interval)
{
return EGL_TRUE;
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);
* 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;
}
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;
EGLBoolean
-_eglGetSyncAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
+_eglGetSyncAttrib(_EGLDriver *drv, _EGLDisplay *disp, _EGLSync *sync,
EGLint attribute, EGLAttrib *value)
{
switch (attribute) {
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;
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);
* 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;
}