[Mesa-dev] [PATCH 1/7] radeon/vce: remove RVCE_NUM_CPB_EXTRA_FRAMES

Christian König deathsimple at vodafone.de
Wed Apr 9 02:20:56 PDT 2014


From: Christian König <christian.koenig at amd.com>

Doesn't seems to be needed any more.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 src/gallium/drivers/radeon/radeon_vce.c        | 2 +-
 src/gallium/drivers/radeon/radeon_vce.h        | 1 -
 src/gallium/drivers/radeon/radeon_vce_40_2_2.c | 3 +--
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeon/radeon_vce.c b/src/gallium/drivers/radeon/radeon_vce.c
index 4b824f9..012b4f8 100644
--- a/src/gallium/drivers/radeon/radeon_vce.c
+++ b/src/gallium/drivers/radeon/radeon_vce.c
@@ -262,7 +262,7 @@ struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context,
 	vpitch = align(tmp_surf->npix_y, 16);
 	tmp_buf->destroy(tmp_buf);
 	if (!rvid_create_buffer(enc->ws, &enc->cpb,
-			pitch * vpitch * 1.5 * (RVCE_NUM_CPB_FRAMES + RVCE_NUM_CPB_EXTRA_FRAMES),
+			pitch * vpitch * 1.5 * RVCE_NUM_CPB_FRAMES,
 			RADEON_DOMAIN_VRAM)) {
 		RVID_ERR("Can't create CPB buffer.\n");
 		goto error;
diff --git a/src/gallium/drivers/radeon/radeon_vce.h b/src/gallium/drivers/radeon/radeon_vce.h
index 9dc0c68..3ea738b 100644
--- a/src/gallium/drivers/radeon/radeon_vce.h
+++ b/src/gallium/drivers/radeon/radeon_vce.h
@@ -44,7 +44,6 @@
 #define RVCE_END() *begin = (&enc->cs->buf[enc->cs->cdw] - begin) * 4; }
 
 #define RVCE_NUM_CPB_FRAMES 2
-#define RVCE_NUM_CPB_EXTRA_FRAMES 2
 
 struct r600_common_screen;
 
diff --git a/src/gallium/drivers/radeon/radeon_vce_40_2_2.c b/src/gallium/drivers/radeon/radeon_vce_40_2_2.c
index 26c3629..c41b2d0 100644
--- a/src/gallium/drivers/radeon/radeon_vce_40_2_2.c
+++ b/src/gallium/drivers/radeon/radeon_vce_40_2_2.c
@@ -224,9 +224,8 @@ static void frame_offset(struct rvce_encoder *enc, unsigned frame_num,
 	unsigned pitch = align(enc->luma->level[0].pitch_bytes, 128);
 	unsigned vpitch = align(enc->luma->npix_y, 16);
 	unsigned fsize = pitch * (vpitch + vpitch / 2);
-	unsigned base_offset = RVCE_NUM_CPB_EXTRA_FRAMES * fsize;
 
-	*luma_offset = base_offset + (frame_num % RVCE_NUM_CPB_FRAMES) * fsize;
+	*luma_offset = (frame_num % RVCE_NUM_CPB_FRAMES) * fsize;
 	*chroma_offset = *luma_offset + pitch * vpitch;
 }
 
-- 
1.8.3.2



More information about the mesa-dev mailing list