egl: Retire NV_post_sub_buffer support.

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 <marek.olsak@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33517>
This commit is contained in:
Emma Anholt
2022-11-22 15:34:02 -08:00
committed by Marge Bot
parent f6aa27a294
commit 2f57cf0323
10 changed files with 0 additions and 120 deletions

View File

@@ -1703,21 +1703,6 @@ dri2_set_damage_region(_EGLDisplay *disp, _EGLSurface *surf, EGLint *rects,
return EGL_TRUE;
}
static EGLBoolean
dri2_post_sub_buffer(_EGLDisplay *disp, _EGLSurface *surf, EGLint x, EGLint y,
EGLint width, EGLint height)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display_lock(disp);
EGLBoolean ret = EGL_FALSE;
if (dri2_dpy->vtbl->post_sub_buffer)
ret = dri2_dpy->vtbl->post_sub_buffer(disp, surf, x, y, width, height);
mtx_unlock(&dri2_dpy->lock);
return ret;
}
static EGLBoolean
dri2_copy_buffers(_EGLDisplay *disp, _EGLSurface *surf,
void *native_pixmap_target)
@@ -3350,7 +3335,6 @@ const _EGLDriver _eglDriver = {
.SwapBuffers = dri2_swap_buffers,
.SwapBuffersWithDamageEXT = dri2_swap_buffers_with_damage,
.SetDamageRegion = dri2_set_damage_region,
.PostSubBufferNV = dri2_post_sub_buffer,
.CopyBuffers = dri2_copy_buffers,
.QueryBufferAge = dri2_query_buffer_age,
.CreateImageKHR = dri2_create_image,

View File

@@ -139,10 +139,6 @@ struct dri2_egl_display_vtbl {
_EGLSurface *surface,
const EGLint *rects, EGLint n_rects);
/* optional */
EGLBoolean (*post_sub_buffer)(_EGLDisplay *disp, _EGLSurface *surf, EGLint x,
EGLint y, EGLint width, EGLint height);
/* optional */
EGLBoolean (*copy_buffers)(_EGLDisplay *disp, _EGLSurface *surf,
void *native_pixmap_target);

View File

@@ -507,9 +507,6 @@ dri2_x11_create_surface(_EGLDisplay *disp, EGLint type, _EGLConfig *conf,
swrastCreateDrawable(dri2_dpy, dri2_surf);
}
/* we always copy the back buffer to front */
dri2_surf->base.PostSubBufferSupportedNV = EGL_TRUE;
return &dri2_surf->base;
cleanup_dri_drawable:
@@ -1127,51 +1124,6 @@ dri2_x11_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
return EGL_TRUE;
}
#ifdef HAVE_X11_DRI2
static EGLBoolean
dri2_x11_swap_buffers_region(_EGLDisplay *disp, _EGLSurface *draw,
EGLint numRects, const EGLint *rects)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
EGLBoolean ret;
xcb_xfixes_region_t region;
xcb_rectangle_t rectangles[16];
if (numRects > (int)ARRAY_SIZE(rectangles))
return dri2_copy_region(disp, draw, dri2_surf->region);
for (int i = 0; i < numRects; i++) {
rectangles[i].x = rects[i * 4];
rectangles[i].y =
dri2_surf->base.Height - rects[i * 4 + 1] - rects[i * 4 + 3];
rectangles[i].width = rects[i * 4 + 2];
rectangles[i].height = rects[i * 4 + 3];
}
region = xcb_generate_id(dri2_dpy->conn);
xcb_xfixes_create_region(dri2_dpy->conn, region, numRects, rectangles);
ret = dri2_copy_region(disp, draw, region);
xcb_xfixes_destroy_region(dri2_dpy->conn, region);
return ret;
}
static EGLBoolean
dri2_x11_post_sub_buffer(_EGLDisplay *disp, _EGLSurface *draw, EGLint x,
EGLint y, EGLint width, EGLint height)
{
const EGLint rect[4] = {x, y, width, height};
if (x < 0 || y < 0 || width < 0 || height < 0)
_eglError(EGL_BAD_PARAMETER, "eglPostSubBufferNV");
return dri2_x11_swap_buffers_region(disp, draw, 1, rect);
}
#else
#define dri2_x11_post_sub_buffer NULL
#endif
static EGLBoolean
dri2_x11_kopper_swap_buffers_with_damage(_EGLDisplay *disp, _EGLSurface *draw,
const EGLint *rects, EGLint numRects)
@@ -1545,7 +1497,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
.create_image = dri2_create_image_khr,
.swap_buffers = dri2_x11_swap_buffers,
.swap_buffers_with_damage = dri2_x11_swap_buffers_with_damage,
.post_sub_buffer = dri2_x11_post_sub_buffer,
.copy_buffers = dri2_x11_copy_buffers,
.query_buffer_age = dri2_swrast_query_buffer_age,
/* XXX: should really implement this since X11 has pixmaps */
@@ -1564,7 +1515,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_kopper_display_vtbl = {
.swap_interval = dri2_kopper_swap_interval,
.swap_buffers = dri2_x11_swap_buffers,
.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,
.query_buffer_age = dri2_kopper_query_buffer_age,
/* XXX: should really implement this since X11 has pixmaps */

View File

@@ -203,9 +203,6 @@ EGL_FUNCTIONS = (
_eglFunc("eglExportDMABUFImageQueryMESA", "display"),
_eglFunc("eglExportDMABUFImageMESA", "display"),
# EGL_NV_post_sub_buffer
_eglFunc("eglPostSubBufferNV", "display"),
# EGL_WL_bind_wayland_display
_eglFunc("eglCreateWaylandBufferFromImageWL", "display"),
_eglFunc("eglUnbindWaylandDisplayWL", "display"),

View File

@@ -606,7 +606,6 @@ _eglCreateExtensionsString(_EGLDisplay *disp)
_EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
_EGL_CHECK_EXTENSION(NV_context_priority_realtime);
_EGL_CHECK_EXTENSION(NV_post_sub_buffer);
_EGL_CHECK_EXTENSION(WL_bind_wayland_display);
_EGL_CHECK_EXTENSION(WL_create_wayland_buffer_from_image);
@@ -2380,28 +2379,6 @@ eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImage image)
RETURN_EGL_EVAL(disp, ret);
}
static EGLBoolean EGLAPIENTRY
eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y,
EGLint width, EGLint height)
{
_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.NV_post_sub_buffer)
RETURN_EGL_EVAL(disp, EGL_FALSE);
egl_relax (disp, &surf->Resource) {
ret = disp->Driver->PostSubBufferNV(disp, surf, x, y, width, height);
}
RETURN_EGL_EVAL(disp, ret);
}
static EGLBoolean EGLAPIENTRY
eglGetSyncValuesCHROMIUM(EGLDisplay dpy, EGLSurface surface, EGLuint64KHR *ust,
EGLuint64KHR *msc, EGLuint64KHR *sbc)

View File

@@ -152,7 +152,6 @@ struct _egl_extensions {
EGLBoolean NOK_texture_from_pixmap;
EGLBoolean NV_post_sub_buffer;
EGLBoolean NV_context_priority_realtime;
EGLBoolean WL_bind_wayland_display;

View File

@@ -168,11 +168,6 @@ struct _egl_driver {
_EGLSurface *surface,
const EGLint *rects, EGLint n_rects);
/* for EGL_NV_post_sub_buffer */
EGLBoolean (*PostSubBufferNV)(_EGLDisplay *disp, _EGLSurface *surface,
EGLint x, EGLint y, EGLint width,
EGLint height);
/* for EGL_EXT_buffer_age/EGL_KHR_partial_update */
EGLint (*QueryBufferAge)(_EGLDisplay *disp, _EGLSurface *surface);

View File

@@ -59,7 +59,6 @@ EGL_ENTRYPOINT(eglGetSyncValuesCHROMIUM)
EGL_ENTRYPOINT(eglInitialize)
EGL_ENTRYPOINT(eglLabelObjectKHR)
EGL_ENTRYPOINT(eglMakeCurrent)
EGL_ENTRYPOINT(eglPostSubBufferNV)
EGL_ENTRYPOINT(eglQueryAPI)
EGL_ENTRYPOINT(eglQueryContext)
EGL_ENTRYPOINT(eglQueryDebugKHR)

View File

@@ -229,17 +229,6 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
}
surf->PresentOpaque = val;
break;
case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
if (!disp->Extensions.NV_post_sub_buffer || type != EGL_WINDOW_BIT) {
err = EGL_BAD_ATTRIBUTE;
break;
}
if (val != EGL_TRUE && val != EGL_FALSE) {
err = EGL_BAD_PARAMETER;
break;
}
surf->PostSubBufferSupportedNV = val;
break;
case EGL_SURFACE_COMPRESSION_EXT:
if (type != EGL_WINDOW_BIT) {
err = EGL_BAD_ATTRIBUTE;
@@ -430,7 +419,6 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *disp, EGLint type,
surf->VerticalResolution = EGL_UNKNOWN;
surf->AspectRatio = EGL_UNKNOWN;
surf->PostSubBufferSupportedNV = EGL_FALSE;
surf->SetDamageRegionCalled = EGL_FALSE;
surf->BufferAgeRead = EGL_FALSE;
@@ -558,9 +546,6 @@ _eglQuerySurface(_EGLDisplay *disp, _EGLSurface *surface, EGLint attribute,
*value = surface->GLColorspace;
break;
case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
*value = surface->PostSubBufferSupportedNV;
break;
case EGL_BUFFER_AGE_EXT:
/* Both EXT_buffer_age and KHR_partial_update accept EGL_BUFFER_AGE_EXT.
* To be precise, the KHR one accepts EGL_BUFFER_AGE_KHR which is an

View File

@@ -165,8 +165,6 @@ struct _egl_surface {
/* True if the surface is bound to an OpenGL ES texture */
EGLBoolean BoundToTexture;
EGLBoolean PostSubBufferSupportedNV;
EGLBoolean ProtectedContent;
EGLBoolean PresentOpaque;