diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2007-07-12 09:02:31 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2007-07-12 09:02:31 +0000 |
| commit | 73f37bf31a947d54e7ea8bde2ae3398f62b42a96 (patch) | |
| tree | af2d1208cfe28255e701a73c2dee80220bbe419d /sys/dev/drm | |
| parent | cddce0cb903815f7309dff5c86d21f663132794d (diff) | |
Notes
Diffstat (limited to 'sys/dev/drm')
| -rw-r--r-- | sys/dev/drm/i915_dma.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/drm/i915_dma.c b/sys/dev/drm/i915_dma.c index 3bd1c3151d9a..3e72769fbf2b 100644 --- a/sys/dev/drm/i915_dma.c +++ b/sys/dev/drm/i915_dma.c @@ -122,7 +122,22 @@ static int i915_initialize(drm_device_t * dev, drm_i915_private_t * dev_priv, drm_i915_init_t * init) { + drm_dma_handle_t *dmah; + + DRM_UNLOCK(); + dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, + 0xffffffff); + if (!dmah) { + dev->dev_private = (void *)dev_priv; + i915_dma_cleanup(dev); + DRM_ERROR("Can not allocate hardware status page\n"); + DRM_LOCK(); + return DRM_ERR(ENOMEM); + } + DRM_LOCK(); + memset(dev_priv, 0, sizeof(drm_i915_private_t)); + dev_priv->status_page_dmah = dmah; DRM_GETSAREA(); if (!dev_priv->sarea) { @@ -181,15 +196,6 @@ static int i915_initialize(drm_device_t * dev, dev_priv->allow_batchbuffer = 1; /* Program Hardware Status Page */ - dev_priv->status_page_dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, - 0xffffffff); - - if (!dev_priv->status_page_dmah) { - dev->dev_private = (void *)dev_priv; - i915_dma_cleanup(dev); - DRM_ERROR("Can not allocate hardware status page\n"); - return DRM_ERR(ENOMEM); - } dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr; dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; |
