Skip to content

Commit

Permalink
radeon: set the address to access the GART table on the CPU side corr…
Browse files Browse the repository at this point in the history
…ectly

This code relied on the CPU and GPU address for the aperture being the same,
On some r5xx hardware I was playing with I noticed that this isn't always true.
This fixes issues seen on some r400 cards. (bugs.freedesktop.org 9957)

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Nov 5, 2007
1 parent 5da0c7a commit 7fc8686
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/char/drm/radeon_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ static int radeon_do_init_cp(struct drm_device * dev, drm_radeon_init_t * init)
dev_priv->gart_info.bus_addr =
dev_priv->pcigart_offset + dev_priv->fb_location;
dev_priv->gart_info.mapping.offset =
dev_priv->gart_info.bus_addr;
dev_priv->pcigart_offset + dev_priv->fb_aper_offset;
dev_priv->gart_info.mapping.size =
dev_priv->gart_info.table_size;

Expand Down Expand Up @@ -2275,7 +2275,8 @@ int radeon_driver_firstopen(struct drm_device *dev)
if (ret != 0)
return ret;

ret = drm_addmap(dev, drm_get_resource_start(dev, 0),
dev_priv->fb_aper_offset = drm_get_resource_start(dev, 0);
ret = drm_addmap(dev, dev_priv->fb_aper_offset,
drm_get_resource_len(dev, 0), _DRM_FRAME_BUFFER,
_DRM_WRITE_COMBINING, &map);
if (ret != 0)
Expand Down
1 change: 1 addition & 0 deletions drivers/char/drm/radeon_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ typedef struct drm_radeon_private {

/* starting from here on, data is preserved accross an open */
uint32_t flags; /* see radeon_chip_flags */
unsigned long fb_aper_offset;
} drm_radeon_private_t;

typedef struct drm_radeon_buf_priv {
Expand Down

0 comments on commit 7fc8686

Please sign in to comment.