diff options
-rw-r--r-- | bsd-core/drmP.h | 1 | ||||
-rw-r--r-- | bsd-core/drm_scatter.c | 3 | ||||
-rw-r--r-- | shared-core/i915_dma.c | 14 | ||||
-rw-r--r-- | shared-core/i915_drv.h | 14 |
4 files changed, 21 insertions, 11 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 6e05b58f..b2ecd4d4 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -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 */ diff --git a/bsd-core/drm_scatter.c b/bsd-core/drm_scatter.c index 46222f18..99eae408 100644 --- a/bsd-core/drm_scatter.c +++ b/bsd-core/drm_scatter.c @@ -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; diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index dbc5f959..535a061a 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -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; diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h index e0432996..60b32b0d 100644 --- a/shared-core/i915_drv.h +++ b/shared-core/i915_drv.h @@ -39,6 +39,11 @@ #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. @@ -52,13 +57,12 @@ * 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; |