summaryrefslogtreecommitdiff
path: root/src/radeon_dri2.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2012-07-13 11:15:25 +0200
committerMichel Dänzer <michel@daenzer.net>2012-07-13 11:15:25 +0200
commit6ef1ad6a46348d3aecd8d1f5e94431ca2298853c (patch)
treeec19a154ec7a0b5d8393d6b8556eb600b04a21be /src/radeon_dri2.c
parentef8a404391036d8aa814dbda2407c789b8a64b92 (diff)
Deal more gracefully with DRI2 being unavailable at build or run time.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src/radeon_dri2.c')
-rw-r--r--src/radeon_dri2.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index e16d5517..92241c7a 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -29,13 +29,16 @@
#include "config.h"
#endif
+#include "radeon.h"
+#include "radeon_dri2.h"
+
+#ifdef DRI2
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
-#include "radeon.h"
-#include "radeon_dri2.h"
#include "radeon_version.h"
#if HAVE_LIST_H
@@ -1398,6 +1401,9 @@ radeon_dri2_screen_init(ScreenPtr pScreen)
Bool scheduling_works = TRUE;
#endif
+ if (!info->dri2.available)
+ return FALSE;
+
info->dri2.device_name = drmGetDeviceNameFromFd(info->dri2.drm_fd);
if ( (info->ChipFamily >= CHIP_FAMILY_TAHITI) ) {
@@ -1502,3 +1508,5 @@ void radeon_dri2_close_screen(ScreenPtr pScreen)
drmFree(info->dri2.device_name);
}
+#endif /* DRI2 */
+