On Fri, Apr 27, 2018 at 11:17 AM, samiuddi <sami.uddin.moham...@intel.com> wrote: > Test: CtsDisplayTestCases pass > > Signed-off-by: samiuddi <sami.uddin.moham...@intel.com> > --- > src/egl/drivers/dri2/platform_android.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/egl/drivers/dri2/platform_android.c > b/src/egl/drivers/dri2/platform_android.c > index 976dd10..5048830 100644 > --- a/src/egl/drivers/dri2/platform_android.c > +++ b/src/egl/drivers/dri2/platform_android.c > @@ -480,6 +480,9 @@ static EGLBoolean > droid_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy, > _EGLSurface *surf, EGLint interval) > { > + if (surf->Type == EGL_PBUFFER_BIT) > + return EGL_FALSE; > + > struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf); > struct ANativeWindow *window = dri2_surf->window; >
While it seems like pbuffers are the only non-window surface-type the android-driver supports, would it not be cleaner to check for EGL_WINDOW_BIT here instead? Also, I don't think EGL_FALSE is the right return-value, as it doesn't seem the EGL 1.5 spec defines any such error. Also, for instance dri2_swap_interval returns EGL_TRUE when there's no driver-function, which further backs the "silent failure" in this case IMO. But, can't we check if the window is non-NULL on usage instead? Something like this... diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 7f1a496ea24..41bdcc2f175 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -424,7 +424,7 @@ droid_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy, struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf); struct ANativeWindow *window = dri2_surf->window; - if (window->setSwapInterval(window, interval)) + if (window && window->setSwapInterval(window, interval)) return EGL_FALSE; surf->SwapInterval = interval; _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev