<div dir="ltr"><div>For the first 4 patches:</div><div><br></div><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 12, 2019 at 6:07 AM Boris Brezillon <<a href="mailto:boris.brezillon@collabora.com">boris.brezillon@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Harish Krupo <<a href="mailto:harishkrupo@gmail.com" target="_blank">harishkrupo@gmail.com</a>><br>
<br>
The intension of the KHR_partial_update was not to send the damage back<br>
to the platform but to send the damage to the driver to ensure that the<br>
following rendering could be restricted to those regions.<br>
This patch removes the set_damage_region from the egl_dri vtbl and all<br>
the platfrom_*.c files.<br>
Then upcomming patches add a new dri2 interface for the drivers to<br>
implement<br>
<br>
Signed-off-by: Harish Krupo <<a href="mailto:harishkrupo@gmail.com" target="_blank">harishkrupo@gmail.com</a>><br>
Reviewed-by: Daniel Stone <<a href="mailto:daniels@collabora.com" target="_blank">daniels@collabora.com</a>><br>
Signed-off-by: Boris Brezillon <<a href="mailto:boris.brezillon@collabora.com" target="_blank">boris.brezillon@collabora.com</a>><br>
Acked-by: Alyssa Rosenzweig <<a href="mailto:alyssa.rosenzweig@collabora.com" target="_blank">alyssa.rosenzweig@collabora.com</a>><br>
Reviewed-by: Qiang Yu <<a href="mailto:yuq825@gmail.com" target="_blank">yuq825@gmail.com</a>><br>
Tested-by: Qiang Yu <<a href="mailto:yuq825@gmail.com" target="_blank">yuq825@gmail.com</a>><br>
---<br>
Changes in v7:<br>
* None<br>
<br>
Changes in v6:<br>
* Fix Harish's email address<br>
<br>
Changes in v5:<br>
* Add Alyssa's a-b<br>
---<br>
 src/egl/drivers/dri2/egl_dri2.c             |  3 +-<br>
 src/egl/drivers/dri2/egl_dri2.h             |  4 --<br>
 src/egl/drivers/dri2/egl_dri2_fallbacks.h   |  9 -----<br>
 src/egl/drivers/dri2/platform_android.c     | 45 ---------------------<br>
 src/egl/drivers/dri2/platform_device.c      |  1 -<br>
 src/egl/drivers/dri2/platform_drm.c         |  1 -<br>
 src/egl/drivers/dri2/platform_surfaceless.c |  1 -<br>
 src/egl/drivers/dri2/platform_wayland.c     |  1 -<br>
 src/egl/drivers/dri2/platform_x11.c         |  2 -<br>
 src/egl/drivers/dri2/platform_x11_dri3.c    |  1 -<br>
 10 files changed, 1 insertion(+), 67 deletions(-)<br>
<br>
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c<br>
index a2f8a38bebf3..59397ed62b24 100644<br>
--- a/src/egl/drivers/dri2/egl_dri2.c<br>
+++ b/src/egl/drivers/dri2/egl_dri2.c<br>
@@ -1694,8 +1694,7 @@ static EGLBoolean<br>
 dri2_set_damage_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,<br>
                        EGLint *rects, EGLint n_rects)<br>
 {<br>
-   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);<br>
-   return dri2_dpy->vtbl->set_damage_region(drv, disp, surf, rects, n_rects);<br>
+   return false;<br>
 }<br>
<br>
 static EGLBoolean<br>
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h<br>
index 3206d00c1ca3..5246b77e64d8 100644<br>
--- a/src/egl/drivers/dri2/egl_dri2.h<br>
+++ b/src/egl/drivers/dri2/egl_dri2.h<br>
@@ -122,10 +122,6 @@ struct dri2_egl_display_vtbl {<br>
                                           _EGLSurface *surface,<br>
                                           const EGLint *rects, EGLint n_rects);<br>
<br>
-   EGLBoolean (*set_damage_region)(_EGLDriver *drv, _EGLDisplay *disp,<br>
-                                   _EGLSurface *surface,<br>
-                                   const EGLint *rects, EGLint n_rects);<br>
-<br>
    EGLBoolean (*swap_buffers_region)(_EGLDriver *drv, _EGLDisplay *disp,<br>
                                      _EGLSurface *surf, EGLint numRects,<br>
                                      const EGLint *rects);<br>
diff --git a/src/egl/drivers/dri2/egl_dri2_fallbacks.h b/src/egl/drivers/dri2/egl_dri2_fallbacks.h<br>
index 6c2c4bbe595e..d975b7a8b130 100644<br>
--- a/src/egl/drivers/dri2/egl_dri2_fallbacks.h<br>
+++ b/src/egl/drivers/dri2/egl_dri2_fallbacks.h<br>
@@ -62,7 +62,6 @@ dri2_fallback_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *disp,<br>
                                       const EGLint *rects, EGLint n_rects)<br>
 {<br>
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);<br>
-   dri2_dpy->vtbl->set_damage_region(drv, disp, surf, rects, n_rects);<br>
    return dri2_dpy->vtbl->swap_buffers(drv, disp, surf);<br>
 }<br>
<br>
@@ -90,14 +89,6 @@ dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp,<br>
    return _eglError(EGL_BAD_NATIVE_PIXMAP, "no support for native pixmaps");<br>
 }<br>
<br>
-static inline EGLBoolean<br>
-dri2_fallback_set_damage_region(_EGLDriver *drv, _EGLDisplay *disp,<br>
-                                _EGLSurface *surf,<br>
-                                const EGLint *rects, EGLint n_rects)<br>
-{<br>
-   return EGL_FALSE;<br>
-}<br>
-<br>
 static inline EGLint<br>
 dri2_fallback_query_buffer_age(_EGLDriver *drv, _EGLDisplay *disp,<br>
                                _EGLSurface *surf)<br>
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c<br>
index d37f6b8e447d..dda38d672653 100644<br>
--- a/src/egl/drivers/dri2/platform_android.c<br>
+++ b/src/egl/drivers/dri2/platform_android.c<br>
@@ -761,43 +761,6 @@ droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)<br>
    return EGL_TRUE;<br>
 }<br>
<br>
-#if ANDROID_API_LEVEL >= 23<br>
-static EGLBoolean<br>
-droid_set_damage_region(_EGLDriver *drv,<br>
-                        _EGLDisplay *disp,<br>
-                        _EGLSurface *draw, const EGLint* rects, EGLint n_rects)<br>
-{<br>
-   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);<br>
-   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);<br>
-   android_native_rect_t* droid_rects = NULL;<br>
-   int ret;<br>
-<br>
-   if (n_rects == 0)<br>
-      return EGL_TRUE;<br>
-<br>
-   droid_rects = malloc(n_rects * sizeof(android_native_rect_t));<br>
-   if (droid_rects == NULL)<br>
-     return _eglError(EGL_BAD_ALLOC, "eglSetDamageRegionKHR");<br>
-<br>
-   for (EGLint num_drects = 0; num_drects < n_rects; num_drects++) {<br>
-      EGLint i = num_drects * 4;<br>
-      droid_rects[num_drects].left = rects[i];<br>
-      droid_rects[num_drects].bottom = rects[i + 1];<br>
-      droid_rects[num_drects].right = rects[i] + rects[i + 2];<br>
-      droid_rects[num_drects].top = rects[i + 1] + rects[i + 3];<br>
-   }<br>
-<br>
-   /*<br>
-    * XXX/TODO: Need to check for other return values<br>
-    */<br>
-<br>
-   ret = native_window_set_surface_damage(dri2_surf->window, droid_rects, n_rects);<br>
-   free(droid_rects);<br>
-<br>
-   return ret == 0 ? EGL_TRUE : EGL_FALSE;<br>
-}<br>
-#endif<br>
-<br>
 static _EGLImage *<br>
 droid_create_image_from_prime_fds_yuv(_EGLDisplay *disp, _EGLContext *ctx,<br>
                                      struct ANativeWindowBuffer *buf,<br>
@@ -1262,11 +1225,6 @@ static const struct dri2_egl_display_vtbl droid_display_vtbl = {<br>
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage, /* Android implements the function */<br>
    .swap_buffers_region = dri2_fallback_swap_buffers_region,<br>
    .swap_interval = droid_swap_interval,<br>
-#if ANDROID_API_LEVEL >= 23<br>
-   .set_damage_region = droid_set_damage_region,<br>
-#else<br>
-   .set_damage_region = dri2_fallback_set_damage_region,<br>
-#endif<br>
    .post_sub_buffer = dri2_fallback_post_sub_buffer,<br>
    .copy_buffers = dri2_fallback_copy_buffers,<br>
    .query_buffer_age = droid_query_buffer_age,<br>
@@ -1649,9 +1607,6 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp)<br>
    disp->Extensions.ANDROID_image_native_buffer = EGL_TRUE;<br>
    disp->Extensions.ANDROID_recordable = EGL_TRUE;<br>
    disp->Extensions.EXT_buffer_age = EGL_TRUE;<br>
-#if ANDROID_API_LEVEL >= 23<br>
-   disp->Extensions.KHR_partial_update = EGL_TRUE;<br>
-#endif<br>
    disp->Extensions.KHR_image = EGL_TRUE;<br>
 #if ANDROID_API_LEVEL >= 24<br>
    if (dri2_dpy->mutable_render_buffer &&<br>
diff --git a/src/egl/drivers/dri2/platform_device.c b/src/egl/drivers/dri2/platform_device.c<br>
index 6b80a3869b3c..e7ae3a3aa2a7 100644<br>
--- a/src/egl/drivers/dri2/platform_device.c<br>
+++ b/src/egl/drivers/dri2/platform_device.c<br>
@@ -229,7 +229,6 @@ static const struct dri2_egl_display_vtbl dri2_device_display_vtbl = {<br>
    .destroy_surface = device_destroy_surface,<br>
    .create_image = dri2_create_image_khr,<br>
    .swap_buffers_region = dri2_fallback_swap_buffers_region,<br>
-   .set_damage_region = dri2_fallback_set_damage_region,<br>
    .post_sub_buffer = dri2_fallback_post_sub_buffer,<br>
    .copy_buffers = dri2_fallback_copy_buffers,<br>
    .query_buffer_age = dri2_fallback_query_buffer_age,<br>
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c<br>
index b0a2af6bf3d4..648bc86ade70 100644<br>
--- a/src/egl/drivers/dri2/platform_drm.c<br>
+++ b/src/egl/drivers/dri2/platform_drm.c<br>
@@ -668,7 +668,6 @@ static const struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {<br>
    .swap_buffers = dri2_drm_swap_buffers,<br>
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,<br>
    .swap_buffers_region = dri2_fallback_swap_buffers_region,<br>
-   .set_damage_region = dri2_fallback_set_damage_region,<br>
    .post_sub_buffer = dri2_fallback_post_sub_buffer,<br>
    .copy_buffers = dri2_fallback_copy_buffers,<br>
    .query_buffer_age = dri2_drm_query_buffer_age,<br>
diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c<br>
index fd6ec6e602d3..142165807c3f 100644<br>
--- a/src/egl/drivers/dri2/platform_surfaceless.c<br>
+++ b/src/egl/drivers/dri2/platform_surfaceless.c<br>
@@ -223,7 +223,6 @@ static const struct dri2_egl_display_vtbl dri2_surfaceless_display_vtbl = {<br>
    .destroy_surface = surfaceless_destroy_surface,<br>
    .create_image = dri2_create_image_khr,<br>
    .swap_buffers_region = dri2_fallback_swap_buffers_region,<br>
-   .set_damage_region = dri2_fallback_set_damage_region,<br>
    .post_sub_buffer = dri2_fallback_post_sub_buffer,<br>
    .copy_buffers = dri2_fallback_copy_buffers,<br>
    .query_buffer_age = dri2_fallback_query_buffer_age,<br>
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c<br>
index 4c9046446a7c..70a7bef9b11c 100644<br>
--- a/src/egl/drivers/dri2/platform_wayland.c<br>
+++ b/src/egl/drivers/dri2/platform_wayland.c<br>
@@ -1313,7 +1313,6 @@ static const struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {<br>
    .swap_buffers = dri2_wl_swap_buffers,<br>
    .swap_buffers_with_damage = dri2_wl_swap_buffers_with_damage,<br>
    .swap_buffers_region = dri2_fallback_swap_buffers_region,<br>
-   .set_damage_region = dri2_fallback_set_damage_region,<br>
    .post_sub_buffer = dri2_fallback_post_sub_buffer,<br>
    .copy_buffers = dri2_fallback_copy_buffers,<br>
    .query_buffer_age = dri2_wl_query_buffer_age,<br>
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c<br>
index 7e6aad66a431..7a58e7184928 100644<br>
--- a/src/egl/drivers/dri2/platform_x11.c<br>
+++ b/src/egl/drivers/dri2/platform_x11.c<br>
@@ -1263,7 +1263,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {<br>
    .destroy_surface = dri2_x11_destroy_surface,<br>
    .create_image = dri2_create_image_khr,<br>
    .swap_buffers = dri2_x11_swap_buffers,<br>
-   .set_damage_region = dri2_fallback_set_damage_region,<br>
    .swap_buffers_region = dri2_fallback_swap_buffers_region,<br>
    .post_sub_buffer = dri2_fallback_post_sub_buffer,<br>
    /* XXX: should really implement this since X11 has pixmaps */<br>
@@ -1286,7 +1285,6 @@ static const struct dri2_egl_display_vtbl dri2_x11_display_vtbl = {<br>
    .swap_buffers = dri2_x11_swap_buffers,<br>
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,<br>
    .swap_buffers_region = dri2_x11_swap_buffers_region,<br>
-   .set_damage_region = dri2_fallback_set_damage_region,<br>
    .post_sub_buffer = dri2_x11_post_sub_buffer,<br>
    .copy_buffers = dri2_x11_copy_buffers,<br>
    .query_buffer_age = dri2_fallback_query_buffer_age,<br>
diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c<br>
index c2228b08b00d..ab137195a97c 100644<br>
--- a/src/egl/drivers/dri2/platform_x11_dri3.c<br>
+++ b/src/egl/drivers/dri2/platform_x11_dri3.c<br>
@@ -501,7 +501,6 @@ struct dri2_egl_display_vtbl dri3_x11_display_vtbl = {<br>
    .swap_buffers = dri3_swap_buffers,<br>
    .swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,<br>
    .swap_buffers_region = dri2_fallback_swap_buffers_region,<br>
-   .set_damage_region = dri2_fallback_set_damage_region,<br>
    .post_sub_buffer = dri2_fallback_post_sub_buffer,<br>
    .copy_buffers = dri3_copy_buffers,<br>
    .query_buffer_age = dri3_query_buffer_age,<br>
-- <br>
2.21.0<br>
<br>
</blockquote></div>