nouveau/video: avoid overwriting base codec init with template
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 24 Aug 2013 04:50:52 +0000 (00:50 -0400)
committerChristian König <christian.koenig@amd.com>
Sun, 25 Aug 2013 08:14:30 +0000 (10:14 +0200)
Commit 53e20b8b introduced the use of a template to initialize some
common fields. Move this copying of fields to before the common vp3
fields are initialized.

Reported-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/nv50/nv98_video.c
src/gallium/drivers/nvc0/nvc0_video.c

index 0fa3a626d9c4d7e307e22927a2667b7ae6fa9b9c..8a1304402db60ad10cd34b2e4b27d132101e2a4f 100644 (file)
@@ -86,6 +86,7 @@ nv98_create_decoder(struct pipe_context *context,
    if (!dec)
       return NULL;
    dec->client = screen->client;
+   dec->base = *templ;
    nouveau_vp3_decoder_init_common(&dec->base);
 
    dec->bsp_idx = 5;
@@ -136,7 +137,6 @@ nv98_create_decoder(struct pipe_context *context,
    for (i = 0; i < 5; i++)
       PUSH_DATA (push[2], nv04_data.vram);
 
-   dec->base = *templ;
    dec->base.context = context;
    dec->base.decode_bitstream = nv98_decoder_decode_bitstream;
 
index f3a301eeea8ff23ae4b1472f89a94862feed3c86..52a634a6014f678cd4afa28979876b5a5e95b8cb 100644 (file)
@@ -86,6 +86,7 @@ nvc0_create_decoder(struct pipe_context *context,
    if (!dec)
       return NULL;
    dec->client = screen->client;
+   dec->base = *templ;
    nouveau_vp3_decoder_init_common(&dec->base);
 
    if (!kepler) {
@@ -162,7 +163,6 @@ nvc0_create_decoder(struct pipe_context *context,
    BEGIN_NVC0(push[2], SUBC_PPP(NV01_SUBCHAN_OBJECT), 1);
    PUSH_DATA (push[2], dec->ppp->handle);
 
-   dec->base = *templ;
    dec->base.context = context;
    dec->base.decode_bitstream = nvc0_decoder_decode_bitstream;