diff options
author | Eric Anholt <anholt@freebsd.org> | 2002-05-29 09:04:53 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2002-05-29 09:04:53 +0000 |
commit | e19e0e4148f3574ab8a58a06d39a5d5239f46833 (patch) | |
tree | 96e33108fc888e8947632a451802c8112c6d81f1 | |
parent | 2ea4becd8bed28d75569e6588bd0e2851c7aa771 (diff) |
Use a single options header, opt_drm.h, which controls debug code and linux
emulation enabling. Add options to makefiles to turn these on/off.
-rw-r--r-- | bsd-core/drm_os_freebsd.h | 7 | ||||
-rw-r--r-- | bsd-core/mga/Makefile | 19 | ||||
-rw-r--r-- | bsd-core/mga_drv.c | 1 | ||||
-rw-r--r-- | bsd-core/r128/Makefile | 19 | ||||
-rw-r--r-- | bsd-core/r128_drv.c | 1 | ||||
-rw-r--r-- | bsd-core/radeon/Makefile | 19 | ||||
-rw-r--r-- | bsd-core/radeon_drv.c | 1 | ||||
-rw-r--r-- | bsd-core/tdfx/Makefile | 21 | ||||
-rw-r--r-- | bsd-core/tdfx_drv.c | 1 | ||||
-rw-r--r-- | bsd/drm_os_freebsd.h | 7 | ||||
-rw-r--r-- | bsd/gamma/Makefile | 19 | ||||
-rw-r--r-- | bsd/gamma_drv.c | 1 | ||||
-rw-r--r-- | bsd/i810_drv.c | 1 | ||||
-rw-r--r-- | bsd/mga/Makefile | 19 | ||||
-rw-r--r-- | bsd/mga_drv.c | 1 | ||||
-rw-r--r-- | bsd/r128/Makefile | 19 | ||||
-rw-r--r-- | bsd/r128_drv.c | 1 | ||||
-rw-r--r-- | bsd/radeon/Makefile | 19 | ||||
-rw-r--r-- | bsd/radeon_drv.c | 1 | ||||
-rw-r--r-- | bsd/tdfx/Makefile | 21 | ||||
-rw-r--r-- | bsd/tdfx_drv.c | 1 |
21 files changed, 115 insertions, 84 deletions
diff --git a/bsd-core/drm_os_freebsd.h b/bsd-core/drm_os_freebsd.h index 253d91e8..ee871cf6 100644 --- a/bsd-core/drm_os_freebsd.h +++ b/bsd-core/drm_os_freebsd.h @@ -38,6 +38,13 @@ #include <pci/agpvar.h> #endif +#include <opt_drm.h> +#if DRM_DEBUG +#undef DRM_DEBUG_CODE +#define DRM_DEBUG_CODE 2 +#endif +#undef DRM_DEBUG + #define DRM_TIME_SLICE (hz/20) /* Time slice for GLXContexts */ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) diff --git a/bsd-core/mga/Makefile b/bsd-core/mga/Makefile index c1779fc6..82c7a382 100644 --- a/bsd-core/mga/Makefile +++ b/bsd-core/mga/Makefile @@ -4,7 +4,7 @@ KMOD= mga NOMAN= YES SRCS= mga_drv.c mga_state.c mga_warp.c mga_dma.c -SRCS+= device_if.h bus_if.h pci_if.h opt_drm_linux.h +SRCS+= device_if.h bus_if.h pci_if.h opt_drm.h CFLAGS+= ${DEBUG_FLAGS} -I. -I.. @: @@ -13,14 +13,17 @@ CFLAGS+= ${DEBUG_FLAGS} -I. -I.. machine: ln -sf /sys/i386/include machine -.if ${MACHINE_ARCH} == "i386" -# This line enables linux ioctl handling -# If you want support for this uncomment this line -#MGA_OPTS= "\#define DRM_LINUX" 1 +.if defined(DRM_DEBUG) +DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -opt_drm_linux.h: - touch opt_drm_linux.h - echo $(MGA_OPTS) >> opt_drm_linux.h +.if !defined(DRM_NOLINUX) +DRM_LINUX_OPT= "\#define DRM_LINUX 1" +.endif + +opt_drm.h: + touch opt_drm.h + echo $(DRM_DEBUG_OPT) >> opt_drm.h + echo $(DRM_LINUX_OPT) >> opt_drm.h .include <bsd.kmod.mk> diff --git a/bsd-core/mga_drv.c b/bsd-core/mga_drv.c index d8af2236..692f7c2b 100644 --- a/bsd-core/mga_drv.c +++ b/bsd-core/mga_drv.c @@ -33,7 +33,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "mga.h" #include "drmP.h" diff --git a/bsd-core/r128/Makefile b/bsd-core/r128/Makefile index 60197bf7..99b728bc 100644 --- a/bsd-core/r128/Makefile +++ b/bsd-core/r128/Makefile @@ -4,7 +4,7 @@ KMOD = r128 NOMAN= YES SRCS = r128_cce.c r128_drv.c r128_state.c -SRCS += device_if.h bus_if.h pci_if.h opt_drm_linux.h +SRCS += device_if.h bus_if.h pci_if.h opt_drm.h CFLAGS += ${DEBUG_FLAGS} -I. -I.. @: @@ -13,14 +13,17 @@ CFLAGS += ${DEBUG_FLAGS} -I. -I.. machine: ln -sf /sys/i386/include machine -.if ${MACHINE_ARCH} == "i386" -# This line enables linux ioctl handling -# If you want support for this uncomment this line -#R128_OPTS= "\#define DRM_LINUX" 1 +.if defined(DRM_DEBUG) +DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -opt_drm_linux.h: - touch opt_drm_linux.h - echo $(R128_OPTS) >> opt_drm_linux.h +.if !defined(DRM_NOLINUX) +DRM_LINUX_OPT= "\#define DRM_LINUX 1" +.endif + +opt_drm.h: + touch opt_drm.h + echo $(DRM_DEBUG_OPT) >> opt_drm.h + echo $(DRM_LINUX_OPT) >> opt_drm.h .include <bsd.kmod.mk> diff --git a/bsd-core/r128_drv.c b/bsd-core/r128_drv.c index cf59aa0d..58313a2f 100644 --- a/bsd-core/r128_drv.c +++ b/bsd-core/r128_drv.c @@ -33,7 +33,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "r128.h" #include "drmP.h" diff --git a/bsd-core/radeon/Makefile b/bsd-core/radeon/Makefile index 1a0d89c2..844586a1 100644 --- a/bsd-core/radeon/Makefile +++ b/bsd-core/radeon/Makefile @@ -4,7 +4,7 @@ KMOD = radeon NOMAN= YES SRCS = radeon_cp.c radeon_drv.c radeon_state.c -SRCS += device_if.h bus_if.h pci_if.h opt_drm_linux.h +SRCS += device_if.h bus_if.h pci_if.h opt_drm.h CFLAGS += ${DEBUG_FLAGS} -I. -I.. @: @@ -13,14 +13,17 @@ CFLAGS += ${DEBUG_FLAGS} -I. -I.. machine: ln -sf /sys/i386/include machine -.if ${MACHINE_ARCH} == "i386" -# This line enables linux ioctl handling -# If you want support for this uncomment this line -#RADEON_OPTS= "\#define DRM_LINUX" 1 +.if defined(DRM_DEBUG) +DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -opt_drm_linux.h: - touch opt_drm_linux.h - echo $(RADEON_OPTS) >> opt_drm_linux.h +.if !defined(DRM_NOLINUX) +DRM_LINUX_OPT= "\#define DRM_LINUX 1" +.endif + +opt_drm.h: + touch opt_drm.h + echo $(DRM_DEBUG_OPT) >> opt_drm.h + echo $(DRM_LINUX_OPT) >> opt_drm.h .include <bsd.kmod.mk> diff --git a/bsd-core/radeon_drv.c b/bsd-core/radeon_drv.c index 009f90c1..32160ee8 100644 --- a/bsd-core/radeon_drv.c +++ b/bsd-core/radeon_drv.c @@ -32,7 +32,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "radeon.h" #include "drmP.h" diff --git a/bsd-core/tdfx/Makefile b/bsd-core/tdfx/Makefile index 8b1b9378..149e3112 100644 --- a/bsd-core/tdfx/Makefile +++ b/bsd-core/tdfx/Makefile @@ -1,10 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../ +.PATH: ${.CURDIR}/.. KMOD= tdfx NOMAN= YES SRCS= tdfx_drv.c -SRCS+= device_if.h bus_if.h pci_if.h opt_drm_linux.h +SRCS+= device_if.h bus_if.h pci_if.h opt_drm.h CFLAGS+= ${DEBUG_FLAGS} -I. -I.. @: @@ -13,14 +13,17 @@ CFLAGS+= ${DEBUG_FLAGS} -I. -I.. machine: ln -sf /sys/i386/include machine -.if ${MACHINE_ARCH} == "i386" -# This line enables linux ioctl handling -# If you want support for this uncomment this line -#TDFX_OPTS= "\#define DRM_LINUX" 1 +.if defined(DRM_DEBUG) +DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -opt_drm_linux.h: - touch opt_drm_linux.h - echo $(TDFX_OPTS) >> opt_drm_linux.h +.if !defined(DRM_NOLINUX) +DRM_LINUX_OPT= "\#define DRM_LINUX 1" +.endif + +opt_drm.h: + touch opt_drm.h + echo $(DRM_DEBUG_OPT) >> opt_drm.h + echo $(DRM_LINUX_OPT) >> opt_drm.h .include <bsd.kmod.mk> diff --git a/bsd-core/tdfx_drv.c b/bsd-core/tdfx_drv.c index 29d19558..64c332cf 100644 --- a/bsd-core/tdfx_drv.c +++ b/bsd-core/tdfx_drv.c @@ -34,7 +34,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "tdfx.h" #include "drmP.h" diff --git a/bsd/drm_os_freebsd.h b/bsd/drm_os_freebsd.h index 253d91e8..ee871cf6 100644 --- a/bsd/drm_os_freebsd.h +++ b/bsd/drm_os_freebsd.h @@ -38,6 +38,13 @@ #include <pci/agpvar.h> #endif +#include <opt_drm.h> +#if DRM_DEBUG +#undef DRM_DEBUG_CODE +#define DRM_DEBUG_CODE 2 +#endif +#undef DRM_DEBUG + #define DRM_TIME_SLICE (hz/20) /* Time slice for GLXContexts */ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) diff --git a/bsd/gamma/Makefile b/bsd/gamma/Makefile index 43756a90..6b99427a 100644 --- a/bsd/gamma/Makefile +++ b/bsd/gamma/Makefile @@ -4,7 +4,7 @@ KMOD = gamma NOMAN= YES SRCS = gamma_drv.c gamma_dma.c -SRCS += device_if.h bus_if.h pci_if.h opt_drm_linux.h +SRCS += device_if.h bus_if.h pci_if.h opt_drm.h CFLAGS += ${DEBUG_FLAGS} -I. -I.. @: @@ -13,14 +13,17 @@ CFLAGS += ${DEBUG_FLAGS} -I. -I.. machine: ln -sf /sys/i386/include machine -.if ${MACHINE_ARCH} == "i386" -# This line enables linux ioctl handling -# If you want support for this uncomment this line -#TDFX_OPTS= "\#define DRM_LINUX" 1 +.if defined(DRM_DEBUG) +DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -opt_drm_linux.h: - touch opt_drm_linux.h - echo $(TDFX_OPTS) >> opt_drm_linux.h +.if !defined(DRM_NOLINUX) +DRM_LINUX_OPT= "\#define DRM_LINUX 1" +.endif + +opt_drm.h: + touch opt_drm.h + echo $(DRM_DEBUG_OPT) >> opt_drm.h + echo $(DRM_LINUX_OPT) >> opt_drm.h .include <bsd.kmod.mk> diff --git a/bsd/gamma_drv.c b/bsd/gamma_drv.c index 50658bba..3891e373 100644 --- a/bsd/gamma_drv.c +++ b/bsd/gamma_drv.c @@ -32,7 +32,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "gamma.h" #include "drmP.h" #include "drm.h" diff --git a/bsd/i810_drv.c b/bsd/i810_drv.c index e76e3a8a..3d96cb48 100644 --- a/bsd/i810_drv.c +++ b/bsd/i810_drv.c @@ -34,7 +34,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "i810.h" #include "drmP.h" diff --git a/bsd/mga/Makefile b/bsd/mga/Makefile index c1779fc6..82c7a382 100644 --- a/bsd/mga/Makefile +++ b/bsd/mga/Makefile @@ -4,7 +4,7 @@ KMOD= mga NOMAN= YES SRCS= mga_drv.c mga_state.c mga_warp.c mga_dma.c -SRCS+= device_if.h bus_if.h pci_if.h opt_drm_linux.h +SRCS+= device_if.h bus_if.h pci_if.h opt_drm.h CFLAGS+= ${DEBUG_FLAGS} -I. -I.. @: @@ -13,14 +13,17 @@ CFLAGS+= ${DEBUG_FLAGS} -I. -I.. machine: ln -sf /sys/i386/include machine -.if ${MACHINE_ARCH} == "i386" -# This line enables linux ioctl handling -# If you want support for this uncomment this line -#MGA_OPTS= "\#define DRM_LINUX" 1 +.if defined(DRM_DEBUG) +DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -opt_drm_linux.h: - touch opt_drm_linux.h - echo $(MGA_OPTS) >> opt_drm_linux.h +.if !defined(DRM_NOLINUX) +DRM_LINUX_OPT= "\#define DRM_LINUX 1" +.endif + +opt_drm.h: + touch opt_drm.h + echo $(DRM_DEBUG_OPT) >> opt_drm.h + echo $(DRM_LINUX_OPT) >> opt_drm.h .include <bsd.kmod.mk> diff --git a/bsd/mga_drv.c b/bsd/mga_drv.c index d8af2236..692f7c2b 100644 --- a/bsd/mga_drv.c +++ b/bsd/mga_drv.c @@ -33,7 +33,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "mga.h" #include "drmP.h" diff --git a/bsd/r128/Makefile b/bsd/r128/Makefile index 60197bf7..99b728bc 100644 --- a/bsd/r128/Makefile +++ b/bsd/r128/Makefile @@ -4,7 +4,7 @@ KMOD = r128 NOMAN= YES SRCS = r128_cce.c r128_drv.c r128_state.c -SRCS += device_if.h bus_if.h pci_if.h opt_drm_linux.h +SRCS += device_if.h bus_if.h pci_if.h opt_drm.h CFLAGS += ${DEBUG_FLAGS} -I. -I.. @: @@ -13,14 +13,17 @@ CFLAGS += ${DEBUG_FLAGS} -I. -I.. machine: ln -sf /sys/i386/include machine -.if ${MACHINE_ARCH} == "i386" -# This line enables linux ioctl handling -# If you want support for this uncomment this line -#R128_OPTS= "\#define DRM_LINUX" 1 +.if defined(DRM_DEBUG) +DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -opt_drm_linux.h: - touch opt_drm_linux.h - echo $(R128_OPTS) >> opt_drm_linux.h +.if !defined(DRM_NOLINUX) +DRM_LINUX_OPT= "\#define DRM_LINUX 1" +.endif + +opt_drm.h: + touch opt_drm.h + echo $(DRM_DEBUG_OPT) >> opt_drm.h + echo $(DRM_LINUX_OPT) >> opt_drm.h .include <bsd.kmod.mk> diff --git a/bsd/r128_drv.c b/bsd/r128_drv.c index cf59aa0d..58313a2f 100644 --- a/bsd/r128_drv.c +++ b/bsd/r128_drv.c @@ -33,7 +33,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "r128.h" #include "drmP.h" diff --git a/bsd/radeon/Makefile b/bsd/radeon/Makefile index 1a0d89c2..844586a1 100644 --- a/bsd/radeon/Makefile +++ b/bsd/radeon/Makefile @@ -4,7 +4,7 @@ KMOD = radeon NOMAN= YES SRCS = radeon_cp.c radeon_drv.c radeon_state.c -SRCS += device_if.h bus_if.h pci_if.h opt_drm_linux.h +SRCS += device_if.h bus_if.h pci_if.h opt_drm.h CFLAGS += ${DEBUG_FLAGS} -I. -I.. @: @@ -13,14 +13,17 @@ CFLAGS += ${DEBUG_FLAGS} -I. -I.. machine: ln -sf /sys/i386/include machine -.if ${MACHINE_ARCH} == "i386" -# This line enables linux ioctl handling -# If you want support for this uncomment this line -#RADEON_OPTS= "\#define DRM_LINUX" 1 +.if defined(DRM_DEBUG) +DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -opt_drm_linux.h: - touch opt_drm_linux.h - echo $(RADEON_OPTS) >> opt_drm_linux.h +.if !defined(DRM_NOLINUX) +DRM_LINUX_OPT= "\#define DRM_LINUX 1" +.endif + +opt_drm.h: + touch opt_drm.h + echo $(DRM_DEBUG_OPT) >> opt_drm.h + echo $(DRM_LINUX_OPT) >> opt_drm.h .include <bsd.kmod.mk> diff --git a/bsd/radeon_drv.c b/bsd/radeon_drv.c index 009f90c1..32160ee8 100644 --- a/bsd/radeon_drv.c +++ b/bsd/radeon_drv.c @@ -32,7 +32,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "radeon.h" #include "drmP.h" diff --git a/bsd/tdfx/Makefile b/bsd/tdfx/Makefile index 8b1b9378..149e3112 100644 --- a/bsd/tdfx/Makefile +++ b/bsd/tdfx/Makefile @@ -1,10 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../ +.PATH: ${.CURDIR}/.. KMOD= tdfx NOMAN= YES SRCS= tdfx_drv.c -SRCS+= device_if.h bus_if.h pci_if.h opt_drm_linux.h +SRCS+= device_if.h bus_if.h pci_if.h opt_drm.h CFLAGS+= ${DEBUG_FLAGS} -I. -I.. @: @@ -13,14 +13,17 @@ CFLAGS+= ${DEBUG_FLAGS} -I. -I.. machine: ln -sf /sys/i386/include machine -.if ${MACHINE_ARCH} == "i386" -# This line enables linux ioctl handling -# If you want support for this uncomment this line -#TDFX_OPTS= "\#define DRM_LINUX" 1 +.if defined(DRM_DEBUG) +DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -opt_drm_linux.h: - touch opt_drm_linux.h - echo $(TDFX_OPTS) >> opt_drm_linux.h +.if !defined(DRM_NOLINUX) +DRM_LINUX_OPT= "\#define DRM_LINUX 1" +.endif + +opt_drm.h: + touch opt_drm.h + echo $(DRM_DEBUG_OPT) >> opt_drm.h + echo $(DRM_LINUX_OPT) >> opt_drm.h .include <bsd.kmod.mk> diff --git a/bsd/tdfx_drv.c b/bsd/tdfx_drv.c index 29d19558..64c332cf 100644 --- a/bsd/tdfx_drv.c +++ b/bsd/tdfx_drv.c @@ -34,7 +34,6 @@ #include <sys/types.h> #include <sys/bus.h> #include <pci/pcivar.h> -#include <opt_drm_linux.h> #include "tdfx.h" #include "drmP.h" |