summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2008-05-28 01:18:45 +0200
committerJakob Bornecrantz <[email protected]>2008-05-28 10:55:27 +0100
commitc2bd95abf60a8b6ea83dce3fc67603b36f937484 (patch)
treea426ef5f332a879faaf0ac567c6291198d9e305a /src/gallium/winsys
parentb870bf79b5387f26668285f44ccbf5812ad62e10 (diff)
i915: Make EGL_i915 segfault if modesetting is not working
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/egl_drm/intel/intel_egl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/winsys/egl_drm/intel/intel_egl.c b/src/gallium/winsys/egl_drm/intel/intel_egl.c
index ac1825210eb..12eeff2b23b 100644
--- a/src/gallium/winsys/egl_drm/intel/intel_egl.c
+++ b/src/gallium/winsys/egl_drm/intel/intel_egl.c
@@ -114,6 +114,7 @@ drm_initialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor)
struct drm_screen *screen = NULL;
drmModeOutputPtr output = NULL;
drmModeResPtr res = NULL;
+ unsigned count_outputs = 0;
EGLint i;
int fd;
@@ -131,8 +132,10 @@ drm_initialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor)
drm_update_res(drm_drv);
res = drm_drv->res;
+ if (res)
+ count_outputs = res->count_outputs;
- for(i = 0; i < res->count_outputs; i++) {
+ for(i = 0; i < count_outputs; i++) {
output = drmModeGetOutput(fd, res->outputs[i]);
if (!output)