summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2009-10-05 11:32:36 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-10-05 11:32:36 -0400
commitfa1956565e4f9ee9293d2fd7671b5947da335840 (patch)
tree67bb514bbd9deb9d7cb12db68a10e14667c7b238
parentb3237965c75d3f045547e409e71f8aebcaa95557 (diff)
r600: avoid assigning vb twicer6xx-r7xx-3d
There is no need to assign vb before you know that space is available. Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
-rw-r--r--shared-core/r600_blit.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/shared-core/r600_blit.c b/shared-core/r600_blit.c
index ae01e635..616baa99 100644
--- a/shared-core/r600_blit.c
+++ b/shared-core/r600_blit.c
@@ -1714,9 +1714,6 @@ r600_blit_copy(struct drm_device *dev,
u64 vb_addr;
u32 *vb;
- vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
- dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
-
if ((size_bytes & 3) || (src_gpu_addr & 3) || (dst_gpu_addr & 3)) {
max_bytes = 8192;
@@ -1752,9 +1749,9 @@ r600_blit_copy(struct drm_device *dev,
if (!dev_priv->blit_vb)
return;
set_shaders(dev);
- vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
- dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
}
+ vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
+ dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
vb[0] = i2f(dst_x);
vb[1] = 0;
@@ -1842,9 +1839,10 @@ r600_blit_copy(struct drm_device *dev,
if (!dev_priv->blit_vb)
return;
set_shaders(dev);
- vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
- dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
}
+ vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
+ dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
+
vb[0] = i2f(dst_x / 4);
vb[1] = 0;
@@ -1912,9 +1910,6 @@ r600_blit_swap(struct drm_device *dev,
u64 vb_addr;
u32 *vb;
- vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
- dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
-
if ((dev_priv->blit_vb->used + 48) > dev_priv->blit_vb->total) {
dev_priv->blit_vb->used = 0;
radeon_cp_discard_buffer(dev, dev_priv->blit_vb);
@@ -1922,9 +1917,9 @@ r600_blit_swap(struct drm_device *dev,
if (!dev_priv->blit_vb)
return;
set_shaders(dev);
- vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
- dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
}
+ vb = (u32 *) ((char *)dev->agp_buffer_map->handle +
+ dev_priv->blit_vb->offset + dev_priv->blit_vb->used);
if (cpp == 4) {
cb_format = COLOR_8_8_8_8;