egl: Improve driver selection.
authorChia-I Wu <olv@lunarg.com>
Wed, 12 Jan 2011 20:40:38 +0000 (04:40 +0800)
committerChia-I Wu <olv@lunarg.com>
Thu, 13 Jan 2011 10:15:45 +0000 (18:15 +0800)
commita22a332fc7cc54d4d0973dcd21a90159cc51de1a
treeb27bd01fcc099bfb7623e3fd1e1ef3016b3ef399
parent655e4598927728a663f4cfcd6babdf7e5ad83f77
egl: Improve driver selection.

The idea is to be able to match a driver using the following order

  try egl_gallium with hw renderer
  try egl_dri2
  try egl_gallium with sw renderer
  try egl_glx

given the module list

  egl_gallium
  egl_dri2
  egl_glx

For that, UseFallback initialization option is added.  The module list
is matched twice: with the option unset and with the option set.  In the
first pass, egl_gallium skips its sw renderer and egl_glx rejects to
initialize since UseFallback is not set.  In the second pass,
egl_gallium skips its hw renderer and egl_dri2 rejects to initialize
since UseFallback is set.  The process stops at the first driver that
initializes the display.
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/glx/egl_glx.c
src/egl/main/egldisplay.h
src/egl/main/egldriver.c
src/gallium/state_trackers/egl/common/egl_g3d.c
src/gallium/state_trackers/egl/common/native.h
src/gallium/state_trackers/egl/drm/native_drm.c
src/gallium/state_trackers/egl/fbdev/native_fbdev.c
src/gallium/state_trackers/egl/gdi/native_gdi.c
src/gallium/state_trackers/egl/x11/native_x11.c