diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-10-20 04:21:33 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-10-20 04:21:33 -0400 |
commit | 312f5726055534be1dc9dd369be13aabd2943fcb (patch) | |
tree | 29394a3f83b4952a73b36a4aa962dfeda839e9db /drivers/char/drm/mga_dma.c | |
parent | 3d5efad953c6d5ba11d5bcb584ef8e906f953a73 (diff) | |
parent | 93918e9afc76717176e9e114e79cdbb602a45ae8 (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.c | 22 |
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, | |||
429 | { | 429 | { |
430 | drm_mga_private_t *const dev_priv = | 430 | drm_mga_private_t *const dev_priv = |
431 | (drm_mga_private_t *) dev->dev_private; | 431 | (drm_mga_private_t *) dev->dev_private; |
432 | const unsigned int warp_size = mga_warp_microcode_size(dev_priv); | 432 | unsigned int warp_size = mga_warp_microcode_size(dev_priv); |
433 | int err; | 433 | int err; |
434 | unsigned offset; | 434 | unsigned offset; |
435 | const unsigned secondary_size = dma_bs->secondary_bin_count | 435 | const unsigned secondary_size = dma_bs->secondary_bin_count |
@@ -487,6 +487,12 @@ static int mga_do_agp_dma_bootstrap(drm_device_t * dev, | |||
487 | return err; | 487 | return err; |
488 | } | 488 | } |
489 | 489 | ||
490 | /* Make drm_addbufs happy by not trying to create a mapping for less | ||
491 | * than a page. | ||
492 | */ | ||
493 | if (warp_size < PAGE_SIZE) | ||
494 | warp_size = PAGE_SIZE; | ||
495 | |||
490 | offset = 0; | 496 | offset = 0; |
491 | err = drm_addmap(dev, offset, warp_size, | 497 | err = drm_addmap(dev, offset, warp_size, |
492 | _DRM_AGP, _DRM_READ_ONLY, &dev_priv->warp); | 498 | _DRM_AGP, _DRM_READ_ONLY, &dev_priv->warp); |
@@ -576,7 +582,7 @@ static int mga_do_pci_dma_bootstrap(drm_device_t * dev, | |||
576 | { | 582 | { |
577 | drm_mga_private_t *const dev_priv = | 583 | drm_mga_private_t *const dev_priv = |
578 | (drm_mga_private_t *) dev->dev_private; | 584 | (drm_mga_private_t *) dev->dev_private; |
579 | const unsigned int warp_size = mga_warp_microcode_size(dev_priv); | 585 | unsigned int warp_size = mga_warp_microcode_size(dev_priv); |
580 | unsigned int primary_size; | 586 | unsigned int primary_size; |
581 | unsigned int bin_count; | 587 | unsigned int bin_count; |
582 | int err; | 588 | int err; |
@@ -587,6 +593,12 @@ static int mga_do_pci_dma_bootstrap(drm_device_t * dev, | |||
587 | return DRM_ERR(EFAULT); | 593 | return DRM_ERR(EFAULT); |
588 | } | 594 | } |
589 | 595 | ||
596 | /* Make drm_addbufs happy by not trying to create a mapping for less | ||
597 | * than a page. | ||
598 | */ | ||
599 | if (warp_size < PAGE_SIZE) | ||
600 | warp_size = PAGE_SIZE; | ||
601 | |||
590 | /* The proper alignment is 0x100 for this mapping */ | 602 | /* The proper alignment is 0x100 for this mapping */ |
591 | err = drm_addmap(dev, 0, warp_size, _DRM_CONSISTENT, | 603 | err = drm_addmap(dev, 0, warp_size, _DRM_CONSISTENT, |
592 | _DRM_READ_ONLY, &dev_priv->warp); | 604 | _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) | |||
789 | } | 801 | } |
790 | 802 | ||
791 | if (!dev_priv->used_new_dma_init) { | 803 | if (!dev_priv->used_new_dma_init) { |
804 | |||
805 | dev_priv->dma_access = MGA_PAGPXFER; | ||
806 | dev_priv->wagp_enable = MGA_WAGP_ENABLE; | ||
807 | |||
792 | dev_priv->status = drm_core_findmap(dev, init->status_offset); | 808 | dev_priv->status = drm_core_findmap(dev, init->status_offset); |
793 | if (!dev_priv->status) { | 809 | if (!dev_priv->status) { |
794 | DRM_ERROR("failed to find status page!\n"); | 810 | DRM_ERROR("failed to find status page!\n"); |
@@ -904,7 +920,7 @@ static int mga_do_cleanup_dma(drm_device_t * dev) | |||
904 | drm_mga_private_t *dev_priv = dev->dev_private; | 920 | drm_mga_private_t *dev_priv = dev->dev_private; |
905 | 921 | ||
906 | if ((dev_priv->warp != NULL) | 922 | if ((dev_priv->warp != NULL) |
907 | && (dev_priv->mmio->type != _DRM_CONSISTENT)) | 923 | && (dev_priv->warp->type != _DRM_CONSISTENT)) |
908 | drm_core_ioremapfree(dev_priv->warp, dev); | 924 | drm_core_ioremapfree(dev_priv->warp, dev); |
909 | 925 | ||
910 | if ((dev_priv->primary != NULL) | 926 | if ((dev_priv->primary != NULL) |