gbm: Fix build without gallium_drm_loader
authorChí-Thanh Christopher Nguyễn <chithanh@gentoo.org>
Thu, 9 Aug 2012 15:42:24 +0000 (17:42 +0200)
committerMatt Turner <mattst88@gmail.com>
Sun, 12 Aug 2012 21:38:32 +0000 (14:38 -0700)
pipe_loader_drm_probe_fd only exists if HAVE_PIPE_LOADER_DRM is defined.
Patch improved as suggested by Vadim A. Misbakh-Soloviov.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52962
src/gallium/targets/gbm/gbm.c

index 7d2af513db82f9a60a5b6c0d2d809fe5e2b7ff00..8f460573b56fcec1fbc8905ced258840621a2f1c 100644 (file)
@@ -49,11 +49,13 @@ int
 gallium_screen_create(struct gbm_gallium_drm_device *gdrm)
 {
    struct pipe_loader_device *dev;
+#ifdef HAVE_PIPE_LOADER_DRM
    int ret;
 
    ret = pipe_loader_drm_probe_fd(&dev, gdrm->base.base.fd);
    if (!ret)
       return -1;
+#endif /* HAVE_PIPE_LOADER_DRM */
 
    gdrm->screen = pipe_loader_create_screen(dev, get_library_search_path());
    if (gdrm->screen == NULL) {