radeon/uvd: adjust the buffer offset when relocation is used
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 29 Sep 2016 14:50:10 +0000 (16:50 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 30 Sep 2016 10:38:52 +0000 (12:38 +0200)
We don't plan to use sub-allocated buffers with UVD, but just in case one
slips through, this increases the chances of things working out anyway.

Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeon/radeon_uvd.c

index 3ae0eaa6e44cb3314da57ecc60e5ad86aeae95ed..9c376cb278c4821f8e54d00364e1dad54aa02584 100644 (file)
@@ -123,6 +123,7 @@ static void send_cmd(struct ruvd_decoder *dec, unsigned cmd,
                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);
        }