summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_android.c
diff options
context:
space:
mode:
authorTomasz Figa <tfiga@chromium.org>2016-08-02 20:07:50 +0900
committerChad Versace <chad@kiwitree.net>2016-08-08 11:40:31 -0700
commit217af75a4092545fb9f5afe4a12e0b74cb1b48e4 (patch)
tree9ab70484b2637490f7f45893e5413a151ae21377 /src/egl/drivers/dri2/platform_android.c
parentc6c26bc589f57c083f040ad70d1606cfa382c66a (diff)
downloadexternal_mesa3d-217af75a4092545fb9f5afe4a12e0b74cb1b48e4.zip
external_mesa3d-217af75a4092545fb9f5afe4a12e0b74cb1b48e4.tar.gz
external_mesa3d-217af75a4092545fb9f5afe4a12e0b74cb1b48e4.tar.bz2
egl/android: Respect buffer mask in droid_image_get_buffers (v2)
Drivers can request different set of buffers depending on the buffer mask they pass to the get_buffers callback. This patch makes droid_image_get_buffers() respect this mask. v2: Return error only in case of real error condition and ignore requests of unavailable buffers. Signed-off-by: Tomasz Figa <tfiga@chromium.org> Tested-by: Rob Herring <rob@kernel.org> Reviewed-by: Chad Versace <chad@kiwitree.net> Change-Id: I6c3c4eca90f4c618579f6725dec323c004cb44ba
Diffstat (limited to 'src/egl/drivers/dri2/platform_android.c')
-rw-r--r--src/egl/drivers/dri2/platform_android.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 124a30c..d78c06d 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -434,16 +434,26 @@ droid_image_get_buffers(__DRIdrawable *driDrawable,
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
+ images->image_mask = 0;
+
if (update_buffers(dri2_surf) < 0)
return 0;
- if (get_back_bo(dri2_surf) < 0) {
- _eglError(EGL_BAD_PARAMETER, "get_back_bo");
- return 0;
+ if (buffer_mask & __DRI_IMAGE_BUFFER_FRONT) {
+ /*
+ * We don't support front buffers and GLES doesn't require them for
+ * window surfaces, but some DRI drivers will request them anyway.
+ * We just ignore such request as other platforms backends do.
+ */
}
- images->image_mask = __DRI_IMAGE_BUFFER_BACK;
- images->back = dri2_surf->dri_image;
+ if (buffer_mask & __DRI_IMAGE_BUFFER_BACK) {
+ if (get_back_bo(dri2_surf) < 0)
+ return 0;
+
+ images->back = dri2_surf->dri_image;
+ images->image_mask |= __DRI_IMAGE_BUFFER_BACK;
+ }
return 1;
}