aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/radeon_cp.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-07-10 05:27:04 -0400
committerDave Airlie <airlied@linux.ie>2005-07-10 05:27:04 -0400
commit836cf0465c422ee6d654060edd7c620d9cf0c09c (patch)
tree622ed9a2ca774818084ffdcfbf1622ef1735bb74 /drivers/char/drm/radeon_cp.c
parentd01cff408057fa925b2f766fa1fd5a305fd1acbf (diff)
drm: cleanup buffer/map code
This is a patch from DRM CVS that cleans up some code that was in CVS that I never moved to the kernel, this patch produces the result of the cleanups and puts it into the kernel drm. From: Eric Anholt <anholt@freebsd.org>, Jon Smirl, Dave Airlie Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/radeon_cp.c')
-rw-r--r--drivers/char/drm/radeon_cp.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index 20bcf872b348..8255cc6fdc28 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -2048,6 +2048,27 @@ int radeon_driver_preinit(struct drm_device *dev, unsigned long flags)
2048 return ret; 2048 return ret;
2049} 2049}
2050 2050
2051int radeon_presetup(struct drm_device *dev)
2052{
2053 int ret;
2054 drm_local_map_t *map;
2055 drm_radeon_private_t *dev_priv = dev->dev_private;
2056
2057 ret = drm_addmap(dev, drm_get_resource_start(dev, 2),
2058 drm_get_resource_len(dev, 2), _DRM_REGISTERS,
2059 _DRM_READ_ONLY, &dev_priv->mmio);
2060 if (ret != 0)
2061 return ret;
2062
2063 ret = drm_addmap(dev, drm_get_resource_start(dev, 0),
2064 drm_get_resource_len(dev, 0), _DRM_FRAME_BUFFER,
2065 _DRM_WRITE_COMBINING, &map);
2066 if (ret != 0)
2067 return ret;
2068
2069 return 0;
2070}
2071
2051int radeon_driver_postcleanup(struct drm_device *dev) 2072int radeon_driver_postcleanup(struct drm_device *dev)
2052{ 2073{
2053 drm_radeon_private_t *dev_priv = dev->dev_private; 2074 drm_radeon_private_t *dev_priv = dev->dev_private;