drm/i915: set the bo up at firstopen time not after DMA init
authorDave Airlie <airlied@linux.ie>
Tue, 27 Mar 2007 08:01:31 +0000 (18:01 +1000)
committerDave Airlie <airlied@linux.ie>
Tue, 27 Mar 2007 08:01:31 +0000 (18:01 +1000)
This is required to use TTM to allocate the ring buffer.

linux-core/i915_drv.c
shared-core/i915_dma.c
shared-core/i915_drv.h

index 56e5998..7fdb083 100644 (file)
@@ -79,6 +79,7 @@ static struct drm_driver driver = {
            DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL |
            DRIVER_IRQ_VBL2,
        .load = i915_driver_load,
+       .firstopen = i915_driver_firstopen,
        .lastclose = i915_driver_lastclose,
        .preclose = i915_driver_preclose,
        .device_is_agp = i915_driver_device_is_agp,
index c8b7e58..9053f54 100644 (file)
@@ -195,9 +195,6 @@ static int i915_initialize(drm_device_t * dev,
        I915_WRITE(0x02080, dev_priv->dma_status_page);
        DRM_DEBUG("Enabled hardware status page\n");
        dev->dev_private = (void *)dev_priv;
-#ifdef I915_HAVE_BUFFER
-       drm_bo_driver_init(dev);
-#endif
        return 0;
 }
 
@@ -949,3 +946,11 @@ int i915_driver_device_is_agp(drm_device_t * dev)
 {
        return 1;
 }
+
+int i915_driver_firstopen(struct drm_device *dev)
+{
+#ifdef I915_HAVE_BUFFER
+       drm_bo_driver_init(dev);
+#endif
+       return 0;
+}
index 662ffad..e8a7be2 100644 (file)
@@ -153,7 +153,7 @@ extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
 extern void i915_emit_breadcrumb(drm_device_t *dev);
 extern void i915_dispatch_flip(drm_device_t * dev, int pipes, int sync);
 extern int i915_emit_mi_flush(drm_device_t *dev, uint32_t flush);
-
+extern int i915_driver_firstopen(struct drm_device *dev);
 
 /* i915_irq.c */
 extern int i915_irq_emit(DRM_IOCTL_ARGS);