From 30a00481cc274394d93defba2a3c62659ec20e5a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 17 May 2006 06:36:28 +0000 Subject: [PATCH] Update to current DRM CVS, bringing in a fix for a NULL pointer chase when running 3d apps on i915. --- sys/dev/drm/drm.h | 4 ++-- sys/dev/drm/i915_drv.c | 2 ++ sys/dev/drm/mga_drv.c | 4 ++-- sys/dev/drm/r300_cmdbuf.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/drm/drm.h b/sys/dev/drm/drm.h index 54e786f77fd2..d4dad8e0c410 100644 --- a/sys/dev/drm/drm.h +++ b/sys/dev/drm/drm.h @@ -82,8 +82,8 @@ __FBSDID("$FreeBSD$"); #define DRM_IOC_WRITE _IOC_WRITE #define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) -#if defined(__FreeBSD__) && defined(IN_MODULE) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(IN_MODULE) /* Prevent name collision when including sys/ioccom.h */ #undef ioctl #include diff --git a/sys/dev/drm/i915_drv.c b/sys/dev/drm/i915_drv.c index 138af374db8e..8a2033065685 100644 --- a/sys/dev/drm/i915_drv.c +++ b/sys/dev/drm/i915_drv.c @@ -50,6 +50,7 @@ static void i915_configure(drm_device_t *dev) dev->driver.preclose = i915_driver_preclose; dev->driver.lastclose = i915_driver_lastclose; dev->driver.device_is_agp = i915_driver_device_is_agp, + dev->driver.vblank_wait = i915_driver_vblank_wait; dev->driver.irq_preinstall = i915_driver_irq_preinstall; dev->driver.irq_postinstall = i915_driver_irq_postinstall; dev->driver.irq_uninstall = i915_driver_irq_uninstall; @@ -69,6 +70,7 @@ static void i915_configure(drm_device_t *dev) dev->driver.require_agp = 1; dev->driver.use_mtrr = 1; dev->driver.use_irq = 1; + dev->driver.use_vbl_irq = 1; } #ifdef __FreeBSD__ diff --git a/sys/dev/drm/mga_drv.c b/sys/dev/drm/mga_drv.c index 725004350e70..8bde4fde78f7 100644 --- a/sys/dev/drm/mga_drv.c +++ b/sys/dev/drm/mga_drv.c @@ -82,9 +82,9 @@ static int mga_driver_device_is_agp(drm_device_t * dev) if (pci_get_device(dev->device) == 0x0525 && pci_get_vendor(bus) == 0x3388 && pci_get_device(bus) == 0x0021) - return 0; + return DRM_IS_NOT_AGP; else - return 2; + return DRM_MIGHT_BE_AGP; } static void mga_configure(drm_device_t *dev) diff --git a/sys/dev/drm/r300_cmdbuf.c b/sys/dev/drm/r300_cmdbuf.c index d1e0bdb79905..d71f8cb486ae 100644 --- a/sys/dev/drm/r300_cmdbuf.c +++ b/sys/dev/drm/r300_cmdbuf.c @@ -725,7 +725,7 @@ static int r300_scratch(drm_radeon_private_t *dev_priv, dev_priv->scratch_ages[header.scratch.reg] ++; - ref_age_base = *(u32 **)cmdbuf->buf; + ref_age_base = (u32 *)(unsigned long)*((uint64_t *)cmdbuf->buf); cmdbuf->buf += sizeof(uint64_t); cmdbuf->bufsz -= sizeof(uint64_t);