From: Eric Engestrom Date: Sat, 2 Feb 2019 11:38:45 +0000 (+0000) Subject: egl: use coherent variable names X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54fa5eceae237598d6fb329ec7cbe1d3a85e7d39;p=mesa.git 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 Acked-by: Emil Velikov Acked-by: Eric Anholt --- diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index c98b9a5d18a..390e99d9a7a 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1360,11 +1360,11 @@ dri2_destroy_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx) } 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; @@ -1375,7 +1375,7 @@ dri2_init_surface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type, 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 @@ -1399,22 +1399,22 @@ dri2_fini_surface(_EGLSurface *surf) } 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; @@ -1559,41 +1559,41 @@ dri2_get_proc_address(_EGLDriver *drv, const char *procname) } 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); } /** @@ -1633,67 +1633,67 @@ dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw) } 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 @@ -1805,12 +1805,12 @@ dri2_release_tex_image(_EGLDriver *drv, } 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); } @@ -1966,12 +1966,12 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx, #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); } /** @@ -2073,21 +2073,21 @@ dri2_create_image_khr_texture(_EGLDisplay *disp, _EGLContext *ctx, } 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 @@ -2909,11 +2909,11 @@ dri2_egl_unref_sync(struct dri2_egl_display *dri2_dpy, } 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; @@ -2925,7 +2925,7 @@ dri2_create_sync(_EGLDriver *drv, _EGLDisplay *dpy, 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; } @@ -3010,9 +3010,9 @@ dri2_create_sync(_EGLDriver *drv, _EGLDisplay *dpy, } 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; @@ -3039,9 +3039,9 @@ dri2_destroy_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync) } 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); @@ -3064,22 +3064,22 @@ dri2_dup_native_fence_fd(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync) } 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; @@ -3167,7 +3167,7 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, } 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); @@ -3193,10 +3193,10 @@ dri2_signal_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *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); @@ -3206,10 +3206,10 @@ dri2_server_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *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) @@ -3219,11 +3219,11 @@ dri2_interop_query_device_info(_EGLDisplay *dpy, _EGLContext *ctx, } 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) diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index a9ddadf11b1..aa143deb867 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -87,63 +87,63 @@ struct wl_buffer; 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, @@ -151,12 +151,12 @@ struct dri2_egl_display_vtbl { __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); }; @@ -534,7 +534,7 @@ void 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 diff --git a/src/egl/drivers/dri2/egl_dri2_fallbacks.h b/src/egl/drivers/dri2/egl_dri2_fallbacks.h index 1482f17d476..6c2c4bbe595 100644 --- a/src/egl/drivers/dri2/egl_dri2_fallbacks.h +++ b/src/egl/drivers/dri2/egl_dri2_fallbacks.h @@ -57,17 +57,17 @@ dri2_fallback_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp, } 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) { @@ -75,7 +75,7 @@ dri2_fallback_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *dpy, } 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) { @@ -83,7 +83,7 @@ dri2_fallback_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *dpy, } 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) { @@ -91,7 +91,7 @@ dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, } 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) { @@ -99,7 +99,7 @@ dri2_fallback_set_damage_region(_EGLDriver *drv, _EGLDisplay *dpy, } 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; @@ -107,14 +107,14 @@ dri2_fallback_query_buffer_age(_EGLDriver *drv, _EGLDisplay *dpy, 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) { diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 366a9ec14e9..7e1d61052db 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -457,7 +457,7 @@ droid_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf) } 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); @@ -960,7 +960,7 @@ droid_create_image_from_name(_EGLDisplay *disp, _EGLContext *ctx, #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); @@ -982,7 +982,7 @@ droid_query_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, default: break; } - return _eglQuerySurface(drv, dpy, surf, attribute, value); + return _eglQuerySurface(drv, disp, surf, attribute, value); } static _EGLImage * @@ -1131,9 +1131,9 @@ droid_get_capability(void *loaderPrivate, enum dri_loader_cap cap) } 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]; @@ -1178,7 +1178,7 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy) }; 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) { diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c index f9809561611..0c018a35234 100644 --- a/src/egl/drivers/dri2/platform_surfaceless.c +++ b/src/egl/drivers/dri2/platform_surfaceless.c @@ -181,9 +181,9 @@ dri2_surfaceless_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp, } 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]; @@ -199,7 +199,7 @@ surfaceless_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy) 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); @@ -272,9 +272,9 @@ static const __DRIextension *swrast_loader_extensions[] = { }; 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; @@ -304,14 +304,14 @@ surfaceless_probe_device(_EGLDisplay *dpy, bool swrast) } 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; } @@ -331,7 +331,7 @@ surfaceless_probe_device(_EGLDisplay *dpy, bool swrast) return false; } - if (dri2_load_driver_swrast(dpy)) { + if (dri2_load_driver_swrast(disp)) { dri2_dpy->loader_extensions = swrast_loader_extensions; return true; } diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 4684c9f0825..5d6efea6141 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -449,11 +449,11 @@ dri2_x11_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf) * 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; @@ -470,7 +470,7 @@ dri2_query_surface(_EGLDriver *drv, _EGLDisplay *dpy, default: break; } - return _eglQuerySurface(drv, dpy, surf, attribute, value); + return _eglQuerySurface(drv, disp, surf, attribute, value); } /** diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c index 1206cd39ae6..189212745ce 100644 --- a/src/egl/drivers/dri2/platform_x11_dri3.c +++ b/src/egl/drivers/dri2/platform_x11_dri3.c @@ -445,7 +445,7 @@ dri3_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, } 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); @@ -453,7 +453,7 @@ dri3_query_buffer_age(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf) } static EGLBoolean -dri3_query_surface(_EGLDriver *drv, _EGLDisplay *dpy, +dri3_query_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint attribute, EGLint *value) { @@ -468,7 +468,7 @@ dri3_query_surface(_EGLDriver *drv, _EGLDisplay *dpy, break; } - return _eglQuerySurface(drv, dpy, surf, attribute, value); + return _eglQuerySurface(drv, disp, surf, attribute, value); } static __DRIdrawable * @@ -480,9 +480,9 @@ dri3_get_dri_drawable(_EGLSurface *surf) } 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); } diff --git a/src/egl/drivers/haiku/egl_haiku.cpp b/src/egl/drivers/haiku/egl_haiku.cpp index d4b046c79b4..517c264088a 100644 --- a/src/egl/drivers/haiku/egl_haiku.cpp +++ b/src/egl/drivers/haiku/egl_haiku.cpp @@ -140,7 +140,7 @@ haiku_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf) static EGLBoolean -haiku_add_configs_for_visuals(_EGLDisplay *dpy) +haiku_add_configs_for_visuals(_EGLDisplay *disp) { CALLED(); @@ -149,7 +149,7 @@ haiku_add_configs_for_visuals(_EGLDisplay *dpy) 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); @@ -190,7 +190,7 @@ haiku_add_configs_for_visuals(_EGLDisplay *dpy) 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; } @@ -206,7 +206,7 @@ cleanup: extern "C" EGLBoolean -init_haiku(_EGLDriver *drv, _EGLDisplay *dpy) +init_haiku(_EGLDriver *drv, _EGLDisplay *disp) { _EGLDevice *dev; CALLED(); @@ -216,13 +216,13 @@ init_haiku(_EGLDriver *drv, _EGLDisplay *dpy) _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"); @@ -232,7 +232,7 @@ init_haiku(_EGLDriver *drv, _EGLDisplay *dpy) extern "C" EGLBoolean -haiku_terminate(_EGLDriver* drv,_EGLDisplay* dpy) +haiku_terminate(_EGLDriver* drv,_EGLDisplay *disp) { return EGL_TRUE; } @@ -281,7 +281,7 @@ haiku_destroy_context(_EGLDriver* drv, _EGLDisplay *disp, _EGLContext* ctx) 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(); @@ -302,7 +302,7 @@ haiku_make_current(_EGLDriver* drv, _EGLDisplay* dpy, _EGLSurface *dsurf, 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); diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index dd9b5b989cb..f99078febb3 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -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; diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h index 5e1581b9ce5..6efb460b697 100644 --- a/src/egl/main/eglapi.h +++ b/src/egl/main/eglapi.h @@ -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); }; diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index a346f937bf3..72cd73d5179 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -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)) diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index 21f0a284124..605289de536 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -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 diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c index 6b241a524ec..216ddb41997 100644 --- a/src/egl/main/eglcontext.c +++ b/src/egl/main/eglcontext.c @@ -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 */ diff --git a/src/egl/main/eglcontext.h b/src/egl/main/eglcontext.h index deddefdcaba..2c6ebd19cb9 100644 --- a/src/egl/main/eglcontext.h +++ b/src/egl/main/eglcontext.h @@ -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; } diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 387df6a66d0..b26a9575087 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -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; } diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 5cc503734bc..cfd0ff66d64 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -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 diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index b20652ed8c1..e294c8c5f7d 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -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; diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index 5695fc06ffb..59bc894e519 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -84,7 +84,7 @@ _eglInitDriver(_EGLDriver *driver); extern _EGLDriver * -_eglMatchDriver(_EGLDisplay *dpy); +_eglMatchDriver(_EGLDisplay *disp); extern __eglMustCastToProperFunctionPointerType diff --git a/src/egl/main/eglimage.c b/src/egl/main/eglimage.c index 46bf0c50f07..9df6b6511d5 100644 --- a/src/egl/main/eglimage.c +++ b/src/egl/main/eglimage.c @@ -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; diff --git a/src/egl/main/eglimage.h b/src/egl/main/eglimage.h index 87517921320..6d2e7ba8a2d 100644 --- a/src/egl/main/eglimage.h +++ b/src/egl/main/eglimage.h @@ -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; } diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c index cd1c7ea4c56..ffef1b8f259 100644 --- a/src/egl/main/eglsurface.c +++ b/src/egl/main/eglsurface.c @@ -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; diff --git a/src/egl/main/eglsurface.h b/src/egl/main/eglsurface.h index 51e6792289c..df8e2e6bdfb 100644 --- a/src/egl/main/eglsurface.h +++ b/src/egl/main/eglsurface.h @@ -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; } diff --git a/src/egl/main/eglsync.c b/src/egl/main/eglsync.c index cb931b81682..d3c0cf4aa6f 100644 --- a/src/egl/main/eglsync.c +++ b/src/egl/main/eglsync.c @@ -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; diff --git a/src/egl/main/eglsync.h b/src/egl/main/eglsync.h index 5ac76f3ac3d..fdb122beb26 100644 --- a/src/egl/main/eglsync.h +++ b/src/egl/main/eglsync.h @@ -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; }