structures if AGP support is enabled in the kernel (__REALLY_HAVE_AGP).
This fixes the compile errors on kernels without AGP support.
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
-#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
-#include <linux/types.h>
-#include <linux/agp_backend.h>
-#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,41)
#define HAS_WORKQUEUE 0
#else
/** \name DRM template customization defaults */
/*@{*/
-#ifndef __HAVE_AGP
-#define __HAVE_AGP 0
-#endif
#ifndef __HAVE_MTRR
#define __HAVE_MTRR 0
#endif
#define __HAVE_DMA_FREELIST 0
#endif
-#define __REALLY_HAVE_AGP (__HAVE_AGP && (defined(CONFIG_AGP) || \
- defined(CONFIG_AGP_MODULE)))
#define __REALLY_HAVE_MTRR (__HAVE_MTRR && defined(CONFIG_MTRR))
#define __REALLY_HAVE_SG (__HAVE_SG)
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
-#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
-#include <linux/types.h>
-#include <linux/agp_backend.h>
-#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,41)
#define HAS_WORKQUEUE 0
#else
/** \name DRM template customization defaults */
/*@{*/
-#ifndef __HAVE_AGP
-#define __HAVE_AGP 0
-#endif
#ifndef __HAVE_MTRR
#define __HAVE_MTRR 0
#endif
#define __HAVE_DMA_FREELIST 0
#endif
-#define __REALLY_HAVE_AGP (__HAVE_AGP && (defined(CONFIG_AGP) || \
- defined(CONFIG_AGP_MODULE)))
#define __REALLY_HAVE_MTRR (__HAVE_MTRR && defined(CONFIG_MTRR))
#define __REALLY_HAVE_SG (__HAVE_SG)
#ifndef _DRM_AGP_H_
#define _DRM_AGP_H_
+#ifndef __HAVE_AGP
+#define __HAVE_AGP 0
+#endif
+
+#define __REALLY_HAVE_AGP (__HAVE_AGP && \
+ (defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)))
+
+#if __REALLY_HAVE_AGP
+
+
+#include <linux/types.h>
+#include <linux/agp_backend.h>
+
/**
* AGP memory entry. Stored as a doubly linked list.
/*@}*/
-#endif
+
+#endif /* __REALLY_HAVE_AGP */
+
+#endif /* !_DRM_AGP_H_ */