[Mesa-dev] [PATCH 3/4] radeon/uvd: adjust the buffer offset when relocation is used

Nicolai Hähnle nhaehnle at gmail.com
Thu Sep 29 16:35:23 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97969
---
 src/gallium/drivers/radeon/radeon_uvd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c
index 3ae0eaa..9c376cb 100644
--- a/src/gallium/drivers/radeon/radeon_uvd.c
+++ b/src/gallium/drivers/radeon/radeon_uvd.c
@@ -116,20 +116,21 @@ static void send_cmd(struct ruvd_decoder *dec, unsigned cmd,
 	reloc_idx = dec->ws->cs_add_buffer(dec->cs, buf, usage | RADEON_USAGE_SYNCHRONIZED,
 					   domain,
 					  RADEON_PRIO_UVD);
 	if (!dec->use_legacy) {
 		uint64_t addr;
 		addr = dec->ws->buffer_get_virtual_address(buf);
 		addr = addr + off;
 		set_reg(dec, RUVD_GPCOM_VCPU_DATA0, addr);
 		set_reg(dec, RUVD_GPCOM_VCPU_DATA1, addr >> 32);
 	} else {
+		off += dec->ws->buffer_get_virtual_address(buf);
 		set_reg(dec, RUVD_GPCOM_VCPU_DATA0, off);
 		set_reg(dec, RUVD_GPCOM_VCPU_DATA1, reloc_idx * 4);
 	}
 	set_reg(dec, RUVD_GPCOM_VCPU_CMD, cmd << 1);
 }
 
 /* do the codec needs an IT buffer ?*/
 static bool have_it(struct ruvd_decoder *dec)
 {
 	return dec->stream_type == RUVD_CODEC_H264_PERF ||
-- 
2.7.4



More information about the mesa-dev mailing list