aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2006-01-02 00:23:01 -0500
committerDave Airlie <airlied@linux.ie>2006-01-02 00:23:01 -0500
commit269dc51296f4e985741d2fd567e7be4e7a0a9f29 (patch)
tree88589ce8ddc51a48f691a2c078863682e645293b /drivers/char/drm
parent3528af1b189d0fbb4c7a3f121f46d9987b9af5b6 (diff)
drm: bring savage inline with latest CVS
apply some whitespace cleanup and add wrappers for MTRR for OS calls From: Eric Anholt <anholt@freebsd.org> + Dave Airlie <airlied@linux.ie> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/drmP.h15
-rw-r--r--drivers/char/drm/savage_bci.c29
2 files changed, 27 insertions, 17 deletions
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 295de65b7088..a3ad85e05bd3 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -750,6 +750,21 @@ static inline int drm_core_has_MTRR(struct drm_device *dev)
750{ 750{
751 return drm_core_check_feature(dev, DRIVER_USE_MTRR); 751 return drm_core_check_feature(dev, DRIVER_USE_MTRR);
752} 752}
753
754#define DRM_MTRR_WC MTRR_TYPE_WRCOMB
755
756static inline int drm_mtrr_add(unsigned long offset, unsigned long size,
757 unsigned int flags)
758{
759 return mtrr_add(offset, size, flags, 1);
760}
761
762static inline int drm_mtrr_del(int handle, unsigned long offset,
763 unsigned long size, unsigned int flags)
764{
765 return mtrr_del(handle, offset, size);
766}
767
753#else 768#else
754#define drm_core_has_MTRR(dev) (0) 769#define drm_core_has_MTRR(dev) (0)
755#endif 770#endif
diff --git a/drivers/char/drm/savage_bci.c b/drivers/char/drm/savage_bci.c
index 00658621b2f6..0d426deeefec 100644
--- a/drivers/char/drm/savage_bci.c
+++ b/drivers/char/drm/savage_bci.c
@@ -584,21 +584,18 @@ int savage_driver_firstopen(drm_device_t *dev)
584 dev_priv->mtrr[0].base = fb_base; 584 dev_priv->mtrr[0].base = fb_base;
585 dev_priv->mtrr[0].size = 0x01000000; 585 dev_priv->mtrr[0].size = 0x01000000;
586 dev_priv->mtrr[0].handle = 586 dev_priv->mtrr[0].handle =
587 mtrr_add(dev_priv->mtrr[0].base, 587 drm_mtrr_add(dev_priv->mtrr[0].base,
588 dev_priv->mtrr[0].size, MTRR_TYPE_WRCOMB, 588 dev_priv->mtrr[0].size, DRM_MTRR_WC);
589 1);
590 dev_priv->mtrr[1].base = fb_base + 0x02000000; 589 dev_priv->mtrr[1].base = fb_base + 0x02000000;
591 dev_priv->mtrr[1].size = 0x02000000; 590 dev_priv->mtrr[1].size = 0x02000000;
592 dev_priv->mtrr[1].handle = 591 dev_priv->mtrr[1].handle =
593 mtrr_add(dev_priv->mtrr[1].base, 592 drm_mtrr_add(dev_priv->mtrr[1].base,
594 dev_priv->mtrr[1].size, MTRR_TYPE_WRCOMB, 593 dev_priv->mtrr[1].size, DRM_MTRR_WC);
595 1);
596 dev_priv->mtrr[2].base = fb_base + 0x04000000; 594 dev_priv->mtrr[2].base = fb_base + 0x04000000;
597 dev_priv->mtrr[2].size = 0x04000000; 595 dev_priv->mtrr[2].size = 0x04000000;
598 dev_priv->mtrr[2].handle = 596 dev_priv->mtrr[2].handle =
599 mtrr_add(dev_priv->mtrr[2].base, 597 drm_mtrr_add(dev_priv->mtrr[2].base,
600 dev_priv->mtrr[2].size, MTRR_TYPE_WRCOMB, 598 dev_priv->mtrr[2].size, DRM_MTRR_WC);
601 1);
602 } else { 599 } else {
603 DRM_ERROR("strange pci_resource_len %08lx\n", 600 DRM_ERROR("strange pci_resource_len %08lx\n",
604 drm_get_resource_len(dev, 0)); 601 drm_get_resource_len(dev, 0));
@@ -618,9 +615,8 @@ int savage_driver_firstopen(drm_device_t *dev)
618 dev_priv->mtrr[0].base = fb_base; 615 dev_priv->mtrr[0].base = fb_base;
619 dev_priv->mtrr[0].size = 0x08000000; 616 dev_priv->mtrr[0].size = 0x08000000;
620 dev_priv->mtrr[0].handle = 617 dev_priv->mtrr[0].handle =
621 mtrr_add(dev_priv->mtrr[0].base, 618 drm_mtrr_add(dev_priv->mtrr[0].base,
622 dev_priv->mtrr[0].size, MTRR_TYPE_WRCOMB, 619 dev_priv->mtrr[0].size, DRM_MTRR_WC);
623 1);
624 } else { 620 } else {
625 DRM_ERROR("strange pci_resource_len %08lx\n", 621 DRM_ERROR("strange pci_resource_len %08lx\n",
626 drm_get_resource_len(dev, 1)); 622 drm_get_resource_len(dev, 1));
@@ -664,9 +660,9 @@ void savage_driver_lastclose(drm_device_t *dev)
664 660
665 for (i = 0; i < 3; ++i) 661 for (i = 0; i < 3; ++i)
666 if (dev_priv->mtrr[i].handle >= 0) 662 if (dev_priv->mtrr[i].handle >= 0)
667 mtrr_del(dev_priv->mtrr[i].handle, 663 drm_mtrr_del(dev_priv->mtrr[i].handle,
668 dev_priv->mtrr[i].base, 664 dev_priv->mtrr[i].base,
669 dev_priv->mtrr[i].size); 665 dev_priv->mtrr[i].size, DRM_MTRR_WC);
670} 666}
671 667
672int savage_driver_unload(drm_device_t *dev) 668int savage_driver_unload(drm_device_t *dev)
@@ -1008,8 +1004,7 @@ static int savage_bci_event_wait(DRM_IOCTL_ARGS)
1008 * DMA buffer management 1004 * DMA buffer management
1009 */ 1005 */
1010 1006
1011static int savage_bci_get_buffers(DRMFILE filp, drm_device_t * dev, 1007static int savage_bci_get_buffers(DRMFILE filp, drm_device_t *dev, drm_dma_t *d)
1012 drm_dma_t * d)
1013{ 1008{
1014 drm_buf_t *buf; 1009 drm_buf_t *buf;
1015 int i; 1010 int i;
@@ -1071,7 +1066,7 @@ int savage_bci_buffers(DRM_IOCTL_ARGS)
1071 return ret; 1066 return ret;
1072} 1067}
1073 1068
1074void savage_reclaim_buffers(drm_device_t * dev, DRMFILE filp) 1069void savage_reclaim_buffers(drm_device_t *dev, DRMFILE filp)
1075{ 1070{
1076 drm_device_dma_t *dma = dev->dma; 1071 drm_device_dma_t *dma = dev->dma;
1077 drm_savage_private_t *dev_priv = dev->dev_private; 1072 drm_savage_private_t *dev_priv = dev->dev_private;