Mesa (master): nouveau/video: avoid overwriting base codec init with template

Christian König deathsimple at kemper.freedesktop.org
Sun Aug 25 08:20:38 UTC 2013


Module: Mesa
Branch: master
Commit: 293fa4e5592896ff5f4992818e0c24a645369253
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=293fa4e5592896ff5f4992818e0c24a645369253

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sat Aug 24 00:50:52 2013 -0400

nouveau/video: avoid overwriting base codec init with template

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 at labri.fr>
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Christian König <christian.koenig at amd.com>

---

 src/gallium/drivers/nv50/nv98_video.c |    2 +-
 src/gallium/drivers/nvc0/nvc0_video.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv98_video.c b/src/gallium/drivers/nv50/nv98_video.c
index 0fa3a62..8a13044 100644
--- a/src/gallium/drivers/nv50/nv98_video.c
+++ b/src/gallium/drivers/nv50/nv98_video.c
@@ -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;
 
diff --git a/src/gallium/drivers/nvc0/nvc0_video.c b/src/gallium/drivers/nvc0/nvc0_video.c
index f3a301e..52a634a 100644
--- a/src/gallium/drivers/nvc0/nvc0_video.c
+++ b/src/gallium/drivers/nvc0/nvc0_video.c
@@ -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;
 




More information about the mesa-commit mailing list