summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>2013-06-08 20:09:25 +0200
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>2013-06-08 20:11:33 +0200
commit26e047dec8dce96b7895feb8b77391c4a58a3895 (patch)
tree2795f6dee4863026388a9157bd889ea7f39c6838
parente9edbf0a688c68ef0896e5d4278f411f6b6f8398 (diff)
downloadexternal_mesa3d-26e047dec8dce96b7895feb8b77391c4a58a3895.zip
external_mesa3d-26e047dec8dce96b7895feb8b77391c4a58a3895.tar.gz
external_mesa3d-26e047dec8dce96b7895feb8b77391c4a58a3895.tar.bz2
nvc0: fix up video buffer alignment requirements
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
-rw-r--r--src/gallium/drivers/nvc0/nvc0_video.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_video.c b/src/gallium/drivers/nvc0/nvc0_video.c
index 3c50016..462637b 100644
--- a/src/gallium/drivers/nvc0/nvc0_video.c
+++ b/src/gallium/drivers/nvc0/nvc0_video.c
@@ -558,8 +558,6 @@ nvc0_video_buffer_create(struct pipe_context *pipe,
buffer = CALLOC_STRUCT(nvc0_video_buffer);
if (!buffer)
return NULL;
- assert(!(templat->height % 4));
- assert(!(templat->width % 2));
buffer->base.buffer_format = templat->buffer_format;
buffer->base.context = pipe;
@@ -578,7 +576,7 @@ nvc0_video_buffer_create(struct pipe_context *pipe,
templ.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
templ.format = PIPE_FORMAT_R8_UNORM;
templ.width0 = buffer->base.width;
- templ.height0 = buffer->base.height/2;
+ templ.height0 = (buffer->base.height + 1)/2;
templ.flags = NVC0_RESOURCE_FLAG_VIDEO;
templ.array_size = 2;
@@ -588,8 +586,8 @@ nvc0_video_buffer_create(struct pipe_context *pipe,
templ.format = PIPE_FORMAT_R8G8_UNORM;
buffer->num_planes = 2;
- templ.width0 /= 2;
- templ.height0 /= 2;
+ templ.width0 = (templ.width0 + 1) / 2;
+ templ.height0 = (templ.height0 + 1) / 2;
for (i = 1; i < buffer->num_planes; ++i) {
buffer->resources[i] = pipe->screen->resource_create(pipe->screen, &templ);
if (!buffer->resources[i])