From f6aa27a2948a10cdc07fef63b0b373efc4a234db Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 22 Nov 2022 15:28:06 -0800 Subject: [PATCH] egl: Retire NOK_swap_region support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's never been ported to DRI3, but nobody seems to care. Since DRI2 is untested at this point, just drop the code. Reviewed-by: Marek Olšák Reviewed-by: Adam Jackson Part-of: --- src/egl/drivers/dri2/egl_dri2.c | 22 ---------------------- src/egl/drivers/dri2/egl_dri2.h | 4 ---- src/egl/drivers/dri2/platform_x11.c | 4 ---- src/egl/generate/eglFunctionList.py | 3 --- src/egl/main/eglapi.c | 28 ---------------------------- src/egl/main/egldisplay.h | 1 - src/egl/main/egldriver.h | 4 ---- src/egl/main/eglentrypoint.h | 1 - 8 files changed, 67 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 0819b7c66a0..aaf36a99633 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1686,27 +1686,6 @@ dri2_swap_buffers_with_damage(_EGLDisplay *disp, _EGLSurface *surf, return ret; } -static EGLBoolean -dri2_swap_buffers_region(_EGLDisplay *disp, _EGLSurface *surf, EGLint numRects, - const EGLint *rects) -{ - struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); - struct dri_drawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(surf); - EGLBoolean ret; - - if (!dri2_dpy->vtbl->swap_buffers_region) - return EGL_FALSE; - ret = dri2_dpy->vtbl->swap_buffers_region(disp, surf, numRects, rects); - - /* SwapBuffers marks the end of the frame; reset the damage region for - * use again next time. - */ - if (ret && disp->Extensions.KHR_partial_update) - dri_set_damage_region(dri_drawable, 0, NULL); - - return ret; -} - static EGLBoolean dri2_set_damage_region(_EGLDisplay *disp, _EGLSurface *surf, EGLint *rects, EGLint n_rects) @@ -3370,7 +3349,6 @@ const _EGLDriver _eglDriver = { .SwapInterval = dri2_swap_interval, .SwapBuffers = dri2_swap_buffers, .SwapBuffersWithDamageEXT = dri2_swap_buffers_with_damage, - .SwapBuffersRegionNOK = dri2_swap_buffers_region, .SetDamageRegion = dri2_set_damage_region, .PostSubBufferNV = dri2_post_sub_buffer, .CopyBuffers = dri2_copy_buffers, diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 4278ff969f1..405b65a967f 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -139,10 +139,6 @@ struct dri2_egl_display_vtbl { _EGLSurface *surface, const EGLint *rects, EGLint n_rects); - /* optional */ - EGLBoolean (*swap_buffers_region)(_EGLDisplay *disp, _EGLSurface *surf, - EGLint numRects, const EGLint *rects); - /* optional */ EGLBoolean (*post_sub_buffer)(_EGLDisplay *disp, _EGLSurface *surf, EGLint x, EGLint y, EGLint width, EGLint height); diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index c47bd6fac32..a759c8dd8e6 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -1169,7 +1169,6 @@ dri2_x11_post_sub_buffer(_EGLDisplay *disp, _EGLSurface *draw, EGLint x, return dri2_x11_swap_buffers_region(disp, draw, 1, rect); } #else -#define dri2_x11_swap_buffers_region NULL #define dri2_x11_post_sub_buffer NULL #endif @@ -1545,7 +1544,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = { .destroy_surface = dri2_x11_destroy_surface, .create_image = dri2_create_image_khr, .swap_buffers = dri2_x11_swap_buffers, - .swap_buffers_region = dri2_x11_swap_buffers_region, .swap_buffers_with_damage = dri2_x11_swap_buffers_with_damage, .post_sub_buffer = dri2_x11_post_sub_buffer, .copy_buffers = dri2_x11_copy_buffers, @@ -1565,7 +1563,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_kopper_display_vtbl = { .create_image = dri2_create_image_khr, .swap_interval = dri2_kopper_swap_interval, .swap_buffers = dri2_x11_swap_buffers, - .swap_buffers_region = dri2_x11_swap_buffers_region, .swap_buffers_with_damage = dri2_x11_kopper_swap_buffers_with_damage, .post_sub_buffer = dri2_x11_post_sub_buffer, .copy_buffers = dri2_x11_copy_buffers, @@ -1586,7 +1583,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_display_vtbl = { .create_image = dri2_x11_create_image_khr, .swap_interval = dri2_x11_swap_interval, .swap_buffers = dri2_x11_swap_buffers, - .swap_buffers_region = dri2_x11_swap_buffers_region, .post_sub_buffer = dri2_x11_post_sub_buffer, .copy_buffers = dri2_x11_copy_buffers, .query_surface = dri2_query_surface, diff --git a/src/egl/generate/eglFunctionList.py b/src/egl/generate/eglFunctionList.py index 9bee8f6983f..a228ffc5fed 100644 --- a/src/egl/generate/eglFunctionList.py +++ b/src/egl/generate/eglFunctionList.py @@ -203,9 +203,6 @@ EGL_FUNCTIONS = ( _eglFunc("eglExportDMABUFImageQueryMESA", "display"), _eglFunc("eglExportDMABUFImageMESA", "display"), - # EGL_NOK_swap_region - _eglFunc("eglSwapBuffersRegionNOK", "display"), - # EGL_NV_post_sub_buffer _eglFunc("eglPostSubBufferNV", "display"), diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index c4fa4ee0e2e..3b9c47eda1d 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -603,7 +603,6 @@ _eglCreateExtensionsString(_EGLDisplay *disp) _EGL_CHECK_EXTENSION(MESA_query_driver); _EGL_CHECK_EXTENSION(MESA_x11_native_visual_id); - _EGL_CHECK_EXTENSION(NOK_swap_region); _EGL_CHECK_EXTENSION(NOK_texture_from_pixmap); _EGL_CHECK_EXTENSION(NV_context_priority_realtime); @@ -2250,33 +2249,6 @@ eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSync sync) RETURN_EGL_SUCCESS(disp, ret); } -static EGLBoolean EGLAPIENTRY -eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, EGLint numRects, - const EGLint *rects) -{ - _EGLContext *ctx = _eglGetCurrentContext(); - _EGLDisplay *disp = _eglLockDisplay(dpy); - _EGLSurface *surf = _eglLookupSurface(surface, disp); - EGLBoolean ret = EGL_FALSE; - - _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf); - - _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE); - - if (!disp->Extensions.NOK_swap_region) - RETURN_EGL_EVAL(disp, EGL_FALSE); - - /* surface must be bound to current context in EGL 1.4 */ - if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT || surf != ctx->DrawSurface) - RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); - - egl_relax (disp, &surf->Resource) { - ret = disp->Driver->SwapBuffersRegionNOK(disp, surf, numRects, rects); - } - - RETURN_EGL_EVAL(disp, ret); -} - static EGLImage EGLAPIENTRY eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attr_list) { diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index d510483e493..0827de421c0 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -150,7 +150,6 @@ struct _egl_extensions { EGLBoolean MESA_query_driver; EGLBoolean MESA_x11_native_visual_id; - EGLBoolean NOK_swap_region; EGLBoolean NOK_texture_from_pixmap; EGLBoolean NV_post_sub_buffer; diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index aec6e589437..bc1285d492f 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -144,10 +144,6 @@ struct _egl_driver { /* for EGL_ANDROID_native_fence_sync */ EGLint (*DupNativeFenceFDANDROID)(_EGLDisplay *disp, _EGLSync *sync); - /* for EGL_NOK_swap_region */ - EGLBoolean (*SwapBuffersRegionNOK)(_EGLDisplay *disp, _EGLSurface *surf, - EGLint numRects, const EGLint *rects); - /* for EGL_MESA_drm_image */ _EGLImage *(*CreateDRMImageMESA)(_EGLDisplay *disp, const EGLint *attr_list); EGLBoolean (*ExportDRMImageMESA)(_EGLDisplay *disp, _EGLImage *img, diff --git a/src/egl/main/eglentrypoint.h b/src/egl/main/eglentrypoint.h index 8a66ce90beb..6e7d0be9ca7 100644 --- a/src/egl/main/eglentrypoint.h +++ b/src/egl/main/eglentrypoint.h @@ -80,7 +80,6 @@ EGL_ENTRYPOINT(eglSetDamageRegionKHR) EGL_ENTRYPOINT(eglSignalSyncKHR) EGL_ENTRYPOINT(eglSurfaceAttrib) EGL_ENTRYPOINT(eglSwapBuffers) -EGL_ENTRYPOINT(eglSwapBuffersRegionNOK) EGL_ENTRYPOINT(eglSwapBuffersWithDamageEXT) EGL_ENTRYPOINT(eglSwapBuffersWithDamageKHR) EGL_ENTRYPOINT(eglSwapInterval)