summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/r600_exa.c22
-rw-r--r--src/r600_textured_videofuncs.c5
-rw-r--r--src/r6xx_accel.c12
3 files changed, 16 insertions, 23 deletions
diff --git a/src/r600_exa.c b/src/r600_exa.c
index b6a1a15b..4d09d6e7 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -167,8 +167,6 @@ R600PrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
#endif
r600_cp_start(pScrn);
- if (!r600_vb_get(pScrn))
- RADEON_FALLBACK(("Can't get VB\n"));
/* Init */
#if defined(XF86DRM_MODE)
@@ -325,8 +323,6 @@ R600Solid(PixmapPtr pPix, int x1, int y1, int x2, int y2)
if (((accel_state->vb_index + 3) * 8) > accel_state->vb_total) {
R600DoneSolid(pPix);
r600_cp_start(pScrn);
- if (!r600_vb_get(pScrn))
- return;
}
vb = (pointer)((char*)accel_state->vb_ptr+accel_state->vb_index*8);
@@ -408,6 +404,7 @@ R600DoneSolid(PixmapPtr pPix)
accel_state->src_bo[0] = NULL;
accel_state->src_bo[1] = NULL;
accel_state->dst_bo = NULL;
+ accel_state->vb_bo = NULL;
}
static void
@@ -449,8 +446,6 @@ R600DoPrepareCopy(ScrnInfoPtr pScrn,
accel_state->dst_bo = dst_bo;
r600_cp_start(pScrn);
- if (!r600_vb_get(pScrn))
- return;
/* Init */
start_3d(pScrn, accel_state->ib);
@@ -681,8 +676,6 @@ R600AppendCopyVertex(ScrnInfoPtr pScrn,
if (((accel_state->vb_index + 3) * 16) > accel_state->vb_total) {
R600DoCopy(pScrn);
r600_cp_start(pScrn);
- if (!r600_vb_get(pScrn))
- return;
}
vb = (pointer)((char*)accel_state->vb_ptr+accel_state->vb_index*16);
@@ -1092,6 +1085,7 @@ R600DoneCopy(PixmapPtr pDst)
accel_state->src_bo[0] = NULL;
accel_state->src_bo[1] = NULL;
accel_state->dst_bo = NULL;
+ accel_state->vb_bo = NULL;
}
@@ -1627,8 +1621,6 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
CLEAR (ps_conf);
r600_cp_start(pScrn);
- if (!r600_vb_get(pScrn))
- RADEON_FALLBACK(("Can't get VB\n"));
/* Init */
start_3d(pScrn, accel_state->ib);
@@ -1818,8 +1810,6 @@ static void R600Composite(PixmapPtr pDst,
if (((accel_state->vb_index + 3) * 24) > accel_state->vb_total) {
R600DoneComposite(pDst);
r600_cp_start(pScrn);
- if (!r600_vb_get(pScrn))
- return;
}
vb = (pointer)((char*)accel_state->vb_ptr+accel_state->vb_index*24);
@@ -1858,8 +1848,6 @@ static void R600Composite(PixmapPtr pDst,
if (((accel_state->vb_index + 3) * 16) > accel_state->vb_total) {
R600DoneComposite(pDst);
r600_cp_start(pScrn);
- if (!r600_vb_get(pScrn))
- return;
}
vb = (pointer)((char*)accel_state->vb_ptr+accel_state->vb_index*16);
@@ -1954,6 +1942,7 @@ static void R600DoneComposite(PixmapPtr pDst)
accel_state->src_bo[0] = NULL;
accel_state->src_bo[1] = NULL;
accel_state->dst_bo = NULL;
+ accel_state->vb_bo = NULL;
}
Bool
@@ -2374,6 +2363,11 @@ R600DrawInit(ScreenPtr pScreen)
info->accel_state->XInited3D = FALSE;
info->accel_state->copy_area = NULL;
+ info->accel_state->src_bo[0] = NULL;
+ info->accel_state->src_bo[1] = NULL;
+ info->accel_state->dst_bo = NULL;
+ info->accel_state->copy_area_bo = NULL;
+ info->accel_state->vb_bo = NULL;
if (!R600AllocShaders(pScrn, pScreen))
return FALSE;
diff --git a/src/r600_textured_videofuncs.c b/src/r600_textured_videofuncs.c
index 9cbfea43..631a40cc 100644
--- a/src/r600_textured_videofuncs.c
+++ b/src/r600_textured_videofuncs.c
@@ -254,8 +254,6 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
#endif
r600_cp_start(pScrn);
- if (!r600_vb_get(pScrn))
- return;
/* Init */
start_3d(pScrn, accel_state->ib);
@@ -587,8 +585,7 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
if (((accel_state->vb_index + 3) * 16) > accel_state->vb_total) {
R600DoneTexturedVideo(pScrn);
- accel_state->ib = RADEONCPGetBuffer(pScrn);
- r600_vb_get(pScrn);
+ r600_cp_start(pScrn);
}
vb = (pointer)((char*)accel_state->vb_ptr+accel_state->vb_index*16);
diff --git a/src/r6xx_accel.c b/src/r6xx_accel.c
index 4aa46504..6e4c8eac 100644
--- a/src/r6xx_accel.c
+++ b/src/r6xx_accel.c
@@ -1188,7 +1188,7 @@ r600_cp_start(ScrnInfoPtr pScrn)
#if defined(XF86DRM_MODE)
if (info->cs) {
if (!r600_vb_get(pScrn))
- return FALSE;
+ return -1;
radeon_cs_space_reset_bos(info->cs);
radeon_cs_space_add_persistent_bo(info->cs, accel_state->shaders_bo,
RADEON_GEM_DOMAIN_VRAM, 0);
@@ -1198,10 +1198,12 @@ r600_cp_start(ScrnInfoPtr pScrn)
if (accel_state->src_bo[1])
radeon_cs_space_add_persistent_bo(info->cs, accel_state->src_bo[1],
RADEON_GEM_DOMAIN_VRAM, 0);
- radeon_cs_space_add_persistent_bo(info->cs, accel_state->dst_bo,
- RADEON_GEM_DOMAIN_VRAM, 0);
- radeon_cs_space_add_persistent_bo(info->cs, accel_state->vb_bo,
- RADEON_GEM_DOMAIN_GTT, 0);
+ if (accel_state->dst_bo)
+ radeon_cs_space_add_persistent_bo(info->cs, accel_state->dst_bo,
+ RADEON_GEM_DOMAIN_VRAM, 0);
+ if (accel_state->vb_bo)
+ radeon_cs_space_add_persistent_bo(info->cs, accel_state->vb_bo,
+ RADEON_GEM_DOMAIN_GTT, 0);
if (accel_state->copy_area_bo)
radeon_cs_space_add_persistent_bo(info->cs,
accel_state->copy_area_bo,