[Mesa-dev] [PATCH 2/8] egl: drop unreachable BAD_NATIVE_WINDOW conditions
Eric Engestrom
eric.engestrom at imgtec.com
Tue Aug 8 14:57:06 UTC 2017
On Tuesday, 2017-08-08 08:02:27 +0300, Tapani Pälli wrote:
>
>
> On 08/05/2017 02:25 AM, Emil Velikov wrote:
> > From: Emil Velikov <emil.velikov at collabora.com>
> >
> > The code in _eglCreatePixmapSurfaceCommon() already has a NULL check
>
> _eglCreateWindowSurfaceCommon()
>
> > which handles the condition. There's no point in checkin again further
"checking"
With the two typos Tapani noticed fixed,
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
> > down the stack.
> >
> > v2: Split the WINDOW vs PIXMAP into separate patches
> >
> > Cc: Eric Engestrom <eric.engestrom at imgtec.com>
> > Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> > ---
> > src/egl/drivers/dri2/platform_android.c | 2 +-
> > src/egl/drivers/dri2/platform_drm.c | 5 -----
> > src/egl/drivers/dri2/platform_wayland.c | 5 -----
> > src/egl/drivers/dri2/platform_x11.c | 6 ++----
> > 4 files changed, 3 insertions(+), 15 deletions(-)
> >
> > diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
> > index 50a82486956..beb474025f7 100644
> > --- a/src/egl/drivers/dri2/platform_android.c
> > +++ b/src/egl/drivers/dri2/platform_android.c
> > @@ -329,7 +329,7 @@ droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
> > if (type == EGL_WINDOW_BIT) {
> > int format;
> > - if (!window || window->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
> > + if (window->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
> > _eglError(EGL_BAD_NATIVE_WINDOW, "droid_create_surface");
> > goto cleanup_surface;
> > }
> > diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
> > index a952aa54560..7ea43e62010 100644
> > --- a/src/egl/drivers/dri2/platform_drm.c
> > +++ b/src/egl/drivers/dri2/platform_drm.c
> > @@ -115,11 +115,6 @@ dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
> > switch (type) {
> > case EGL_WINDOW_BIT:
> > - if (!window) {
> > - _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
> > - goto cleanup_surf;
> > - }
> > -
> > surf = gbm_dri_surface(window);
> > dri2_surf->gbm_surf = surf;
> > dri2_surf->base.Width = surf->base.width;
> > diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
> > index 38fdfe974fa..dcc777a3e8b 100644
> > --- a/src/egl/drivers/dri2/platform_wayland.c
> > +++ b/src/egl/drivers/dri2/platform_wayland.c
> > @@ -162,11 +162,6 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
> > dri2_surf->format = WL_SHM_FORMAT_ARGB8888;
> > }
> > - if (!window) {
> > - _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
> > - goto cleanup_surf;
> > - }
> > -
> > dri2_surf->wl_win = window;
> > dri2_surf->wl_queue = wl_display_create_queue(dri2_dpy->wl_dpy);
> > if (!dri2_surf->wl_queue) {
> > diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
> > index 7b5a1770bd7..00cab577b77 100644
> > --- a/src/egl/drivers/dri2/platform_x11.c
> > +++ b/src/egl/drivers/dri2/platform_x11.c
> > @@ -235,10 +235,8 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
> > dri2_surf->base.Width, dri2_surf->base.Height);
> > } else {
> > if (!drawable) {
> > - if (type == EGL_WINDOW_BIT)
> > - _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
> > - else
> > - _eglError(EGL_BAD_NATIVE_PIXMAP, "dri2_create_surface");
> > + assert(type == EGL_PIXMAP_BIT_BIT)
>
> no BIT_BIT but EGL_PIXMAP_BIT :)
>
> > + _eglError(EGL_BAD_NATIVE_PIXMAP, "dri2_create_surface");
> > goto cleanup_surf;
> > }
> > dri2_surf->drawable = drawable;
> >
More information about the mesa-dev
mailing list