summaryrefslogtreecommitdiff
path: root/bsd
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2004-08-17 12:04:58 +0000
committerDave Airlie <airlied@linux.ie>2004-08-17 12:04:58 +0000
commit15026ddc3cbb831343a53fc33f4d4cbeea3e4f98 (patch)
tree340f67a5bc3d400c0ef0a1ee00f162c54c638331 /bsd
parent05c724faee6dbff27a6a573adc77bd22015444b4 (diff)
merge trunk to branchdrmfntbl-0-0-1-170804
Diffstat (limited to 'bsd')
-rw-r--r--bsd/drm_context.h1
-rw-r--r--bsd/drm_drv.h6
-rw-r--r--bsd/drm_memory.h4
-rw-r--r--bsd/drm_os_freebsd.h12
-rw-r--r--bsd/i915_drv.c6
5 files changed, 13 insertions, 16 deletions
diff --git a/bsd/drm_context.h b/bsd/drm_context.h
index 8988ee22..aa655297 100644
--- a/bsd/drm_context.h
+++ b/bsd/drm_context.h
@@ -341,6 +341,7 @@ int DRM(rmctx)( DRM_IOCTL_ARGS )
if ( ctx.handle != DRM_KERNEL_CONTEXT ) {
if (dev->fn_tbl.context_dtor)
dev->fn_tbl.context_dtor(dev, ctx.handle);
+
DRM(ctxbitmap_free)( dev, ctx.handle );
}
diff --git a/bsd/drm_drv.h b/bsd/drm_drv.h
index 4474f250..865bcde6 100644
--- a/bsd/drm_drv.h
+++ b/bsd/drm_drv.h
@@ -256,8 +256,12 @@ static device_method_t DRM(methods)[] = {
{ 0, 0 }
};
+#ifndef DRM_DEV_NAME
+#define DRM_DEV_NAME "drm"
+#endif
+
static driver_t DRM(driver) = {
- "drm",
+ DRM_DEV_NAME,
DRM(methods),
sizeof(drm_device_t),
};
diff --git a/bsd/drm_memory.h b/bsd/drm_memory.h
index c871274e..26adb085 100644
--- a/bsd/drm_memory.h
+++ b/bsd/drm_memory.h
@@ -138,7 +138,7 @@ DRM(mtrr_add)(unsigned long offset, size_t size, int flags)
mrdesc.mr_len = size;
mrdesc.mr_flags = flags;
act = MEMRANGE_SET_UPDATE;
- bcopy(DRIVER_NAME, &mrdesc.mr_owner, strlen(DRIVER_NAME));
+ strlcpy(mrdesc.mr_owner, DRIVER_NAME, sizeof(mrdesc.mr_owner));
return mem_range_attr_set(&mrdesc, &act);
}
@@ -152,7 +152,7 @@ DRM(mtrr_del)(unsigned long offset, size_t size, int flags)
mrdesc.mr_len = size;
mrdesc.mr_flags = flags;
act = MEMRANGE_SET_REMOVE;
- bcopy(DRIVER_NAME, &mrdesc.mr_owner, strlen(DRIVER_NAME));
+ strlcpy(mrdesc.mr_owner, DRIVER_NAME, sizeof(mrdesc.mr_owner));
return mem_range_attr_set(&mrdesc, &act);
}
#elif defined(__NetBSD__)
diff --git a/bsd/drm_os_freebsd.h b/bsd/drm_os_freebsd.h
index 7d750dba..dd95d9cb 100644
--- a/bsd/drm_os_freebsd.h
+++ b/bsd/drm_os_freebsd.h
@@ -84,6 +84,8 @@
#ifdef __i386__
#define __REALLY_HAVE_MTRR (__HAVE_MTRR) && (__FreeBSD_version >= 460000)
+#elif defined(__amd64__)
+#define __REALLY_HAVE_MTRR (__HAVE_MTRR)
#else
#define __REALLY_HAVE_MTRR 0
#endif
@@ -204,15 +206,7 @@ do { \
} \
} while (0)
-#define DRM_UDELAY( udelay ) \
-do { \
- struct timeval tv1, tv2; \
- microtime(&tv1); \
- do { \
- microtime(&tv2); \
- } \
- while (((tv2.tv_sec-tv1.tv_sec)*1000000 + tv2.tv_usec - tv1.tv_usec) < udelay ); \
-} while (0)
+#define DRM_UDELAY(udelay) DELAY(udelay)
#define DRM_GETSAREA() \
do { \
diff --git a/bsd/i915_drv.c b/bsd/i915_drv.c
index 5fbbfb2b..15ef406c 100644
--- a/bsd/i915_drv.c
+++ b/bsd/i915_drv.c
@@ -28,14 +28,13 @@
*
*/
+#define DRM_DEV_NAME "drmsub"
+
#include "i915.h"
#include "drmP.h"
#include "drm.h"
#include "i915_drm.h"
#include "i915_drv.h"
-#if __REALLY_HAVE_SG
-#include "ati_pcigart.h"
-#endif
#include "drm_agpsupport.h"
#include "drm_auth.h"
@@ -52,7 +51,6 @@
#include "drm_pci.h"
#include "drm_vm.h"
#include "drm_sysctl.h"
-#include "drm_scatter.h"
#ifdef __FreeBSD__
DRIVER_MODULE(DRIVER_NAME, agp, DRM(driver), DRM(devclass), 0, 0);