vl: use a template for create_video_decoder

Signed-off-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
Christian König 2013-07-15 01:50:24 -06:00
parent d13003f544
commit 53e20b8b41
21 changed files with 125 additions and 252 deletions

View file

@ -61,13 +61,10 @@ vl_level_supported(struct pipe_screen *screen, enum pipe_video_profile profile)
struct pipe_video_decoder * struct pipe_video_decoder *
vl_create_decoder(struct pipe_context *pipe, vl_create_decoder(struct pipe_context *pipe,
enum pipe_video_profile profile, const struct pipe_video_decoder *templat)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height, unsigned max_references,
bool expect_chunked_decode)
{ {
unsigned buffer_width, buffer_height; unsigned width = templat->width, height = templat->height;
struct pipe_video_decoder temp;
bool pot_buffers; bool pot_buffers;
assert(pipe); assert(pipe);
@ -76,18 +73,18 @@ vl_create_decoder(struct pipe_context *pipe,
pot_buffers = !pipe->screen->get_video_param pot_buffers = !pipe->screen->get_video_param
( (
pipe->screen, pipe->screen,
profile, templat->profile,
PIPE_VIDEO_CAP_NPOT_TEXTURES PIPE_VIDEO_CAP_NPOT_TEXTURES
); );
buffer_width = pot_buffers ? util_next_power_of_two(width) : align(width, VL_MACROBLOCK_WIDTH); temp = *templat;
buffer_height = pot_buffers ? util_next_power_of_two(height) : align(height, VL_MACROBLOCK_HEIGHT); temp.width = pot_buffers ? util_next_power_of_two(width) : align(width, VL_MACROBLOCK_WIDTH);
temp.height = pot_buffers ? util_next_power_of_two(height) : align(height, VL_MACROBLOCK_HEIGHT);
switch (u_reduce_video_profile(profile)) { switch (u_reduce_video_profile(temp.profile)) {
case PIPE_VIDEO_CODEC_MPEG12: case PIPE_VIDEO_CODEC_MPEG12:
return vl_create_mpeg12_decoder(pipe, profile, entrypoint, chroma_format, return vl_create_mpeg12_decoder(pipe, &temp);
buffer_width, buffer_height, max_references,
expect_chunked_decode);
default: default:
return NULL; return NULL;
} }

View file

@ -48,10 +48,6 @@ vl_level_supported(struct pipe_screen *screen, enum pipe_video_profile profile);
*/ */
struct pipe_video_decoder * struct pipe_video_decoder *
vl_create_decoder(struct pipe_context *pipe, vl_create_decoder(struct pipe_context *pipe,
enum pipe_video_profile profile, const struct pipe_video_decoder *templat);
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height, unsigned max_references,
bool expect_chunked_decode);
#endif /* vl_decoder_h */ #endif /* vl_decoder_h */

View file

@ -480,7 +480,7 @@ vl_mpeg12_get_decode_buffer(struct vl_mpeg12_decoder *dec, struct pipe_video_buf
if (dec->base.entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) if (dec->base.entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM)
vl_mpg12_bs_init(&buffer->bs, &dec->base); vl_mpg12_bs_init(&buffer->bs, &dec->base);
if (dec->expect_chunked_decode) if (dec->base.expect_chunked_decode)
vl_video_buffer_set_associated_data(target, &dec->base, vl_video_buffer_set_associated_data(target, &dec->base,
buffer, vl_mpeg12_destroy_buffer); buffer, vl_mpeg12_destroy_buffer);
else else
@ -1018,30 +1018,21 @@ mc_frag_shader_callback(void *priv, struct vl_mc *mc,
struct pipe_video_decoder * struct pipe_video_decoder *
vl_create_mpeg12_decoder(struct pipe_context *context, vl_create_mpeg12_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templat)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height, unsigned max_references,
bool expect_chunked_decode)
{ {
const unsigned block_size_pixels = VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT; const unsigned block_size_pixels = VL_BLOCK_WIDTH * VL_BLOCK_HEIGHT;
const struct format_config *format_config; const struct format_config *format_config;
struct vl_mpeg12_decoder *dec; struct vl_mpeg12_decoder *dec;
assert(u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG12); assert(u_reduce_video_profile(templat->profile) == PIPE_VIDEO_CODEC_MPEG12);
dec = CALLOC_STRUCT(vl_mpeg12_decoder); dec = CALLOC_STRUCT(vl_mpeg12_decoder);
if (!dec) if (!dec)
return NULL; return NULL;
dec->base = *templat;
dec->base.context = context; dec->base.context = context;
dec->base.profile = profile;
dec->base.entrypoint = entrypoint;
dec->base.chroma_format = chroma_format;
dec->base.width = width;
dec->base.height = height;
dec->base.max_references = max_references;
dec->base.destroy = vl_mpeg12_destroy; dec->base.destroy = vl_mpeg12_destroy;
dec->base.begin_frame = vl_mpeg12_begin_frame; dec->base.begin_frame = vl_mpeg12_begin_frame;
@ -1053,7 +1044,6 @@ vl_create_mpeg12_decoder(struct pipe_context *context,
dec->blocks_per_line = MAX2(util_next_power_of_two(dec->base.width) / block_size_pixels, 4); dec->blocks_per_line = MAX2(util_next_power_of_two(dec->base.width) / block_size_pixels, 4);
dec->num_blocks = (dec->base.width * dec->base.height) / block_size_pixels; dec->num_blocks = (dec->base.width * dec->base.height) / block_size_pixels;
dec->width_in_macroblocks = align(dec->base.width, VL_MACROBLOCK_WIDTH) / VL_MACROBLOCK_WIDTH; dec->width_in_macroblocks = align(dec->base.width, VL_MACROBLOCK_WIDTH) / VL_MACROBLOCK_WIDTH;
dec->expect_chunked_decode = expect_chunked_decode;
/* TODO: Implement 422, 444 */ /* TODO: Implement 422, 444 */
assert(dec->base.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420); assert(dec->base.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
@ -1082,7 +1072,7 @@ vl_create_mpeg12_decoder(struct pipe_context *context,
dec->ves_ycbcr = vl_vb_get_ves_ycbcr(dec->base.context); dec->ves_ycbcr = vl_vb_get_ves_ycbcr(dec->base.context);
dec->ves_mv = vl_vb_get_ves_mv(dec->base.context); dec->ves_mv = vl_vb_get_ves_mv(dec->base.context);
switch (entrypoint) { switch (templat->entrypoint) {
case PIPE_VIDEO_ENTRYPOINT_BITSTREAM: case PIPE_VIDEO_ENTRYPOINT_BITSTREAM:
format_config = find_format_config(dec, bitstream_format_config, num_bitstream_format_configs); format_config = find_format_config(dec, bitstream_format_config, num_bitstream_format_configs);
break; break;
@ -1109,7 +1099,7 @@ vl_create_mpeg12_decoder(struct pipe_context *context,
if (!init_zscan(dec, format_config)) if (!init_zscan(dec, format_config))
goto error_zscan; goto error_zscan;
if (entrypoint <= PIPE_VIDEO_ENTRYPOINT_IDCT) { if (templat->entrypoint <= PIPE_VIDEO_ENTRYPOINT_IDCT) {
if (!init_idct(dec, format_config)) if (!init_idct(dec, format_config))
goto error_sources; goto error_sources;
} else { } else {
@ -1140,7 +1130,7 @@ error_mc_c:
vl_mc_cleanup(&dec->mc_y); vl_mc_cleanup(&dec->mc_y);
error_mc_y: error_mc_y:
if (entrypoint <= PIPE_VIDEO_ENTRYPOINT_IDCT) { if (templat->entrypoint <= PIPE_VIDEO_ENTRYPOINT_IDCT) {
vl_idct_cleanup(&dec->idct_y); vl_idct_cleanup(&dec->idct_y);
vl_idct_cleanup(&dec->idct_c); vl_idct_cleanup(&dec->idct_c);
dec->idct_source->destroy(dec->idct_source); dec->idct_source->destroy(dec->idct_source);

View file

@ -50,7 +50,6 @@ struct vl_mpeg12_decoder
unsigned blocks_per_line; unsigned blocks_per_line;
unsigned num_blocks; unsigned num_blocks;
unsigned width_in_macroblocks; unsigned width_in_macroblocks;
bool expect_chunked_decode;
enum pipe_format zscan_source_format; enum pipe_format zscan_source_format;
@ -105,10 +104,6 @@ struct vl_mpeg12_buffer
*/ */
struct pipe_video_decoder * struct pipe_video_decoder *
vl_create_mpeg12_decoder(struct pipe_context *pipe, vl_create_mpeg12_decoder(struct pipe_context *pipe,
enum pipe_video_profile profile, const struct pipe_video_decoder *templat);
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height, unsigned max_references,
bool expect_chunked_decode);
#endif /* vl_mpeg12_decoder_h */ #endif /* vl_mpeg12_decoder_h */

View file

@ -37,14 +37,9 @@
static struct pipe_video_decoder * static struct pipe_video_decoder *
ilo_create_video_decoder(struct pipe_context *pipe, ilo_create_video_decoder(struct pipe_context *pipe,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height, unsigned max_references,
bool expect_chunked_decode)
{ {
return vl_create_decoder(pipe, profile, entrypoint, chroma_format, return vl_create_decoder(pipe, templ);
width, height, max_references, expect_chunked_decode);
} }
static struct pipe_video_buffer * static struct pipe_video_buffer *

View file

@ -499,26 +499,23 @@ nouveau_decoder_destroy(struct pipe_video_decoder *decoder)
static struct pipe_video_decoder * static struct pipe_video_decoder *
nouveau_create_decoder(struct pipe_context *context, nouveau_create_decoder(struct pipe_context *context,
struct nouveau_screen *screen, const struct pipe_video_decoder *templ,
enum pipe_video_profile profile, struct nouveau_screen *screen)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references, bool expect_chunked_decode)
{ {
struct nv04_fifo nv04_data = { .vram = 0xbeef0201, .gart = 0xbeef0202 }; struct nv04_fifo nv04_data = { .vram = 0xbeef0201, .gart = 0xbeef0202 };
unsigned width = templ->width, height = templ->height;
struct nouveau_object *mpeg = NULL; struct nouveau_object *mpeg = NULL;
struct nouveau_decoder *dec; struct nouveau_decoder *dec;
struct nouveau_pushbuf *push; struct nouveau_pushbuf *push;
int ret; int ret;
bool is8274 = screen->device->chipset > 0x80; bool is8274 = screen->device->chipset > 0x80;
debug_printf("Acceleration level: %s\n", entrypoint <= PIPE_VIDEO_ENTRYPOINT_BITSTREAM ? "bit": debug_printf("Acceleration level: %s\n", templ->entrypoint <= PIPE_VIDEO_ENTRYPOINT_BITSTREAM ? "bit":
entrypoint == PIPE_VIDEO_ENTRYPOINT_IDCT ? "IDCT" : "MC"); templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_IDCT ? "IDCT" : "MC");
if (getenv("XVMC_VL")) if (getenv("XVMC_VL"))
goto vl; goto vl;
if (u_reduce_video_profile(profile) != PIPE_VIDEO_CODEC_MPEG12) if (u_reduce_video_profile(templ->profile) != PIPE_VIDEO_CODEC_MPEG12)
goto vl; goto vl;
if (screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0) if (screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0)
goto vl; goto vl;
@ -560,13 +557,10 @@ nouveau_create_decoder(struct pipe_context *context,
} }
dec->mpeg = mpeg; dec->mpeg = mpeg;
dec->base = *templ;
dec->base.context = context; dec->base.context = context;
dec->base.profile = profile;
dec->base.entrypoint = entrypoint;
dec->base.chroma_format = chroma_format;
dec->base.width = width; dec->base.width = width;
dec->base.height = height; dec->base.height = height;
dec->base.max_references = max_references;
dec->base.destroy = nouveau_decoder_destroy; dec->base.destroy = nouveau_decoder_destroy;
dec->base.begin_frame = nouveau_decoder_begin_frame; dec->base.begin_frame = nouveau_decoder_begin_frame;
dec->base.decode_macroblock = nouveau_decoder_decode_macroblock; dec->base.decode_macroblock = nouveau_decoder_decode_macroblock;
@ -616,7 +610,7 @@ nouveau_create_decoder(struct pipe_context *context,
BEGIN_NV04(push, NV31_MPEG(FORMAT), 2); BEGIN_NV04(push, NV31_MPEG(FORMAT), 2);
PUSH_DATA (push, 0); PUSH_DATA (push, 0);
switch (entrypoint) { switch (templ->entrypoint) {
case PIPE_VIDEO_ENTRYPOINT_BITSTREAM: PUSH_DATA (push, 0x100); break; case PIPE_VIDEO_ENTRYPOINT_BITSTREAM: PUSH_DATA (push, 0x100); break;
case PIPE_VIDEO_ENTRYPOINT_IDCT: PUSH_DATA (push, 1); break; case PIPE_VIDEO_ENTRYPOINT_IDCT: PUSH_DATA (push, 1); break;
case PIPE_VIDEO_ENTRYPOINT_MC: PUSH_DATA (push, 0); break; case PIPE_VIDEO_ENTRYPOINT_MC: PUSH_DATA (push, 0); break;
@ -645,9 +639,7 @@ fail:
vl: vl:
debug_printf("Using g3dvl renderer\n"); debug_printf("Using g3dvl renderer\n");
return vl_create_decoder(context, profile, entrypoint, return vl_create_decoder(context, templ);
chroma_format, width, height,
max_references, expect_chunked_decode);
} }
static struct pipe_sampler_view ** static struct pipe_sampler_view **
@ -877,16 +869,10 @@ nouveau_screen_init_vdec(struct nouveau_screen *screen)
static struct pipe_video_decoder * static struct pipe_video_decoder *
nouveau_context_create_decoder(struct pipe_context *context, nouveau_context_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references, bool expect_chunked_decode)
{ {
struct nouveau_screen *screen = nouveau_context(context)->screen; struct nouveau_screen *screen = nouveau_context(context)->screen;
return nouveau_create_decoder(context, screen, profile, entrypoint, return nouveau_create_decoder(context, templ, screen);
chroma_format, width, height,
max_references, expect_chunked_decode);
} }
static struct pipe_video_buffer * static struct pipe_video_buffer *

View file

@ -292,12 +292,7 @@ void nv50_push_vbo(struct nv50_context *, const struct pipe_draw_info *);
/* nv84_video.c */ /* nv84_video.c */
struct pipe_video_decoder * struct pipe_video_decoder *
nv84_create_decoder(struct pipe_context *context, nv84_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ);
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references,
bool expect_chunked_decode);
struct pipe_video_buffer * struct pipe_video_buffer *
nv84_video_buffer_create(struct pipe_context *pipe, nv84_video_buffer_create(struct pipe_context *pipe,
@ -316,12 +311,7 @@ nv84_screen_video_supported(struct pipe_screen *screen,
/* nv98_video.c */ /* nv98_video.c */
struct pipe_video_decoder * struct pipe_video_decoder *
nv98_create_decoder(struct pipe_context *context, nv98_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ);
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references,
bool expect_chunked_decode);
struct pipe_video_buffer * struct pipe_video_buffer *
nv98_video_buffer_create(struct pipe_context *pipe, nv98_video_buffer_create(struct pipe_context *pipe,

View file

@ -263,12 +263,7 @@ nv84_decoder_destroy(struct pipe_video_decoder *decoder)
struct pipe_video_decoder * struct pipe_video_decoder *
nv84_create_decoder(struct pipe_context *context, nv84_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references,
bool chunked_decode)
{ {
struct nv50_context *nv50 = (struct nv50_context *)context; struct nv50_context *nv50 = (struct nv50_context *)context;
struct nouveau_screen *screen = &nv50->screen->base; struct nouveau_screen *screen = &nv50->screen->base;
@ -279,22 +274,20 @@ nv84_create_decoder(struct pipe_context *context,
union pipe_color_union color; union pipe_color_union color;
struct nv04_fifo nv04_data = { .vram = 0xbeef0201, .gart = 0xbeef0202 }; struct nv04_fifo nv04_data = { .vram = 0xbeef0201, .gart = 0xbeef0202 };
int ret, i; int ret, i;
int is_h264 = u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG4_AVC; int is_h264 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_CODEC_MPEG4_AVC;
int is_mpeg12 = u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG12; int is_mpeg12 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_CODEC_MPEG12;
if (getenv("XVMC_VL")) if (getenv("XVMC_VL"))
return vl_create_decoder(context, profile, entrypoint, return vl_create_decoder(context, templ);
chroma_format, width, height,
max_references, chunked_decode);
if ((is_h264 && entrypoint != PIPE_VIDEO_ENTRYPOINT_BITSTREAM) || if ((is_h264 && templ->entrypoint != PIPE_VIDEO_ENTRYPOINT_BITSTREAM) ||
(is_mpeg12 && entrypoint > PIPE_VIDEO_ENTRYPOINT_IDCT)) { (is_mpeg12 && templ->entrypoint > PIPE_VIDEO_ENTRYPOINT_IDCT)) {
debug_printf("%x\n", entrypoint); debug_printf("%x\n", templ->entrypoint);
return NULL; return NULL;
} }
if (!is_h264 && !is_mpeg12) { if (!is_h264 && !is_mpeg12) {
debug_printf("invalid profile: %x\n", profile); debug_printf("invalid profile: %x\n", templ->profile);
return NULL; return NULL;
} }
@ -302,13 +295,8 @@ nv84_create_decoder(struct pipe_context *context,
if (!dec) if (!dec)
return NULL; return NULL;
dec->base = *templ;
dec->base.context = context; dec->base.context = context;
dec->base.profile = profile;
dec->base.entrypoint = entrypoint;
dec->base.chroma_format = chroma_format;
dec->base.width = width;
dec->base.height = height;
dec->base.max_references = max_references;
dec->base.destroy = nv84_decoder_destroy; dec->base.destroy = nv84_decoder_destroy;
dec->base.flush = nv84_decoder_flush; dec->base.flush = nv84_decoder_flush;
if (is_h264) { if (is_h264) {
@ -326,7 +314,7 @@ nv84_create_decoder(struct pipe_context *context,
dec->base.begin_frame = nv84_decoder_begin_frame_mpeg12; dec->base.begin_frame = nv84_decoder_begin_frame_mpeg12;
dec->base.end_frame = nv84_decoder_end_frame_mpeg12; dec->base.end_frame = nv84_decoder_end_frame_mpeg12;
if (entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) { if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) {
dec->mpeg12_bs = CALLOC_STRUCT(vl_mpg12_bs); dec->mpeg12_bs = CALLOC_STRUCT(vl_mpg12_bs);
if (!dec->mpeg12_bs) if (!dec->mpeg12_bs)
goto fail; goto fail;
@ -409,7 +397,7 @@ nv84_create_decoder(struct pipe_context *context,
goto fail; goto fail;
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM | NOUVEAU_BO_NOSNOOP, ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM | NOUVEAU_BO_NOSNOOP,
0, 0,
(max_references + 1) * dec->frame_mbs * 0x40 + (templ->max_references + 1) * dec->frame_mbs * 0x40 +
dec->frame_size + 0x2000, dec->frame_size + 0x2000,
NULL, &dec->mbring); NULL, &dec->mbring);
if (ret) if (ret)
@ -433,8 +421,8 @@ nv84_create_decoder(struct pipe_context *context,
if (is_mpeg12) { if (is_mpeg12) {
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_GART, ret = nouveau_bo_new(screen->device, NOUVEAU_BO_GART,
0, 0,
align(0x20 * mb(width) * mb(height), 0x100) + align(0x20 * mb(templ->width) * mb(templ->height), 0x100) +
(6 * 64 * 8) * mb(width) * mb(height) + 0x100, (6 * 64 * 8) * mb(templ->width) * mb(templ->height) + 0x100,
NULL, &dec->mpeg12_bo); NULL, &dec->mpeg12_bo);
if (ret) if (ret)
goto fail; goto fail;
@ -485,7 +473,7 @@ nv84_create_decoder(struct pipe_context *context,
color.f[0] = color.f[1] = color.f[2] = color.f[3] = 0; color.f[0] = color.f[1] = color.f[2] = color.f[3] = 0;
surf.offset = dec->frame_size; surf.offset = dec->frame_size;
surf.width = 64; surf.width = 64;
surf.height = (max_references + 1) * dec->frame_mbs / 4; surf.height = (templ->max_references + 1) * dec->frame_mbs / 4;
surf.depth = 1; surf.depth = 1;
surf.base.format = PIPE_FORMAT_B8G8R8A8_UNORM; surf.base.format = PIPE_FORMAT_B8G8R8A8_UNORM;
surf.base.u.tex.level = 0; surf.base.u.tex.level = 0;

View file

@ -58,11 +58,7 @@ nv98_decoder_decode_bitstream(struct pipe_video_decoder *decoder,
struct pipe_video_decoder * struct pipe_video_decoder *
nv98_create_decoder(struct pipe_context *context, nv98_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height, unsigned max_references,
bool chunked_decode)
{ {
struct nouveau_screen *screen = &((struct nv50_context *)context)->screen->base; struct nouveau_screen *screen = &((struct nv50_context *)context)->screen->base;
struct nouveau_vp3_decoder *dec; struct nouveau_vp3_decoder *dec;
@ -79,12 +75,10 @@ nv98_create_decoder(struct pipe_context *context,
u32 tmp_size = 0; u32 tmp_size = 0;
if (getenv("XVMC_VL")) if (getenv("XVMC_VL"))
return vl_create_decoder(context, profile, entrypoint, return vl_create_decoder(context, templ);
chroma_format, width, height,
max_references, chunked_decode);
if (entrypoint != PIPE_VIDEO_ENTRYPOINT_BITSTREAM) { if (templ->entrypoint != PIPE_VIDEO_ENTRYPOINT_BITSTREAM) {
debug_printf("%x\n", entrypoint); debug_printf("%x\n", templ->entrypoint);
return NULL; return NULL;
} }
@ -142,13 +136,8 @@ nv98_create_decoder(struct pipe_context *context,
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
PUSH_DATA (push[2], nv04_data.vram); PUSH_DATA (push[2], nv04_data.vram);
dec->base = *templ;
dec->base.context = context; dec->base.context = context;
dec->base.profile = profile;
dec->base.entrypoint = entrypoint;
dec->base.chroma_format = chroma_format;
dec->base.width = width;
dec->base.height = height;
dec->base.max_references = max_references;
dec->base.decode_bitstream = nv98_decoder_decode_bitstream; dec->base.decode_bitstream = nv98_decoder_decode_bitstream;
for (i = 0; i < NOUVEAU_VP3_VIDEO_QDEPTH && !ret; ++i) for (i = 0; i < NOUVEAU_VP3_VIDEO_QDEPTH && !ret; ++i)
@ -162,29 +151,29 @@ nv98_create_decoder(struct pipe_context *context,
if (ret) if (ret)
goto fail; goto fail;
switch (u_reduce_video_profile(profile)) { switch (u_reduce_video_profile(templ->profile)) {
case PIPE_VIDEO_CODEC_MPEG12: { case PIPE_VIDEO_CODEC_MPEG12: {
codec = 1; codec = 1;
assert(max_references <= 2); assert(templ->max_references <= 2);
break; break;
} }
case PIPE_VIDEO_CODEC_MPEG4: { case PIPE_VIDEO_CODEC_MPEG4: {
codec = 4; codec = 4;
tmp_size = mb(height)*16 * mb(width)*16; tmp_size = mb(templ->height)*16 * mb(templ->width)*16;
assert(max_references <= 2); assert(templ->max_references <= 2);
break; break;
} }
case PIPE_VIDEO_CODEC_VC1: { case PIPE_VIDEO_CODEC_VC1: {
ppp_codec = codec = 2; ppp_codec = codec = 2;
tmp_size = mb(height)*16 * mb(width)*16; tmp_size = mb(templ->height)*16 * mb(templ->width)*16;
assert(max_references <= 2); assert(templ->max_references <= 2);
break; break;
} }
case PIPE_VIDEO_CODEC_MPEG4_AVC: { case PIPE_VIDEO_CODEC_MPEG4_AVC: {
codec = 3; codec = 3;
dec->tmp_stride = 16 * mb_half(width) * nouveau_vp3_video_align(height) * 3 / 2; dec->tmp_stride = 16 * mb_half(templ->width) * nouveau_vp3_video_align(templ->height) * 3 / 2;
tmp_size = dec->tmp_stride * (max_references + 1); tmp_size = dec->tmp_stride * (templ->max_references + 1);
assert(max_references <= 16); assert(templ->max_references <= 16);
break; break;
} }
default: default:
@ -197,7 +186,7 @@ nv98_create_decoder(struct pipe_context *context,
if (ret) if (ret)
goto fail; goto fail;
ret = nouveau_vp3_load_firmware(dec, profile, screen->device->chipset); ret = nouveau_vp3_load_firmware(dec, templ->profile, screen->device->chipset);
if (ret) if (ret)
goto fw_fail; goto fw_fail;
@ -208,9 +197,9 @@ nv98_create_decoder(struct pipe_context *context,
goto fail; goto fail;
} }
dec->ref_stride = mb(width)*16 * (mb_half(height)*32 + nouveau_vp3_video_align(height)/2); dec->ref_stride = mb(templ->width)*16 * (mb_half(templ->height)*32 + nouveau_vp3_video_align(templ->height)/2);
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM, 0, ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM, 0,
dec->ref_stride * (max_references+2) + tmp_size, dec->ref_stride * (templ->max_references+2) + tmp_size,
&cfg, &dec->ref_bo); &cfg, &dec->ref_bo);
if (ret) if (ret)
goto fail; goto fail;

View file

@ -335,12 +335,7 @@ void nvc0_idxbuf_validate(struct nvc0_context *);
/* nvc0_video.c */ /* nvc0_video.c */
struct pipe_video_decoder * struct pipe_video_decoder *
nvc0_create_decoder(struct pipe_context *context, nvc0_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ);
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references,
bool expect_chunked_decode);
struct pipe_video_buffer * struct pipe_video_buffer *
nvc0_video_buffer_create(struct pipe_context *pipe, nvc0_video_buffer_create(struct pipe_context *pipe,

View file

@ -58,11 +58,7 @@ nvc0_decoder_decode_bitstream(struct pipe_video_decoder *decoder,
struct pipe_video_decoder * struct pipe_video_decoder *
nvc0_create_decoder(struct pipe_context *context, nvc0_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height, unsigned max_references,
bool chunked_decode)
{ {
struct nouveau_screen *screen = &((struct nvc0_context *)context)->screen->base; struct nouveau_screen *screen = &((struct nvc0_context *)context)->screen->base;
struct nouveau_vp3_decoder *dec; struct nouveau_vp3_decoder *dec;
@ -79,12 +75,10 @@ nvc0_create_decoder(struct pipe_context *context,
u32 tmp_size = 0; u32 tmp_size = 0;
if (getenv("XVMC_VL")) if (getenv("XVMC_VL"))
return vl_create_decoder(context, profile, entrypoint, return vl_create_decoder(context, templ);
chroma_format, width, height,
max_references, chunked_decode);
if (entrypoint != PIPE_VIDEO_ENTRYPOINT_BITSTREAM) { if (templ->entrypoint != PIPE_VIDEO_ENTRYPOINT_BITSTREAM) {
debug_printf("%x\n", entrypoint); debug_printf("%x\n", templ->entrypoint);
return NULL; return NULL;
} }
@ -168,13 +162,8 @@ nvc0_create_decoder(struct pipe_context *context,
BEGIN_NVC0(push[2], SUBC_PPP(NV01_SUBCHAN_OBJECT), 1); BEGIN_NVC0(push[2], SUBC_PPP(NV01_SUBCHAN_OBJECT), 1);
PUSH_DATA (push[2], dec->ppp->handle); PUSH_DATA (push[2], dec->ppp->handle);
dec->base = *templ;
dec->base.context = context; dec->base.context = context;
dec->base.profile = profile;
dec->base.entrypoint = entrypoint;
dec->base.chroma_format = chroma_format;
dec->base.width = width;
dec->base.height = height;
dec->base.max_references = max_references;
dec->base.decode_bitstream = nvc0_decoder_decode_bitstream; dec->base.decode_bitstream = nvc0_decoder_decode_bitstream;
for (i = 0; i < NOUVEAU_VP3_VIDEO_QDEPTH && !ret; ++i) for (i = 0; i < NOUVEAU_VP3_VIDEO_QDEPTH && !ret; ++i)
@ -194,29 +183,29 @@ nvc0_create_decoder(struct pipe_context *context,
if (ret) if (ret)
goto fail; goto fail;
switch (u_reduce_video_profile(profile)) { switch (u_reduce_video_profile(templ->profile)) {
case PIPE_VIDEO_CODEC_MPEG12: { case PIPE_VIDEO_CODEC_MPEG12: {
codec = 1; codec = 1;
assert(max_references <= 2); assert(templ->max_references <= 2);
break; break;
} }
case PIPE_VIDEO_CODEC_MPEG4: { case PIPE_VIDEO_CODEC_MPEG4: {
codec = 4; codec = 4;
tmp_size = mb(height)*16 * mb(width)*16; tmp_size = mb(templ->height)*16 * mb(templ->width)*16;
assert(max_references <= 2); assert(templ->max_references <= 2);
break; break;
} }
case PIPE_VIDEO_CODEC_VC1: { case PIPE_VIDEO_CODEC_VC1: {
ppp_codec = codec = 2; ppp_codec = codec = 2;
tmp_size = mb(height)*16 * mb(width)*16; tmp_size = mb(templ->height)*16 * mb(templ->width)*16;
assert(max_references <= 2); assert(templ->max_references <= 2);
break; break;
} }
case PIPE_VIDEO_CODEC_MPEG4_AVC: { case PIPE_VIDEO_CODEC_MPEG4_AVC: {
codec = 3; codec = 3;
dec->tmp_stride = 16 * mb_half(width) * nouveau_vp3_video_align(height) * 3 / 2; dec->tmp_stride = 16 * mb_half(templ->width) * nouveau_vp3_video_align(templ->height) * 3 / 2;
tmp_size = dec->tmp_stride * (max_references + 1); tmp_size = dec->tmp_stride * (templ->max_references + 1);
assert(max_references <= 16); assert(templ->max_references <= 16);
break; break;
} }
default: default:
@ -230,7 +219,7 @@ nvc0_create_decoder(struct pipe_context *context,
if (ret) if (ret)
goto fail; goto fail;
ret = nouveau_vp3_load_firmware(dec, profile, screen->device->chipset); ret = nouveau_vp3_load_firmware(dec, templ->profile, screen->device->chipset);
if (ret) if (ret)
goto fw_fail; goto fw_fail;
} }
@ -242,9 +231,9 @@ nvc0_create_decoder(struct pipe_context *context,
goto fail; goto fail;
} }
dec->ref_stride = mb(width)*16 * (mb_half(height)*32 + nouveau_vp3_video_align(height)/2); dec->ref_stride = mb(templ->width)*16 * (mb_half(templ->height)*32 + nouveau_vp3_video_align(templ->height)/2);
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM, 0, ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM, 0,
dec->ref_stride * (max_references+2) + tmp_size, dec->ref_stride * (templ->max_references+2) + tmp_size,
&cfg, &dec->ref_bo); &cfg, &dec->ref_bo);
if (ret) if (ret)
goto fail; goto fail;

View file

@ -891,11 +891,7 @@ bool sampler_state_needs_border_color(const struct pipe_sampler_state *state);
/* r600_uvd.c */ /* r600_uvd.c */
struct pipe_video_decoder *r600_uvd_create_decoder(struct pipe_context *context, struct pipe_video_decoder *r600_uvd_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *decoder);
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references, bool expect_chunked_decode);
struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe, struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
const struct pipe_video_buffer *tmpl); const struct pipe_video_buffer *tmpl);

View file

@ -165,17 +165,11 @@ static struct radeon_winsys_cs_handle* r600_uvd_set_dtb(struct ruvd_msg *msg, st
/* create decoder */ /* create decoder */
struct pipe_video_decoder *r600_uvd_create_decoder(struct pipe_context *context, struct pipe_video_decoder *r600_uvd_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templat)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references, bool expect_chunked_decode)
{ {
struct r600_context *ctx = (struct r600_context *)context; struct r600_context *ctx = (struct r600_context *)context;
return ruvd_create_decoder(context, profile, entrypoint, chroma_format, return ruvd_create_decoder(context, templat, ctx->ws, r600_uvd_set_dtb);
width, height, max_references, expect_chunked_decode,
ctx->ws, r600_uvd_set_dtb);
} }
int r600_uvd_get_video_param(struct pipe_screen *screen, int r600_uvd_get_video_param(struct pipe_screen *screen,

View file

@ -262,18 +262,16 @@ static uint32_t profile2stream_type(enum pipe_video_profile profile)
} }
/* calculate size of reference picture buffer */ /* calculate size of reference picture buffer */
static unsigned calc_dpb_size(enum pipe_video_profile profile, static unsigned calc_dpb_size(const struct pipe_video_decoder *templ)
unsigned width, unsigned height,
unsigned max_references)
{ {
unsigned width_in_mb, height_in_mb, image_size, dpb_size; unsigned width_in_mb, height_in_mb, image_size, dpb_size;
// always align them to MB size for dpb calculation // always align them to MB size for dpb calculation
width = align(width, VL_MACROBLOCK_WIDTH); unsigned width = align(templ->width, VL_MACROBLOCK_WIDTH);
height = align(height, VL_MACROBLOCK_HEIGHT); unsigned height = align(templ->height, VL_MACROBLOCK_HEIGHT);
// always one more for currently decoded picture // always one more for currently decoded picture
max_references += 1; unsigned max_references = templ->max_references + 1;
// aligned size of a single frame // aligned size of a single frame
image_size = width * height; image_size = width * height;
@ -284,7 +282,7 @@ static unsigned calc_dpb_size(enum pipe_video_profile profile,
width_in_mb = width / VL_MACROBLOCK_WIDTH; width_in_mb = width / VL_MACROBLOCK_WIDTH;
height_in_mb = align(height / VL_MACROBLOCK_HEIGHT, 2); height_in_mb = align(height / VL_MACROBLOCK_HEIGHT, 2);
switch (u_reduce_video_profile(profile)) { switch (u_reduce_video_profile(templ->profile)) {
case PIPE_VIDEO_CODEC_MPEG4_AVC: case PIPE_VIDEO_CODEC_MPEG4_AVC:
// the firmware seems to allways assume a minimum of ref frames // the firmware seems to allways assume a minimum of ref frames
max_references = MAX2(NUM_H264_REFS, max_references); max_references = MAX2(NUM_H264_REFS, max_references);
@ -819,15 +817,12 @@ static void ruvd_flush(struct pipe_video_decoder *decoder)
* create and UVD decoder * create and UVD decoder
*/ */
struct pipe_video_decoder *ruvd_create_decoder(struct pipe_context *context, struct pipe_video_decoder *ruvd_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ,
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references, bool expect_chunked_decode,
struct radeon_winsys* ws, struct radeon_winsys* ws,
ruvd_set_dtb set_dtb) ruvd_set_dtb set_dtb)
{ {
unsigned dpb_size = calc_dpb_size(profile, width, height, max_references); unsigned dpb_size = calc_dpb_size(templ);
unsigned width = templ->width, height = templ->height;
struct radeon_info info; struct radeon_info info;
struct ruvd_decoder *dec; struct ruvd_decoder *dec;
struct ruvd_msg msg; struct ruvd_msg msg;
@ -835,12 +830,10 @@ struct pipe_video_decoder *ruvd_create_decoder(struct pipe_context *context,
ws->query_info(ws, &info); ws->query_info(ws, &info);
switch(u_reduce_video_profile(profile)) { switch(u_reduce_video_profile(templ->profile)) {
case PIPE_VIDEO_CODEC_MPEG12: case PIPE_VIDEO_CODEC_MPEG12:
if (entrypoint > PIPE_VIDEO_ENTRYPOINT_BITSTREAM || info.family < CHIP_PALM) if (templ->entrypoint > PIPE_VIDEO_ENTRYPOINT_BITSTREAM || info.family < CHIP_PALM)
return vl_create_mpeg12_decoder(context, profile, entrypoint, return vl_create_mpeg12_decoder(context, templ);
chroma_format, width,
height, max_references, expect_chunked_decode);
/* fall through */ /* fall through */
case PIPE_VIDEO_CODEC_MPEG4: case PIPE_VIDEO_CODEC_MPEG4:
@ -859,12 +852,8 @@ struct pipe_video_decoder *ruvd_create_decoder(struct pipe_context *context,
if (!dec) if (!dec)
return NULL; return NULL;
dec->base = *templ;
dec->base.context = context; dec->base.context = context;
dec->base.profile = profile;
dec->base.entrypoint = entrypoint;
dec->base.chroma_format = chroma_format;
dec->base.width = width;
dec->base.height = height;
dec->base.destroy = ruvd_destroy; dec->base.destroy = ruvd_destroy;
dec->base.begin_frame = ruvd_begin_frame; dec->base.begin_frame = ruvd_begin_frame;

View file

@ -346,11 +346,7 @@ typedef struct radeon_winsys_cs_handle* (*ruvd_set_dtb)
/* create an UVD decode */ /* create an UVD decode */
struct pipe_video_decoder *ruvd_create_decoder(struct pipe_context *context, struct pipe_video_decoder *ruvd_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templat,
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references, bool expect_chunked_decode,
struct radeon_winsys* ws, struct radeon_winsys* ws,
ruvd_set_dtb set_dtb); ruvd_set_dtb set_dtb);

View file

@ -278,11 +278,7 @@ void si_init_compute_functions(struct r600_context *rctx);
/* radeonsi_uvd.c */ /* radeonsi_uvd.c */
struct pipe_video_decoder *radeonsi_uvd_create_decoder(struct pipe_context *context, struct pipe_video_decoder *radeonsi_uvd_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ);
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references, bool expect_chunked_decode);
struct pipe_video_buffer *radeonsi_video_buffer_create(struct pipe_context *pipe, struct pipe_video_buffer *radeonsi_video_buffer_create(struct pipe_context *pipe,
const struct pipe_video_buffer *tmpl); const struct pipe_video_buffer *tmpl);

View file

@ -147,15 +147,9 @@ static struct radeon_winsys_cs_handle* radeonsi_uvd_set_dtb(struct ruvd_msg *msg
* creates an UVD compatible decoder * creates an UVD compatible decoder
*/ */
struct pipe_video_decoder *radeonsi_uvd_create_decoder(struct pipe_context *context, struct pipe_video_decoder *radeonsi_uvd_create_decoder(struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templ)
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height,
unsigned max_references, bool expect_chunked_decode)
{ {
struct r600_context *ctx = (struct r600_context *)context; struct r600_context *ctx = (struct r600_context *)context;
return ruvd_create_decoder(context, profile, entrypoint, chroma_format, return ruvd_create_decoder(context, templ, ctx->ws, radeonsi_uvd_set_dtb);
width, height, max_references, expect_chunked_decode,
ctx->ws, radeonsi_uvd_set_dtb);
} }

View file

@ -433,11 +433,7 @@ struct pipe_context {
* Creates a video decoder for a specific video codec/profile * Creates a video decoder for a specific video codec/profile
*/ */
struct pipe_video_decoder *(*create_video_decoder)( struct pipe_context *context, struct pipe_video_decoder *(*create_video_decoder)( struct pipe_context *context,
enum pipe_video_profile profile, const struct pipe_video_decoder *templat );
enum pipe_video_entrypoint entrypoint,
enum pipe_video_chroma_format chroma_format,
unsigned width, unsigned height, unsigned max_references,
bool expect_chunked_decode);
/** /**
* Creates a video buffer as decoding target * Creates a video buffer as decoding target

View file

@ -53,6 +53,7 @@ struct pipe_video_decoder
unsigned width; unsigned width;
unsigned height; unsigned height;
unsigned max_references; unsigned max_references;
bool expect_chunked_decode;
/** /**
* destroy this video decoder * destroy this video decoder

View file

@ -44,7 +44,7 @@ vlVdpDecoderCreate(VdpDevice device,
uint32_t max_references, uint32_t max_references,
VdpDecoder *decoder) VdpDecoder *decoder)
{ {
enum pipe_video_profile p_profile; struct pipe_video_decoder templat = {};
struct pipe_context *pipe; struct pipe_context *pipe;
struct pipe_screen *screen; struct pipe_screen *screen;
vlVdpDevice *dev; vlVdpDevice *dev;
@ -59,8 +59,8 @@ vlVdpDecoderCreate(VdpDevice device,
if (!(width && height)) if (!(width && height))
return VDP_STATUS_INVALID_VALUE; return VDP_STATUS_INVALID_VALUE;
p_profile = ProfileToPipe(profile); templat.profile = ProfileToPipe(profile);
if (p_profile == PIPE_VIDEO_PROFILE_UNKNOWN) if (templat.profile == PIPE_VIDEO_PROFILE_UNKNOWN)
return VDP_STATUS_INVALID_DECODER_PROFILE; return VDP_STATUS_INVALID_DECODER_PROFILE;
dev = vlGetDataHTAB(device); dev = vlGetDataHTAB(device);
@ -75,7 +75,7 @@ vlVdpDecoderCreate(VdpDevice device,
supported = screen->get_video_param supported = screen->get_video_param
( (
screen, screen,
p_profile, templat.profile,
PIPE_VIDEO_CAP_SUPPORTED PIPE_VIDEO_CAP_SUPPORTED
); );
if (!supported) { if (!supported) {
@ -91,14 +91,13 @@ vlVdpDecoderCreate(VdpDevice device,
vldecoder->device = dev; vldecoder->device = dev;
vldecoder->decoder = pipe->create_video_decoder templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
( templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
pipe, p_profile, templat.width = width;
PIPE_VIDEO_ENTRYPOINT_BITSTREAM, templat.height = height;
PIPE_VIDEO_CHROMA_FORMAT_420, templat.max_references = max_references;
width, height, max_references,
false vldecoder->decoder = pipe->create_video_decoder(pipe, &templat);
);
if (!vldecoder->decoder) { if (!vldecoder->decoder) {
ret = VDP_STATUS_ERROR; ret = VDP_STATUS_ERROR;

View file

@ -191,6 +191,7 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id,
Status ret; Status ret;
struct vl_screen *vscreen; struct vl_screen *vscreen;
struct pipe_context *pipe; struct pipe_context *pipe;
struct pipe_video_decoder templat = {};
XvMCContextPrivate *context_priv; XvMCContextPrivate *context_priv;
vl_csc_matrix csc; vl_csc_matrix csc;
@ -244,14 +245,15 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id,
return BadAlloc; return BadAlloc;
} }
context_priv->decoder = pipe->create_video_decoder templat.profile = ProfileToPipe(mc_type);
( templat.entrypoint = (mc_type & XVMC_IDCT) ? PIPE_VIDEO_ENTRYPOINT_IDCT : PIPE_VIDEO_ENTRYPOINT_MC;
pipe, ProfileToPipe(mc_type), templat.chroma_format = FormatToPipe(chroma_format);
(mc_type & XVMC_IDCT) ? PIPE_VIDEO_ENTRYPOINT_IDCT : PIPE_VIDEO_ENTRYPOINT_MC, templat.width = width;
FormatToPipe(chroma_format), templat.height = height;
width, height, 2, templat.max_references = 2;
true templat.expect_chunked_decode = true;
);
context_priv->decoder = pipe->create_video_decoder(pipe, &templat);
if (!context_priv->decoder) { if (!context_priv->decoder) {
XVMC_MSG(XVMC_ERR, "[XvMC] Could not create VL decoder.\n"); XVMC_MSG(XVMC_ERR, "[XvMC] Could not create VL decoder.\n");