From 13cb41f666212ed50a7939a37a373b4431a84033 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Fri, 30 Sep 2016 11:26:13 +0200 Subject: [PATCH] radeon/video: don't use sub-allocated buffers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Cc: Christian König Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97976 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97969 Reviewed-by: Christian König --- src/gallium/drivers/radeon/r600_buffer_common.c | 3 +++ src/gallium/drivers/radeon/radeon_video.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c index cbbcc293e12..784522dd456 100644 --- a/src/gallium/drivers/radeon/r600_buffer_common.c +++ b/src/gallium/drivers/radeon/r600_buffer_common.c @@ -531,6 +531,9 @@ struct pipe_resource *r600_buffer_create(struct pipe_screen *screen, r600_init_resource_fields(rscreen, rbuffer, templ->width0, alignment); + if (templ->bind & PIPE_BIND_SHARED) + rbuffer->flags |= RADEON_FLAG_HANDLE; + if (!r600_alloc_resource(rscreen, rbuffer)) { FREE(rbuffer); return NULL; diff --git a/src/gallium/drivers/radeon/radeon_video.c b/src/gallium/drivers/radeon/radeon_video.c index d7c5a165ef3..de8e11cd8e2 100644 --- a/src/gallium/drivers/radeon/radeon_video.c +++ b/src/gallium/drivers/radeon/radeon_video.c @@ -66,8 +66,14 @@ bool rvid_create_buffer(struct pipe_screen *screen, struct rvid_buffer *buffer, { memset(buffer, 0, sizeof(*buffer)); buffer->usage = usage; + + /* Hardware buffer placement restrictions require the kernel to be + * able to move buffers around individually, so request a + * non-sub-allocated buffer. + */ buffer->res = (struct r600_resource *) - pipe_buffer_create(screen, PIPE_BIND_CUSTOM, usage, size); + pipe_buffer_create(screen, PIPE_BIND_CUSTOM | PIPE_BIND_SHARED, + usage, size); return buffer->res != NULL; } -- 2.30.2