egl: drop unused _EGLDriver from SwapBuffers{,WithDamageEXT,RegionNOK}()
authorEric Engestrom <eric@engestrom.ch>
Sun, 22 Apr 2018 14:48:15 +0000 (16:48 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sun, 16 Aug 2020 13:49:18 +0000 (13:49 +0000)
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241>

src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_android.c
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_wayland.c
src/egl/drivers/dri2/platform_x11.c
src/egl/drivers/dri2/platform_x11_dri3.c
src/egl/drivers/haiku/egl_haiku.cpp
src/egl/main/eglapi.c
src/egl/main/egldriver.h

index 4d1fcad59286837c0fe5562ea2096de243b1c059..8cf286229b6662d9a784fb5a581a69cfecf3220b 100644 (file)
@@ -1979,7 +1979,7 @@ dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw)
 }
 
 static EGLBoolean
-dri2_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
+dri2_swap_buffers(_EGLDisplay *disp, _EGLSurface *surf)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    __DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(surf);
@@ -1988,7 +1988,7 @@ dri2_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
 
    if (ctx && surf)
       dri2_surf_update_fence_fd(ctx, disp, surf);
-   ret = dri2_dpy->vtbl->swap_buffers(drv, disp, surf);
+   ret = dri2_dpy->vtbl->swap_buffers(disp, surf);
 
    /* SwapBuffers marks the end of the frame; reset the damage region for
     * use again next time.
@@ -2001,8 +2001,7 @@ dri2_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
 }
 
 static EGLBoolean
-dri2_swap_buffers_with_damage(const _EGLDriver *drv, _EGLDisplay *disp,
-                              _EGLSurface *surf,
+dri2_swap_buffers_with_damage(_EGLDisplay *disp, _EGLSurface *surf,
                               const EGLint *rects, EGLint n_rects)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
@@ -2013,10 +2012,10 @@ dri2_swap_buffers_with_damage(const _EGLDriver *drv, _EGLDisplay *disp,
    if (ctx && surf)
       dri2_surf_update_fence_fd(ctx, disp, surf);
    if (dri2_dpy->vtbl->swap_buffers_with_damage)
-      ret = dri2_dpy->vtbl->swap_buffers_with_damage(drv, disp, surf,
+      ret = dri2_dpy->vtbl->swap_buffers_with_damage(disp, surf,
                                                      rects, n_rects);
    else
-      ret = dri2_dpy->vtbl->swap_buffers(drv, disp, surf);
+      ret = dri2_dpy->vtbl->swap_buffers(disp, surf);
 
    /* SwapBuffers marks the end of the frame; reset the damage region for
     * use again next time.
@@ -2029,7 +2028,7 @@ dri2_swap_buffers_with_damage(const _EGLDriver *drv, _EGLDisplay *disp,
 }
 
 static EGLBoolean
-dri2_swap_buffers_region(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
+dri2_swap_buffers_region(_EGLDisplay *disp, _EGLSurface *surf,
                          EGLint numRects, const EGLint *rects)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
@@ -2038,7 +2037,7 @@ dri2_swap_buffers_region(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *
 
    if (!dri2_dpy->vtbl->swap_buffers_region)
       return EGL_FALSE;
-   ret = dri2_dpy->vtbl->swap_buffers_region(drv, disp, surf, numRects, rects);
+   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.
index bd4c03a93dc0d6732d084dfa4952a7d74dfa876c..0f8d941f5d0135a60a1d1a003b0bf69d513b7e2a 100644 (file)
@@ -119,18 +119,15 @@ struct dri2_egl_display_vtbl {
                               const EGLint *attr_list);
 
    /* mandatory */
-   EGLBoolean (*swap_buffers)(const _EGLDriver *drv, _EGLDisplay *disp,
-                              _EGLSurface *surf);
+   EGLBoolean (*swap_buffers)(_EGLDisplay *disp, _EGLSurface *surf);
 
    /* optional - falls back to .swap_buffers */
-   EGLBoolean (*swap_buffers_with_damage)(const _EGLDriver *drv, _EGLDisplay *disp,
-                                          _EGLSurface *surface,
+   EGLBoolean (*swap_buffers_with_damage)(_EGLDisplay *disp, _EGLSurface *surface,
                                           const EGLint *rects, EGLint n_rects);
 
    /* optional */
-   EGLBoolean (*swap_buffers_region)(const _EGLDriver *drv, _EGLDisplay *disp,
-                                     _EGLSurface *surf, EGLint numRects,
-                                     const EGLint *rects);
+   EGLBoolean (*swap_buffers_region)(_EGLDisplay *disp, _EGLSurface *surf,
+                                     EGLint numRects, const EGLint *rects);
 
    /* optional */
    EGLBoolean (*post_sub_buffer)(const _EGLDriver *drv, _EGLDisplay *disp,
index 5f2987381fd9cbc997a6ad7711c470d6dd3b78a5..1d68b13e06fa3ebda4a143b7b5b9428ba369845e 100644 (file)
@@ -712,7 +712,7 @@ droid_query_buffer_age(const _EGLDriver *drv,
 }
 
 static EGLBoolean
-droid_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+droid_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
index e2a9f77c844946b63087dd3049745ad4c4745b96..2354148c9747a63a454c627882009bf23354a690 100644 (file)
@@ -414,7 +414,7 @@ dri2_drm_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
 }
 
 static EGLBoolean
-dri2_drm_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+dri2_drm_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
index 878cc60b5f292d1377108f3b9464d368489d2967..8cfacce1f34d35e3d9f3ebd6e4dc0d9f2a958e42 100644 (file)
@@ -1049,8 +1049,7 @@ try_damage_buffer(struct dri2_egl_surface *dri2_surf,
  * Called via eglSwapBuffers(), drv->SwapBuffers().
  */
 static EGLBoolean
-dri2_wl_swap_buffers_with_damage(const _EGLDriver *drv,
-                                 _EGLDisplay *disp,
+dri2_wl_swap_buffers_with_damage(_EGLDisplay *disp,
                                  _EGLSurface *draw,
                                  const EGLint *rects,
                                  EGLint n_rects)
@@ -1164,9 +1163,9 @@ dri2_wl_query_buffer_age(const _EGLDriver *drv,
 }
 
 static EGLBoolean
-dri2_wl_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+dri2_wl_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
 {
-   return dri2_wl_swap_buffers_with_damage(drv, disp, draw, NULL, 0);
+   return dri2_wl_swap_buffers_with_damage(disp, draw, NULL, 0);
 }
 
 static struct wl_buffer *
@@ -1945,7 +1944,7 @@ dri2_wl_swrast_put_image(__DRIdrawable * draw, int op,
 }
 
 static EGLBoolean
-dri2_wl_swrast_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+dri2_wl_swrast_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
index de465f52fd4e58aaf29a5c99b8cf85b213245985..9fb9423123bb9957d9f7c79005d5ef4d472fdd31 100644 (file)
@@ -842,7 +842,7 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
 }
 
 static EGLBoolean
-dri2_copy_region(const _EGLDriver *drv, _EGLDisplay *disp,
+dri2_copy_region(_EGLDisplay *disp,
                 _EGLSurface *draw, xcb_xfixes_region_t region)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
@@ -872,7 +872,7 @@ dri2_copy_region(const _EGLDriver *drv, _EGLDisplay *disp,
 }
 
 static int64_t
-dri2_x11_swap_buffers_msc(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
+dri2_x11_swap_buffers_msc(_EGLDisplay *disp, _EGLSurface *draw,
                           int64_t msc, int64_t divisor, int64_t remainder)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
@@ -888,7 +888,7 @@ dri2_x11_swap_buffers_msc(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface
    int64_t swap_count = -1;
 
    if (draw->SwapBehavior == EGL_BUFFER_PRESERVED || !dri2_dpy->swap_available) {
-      swap_count = dri2_copy_region(drv, disp, draw, dri2_surf->region) ? 0 : -1;
+      swap_count = dri2_copy_region(disp, draw, dri2_surf->region) ? 0 : -1;
    } else {
       dri2_flush_drawable_for_swapbuffers(disp, draw);
 
@@ -922,7 +922,7 @@ dri2_x11_swap_buffers_msc(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface
 }
 
 static EGLBoolean
-dri2_x11_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+dri2_x11_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
@@ -932,7 +932,7 @@ dri2_x11_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dra
       return EGL_TRUE;
    }
 
-   if (dri2_x11_swap_buffers_msc(drv, disp, draw, 0, 0, 0) == -1) {
+   if (dri2_x11_swap_buffers_msc(disp, draw, 0, 0, 0) == -1) {
       /* Swap failed with a window drawable. */
       return _eglError(EGL_BAD_NATIVE_WINDOW, __func__);
    }
@@ -940,8 +940,7 @@ dri2_x11_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dra
 }
 
 static EGLBoolean
-dri2_x11_swap_buffers_region(const _EGLDriver *drv, _EGLDisplay *disp,
-                             _EGLSurface *draw,
+dri2_x11_swap_buffers_region(_EGLDisplay *disp, _EGLSurface *draw,
                              EGLint numRects, const EGLint *rects)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
@@ -951,7 +950,7 @@ dri2_x11_swap_buffers_region(const _EGLDriver *drv, _EGLDisplay *disp,
    xcb_rectangle_t rectangles[16];
 
    if (numRects > (int)ARRAY_SIZE(rectangles))
-      return dri2_copy_region(drv, disp, draw, dri2_surf->region);
+      return dri2_copy_region(disp, draw, dri2_surf->region);
 
    for (int i = 0; i < numRects; i++) {
       rectangles[i].x = rects[i * 4];
@@ -962,7 +961,7 @@ dri2_x11_swap_buffers_region(const _EGLDriver *drv, _EGLDisplay *disp,
 
    region = xcb_generate_id(dri2_dpy->conn);
    xcb_xfixes_create_region(dri2_dpy->conn, region, numRects, rectangles);
-   ret = dri2_copy_region(drv, disp, draw, region);
+   ret = dri2_copy_region(disp, draw, region);
    xcb_xfixes_destroy_region(dri2_dpy->conn, region);
 
    return ret;
@@ -977,7 +976,7 @@ dri2_x11_post_sub_buffer(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *
    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);
+   return dri2_x11_swap_buffers_region(disp, draw, 1, rect);
 }
 
 static EGLBoolean
index c5af9b50834829df6c45e2e2d7e429afdb25e74c..b15b06b098fd94c7dd8729d2c6a83f0f65ee7cfd 100644 (file)
@@ -413,7 +413,7 @@ const __DRIimageLoaderExtension dri3_image_loader_extension = {
 };
 
 static EGLBoolean
-dri3_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
+dri3_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
 {
    struct dri3_egl_surface *dri3_surf = dri3_egl_surface(draw);
 
index 3bb1a798466fbd3317a7e07d2ec83239d1f34c6e..8eda31c29362ac06200dcd0d0746c448f5756af1 100644 (file)
@@ -299,7 +299,7 @@ haiku_make_current(_EGLDisplay *disp, _EGLSurface *dsurf,
 
 extern "C"
 EGLBoolean
-haiku_swap_buffers(const _EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
+haiku_swap_buffers(_EGLDisplay *disp, _EGLSurface *surf)
 {
        struct haiku_egl_surface* surface = haiku_egl_surface(surf);
 
index f8c881d29238bb85452145ea16f396b6c084f821..5b78c9bae26389760f114edb83644b77a0174354 100644 (file)
@@ -1333,7 +1333,7 @@ eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
    if (surf->Lost)
       RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_FALSE);
 
-   ret = drv->SwapBuffers(drv, disp, surf);
+   ret = drv->SwapBuffers(disp, surf);
 
    /* EGL_KHR_partial_update
     * Frame boundary successfully reached,
@@ -1369,7 +1369,7 @@ _eglSwapBuffersWithDamageCommon(_EGLDisplay *disp, _EGLSurface *surf,
    if ((n_rects > 0 && rects == NULL) || n_rects < 0)
       RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
 
-   ret = drv->SwapBuffersWithDamageEXT(drv, disp, surf, rects, n_rects);
+   ret = drv->SwapBuffersWithDamageEXT(disp, surf, rects, n_rects);
 
    /* EGL_KHR_partial_update
     * Frame boundary successfully reached,
@@ -2190,7 +2190,7 @@ eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface,
        surf != ctx->DrawSurface)
       RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
 
-   ret = drv->SwapBuffersRegionNOK(drv, disp, surf, numRects, rects);
+   ret = drv->SwapBuffersRegionNOK(disp, surf, numRects, rects);
 
    RETURN_EGL_EVAL(disp, ret);
 }
index 214eb50d8bcf7fcb4c9470595af33497028d5890..5341b3a336e823dec515e05aceb6314afe4bde46 100644 (file)
@@ -117,8 +117,7 @@ struct _egl_driver
                                  EGLint buffer);
    EGLBoolean (*SwapInterval)(_EGLDisplay *disp, _EGLSurface *surf,
                               EGLint interval);
-   EGLBoolean (*SwapBuffers)(const _EGLDriver *drv, _EGLDisplay *disp,
-                             _EGLSurface *draw);
+   EGLBoolean (*SwapBuffers)(_EGLDisplay *disp, _EGLSurface *draw);
    EGLBoolean (*CopyBuffers)(const _EGLDriver *drv, _EGLDisplay *disp,
                              _EGLSurface *surface, void *native_pixmap_target);
    EGLBoolean (*SetDamageRegion)(const _EGLDriver *drv, _EGLDisplay *disp,
@@ -152,9 +151,8 @@ struct _egl_driver
    EGLint (*DupNativeFenceFDANDROID)(const _EGLDriver *drv, _EGLDisplay *disp,
                                      _EGLSync *sync);
 
-   EGLBoolean (*SwapBuffersRegionNOK)(const _EGLDriver *drv, _EGLDisplay *disp,
-                                      _EGLSurface *surf, EGLint numRects,
-                                      const EGLint *rects);
+   EGLBoolean (*SwapBuffersRegionNOK)(_EGLDisplay *disp, _EGLSurface *surf,
+                                      EGLint numRects, const EGLint *rects);
 
    _EGLImage *(*CreateDRMImageMESA)(const _EGLDriver *drv, _EGLDisplay *disp,
                                     const EGLint *attr_list);
@@ -174,8 +172,7 @@ struct _egl_driver
                                                        _EGLDisplay *disp,
                                                        _EGLImage *img);
 
-   EGLBoolean (*SwapBuffersWithDamageEXT)(const _EGLDriver *drv, _EGLDisplay *disp,
-                                          _EGLSurface *surface,
+   EGLBoolean (*SwapBuffersWithDamageEXT)(_EGLDisplay *disp, _EGLSurface *surface,
                                           const EGLint *rects, EGLint n_rects);
 
    EGLBoolean (*PostSubBufferNV)(const _EGLDriver *drv, _EGLDisplay *disp,