radeon/uvd: fix gpu_address for video surfaces
authorChristian König <christian.koenig@amd.com>
Mon, 11 Aug 2014 14:40:43 +0000 (16:40 +0200)
committerChristian König <christian.koenig@amd.com>
Tue, 12 Aug 2014 09:53:52 +0000 (11:53 +0200)
We need to get the new gpu_address as well when
reallocating the cs buffer.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82428

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
src/gallium/drivers/r600/r600_uvd.c
src/gallium/drivers/radeonsi/si_uvd.c

index f42384c12ee3b9f7dc2a11175502765b0c7feb1c..ee5288f384de8fe1bf7bdd7f1f942693982d4531 100644 (file)
@@ -121,6 +121,8 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
                /* recreate the CS handle */
                resources[i]->resource.cs_buf = ctx->b.ws->buffer_get_cs_handle(
                        resources[i]->resource.buf);
+               resources[i]->resource.gpu_address = ctx->b.ws->buffer_get_virtual_address(
+                       resources[i]->resource.cs_buf);
        }
 
        template.height *= array_size;
index 9f25cd6b09a273e27c785c408595b5f7eeb5878b..0ba3b125351a8c073603bc43498288d6dbf2a50c 100644 (file)
@@ -106,6 +106,8 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
                /* recreate the CS handle */
                resources[i]->resource.cs_buf = ctx->b.ws->buffer_get_cs_handle(
                        resources[i]->resource.buf);
+               resources[i]->resource.gpu_address = ctx->b.ws->buffer_get_virtual_address(
+                       resources[i]->resource.cs_buf);
        }
 
        template.height *= array_size;