[PATCH 3/7] g3dvl: Add resource flags to vl_video_buffer_create_ex
Maarten Lankhorst
m.b.lankhorst at gmail.com
Fri Jul 29 04:30:45 PDT 2011
Needed to make a linear texture for nouveau vpe acceleration
---
src/gallium/auxiliary/vl/vl_mpeg12_decoder.c | 8 ++++----
src/gallium/auxiliary/vl/vl_video_buffer.c | 5 +++--
src/gallium/auxiliary/vl/vl_video_buffer.h | 2 +-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index 61d947c..0aa02f7 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -97,7 +97,7 @@ init_zscan_buffer(struct vl_mpeg12_buffer *buffer)
dec->base.context,
dec->blocks_per_line * BLOCK_WIDTH * BLOCK_HEIGHT,
align(dec->num_blocks, dec->blocks_per_line) / dec->blocks_per_line,
- 1, PIPE_VIDEO_CHROMA_FORMAT_444, formats, PIPE_USAGE_STATIC
+ 1, PIPE_VIDEO_CHROMA_FORMAT_444, formats, PIPE_USAGE_STATIC, 0
);
if (!buffer->zscan_source)
@@ -737,7 +737,7 @@ init_idct(struct vl_mpeg12_decoder *dec, const struct format_config* format_conf
dec->idct_source = vl_video_buffer_create_ex
(
dec->base.context, dec->base.width / 4, dec->base.height, 1,
- dec->base.chroma_format, formats, PIPE_USAGE_STATIC
+ dec->base.chroma_format, formats, PIPE_USAGE_STATIC, 0
);
if (!dec->idct_source)
@@ -748,7 +748,7 @@ init_idct(struct vl_mpeg12_decoder *dec, const struct format_config* format_conf
(
dec->base.context, dec->base.width / nr_of_idct_render_targets,
dec->base.height / 4, nr_of_idct_render_targets,
- dec->base.chroma_format, formats, PIPE_USAGE_STATIC
+ dec->base.chroma_format, formats, PIPE_USAGE_STATIC, 0
);
if (!dec->mc_source)
@@ -794,7 +794,7 @@ init_mc_source_widthout_idct(struct vl_mpeg12_decoder *dec, const struct format_
dec->mc_source = vl_video_buffer_create_ex
(
dec->base.context, dec->base.width, dec->base.height, 1,
- dec->base.chroma_format, formats, PIPE_USAGE_STATIC
+ dec->base.chroma_format, formats, PIPE_USAGE_STATIC, 0
);
return dec->mc_source != NULL;
diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c
index 4d8b664..f4e2d75 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.c
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
@@ -253,7 +253,7 @@ vl_video_buffer_create(struct pipe_context *pipe,
result = vl_video_buffer_create_ex
(
pipe, buffer_width, buffer_height, 1,
- chroma_format, resource_formats, PIPE_USAGE_STATIC
+ chroma_format, resource_formats, PIPE_USAGE_STATIC, 0
);
if (result)
result->buffer_format = buffer_format;
@@ -266,7 +266,7 @@ vl_video_buffer_create_ex(struct pipe_context *pipe,
unsigned width, unsigned height, unsigned depth,
enum pipe_video_chroma_format chroma_format,
const enum pipe_format resource_formats[VL_MAX_PLANES],
- unsigned usage)
+ unsigned usage, unsigned resource_flags)
{
struct vl_video_buffer *buffer;
struct pipe_resource templ;
@@ -295,6 +295,7 @@ vl_video_buffer_create_ex(struct pipe_context *pipe,
templ.array_size = 1;
templ.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
templ.usage = usage;
+ templ.flags = resource_flags;
buffer->resources[0] = pipe->screen->resource_create(pipe->screen, &templ);
if (!buffer->resources[0])
diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.h b/src/gallium/auxiliary/vl/vl_video_buffer.h
index 291d15c..ec5a5b9 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.h
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.h
@@ -86,6 +86,6 @@ vl_video_buffer_create_ex(struct pipe_context *pipe,
unsigned width, unsigned height, unsigned depth,
enum pipe_video_chroma_format chroma_format,
const enum pipe_format resource_formats[VL_MAX_PLANES],
- unsigned usage);
+ unsigned usage, unsigned resource_flags);
#endif /* vl_ycbcr_buffer_h */
--
1.7.6
--------------090604040502020500060605--
More information about the mesa-dev
mailing list