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.
This commit is contained in:
Eric Anholt 2002-05-29 09:04:53 +00:00
parent 2ea4becd8b
commit e19e0e4148
21 changed files with 115 additions and 84 deletions

View file

@ -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)

View file

@ -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>

View file

@ -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"

View file

@ -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>

View file

@ -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"

View file

@ -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>

View file

@ -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"

View file

@ -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>

View file

@ -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"

View file

@ -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)

View file

@ -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>

View file

@ -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"

View file

@ -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"

View file

@ -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>

View file

@ -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"

View file

@ -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>

View file

@ -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"

View file

@ -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>

View file

@ -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"

View file

@ -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>

View file

@ -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"