summaryrefslogtreecommitdiff
path: root/drivers/char/drm/mga_dma.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-10-20 18:21:33 +1000
committerDave Airlie <airlied@linux.ie>2005-10-20 18:21:33 +1000
commit312f5726055534be1dc9dd369be13aabd2943fcb (patch)
tree29394a3f83b4952a73b36a4aa962dfeda839e9db /drivers/char/drm/mga_dma.c
parent3d5efad953c6d5ba11d5bcb584ef8e906f953a73 (diff)
parent93918e9afc76717176e9e114e79cdbb602a45ae8 (diff)
merge Linus head tree into my drm tree and fix up conflicts
Diffstat (limited to 'drivers/char/drm/mga_dma.c')
-rw-r--r--drivers/char/drm/mga_dma.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c
index cfbe35d5d862..70dc7f64b7b9 100644
--- a/drivers/char/drm/mga_dma.c
+++ b/drivers/char/drm/mga_dma.c
@@ -429,7 +429,7 @@ static int mga_do_agp_dma_bootstrap(drm_device_t * dev,
{
drm_mga_private_t *const dev_priv =
(drm_mga_private_t *) dev->dev_private;
- const unsigned int warp_size = mga_warp_microcode_size(dev_priv);
+ unsigned int warp_size = mga_warp_microcode_size(dev_priv);
int err;
unsigned offset;
const unsigned secondary_size = dma_bs->secondary_bin_count
@@ -487,6 +487,12 @@ static int mga_do_agp_dma_bootstrap(drm_device_t * dev,
return err;
}
+ /* Make drm_addbufs happy by not trying to create a mapping for less
+ * than a page.
+ */
+ if (warp_size < PAGE_SIZE)
+ warp_size = PAGE_SIZE;
+
offset = 0;
err = drm_addmap(dev, offset, warp_size,
_DRM_AGP, _DRM_READ_ONLY, &dev_priv->warp);
@@ -576,7 +582,7 @@ static int mga_do_pci_dma_bootstrap(drm_device_t * dev,
{
drm_mga_private_t *const dev_priv =
(drm_mga_private_t *) dev->dev_private;
- const unsigned int warp_size = mga_warp_microcode_size(dev_priv);
+ unsigned int warp_size = mga_warp_microcode_size(dev_priv);
unsigned int primary_size;
unsigned int bin_count;
int err;
@@ -587,6 +593,12 @@ static int mga_do_pci_dma_bootstrap(drm_device_t * dev,
return DRM_ERR(EFAULT);
}
+ /* Make drm_addbufs happy by not trying to create a mapping for less
+ * than a page.
+ */
+ if (warp_size < PAGE_SIZE)
+ warp_size = PAGE_SIZE;
+
/* The proper alignment is 0x100 for this mapping */
err = drm_addmap(dev, 0, warp_size, _DRM_CONSISTENT,
_DRM_READ_ONLY, &dev_priv->warp);
@@ -789,6 +801,10 @@ static int mga_do_init_dma(drm_device_t * dev, drm_mga_init_t * init)
}
if (!dev_priv->used_new_dma_init) {
+
+ dev_priv->dma_access = MGA_PAGPXFER;
+ dev_priv->wagp_enable = MGA_WAGP_ENABLE;
+
dev_priv->status = drm_core_findmap(dev, init->status_offset);
if (!dev_priv->status) {
DRM_ERROR("failed to find status page!\n");
@@ -904,7 +920,7 @@ static int mga_do_cleanup_dma(drm_device_t * dev)
drm_mga_private_t *dev_priv = dev->dev_private;
if ((dev_priv->warp != NULL)
- && (dev_priv->mmio->type != _DRM_CONSISTENT))
+ && (dev_priv->warp->type != _DRM_CONSISTENT))
drm_core_ioremapfree(dev_priv->warp, dev);
if ((dev_priv->primary != NULL)