summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl/fbdev
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2011-01-13 04:40:38 +0800
committerChia-I Wu <olv@lunarg.com>2011-01-13 18:15:45 +0800
commita22a332fc7cc54d4d0973dcd21a90159cc51de1a (patch)
treeb27bd01fcc099bfb7623e3fd1e1ef3016b3ef399 /src/gallium/state_trackers/egl/fbdev
parent655e4598927728a663f4cfcd6babdf7e5ad83f77 (diff)
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.
Diffstat (limited to 'src/gallium/state_trackers/egl/fbdev')
-rw-r--r--src/gallium/state_trackers/egl/fbdev/native_fbdev.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/egl/fbdev/native_fbdev.c b/src/gallium/state_trackers/egl/fbdev/native_fbdev.c
index 1b5ea8bf9d..a1e91ba701 100644
--- a/src/gallium/state_trackers/egl/fbdev/native_fbdev.c
+++ b/src/gallium/state_trackers/egl/fbdev/native_fbdev.c
@@ -459,9 +459,16 @@ fbdev_display_create(int fd, struct native_event_handler *event_handler,
return &fbdpy->base;
}
+static struct native_event_handler *fbdev_event_handler;
+
+static void
+native_set_event_handler(struct native_event_handler *event_handler)
+{
+ fbdev_event_handler = event_handler;
+}
+
static struct native_display *
-native_create_display(void *dpy, struct native_event_handler *event_handler,
- void *user_data)
+native_create_display(void *dpy, boolean use_sw, void *user_data)
{
struct native_display *ndpy;
int fd;
@@ -476,7 +483,7 @@ native_create_display(void *dpy, struct native_event_handler *event_handler,
if (fd < 0)
return NULL;
- ndpy = fbdev_display_create(fd, event_handler, user_data);
+ ndpy = fbdev_display_create(fd, fbdev_event_handler, user_data);
if (!ndpy)
close(fd);
@@ -485,6 +492,7 @@ native_create_display(void *dpy, struct native_event_handler *event_handler,
static const struct native_platform fbdev_platform = {
"FBDEV", /* name */
+ native_set_event_handler,
native_create_display
};