egl: fix _eglQuerySurface in EGL_BUFFER_AGE_EXT case
authorTapani Pälli <tapani.palli@intel.com>
Thu, 8 Jun 2017 09:24:24 +0000 (12:24 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Fri, 9 Jun 2017 04:39:22 +0000 (07:39 +0300)
commit8fac894f9b8e4e2cb93061fdd25f3aecbfb3bbb7
tree47801fa4bcc687a5c2e09d2615b6997496d4525c
parentc2464271a04964121d21eb1508d9dc61ec2d8e71
egl: fix _eglQuerySurface in EGL_BUFFER_AGE_EXT case

Specification states that in case of error, value should not be
written, patch changes buffer age queries to return -1 in case of
error so that we can skip changing the value.

In addition, small change to droid_query_buffer_age to return 0
in case buffer does not have a back buffer available.

Fixes:
   dEQP-EGL.functional.negative_partial_update.not_postable_surface

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Cc: mesa-stable@lists.freedesktop.org
src/egl/drivers/dri2/platform_android.c
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_wayland.c
src/egl/main/eglsurface.c