egl/android: fix buffer_count for applications setting max count
authorTapani Pälli <tapani.palli@intel.com>
Tue, 21 Jan 2020 11:01:51 +0000 (13:01 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 22 Jan 2020 10:37:04 +0000 (10:37 +0000)
commit39e7492d33c89ee7049d5bc07267d131cc6a1ff9
treeafc1dcb695059909f4d14964e242d2ff9b7da6c3
parent1c9ecb21237a24675d0ab001ef61efa70385399d
egl/android: fix buffer_count for applications setting max count

Problem with previous solution was that it did not take account that
some applications may set a max count for buffers. Therefore we need to
query both min and max and clamp our setting based on that.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2373
Fixes: be08e6a4496 ("egl/android: Restrict minimum triple buffering for android color_buffers")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3480>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3480>
src/egl/drivers/dri2/platform_android.c