Fix FreeBSD build.
authorEric Anholt <eric@anholt.net>
Mon, 16 Jul 2007 08:53:06 +0000 (01:53 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 16 Jul 2007 08:53:06 +0000 (01:53 -0700)
bsd-core/drmP.h
bsd-core/drm_scatter.c
shared-core/i915_dma.c
shared-core/i915_drv.h

index 6e05b58ff3322a30844ac2f417720bf0942232a8..b2ecd4d43ae7046a01b37b6bdd8569f98d8e68ac 100644 (file)
@@ -780,6 +780,7 @@ struct drm_device {
        int               last_context; /* Last current context            */
        int               vbl_queue;    /* vbl wait channel */
        atomic_t          vbl_received;
+       atomic_t          vbl_received2;
 
 #ifdef __FreeBSD__
        struct sigio      *buf_sigio;   /* Processes waiting for SIGIO     */
index 46222f18e2a6ee04c34d334b9dc0701ee88826d7..99eae4081ea211380cbb4525df71d0bbd47ae2c6 100644 (file)
@@ -44,6 +44,7 @@ int drm_sg_alloc(drm_device_t * dev, drm_scatter_gather_t * request)
 {
        drm_sg_mem_t *entry;
        unsigned long pages;
+       int i;
 
        if ( dev->sg )
                return EINVAL;
@@ -52,7 +53,7 @@ int drm_sg_alloc(drm_device_t * dev, drm_scatter_gather_t * request)
        if ( !entry )
                return ENOMEM;
 
-       pages = round_page(request.size) / PAGE_SIZE;
+       pages = round_page(request->size) / PAGE_SIZE;
        DRM_DEBUG( "sg size=%ld pages=%ld\n", request->size, pages );
 
        entry->pages = pages;
index dbc5f9597ef90f965b3f9cd5165e8d4942eeae9e..535a061a92b16633c38f177b4a73a145ec744864 100644 (file)
@@ -855,12 +855,14 @@ static int mmio_table_size = sizeof(mmio_table)/sizeof(drm_i915_mmio_entry_t);
 
 static int i915_mmio(DRM_IOCTL_ARGS)
 {
-       char buf[32];
+       uint32_t buf[8];
        DRM_DEVICE;
        drm_i915_private_t *dev_priv = dev->dev_private;
        drm_i915_mmio_entry_t *e;        
        drm_i915_mmio_t mmio;
        void __iomem *base;
+       int i;
+
        if (!dev_priv) {
                DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
                return DRM_ERR(EINVAL);
@@ -878,7 +880,8 @@ static int i915_mmio(DRM_IOCTL_ARGS)
                case I915_MMIO_READ:
                        if (!(e->flag & I915_MMIO_MAY_READ))
                                return DRM_ERR(EINVAL);
-                       memcpy_fromio(buf, base, e->size);
+                       for (i = 0; i < e->size / 4; i++)
+                               buf[i] = I915_READ(e->offset + i * 4);
                        if (DRM_COPY_TO_USER(mmio.data, buf, e->size)) {
                                DRM_ERROR("DRM_COPY_TO_USER failed\n");
                                return DRM_ERR(EFAULT);
@@ -892,7 +895,8 @@ static int i915_mmio(DRM_IOCTL_ARGS)
                                DRM_ERROR("DRM_COPY_TO_USER failed\n");
                                return DRM_ERR(EFAULT);
                        }
-                       memcpy_toio(base, buf, e->size);
+                       for (i = 0; i < e->size / 4; i++)
+                               I915_WRITE(e->offset + i * 4, buf[i]);
                        break;
        }
        return 0;
@@ -910,11 +914,11 @@ static int i915_set_status_page(DRM_IOCTL_ARGS)
        }
        DRM_COPY_FROM_USER_IOCTL(hws, (drm_i915_hws_addr_t __user *) data,
                        sizeof(hws));
-       printk(KERN_DEBUG "set status page addr 0x%08x\n", (u32)hws.addr);
+       DRM_DEBUG("set status page addr 0x%08x\n", (u32)hws.addr);
 
        dev_priv->status_gfx_addr = hws.addr & (0x1ffff<<12);
 
-       dev_priv->hws_map.offset = dev->agp->agp_info.aper_base + hws.addr;
+       dev_priv->hws_map.offset = dev->agp->base + hws.addr;
        dev_priv->hws_map.size = 4*1024;
        dev_priv->hws_map.type = 0;
        dev_priv->hws_map.flags = 0;
index e0432996d4192b072d78341695ba99918cb0f6cf..60b32b0dffbd2bee7e244e770abb34133b00307a 100644 (file)
 #define DRIVER_DESC            "Intel Graphics"
 #define DRIVER_DATE            "20070209"
 
+#if defined(__linux__)
+#define I915_HAVE_FENCE
+#define I915_HAVE_BUFFER
+#endif
+
 /* Interface history:
  *
  * 1.1: Original.
  * 1.9: Usable page flipping and triple buffering
  */
 #define DRIVER_MAJOR           1
+#if defined(I915_HAVE_FENCE) && defined(I915_HAVE_BUFFER)
 #define DRIVER_MINOR           9
-#define DRIVER_PATCHLEVEL      0
-
-#if defined(__linux__)
-#define I915_HAVE_FENCE
-#define I915_HAVE_BUFFER
+#else
+#define DRIVER_MINOR           6
 #endif
+#define DRIVER_PATCHLEVEL      0
 
 typedef struct _drm_i915_ring_buffer {
        int tail_mask;