egl/android: enable/disable KHR_partial_update correctly
authorChia-I Wu <olvaffe@gmail.com>
Wed, 18 Mar 2020 19:50:31 +0000 (12:50 -0700)
committerChia-I Wu <olvaffe@gmail.com>
Mon, 23 Mar 2020 23:22:24 +0000 (16:22 -0700)
Commit f3728816af (egl/android: require ANDROID_native_fence_sync
for buffer age) re-added some stale code removed in commit
b4345da8762 (egl/android: Delete set_damage_region from egl dri
vtbl).  Remove it now.

Commit b4345da8762 assumes KHR_partial_update is only
driver-dependent.  That is mostly true except that the extension
also introduces buffer age query, which depends on
ANDROID_native_fence_sync on Android.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4235>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4235>

src/egl/drivers/dri2/platform_android.c

index c682b06d20069370afb66035281b00ac2c890557..6f90fd46688b206d5ee8a155d2abe6eda2f91313 100644 (file)
@@ -1657,9 +1657,11 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp)
     */
    if (disp->Extensions.ANDROID_native_fence_sync) {
       disp->Extensions.EXT_buffer_age = EGL_TRUE;
-#if ANDROID_API_LEVEL >= 23
-      disp->Extensions.KHR_partial_update = EGL_TRUE;
-#endif
+   } else {
+      /* disable KHR_partial_update that might have been enabled in
+       * dri2_setup_screen
+       */
+      disp->Extensions.KHR_partial_update = EGL_FALSE;
    }
 
    disp->Extensions.KHR_image = EGL_TRUE;