egl/dri2: dri2_initialize: Do not reference-count TestOnly display
authorNicolas Boichat <drinkcat@chromium.org>
Wed, 3 Aug 2016 13:54:22 +0000 (21:54 +0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 23 Aug 2016 17:08:17 +0000 (18:08 +0100)
commit4f3f8bb59dd98e39c363fe47a55a7f97e7df9f4b
treeb620e1ae8eb397b674ab580d5b2362847b0a6486
parent6687037f1fdc76089f3d0ad2f4d48aa8c2263f28
egl/dri2: dri2_initialize: Do not reference-count TestOnly display

In the case where dri2_initialize is called with a TestOnly display,
the display is not actually initialized, so dri2_egl_display always
fails, and we cannot do any reference counting.

Fixes piglit spec@egl_khr_create_context@verify gl flavor (reproducible
with LIBGL_ALWAYS_SOFTWARE=1).

Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reported-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/egl_dri2.c