[Mesa-dev] [RFC 2/3] egl: remove EGL_NV_post_sub_buffer

Emil Velikov emil.l.velikov at gmail.com
Sun Jun 4 23:52:09 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

Only the X11+DRI2 platform supports it and AFAICT only Chrome uses it.
Other EGL implementations, barring the Nvidia one, do not implement the
extension.

Which is understandable since it is superseded by EGL_EXT_buffer_age,
EGL_KHR_swap_buffers_with_damage and/or EGL_KHR_partial_update.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/egl/drivers/dri2/egl_dri2.c             |  9 ---------
 src/egl/drivers/dri2/egl_dri2.h             |  5 -----
 src/egl/drivers/dri2/egl_dri2_fallbacks.h   |  8 --------
 src/egl/drivers/dri2/platform_android.c     |  1 -
 src/egl/drivers/dri2/platform_drm.c         |  1 -
 src/egl/drivers/dri2/platform_surfaceless.c |  1 -
 src/egl/drivers/dri2/platform_wayland.c     |  2 --
 src/egl/drivers/dri2/platform_x11.c         | 19 +------------------
 src/egl/drivers/dri2/platform_x11_dri3.c    |  1 -
 src/egl/main/eglapi.c                       | 23 -----------------------
 src/egl/main/eglapi.h                       |  4 ----
 src/egl/main/egldisplay.h                   |  2 --
 src/egl/main/eglentrypoint.h                |  1 -
 src/egl/main/eglsurface.c                   | 17 -----------------
 src/egl/main/eglsurface.h                   |  2 --
 15 files changed, 1 insertion(+), 95 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index f6d2d5464a8..977482f4b55 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1513,14 +1513,6 @@ dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
 }
 
 static EGLBoolean
-dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *dpy, _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);
-}
-
-static EGLBoolean
 dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
                   void *native_pixmap_target)
 {
@@ -3142,7 +3134,6 @@ _eglBuiltInDriverDRI2(const char *args)
    dri2_drv->base.API.SwapBuffers = dri2_swap_buffers;
    dri2_drv->base.API.SwapBuffersWithDamageEXT = dri2_swap_buffers_with_damage;
    dri2_drv->base.API.SwapBuffersRegionNOK = dri2_swap_buffers_region;
-   dri2_drv->base.API.PostSubBufferNV = dri2_post_sub_buffer;
    dri2_drv->base.API.CopyBuffers = dri2_copy_buffers,
    dri2_drv->base.API.QueryBufferAge = dri2_query_buffer_age;
    dri2_drv->base.API.CreateImageKHR = dri2_create_image;
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index a71b4489cde..8cc0d87acde 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -122,11 +122,6 @@ struct dri2_egl_display_vtbl {
                                      _EGLSurface *surf, EGLint numRects,
                                      const EGLint *rects);
 
-   EGLBoolean (*post_sub_buffer)(_EGLDriver *drv, _EGLDisplay *dpy,
-                                 _EGLSurface *surf,
-                                 EGLint x, EGLint y,
-                                 EGLint width, EGLint height);
-
    EGLBoolean (*copy_buffers)(_EGLDriver *drv, _EGLDisplay *dpy,
                               _EGLSurface *surf, void *native_pixmap_target);
 
diff --git a/src/egl/drivers/dri2/egl_dri2_fallbacks.h b/src/egl/drivers/dri2/egl_dri2_fallbacks.h
index 67a9c5034a2..44d50dd3925 100644
--- a/src/egl/drivers/dri2/egl_dri2_fallbacks.h
+++ b/src/egl/drivers/dri2/egl_dri2_fallbacks.h
@@ -80,14 +80,6 @@ dri2_fallback_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *dpy,
 }
 
 static inline EGLBoolean
-dri2_fallback_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *dpy,
-                              _EGLSurface *draw,
-                              EGLint x, EGLint y, EGLint width, EGLint height)
-{
-   return EGL_FALSE;
-}
-
-static inline EGLBoolean
 dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy,
                            _EGLSurface *surf,
                            void *native_pixmap_target)
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 48ecb9fd40b..08037e34de2 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1066,7 +1066,6 @@ static const struct dri2_egl_display_vtbl droid_display_vtbl = {
    .swap_buffers = droid_swap_buffers,
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = droid_query_buffer_age,
    .query_surface = droid_query_surface,
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 2f045894265..017e77fae75 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -658,7 +658,6 @@ static const struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
    .swap_buffers = dri2_drm_swap_buffers,
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_drm_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c
index 6563e466c09..8cdb00b2191 100644
--- a/src/egl/drivers/dri2/platform_surfaceless.c
+++ b/src/egl/drivers/dri2/platform_surfaceless.c
@@ -237,7 +237,6 @@ static const struct dri2_egl_display_vtbl dri2_surfaceless_display_vtbl = {
    .swap_buffers = surfaceless_swap_buffers,
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index e447aa67290..0450fb2d359 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1080,7 +1080,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
    .swap_buffers = dri2_wl_swap_buffers,
    .swap_buffers_with_damage = dri2_wl_swap_buffers_with_damage,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_wl_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_wl_create_wayland_buffer_from_image,
@@ -1774,7 +1773,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_swrast_display_vtbl = {
    .swap_buffers = dri2_wl_swrast_swap_buffers,
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_fallback_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
    .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 1985818e119..9d87c9f4c1a 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -311,9 +311,6 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
       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:
@@ -935,18 +932,6 @@ dri2_x11_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp,
 }
 
 static EGLBoolean
-dri2_x11_post_sub_buffer(_EGLDriver *drv, _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(drv, disp, draw, 1, rect);
-}
-
-static EGLBoolean
 dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
                        EGLint interval)
 {
@@ -1141,7 +1126,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
    .swap_interval = dri2_fallback_swap_interval,
    .swap_buffers = dri2_x11_swap_buffers,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri2_x11_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
    .query_surface = dri2_query_surface,
@@ -1161,7 +1145,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_display_vtbl = {
    .swap_buffers = dri2_x11_swap_buffers,
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
    .swap_buffers_region = dri2_x11_swap_buffers_region,
-   .post_sub_buffer = dri2_x11_post_sub_buffer,
    .copy_buffers = dri2_x11_copy_buffers,
    .query_buffer_age = dri2_fallback_query_buffer_age,
    .query_surface = dri2_query_surface,
@@ -1458,7 +1441,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
 
    disp->Extensions.KHR_image_pixmap = EGL_TRUE;
    disp->Extensions.NOK_swap_region = EGL_TRUE;
-   disp->Extensions.NV_post_sub_buffer = EGL_TRUE;
+   disp->Extensions.NOK_texture_from_pixmap = EGL_TRUE;
    disp->Extensions.CHROMIUM_sync_control = EGL_TRUE;
 
    dri2_set_WL_bind_wayland_display(drv, disp);
diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c
index 041da3208de..3d459f27416 100644
--- a/src/egl/drivers/dri2/platform_x11_dri3.c
+++ b/src/egl/drivers/dri2/platform_x11_dri3.c
@@ -458,7 +458,6 @@ struct dri2_egl_display_vtbl dri3_x11_display_vtbl = {
    .swap_buffers = dri3_swap_buffers,
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
    .swap_buffers_region = dri2_fallback_swap_buffers_region,
-   .post_sub_buffer = dri2_fallback_post_sub_buffer,
    .copy_buffers = dri3_copy_buffers,
    .query_buffer_age = dri3_query_buffer_age,
    .query_surface = dri3_query_surface,
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index e6355ace872..7e680161f31 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -520,8 +520,6 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
    _EGL_CHECK_EXTENSION(NOK_swap_region);
    _EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
 
-   _EGL_CHECK_EXTENSION(NV_post_sub_buffer);
-
    _EGL_CHECK_EXTENSION(WL_bind_wayland_display);
    _EGL_CHECK_EXTENSION(WL_create_wayland_buffer_from_image);
 
@@ -2147,27 +2145,6 @@ eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImage image)
 }
 
 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);
-   _EGLDriver *drv;
-   EGLBoolean ret;
-
-   _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
-
-   _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
-
-   if (!disp->Extensions.NV_post_sub_buffer)
-      RETURN_EGL_EVAL(disp, EGL_FALSE);
-
-   ret = drv->API.PostSubBufferNV(drv, disp, surf, x, y, width, height);
-
-   RETURN_EGL_EVAL(disp, ret);
-}
-
-static EGLBoolean EGLAPIENTRY
 eglGetSyncValuesCHROMIUM(EGLDisplay display, EGLSurface surface,
                          EGLuint64KHR *ust, EGLuint64KHR *msc,
                          EGLuint64KHR *sbc)
diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h
index cab3e9605a0..0c46b51df62 100644
--- a/src/egl/main/eglapi.h
+++ b/src/egl/main/eglapi.h
@@ -175,10 +175,6 @@ struct _egl_api
                                           _EGLSurface *surface,
                                           const EGLint *rects, EGLint n_rects);
 
-   EGLBoolean (*PostSubBufferNV)(_EGLDriver *drv, _EGLDisplay *disp,
-                                 _EGLSurface *surface, EGLint x, EGLint y,
-                                 EGLint width, EGLint height);
-
    EGLint (*QueryBufferAge)(_EGLDriver *drv,
                             _EGLDisplay *dpy, _EGLSurface *surface);
    EGLBoolean (*GetSyncValuesCHROMIUM)(_EGLDisplay *dpy, _EGLSurface *surface,
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 9685bed360c..5fb8a3a026d 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -128,8 +128,6 @@ struct _egl_extensions
    EGLBoolean NOK_swap_region;
    EGLBoolean NOK_texture_from_pixmap;
 
-   EGLBoolean NV_post_sub_buffer;
-
    EGLBoolean WL_bind_wayland_display;
    EGLBoolean WL_create_wayland_buffer_from_image;
 };
diff --git a/src/egl/main/eglentrypoint.h b/src/egl/main/eglentrypoint.h
index b9dca7ceda2..d8d85d1c35e 100644
--- a/src/egl/main/eglentrypoint.h
+++ b/src/egl/main/eglentrypoint.h
@@ -52,7 +52,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)
diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c
index e935c832713..f748dcf0293 100644
--- a/src/egl/main/eglsurface.c
+++ b/src/egl/main/eglsurface.c
@@ -140,18 +140,6 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
          }
          surf->RenderBuffer = val;
          break;
-      case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
-         if (!dpy->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;
       /* pbuffer surface attributes */
       case EGL_WIDTH:
          if (type != EGL_PBUFFER_BIT) {
@@ -316,8 +304,6 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
    surf->VerticalResolution = EGL_UNKNOWN;
    surf->AspectRatio = EGL_UNKNOWN;
 
-   surf->PostSubBufferSupportedNV = EGL_FALSE;
-
    /* the default swap interval is 1 */
    _eglClampSwapInterval(surf, 1);
 
@@ -401,9 +387,6 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
       }
       *value = surface->GLColorspace;
       break;
-   case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
-      *value = surface->PostSubBufferSupportedNV;
-      break;
    case EGL_BUFFER_AGE_EXT:
       if (!dpy->Extensions.EXT_buffer_age) {
          _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
diff --git a/src/egl/main/eglsurface.h b/src/egl/main/eglsurface.h
index f13cf49741b..20439ade74c 100644
--- a/src/egl/main/eglsurface.h
+++ b/src/egl/main/eglsurface.h
@@ -84,8 +84,6 @@ struct _egl_surface
 
    /* True if the surface is bound to an OpenGL ES texture */
    EGLBoolean BoundToTexture;
-
-   EGLBoolean PostSubBufferSupportedNV;
 };
 
 
-- 
2.13.0



More information about the mesa-dev mailing list