[Mesa-dev] [PATCH v2 2/5] radeon/vce: adjust the buffer offset when relocation is used

Nicolai Hähnle nhaehnle at gmail.com
Fri Sep 30 09:52:39 UTC 2016


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

We don't plan to use sub-allocated buffers with VCE, but just in case one
slips through, this increases the chances of things working out anyway.
---
 src/gallium/drivers/radeon/radeon_vce.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/radeon/radeon_vce.c b/src/gallium/drivers/radeon/radeon_vce.c
index 10c5a78..30705c1 100644
--- a/src/gallium/drivers/radeon/radeon_vce.c
+++ b/src/gallium/drivers/radeon/radeon_vce.c
@@ -542,14 +542,15 @@ void rvce_add_buffer(struct rvce_encoder *enc, struct pb_buffer *buf,
 
 	reloc_idx = enc->ws->cs_add_buffer(enc->cs, buf, usage | RADEON_USAGE_SYNCHRONIZED,
 					   domain, RADEON_PRIO_VCE);
 	if (enc->use_vm) {
 		uint64_t addr;
 		addr = enc->ws->buffer_get_virtual_address(buf);
 		addr = addr + offset;
 		RVCE_CS(addr >> 32);
 		RVCE_CS(addr);
 	} else {
+		offset += enc->ws->buffer_get_virtual_address(buf);
 		RVCE_CS(reloc_idx * 4);
 		RVCE_CS(offset);
 	}
 }
-- 
2.7.4



More information about the mesa-dev mailing list