Move the linux AGP includes into drm_agp.h and only define the AGP data

structures if AGP support is enabled in the kernel (__REALLY_HAVE_AGP).
    This fixes the compile errors on kernels without AGP support.
main
Jose Fonseca 2003-06-14 15:18:49 +00:00
parent 0b01c70d59
commit fdf320a1b8
3 changed files with 17 additions and 19 deletions

View File

@ -66,10 +66,6 @@
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
#include <asm/mtrr.h> #include <asm/mtrr.h>
#endif #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) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,41)
#define HAS_WORKQUEUE 0 #define HAS_WORKQUEUE 0
#else #else
@ -90,9 +86,6 @@
/** \name DRM template customization defaults */ /** \name DRM template customization defaults */
/*@{*/ /*@{*/
#ifndef __HAVE_AGP
#define __HAVE_AGP 0
#endif
#ifndef __HAVE_MTRR #ifndef __HAVE_MTRR
#define __HAVE_MTRR 0 #define __HAVE_MTRR 0
#endif #endif
@ -112,8 +105,6 @@
#define __HAVE_DMA_FREELIST 0 #define __HAVE_DMA_FREELIST 0
#endif #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_MTRR (__HAVE_MTRR && defined(CONFIG_MTRR))
#define __REALLY_HAVE_SG (__HAVE_SG) #define __REALLY_HAVE_SG (__HAVE_SG)

View File

@ -66,10 +66,6 @@
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
#include <asm/mtrr.h> #include <asm/mtrr.h>
#endif #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) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,41)
#define HAS_WORKQUEUE 0 #define HAS_WORKQUEUE 0
#else #else
@ -90,9 +86,6 @@
/** \name DRM template customization defaults */ /** \name DRM template customization defaults */
/*@{*/ /*@{*/
#ifndef __HAVE_AGP
#define __HAVE_AGP 0
#endif
#ifndef __HAVE_MTRR #ifndef __HAVE_MTRR
#define __HAVE_MTRR 0 #define __HAVE_MTRR 0
#endif #endif
@ -112,8 +105,6 @@
#define __HAVE_DMA_FREELIST 0 #define __HAVE_DMA_FREELIST 0
#endif #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_MTRR (__HAVE_MTRR && defined(CONFIG_MTRR))
#define __REALLY_HAVE_SG (__HAVE_SG) #define __REALLY_HAVE_SG (__HAVE_SG)

View File

@ -34,6 +34,19 @@
#ifndef _DRM_AGP_H_ #ifndef _DRM_AGP_H_
#define _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. * AGP memory entry. Stored as a doubly linked list.
@ -92,4 +105,7 @@ extern void DRM(agp_cleanup_dev)(drm_device_t *dev);
/*@}*/ /*@}*/
#endif
#endif /* __REALLY_HAVE_AGP */
#endif /* !_DRM_AGP_H_ */