I'm seeing that message quite often when running the unit tests. The problem seems to be that some tests run so fast that the web process never renders the first frame, so the context is created but never made current. I've checked with apitrace that there are calls to eglQueryContext with null display, causing a EGL_BAD_DISPLAY, but I don't know where those calls are originated, see: 12 eglChooseConfig(dpy = 0x55afaa1eaba0, attrib_list = {EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_STENCIL_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_NONE}, configs = &0x55afaa1eba50, config_size = 1, num_config = &1) = EGL_TRUE 13 eglCreateContext(dpy = 0x55afaa1eaba0, config = 0x55afaa1eba50, share_context = 0x7f8c24003290, attrib_list = {EGL_CONTEXT_MAJOR_VERSION, 2, EGL_NONE}) = 0x7f8c240391c0 14 eglCreateWindowSurface(dpy = 0x55afaa1eaba0, config = 0x55afaa1eba50, win = 0x7f8c24039130, attrib_list = {}) = 0x7f8c240476a0 15 eglGetCurrentDisplay() = NULL 16 eglGetCurrentContext() = NULL 17 eglGetCurrentDisplay() = NULL 18 eglQueryContext(dpy = NULL, ctx = NULL, attribute = EGL_CONTEXT_CLIENT_TYPE, value = &0) = EGL_FALSE 19 eglGetError() = EGL_BAD_DISPLAY
Created attachment 327358 [details] Patch
Looks good to me. The context that is being created is meant to be made current in the compositing thread, so there shouldn't be any problem by making it current when it's created instead of waiting for the first rendered frame.
Committed r225078: <https://trac.webkit.org/changeset/225078>