diff options
author | Tapani Pälli <[email protected]> | 2017-06-08 12:24:24 +0300 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2017-06-09 07:39:22 +0300 |
commit | 8fac894f9b8e4e2cb93061fdd25f3aecbfb3bbb7 (patch) | |
tree | 47801fa4bcc687a5c2e09d2615b6997496d4525c /src/egl/drivers/dri2 | |
parent | c2464271a04964121d21eb1508d9dc61ec2d8e71 (diff) |
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 <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Cc: [email protected]
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r-- | src/egl/drivers/dri2/platform_android.c | 4 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_drm.c | 2 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 48ecb9fd40b..4c979351192 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -614,10 +614,10 @@ droid_query_buffer_age(_EGLDriver *drv, if (update_buffers(dri2_surf) < 0) { _eglError(EGL_BAD_ALLOC, "droid_query_buffer_age"); - return 0; + return -1; } - return dri2_surf->back->age; + return dri2_surf->back ? dri2_surf->back->age : 0; } static EGLBoolean diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 2f045894265..36c89fc832b 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -464,7 +464,7 @@ dri2_drm_query_buffer_age(_EGLDriver *drv, if (get_back_bo(dri2_surf) < 0) { _eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age"); - return 0; + return -1; } return dri2_surf->back->age; diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index e447aa67290..15cc597111e 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -810,7 +810,7 @@ dri2_wl_query_buffer_age(_EGLDriver *drv, if (get_back_bo(dri2_surf) < 0) { _eglError(EGL_BAD_ALLOC, "dri2_query_buffer_age"); - return 0; + return -1; } return dri2_surf->back->age; |